1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 * Copyright (C) 2007 Elliot Fairweather
4 * Copyright (C) 2007-2008 Collabora Ltd.
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 * Authors: Elliot Fairweather <elliot.fairweather@collabora.co.uk>
21 * Xavier Claessens <xclaesse@gmail.com>
26 #include <telepathy-glib/proxy-subclass.h>
27 #include <telepathy-glib/dbus.h>
29 #include <extensions/extensions.h>
31 #include "empathy-tp-call.h"
32 #include "empathy-contact-factory.h"
33 #include "empathy-tp-group.h"
34 #include "empathy-utils.h"
36 #define DEBUG_FLAG EMPATHY_DEBUG_TP
37 #include "empathy-debug.h"
39 #define STREAM_ENGINE_BUS_NAME "org.freedesktop.Telepathy.StreamEngine"
40 #define STREAM_ENGINE_OBJECT_PATH "/org/freedesktop/Telepathy/StreamEngine"
42 #define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyTpCall)
46 TpProxy *stream_engine;
47 TpDBusDaemon *dbus_daemon;
48 EmpathyTpGroup *group;
49 EmpathyContact *contact;
52 gboolean stream_engine_running;
54 EmpathyTpCallStream *audio;
55 EmpathyTpCallStream *video;
69 G_DEFINE_TYPE (EmpathyTpCall, empathy_tp_call, G_TYPE_OBJECT)
72 tp_call_add_stream (EmpathyTpCall *call,
77 guint stream_direction)
79 EmpathyTpCallPriv *priv = GET_PRIV (call);
83 case TP_MEDIA_STREAM_TYPE_AUDIO:
84 DEBUG ("Audio stream - id: %d, state: %d, direction: %d",
85 stream_id, stream_state, stream_direction);
86 priv->audio->exists = TRUE;
87 priv->audio->id = stream_id;
88 priv->audio->state = stream_state;
89 priv->audio->direction = stream_direction;
90 g_object_notify (G_OBJECT (call), "audio-stream");
92 case TP_MEDIA_STREAM_TYPE_VIDEO:
93 DEBUG ("Video stream - id: %d, state: %d, direction: %d",
94 stream_id, stream_state, stream_direction);
95 priv->video->exists = TRUE;
96 priv->video->id = stream_id;
97 priv->video->state = stream_state;
98 priv->video->direction = stream_direction;
99 g_object_notify (G_OBJECT (call), "video-stream");
102 DEBUG ("Unknown stream type: %d", stream_type);
107 tp_call_stream_added_cb (TpChannel *channel,
109 guint contact_handle,
114 DEBUG ("Stream added - stream id: %d, contact handle: %d, stream type: %d",
115 stream_id, contact_handle, stream_type);
117 tp_call_add_stream (EMPATHY_TP_CALL (call), stream_id, contact_handle,
118 stream_type, TP_MEDIA_STREAM_STATE_DISCONNECTED,
119 TP_MEDIA_STREAM_DIRECTION_NONE);
123 tp_call_stream_removed_cb (TpChannel *channel,
128 EmpathyTpCallPriv *priv = GET_PRIV (call);
130 DEBUG ("Stream removed - stream id: %d", stream_id);
132 if (stream_id == priv->audio->id)
134 priv->audio->exists = FALSE;
135 g_object_notify (call, "audio-stream");
137 else if (stream_id == priv->video->id)
139 priv->video->exists = FALSE;
140 g_object_notify (call, "video-stream");
145 tp_call_stream_state_changed_cb (TpChannel *proxy,
151 EmpathyTpCallPriv *priv = GET_PRIV (call);
153 DEBUG ("Stream state changed - stream id: %d, state state: %d",
154 stream_id, stream_state);
156 if (stream_id == priv->audio->id)
158 priv->audio->state = stream_state;
159 g_object_notify (call, "audio-stream");
161 else if (stream_id == priv->video->id)
163 priv->video->state = stream_state;
164 g_object_notify (call, "video-stream");
169 tp_call_stream_direction_changed_cb (TpChannel *channel,
171 guint stream_direction,
176 EmpathyTpCallPriv *priv = GET_PRIV (call);
178 DEBUG ("Stream direction changed - stream: %d, direction: %d",
179 stream_id, stream_direction);
181 if (stream_id == priv->audio->id)
183 priv->audio->direction = stream_direction;
184 g_object_notify (call, "audio-stream");
186 else if (stream_id == priv->video->id)
188 priv->video->direction = stream_direction;
189 g_object_notify (call, "video-stream");
194 tp_call_request_streams_cb (TpChannel *channel,
195 const GPtrArray *streams,
204 DEBUG ("Error requesting streams: %s", error->message);
208 for (i = 0; i < streams->len; i++)
212 guint contact_handle;
215 guint stream_direction;
217 values = g_ptr_array_index (streams, i);
218 stream_id = g_value_get_uint (g_value_array_get_nth (values, 0));
219 contact_handle = g_value_get_uint (g_value_array_get_nth (values, 1));
220 stream_type = g_value_get_uint (g_value_array_get_nth (values, 2));
221 stream_state = g_value_get_uint (g_value_array_get_nth (values, 3));
222 stream_direction = g_value_get_uint (g_value_array_get_nth (values, 4));
224 tp_call_add_stream (EMPATHY_TP_CALL (call), stream_id, contact_handle,
225 stream_type, stream_state, stream_direction);
230 tp_call_request_streams_for_capabilities (EmpathyTpCall *call,
231 EmpathyCapabilities capabilities)
233 EmpathyTpCallPriv *priv = GET_PRIV (call);
234 GArray *stream_types;
238 if (capabilities == EMPATHY_CAPABILITIES_UNKNOWN)
239 capabilities = EMPATHY_CAPABILITIES_AUDIO | EMPATHY_CAPABILITIES_VIDEO;
241 DEBUG ("Requesting new stream for capabilities %d",
244 stream_types = g_array_new (FALSE, FALSE, sizeof (guint));
245 handle = empathy_contact_get_handle (priv->contact);
247 if (capabilities & EMPATHY_CAPABILITIES_AUDIO)
249 stream_type = TP_MEDIA_STREAM_TYPE_AUDIO;
250 g_array_append_val (stream_types, stream_type);
252 if (capabilities & EMPATHY_CAPABILITIES_VIDEO)
254 stream_type = TP_MEDIA_STREAM_TYPE_VIDEO;
255 g_array_append_val (stream_types, stream_type);
258 tp_cli_channel_type_streamed_media_call_request_streams (priv->channel, -1,
259 handle, stream_types, tp_call_request_streams_cb, NULL, NULL,
262 g_array_free (stream_types, TRUE);
266 tp_call_member_added_cb (EmpathyTpGroup *group,
267 EmpathyContact *contact,
268 EmpathyContact *actor,
270 const gchar *message,
273 EmpathyTpCallPriv *priv = GET_PRIV (call);
275 if (!priv->contact && !empathy_contact_is_user (contact))
277 priv->contact = g_object_ref (contact);
278 priv->is_incoming = TRUE;
279 priv->status = EMPATHY_TP_CALL_STATUS_PENDING;
280 g_object_notify (G_OBJECT (call), "is-incoming");
281 g_object_notify (G_OBJECT (call), "contact");
282 g_object_notify (G_OBJECT (call), "status");
283 tp_call_request_streams_for_capabilities (call,
284 EMPATHY_CAPABILITIES_AUDIO);
287 if (priv->status == EMPATHY_TP_CALL_STATUS_PENDING &&
288 ((priv->is_incoming && contact != priv->contact) ||
289 (!priv->is_incoming && contact == priv->contact)))
291 priv->status = EMPATHY_TP_CALL_STATUS_ACCEPTED;
292 g_object_notify (G_OBJECT (call), "status");
297 tp_call_remote_pending_cb (EmpathyTpGroup *group,
298 EmpathyContact *contact,
299 EmpathyContact *actor,
301 const gchar *message,
304 EmpathyTpCallPriv *priv = GET_PRIV (call);
306 if (!priv->contact && !empathy_contact_is_user (contact))
308 priv->contact = g_object_ref (contact);
309 priv->is_incoming = FALSE;
310 priv->status = EMPATHY_TP_CALL_STATUS_PENDING;
311 g_object_notify (G_OBJECT (call), "is-incoming");
312 g_object_notify (G_OBJECT (call), "contact");
313 g_object_notify (G_OBJECT (call), "status");
314 tp_call_request_streams_for_capabilities (call,
315 EMPATHY_CAPABILITIES_AUDIO);
320 tp_call_channel_invalidated_cb (TpChannel *channel,
326 EmpathyTpCallPriv *priv = GET_PRIV (call);
328 DEBUG ("Channel invalidated: %s", message);
329 priv->status = EMPATHY_TP_CALL_STATUS_CLOSED;
330 g_object_notify (G_OBJECT (call), "status");
334 tp_call_async_cb (TpProxy *proxy,
340 DEBUG ("Error %s: %s", (gchar*) user_data, error->message);
344 tp_call_close_channel (EmpathyTpCall *call)
346 EmpathyTpCallPriv *priv = GET_PRIV (call);
348 if (priv->status == EMPATHY_TP_CALL_STATUS_CLOSED)
351 DEBUG ("Closing channel");
353 tp_cli_channel_call_close (priv->channel, -1,
354 NULL, NULL, NULL, NULL);
356 priv->status = EMPATHY_TP_CALL_STATUS_CLOSED;
357 g_object_notify (G_OBJECT (call), "status");
361 tp_call_stream_engine_invalidated_cb (TpProxy *stream_engine,
367 DEBUG ("Stream engine proxy invalidated: %s", message);
368 tp_call_close_channel (call);
372 tp_call_stream_engine_watch_name_owner_cb (TpDBusDaemon *daemon,
374 const gchar *new_owner,
377 EmpathyTpCallPriv *priv = GET_PRIV (call);
379 /* G_STR_EMPTY(new_owner) means either stream-engine has not started yet or
380 * has crashed. We want to close the channel if stream-engine has crashed.
382 DEBUG ("Watch SE: name='%s' SE running='%s' new_owner='%s'",
383 name, priv->stream_engine_running ? "yes" : "no",
384 new_owner ? new_owner : "none");
385 if (priv->stream_engine_running && G_STR_EMPTY (new_owner))
387 DEBUG ("Stream engine falled off the bus");
388 tp_call_close_channel (call);
392 priv->stream_engine_running = !G_STR_EMPTY (new_owner);
396 tp_call_stream_engine_handle_channel (EmpathyTpCall *call)
398 EmpathyTpCallPriv *priv = GET_PRIV (call);
405 DEBUG ("Revving up the stream engine");
407 priv->stream_engine = g_object_new (TP_TYPE_PROXY,
408 "bus-name", STREAM_ENGINE_BUS_NAME,
409 "dbus-connection", tp_get_bus (),
410 "object-path", STREAM_ENGINE_OBJECT_PATH,
412 tp_proxy_add_interface_by_id (priv->stream_engine,
413 EMP_IFACE_QUARK_STREAM_ENGINE);
414 tp_proxy_add_interface_by_id (priv->stream_engine,
415 EMP_IFACE_QUARK_CHANNEL_HANDLER);
417 g_signal_connect (priv->stream_engine, "invalidated",
418 G_CALLBACK (tp_call_stream_engine_invalidated_cb),
421 /* FIXME: dbus daemon should be unique */
422 priv->dbus_daemon = tp_dbus_daemon_new (tp_get_bus ());
423 tp_dbus_daemon_watch_name_owner (priv->dbus_daemon, STREAM_ENGINE_BUS_NAME,
424 tp_call_stream_engine_watch_name_owner_cb,
427 g_object_get (priv->channel,
428 "connection", &connection,
429 "channel-type", &channel_type,
430 "object-path", &object_path,
431 "handle_type", &handle_type,
435 emp_cli_channel_handler_call_handle_channel (priv->stream_engine, -1,
436 connection->bus_name,
437 connection->object_path,
438 channel_type, object_path, handle_type, handle,
439 tp_call_async_cb, "calling handle channel", NULL,
442 g_object_unref (connection);
443 g_free (channel_type);
444 g_free (object_path);
448 tp_call_constructor (GType type,
449 guint n_construct_params,
450 GObjectConstructParam *construct_params)
454 EmpathyTpCallPriv *priv;
456 object = G_OBJECT_CLASS (empathy_tp_call_parent_class)->constructor (type,
457 n_construct_params, construct_params);
459 call = EMPATHY_TP_CALL (object);
460 priv = GET_PRIV (call);
462 /* Setup streamed media channel */
463 g_signal_connect (priv->channel, "invalidated",
464 G_CALLBACK (tp_call_channel_invalidated_cb), call);
465 tp_cli_channel_type_streamed_media_connect_to_stream_added (priv->channel,
466 tp_call_stream_added_cb, NULL, NULL, G_OBJECT (call), NULL);
467 tp_cli_channel_type_streamed_media_connect_to_stream_removed (priv->channel,
468 tp_call_stream_removed_cb, NULL, NULL, G_OBJECT (call), NULL);
469 tp_cli_channel_type_streamed_media_connect_to_stream_state_changed (priv->channel,
470 tp_call_stream_state_changed_cb, NULL, NULL, G_OBJECT (call), NULL);
471 tp_cli_channel_type_streamed_media_connect_to_stream_direction_changed (priv->channel,
472 tp_call_stream_direction_changed_cb, NULL, NULL, G_OBJECT (call), NULL);
473 tp_cli_channel_type_streamed_media_call_list_streams (priv->channel, -1,
474 tp_call_request_streams_cb, NULL, NULL, G_OBJECT (call));
476 /* Setup group interface */
477 priv->group = empathy_tp_group_new (priv->channel);
479 g_signal_connect (priv->group, "member-added",
480 G_CALLBACK (tp_call_member_added_cb), call);
481 g_signal_connect (priv->group, "remote-pending",
482 G_CALLBACK (tp_call_remote_pending_cb), call);
484 /* Start stream engine */
485 tp_call_stream_engine_handle_channel (call);
491 tp_call_finalize (GObject *object)
493 EmpathyTpCallPriv *priv = GET_PRIV (object);
495 DEBUG ("Finalizing: %p", object);
497 g_slice_free (EmpathyTpCallStream, priv->audio);
498 g_slice_free (EmpathyTpCallStream, priv->video);
499 g_object_unref (priv->group);
501 if (priv->channel != NULL)
503 g_signal_handlers_disconnect_by_func (priv->channel,
504 tp_call_channel_invalidated_cb, object);
505 tp_call_close_channel (EMPATHY_TP_CALL (object));
506 g_object_unref (priv->channel);
509 if (priv->stream_engine != NULL)
511 g_signal_handlers_disconnect_by_func (priv->stream_engine,
512 tp_call_stream_engine_invalidated_cb, object);
513 g_object_unref (priv->stream_engine);
516 if (priv->contact != NULL)
517 g_object_unref (priv->contact);
519 if (priv->dbus_daemon != NULL)
521 tp_dbus_daemon_cancel_name_owner_watch (priv->dbus_daemon,
522 STREAM_ENGINE_BUS_NAME,
523 tp_call_stream_engine_watch_name_owner_cb,
525 g_object_unref (priv->dbus_daemon);
528 (G_OBJECT_CLASS (empathy_tp_call_parent_class)->finalize) (object);
532 tp_call_set_property (GObject *object,
537 EmpathyTpCallPriv *priv = GET_PRIV (object);
542 priv->channel = g_value_dup_object (value);
545 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
551 tp_call_get_property (GObject *object,
556 EmpathyTpCallPriv *priv = GET_PRIV (object);
561 g_value_set_object (value, priv->channel);
564 g_value_set_object (value, priv->contact);
566 case PROP_IS_INCOMING:
567 g_value_set_boolean (value, priv->is_incoming);
570 g_value_set_uint (value, priv->status);
572 case PROP_AUDIO_STREAM:
573 g_value_set_pointer (value, priv->audio);
575 case PROP_VIDEO_STREAM:
576 g_value_set_pointer (value, priv->video);
579 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
585 empathy_tp_call_class_init (EmpathyTpCallClass *klass)
587 GObjectClass *object_class = G_OBJECT_CLASS (klass);
591 object_class->constructor = tp_call_constructor;
592 object_class->finalize = tp_call_finalize;
593 object_class->set_property = tp_call_set_property;
594 object_class->get_property = tp_call_get_property;
596 g_type_class_add_private (klass, sizeof (EmpathyTpCallPriv));
598 g_object_class_install_property (object_class, PROP_CHANNEL,
599 g_param_spec_object ("channel", "channel", "channel",
601 G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE |
602 G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
603 g_object_class_install_property (object_class, PROP_CONTACT,
604 g_param_spec_object ("contact", "Call contact", "Call contact",
605 EMPATHY_TYPE_CONTACT,
606 G_PARAM_READABLE | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
607 g_object_class_install_property (object_class, PROP_IS_INCOMING,
608 g_param_spec_boolean ("is-incoming", "Is media stream incoming",
609 "Is media stream incoming", FALSE, G_PARAM_READABLE |
610 G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
611 g_object_class_install_property (object_class, PROP_STATUS,
612 g_param_spec_uint ("status", "Call status",
613 "Call status", 0, 255, 0, G_PARAM_READABLE | G_PARAM_STATIC_NICK |
614 G_PARAM_STATIC_BLURB));
615 g_object_class_install_property (object_class, PROP_AUDIO_STREAM,
616 g_param_spec_pointer ("audio-stream", "Audio stream data",
618 G_PARAM_READABLE | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
619 g_object_class_install_property (object_class, PROP_VIDEO_STREAM,
620 g_param_spec_pointer ("video-stream", "Video stream data",
622 G_PARAM_READABLE | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
626 empathy_tp_call_init (EmpathyTpCall *call)
628 EmpathyTpCallPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (call,
629 EMPATHY_TYPE_TP_CALL, EmpathyTpCallPriv);
632 priv->status = EMPATHY_TP_CALL_STATUS_READYING;
633 priv->contact = NULL;
634 priv->stream_engine_running = FALSE;
635 priv->audio = g_slice_new0 (EmpathyTpCallStream);
636 priv->video = g_slice_new0 (EmpathyTpCallStream);
637 priv->audio->exists = FALSE;
638 priv->video->exists = FALSE;
642 empathy_tp_call_new (TpChannel *channel)
644 g_return_val_if_fail (TP_IS_CHANNEL (channel), NULL);
646 return g_object_new (EMPATHY_TYPE_TP_CALL,
652 empathy_tp_call_accept_incoming_call (EmpathyTpCall *call)
654 EmpathyTpCallPriv *priv = GET_PRIV (call);
655 EmpathyContact *self_contact;
657 g_return_if_fail (EMPATHY_IS_TP_CALL (call));
658 g_return_if_fail (priv->status == EMPATHY_TP_CALL_STATUS_PENDING);
660 DEBUG ("Accepting incoming call");
662 self_contact = empathy_tp_group_get_self_contact (priv->group);
663 empathy_tp_group_add_member (priv->group, self_contact, NULL);
664 g_object_unref (self_contact);
668 empathy_tp_call_request_video_stream_direction (EmpathyTpCall *call,
671 EmpathyTpCallPriv *priv = GET_PRIV (call);
674 g_return_if_fail (EMPATHY_IS_TP_CALL (call));
675 g_return_if_fail (priv->status == EMPATHY_TP_CALL_STATUS_ACCEPTED);
677 DEBUG ("Requesting video stream direction - is_sending: %d", is_sending);
679 if (!priv->video->exists)
682 tp_call_request_streams_for_capabilities (call,
683 EMPATHY_CAPABILITIES_VIDEO);
688 new_direction = priv->video->direction | TP_MEDIA_STREAM_DIRECTION_SEND;
690 new_direction = priv->video->direction & ~TP_MEDIA_STREAM_DIRECTION_SEND;
692 tp_cli_channel_type_streamed_media_call_request_stream_direction (priv->channel,
693 -1, priv->video->id, new_direction,
694 (tp_cli_channel_type_streamed_media_callback_for_request_stream_direction)
695 tp_call_async_cb, NULL, NULL, G_OBJECT (call));
699 empathy_tp_call_add_preview_video (EmpathyTpCall *call,
700 guint preview_video_socket_id)
702 EmpathyTpCallPriv *priv = GET_PRIV (call);
704 g_return_if_fail (EMPATHY_IS_TP_CALL (call));
706 DEBUG ("Adding preview video");
708 emp_cli_stream_engine_call_add_preview_window (priv->stream_engine, -1,
709 preview_video_socket_id,
711 "adding preview window", NULL,
716 empathy_tp_call_remove_preview_video (EmpathyTpCall *call,
717 guint preview_video_socket_id)
719 EmpathyTpCallPriv *priv = GET_PRIV (call);
721 g_return_if_fail (EMPATHY_IS_TP_CALL (call));
723 DEBUG ("Removing preview video");
725 emp_cli_stream_engine_call_remove_preview_window (priv->stream_engine, -1,
726 preview_video_socket_id,
728 "removing preview window", NULL,
733 empathy_tp_call_add_output_video (EmpathyTpCall *call,
734 guint output_video_socket_id)
736 EmpathyTpCallPriv *priv = GET_PRIV (call);
738 g_return_if_fail (EMPATHY_IS_TP_CALL (call));
740 DEBUG ("Adding output video - socket: %d", output_video_socket_id);
742 emp_cli_stream_engine_call_set_output_window (priv->stream_engine, -1,
743 TP_PROXY (priv->channel)->object_path,
744 priv->video->id, output_video_socket_id,
746 "setting output window", NULL,
751 empathy_tp_call_set_output_volume (EmpathyTpCall *call,
754 EmpathyTpCallPriv *priv = GET_PRIV (call);
756 g_return_if_fail (EMPATHY_IS_TP_CALL (call));
757 g_return_if_fail (priv->status != EMPATHY_TP_CALL_STATUS_CLOSED);
759 DEBUG ("Setting output volume: %d", volume);
761 emp_cli_stream_engine_call_set_output_volume (priv->stream_engine, -1,
762 TP_PROXY (priv->channel)->object_path,
763 priv->audio->id, volume,
765 "setting output volume", NULL,
770 empathy_tp_call_mute_output (EmpathyTpCall *call,
773 EmpathyTpCallPriv *priv = GET_PRIV (call);
775 g_return_if_fail (EMPATHY_IS_TP_CALL (call));
777 DEBUG ("Setting output mute: %d", is_muted);
779 emp_cli_stream_engine_call_mute_output (priv->stream_engine, -1,
780 TP_PROXY (priv->channel)->object_path,
781 priv->audio->id, is_muted,
783 "muting output", NULL,
788 empathy_tp_call_mute_input (EmpathyTpCall *call,
791 EmpathyTpCallPriv *priv = GET_PRIV (call);
793 g_return_if_fail (EMPATHY_IS_TP_CALL (call));
795 DEBUG ("Setting input mute: %d", is_muted);
797 emp_cli_stream_engine_call_mute_input (priv->stream_engine, -1,
798 TP_PROXY (priv->channel)->object_path,
799 priv->audio->id, is_muted,
801 "muting input", NULL,
806 empathy_tp_call_start_tone (EmpathyTpCall *call, TpDTMFEvent event)
808 EmpathyTpCallPriv *priv = GET_PRIV (call);
810 g_return_if_fail (EMPATHY_IS_TP_CALL (call));
811 g_return_if_fail (priv->status == EMPATHY_TP_CALL_STATUS_ACCEPTED);
813 if (!priv->audio->exists)
816 tp_cli_channel_interface_dtmf_call_start_tone (priv->channel, -1,
817 priv->audio->id, event,
818 (tp_cli_channel_interface_dtmf_callback_for_start_tone) tp_call_async_cb,
819 "starting tone", NULL, G_OBJECT (call));
823 empathy_tp_call_stop_tone (EmpathyTpCall *call)
825 EmpathyTpCallPriv *priv = GET_PRIV (call);
827 g_return_if_fail (EMPATHY_IS_TP_CALL (call));
828 g_return_if_fail (priv->status == EMPATHY_TP_CALL_STATUS_ACCEPTED);
830 if (!priv->audio->exists)
833 tp_cli_channel_interface_dtmf_call_stop_tone (priv->channel, -1,
835 (tp_cli_channel_interface_dtmf_callback_for_stop_tone) tp_call_async_cb,
836 "stoping tone", NULL, G_OBJECT (call));