base-call: automatically terminate unanswered incoming calls

Try to automatically detect when the caller finishes the attempt to
establish the call.
This commit is contained in:
Aleksander Morgado
2018-06-14 15:36:06 +02:00
committed by Dan Williams
parent 0090124ec0
commit bd3b5aca01
7 changed files with 110 additions and 59 deletions

View File

@@ -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;