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.
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user