base-call: allow keeping ongoing call index for easy call matching

This commit is contained in:
Aleksander Morgado
2019-06-15 22:59:22 +02:00
parent a006ed0744
commit 3873fda83f
2 changed files with 26 additions and 0 deletions

View File

@@ -63,6 +63,9 @@ struct _MMBaseCallPrivate {
/* The port used for audio while call is ongoing, if known */
MMPort *audio_port;
/* Ongoing call index */
guint index;
};
/*****************************************************************************/
@@ -811,6 +814,24 @@ mm_base_call_get_state (MMBaseCall *self)
return (MMCallState) mm_gdbus_call_get_state (MM_GDBUS_CALL (self));
}
/*****************************************************************************/
/* Current call index, only applicable while the call is ongoing
* See 3GPP TS 22.030 [27], subclause 6.5.5.1.
*/
guint
mm_base_call_get_index (MMBaseCall *self)
{
return self->priv->index;
}
void
mm_base_call_set_index (MMBaseCall *self,
guint index)
{
self->priv->index = index;
}
/*****************************************************************************/
/* Define the states in which we want to handle in-call events */
@@ -872,6 +893,8 @@ mm_base_call_change_state (MMBaseCall *self,
(GAsyncReadyCallback) cleanup_audio_channel_ready,
NULL);
}
/* reset index */
self->priv->index = 0;
}
mm_gdbus_call_set_state (MM_GDBUS_CALL (self), new_state);