[calls] call: Add API to query whether this call can do DTMF



commit c5636ab71ce4dfe22764dc15cac1687cba768bab
Author: Evangelos Ribeiro Tzaras <devrtz fortysixandtwo eu>
Date:   Fri Nov 12 09:51:04 2021 +0100

    call: Add API to query whether this call can do DTMF
    
    This allows enable or disable UI elements.

 src/calls-call.c | 13 +++++++++++++
 src/calls-call.h |  1 +
 2 files changed, 14 insertions(+)
---
diff --git a/src/calls-call.c b/src/calls-call.c
index 08163714..035710af 100644
--- a/src/calls-call.c
+++ b/src/calls-call.c
@@ -358,6 +358,19 @@ tone_key_is_valid (gchar key)
     ||  key == '#';
 }
 
+/**
+ * calls_call_can_dtmf:
+ * @self: a #CallsCall
+ *
+ * Returns: %TRUE if this call supports DTMF, %FALSE otherwise
+ */
+gboolean
+calls_call_can_dtmf (CallsCall *self)
+{
+  g_return_val_if_fail (CALLS_IS_CALL (self), FALSE);
+
+  return CALLS_CALL_GET_CLASS (self)->tone_start != calls_call_real_tone_start;
+}
 
 /**
  * calls_call_tone_start:
diff --git a/src/calls-call.h b/src/calls-call.h
index f3579f79..a9bb58bf 100644
--- a/src/calls-call.h
+++ b/src/calls-call.h
@@ -70,6 +70,7 @@ gboolean         calls_call_get_inbound    (CallsCall *self);
 const char      *calls_call_get_protocol   (CallsCall *self);
 void             calls_call_answer         (CallsCall *self);
 void             calls_call_hang_up        (CallsCall *self);
+gboolean         calls_call_can_dtmf       (CallsCall *self);
 void             calls_call_tone_start     (CallsCall *self,
                                             gchar      key);
 gboolean         calls_call_tone_stoppable (CallsCall *self);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]