aboutsummaryrefslogtreecommitdiff
path: root/src/mm-iface-modem-voice.c
diff options
context:
space:
mode:
authorBob Ham <bob.ham@puri.sm>2020-02-03 15:31:30 +0000
committerBob Ham <bob.ham@puri.sm>2020-02-06 15:16:00 +0000
commitb5d4f045d888e94831b06624a15130c0b181219b (patch)
tree161f1ac35784fb7916f6a248534d1362d35f2a63 /src/mm-iface-modem-voice.c
parentbdd1874f172438453c80f6b1cfcbd7ebbc31f02b (diff)
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: <debug> 1 calls being established: call list polling required <debug> (ttyUSB1) device open count is 3 (open) <debug> (ttyUSB1): --> 'AT+CLCC<CR>' <debug> (ttyUSB1): <-- '<CR><LF>+CLCC: 1,1,0,1,0,"",128<CR><LF>+CLCC: 2,0,3,0,0,"07763578094",129<CR><LF><CR><LF>OK<CR><LF>' <debug> Reported 2 ongoing calls <debug> call at index 1: direction incoming, state active, number n/a <debug> call at index 2: direction outgoing, state ringing-out, number 07763578094 <info> Call state changed: dialing -> terminated (unknown) <warn> unexpected incoming call to number 'n/a' reported in call list: state active <warn> 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.
Diffstat (limited to 'src/mm-iface-modem-voice.c')
-rw-r--r--src/mm-iface-modem-voice.c15
1 files 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));