summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2009-10-23 13:56:26 -0500
committerDenis Kenzior <denkenz@gmail.com>2009-10-23 13:56:26 -0500
commit0faa8b3c42533578b5b6ed4d3de0cb25ba24cb1d (patch)
treec81f8814586a19a360f55761031048da0a8532d9
parentfa10070bf9dbebe7716a82b502b846141956f07b (diff)
downloadofono-0faa8b3c42533578b5b6ed4d3de0cb25ba24cb1d.tar.bz2
Fix: Invalid call state transition
When an active and a waiting call exist, and the active is released the waiting call becomes incoming. This wasn't properly handled by the generic at driver.
-rw-r--r--drivers/atmodem/voicecall.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/atmodem/voicecall.c b/drivers/atmodem/voicecall.c
index c7b9ac7f..22a802fa 100644
--- a/drivers/atmodem/voicecall.c
+++ b/drivers/atmodem/voicecall.c
@@ -727,6 +727,11 @@ static void ring_notify(GAtResult *result, gpointer user_data)
dump_response("ring_notify", TRUE, result);
+ /* See comment in CRING */
+ if (g_slist_find_custom(vd->calls, GINT_TO_POINTER(5),
+ call_compare_by_status))
+ return;
+
/* RING can repeat, ignore if we already have an incoming call */
if (g_slist_find_custom(vd->calls, GINT_TO_POINTER(4),
call_compare_by_status))
@@ -755,6 +760,17 @@ static void cring_notify(GAtResult *result, gpointer user_data)
dump_response("cring_notify", TRUE, result);
+ /* Handle the following situation:
+ * Active Call + Waiting Call. Active Call is Released. The Waiting
+ * call becomes Incoming and RING/CRING indications are signaled.
+ * Sometimes these arrive before we managed to poll CLCC to find about
+ * the stage change. If this happens, simply ignore the RING/CRING
+ * when a waiting call exists (cannot have waiting + incoming in GSM)
+ */
+ if (g_slist_find_custom(vd->calls, GINT_TO_POINTER(5),
+ call_compare_by_status))
+ return;
+
/* CRING can repeat, ignore if we already have an incoming call */
if (g_slist_find_custom(vd->calls, GINT_TO_POINTER(4),
call_compare_by_status))