aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2019-06-16 16:15:02 +0200
committerAleksander Morgado <aleksander@aleksander.es>2019-07-11 23:01:08 +0200
commitb22f90c4c4f874b5bef0e0b7a45b8888328e6aa4 (patch)
treea53dfc6b785e5cada113dc0fdcd06b45e0ba865b /src
parent47dd9fffac61f0bb8c83e0c83232c6dc117fedca (diff)
broadband-modem: if +CLCC is supported, call supports detailed events
Diffstat (limited to 'src')
-rw-r--r--src/mm-base-call.c13
-rw-r--r--src/mm-base-call.h5
-rw-r--r--src/mm-broadband-modem.c40
3 files changed, 46 insertions, 12 deletions
diff --git a/src/mm-base-call.c b/src/mm-base-call.c
index 4b127457..293a3dd7 100644
--- a/src/mm-base-call.c
+++ b/src/mm-base-call.c
@@ -542,10 +542,7 @@ handle_hangup_ready (MMBaseCall *self,
if (!MM_BASE_CALL_GET_CLASS (self)->hangup_finish (self, res, &error))
g_dbus_method_invocation_take_error (ctx->invocation, error);
else {
- if (ctx->self->priv->incoming_timeout) {
- g_source_remove (ctx->self->priv->incoming_timeout);
- ctx->self->priv->incoming_timeout = 0;
- }
+ /* note: timeouts are already removed when setting state as TERMINATED */
mm_gdbus_call_complete_hangup (MM_GDBUS_CALL (ctx->self), ctx->invocation);
}
@@ -1121,12 +1118,18 @@ call_send_dtmf (MMBaseCall *self,
MMBaseCall *
mm_base_call_new (MMBaseModem *modem,
MMCallDirection direction,
- const gchar *number)
+ const gchar *number,
+ gboolean skip_incoming_timeout,
+ gboolean supports_dialing_to_ringing,
+ gboolean supports_ringing_to_active)
{
return MM_BASE_CALL (g_object_new (MM_TYPE_BASE_CALL,
MM_BASE_CALL_MODEM, modem,
"direction", direction,
"number", number,
+ MM_BASE_CALL_SKIP_INCOMING_TIMEOUT, skip_incoming_timeout,
+ MM_BASE_CALL_SUPPORTS_DIALING_TO_RINGING, supports_dialing_to_ringing,
+ MM_BASE_CALL_SUPPORTS_RINGING_TO_ACTIVE, supports_ringing_to_active,
NULL));
}
diff --git a/src/mm-base-call.h b/src/mm-base-call.h
index 7f02f39e..5dddb6bc 100644
--- a/src/mm-base-call.h
+++ b/src/mm-base-call.h
@@ -112,7 +112,10 @@ GType mm_base_call_get_type (void);
/* This one can be overriden by plugins */
MMBaseCall *mm_base_call_new (MMBaseModem *modem,
MMCallDirection direction,
- const gchar *number);
+ const gchar *number,
+ gboolean skip_incoming_timeout,
+ gboolean supports_dialing_to_ringing,
+ gboolean supports_ringing_to_active);
void mm_base_call_export (MMBaseCall *self);
void mm_base_call_unexport (MMBaseCall *self);
diff --git a/src/mm-broadband-modem.c b/src/mm-broadband-modem.c
index c1e2582f..aceeb5df 100644
--- a/src/mm-broadband-modem.c
+++ b/src/mm-broadband-modem.c
@@ -223,8 +223,9 @@ struct _MMBroadbandModemPrivate {
/*<--- Modem Voice interface --->*/
/* Properties */
- GObject *modem_voice_dbus_skeleton;
+ GObject *modem_voice_dbus_skeleton;
MMCallList *modem_voice_call_list;
+ gboolean clcc_supported;
/*<--- Modem Time interface --->*/
/* Properties */
@@ -7200,6 +7201,19 @@ modem_voice_check_support_finish (MMIfaceModemVoice *self,
}
static void
+clcc_format_check_ready (MMBroadbandModem *self,
+ GAsyncResult *res,
+ GTask *task)
+{
+ /* +CLCC supported unless we got any error response */
+ self->priv->clcc_supported = !!mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, NULL);
+
+ /* ATH command is supported; assume we have full voice capabilities */
+ g_task_return_boolean (task, TRUE);
+ g_object_unref (task);
+}
+
+static void
ath_format_check_ready (MMBroadbandModem *self,
GAsyncResult *res,
GTask *task)
@@ -7213,9 +7227,13 @@ ath_format_check_ready (MMBroadbandModem *self,
return;
}
- /* ATH command is supported; assume we have full voice capabilities */
- g_task_return_boolean (task, TRUE);
- g_object_unref (task);
+ /* Also check if +CLCC is supported */
+ mm_base_modem_at_command (MM_BASE_MODEM (self),
+ "+CLCC=?",
+ 3,
+ TRUE,
+ (GAsyncReadyCallback)clcc_format_check_ready,
+ task);
}
static void
@@ -7572,11 +7590,21 @@ modem_voice_disable_unsolicited_events (MMIfaceModemVoice *self,
/* Create CALL (Voice interface) */
static MMBaseCall *
-modem_voice_create_call (MMIfaceModemVoice *self,
+modem_voice_create_call (MMIfaceModemVoice *_self,
MMCallDirection direction,
const gchar *number)
{
- return mm_base_call_new (MM_BASE_MODEM (self), direction, number);
+ MMBroadbandModem *self = MM_BROADBAND_MODEM (_self);
+
+ return mm_base_call_new (MM_BASE_MODEM (self),
+ direction,
+ number,
+ /* If +CLCC is supported, we want no incoming timeout.
+ * Also, we're able to support detailed call state updates without
+ * additional vendor-specific commands. */
+ self->priv->clcc_supported, /* skip incoming timeout */
+ self->priv->clcc_supported, /* dialing->ringing supported */
+ self->priv->clcc_supported); /* ringing->active supported */
}
/*****************************************************************************/