From bd3b5aca01a3d3102c607b7ca6fab310963ec77c Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Thu, 14 Jun 2018 15:36:06 +0200 Subject: base-call: automatically terminate unanswered incoming calls Try to automatically detect when the caller finishes the attempt to establish the call. --- src/mm-call-list.c | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) (limited to 'src/mm-call-list.c') diff --git a/src/mm-call-list.c b/src/mm-call-list.c index b1950e3a..91ccc8d0 100644 --- a/src/mm-call-list.c +++ b/src/mm-call-list.c @@ -84,36 +84,33 @@ mm_call_list_get_paths (MMCallList *self) /*****************************************************************************/ MMBaseCall * -mm_call_list_get_new_incoming (MMCallList *self) +mm_call_list_get_first_ringing_in_call (MMCallList *self) { - MMBaseCall *call = NULL; GList *l; for (l = self->priv->list; l; l = g_list_next (l)) { - + MMBaseCall *call; MMCallState state; - MMCallStateReason reason; - MMCallDirection direct; + MMCallDirection direction; - g_object_get (MM_BASE_CALL (l->data), - "state", &state, - "state-reason", &reason, - "direction", &direct, + call = MM_BASE_CALL (l->data); + + g_object_get (call, + "state", &state, + "direction", &direction, NULL); - if (direct == MM_CALL_DIRECTION_INCOMING && - state == MM_CALL_STATE_RINGING_IN && - reason == MM_CALL_STATE_REASON_INCOMING_NEW ) { - call = MM_BASE_CALL (l->data); - break; + if (direction == MM_CALL_DIRECTION_INCOMING && + state == MM_CALL_STATE_RINGING_IN) { + return call; } } - return call; + return NULL; } MMBaseCall * -mm_call_list_get_first_ringing_call (MMCallList *self) +mm_call_list_get_first_ringing_out_call (MMCallList *self) { MMBaseCall *call = NULL; GList *l; -- cgit v1.2.3-70-g09d2