~ubuntu-branches/ubuntu/wily/sflphone/wily

« back to all changes in this revision

Viewing changes to gnome/src/dbus/dbus.c

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2015-01-07 14:51:16 UTC
  • mfrom: (4.3.5 sid)
  • Revision ID: package-import@ubuntu.com-20150107145116-yxnafinf4lrdvrmx
Tags: 1.4.1-0.1ubuntu1
* Merge with Debian, remaining changes:
 - Drop soprano, nepomuk build-dep
* Drop ubuntu patches, now upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
#include "callmanager-glue.h"
40
40
#include "configurationmanager-glue.h"
41
41
#ifdef SFL_VIDEO
42
 
#include "video_controls-glue.h"
 
42
#include "videomanager-glue.h"
43
43
#endif
44
44
#include "instance-glue.h"
45
45
#include "preferencesdialog.h"
203
203
        if (c->_state == CALL_STATE_CURRENT)
204
204
            time(&c->_time_stop);
205
205
 
206
 
        calltree_update_call(history_tab, c, client, FALSE);
 
206
        calltree_update_call(history_tab, c, client);
207
207
        status_bar_display_account();
208
208
        sflphone_hung_up(c, client);
209
209
    } else if (g_strcmp0(state, "UNHOLD") == 0 || g_strcmp0(state, "CURRENT") == 0)
515
515
secure_zrtp_on_cb(G_GNUC_UNUSED DBusGProxy *proxy, const gchar *callID,
516
516
                  const gchar *cipher, SFLPhoneClient *client)
517
517
{
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);
520
520
 
521
521
    if (c) {
522
 
        c->_srtp_cipher = g_strdup(cipher);
523
522
        sflphone_srtp_zrtp_on(c, client);
524
523
        notify_secure_on(c, client);
525
524
    }
570
569
    }
571
570
}
572
571
 
 
572
 
 
573
#ifdef RTCP_DEBUG
 
574
static void
 
575
print_rtcp_stats(const gchar *key, gint value, G_GNUC_UNUSED gpointer data)
 
576
{
 
577
    g_debug("%s: %d", key, value);
 
578
}
 
579
#endif
 
580
 
 
581
static void
 
582
on_rtcp_report_received_cb(G_GNUC_UNUSED DBusGProxy *proxy,
 
583
        const gchar *callID,
 
584
        G_GNUC_UNUSED const GHashTable *stats,
 
585
        G_GNUC_UNUSED SFLPhoneClient *client)
 
586
{
 
587
    g_debug("Daemon notification of new RTCP report for %s", callID);
 
588
#ifdef RTCP_DEBUG
 
589
    g_hash_table_foreach(stats, print_rtcp_stats, NULL);
 
590
#endif
 
591
}
 
592
 
573
593
static void
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);
824
844
 
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,
 
849
        G_TYPE_INVALID);
829
850
 
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);
957
978
 
 
979
 
 
980
    /* Manually register this marshaller as we need to declare that the boxed type is in fact
 
981
     * a GHashTable */
 
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);
 
984
 
 
985
    dbus_g_proxy_add_signal(call_proxy, "onRtcpReportReceived",
 
986
                            G_TYPE_STRING,
 
987
                            dbus_g_type_get_map("GHashTable", G_TYPE_STRING, G_TYPE_INT),
 
988
                            G_TYPE_INVALID);
 
989
 
 
990
    dbus_g_proxy_connect_signal(call_proxy, "onRtcpReportReceived",
 
991
                                G_CALLBACK(on_rtcp_report_received_cb), client, NULL);
 
992
 
958
993
    g_debug("Adding configurationmanager Dbus signals");
959
994
 
960
995
    dbus_g_proxy_add_signal(config_proxy, "accountsChanged", G_TYPE_INVALID);
998
1033
#endif
999
1034
 
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);
1007
1042
        return FALSE;
1008
1043
    }
1009
1044
    /* Video related signals */
1012
1047
            G_CALLBACK(video_device_event_cb), NULL, NULL);
1013
1048
 
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,
 
1051
            G_TYPE_INVALID);
1016
1052
    dbus_g_proxy_connect_signal(video_proxy, "startedDecoding",
1017
 
            G_CALLBACK(started_decoding_video_cb), NULL,
1018
 
            NULL);
 
