From b5d4f045d888e94831b06624a15130c0b181219b Mon Sep 17 00:00:00 2001 From: Bob Ham Date: Mon, 3 Feb 2020 15:31:30 +0000 Subject: [PATCH] iface-modem-voice: match calls in call list by number Outgoing calls which ring before the first +CLCC response cannot match on the direction/state and are terminated, at least on the BroadMobi BM818. For example: 1 calls being established: call list polling required (ttyUSB1) device open count is 3 (open) (ttyUSB1): --> 'AT+CLCC' (ttyUSB1): <-- '+CLCC: 1,1,0,1,0,"",128+CLCC: 2,0,3,0,0,"07763578094",129OK' Reported 2 ongoing calls call at index 1: direction incoming, state active, number n/a call at index 2: direction outgoing, state ringing-out, number 07763578094 Call state changed: dialing -> terminated (unknown) unexpected incoming call to number 'n/a' reported in call list: state active unexpected outgoing call to number '07763578094' reported in call list: state ringing-out To fix this, we match calls in a +CLCC call list by number as well. --- src/mm-iface-modem-voice.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/mm-iface-modem-voice.c b/src/mm-iface-modem-voice.c index 9f3b7ed5..494d0e2a 100644 --- a/src/mm-iface-modem-voice.c +++ b/src/mm-iface-modem-voice.c @@ -196,6 +196,7 @@ match_single_call_info (const MMCallInfo *call_info, const gchar *number; guint idx; gboolean match_direction_and_state = FALSE; + gboolean match_number = FALSE; gboolean match_index = FALSE; gboolean match_terminated = FALSE; @@ -217,6 +218,11 @@ match_single_call_info (const MMCallInfo *call_info, (!call_info->index || !idx || match_index)) match_direction_and_state = TRUE; + /* Match number */ + if (call_info->number && number && + g_strcmp0 (call_info->number, number) == 0) + match_number = TRUE; + /* Match special terminated event. * We cannot apply this match if the call is part of a multiparty * call, because we don't know which of the calls in the multiparty @@ -230,11 +236,16 @@ match_single_call_info (const MMCallInfo *call_info, match_terminated = TRUE; /* If no clear match, nothing to do */ - if (!match_index && !match_direction_and_state && !match_terminated) + if (!match_direction_and_state && + !match_number && + !match_index && + !match_terminated) return FALSE; - mm_dbg ("call info matched (matched direction/state %s, matched index %s, matched terminated %s) with call at '%s'", + mm_dbg ("call info matched (matched direction/state %s, matched number %s" + ", matched index %s, matched terminated %s) with call at '%s'", match_direction_and_state ? "yes" : "no", + match_number ? "yes" : "no", match_index ? "yes" : "no", match_terminated ? "yes" : "no", mm_base_call_get_path (call));