diff --git a/gnome/src/dbus/Makefile.am b/gnome/src/dbus/Makefile.am index 4c5ce7683b9290ca6b56a7207e8e16819d272797..846fa19609156f634dab61b86e3b73e919a83287 100644 --- a/gnome/src/dbus/Makefile.am +++ b/gnome/src/dbus/Makefile.am @@ -11,7 +11,7 @@ BUILT_SOURCES= \ # Rule to generate the binding headers %-glue.h: %-introspec.xml Makefile.am - dbus-binding-tool --mode=glib-client $< > $@ + dbus-binding-tool --mode=glib-client $< > $@ # Create the necessary marshallers for the signals implemented by the library marshaller.c: marshaller.list diff --git a/gnome/src/dbus/dbus.c b/gnome/src/dbus/dbus.c index 6ae99d082efb4809e103bc365fe27e9fc4bfc3af..e321a671498d0ee17cbab3f8e69df78cbace24e2 100644 --- a/gnome/src/dbus/dbus.c +++ b/gnome/src/dbus/dbus.c @@ -53,7 +53,9 @@ #include "eel-gconf-extensions.h" #include "mainwindow.h" -static DBusGProxy *callManagerProxy, *configurationManagerProxy, *instanceProxy; +static DBusGProxy *call_proxy; +static DBusGProxy *config_proxy; +static DBusGProxy *instance_proxy; /* Returns TRUE if there was an error, FALSE otherwise */ static gboolean check_error(GError *error) @@ -88,7 +90,8 @@ incoming_call_cb(DBusGProxy *proxy UNUSED, const gchar *accountID, gchar *display_name = call_get_display_name(from); gchar *peer_number = call_get_peer_number(from); - callable_obj_t *c = create_new_call(CALL, CALL_STATE_INCOMING, callID, accountID, display_name, peer_number); + callable_obj_t *c = create_new_call(CALL, CALL_STATE_INCOMING, callID, + accountID, display_name, peer_number); g_free(peer_number); g_free(display_name); @@ -127,8 +130,8 @@ voice_mail_cb(DBusGProxy *proxy UNUSED, const gchar *accountID, guint nb, } static void -incoming_message_cb(DBusGProxy *proxy UNUSED, const gchar *callID UNUSED, const gchar *from, - const gchar *msg, void *foo UNUSED) +incoming_message_cb(DBusGProxy *proxy UNUSED, const gchar *callID UNUSED, + const gchar *from, const gchar *msg, void *foo UNUSED) { // do not display message if instant messaging is disabled if (eel_gconf_key_exists(INSTANT_MESSAGING_ENABLED) && @@ -163,7 +166,8 @@ incoming_message_cb(DBusGProxy *proxy UNUSED, const gchar *callID UNUSED, const /** * Perform the right sflphone action based on the requested state */ -static void process_existing_call_state_change(callable_obj_t *c, const gchar *state) +static void +process_existing_call_state_change(callable_obj_t *c, const gchar *state) { if (c == NULL) { ERROR("Pointer to call is NULL in %s\n", __func__); @@ -182,7 +186,8 @@ static void process_existing_call_state_change(callable_obj_t *c, const gchar *s calltree_update_call(history_tab, c); status_bar_display_account(); sflphone_hung_up(c); - } else if (g_strcmp0(state, "UNHOLD_CURRENT") == 0) + } + else if (g_strcmp0(state, "UNHOLD_CURRENT") == 0) sflphone_current(c); else if (g_strcmp0(state, "UNHOLD_RECORD") == 0) sflphone_record(c); @@ -205,26 +210,23 @@ static void process_existing_call_state_change(callable_obj_t *c, const gchar *s * This function process call state changes in case the call have not been created yet. * This mainly occurs when anotehr SFLphone client takes actions. */ -static void process_nonexisting_call_state_change(const gchar *callID, const gchar *state) +static void +process_nonexisting_call_state_change(const gchar *callID, const gchar *state) { if (callID == NULL) { ERROR("Pointer to call id is NULL in %s\n", __func__); return; - } - - if (state == NULL) { + } else if (state == NULL) { ERROR("Pointer to state is NULL in %s\n", __func__); return; - } - - // Could occur if a user picked up the phone and hung up without making a call - if (g_strcmp0(state, "HUNGUP") == 0) - return; + } else if (g_strcmp0(state, "HUNGUP") == 0) + return; // Could occur if a user picked up the phone and hung up without making a call // The callID is unknow, threat it like a new call // If it were an incoming call, we won't be here // It means that a new call has been initiated with an other client (cli for instance) - if ((g_strcmp0(state, "RINGING")) == 0 || (g_strcmp0(state, "CURRENT")) == 0 || + if (g_strcmp0(state, "RINGING") == 0 || + g_strcmp0(state, "CURRENT") == 0 || g_strcmp0(state, "RECORD")) { DEBUG("DBUS: New ringing call! accountID: %s", callID); @@ -233,8 +235,10 @@ static void process_nonexisting_call_state_change(const gchar *callID, const gch GHashTable *call_details = dbus_get_call_details(callID); callable_obj_t *new_call = create_new_call_from_details(callID, call_details); - new_call->_history_state = (g_strcasecmp(g_hash_table_lookup(call_details, "CALL_TYPE"), INCOMING_STRING) == 0) - ? g_strdup(INCOMING_STRING) : g_strdup(OUTGOING_STRING); + if (g_strcasecmp(g_hash_table_lookup(call_details, "CALL_TYPE"), INCOMING_STRING) == 0) + new_call->_history_state = g_strdup(INCOMING_STRING); + else + new_call->_history_state = g_strdup(OUTGOING_STRING); calllist_add_call(current_calls_tab, new_call); calltree_add_call(current_calls_tab, new_call, NULL); @@ -244,7 +248,8 @@ static void process_nonexisting_call_state_change(const gchar *callID, const gch } static void -call_state_cb(DBusGProxy *proxy UNUSED, const gchar *callID, const gchar *state, void *foo UNUSED) +call_state_cb(DBusGProxy *proxy UNUSED, const gchar *callID, + const gchar *state, void *foo UNUSED) { callable_obj_t *c = calllist_get_call(current_calls_tab, callID); @@ -256,7 +261,8 @@ call_state_cb(DBusGProxy *proxy UNUSED, const gchar *callID, const gchar *state, } } -static void toggle_im(conference_obj_t *conf, gboolean activate) +static void +toggle_im(conference_obj_t *conf, gboolean activate) { for (GSList *p = conf->participant_list; p; p = g_slist_next(p)) { callable_obj_t *call = calllist_get_call(current_calls_tab, p->data); @@ -267,8 +273,8 @@ static void toggle_im(conference_obj_t *conf, gboolean activate) } static void -conference_changed_cb(DBusGProxy *proxy UNUSED, const gchar *confID, const gchar *state, - void *foo UNUSED) +conference_changed_cb(DBusGProxy *proxy UNUSED, const gchar *confID, + const gchar *state, void *foo UNUSED) { DEBUG("DBUS: Conference state changed: %s\n", state); @@ -345,10 +351,10 @@ conference_created_cb(DBusGProxy *proxy UNUSED, const gchar *confID, void *foo U } static void -conference_removed_cb(DBusGProxy *proxy UNUSED, const gchar *confID, void *foo UNUSED) +conference_removed_cb(DBusGProxy *proxy UNUSED, const gchar *confID, + void *foo UNUSED) { DEBUG("DBUS: Conference removed %s", confID); - conference_obj_t *c = conferencelist_get(current_calls_tab, confID); calltree_remove_conference(current_calls_tab, c); @@ -369,10 +375,10 @@ conference_removed_cb(DBusGProxy *proxy UNUSED, const gchar *confID, void *foo U } static void -record_playback_filepath_cb(DBusGProxy *proxy UNUSED, const gchar *id, const gchar *filepath) +record_playback_filepath_cb(DBusGProxy *proxy UNUSED, const gchar *id, + const gchar *filepath) { DEBUG("DBUS: Filepath for %s: %s", id, filepath); - callable_obj_t *call = calllist_get_call(current_calls_tab, id); conference_obj_t *conf = conferencelist_get(current_calls_tab, id); @@ -432,7 +438,6 @@ transfer_succeeded_cb(DBusGProxy *proxy UNUSED, void *foo UNUSED) static void transfer_failed_cb(DBusGProxy *proxy UNUSED, void *foo UNUSED) { - DEBUG("DBUS: Transfer failed"); sflphone_display_transfer_status("Transfer failed"); } @@ -573,22 +578,21 @@ gboolean dbus_connect(GError **error) /* Create a proxy object for the "bus driver" (name "org.freedesktop.DBus") */ - instanceProxy = dbus_g_proxy_new_for_name(connection, + instance_proxy = dbus_g_proxy_new_for_name(connection, "org.sflphone.SFLphone", "/org/sflphone/SFLphone/Instance", "org.sflphone.SFLphone.Instance"); - if (instanceProxy == NULL) { + if (instance_proxy == NULL) { ERROR("Failed to get proxy to Instance"); return FALSE; } DEBUG("DBus connected to Instance"); - callManagerProxy = dbus_g_proxy_new_for_name(connection, - "org.sflphone.SFLphone", - "/org/sflphone/SFLphone/CallManager", - "org.sflphone.SFLphone.CallManager"); - g_assert(callManagerProxy != NULL); + call_proxy = dbus_g_proxy_new_for_name(connection, "org.sflphone.SFLphone", + "/org/sflphone/SFLphone/CallManager", + "org.sflphone.SFLphone.CallManager"); + g_assert(call_proxy != NULL); DEBUG("DBus connected to CallManager"); /* STRING STRING STRING Marshaller */ @@ -596,125 +600,125 @@ gboolean dbus_connect(GError **error) dbus_g_object_register_marshaller( g_cclosure_user_marshal_VOID__STRING_STRING_STRING, G_TYPE_NONE, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_add_signal(callManagerProxy, "newCallCreated", G_TYPE_STRING, + dbus_g_proxy_add_signal(call_proxy, "newCallCreated", G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_connect_signal(callManagerProxy, "newCallCreated", + dbus_g_proxy_connect_signal(call_proxy, "newCallCreated", G_CALLBACK(new_call_created_cb), NULL, NULL); - dbus_g_proxy_add_signal(callManagerProxy, "incomingCall", G_TYPE_STRING, + dbus_g_proxy_add_signal(call_proxy, "incomingCall", G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_connect_signal(callManagerProxy, "incomingCall", + dbus_g_proxy_connect_signal(call_proxy, "incomingCall", G_CALLBACK(incoming_call_cb), NULL, NULL); - dbus_g_proxy_add_signal(callManagerProxy, "zrtpNegotiationFailed", + dbus_g_proxy_add_signal(call_proxy, "zrtpNegotiationFailed", G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_connect_signal(callManagerProxy, "zrtpNegotiationFailed", + dbus_g_proxy_connect_signal(call_proxy, "zrtpNegotiationFailed", G_CALLBACK(zrtp_negotiation_failed_cb), NULL, NULL); /* Register a marshaller for STRING,STRING */ dbus_g_object_register_marshaller( g_cclosure_user_marshal_VOID__STRING_STRING, G_TYPE_NONE, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_add_signal(callManagerProxy, "callStateChanged", G_TYPE_STRING, + dbus_g_proxy_add_signal(call_proxy, "callStateChanged", G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_connect_signal(callManagerProxy, "callStateChanged", + dbus_g_proxy_connect_signal(call_proxy, "callStateChanged", G_CALLBACK(call_state_cb), NULL, NULL); dbus_g_object_register_marshaller(g_cclosure_user_marshal_VOID__STRING_INT, G_TYPE_NONE, G_TYPE_STRING, G_TYPE_INT, G_TYPE_INVALID); - dbus_g_proxy_add_signal(callManagerProxy, "voiceMailNotify", G_TYPE_STRING, + dbus_g_proxy_add_signal(call_proxy, "voiceMailNotify", G_TYPE_STRING, G_TYPE_INT, G_TYPE_INVALID); - dbus_g_proxy_connect_signal(callManagerProxy, "voiceMailNotify", + dbus_g_proxy_connect_signal(call_proxy, "voiceMailNotify", G_CALLBACK(voice_mail_cb), NULL, NULL); - dbus_g_proxy_add_signal(callManagerProxy, "incomingMessage", G_TYPE_STRING, + dbus_g_proxy_add_signal(call_proxy, "incomingMessage", G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_connect_signal(callManagerProxy, "incomingMessage", + dbus_g_proxy_connect_signal(call_proxy, "incomingMessage", G_CALLBACK(incoming_message_cb), NULL, NULL); dbus_g_object_register_marshaller( g_cclosure_user_marshal_VOID__STRING_DOUBLE, G_TYPE_NONE, G_TYPE_STRING, G_TYPE_DOUBLE, G_TYPE_INVALID); - dbus_g_proxy_add_signal(callManagerProxy, "volumeChanged", G_TYPE_STRING, + dbus_g_proxy_add_signal(call_proxy, "volumeChanged", G_TYPE_STRING, G_TYPE_DOUBLE, G_TYPE_INVALID); - dbus_g_proxy_connect_signal(callManagerProxy, "volumeChanged", + dbus_g_proxy_connect_signal(call_proxy, "volumeChanged", G_CALLBACK(volume_changed_cb), NULL, NULL); - dbus_g_proxy_add_signal(callManagerProxy, "transferSucceeded", G_TYPE_INVALID); - dbus_g_proxy_connect_signal(callManagerProxy, "transferSucceeded", + dbus_g_proxy_add_signal(call_proxy, "transferSucceeded", G_TYPE_INVALID); + dbus_g_proxy_connect_signal(call_proxy, "transferSucceeded", G_CALLBACK(transfer_succeeded_cb), NULL, NULL); - dbus_g_proxy_add_signal(callManagerProxy, "transferFailed", G_TYPE_INVALID); - dbus_g_proxy_connect_signal(callManagerProxy, "transferFailed", + dbus_g_proxy_add_signal(call_proxy, "transferFailed", G_TYPE_INVALID); + dbus_g_proxy_connect_signal(call_proxy, "transferFailed", G_CALLBACK(transfer_failed_cb), NULL, NULL); /* Conference related callback */ dbus_g_object_register_marshaller(g_cclosure_user_marshal_VOID__STRING, G_TYPE_NONE, G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_add_signal(callManagerProxy, "conferenceChanged", G_TYPE_STRING, + dbus_g_proxy_add_signal(call_proxy, "conferenceChanged", G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_connect_signal(callManagerProxy, "conferenceChanged", + dbus_g_proxy_connect_signal(call_proxy, "conferenceChanged", G_CALLBACK(conference_changed_cb), NULL, NULL); - dbus_g_proxy_add_signal(callManagerProxy, "conferenceCreated", G_TYPE_STRING, + dbus_g_proxy_add_signal(call_proxy, "conferenceCreated", G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_connect_signal(callManagerProxy, "conferenceCreated", + dbus_g_proxy_connect_signal(call_proxy, "conferenceCreated", G_CALLBACK(conference_created_cb), NULL, NULL); - dbus_g_proxy_add_signal(callManagerProxy, "conferenceRemoved", G_TYPE_STRING, + dbus_g_proxy_add_signal(call_proxy, "conferenceRemoved", G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_connect_signal(callManagerProxy, "conferenceRemoved", + dbus_g_proxy_connect_signal(call_proxy, "conferenceRemoved", G_CALLBACK(conference_removed_cb), NULL, NULL); /* Playback related signals */ - dbus_g_proxy_add_signal(callManagerProxy, "recordPlaybackFilepath", G_TYPE_STRING, + dbus_g_proxy_add_signal(call_proxy, "recordPlaybackFilepath", G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_connect_signal(callManagerProxy, "recordPlaybackFilepath", + dbus_g_proxy_connect_signal(call_proxy, "recordPlaybackFilepath", G_CALLBACK(record_playback_filepath_cb), NULL, NULL); - dbus_g_proxy_add_signal(callManagerProxy, "recordPlaybackStopped", G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_connect_signal(callManagerProxy, "recordPlaybackStopped", + dbus_g_proxy_add_signal(call_proxy, "recordPlaybackStopped", G_TYPE_STRING, G_TYPE_INVALID); + dbus_g_proxy_connect_signal(call_proxy, "recordPlaybackStopped", G_CALLBACK(record_playback_stopped_cb), NULL, NULL); /* Security related callbacks */ - dbus_g_proxy_add_signal(callManagerProxy, "secureSdesOn", G_TYPE_STRING, + dbus_g_proxy_add_signal(call_proxy, "secureSdesOn", G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_connect_signal(callManagerProxy, "secureSdesOn", + dbus_g_proxy_connect_signal(call_proxy, "secureSdesOn", G_CALLBACK(secure_sdes_on_cb), NULL, NULL); - dbus_g_proxy_add_signal(callManagerProxy, "secureSdesOff", G_TYPE_STRING, + dbus_g_proxy_add_signal(call_proxy, "secureSdesOff", G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_connect_signal(callManagerProxy, "secureSdesOff", + dbus_g_proxy_connect_signal(call_proxy, "secureSdesOff", G_CALLBACK(secure_sdes_off_cb), NULL, NULL); /* Register a marshaller for STRING,STRING,BOOL */ dbus_g_object_register_marshaller( g_cclosure_user_marshal_VOID__STRING_STRING_BOOL, G_TYPE_NONE, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_INVALID); - dbus_g_proxy_add_signal(callManagerProxy, "showSAS", G_TYPE_STRING, + dbus_g_proxy_add_signal(call_proxy, "showSAS", G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_INVALID); - dbus_g_proxy_connect_signal(callManagerProxy, "showSAS", + dbus_g_proxy_connect_signal(call_proxy, "showSAS", G_CALLBACK(show_zrtp_sas_cb), NULL, NULL); - dbus_g_proxy_add_signal(callManagerProxy, "secureZrtpOn", G_TYPE_STRING, + dbus_g_proxy_add_signal(call_proxy, "secureZrtpOn", G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_connect_signal(callManagerProxy, "secureZrtpOn", + dbus_g_proxy_connect_signal(call_proxy, "secureZrtpOn", G_CALLBACK(secure_zrtp_on_cb), NULL, NULL); /* Register a marshaller for STRING*/ dbus_g_object_register_marshaller(g_cclosure_user_marshal_VOID__STRING, G_TYPE_NONE, G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_add_signal(callManagerProxy, "secureZrtpOff", G_TYPE_STRING, + dbus_g_proxy_add_signal(call_proxy, "secureZrtpOff", G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_connect_signal(callManagerProxy, "secureZrtpOff", + dbus_g_proxy_connect_signal(call_proxy, "secureZrtpOff", G_CALLBACK(secure_zrtp_off_cb), NULL, NULL); - dbus_g_proxy_add_signal(callManagerProxy, "zrtpNotSuppOther", G_TYPE_STRING, + dbus_g_proxy_add_signal(call_proxy, "zrtpNotSuppOther", G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_connect_signal(callManagerProxy, "zrtpNotSuppOther", + dbus_g_proxy_connect_signal(call_proxy, "zrtpNotSuppOther", G_CALLBACK(zrtp_not_supported_cb), NULL, NULL); - dbus_g_proxy_add_signal(callManagerProxy, "confirmGoClear", G_TYPE_STRING, + dbus_g_proxy_add_signal(call_proxy, "confirmGoClear", G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_connect_signal(callManagerProxy, "confirmGoClear", + dbus_g_proxy_connect_signal(call_proxy, "confirmGoClear", G_CALLBACK(confirm_go_clear_cb), NULL, NULL); /* VOID STRING STRING INT */ @@ -722,37 +726,36 @@ gboolean dbus_connect(GError **error) g_cclosure_user_marshal_VOID__STRING_STRING_INT, G_TYPE_NONE, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT, G_TYPE_INVALID); - dbus_g_proxy_add_signal(callManagerProxy, "sipCallStateChanged", + dbus_g_proxy_add_signal(call_proxy, "sipCallStateChanged", G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT, G_TYPE_INVALID); - dbus_g_proxy_connect_signal(callManagerProxy, "sipCallStateChanged", + dbus_g_proxy_connect_signal(call_proxy, "sipCallStateChanged", G_CALLBACK(sip_call_state_cb), NULL, NULL); - configurationManagerProxy = dbus_g_proxy_new_for_name(connection, + config_proxy = dbus_g_proxy_new_for_name(connection, "org.sflphone.SFLphone", "/org/sflphone/SFLphone/ConfigurationManager", "org.sflphone.SFLphone.ConfigurationManager"); - g_assert(configurationManagerProxy != NULL); + g_assert(config_proxy != NULL); DEBUG("DBus connected to ConfigurationManager"); - dbus_g_proxy_add_signal(configurationManagerProxy, "accountsChanged", - G_TYPE_INVALID); - dbus_g_proxy_connect_signal(configurationManagerProxy, "accountsChanged", + dbus_g_proxy_add_signal(config_proxy, "accountsChanged", G_TYPE_INVALID); + dbus_g_proxy_connect_signal(config_proxy, "accountsChanged", G_CALLBACK(accounts_changed_cb), NULL, NULL); dbus_g_object_register_marshaller(g_cclosure_user_marshal_VOID__INT, G_TYPE_NONE, G_TYPE_INT, G_TYPE_INVALID); - dbus_g_proxy_add_signal(configurationManagerProxy, "errorAlert", G_TYPE_INT, + dbus_g_proxy_add_signal(config_proxy, "errorAlert", G_TYPE_INT, G_TYPE_INVALID); - dbus_g_proxy_connect_signal(configurationManagerProxy, "errorAlert", + dbus_g_proxy_connect_signal(config_proxy, "errorAlert", G_CALLBACK(error_alert), NULL, NULL); /* Defines a default timeout for the proxies */ #if HAVE_DBUS_G_PROXY_SET_DEFAULT_TIMEOUT static const int DEFAULT_DBUS_TIMEOUT = 30000; - dbus_g_proxy_set_default_timeout(callManagerProxy, DEFAULT_DBUS_TIMEOUT); - dbus_g_proxy_set_default_timeout(instanceProxy, DEFAULT_DBUS_TIMEOUT); - dbus_g_proxy_set_default_timeout(configurationManagerProxy, DEFAULT_DBUS_TIMEOUT); + dbus_g_proxy_set_default_timeout(call_proxy, DEFAULT_DBUS_TIMEOUT); + dbus_g_proxy_set_default_timeout(instance_proxy, DEFAULT_DBUS_TIMEOUT); + dbus_g_proxy_set_default_timeout(config_proxy, DEFAULT_DBUS_TIMEOUT); #endif return TRUE; @@ -760,16 +763,15 @@ gboolean dbus_connect(GError **error) void dbus_clean() { - g_object_unref(callManagerProxy); - g_object_unref(configurationManagerProxy); - g_object_unref(instanceProxy); + g_object_unref(call_proxy); + g_object_unref(config_proxy); + g_object_unref(instance_proxy); } void dbus_hold(const callable_obj_t *c) { GError *error = NULL; - org_sflphone_SFLphone_CallManager_hold(callManagerProxy, c->_callID, - &error); + org_sflphone_SFLphone_CallManager_hold(call_proxy, c->_callID, &error); check_error(error); } @@ -777,8 +779,7 @@ void dbus_unhold(const callable_obj_t *c) { GError *error = NULL; - org_sflphone_SFLphone_CallManager_unhold(callManagerProxy, c->_callID, - &error); + org_sflphone_SFLphone_CallManager_unhold(call_proxy, c->_callID, &error); check_error(error); } @@ -786,8 +787,7 @@ void dbus_hold_conference(const conference_obj_t *c) { GError *error = NULL; - org_sflphone_SFLphone_CallManager_hold_conference(callManagerProxy, - c->_confID, &error); + org_sflphone_SFLphone_CallManager_hold_conference(call_proxy, c->_confID, &error); check_error(error); } @@ -795,8 +795,7 @@ void dbus_unhold_conference(const conference_obj_t *c) { GError *error = NULL; - org_sflphone_SFLphone_CallManager_unhold_conference(callManagerProxy, - c->_confID, &error); + org_sflphone_SFLphone_CallManager_unhold_conference(call_proxy, c->_confID, &error); check_error(error); } @@ -806,8 +805,7 @@ dbus_start_recorded_file_playback(const gchar *filepath) GError *error = NULL; gboolean result; - org_sflphone_SFLphone_CallManager_start_recorded_file_playback(callManagerProxy, - filepath, &result, &error); + org_sflphone_SFLphone_CallManager_start_recorded_file_playback(call_proxy, filepath, &result, &error); check_error(error); return result; } @@ -816,8 +814,7 @@ void dbus_stop_recorded_file_playback(const gchar *filepath) { GError *error = NULL; - org_sflphone_SFLphone_CallManager_stop_recorded_file_playback(callManagerProxy, - filepath, &error); + org_sflphone_SFLphone_CallManager_stop_recorded_file_playback(call_proxy, filepath, &error); check_error(error); } @@ -825,7 +822,7 @@ void dbus_hang_up(const callable_obj_t *c) { GError *error = NULL; - org_sflphone_SFLphone_CallManager_hang_up(callManagerProxy, c->_callID, &error); + org_sflphone_SFLphone_CallManager_hang_up(call_proxy, c->_callID, &error); check_error(error); } @@ -833,8 +830,7 @@ void dbus_hang_up_conference(const conference_obj_t *c) { GError *error = NULL; - org_sflphone_SFLphone_CallManager_hang_up_conference(callManagerProxy, - c->_confID, &error); + org_sflphone_SFLphone_CallManager_hang_up_conference(call_proxy, c->_confID, &error); check_error(error); } @@ -842,8 +838,7 @@ void dbus_transfer(const callable_obj_t *c) { GError *error = NULL; - org_sflphone_SFLphone_CallManager_transfer(callManagerProxy, c->_callID, - c->_trsft_to, &error); + org_sflphone_SFLphone_CallManager_transfer(call_proxy, c->_callID, c->_trsft_to, &error); check_error(error); } @@ -851,10 +846,8 @@ void dbus_attended_transfer(const callable_obj_t *transfer, const callable_obj_t *target) { GError *error = NULL; - org_sflphone_SFLphone_CallManager_attended_transfer(callManagerProxy, - transfer->_callID, - target->_callID, - &error); + org_sflphone_SFLphone_CallManager_attended_transfer(call_proxy, transfer->_callID, + target->_callID, &error); check_error(error); } @@ -862,10 +855,8 @@ void dbus_accept(const callable_obj_t *c) { status_tray_icon_blink(FALSE); - GError *error = NULL; - org_sflphone_SFLphone_CallManager_accept(callManagerProxy, c->_callID, - &error); + org_sflphone_SFLphone_CallManager_accept(call_proxy, c->_callID, &error); check_error(error); } @@ -874,8 +865,7 @@ dbus_refuse(const callable_obj_t *c) { status_tray_icon_blink(FALSE); GError *error = NULL; - org_sflphone_SFLphone_CallManager_refuse(callManagerProxy, c->_callID, - &error); + org_sflphone_SFLphone_CallManager_refuse(call_proxy, c->_callID, &error); check_error(error); } @@ -883,10 +873,8 @@ void dbus_place_call(const callable_obj_t *c) { GError *error = NULL; - - org_sflphone_SFLphone_CallManager_place_call(callManagerProxy, - c->_accountID, c->_callID, - c->_peer_number, &error); + org_sflphone_SFLphone_CallManager_place_call(call_proxy, c->_accountID, c->_callID, c->_peer_number, + &error); check_error(error); } @@ -896,10 +884,8 @@ dbus_account_list() GError *error = NULL; char **array = NULL; - if (!org_sflphone_SFLphone_ConfigurationManager_get_account_list(configurationManagerProxy, - &array, &error)) { - if (error->domain == DBUS_GERROR && - error->code == DBUS_GERROR_REMOTE_EXCEPTION) + if (!org_sflphone_SFLphone_ConfigurationManager_get_account_list(config_proxy, &array, &error)) { + if (error->domain == DBUS_GERROR && error->code == DBUS_GERROR_REMOTE_EXCEPTION) ERROR("Caught remote method (get_account_list) exception %s: %s", dbus_g_error_get_name(error), error->message); else @@ -918,10 +904,8 @@ dbus_get_account_details(const gchar *accountID) GError *error = NULL; GHashTable *details = NULL; - if (!org_sflphone_SFLphone_ConfigurationManager_get_account_details( - configurationManagerProxy, accountID, &details, &error)) { - if (error->domain == DBUS_GERROR && - error->code == DBUS_GERROR_REMOTE_EXCEPTION) + if (!org_sflphone_SFLphone_ConfigurationManager_get_account_details(config_proxy, accountID, &details, &error)) { + if (error->domain == DBUS_GERROR && error->code == DBUS_GERROR_REMOTE_EXCEPTION) ERROR("Caught remote method exception %s: %s", dbus_g_error_get_name(error), error->message); else @@ -938,11 +922,9 @@ void dbus_set_credentials(account_t *a) { g_assert(a); - DEBUG("DBUS: Sending credentials to server"); - GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_credentials( - configurationManagerProxy, a->accountID, a->credential_information, &error); + org_sflphone_SFLphone_ConfigurationManager_set_credentials(config_proxy, a->accountID, + a->credential_information, &error); check_error(error); } @@ -951,9 +933,8 @@ dbus_get_credentials(account_t *a) { g_assert(a); GError *error = NULL; - - if (org_sflphone_SFLphone_ConfigurationManager_get_credentials( - configurationManagerProxy, a->accountID, &a->credential_information, &error)) + if (org_sflphone_SFLphone_ConfigurationManager_get_credentials(config_proxy, a->accountID, + &a->credential_information, &error)) return; if (error->domain == DBUS_GERROR && @@ -972,8 +953,7 @@ dbus_get_ip2_ip_details(void) GError *error = NULL; GHashTable *details = NULL; - if (!org_sflphone_SFLphone_ConfigurationManager_get_ip2_ip_details( - configurationManagerProxy, &details, &error)) { + if (!org_sflphone_SFLphone_ConfigurationManager_get_ip2_ip_details(config_proxy, &details, &error)) { if (error->domain == DBUS_GERROR && error->code == DBUS_GERROR_REMOTE_EXCEPTION) ERROR("Caught remote method (get_ip2_ip_details) exception %s: %s", @@ -991,8 +971,7 @@ void dbus_send_register(const gchar *accountID, gboolean enable) { GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_send_register( - configurationManagerProxy, accountID, enable, &error); + org_sflphone_SFLphone_ConfigurationManager_send_register(config_proxy, accountID, enable, &error); check_error(error); } @@ -1000,8 +979,7 @@ void dbus_remove_account(const gchar *accountID) { GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_remove_account( - configurationManagerProxy, accountID, &error); + org_sflphone_SFLphone_ConfigurationManager_remove_account(config_proxy, accountID, &error); check_error(error); } @@ -1010,8 +988,8 @@ dbus_set_account_details(account_t *a) { g_assert(a); GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_account_details( - configurationManagerProxy, a->accountID, a->properties, &error); + org_sflphone_SFLphone_ConfigurationManager_set_account_details(config_proxy, a->accountID, a->properties, + &error); check_error(error); } @@ -1021,8 +999,8 @@ dbus_add_account(account_t *a) g_assert(a); GError *error = NULL; g_free(a->accountID); - org_sflphone_SFLphone_ConfigurationManager_add_account( - configurationManagerProxy, a->properties, &a->accountID, &error); + org_sflphone_SFLphone_ConfigurationManager_add_account(config_proxy, a->properties, &a->accountID, + &error); check_error(error); } @@ -1030,8 +1008,7 @@ void dbus_set_volume(const gchar *device, gdouble value) { GError *error = NULL; - org_sflphone_SFLphone_CallManager_set_volume(callManagerProxy, device, - value, &error); + org_sflphone_SFLphone_CallManager_set_volume(call_proxy, device, value, &error); check_error(error); } @@ -1040,9 +1017,7 @@ dbus_get_volume(const gchar *device) { gdouble value; GError *error = NULL; - - org_sflphone_SFLphone_CallManager_get_volume(callManagerProxy, device, - &value, &error); + org_sflphone_SFLphone_CallManager_get_volume(call_proxy, device, &value, &error); check_error(error); return value; } @@ -1051,7 +1026,7 @@ void dbus_play_dtmf(const gchar *key) { GError *error = NULL; - org_sflphone_SFLphone_CallManager_play_dt_mf(callManagerProxy, key, &error); + org_sflphone_SFLphone_CallManager_play_dt_mf(call_proxy, key, &error); check_error(error); } @@ -1059,22 +1034,22 @@ void dbus_start_tone(int start, guint type) { GError *error = NULL; - org_sflphone_SFLphone_CallManager_start_tone(callManagerProxy, start, type, - &error); + org_sflphone_SFLphone_CallManager_start_tone(call_proxy, start, type, &error); check_error(error); } gboolean dbus_register(int pid, const gchar *name, GError **error) { - return org_sflphone_SFLphone_Instance_register(instanceProxy, pid, name, error); + return org_sflphone_SFLphone_Instance_register(instance_proxy, pid, name, + error); } void dbus_unregister(int pid) { GError *error = NULL; - org_sflphone_SFLphone_Instance_unregister(instanceProxy, pid, &error); + org_sflphone_SFLphone_Instance_unregister(instance_proxy, pid, &error); check_error(error); } @@ -1083,8 +1058,7 @@ dbus_audio_codec_list() { GError *error = NULL; GArray *array = NULL; - org_sflphone_SFLphone_ConfigurationManager_get_audio_codec_list( - configurationManagerProxy, &array, &error); + org_sflphone_SFLphone_ConfigurationManager_get_audio_codec_list(config_proxy, &array, &error); check_error(error); return array; } @@ -1094,8 +1068,7 @@ dbus_audio_codec_details(int payload) { GError *error = NULL; gchar **array; - org_sflphone_SFLphone_ConfigurationManager_get_audio_codec_details( - configurationManagerProxy, payload, &array, &error); + org_sflphone_SFLphone_ConfigurationManager_get_audio_codec_details(config_proxy, payload, &array, &error); check_error(error); return array; } @@ -1106,8 +1079,8 @@ dbus_get_current_audio_codec_name(const callable_obj_t *c) gchar *codecName = NULL; GError *error = NULL; - org_sflphone_SFLphone_CallManager_get_current_audio_codec_name(callManagerProxy, - c->_callID, &codecName, &error); + org_sflphone_SFLphone_CallManager_get_current_audio_codec_name(call_proxy, c->_callID, &codecName, + &error); check_error(error); DEBUG("%s: codecName : %s", __PRETTY_FUNCTION__, codecName); return codecName; @@ -1118,8 +1091,8 @@ dbus_get_active_audio_codec_list(const gchar *accountID) { GArray *array = NULL; GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_get_active_audio_codec_list( - configurationManagerProxy, accountID, &array, &error); + org_sflphone_SFLphone_ConfigurationManager_get_active_audio_codec_list(config_proxy, accountID, &array, + &error); check_error(error); return array; @@ -1129,8 +1102,7 @@ void dbus_set_active_audio_codec_list(const gchar **list, const gchar *accountID) { GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_active_audio_codec_list( - configurationManagerProxy, list, accountID, &error); + org_sflphone_SFLphone_ConfigurationManager_set_active_audio_codec_list(config_proxy, list, accountID, &error); check_error(error); } @@ -1143,11 +1115,10 @@ dbus_get_audio_plugin_list() gchar **array = NULL; GError *error = NULL; - if (!org_sflphone_SFLphone_ConfigurationManager_get_audio_plugin_list( - configurationManagerProxy, &array, &error)) { - if (error->domain == DBUS_GERROR && - error->code == DBUS_GERROR_REMOTE_EXCEPTION) - ERROR("Caught remote method (get_output_plugin_list) exception %s: %s", dbus_g_error_get_name(error), error->message); + if (!org_sflphone_SFLphone_ConfigurationManager_get_audio_plugin_list(config_proxy, &array, &error)) { + if (error->domain == DBUS_GERROR && error->code == DBUS_GERROR_REMOTE_EXCEPTION) + ERROR("Caught remote method (get_output_plugin_list) exception" + "%s: %s", dbus_g_error_get_name(error), error->message); else ERROR("Error while calling get_out_plugin_list: %s", error->message); @@ -1161,8 +1132,7 @@ void dbus_set_audio_plugin(const gchar *audioPlugin) { GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_audio_plugin( - configurationManagerProxy, audioPlugin, &error); + org_sflphone_SFLphone_ConfigurationManager_set_audio_plugin(config_proxy, audioPlugin, &error); check_error(error); } @@ -1174,8 +1144,7 @@ dbus_get_audio_output_device_list() { gchar **array = NULL; GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_get_audio_output_device_list( - configurationManagerProxy, &array, &error); + org_sflphone_SFLphone_ConfigurationManager_get_audio_output_device_list(config_proxy, &array, &error); check_error(error); return array; } @@ -1187,8 +1156,7 @@ void dbus_set_audio_output_device(int device) { GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_audio_output_device( - configurationManagerProxy, device, &error); + org_sflphone_SFLphone_ConfigurationManager_set_audio_output_device(config_proxy, device, &error); check_error(error); } @@ -1199,8 +1167,7 @@ void dbus_set_audio_input_device(int device) { GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_audio_input_device( - configurationManagerProxy, device, &error); + org_sflphone_SFLphone_ConfigurationManager_set_audio_input_device(config_proxy, device, &error); check_error(error); } @@ -1211,8 +1178,7 @@ void dbus_set_audio_ringtone_device(int device) { GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_audio_ringtone_device( - configurationManagerProxy, device, &error); + org_sflphone_SFLphone_ConfigurationManager_set_audio_ringtone_device(config_proxy, device, &error); check_error(error); } @@ -1224,8 +1190,7 @@ dbus_get_audio_input_device_list() { gchar **array = NULL; GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_get_audio_input_device_list( - configurationManagerProxy, &array, &error); + org_sflphone_SFLphone_ConfigurationManager_get_audio_input_device_list(config_proxy, &array, &error); check_error(error); return array; @@ -1239,8 +1204,7 @@ dbus_get_current_audio_devices_index() { gchar **array = NULL; GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_get_current_audio_devices_index( - configurationManagerProxy, &array, &error); + org_sflphone_SFLphone_ConfigurationManager_get_current_audio_devices_index(config_proxy, &array, &error); check_error(error); return array; @@ -1254,8 +1218,7 @@ dbus_get_audio_device_index(const gchar *name) { int device_index = 0; GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_get_audio_device_index( - configurationManagerProxy, name, &device_index, &error); + org_sflphone_SFLphone_ConfigurationManager_get_audio_device_index(config_proxy, name, &device_index, &error); check_error(error); return device_index; @@ -1269,8 +1232,7 @@ dbus_get_current_audio_output_plugin() { gchar *plugin; GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_get_current_audio_output_plugin( - configurationManagerProxy, &plugin, &error); + org_sflphone_SFLphone_ConfigurationManager_get_current_audio_output_plugin(config_proxy, &plugin, &error); if (check_error(error)) plugin = g_strdup(""); @@ -1286,7 +1248,7 @@ dbus_get_noise_suppress_state() { gchar *state; GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_get_noise_suppress_state(configurationManagerProxy, &state, &error); + org_sflphone_SFLphone_ConfigurationManager_get_noise_suppress_state(config_proxy, &state, &error); if (check_error(error)) state = g_strdup(""); @@ -1301,11 +1263,11 @@ void dbus_set_noise_suppress_state(const gchar *state) { GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_noise_suppress_state( - configurationManagerProxy, state, &error); + org_sflphone_SFLphone_ConfigurationManager_set_noise_suppress_state(config_proxy, state, &error); if (error) { - ERROR("Failed to call set_noise_suppress_state() on ConfigurationManager: %s", error->message); + ERROR("Failed to call set_noise_suppress_state() on " + "ConfigurationManager: %s", error->message); g_error_free(error); } } @@ -1315,7 +1277,7 @@ dbus_get_echo_cancel_state(void) { GError *error = NULL; gchar *state; - org_sflphone_SFLphone_ConfigurationManager_get_echo_cancel_state(configurationManagerProxy, &state, &error); + org_sflphone_SFLphone_ConfigurationManager_get_echo_cancel_state(config_proxy, &state, &error); if (check_error(error)) state = g_strdup(""); @@ -1327,7 +1289,7 @@ void dbus_set_echo_cancel_state(const gchar *state) { GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_echo_cancel_state(configurationManagerProxy, state, &error); + org_sflphone_SFLphone_ConfigurationManager_set_echo_cancel_state(config_proxy, state, &error); check_error(error); } @@ -1336,8 +1298,7 @@ dbus_get_echo_cancel_tail_length(void) { GError *error = NULL; int length = 0; - - org_sflphone_SFLphone_ConfigurationManager_get_echo_cancel_tail_length(configurationManagerProxy, &length, &error); + org_sflphone_SFLphone_ConfigurationManager_get_echo_cancel_tail_length(config_proxy, &length, &error); check_error(error); return length; } @@ -1346,7 +1307,7 @@ void dbus_set_echo_cancel_tail_length(int length) { GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_echo_cancel_tail_length(configurationManagerProxy, length, &error); + org_sflphone_SFLphone_ConfigurationManager_set_echo_cancel_tail_length(config_proxy, length, &error); check_error(error); } @@ -1355,7 +1316,7 @@ dbus_get_echo_cancel_delay(void) { GError *error = NULL; int delay = 0; - org_sflphone_SFLphone_ConfigurationManager_get_echo_cancel_delay(configurationManagerProxy, &delay, &error); + org_sflphone_SFLphone_ConfigurationManager_get_echo_cancel_delay(config_proxy, &delay, &error); check_error(error); return delay; @@ -1365,8 +1326,7 @@ void dbus_set_echo_cancel_delay(int delay) { GError *error = NULL; - - org_sflphone_SFLphone_ConfigurationManager_set_echo_cancel_delay(configurationManagerProxy, delay, &error); + org_sflphone_SFLphone_ConfigurationManager_set_echo_cancel_delay(config_proxy, delay, &error); check_error(error); } @@ -1376,8 +1336,7 @@ dbus_is_iax2_enabled() { int res = 0; GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_is_iax2_enabled( - configurationManagerProxy, &res, &error); + org_sflphone_SFLphone_ConfigurationManager_is_iax2_enabled(config_proxy, &res, &error); check_error(error); return res; @@ -1388,9 +1347,7 @@ dbus_join_participant(const gchar *sel_callID, const gchar *drag_callID) { DEBUG("DBUS: Join participant %s and %s\n", sel_callID, drag_callID); GError *error = NULL; - - org_sflphone_SFLphone_CallManager_join_participant(callManagerProxy, - sel_callID, drag_callID, &error); + org_sflphone_SFLphone_CallManager_join_participant(call_proxy, sel_callID, drag_callID, &error); check_error(error); } @@ -1398,8 +1355,7 @@ void dbus_create_conf_from_participant_list(const gchar **list) { GError *error = NULL; - org_sflphone_SFLphone_CallManager_create_conf_from_participant_list(callManagerProxy, - list, &error); + org_sflphone_SFLphone_CallManager_create_conf_from_participant_list(call_proxy, list, &error); check_error(error); } @@ -1408,9 +1364,7 @@ dbus_add_participant(const gchar *callID, const gchar *confID) { DEBUG("DBUS: Add participant %s to %s\n", callID, confID); GError *error = NULL; - - org_sflphone_SFLphone_CallManager_add_participant(callManagerProxy, callID, - confID, &error); + org_sflphone_SFLphone_CallManager_add_participant(call_proxy, callID, confID, &error); check_error(error); } @@ -1418,8 +1372,7 @@ void dbus_add_main_participant(const gchar *confID) { GError *error = NULL; - org_sflphone_SFLphone_CallManager_add_main_participant(callManagerProxy, - confID, &error); + org_sflphone_SFLphone_CallManager_add_main_participant(call_proxy, confID, &error); check_error(error); } @@ -1427,8 +1380,7 @@ void dbus_detach_participant(const gchar *callID) { GError *error = NULL; - org_sflphone_SFLphone_CallManager_detach_participant(callManagerProxy, - callID, &error); + org_sflphone_SFLphone_CallManager_detach_participant(call_proxy, callID, &error); check_error(error); } @@ -1437,10 +1389,7 @@ dbus_join_conference(const gchar *sel_confID, const gchar *drag_confID) { DEBUG("dbus_join_conference %s and %s\n", sel_confID, drag_confID); GError *error = NULL; - - org_sflphone_SFLphone_CallManager_join_conference(callManagerProxy, - sel_confID, drag_confID, - &error); + org_sflphone_SFLphone_CallManager_join_conference(call_proxy, sel_confID, drag_confID, &error); check_error(error); } @@ -1448,7 +1397,7 @@ void dbus_set_record(const gchar *id) { GError *error = NULL; - org_sflphone_SFLphone_CallManager_set_recording(callManagerProxy, id, &error); + org_sflphone_SFLphone_CallManager_set_recording(call_proxy, id, &error); check_error(error); } @@ -1457,8 +1406,7 @@ dbus_get_is_recording(const callable_obj_t *c) { GError *error = NULL; gboolean isRecording; - org_sflphone_SFLphone_CallManager_get_is_recording(callManagerProxy, - c->_callID, &isRecording, &error); + org_sflphone_SFLphone_CallManager_get_is_recording(call_proxy, c->_callID, &isRecording, &error); check_error(error); return isRecording; @@ -1468,9 +1416,7 @@ void dbus_set_record_path(const gchar *path) { GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_record_path( - configurationManagerProxy, path, &error); - + org_sflphone_SFLphone_ConfigurationManager_set_record_path(config_proxy, path, &error); check_error(error); } @@ -1479,8 +1425,7 @@ dbus_get_record_path(void) { GError *error = NULL; gchar *path; - org_sflphone_SFLphone_ConfigurationManager_get_record_path( - configurationManagerProxy, &path, &error); + org_sflphone_SFLphone_ConfigurationManager_get_record_path(config_proxy, &path, &error); check_error(error); return path; @@ -1489,8 +1434,7 @@ dbus_get_record_path(void) void dbus_set_is_always_recording(const gboolean alwaysRec) { GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_is_always_recording( - configurationManagerProxy, alwaysRec, &error); + org_sflphone_SFLphone_ConfigurationManager_set_is_always_recording(config_proxy, alwaysRec, &error); check_error(error); } @@ -1498,8 +1442,7 @@ gboolean dbus_get_is_always_recording(void) { GError *error = NULL; gboolean alwaysRec; - org_sflphone_SFLphone_ConfigurationManager_get_is_always_recording( - configurationManagerProxy, &alwaysRec, &error); + org_sflphone_SFLphone_ConfigurationManager_get_is_always_recording(config_proxy, &alwaysRec, &error); check_error(error); return alwaysRec; @@ -1509,8 +1452,7 @@ void dbus_set_history_limit(guint days) { GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_history_limit( - configurationManagerProxy, days, &error); + org_sflphone_SFLphone_ConfigurationManager_set_history_limit(config_proxy, days, &error); check_error(error); } @@ -1519,8 +1461,7 @@ dbus_get_history_limit(void) { GError *error = NULL; gint days = 30; - org_sflphone_SFLphone_ConfigurationManager_get_history_limit( - configurationManagerProxy, &days, &error); + org_sflphone_SFLphone_ConfigurationManager_get_history_limit(config_proxy, &days, &error); check_error(error); return days; @@ -1530,8 +1471,7 @@ void dbus_clear_history(void) { GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_clear_history( - configurationManagerProxy, &error); + org_sflphone_SFLphone_ConfigurationManager_clear_history(config_proxy, &error); check_error(error); } @@ -1539,8 +1479,7 @@ void dbus_set_audio_manager(const gchar *api) { GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_audio_manager( - configurationManagerProxy, api, &error); + org_sflphone_SFLphone_ConfigurationManager_set_audio_manager(config_proxy, api, &error); check_error(error); } @@ -1549,8 +1488,7 @@ dbus_get_audio_manager(void) { gchar *api; GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_get_audio_manager( - configurationManagerProxy, &api, &error); + org_sflphone_SFLphone_ConfigurationManager_get_audio_manager(config_proxy, &api, &error); check_error(error); return api; @@ -1562,9 +1500,7 @@ dbus_get_addressbook_settings(void) { GError *error = NULL; GHashTable *results = NULL; - - org_sflphone_SFLphone_ConfigurationManager_get_addressbook_settings( - configurationManagerProxy, &results, &error); + org_sflphone_SFLphone_ConfigurationManager_get_addressbook_settings(config_proxy, &results, &error); check_error(error); return results; @@ -1574,10 +1510,7 @@ void dbus_set_addressbook_settings(GHashTable *settings) { GError *error = NULL; - DEBUG("Calling org_sflphone_SFLphone_ConfigurationManager_set_addressbook_settings"); - - org_sflphone_SFLphone_ConfigurationManager_set_addressbook_settings( - configurationManagerProxy, settings, &error); + org_sflphone_SFLphone_ConfigurationManager_set_addressbook_settings(config_proxy, settings, &error); check_error(error); } @@ -1586,9 +1519,7 @@ dbus_get_addressbook_list(void) { GError *error = NULL; gchar **array = NULL; - - org_sflphone_SFLphone_ConfigurationManager_get_addressbook_list( - configurationManagerProxy, &array, &error); + org_sflphone_SFLphone_ConfigurationManager_get_addressbook_list(config_proxy, &array, &error); check_error(error); return array; @@ -1598,9 +1529,7 @@ void dbus_set_addressbook_list(const gchar **list) { GError *error = NULL; - - org_sflphone_SFLphone_ConfigurationManager_set_addressbook_list( - configurationManagerProxy, list, &error); + org_sflphone_SFLphone_ConfigurationManager_set_addressbook_list(config_proxy, list, &error); check_error(error); } @@ -1611,8 +1540,7 @@ dbus_get_hook_settings(void) GError *error = NULL; GHashTable *results = NULL; - org_sflphone_SFLphone_ConfigurationManager_get_hook_settings( - configurationManagerProxy, &results, &error); + org_sflphone_SFLphone_ConfigurationManager_get_hook_settings(config_proxy, &results, &error); check_error(error); return results; @@ -1622,8 +1550,7 @@ void dbus_set_hook_settings(GHashTable *settings) { GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_hook_settings( - configurationManagerProxy, settings, &error); + org_sflphone_SFLphone_ConfigurationManager_set_hook_settings(config_proxy, settings, &error); check_error(error); } @@ -1632,9 +1559,7 @@ dbus_get_call_details(const gchar *callID) { GError *error = NULL; GHashTable *details = NULL; - - org_sflphone_SFLphone_CallManager_get_call_details(callManagerProxy, callID, - &details, &error); + org_sflphone_SFLphone_CallManager_get_call_details(call_proxy, callID, &details, &error); check_error(error); return details; @@ -1645,9 +1570,7 @@ dbus_get_call_list(void) { GError *error = NULL; gchar **list = NULL; - - org_sflphone_SFLphone_CallManager_get_call_list(callManagerProxy, &list, - &error); + org_sflphone_SFLphone_CallManager_get_call_list(call_proxy, &list, &error); check_error(error); return list; @@ -1658,9 +1581,7 @@ dbus_get_conference_list(void) { GError *error = NULL; gchar **list = NULL; - - org_sflphone_SFLphone_CallManager_get_conference_list(callManagerProxy, - &list, &error); + org_sflphone_SFLphone_CallManager_get_conference_list(call_proxy, &list, &error); check_error(error); return list; @@ -1673,10 +1594,7 @@ dbus_get_participant_list(const gchar *confID) char **list = NULL; DEBUG("DBUS: Get conference %s participant list", confID); - - org_sflphone_SFLphone_CallManager_get_participant_list(callManagerProxy, - confID, &list, - &error); + org_sflphone_SFLphone_CallManager_get_participant_list(call_proxy, confID, &list, &error); check_error(error); return list; @@ -1687,10 +1605,7 @@ dbus_get_conference_details(const gchar *confID) { GError *error = NULL; GHashTable *details = NULL; - - org_sflphone_SFLphone_CallManager_get_conference_details(callManagerProxy, - confID, &details, - &error); + org_sflphone_SFLphone_CallManager_get_conference_details(call_proxy, confID, &details, &error); check_error(error); return details; @@ -1700,9 +1615,7 @@ void dbus_set_accounts_order(const gchar *order) { GError *error = NULL; - - org_sflphone_SFLphone_ConfigurationManager_set_accounts_order( - configurationManagerProxy, order, &error); + org_sflphone_SFLphone_ConfigurationManager_set_accounts_order(config_proxy, order, &error); check_error(error); } @@ -1711,9 +1624,7 @@ dbus_get_history(void) { GError *error = NULL; GPtrArray *entries = NULL; - - org_sflphone_SFLphone_ConfigurationManager_get_history( - configurationManagerProxy, &entries, &error); + org_sflphone_SFLphone_ConfigurationManager_get_history(config_proxy, &entries, &error); check_error(error); return entries; @@ -1723,8 +1634,7 @@ void dbus_confirm_sas(const callable_obj_t *c) { GError *error = NULL; - org_sflphone_SFLphone_CallManager_set_sa_sverified(callManagerProxy, - c->_callID, &error); + org_sflphone_SFLphone_CallManager_set_sa_sverified(call_proxy, c->_callID, &error); check_error(error); } @@ -1732,8 +1642,7 @@ void dbus_reset_sas(const callable_obj_t *c) { GError *error = NULL; - org_sflphone_SFLphone_CallManager_reset_sa_sverified(callManagerProxy, - c->_callID, &error); + org_sflphone_SFLphone_CallManager_reset_sa_sverified(call_proxy, c->_callID, &error); check_error(error); } @@ -1741,8 +1650,7 @@ void dbus_set_confirm_go_clear(const callable_obj_t *c) { GError *error = NULL; - org_sflphone_SFLphone_CallManager_set_confirm_go_clear(callManagerProxy, - c->_callID, &error); + org_sflphone_SFLphone_CallManager_set_confirm_go_clear(call_proxy, c->_callID, &error); check_error(error); } @@ -1750,8 +1658,7 @@ void dbus_request_go_clear(const callable_obj_t *c) { GError *error = NULL; - org_sflphone_SFLphone_CallManager_request_go_clear(callManagerProxy, - c->_callID, &error); + org_sflphone_SFLphone_CallManager_request_go_clear(call_proxy, c->_callID, &error); check_error(error); } @@ -1760,8 +1667,7 @@ dbus_get_supported_tls_method() { GError *error = NULL; gchar **array = NULL; - org_sflphone_SFLphone_ConfigurationManager_get_supported_tls_method( - configurationManagerProxy, &array, &error); + org_sflphone_SFLphone_ConfigurationManager_get_supported_tls_method(config_proxy, &array, &error); check_error(error); return array; @@ -1772,9 +1678,7 @@ dbus_get_tls_settings_default(void) { GError *error = NULL; GHashTable *results = NULL; - - org_sflphone_SFLphone_ConfigurationManager_get_tls_settings_default( - configurationManagerProxy, &results, &error); + org_sflphone_SFLphone_ConfigurationManager_get_tls_settings_default(config_proxy, &results, &error); check_error(error); return results; @@ -1785,9 +1689,7 @@ dbus_get_address_from_interface_name(const gchar *interface) { GError *error = NULL; gchar *address = NULL; - - org_sflphone_SFLphone_ConfigurationManager_get_addr_from_interface_name( - configurationManagerProxy, interface, &address, &error); + org_sflphone_SFLphone_ConfigurationManager_get_addr_from_interface_name(config_proxy, interface, &address, &error); check_error(error); return address; @@ -1799,10 +1701,8 @@ dbus_get_all_ip_interface(void) GError *error = NULL; gchar **array = NULL; - if (!org_sflphone_SFLphone_ConfigurationManager_get_all_ip_interface( - configurationManagerProxy, &array, &error)) { - if (error->domain == DBUS_GERROR && - error->code == DBUS_GERROR_REMOTE_EXCEPTION) + if (!org_sflphone_SFLphone_ConfigurationManager_get_all_ip_interface(config_proxy, &array, &error)) { + if (error->domain == DBUS_GERROR && error->code == DBUS_GERROR_REMOTE_EXCEPTION) ERROR("Caught remote method (get_all_ip_interface) exception %s: %s", dbus_g_error_get_name(error), error->message); else ERROR("Error while calling get_all_ip_interface: %s", error->message); @@ -1820,11 +1720,10 @@ dbus_get_all_ip_interface_by_name(void) GError *error = NULL; gchar **array = NULL; - if (!org_sflphone_SFLphone_ConfigurationManager_get_all_ip_interface_by_name( - configurationManagerProxy, &array, &error)) { - if (error->domain == DBUS_GERROR && - error->code == DBUS_GERROR_REMOTE_EXCEPTION) - ERROR("Caught remote method (get_all_ip_interface) exception %s: %s", dbus_g_error_get_name(error), error->message); + if (!org_sflphone_SFLphone_ConfigurationManager_get_all_ip_interface_by_name(config_proxy, &array, &error)) { + if (error->domain == DBUS_GERROR && error->code == DBUS_GERROR_REMOTE_EXCEPTION) + ERROR("Caught remote method (get_all_ip_interface) exception %s: %s", + dbus_g_error_get_name(error), error->message); else ERROR("Error while calling get_all_ip_interface: %s", error->message); @@ -1840,10 +1739,8 @@ dbus_get_shortcuts(void) GError *error = NULL; GHashTable *shortcuts = NULL; - if (!org_sflphone_SFLphone_ConfigurationManager_get_shortcuts( - configurationManagerProxy, &shortcuts, &error)) { - if (error->domain == DBUS_GERROR && - error->code == DBUS_GERROR_REMOTE_EXCEPTION) + if (!org_sflphone_SFLphone_ConfigurationManager_get_shortcuts(config_proxy, &shortcuts, &error)) { + if (error->domain == DBUS_GERROR && error->code == DBUS_GERROR_REMOTE_EXCEPTION) ERROR("Caught remote method (get_shortcuts) exception %s: %s", dbus_g_error_get_name(error), error->message); else @@ -1859,9 +1756,7 @@ void dbus_set_shortcuts(GHashTable *shortcuts) { GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_shortcuts( - configurationManagerProxy, shortcuts, &error); - + org_sflphone_SFLphone_ConfigurationManager_set_shortcuts(config_proxy, shortcuts, &error); check_error(error); } @@ -1869,8 +1764,6 @@ void dbus_send_text_message(const gchar *callID, const gchar *message) { GError *error = NULL; - org_sflphone_SFLphone_CallManager_send_text_message(callManagerProxy, - callID, message, - &error); + org_sflphone_SFLphone_CallManager_send_text_message(call_proxy, callID, message, &error); check_error(error); } diff --git a/gnome/src/dbus/dbus.h b/gnome/src/dbus/dbus.h index be49560a39944ad2b23acabc28c93b5772c1649c..65987bbba21b47c214ed0fb1c72e6e8357addfc7 100644 --- a/gnome/src/dbus/dbus.h +++ b/gnome/src/dbus/dbus.h @@ -30,8 +30,8 @@ * as that of the covered work. */ -#ifndef __DBUS_H__ -#define __DBUS_H__ +#ifndef DBUS_H_ +#define DBUS_H_ #include <dbus/dbus-glib.h>