1053
            G_CALLBACK(started_decoding_video_cb), client, NULL);
1019
1054
 
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),
1024
 
            NULL, NULL);
 
1058
            G_CALLBACK(stopped_decoding_video_cb), client, NULL);
1025
1059
#endif
1026
1060
 
1027
1061
    /* Defines a default timeout for the proxies */
1048
1082
void dbus_clean()
1049
1083
{
1050
1084
#ifdef SFL_VIDEO
1051
 
        g_object_unref(video_proxy);
 
1085
    g_object_unref(video_proxy);
1052
1086
#endif
1053
1087
    g_object_unref(call_proxy);
1054
1088
    g_object_unref(config_proxy);
1115
1149
}
1116
1150
 
1117
1151
static void
1118
 
hang_up_reply_cb(G_GNUC_UNUSED DBusGProxy *proxy, gboolean is_hung_up, GError *error, G_GNUC_UNUSED gpointer userdata)
 
1152
hang_up_reply_cb(G_GNUC_UNUSED DBusGProxy *proxy,
 
1153
        G_GNUC_UNUSED gboolean is_hung_up,
 
1154
        GError *error,
 
1155
        G_GNUC_UNUSED gpointer userdata)
1119
1156
{
1120
 
    if (!is_hung_up)
1121
 
        g_warning("Did not hang up properly");
1122
1157
    check_error(error);
1123
1158
}
1124
1159
 
1241
1276
}
1242
1277
 
1243
1278
GHashTable *
1244
 
dbus_get_ip2_ip_details(void)
 
1279
dbus_get_ip2ip_details(void)
1245
1280
{
1246
1281
    GError *error = NULL;
1247
1282
    GHashTable *details = NULL;
1412
1447
{
1413
1448
    GError *error = NULL;
1414
1449
    GPtrArray *array = NULL;
1415
 
    org_sflphone_SFLphone_VideoControls_get_codecs(video_proxy, accountID, &array, &error);
 
1450
    org_sflphone_SFLphone_VideoManager_get_codecs(video_proxy, accountID, &array, &error);
1416
1451
    check_error(error);
1417
1452
    return array;
1418
1453
}
1421
1456
dbus_set_video_codecs(const gchar *accountID, const GPtrArray *list)
1422
1457
{
1423
1458
    GError *error = NULL;
1424
 
    org_sflphone_SFLphone_VideoControls_set_codecs(video_proxy, accountID, list, &error);
1425
 
    check_error(error);
 
1459
    org_sflphone_SFLphone_VideoManager_set_codecs(video_proxy, accountID, list, &error);
 
1460
    check_error(error);
 
1461
}
 
1462
 
 
1463
gboolean
 
1464
dbus_switch_video_input(const gchar *resource)
 
1465
{
 
1466
    GError *error = NULL;
 
1467
    gboolean switched;
 
1468
    org_sflphone_SFLphone_VideoManager_switch_input(video_proxy, resource, &switched, &error);
 
1469
    check_error(error);
 
1470
    return switched;
1426
1471
}
1427
1472
#endif
1428
1473
 
1436
1481
    return array;
1437
1482
}
1438
1483
 
1439
 
#ifdef SFL_VIDEO
1440
 
 
1441
 
gchar *
1442
 
dbus_get_current_video_codec_name(const callable_obj_t *c)
1443
 
{
1444
 
    gchar *codecName = NULL;
1445
 
    GError *error = NULL;
1446
 
 
1447
 
    org_sflphone_SFLphone_VideoControls_get_current_codec_name(video_proxy,
1448
 
            c->_callID, &codecName, &error);
1449
 
 
1450
 
    if (check_error(error)) {
1451
 
        g_free(codecName);
1452
 
        codecName = g_strdup("");
1453
 
    }
1454
 
 
1455
 
    return codecName;
1456
 
}
1457
 
#endif
1458
 
 
1459
 
gchar *
1460
 
dbus_get_current_audio_codec_name(const callable_obj_t *c)
1461
 
