summaryrefslogtreecommitdiff
path: root/src/mm-iface-modem-voice.c
diff options
context:
space:
mode:
authorMarco Bascetta <marco.bascetta@sadel.it>2015-05-06 16:21:17 +0200
committerAleksander Morgado <aleksander@aleksander.es>2015-08-02 10:39:47 +0200
commit55ae2c7f2f5729346e28425f84a28b810b33efed (patch)
tree5dc339dcd771bce7b46c1070534dcc087d775e94 /src/mm-iface-modem-voice.c
parent5a281dbd34eaebef88299d60d014fa2e82eb6328 (diff)
downloadModemManager-55ae2c7f2f5729346e28425f84a28b810b33efed.tar.gz
huawei: handle voice call state changes
Diffstat (limited to 'src/mm-iface-modem-voice.c')
-rw-r--r--src/mm-iface-modem-voice.c62
1 files changed, 52 insertions, 10 deletions
diff --git a/src/mm-iface-modem-voice.c b/src/mm-iface-modem-voice.c
index 6b896dbde..36cb82f79 100644
--- a/src/mm-iface-modem-voice.c
+++ b/src/mm-iface-modem-voice.c
@@ -118,7 +118,7 @@ gboolean mm_iface_modem_voice_update_incoming_call_number (MMIfaceModemVoice *se
return updated;
}
-gboolean mm_iface_modem_voice_network_hangup (MMIfaceModemVoice *self)
+gboolean mm_iface_modem_voice_call_dialing_to_ringing(MMIfaceModemVoice *self)
{
gboolean updated = FALSE;
MMBaseCall *call = NULL;
@@ -130,19 +130,61 @@ gboolean mm_iface_modem_voice_network_hangup (MMIfaceModemVoice *self)
if( list ) {
- call = mm_call_list_get_first_non_terminated_call(list);
+ call = mm_call_list_get_first_outgoing_dialing_call(list);
if( call ) {
- //BASCETTA:TODO: Hang this call!
- g_object_set (call,
- "state", MM_CALL_STATE_TERMINATED,
- "state-reason", MM_CALL_STATE_REASON_TERMINATED,
- NULL);
- mm_gdbus_call_set_state(MM_GDBUS_CALL (call), MM_CALL_STATE_TERMINATED);
- mm_gdbus_call_set_state_reason(MM_GDBUS_CALL (call), MM_CALL_STATE_REASON_TERMINATED);
+ mm_base_call_change_state(call, MM_CALL_STATE_RINGING_OUT, MM_CALL_STATE_REASON_OUTGOING_STARTED);
+
updated = TRUE;
+ } else {
+ mm_dbg("[%s:%d] Incoming call does not exist yet", __func__, __LINE__);
+ }
+ }
- //BASCETTA:TODO: I have to signal state change...
+ return updated;
+}
+gboolean mm_iface_modem_voice_call_ringing_to_active(MMIfaceModemVoice *self)
+{
+ gboolean updated = FALSE;
+ MMBaseCall *call = NULL;
+ MMCallList *list = NULL;
+
+ g_object_get (MM_BASE_MODEM (self),
+ MM_IFACE_MODEM_VOICE_CALL_LIST, &list,
+ NULL);
+
+ if( list ) {
+
+ call = mm_call_list_get_first_ringing_call(list);
+ if( call ) {
+ mm_base_call_change_state(call, MM_CALL_STATE_ACTIVE, MM_CALL_STATE_REASON_ACCEPTED);
+
+ updated = TRUE;
+ } else {
+ mm_dbg("[%s:%d] Incoming call does not exist yet", __func__, __LINE__);
+ }
+ }
+
+ return updated;
+}
+
+gboolean mm_iface_modem_voice_network_hangup (MMIfaceModemVoice *self)
+{
+ gboolean updated = FALSE;
+ MMBaseCall *call = NULL;
+ MMCallList *list = NULL;
+
+ g_object_get (MM_BASE_MODEM (self),
+ MM_IFACE_MODEM_VOICE_CALL_LIST, &list,
+ NULL);
+
+ if( list ) {
+
+ call = mm_call_list_get_first_non_terminated_call(list);
+ if( call ) {
+ mm_base_call_change_state(call, MM_CALL_STATE_TERMINATED, MM_CALL_STATE_REASON_TERMINATED);
+
+ updated = TRUE;
} else {
mm_dbg("[%s:%d] Incoming call does not exist yet", __func__, __LINE__);
}