aboutsummaryrefslogtreecommitdiff
path: root/src/mm-iface-modem-voice.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2019-06-07 18:06:42 +0200
committerAleksander Morgado <aleksander@aleksander.es>2019-07-11 23:00:50 +0200
commitd9a7b403eeb12b22f9d63aae9c6956d735cdd97a (patch)
treef0fe1060c182fe3712f9dd5c6cdd98cd650719b8 /src/mm-iface-modem-voice.c
parentd3ef177f532101dfd8db8415ce57091154d5e97d (diff)
iface-modem-voice: allow creating incoming calls in waiting state
Diffstat (limited to 'src/mm-iface-modem-voice.c')
-rw-r--r--src/mm-iface-modem-voice.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/mm-iface-modem-voice.c b/src/mm-iface-modem-voice.c
index e2788994..8ddc5d2b 100644
--- a/src/mm-iface-modem-voice.c
+++ b/src/mm-iface-modem-voice.c
@@ -73,11 +73,14 @@ create_outgoing_call_from_properties (MMIfaceModemVoice *self,
void
mm_iface_modem_voice_report_incoming_call (MMIfaceModemVoice *self,
- const gchar *number)
+ const gchar *number,
+ MMCallState state)
{
MMBaseCall *call = NULL;
MMCallList *list = NULL;
+ g_assert (state == MM_CALL_STATE_RINGING_IN || state == MM_CALL_STATE_WAITING);
+
g_object_get (MM_BASE_MODEM (self),
MM_IFACE_MODEM_VOICE_CALL_LIST, &list,
NULL);
@@ -87,7 +90,7 @@ mm_iface_modem_voice_report_incoming_call (MMIfaceModemVoice *self,
return;
}
- call = mm_call_list_get_first_ringing_in_call (list);
+ call = mm_call_list_get_first_incoming_call (list, state);
/* If call exists already, refresh its validity and set number if it wasn't set */
if (call) {
@@ -101,8 +104,8 @@ mm_iface_modem_voice_report_incoming_call (MMIfaceModemVoice *self,
mm_dbg ("Creating new incoming call...");
call = create_incoming_call (self, number);
- /* Set the state as ringing in */
- mm_base_call_change_state (call, MM_CALL_STATE_RINGING_IN, MM_CALL_STATE_REASON_INCOMING_NEW);
+ /* Set the state */
+ mm_base_call_change_state (call, state, MM_CALL_STATE_REASON_INCOMING_NEW);
/* Start its validity timeout */
mm_base_call_incoming_refresh (call);