diff options
author | Gjermund Hodnebrog <gjermund.hodnebrog@stericsson.com> | 2011-04-18 13:47:16 +0200 |
---|---|---|
committer | Sverre Vegge <sverre.vegge@stericsson.com> | 2011-05-19 09:15:55 +0200 |
commit | 21e0a0a61b53fc98406e1fe5e6ffcd75d8397b50 (patch) | |
tree | a8d98e3d340514d0082c87d02d7159c59be50035 | |
parent | 1fcb1dcf8019ea01f4323897902ae50f337d6962 (diff) | |
download | u300-21e0a0a61b53fc98406e1fe5e6ffcd75d8397b50.tar.gz |
Callhandling: Filter out proprietary exit cause values
The ST-Ericsson modems supports proprietary exit cause values
in UR code *ECAV that Android does not understand. These must
be mapped to CALL_FAIL_ERROR_UNSPECIFIED (0xFFFF).
Signed-off-by: Sverre Vegge <sverre.vegge@stericsson.com>
-rw-r--r-- | u300-ril-callhandling.c | 41 |
1 files changed, 30 insertions, 11 deletions
diff --git a/u300-ril-callhandling.c b/u300-ril-callhandling.c index 6223104..c477915 100644 --- a/u300-ril-callhandling.c +++ b/u300-ril-callhandling.c @@ -318,6 +318,26 @@ void onECAVReceived(const char *s) goto error; /* + * The STE modems support these additional proprietary exit cause + * values: + * 150 - Radio path not available + * 151 - Access class barred + * 160 - Illegal command + * 161 - Collision + * 222 - Failure not off hook + * 255 - Empty cause + * + * Limit to the cause values standardized in 3GPP 24.008 Annex H since + * Android does not support the proprietary values listed above. + */ + if (lastCallFailCause > 127) { + LOGD("%s(): Proprietary exit cause %d returned by modem, " + "replacing with CALL_FAIL_ERROR_UNSPECIFIED", __func__, + lastCallFailCause); + lastCallFailCause = CALL_FAIL_ERROR_UNSPECIFIED; + } + + /* * If restricted state ril.h specifies that we should return * unspecified error. */ @@ -325,7 +345,7 @@ void onECAVReceived(const char *s) if (rState == RIL_RESTRICTED_STATE_CS_EMERGENCY || rState == RIL_RESTRICTED_STATE_CS_NORMAL || rState == RIL_RESTRICTED_STATE_CS_ALL) - s_lastCallFailCause = CALL_FAIL_ERROR_UNSPECIFIED; + lastCallFailCause = CALL_FAIL_ERROR_UNSPECIFIED; if (res == RELEASED) { /* @@ -352,24 +372,23 @@ void onECAVReceived(const char *s) * otherwise it will take up to 20 s until it is taken down by the * network. */ - s_lastCallFailCause = CALL_FAIL_BUSY; + lastCallFailCause = CALL_FAIL_BUSY; enqueueRILEvent(CMD_QUEUE_AUXILIARY, hangupCall, NULL, NULL); } + goto exit; -finally: +error: + LOGE("ECAV: Failed to parse %s.", s); + /* Reset lastCallFailCause */ + lastCallFailCause = CALL_FAIL_ERROR_UNSPECIFIED; + +exit: free(line); - s_lastCallFailCause = lastCallFailCause; + s_lastCallFailCause = lastCallFailCause; /* Update static variable */ /* Send the response even if we failed.. */ RIL_onUnsolicitedResponse(RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED, NULL, 0); - return; - -error: - LOGE("ECAV: Failed to parse %s.", s); - /* Reset lastCallFailCause */ - lastCallFailCause = CALL_FAIL_ERROR_UNSPECIFIED; - goto finally; } /** |