diff options
author | Marco Bascetta <marco.bascetta@sadel.it> | 2015-05-06 16:21:17 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2015-08-02 10:39:47 +0200 |
commit | 55ae2c7f2f5729346e28425f84a28b810b33efed (patch) | |
tree | 5dc339dcd771bce7b46c1070534dcc087d775e94 /src/mm-call-list.c | |
parent | 5a281dbd34eaebef88299d60d014fa2e82eb6328 (diff) |
huawei: handle voice call state changes
Diffstat (limited to 'src/mm-call-list.c')
-rw-r--r-- | src/mm-call-list.c | 54 |
1 files changed, 51 insertions, 3 deletions
diff --git a/src/mm-call-list.c b/src/mm-call-list.c index aa650058..c241a0be 100644 --- a/src/mm-call-list.c +++ b/src/mm-call-list.c @@ -114,7 +114,32 @@ MMBaseCall* mm_call_list_get_new_incoming(MMCallList *self) return call; } -MMBaseCall* mm_call_list_get_first_non_terminated_call(MMCallList *self) +MMBaseCall* mm_call_list_get_first_ringing_call(MMCallList *self) +{ + MMBaseCall *call = NULL; + GList *l; + guint i; + + for (i = 0, l = self->priv->list; l && !call; l = g_list_next (l)) { + + MMCallState state; + + g_object_get (MM_BASE_CALL (l->data), + "state" , &state, + NULL); + + if( state == MM_CALL_STATE_RINGING_IN || + state == MM_CALL_STATE_RINGING_OUT ) { + + call = MM_BASE_CALL (l->data); + break; + } + } + + return call; +} + +MMBaseCall* mm_call_list_get_first_outgoing_dialing_call(MMCallList *self) { MMBaseCall *call = NULL; GList *l; @@ -123,15 +148,38 @@ MMBaseCall* mm_call_list_get_first_non_terminated_call(MMCallList *self) for (i = 0, l = self->priv->list; l && !call; l = g_list_next (l)) { MMCallState state; - MMCallStateReason reason; MMCallDirection direct; g_object_get (MM_BASE_CALL (l->data), "state" , &state, - "state-reason", &reason, "direction" , &direct, NULL); + if( direct == MM_CALL_DIRECTION_OUTGOING && + state == MM_CALL_STATE_DIALING ) { + + call = MM_BASE_CALL (l->data); + break; + } + } + + return call; +} + +MMBaseCall* mm_call_list_get_first_non_terminated_call(MMCallList *self) +{ + MMBaseCall *call = NULL; + GList *l; + guint i; + + for (i = 0, l = self->priv->list; l && !call; l = g_list_next (l)) { + + MMCallState state; + + g_object_get (MM_BASE_CALL (l->data), + "state" , &state, + NULL); + if( state != MM_CALL_STATE_TERMINATED ) { call = MM_BASE_CALL (l->data); break; |