{
1462
 
    gchar *codecName = NULL;
1463
 
    GError *error = NULL;
1464
 
 
1465
 
    org_sflphone_SFLphone_CallManager_get_current_audio_codec_name(call_proxy, c->_callID, &codecName,
1466
 
                                      &error);
1467
 
    check_error(error);
1468
 
    return codecName;
1469
 
}
1470
 
 
1471
1484
GArray *
1472
1485
dbus_get_active_audio_codec_list(const gchar *accountID)
1473
1486
{
1589
1602
 * Get index
1590
1603
 */
1591
1604
int
1592
 
dbus_get_audio_device_index(const gchar *name)
1593
 
{
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)
 
1606
{
 
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);
 
1610
    check_error(error);
 
1611
 
 
1612
    return device_index;
 
1613
}
 
1614
 
 
1615
/**
 
1616
 * Get index
 
1617
 */
 
1618
int
 
1619
dbus_get_audio_input_device_index(const gchar *name)
 
1620
{
 
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);
1598
1625
 
1599
1626
    return device_index;
1639
1666
{
1640
1667
    GError *error = NULL;
1641
1668
    org_sflphone_SFLphone_ConfigurationManager_set_noise_suppress_state(config_proxy, state, &error);
1642
 
 
1643
 
    if (error) {
1644
 
        g_warning("Failed to call set_noise_suppress_state() on "
1645
 
              "ConfigurationManager: %s", error->message);
1646
 
        g_error_free(error);
1647
 
    }
 
1669
    check_error(error);
1648
1670
}
1649
1671
 
