iface-modem-voice: allow creating incoming calls in waiting state
This commit is contained in:
@@ -84,10 +84,13 @@ mm_call_list_get_paths (MMCallList *self)
|
|||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
MMBaseCall *
|
MMBaseCall *
|
||||||
mm_call_list_get_first_ringing_in_call (MMCallList *self)
|
mm_call_list_get_first_incoming_call (MMCallList *self,
|
||||||
|
MMCallState incoming_state)
|
||||||
{
|
{
|
||||||
GList *l;
|
GList *l;
|
||||||
|
|
||||||
|
g_assert (incoming_state == MM_CALL_STATE_RINGING_IN || incoming_state == MM_CALL_STATE_WAITING);
|
||||||
|
|
||||||
for (l = self->priv->list; l; l = g_list_next (l)) {
|
for (l = self->priv->list; l; l = g_list_next (l)) {
|
||||||
MMBaseCall *call;
|
MMBaseCall *call;
|
||||||
MMCallState state;
|
MMCallState state;
|
||||||
@@ -101,7 +104,7 @@ mm_call_list_get_first_ringing_in_call (MMCallList *self)
|
|||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
if (direction == MM_CALL_DIRECTION_INCOMING &&
|
if (direction == MM_CALL_DIRECTION_INCOMING &&
|
||||||
state == MM_CALL_STATE_RINGING_IN) {
|
state == incoming_state) {
|
||||||
return call;
|
return call;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -68,6 +68,7 @@ gboolean mm_call_list_delete_call (MMCallList *self,
|
|||||||
const gchar *call_path,
|
const gchar *call_path,
|
||||||
GError **error);
|
GError **error);
|
||||||
|
|
||||||
MMBaseCall *mm_call_list_get_first_ringing_in_call (MMCallList *self);
|
MMBaseCall *mm_call_list_get_first_incoming_call (MMCallList *self,
|
||||||
|
MMCallState incoming_state);
|
||||||
|
|
||||||
#endif /* MM_CALL_LIST_H */
|
#endif /* MM_CALL_LIST_H */
|
||||||
|
@@ -73,11 +73,14 @@ create_outgoing_call_from_properties (MMIfaceModemVoice *self,
|
|||||||
|
|
||||||
void
|
void
|
||||||
mm_iface_modem_voice_report_incoming_call (MMIfaceModemVoice *self,
|
mm_iface_modem_voice_report_incoming_call (MMIfaceModemVoice *self,
|
||||||
const gchar *number)
|
const gchar *number,
|
||||||
|
MMCallState state)
|
||||||
{
|
{
|
||||||
MMBaseCall *call = NULL;
|
MMBaseCall *call = NULL;
|
||||||
MMCallList *list = NULL;
|
MMCallList *list = NULL;
|
||||||
|
|
||||||
|
g_assert (state == MM_CALL_STATE_RINGING_IN || state == MM_CALL_STATE_WAITING);
|
||||||
|
|
||||||
g_object_get (MM_BASE_MODEM (self),
|
g_object_get (MM_BASE_MODEM (self),
|
||||||
MM_IFACE_MODEM_VOICE_CALL_LIST, &list,
|
MM_IFACE_MODEM_VOICE_CALL_LIST, &list,
|
||||||
NULL);
|
NULL);
|
||||||
@@ -87,7 +90,7 @@ mm_iface_modem_voice_report_incoming_call (MMIfaceModemVoice *self,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
call = mm_call_list_get_first_ringing_in_call (list);
|
call = mm_call_list_get_first_incoming_call (list, state);
|
||||||
|
|
||||||
/* If call exists already, refresh its validity and set number if it wasn't set */
|
/* If call exists already, refresh its validity and set number if it wasn't set */
|
||||||
if (call) {
|
if (call) {
|
||||||
@@ -101,8 +104,8 @@ mm_iface_modem_voice_report_incoming_call (MMIfaceModemVoice *self,
|
|||||||
mm_dbg ("Creating new incoming call...");
|
mm_dbg ("Creating new incoming call...");
|
||||||
call = create_incoming_call (self, number);
|
call = create_incoming_call (self, number);
|
||||||
|
|
||||||
/* Set the state as ringing in */
|
/* Set the state */
|
||||||
mm_base_call_change_state (call, MM_CALL_STATE_RINGING_IN, MM_CALL_STATE_REASON_INCOMING_NEW);
|
mm_base_call_change_state (call, state, MM_CALL_STATE_REASON_INCOMING_NEW);
|
||||||
|
|
||||||
/* Start its validity timeout */
|
/* Start its validity timeout */
|
||||||
mm_base_call_incoming_refresh (call);
|
mm_base_call_incoming_refresh (call);
|
||||||
|
@@ -120,6 +120,7 @@ void mm_iface_modem_voice_bind_simple_status (MMIfaceModemVoice *self,
|
|||||||
|
|
||||||
/* Incoming call management */
|
/* Incoming call management */
|
||||||
void mm_iface_modem_voice_report_incoming_call (MMIfaceModemVoice *self,
|
void mm_iface_modem_voice_report_incoming_call (MMIfaceModemVoice *self,
|
||||||
const gchar *number);
|
const gchar *number,
|
||||||
|
MMCallState state);
|
||||||
|
|
||||||
#endif /* MM_IFACE_MODEM_VOICE_H */
|
#endif /* MM_IFACE_MODEM_VOICE_H */
|
||||||
|
Reference in New Issue
Block a user