aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2018-07-03 15:00:14 +0200
committerDan Williams <dcbw@redhat.com>2018-10-16 17:09:21 +0000
commitb2d859e37084099295cb96725e7e9f03b81dc84f (patch)
tree0b7c1aef4406230f7807810c8c1ba2df53c8c98f
parent887376fe4467da7a18b8e008537493512adb9fcb (diff)
base-call: treat 'ringing-in' as an in-call state
So that we setup in-call events as soon as we get the incoming call ringing in. This allows us to have plugin-specific implementations e.g. reporting call termination when the remote caller hangs up.
-rw-r--r--src/mm-base-call.c1
-rw-r--r--src/mm-iface-modem-voice.c7
2 files changed, 4 insertions, 4 deletions
diff --git a/src/mm-base-call.c b/src/mm-base-call.c
index ae84afa6..c0fada6e 100644
--- a/src/mm-base-call.c
+++ b/src/mm-base-call.c
@@ -673,6 +673,7 @@ mm_base_call_get_path (MMBaseCall *self)
/* Define the states in which we want to handle in-call events */
#define MM_CALL_STATE_IS_IN_CALL(state) \
(state == MM_CALL_STATE_DIALING || \
+ state == MM_CALL_STATE_RINGING_IN || \
state == MM_CALL_STATE_RINGING_OUT || \
state == MM_CALL_STATE_ACTIVE)
diff --git a/src/mm-iface-modem-voice.c b/src/mm-iface-modem-voice.c
index 286e96d9..2ba9d5d3 100644
--- a/src/mm-iface-modem-voice.c
+++ b/src/mm-iface-modem-voice.c
@@ -97,10 +97,9 @@ mm_iface_modem_voice_incoming_call (MMIfaceModemVoice *self)
mm_dbg ("Creating new incoming call...");
call = create_incoming_call (self, NULL);
- g_object_set (call,
- "state", MM_CALL_STATE_RINGING_IN,
- "state-reason", MM_CALL_STATE_REASON_INCOMING_NEW,
- NULL);
+
+ /* Set the state as ringing in */
+ mm_base_call_change_state (call, MM_CALL_STATE_RINGING_IN, MM_CALL_STATE_REASON_INCOMING_NEW);
/* Start its validity timeout */
mm_base_call_incoming_refresh (call);