1650
1672
/**
1671
1693
{
1672
1694
    GError *error = NULL;
1673
1695
    org_sflphone_SFLphone_ConfigurationManager_set_agc_state(config_proxy, state, &error);
1674
 
 
1675
 
    if (error) {
1676
 
        g_warning("Failed to call set_agc_state() on "
1677
 
              "ConfigurationManager: %s", error->message);
1678
 
        g_error_free(error);
1679
 
    }
 
1696
    check_error(error);
1680
1697
}
1681
1698
 
1682
1699
int
1690
1707
    return res;
1691
1708
}
1692
1709
 
 
1710
static void
 
1711
dbus_join_participant_async_cb(G_GNUC_UNUSED DBusGProxy *proxy,
 
1712
                      gboolean result,
 
1713
                      GError *error,
 
1714
                      G_GNUC_UNUSED gpointer data)
 
1715
{
 
1716
    check_error(error);
 
1717
    if (!result)
 
1718
        g_warning("Failed to join participant");
 
1719
}
 
1720
 
1693
1721
void
1694
1722
dbus_join_participant(const gchar *sel_callID, const gchar *drag_callID)
1695
1723
{
1696
 
    g_debug("Join participant %s and %s\n", sel_callID, drag_callID);
1697
 
    GError *error = NULL;
1698
 
    gboolean result;
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);
 
1726
}
 
1727
 
 
1728
static void
 
1729
dbus_add_participant_async_cb(G_GNUC_UNUSED DBusGProxy *proxy,
 
1730
                              gboolean result,
 
1731
                              GError *error,
 
1732
                              G_GNUC_UNUSED gpointer data)
 
1733
{
1701
1734
    check_error(error);
 
1735
    if (!result)
 
1736
        g_warning("Failed to add participant");
1702
1737
}
1703
1738
 
1704
1739
void
1705
1740
dbus_add_participant(const gchar *callID, const gchar *confID)
1706
1741
{
1707
 
    g_debug("Add participant %s to %s\n", callID, confID);
1708
 
    GError *error = NULL;
1709
 
    gboolean result;
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);
 
1744
}
 
1745
 
 
1746
static void
 
1747
dbus_add_main_participant_async_cb(G_GNUC_UNUSED DBusGProxy *proxy,
 
1748
                                   gboolean result,
 
1749
                                   GError *error,
 
1750
                                   G_GNUC_UNUSED gpointer data)
 
1751
{
1712
1752
    check_error(error);
 
1753
    if (!result)
 
1754
        g_warning("Failed to add main participant");
1713
1755
}
1714
1756
 
1715
1757
void
1716
1758
dbus_add_main_participant(const gchar *confID)
1717
1759
{
1718
 
    GError *error = NULL;
1719
 
    gboolean result;
1720
 
    org_sflphone_SFLphone_CallManager_add_main_participant(call_proxy, confID,
1721
 
            &result, &error);
1722
 
    check_error(error);
 
1760
    org_sflphone_SFLphone_CallManager_add_main_participant_async(call_proxy,
 
1761
            confID, dbus_add_main_participant_async_cb, NULL);
1723
1762
}
1724
1763
 
1725
1764
void
1832
1871
    check_error(error);
1833
1872
}
1834
1873
 
1835
 
void
 
1874
gboolean
1836
1875
dbus_set_audio_manager(const gchar *api)
1837
1876
{
1838
1877
    GError *error = NULL;
1839
 
    org_sflphone_SFLphone_ConfigurationManager_set_audio_manager(config_proxy, api, &error);
 
1878
    gboolean result;
 
1879
    org_sflphone_SFLphone_ConfigurationManager_set_audio_manager(config_proxy, api, &result, &error);
1840
1880
    check_error(error);
 
1881
    return result;
1841
1882
}
1842
1883
 
1843
1884
gchar *
1851
1892
    return api;
1852
1893
}
1853
1894
 
 
1895
gchar **
 
1896
dbus_get_supported_audio_managers()
 
1897
{
 
1898
    GError *error = NULL;
 
1899
    gchar **array = NULL;
 
1900
    org_sflphone_SFLphone_ConfigurationManager_get_supported_audio_managers(config_proxy, &array, &error);
 
1901
    check_error(error);
 
1902
 
 
1903
    return array;
 
1904
}
 
1905
 
1854
1906
#ifdef SFL_VIDEO
1855
1907
gchar *
1856
 
dbus_get_active_video_device_channel()
1857
 
{
1858
 
    gchar *str = NULL;
1859
 
    GError *error = NULL;
1860
 
 
1861
 
    org_sflphone_SFLphone_VideoControls_get_active_device_channel(video_proxy, &str, &error);
1862
 
    check_error(error);
1863
 
 
1864
 
    return str;
1865
 
}
1866
 
 
1867
 
gchar *
1868
 
dbus_get_active_video_device_size()
1869
 
{
1870
 
    gchar *str = NULL;
1871
 
    GError *error = NULL;
1872
 
 
1873
 
    org_sflphone_SFLphone_VideoControls_get_active_device_size(video_proxy, &str, &error);
1874
 
    check_error(error);
1875
 
 
1876
 
    return str;
1877
 
}
1878
 
 
1879
 
gchar *
1880
 
dbus_get_active_video_device_rate()
1881
 
{
1882
 
    gchar *str = NULL;
1883
 
    GError *error = NULL;
1884
 
 
1885
 
    org_sflphone_SFLphone_VideoControls_get_active_device_rate(video_proxy, &str, &error);
1886
 
    check_error(error);
1887
 
 
1888
 
    return str;
1889
 
}
1890
 
 
1891
 
gchar *
1892
 
dbus_get_active_video_device()
1893
 
{
1894
 
    gchar *str = NULL;
1895
 
    GError *error = NULL;
1896
 
 
1897
 
    org_sflphone_SFLphone_VideoControls_get_active_device(video_proxy, &str, &error);
1898
 
    check_error(error);
1899
 
 
1900
 
    return str;
1901
 
}
1902
 
 
1903
 
void
1904
 
dbus_set_active_video_device(const gchar *device)
1905
 
{
1906
 
    GError *error = NULL;
1907
 
    org_sflphone_SFLphone_VideoControls_set_active_device(video_proxy, device, &error);
1908
 
    check_error(error);
1909
 
}
1910
 
 
1911
 
void
1912
 
dbus_set_active_video_device_channel(const gchar *channel)
1913
 
{
1914
 
    GError *error = NULL;
1915
 
    org_sflphone_SFLphone_VideoControls_set_active_device_channel(video_proxy, channel, &error);
1916
 
    check_error(error);
1917
 
}
1918
 
 
1919
 
void
1920
 
dbus_set_active_video_device_size(const gchar *size)
1921
 
{
1922
 
    GError *error = NULL;
1923
 
    org_sflphone_SFLphone_VideoControls_set_active_device_size(video_proxy, size, &error);
1924
 
    check_error(error);
1925
 
}
1926
 
 
1927
 
void
1928
 
dbus_set_active_video_device_rate(const gchar *rate)
1929
 
{
1930
 
    GError *error = NULL;
1931
 
    org_sflphone_SFLphone_VideoControls_set_active_device_rate(video_proxy, rate, &error);
1932
 
    check_error(error);
1933
 
}
1934
 
 
1935
 
gchar **
1936
 
dbus_get_video_device_list()
1937
 
{
1938
 
    gchar **array = NULL;
1939
 
    GError *error = NULL;
1940
 
 
1941
 
    org_sflphone_SFLphone_VideoControls_get_device_list(video_proxy, &array, &error);
1942
 
    check_error(error);
1943
 
    return array;
1944
 
}
1945
 
 
1946
 
/**
1947
 
 * Get the list of channels supported by the given device
1948
 
 */
