515
515
secure_zrtp_on_cb(G_GNUC_UNUSED DBusGProxy *proxy, const gchar *callID,
516
516
const gchar *cipher, SFLPhoneClient *client)
518
g_debug("SRTP using ZRTP is ON secure_on_cb");
518
g_debug("SRTP using ZRTP is ON with cipher %s", cipher);
519
519
callable_obj_t *c = calllist_get_call(current_calls_tab, callID);
522
c->_srtp_cipher = g_strdup(cipher);
523
522
sflphone_srtp_zrtp_on(c, client);
524
523
notify_secure_on(c, client);
575
print_rtcp_stats(const gchar *key, gint value, G_GNUC_UNUSED gpointer data)
577
g_debug("%s: %d", key, value);
582
on_rtcp_report_received_cb(G_GNUC_UNUSED DBusGProxy *proxy,
584
G_GNUC_UNUSED const GHashTable *stats,
585
G_GNUC_UNUSED SFLPhoneClient *client)
587
g_debug("Daemon notification of new RTCP report for %s", callID);
589
g_hash_table_foreach(stats, print_rtcp_stats, NULL);
574
594
sip_call_state_cb(G_GNUC_UNUSED DBusGProxy *proxy, const gchar *callID,
575
595
const gchar *description, guint code, SFLPhoneClient *client)
822
842
g_cclosure_user_marshal_VOID__STRING_STRING_STRING, G_TYPE_NONE,
823
843
G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID);
825
/* Register STRING STRING INT INT Marshaller */
845
/* Register STRING STRING INT INT BOOL Marshaller */
826
846
dbus_g_object_register_marshaller(
827
g_cclosure_user_marshal_VOID__STRING_STRING_INT_INT, G_TYPE_NONE,
828
G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT, G_TYPE_INT, G_TYPE_INVALID);
847
g_cclosure_user_marshal_VOID__STRING_STRING_INT_INT_BOOLEAN, G_TYPE_NONE,
848
G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT, G_TYPE_INT, G_TYPE_BOOLEAN,
830
851
/* Register STRING STRING BOOLEAN STRING Marshaller */
831
852
dbus_g_object_register_marshaller(
955
976
dbus_g_proxy_connect_signal(call_proxy, "sipCallStateChanged",
956
977
G_CALLBACK(sip_call_state_cb), client, NULL);
980
/* Manually register this marshaller as we need to declare that the boxed type is in fact
982
dbus_g_object_register_marshaller(g_cclosure_user_marshal_VOID__STRING_BOXED, G_TYPE_NONE,
983
G_TYPE_STRING, G_TYPE_HASH_TABLE, G_TYPE_INVALID);
985
dbus_g_proxy_add_signal(call_proxy, "onRtcpReportReceived",
987
dbus_g_type_get_map("GHashTable", G_TYPE_STRING, G_TYPE_INT),
990
dbus_g_proxy_connect_signal(call_proxy, "onRtcpReportReceived",
991
G_CALLBACK(on_rtcp_report_received_cb), client, NULL);
958
993
g_debug("Adding configurationmanager Dbus signals");
960
995
dbus_g_proxy_add_signal(config_proxy, "accountsChanged", G_TYPE_INVALID);
1000
1035
#ifdef SFL_VIDEO
1001
const gchar *videocontrols_object_instance = "/org/sflphone/SFLphone/VideoControls";
1002
const gchar *videocontrols_interface = "org.sflphone.SFLphone.VideoControls";
1036
const gchar *videomanager_object_instance = "/org/sflphone/SFLphone/VideoManager";
1037
const gchar *videomanager_interface = "org.sflphone.SFLphone.VideoManager";
1003
1038
video_proxy = dbus_g_proxy_new_for_name(connection, dbus_message_bus_name,
1004
videocontrols_object_instance, videocontrols_interface);
1039
videomanager_object_instance, videomanager_interface);
1005
1040
if (video_proxy == NULL) {
1006
g_warning("Error: Failed to connect to %s", videocontrols_object_instance);
1041
g_warning("Error: Failed to connect to %s", videomanager_object_instance);
1009
1044
/* Video related signals */
1012
1047
G_CALLBACK(video_device_event_cb), NULL, NULL);
1014
1049
dbus_g_proxy_add_signal(video_proxy, "startedDecoding", G_TYPE_STRING,
1015
G_TYPE_STRING, G_TYPE_INT, G_TYPE_INT, G_TYPE_INVALID);
1050
G_TYPE_STRING, G_TYPE_INT, G_TYPE_INT, G_TYPE_BOOLEAN,
1016
1052
dbus_g_proxy_connect_signal(video_proxy, "startedDecoding",
1017
G_CALLBACK(started_decoding_video_cb), NULL,
1053
G_CALLBACK(started_decoding_video_cb), client, NULL);
1020
1055
dbus_g_proxy_add_signal(video_proxy, "stoppedDecoding",
1021
G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID);
1056
G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_INVALID);
1022
1057
dbus_g_proxy_connect_signal(video_proxy, "stoppedDecoding",
1023
G_CALLBACK(stopped_decoding_video_cb),
1058
G_CALLBACK(stopped_decoding_video_cb), client, NULL);
1027
1061
/* Defines a default timeout for the proxies */
1442
dbus_get_current_video_codec_name(const callable_obj_t *c)
1444
gchar *codecName = NULL;
1445
GError *error = NULL;
1447
org_sflphone_SFLphone_VideoControls_get_current_codec_name(video_proxy,
1448
c->_callID, &codecName, &error);
1450
if (check_error(error)) {
1452
codecName = g_strdup("");
1460
dbus_get_current_audio_codec_name(const callable_obj_t *c)
1462
gchar *codecName = NULL;
1463
GError *error = NULL;
1465
org_sflphone_SFLphone_CallManager_get_current_audio_codec_name(call_proxy, c->_callID, &codecName,
1472
1485
dbus_get_active_audio_codec_list(const gchar *accountID)
1592
dbus_get_audio_device_index(const gchar *name)
1594
int device_index = 0;
1595
GError *error = NULL;
1596
org_sflphone_SFLphone_ConfigurationManager_get_audio_device_index(config_proxy, name, &device_index, &error);
1605
dbus_get_audio_output_device_index(const gchar *name)
1607
int device_index = 0;
1608
GError *error = NULL;
1609
org_sflphone_SFLphone_ConfigurationManager_get_audio_output_device_index(config_proxy, name, &device_index, &error);
1612
return device_index;
1619
dbus_get_audio_input_device_index(const gchar *name)
1621
int device_index = 0;
1622
GError *error = NULL;
1623
org_sflphone_SFLphone_ConfigurationManager_get_audio_input_device_index(config_proxy, name, &device_index, &error);
1597
1624
check_error(error);
1599
1626
return device_index;
1711
dbus_join_participant_async_cb(G_GNUC_UNUSED DBusGProxy *proxy,
1714
G_GNUC_UNUSED gpointer data)
1718
g_warning("Failed to join participant");
1694
1722
dbus_join_participant(const gchar *sel_callID, const gchar *drag_callID)
1696
g_debug("Join participant %s and %s\n", sel_callID, drag_callID);
1697
GError *error = NULL;
1699
org_sflphone_SFLphone_CallManager_join_participant(call_proxy, sel_callID,
1700
drag_callID, &result, &error);
1724
org_sflphone_SFLphone_CallManager_join_participant_async(call_proxy, sel_callID,
1725
drag_callID, dbus_join_participant_async_cb, NULL);
1729
dbus_add_participant_async_cb(G_GNUC_UNUSED DBusGProxy *proxy,
1732
G_GNUC_UNUSED gpointer data)
1701
1734
check_error(error);
1736
g_warning("Failed to add participant");
1705
1740
dbus_add_participant(const gchar *callID, const gchar *confID)
1707
g_debug("Add participant %s to %s\n", callID, confID);
1708
GError *error = NULL;
1710
org_sflphone_SFLphone_CallManager_add_participant(call_proxy, callID,
1711
confID, &result, &error);
1742
org_sflphone_SFLphone_CallManager_add_participant_async(call_proxy, callID,
1743
confID, dbus_add_participant_async_cb, NULL);
1747
dbus_add_main_participant_async_cb(G_GNUC_UNUSED DBusGProxy *proxy,
1750
G_GNUC_UNUSED gpointer data)
1712
1752
check_error(error);
1754
g_warning("Failed to add main participant");
1716
1758
dbus_add_main_participant(const gchar *confID)
1718
GError *error = NULL;
1720
org_sflphone_SFLphone_CallManager_add_main_participant(call_proxy, confID,
1760
org_sflphone_SFLphone_CallManager_add_main_participant_async(call_proxy,
1761
confID, dbus_add_main_participant_async_cb, NULL);
1896
dbus_get_supported_audio_managers()
1898
GError *error = NULL;
1899
gchar **array = NULL;
1900
org_sflphone_SFLphone_ConfigurationManager_get_supported_audio_managers(config_proxy, &array, &error);
1854
1906
#ifdef SFL_VIDEO
1856
dbus_get_active_video_device_channel()
1859
GError *error = NULL;
1861
org_sflphone_SFLphone_VideoControls_get_active_device_channel(video_proxy, &str, &error);
1868
dbus_get_active_video_device_size()
1871
GError *error = NULL;
1873
org_sflphone_SFLphone_VideoControls_get_active_device_size(video_proxy, &str, &error);
1880
dbus_get_active_video_device_rate()
1883
GError *error = NULL;
1885
org_sflphone_SFLphone_VideoControls_get_active_device_rate(video_proxy, &str, &error);
1892
dbus_get_active_video_device()
1895
GError *error = NULL;
1897
org_sflphone_SFLphone_VideoControls_get_active_device(video_proxy, &str, &error);
1904
dbus_set_active_video_device(const gchar *device)
1906
GError *error = NULL;
1907
org_sflphone_SFLphone_VideoControls_set_active_device(video_proxy, device, &error);
1912
dbus_set_active_video_device_channel(const gchar *channel)
1914
GError *error = NULL;
1915
org_sflphone_SFLphone_VideoControls_set_active_device_channel(video_proxy, channel, &error);
1920
dbus_set_active_video_device_size(const gchar *size)
1922
GError *error = NULL;
1923
org_sflphone_SFLphone_VideoControls_set_active_device_size(video_proxy, size, &error);
1928
dbus_set_active_video_device_rate(const gchar *rate)
1930
GError *error = NULL;
1931
org_sflphone_SFLphone_VideoControls_set_active_device_rate(video_proxy, rate, &error);
1936
dbus_get_video_device_list()
1938
gchar **array = NULL;
1939
GError *error = NULL;
1941
org_sflphone_SFLphone_VideoControls_get_device_list(video_proxy, &array, &error);
1947
* Get the list of channels supported by the given device
1950
dbus_get_video_device_channel_list(const gchar *dev)
1952
gchar **array = NULL;
1953
GError *error = NULL;
1954
org_sflphone_SFLphone_VideoControls_get_device_channel_list(video_proxy, dev, &array, &error);
1960
* Get the list of resolutions supported by the given channel of the given device
1963
dbus_get_video_device_size_list(const gchar *dev, const gchar *channel)
1965
gchar **array = NULL;
1966
GError *error = NULL;
1968
org_sflphone_SFLphone_VideoControls_get_device_size_list(video_proxy, dev, channel, &array, &error);
1974
* Get the list of frame rates supported by the given resolution of the given channel of the given device
1977
dbus_get_video_device_rate_list(const gchar *dev, const gchar *channel, const gchar *size)
1979
gchar **array = NULL;
1980
GError *error = NULL;
1982
org_sflphone_SFLphone_VideoControls_get_device_rate_list(video_proxy, dev, channel, size, &array, &error);
1908
dbus_video_get_default_device()
1911
GError *error = NULL;
1913
org_sflphone_SFLphone_VideoManager_get_default_device(video_proxy, &str, &error);
1920
dbus_video_set_default_device(const gchar *name)
1922
GError *error = NULL;
1923
org_sflphone_SFLphone_VideoManager_set_default_device(video_proxy, name, &error);
1928
dbus_video_get_settings(const gchar *name)
1930
GError *error = NULL;
1931
GHashTable *settings = NULL;
1933
org_sflphone_SFLphone_VideoManager_get_settings(video_proxy, name, &settings, &error);
1940
dbus_video_apply_settings(const gchar *name, GHashTable *settings)
1942
GError *error = NULL;
1943
org_sflphone_SFLphone_VideoManager_apply_settings(video_proxy, name, settings, &error);
1948
dbus_video_get_device_list()
1950
gchar **array = NULL;
1951
GError *error = NULL;
1953
org_sflphone_SFLphone_VideoManager_get_device_list(video_proxy, &array, &error);
1959
dbus_video_get_capabilities(const gchar *name)
1961
GError *error = NULL;
1962
GHashTable *cap = NULL;
1964
org_sflphone_SFLphone_VideoManager_get_capabilities(video_proxy, name, &cap, &error);
2226
2242
dbus_start_video_camera()
2228
2244
set_camera_button_sensitivity(FALSE);
2229
org_sflphone_SFLphone_VideoControls_start_camera_async(video_proxy, video_camera_async_cb, NULL);
2245
org_sflphone_SFLphone_VideoManager_start_camera_async(video_proxy, video_camera_async_cb, NULL);
2233
2249
dbus_stop_video_camera()
2235
2251
set_camera_button_sensitivity(FALSE);
2236
org_sflphone_SFLphone_VideoControls_stop_camera_async(video_proxy, video_camera_async_cb, NULL);
2252
org_sflphone_SFLphone_VideoManager_stop_camera_async(video_proxy, video_camera_async_cb, NULL);