diff options
author | Pekka Pessi <Pekka.Pessi@nokia.com> | 2011-04-12 17:33:29 +0300 |
---|---|---|
committer | Aki Niemi <aki.niemi@nokia.com> | 2011-04-12 20:39:19 +0300 |
commit | 60918dd3f2ad986777419db9d57278e8597a5b68 (patch) | |
tree | 59be3539ae82a599b3ff9a27bca069c712d783ad /drivers/isimodem | |
parent | c33853ecf36e1b5cd1d14f04e389fdb8296f9189 (diff) | |
download | ofono-60918dd3f2ad986777419db9d57278e8597a5b68.tar.bz2 |
isimodem: fix call_create_resp handling
In case of call creation failure modem may return a valid call id in
order to send CALL_SERVICE_DENIED_IND which we do not handle.
Fixes MeeGo bug#15855.
Diffstat (limited to 'drivers/isimodem')
-rw-r--r-- | drivers/isimodem/voicecall.c | 39 |
1 files changed, 33 insertions, 6 deletions
diff --git a/drivers/isimodem/voicecall.c b/drivers/isimodem/voicecall.c index be52c065..333f9b88 100644 --- a/drivers/isimodem/voicecall.c +++ b/drivers/isimodem/voicecall.c @@ -574,15 +574,42 @@ static void isi_call_create_resp(const GIsiMessage *msg, void *data) { struct isi_call_req_ctx *irc = data; uint8_t call_id; - - if (!check_response_status(msg, CALL_CREATE_RESP) || - !g_isi_msg_data_get_byte(msg, 0, &call_id) || - call_id == CALL_ID_NONE) { - isi_ctx_return_failure(irc); - return; + uint8_t subblocks; + + if (!check_response_status(msg, CALL_CREATE_RESP)) + goto failure; + + if (!g_isi_msg_data_get_byte(msg, 0, &call_id) || + call_id == CALL_ID_NONE) + goto failure; + + if (!g_isi_msg_data_get_byte(msg, 1, &subblocks)) + goto failure; + + if (subblocks != 0) { + GIsiSubBlockIter iter; + struct isi_call call = { 0 }; + + for (g_isi_sb_iter_init(&iter, msg, 2); + g_isi_sb_iter_is_valid(&iter); + g_isi_sb_iter_next(&iter)) { + + switch (g_isi_sb_iter_get_id(&iter)) { + case CALL_CAUSE: + isi_call_cause_sb_proc(NULL, &call, &iter); + DBG("CALL_CREATE_RESP " + "cause_type=0x%02x cause=0x%02x", + call.cause_type, call.cause); + goto failure; + } + } } isi_ctx_return_success(irc); + return; + +failure: + isi_ctx_return_failure(irc); } static struct isi_call_req_ctx *isi_modem_call_create_req( |