1949
 
gchar **
1950
 
dbus_get_video_device_channel_list(const gchar *dev)
1951
 
{
1952
 
    gchar **array = NULL;
1953
 
    GError *error = NULL;
1954
 
    org_sflphone_SFLphone_VideoControls_get_device_channel_list(video_proxy, dev, &array, &error);
1955
 
    check_error(error);
1956
 
    return array;
1957
 
}
1958
 
 
1959
 
/**
1960
 
 * Get the list of resolutions supported by the given channel of the given device
1961
 
 */
1962
 
gchar **
1963
 
dbus_get_video_device_size_list(const gchar *dev, const gchar *channel)
1964
 
{
1965
 
    gchar **array = NULL;
1966
 
    GError *error = NULL;
1967
 
 
1968
 
    org_sflphone_SFLphone_VideoControls_get_device_size_list(video_proxy, dev, channel, &array, &error);
1969
 
    check_error(error);
1970
 
    return array;
1971
 
}
1972
 
 
1973
 
/**
1974
 
 * Get the list of frame rates supported by the given resolution of the given channel of the given device
1975
 
 */
1976
 
gchar **
1977
 
dbus_get_video_device_rate_list(const gchar *dev, const gchar *channel, const gchar *size)
1978
 
{
1979
 
    gchar **array = NULL;
1980
 
    GError *error = NULL;
1981
 
 
1982
 
    org_sflphone_SFLphone_VideoControls_get_device_rate_list(video_proxy, dev, channel, size, &array, &error);
1983
 
    check_error(error);
1984
 
    return array;
 
1908
dbus_video_get_default_device()
 
1909
{
 
1910
    gchar *str = NULL;
 
1911
    GError *error = NULL;
 
1912
 
 
1913
    org_sflphone_SFLphone_VideoManager_get_default_device(video_proxy, &str, &error);
 
1914
    check_error(error);
 
1915
 
 
1916
    return str;
 
1917
}
 
1918
 
 
1919
void
 
1920
dbus_video_set_default_device(const gchar *name)
 
1921
{
 
1922
    GError *error = NULL;
 
1923
    org_sflphone_SFLphone_VideoManager_set_default_device(video_proxy, name, &error);
 
1924
    check_error(error);
 
1925
}
 
1926
 
 
1927
GHashTable *
 
1928
dbus_video_get_settings(const gchar *name)
 
1929
{
 
1930
    GError *error = NULL;
 
1931
    GHashTable *settings = NULL;
 
1932
 
 
1933
    org_sflphone_SFLphone_VideoManager_get_settings(video_proxy, name, &settings, &error);
 
1934
    check_error(error);
 
1935
 
 
1936
    return settings;
 
1937
}
 
1938
 
 
1939
void
 
1940
dbus_video_apply_settings(const gchar *name, GHashTable *settings)
 
1941
{
 
1942
    GError *error = NULL;
 
1943
    org_sflphone_SFLphone_VideoManager_apply_settings(video_proxy, name, settings, &error);
 
1944
    check_error(error);
 
1945
}
 
1946
 
 
1947
gchar **
 
1948
dbus_video_get_device_list()
 
1949
{
 
1950
    gchar **array = NULL;
 
1951
    GError *error = NULL;
 
1952
 
 
1953
    org_sflphone_SFLphone_VideoManager_get_device_list(video_proxy, &array, &error);
 
1954
    check_error(error);
 
1955
    return array;
 
1956
}
 
1957
 
 
1958
GHashTable *
 
1959
dbus_video_get_capabilities(const gchar *name)
 
1960
{
 
1961
    GError *error = NULL;
 
1962
    GHashTable *cap = NULL;
 
1963
 
 
1964
    org_sflphone_SFLphone_VideoManager_get_capabilities(video_proxy, name, &cap, &error);
 
1965
    check_error(error);
 
1966
 
 
1967
    return cap;
1985
1968
}
1986
1969
#endif
1987
1970
 
2040
2023
}
2041
2024
 
