aboutsummaryrefslogtreecommitdiff
path: root/src/mm-call-qmi.c
diff options
context:
space:
mode:
authorDan Williams <dan@ioncontrol.co>2025-04-11 20:43:17 -0500
committerDan Williams <dan@ioncontrol.co>2025-05-30 07:59:58 -0500
commit5448a85a2bae32b6c9dfb82ac148904bf20fc209 (patch)
treed3dc01eb24ab04b592195ef335d43ca8ef4c08d0 /src/mm-call-qmi.c
parent28b195465422b63ccc77e1a8d9d21e8bb6f217e9 (diff)
call: allow setting DTMF tone duration at call creation time
Instead of hard-coding a 500ms DTMF tone duration, let applications use a specific duration at call setup time. Signed-off-by: Dan Williams <dan@ioncontrol.co>
Diffstat (limited to 'src/mm-call-qmi.c')
-rw-r--r--src/mm-call-qmi.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/mm-call-qmi.c b/src/mm-call-qmi.c
index 55bfa89a..1a9b2dd7 100644
--- a/src/mm-call-qmi.c
+++ b/src/mm-call-qmi.c
@@ -402,9 +402,12 @@ voice_start_continuous_dtmf_ready (QmiClientVoice *client,
GAsyncResult *res,
GTask *task)
{
+ MMCallQmi *self;
g_autoptr(QmiMessageVoiceStartContinuousDtmfOutput) output = NULL;
GError *error = NULL;
+ self = g_task_get_source_object (task);
+
output = qmi_client_voice_start_continuous_dtmf_finish (client, res, &error);
if (!output) {
g_prefix_error (&error, "QMI operation failed: ");
@@ -420,8 +423,10 @@ voice_start_continuous_dtmf_ready (QmiClientVoice *client,
return;
}
- /* Disable DTMF press after 500 ms */
- g_timeout_add (500, (GSourceFunc) voice_stop_continuous_dtmf, task);
+ /* Disable DTMF press after DTMF tone duration elapses */
+ g_timeout_add (mm_base_call_get_dtmf_tone_duration (MM_BASE_CALL (self)),
+ (GSourceFunc) voice_stop_continuous_dtmf,
+ task);
}
static void
@@ -489,15 +494,17 @@ call_send_dtmf (MMBaseCall *self,
MMBaseCall *
mm_call_qmi_new (MMBaseModem *modem,
MMCallDirection direction,
- const gchar *number)
+ const gchar *number,
+ const guint dtmf_tone_duration)
{
MMBaseCall *call;
call = MM_BASE_CALL (g_object_new (MM_TYPE_CALL_QMI,
- MM_BASE_CALL_IFACE_MODEM_VOICE, modem,
- MM_BIND_TO, modem,
- "direction", direction,
- "number", number,
+ MM_BASE_CALL_IFACE_MODEM_VOICE, modem,
+ MM_BIND_TO, modem,
+ MM_CALL_DIRECTION, direction,
+ MM_CALL_NUMBER, number,
+ MM_CALL_DTMF_TONE_DURATION, dtmf_tone_duration,
MM_BASE_CALL_SKIP_INCOMING_TIMEOUT, TRUE,
MM_BASE_CALL_SUPPORTS_DIALING_TO_RINGING, TRUE,
MM_BASE_CALL_SUPPORTS_RINGING_TO_ACTIVE, TRUE,