aboutsummaryrefslogtreecommitdiff
path: root/src/mm-call-list.c
diff options
context:
space:
mode:
authorMarco Bascetta <marco.bascetta@sadel.it>2015-05-05 18:00:09 +0200
committerAleksander Morgado <aleksander@aleksander.es>2015-08-02 10:39:13 +0200
commit6d85146bba3edceeaf9f23e0e7a5281fda527d59 (patch)
treee09cc3e936ec9fc60cd4bac01da72e3118999ae8 /src/mm-call-list.c
parentc53bc10092563eb361b4980afb00080009067661 (diff)
core: handle incoming calls (RING/CRING, CLIP, NO CARRIER).
Diffstat (limited to 'src/mm-call-list.c')
-rw-r--r--src/mm-call-list.c59
1 files changed, 59 insertions, 0 deletions
diff --git a/src/mm-call-list.c b/src/mm-call-list.c
index 76af785b..aa650058 100644
--- a/src/mm-call-list.c
+++ b/src/mm-call-list.c
@@ -84,6 +84,65 @@ mm_call_list_get_paths (MMCallList *self)
/*****************************************************************************/
+MMBaseCall* mm_call_list_get_new_incoming(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;
+ 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_INCOMING &&
+ state == MM_CALL_STATE_RINGING_IN &&
+ reason == MM_CALL_STATE_REASON_INCOMING_NEW ) {
+
+ 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;
+ MMCallStateReason reason;
+ MMCallDirection direct;
+
+ g_object_get (MM_BASE_CALL (l->data),
+ "state" , &state,
+ "state-reason", &reason,
+ "direction" , &direct,
+ NULL);
+
+ if( state != MM_CALL_STATE_TERMINATED ) {
+ call = MM_BASE_CALL (l->data);
+ break;
+ }
+ }
+
+ return call;
+}
+
+/*****************************************************************************/
+
typedef struct {
MMCallList *self;
GSimpleAsyncResult *result;