2042
2025
gchar **
 
2026
dbus_get_display_names(const gchar *confID)
 
2027
{
 
2028
    GError *error = NULL;
 
2029
    gchar **list = NULL;
 
2030
 
 
2031
    org_sflphone_SFLphone_CallManager_get_display_names(call_proxy, confID, &list, &error);
 
2032
    check_error(error);
 
2033
 
 
2034
    return list;
 
2035
}
 
2036
 
 
2037
gchar **
2043
2038
dbus_get_participant_list(const gchar *confID)
2044
2039
{
2045
2040
    GError *error = NULL;
2046
2041
    gchar **list = NULL;
2047
2042
 
2048
 
    g_debug("Get conference %s participant list", confID);
2049
2043
    org_sflphone_SFLphone_CallManager_get_participant_list(call_proxy, confID, &list, &error);
2050
2044
    check_error(error);
2051
2045
 
2150
2144
    return results;
2151
2145
}
2152
2146
 
 
2147
gboolean
 
2148
dbus_check_certificate(const gchar *capath, const gchar *certpath)
 
2149
{
 
2150
    GError *error = NULL;
 
2151
    gboolean result;
 
2152
    org_sflphone_SFLphone_ConfigurationManager_check_certificate_validity(config_proxy, capath, certpath, &result, &error);
 
2153
    check_error(error);
 
2154
 
 
2155
    return result;
 
2156
}
 
2157
 
 
2158
gboolean
 
2159
dbus_certificate_contains_private_key(const gchar *filepath)
 
2160
{
 
2161
    GError *error = NULL;
 
2162
    gboolean result;
 
2163
    org_sflphone_SFLphone_ConfigurationManager_check_for_private_key(config_proxy, filepath, &result, &error);
 
2164
    check_error(error);
 
2165
 
 
2166
    return result;
 
2167
}
 
2168
 
2153
2169
gchar *
2154
2170
dbus_get_address_from_interface_name(const gchar *interface)
2155
2171
{
2226
2242
dbus_start_video_camera()
2227
2243
{
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);
2230
2246
}
2231
2247
 
2232
2248
void
2233
2249
dbus_stop_video_camera()
2234
2250
{
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);
2237
2253
}
2238
2254
 
2239
2255
gboolean
2241
2257
{
2242
2258
    GError *error = NULL;
2243
2259
    gboolean started = FALSE;
2244
 
    org_sflphone_SFLphone_VideoControls_has_camera_started(video_proxy, &started, &error);
 
2260
    org_sflphone_SFLphone_VideoManager_has_camera_started(video_proxy, &started, &error);
2245
2261
    check_error(error);
2246
2262
    return started;
2247
2263
}
2319
2335
{
2320
2336
    if (cookie == 0)
2321
2337
        return;
2322
 
    g_debug("uninhibit");
2323
2338
 
2324
2339
    GVariant *parameters = g_variant_new("(u)", cookie);
2325
2340
    if (parameters == NULL) {
2326
 
        g_warning("Could not create session manager uninhibit "
2327
 
               "parameters");
 
2341
        g_warning("Could not create session manager uninhibit parameters");
2328
2342
        return;
2329
2343
    }
2330
2344
 
2339
2353
dbus_presence_publish(const gchar *accountID, gboolean status)
2340
2354
{
2341
2355
    GError *error = NULL;
2342
 
    g_debug("DBus: publish presence status.");
2343
2356
    org_sflphone_SFLphone_PresenceManager_publish(presence_proxy, accountID,status, "Tout va bien.", NULL);
2344
2357
    check_error(error);
2345
2358
}
2347
2360
void
2348
2361
dbus_presence_subscribe(const gchar *accountID, const gchar *uri, gboolean flag)
2349
2362
{
2350
 
    g_debug("DBus: subscrbe presence status %s:%s.", uri, flag? "true" : "false");
2351
2363
    GError *error = NULL;
2352
2364
    org_sflphone_SFLphone_PresenceManager_subscribe_buddy(presence_proxy, accountID, uri, flag, NULL);
2353
2365
    check_error(error);