From 68df0eb758d6107c501743e5cdaa31ce93b30e05 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Sat, 24 Nov 2012 22:46:49 -0600 Subject: [PATCH] ifx: Fix the case of modem-originated call During STK Set Up Call, we have modem-originated calls that do not go through the core 'Dial' method. Make sure the calls are still detected in this case. --- drivers/ifxmodem/voicecall.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/drivers/ifxmodem/voicecall.c b/drivers/ifxmodem/voicecall.c index 5d4d207f..7c276422 100644 --- a/drivers/ifxmodem/voicecall.c +++ b/drivers/ifxmodem/voicecall.c @@ -169,11 +169,19 @@ static void xcallstat_notify(GAtResult *result, gpointer user_data) break; } case CALL_STATUS_DIALING: + new_call = create_call(vc, 0, CALL_DIRECTION_MOBILE_ORIGINATED, + status, NULL, 128, + CLIP_VALIDITY_NOT_AVAILABLE, id); + if (new_call == NULL) { + ofono_error("Unable to malloc. " + "Call management is fubar"); + return; + } + + ofono_voicecall_notify(vc, new_call); + break; case CALL_STATUS_WAITING: case CALL_STATUS_INCOMING: - { - int direction; - /* Handle the following situation: * Active Call + Waiting Call. Active Call is Released. * The Waiting call becomes Incoming. In this case, no @@ -185,13 +193,8 @@ static void xcallstat_notify(GAtResult *result, gpointer user_data) return; } - if (status == CALL_STATUS_DIALING) - direction = CALL_DIRECTION_MOBILE_ORIGINATED; - else - direction = CALL_DIRECTION_MOBILE_TERMINATED; - - new_call = create_call(vc, 0, direction, status, - NULL, 128, + new_call = create_call(vc, 0, CALL_DIRECTION_MOBILE_TERMINATED, + status, NULL, 128, CLIP_VALIDITY_NOT_AVAILABLE, id); if (new_call == NULL) { ofono_error("Unable to malloc. " @@ -199,9 +202,7 @@ static void xcallstat_notify(GAtResult *result, gpointer user_data) return; } - new_call->id = id; break; - } case CALL_STATUS_ALERTING: case CALL_STATUS_ACTIVE: case CALL_STATUS_HELD: