aboutsummaryrefslogtreecommitdiff
path: root/libmm-glib/mm-modem-voice.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2019-06-27 14:50:00 +0200
committerAleksander Morgado <aleksander@aleksander.es>2019-07-11 23:20:59 +0200
commit8b01958cb4f1060c9cda114228168be32090c639 (patch)
treeab38951c4df3304b7b645c3d10368d3ed44e02db /libmm-glib/mm-modem-voice.c
parent7ceac6f789e4ae65f1c38166f30a906751023aa6 (diff)
api,voice: new Transfer() method
This method will join all active and held calls into a single multiparty call, and then request the network to terminate the call on the subscriber's end and transfer the control of the call to the parties that are still in the call.
Diffstat (limited to 'libmm-glib/mm-modem-voice.c')
-rw-r--r--libmm-glib/mm-modem-voice.c79
1 files changed, 79 insertions, 0 deletions
diff --git a/libmm-glib/mm-modem-voice.c b/libmm-glib/mm-modem-voice.c
index bf3a5a6d..d01efb14 100644
--- a/libmm-glib/mm-modem-voice.c
+++ b/libmm-glib/mm-modem-voice.c
@@ -769,6 +769,85 @@ mm_modem_voice_hangup_all_sync (MMModemVoice *self,
/*****************************************************************************/
+/**
+ * mm_modem_voice_transfer_finish:
+ * @self: A #MMModemVoice.
+ * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to mm_modem_voice_transfer().
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes an operation started with mm_modem_voice_transfer().
+ *
+ * Returns: %TRUE if the operation was successful, %FALSE if @error is set.
+ * Since: 1.12
+ */
+gboolean
+mm_modem_voice_transfer_finish (MMModemVoice *self,
+ GAsyncResult *res,
+ GError **error)
+{
+ g_return_val_if_fail (MM_IS_MODEM_VOICE (self), FALSE);
+
+ return mm_gdbus_modem_voice_call_transfer_finish (MM_GDBUS_MODEM_VOICE (self), res, error);
+}
+
+/**
+ * mm_modem_voice_transfer:
+ * @self: A #MMModemVoice.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
+ * @user_data: User data to pass to @callback.
+ *
+ * Asynchronously joins all active and held calls, and disconnects from them.
+ *
+ * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
+ * You can then call mm_modem_voice_transfer_finish() to get the result of the operation.
+ *
+ * See mm_modem_voice_transfer_sync() for the synchronous, blocking version of this method.
+ *
+ * Since: 1.12
+ */
+void
+mm_modem_voice_transfer (MMModemVoice *self,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_return_if_fail (MM_IS_MODEM_VOICE (self));
+
+ mm_gdbus_modem_voice_call_transfer (MM_GDBUS_MODEM_VOICE (self),
+ cancellable,
+ callback,
+ user_data);
+}
+
+/**
+ * mm_modem_voice_transfer_sync:
+ * @self: A #MMModemVoice.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously joins all active and held calls, and disconnects from them.
+ *
+ * The calling thread is blocked until a reply is received. See mm_modem_voice_transfer()
+ * for the asynchronous version of this method.
+ *
+ * Returns: %TRUE if the operation was successful, %FALSE if @error is set.
+ * Since: 1.12
+ */
+gboolean
+mm_modem_voice_transfer_sync (MMModemVoice *self,
+ GCancellable *cancellable,
+ GError **error)
+{
+ g_return_val_if_fail (MM_IS_MODEM_VOICE (self), FALSE);
+
+ return mm_gdbus_modem_voice_call_transfer_sync (MM_GDBUS_MODEM_VOICE (self),
+ cancellable,
+ error);
+}
+
+/*****************************************************************************/
+
static void
mm_modem_voice_init (MMModemVoice *self)
{