Commit 9fa967a6 authored by Emmanuel Milou's avatar Emmanuel Milou
Browse files

Clean up debug messages in dbus.c

parent 5d1df6f2
......@@ -39,7 +39,6 @@ DBusGConnection * connection;
DBusGProxy * callManagerProxy;
DBusGProxy * configurationManagerProxy;
DBusGProxy * instanceProxy;
DBusGProxy * nameOwnerProxy;
static void
incoming_call_cb (DBusGProxy *proxy UNUSED,
......@@ -177,19 +176,6 @@ error_alert(DBusGProxy *proxy UNUSED,
sflphone_throw_exception( errCode );
}
static void nameOwnerChanged(DBusGProxy *proxy UNUSED, char *name , char *old_owner UNUSED, char *new_owner UNUSED, gpointer data UNUSED)
{
#if 0
g_print("******************************************************************\n");
g_print("Owner name of the service %s changed from %s to %s\n", name, old_owner, new_owner);
g_print("******************************************************************\n");
#endif
if (strcmp(name, "org.sflphone.SFLphone")!=0) return;
}
gboolean
dbus_connect ()
{
......@@ -197,7 +183,6 @@ dbus_connect ()
GError *error = NULL;
connection = NULL;
instanceProxy = NULL;
nameOwnerProxy = NULL;
g_type_init ();
......@@ -211,24 +196,6 @@ dbus_connect ()
return FALSE;
}
nameOwnerProxy = dbus_g_proxy_new_for_name( connection,
DBUS_SERVICE_DBUS,
DBUS_PATH_DBUS,
DBUS_INTERFACE_DBUS);
if( nameOwnerProxy==NULL)
{
g_printerr ("Failed to get proxy to NameOwner\n");
return FALSE;
}
dbus_g_proxy_add_signal( nameOwnerProxy, "NameOwnerChanged",
G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID);
dbus_g_proxy_connect_signal (nameOwnerProxy, "NameOwnerChanged",
G_CALLBACK (nameOwnerChanged), NULL, NULL);
/* Create a proxy object for the "bus driver" (name "org.freedesktop.DBus") */
instanceProxy = dbus_g_proxy_new_for_name (connection,
......@@ -337,11 +304,6 @@ dbus_hold (const call_t * c)
error->message);
g_error_free (error);
}
else
{
g_print ("DBus called hold() on CallManager\n");
}
}
void
......@@ -355,11 +317,6 @@ dbus_unhold (const call_t * c)
error->message);
g_error_free (error);
}
else
{
g_print ("DBus called unhold() on CallManager\n");
}
}
void
......@@ -373,11 +330,6 @@ dbus_hang_up (const call_t * c)
error->message);
g_error_free (error);
}
else
{
g_print ("DBus called hang_up() on CallManager\n");
}
}
void
......@@ -391,11 +343,6 @@ dbus_transfert (const call_t * c)
error->message);
g_error_free (error);
}
else
{
g_print ("DBus called transfert() on CallManager\n");
}
}
void
......@@ -412,11 +359,6 @@ dbus_accept (const call_t * c)
(error->message == NULL ? g_quark_to_string(error->domain): error->message));
g_error_free (error);
}
else
{
g_print ("DBus called accept(%s) on CallManager\n", c->callID);
}
}
void
......@@ -433,12 +375,6 @@ dbus_refuse (const call_t * c)
error->message);
g_error_free (error);
}
else
{
g_print ("DBus called refuse() on CallManager\n");
}
}
......@@ -453,12 +389,6 @@ dbus_place_call (const call_t * c)
error->message);
g_error_free (error);
}
else
{
g_print ("DBus called placeCall() on CallManager\n");
}
}
gchar** dbus_account_list()
......@@ -497,7 +427,6 @@ GHashTable* dbus_account_details(gchar * accountID)
return NULL;
}
else{
g_print ("DBus called get_account_details() on ConfigurationManager\n");
return details;
}
}
......@@ -513,10 +442,6 @@ dbus_send_register ( gchar* accountID , const guint expire)
error->message);
g_error_free (error);
}
else
{
g_print ("DBus called send_register() on ConfigurationManager\n");
}
}
void
......@@ -533,11 +458,6 @@ dbus_remove_account(gchar * accountID)
error->message);
g_error_free (error);
}
else
{
g_print ("DBus called remove_account() on ConfigurationManager\n");
}
}
void
......@@ -555,11 +475,6 @@ dbus_set_account_details(account_t *a)
error->message);
g_error_free (error);
}
else
{
g_print ("DBus called set_account_details() on ConfigurationManager\n");
}
}
void
......@@ -576,11 +491,6 @@ dbus_add_account(account_t *a)
error->message);
g_error_free (error);
}
else
{
g_print ("DBus called add_account() on ConfigurationManager\n");
}
}
void
......@@ -599,11 +509,6 @@ dbus_set_volume(const gchar * device, gdouble value)
error->message);
g_error_free (error);
}
else
{
g_print ("DBus called set_volume() on callManagerProxy\n");
}
}
......@@ -625,11 +530,6 @@ dbus_get_volume(const gchar * device)
error->message);
g_error_free (error);
}
else
{
g_print ("DBus called get_volume(%s) on callManagerProxy, got %f\n", device, value);
}
return value;
}
......@@ -650,11 +550,6 @@ dbus_play_dtmf(const gchar * key)
error->message);
g_error_free (error);
}
else
{
g_print ("DBus called playDTMF() on callManagerProxy\n");
}
}
void
......@@ -674,11 +569,6 @@ dbus_start_tone(const int start , const guint type )
error->message);
g_error_free (error);
}
else
{
g_print ("DBus called startTone() on callManagerProxy\n");
}
}
void
......@@ -698,11 +588,6 @@ dbus_register(int pid, gchar * name)
error->message);
g_error_free (error);
}
else
{
g_print ("DBus called register() on instanceProxy\n");
}
}
void
......@@ -721,16 +606,11 @@ dbus_unregister(int pid)
error->message);
g_error_free (error);
}
else
{
g_print ("DBus called unregister() on instanceProxy\n");
}
}
gchar**
dbus_codec_list()
{
g_print("Before");
GError *error = NULL;
gchar** array;
......@@ -739,17 +619,11 @@ dbus_codec_list()
&array,
&error);
g_print("After");
if (error)
{
g_printerr ("Failed to call get_codec_list() on ConfigurationManager: %s\n",
error->message);
g_error_free (error);
}
else
{
g_print ("DBus called get_codec_list() on ConfigurationManager\n");
}
return array;
}
......@@ -757,7 +631,6 @@ dbus_codec_list()
gchar**
dbus_codec_details( int payload )
{
g_print("Before");
GError *error = NULL;
gchar ** array;
......@@ -767,17 +640,11 @@ dbus_codec_details( int payload )
&array,
&error);
g_print("After");
if (error)
{
g_printerr ("Failed to call get_codec_details() on ConfigurationManager: %s\n",
error->message);
g_error_free (error);
}
else
{
g_print ("DBus called get_codec_details() on ConfigurationManager\n");
}
return array;
}
......@@ -787,7 +654,6 @@ dbus_codec_details( int payload )
gchar**
dbus_get_active_codec_list()
{
g_print("Before");
gchar ** array;
GError *error = NULL;
......@@ -796,17 +662,11 @@ dbus_get_active_codec_list()
&array,
&error);
g_print("After");
if (error)
{
g_printerr ("Failed to call get_active_codec_list() on ConfigurationManager: %s\n",
error->message);
g_error_free (error);
}
else
{
g_print ("DBus called get_active_codec_list() on ConfigurationManager\n");
}
return array;
}
......@@ -814,7 +674,6 @@ dbus_get_active_codec_list()
void
dbus_set_active_codec_list(const gchar** list)
{
g_print("Before");
GError *error = NULL;
org_sflphone_SFLphone_ConfigurationManager_set_active_codec_list (
......@@ -822,18 +681,12 @@ dbus_set_active_codec_list(const gchar** list)
list,
&error);
g_print("After");
if (error)
{
g_printerr ("Failed to call set_active_codec_list() on ConfigurationManager: %s\n",
error->message);
g_error_free (error);
}
else
{
g_print ("DBus called set_active_codec_list() on ConfigurationManager\n");
}
}
/**
......@@ -842,21 +695,17 @@ dbus_set_active_codec_list(const gchar** list)
gchar**
dbus_get_input_audio_plugin_list()
{
g_print("Before get input audio plugin list");
gchar** array;
GError* error = NULL;
org_sflphone_SFLphone_ConfigurationManager_get_input_audio_plugin_list(
configurationManagerProxy,
&array,
&error);
g_print("After");
if(error)
{
g_printerr("Failed to call get_input_audio_plugin_list() on ConfigurationManager: %s\n", error->message);
g_error_free(error);
}
else
g_print("DBus called get_input_audio_plugin_list() on ConfigurationManager\n");
return array;
}
......@@ -879,7 +728,6 @@ dbus_get_output_audio_plugin_list()
return NULL;
}
else{
g_print("DBus called get_output_audio_plugin_list() on ConfigurationManager\n");
return array;
}
}
......@@ -887,39 +735,31 @@ dbus_get_output_audio_plugin_list()
void
dbus_set_input_audio_plugin(gchar* audioPlugin)
{
g_print("Before set input audio plugin");
GError* error = NULL;
org_sflphone_SFLphone_ConfigurationManager_set_input_audio_plugin(
configurationManagerProxy,
audioPlugin,
&error);
g_print("After");
if(error)
{
g_printerr("Failed to call set_input_audio_plugin() on ConfigurationManager: %s\n", error->message);
g_error_free(error);
}
else
g_print("DBus called set_input_audio_plugin() on ConfigurationManager\n");
}
void
dbus_set_output_audio_plugin(gchar* audioPlugin)
{
g_print("Before set output audio plugin");
GError* error = NULL;
org_sflphone_SFLphone_ConfigurationManager_set_output_audio_plugin(
configurationManagerProxy,
audioPlugin,
&error);
g_print("After");
if(error)
{
g_printerr("Failed to call set_output_audio_plugin() on ConfigurationManager: %s\n", error->message);
g_error_free(error);
}
else
g_print("DBus called set_output_audio_plugin() on ConfigurationManager\n");
}
/**
......@@ -927,21 +767,17 @@ dbus_set_output_audio_plugin(gchar* audioPlugin)
*/
gchar** dbus_get_audio_output_device_list()
{
g_print("Before get audio output device list");
gchar** array;
GError* error = NULL;
org_sflphone_SFLphone_ConfigurationManager_get_audio_output_device_list(
configurationManagerProxy,
&array,
&error);
g_print("After");
if(error)
{
g_printerr("Failed to call get_audio_output_device_list() on ConfigurationManager: %s\n", error->message);
g_error_free(error);
}
else
g_print("DBus called get_audio_output_device_list() on ConfigurationManager\n");
return array;
}
......@@ -951,20 +787,16 @@ gchar** dbus_get_audio_output_device_list()
void
dbus_set_audio_output_device(const int index)
{
g_print("Before set audio output device");
GError* error = NULL;
org_sflphone_SFLphone_ConfigurationManager_set_audio_output_device(
configurationManagerProxy,
index,
&error);
g_print("After");
if(error)
{
g_printerr("Failed to call set_audio_output_device() on ConfigurationManager: %s\n", error->message);
g_error_free(error);
}
else
g_print("DBus called set_audio_output_device() on ConfigurationManager\n");
}
/**
......@@ -973,21 +805,17 @@ dbus_set_audio_output_device(const int index)
gchar**
dbus_get_audio_input_device_list()
{
g_print("Before get audio input device list");
gchar** array;
GError* error = NULL;
org_sflphone_SFLphone_ConfigurationManager_get_audio_input_device_list(
configurationManagerProxy,
&array,
&error);
g_print("After");
if(error)
{
g_printerr("Failed to call get_audio_input_device_list() on ConfigurationManager: %s\n", error->message);
g_error_free(error);
}
else
g_print("DBus called get_audio_input_device_list() on ConfigurationManager\n");
return array;
}
......@@ -997,20 +825,16 @@ dbus_get_audio_input_device_list()
void
dbus_set_audio_input_device(const int index)
{
g_print("Before set audio input device");
GError* error = NULL;
org_sflphone_SFLphone_ConfigurationManager_set_audio_input_device(
configurationManagerProxy,
index,
&error);
g_print("After");
if(error)
{
g_printerr("Failed to call set_audio_input_device() on ConfigurationManager: %s\n", error->message);
g_error_free(error);
}
else
g_print("DBus called set_audio_input_device() on ConfigurationManager\n");
}
/**
......@@ -1019,21 +843,17 @@ dbus_set_audio_input_device(const int index)
gchar**
dbus_get_current_audio_devices_index()
{
g_print("Before get current audio devices index");
gchar** array;
GError* error = NULL;
org_sflphone_SFLphone_ConfigurationManager_get_current_audio_devices_index(
configurationManagerProxy,
&array,
&error);
g_print("After");
if(error)
{
g_printerr("Failed to call get_current_audio_devices_index() on ConfigurationManager: %s\n", error->message);
g_error_free(error);
}
else
g_print("DBus called get_current_audio_devices_index() on ConfigurationManager\n");
return array;
}
......@@ -1043,7 +863,6 @@ dbus_get_current_audio_devices_index()
int
dbus_get_audio_device_index(const gchar *name)
{
g_print("Before get audio device index");
int index;
GError* error = NULL;
org_sflphone_SFLphone_ConfigurationManager_get_audio_device_index(
......@@ -1051,14 +870,11 @@ dbus_get_audio_device_index(const gchar *name)
name,
&index,
&error);
g_print("After");
if(error)
{
g_printerr("Failed to call get_audio_device_index() on ConfigurationManager: %s\n", error->message);
g_error_free(error);
}
else
g_print("DBus called get_audio_device_index() on ConfigurationManager\n");
return index;
}
......@@ -1068,21 +884,17 @@ dbus_get_audio_device_index(const gchar *name)
gchar*
dbus_get_current_audio_output_plugin()
{
g_print("Before get audio plugin");
gchar* plugin="";
GError* error = NULL;
org_sflphone_SFLphone_ConfigurationManager_get_current_audio_output_plugin(
configurationManagerProxy,
&plugin,
&error);
g_print("After");
if(error)
{
g_printerr("Failed to call get_current_audio_output_plugin() on ConfigurationManager: %s\n", error->message);
g_error_free(error);
}
else
g_print("DBus called get_current_audio_output_plugin() on ConfigurationManager\n");
return plugin;
}
......@@ -1096,13 +908,10 @@ dbus_get_ringtone_choice()
configurationManagerProxy,
&tone,
&error);
g_print("After");
if(error)
{
g_error_free(error);
}
else
g_print("DBus called get_ringtone_choice() on ConfigurationManager\n");
return tone;
}
......@@ -1114,13 +923,10 @@ dbus_set_ringtone_choice( const gchar* tone )
configurationManagerProxy,
tone,
&error);
g_print("After");
if(error)
{
g_error_free(error);
}
else
g_print("DBus called set_ringtone_choice() on ConfigurationManager\n");
}
int
......@@ -1132,13 +938,10 @@ dbus_is_ringtone_enabled()
configurationManagerProxy,
&res,
&error);
g_print("After");
if(error)
{
g_error_free(error);
}
else
g_print("DBus called is_ringtone_enabled() on ConfigurationManager\n");
return res;
}
......@@ -1149,13 +952,10 @@ dbus_ringtone_enabled()
org_sflphone_SFLphone_ConfigurationManager_ringtone_enabled(
configurationManagerProxy,
&error);
g_print("After");
if(error)
{
g_error_free(error);
}
else
g_print("DBus called ringtone_enabled() on ConfigurationManager\n");
}
int
......@@ -1167,13 +967,10 @@ dbus_is_iax2_enabled()
configurationManagerProxy,
&res,
&error);
g_print("After");
if(error)
{
g_error_free(error);
}
else
g_print("DBus called is_iax2_enabled() on ConfigurationManager\n");
return res;
}
......@@ -1186,13 +983,10 @@ dbus_get_dialpad()
configurationManagerProxy,
&state,
&error);
g_print("After");
if(error)
{
g_error_free(error);
}
else
g_print("DBus called get_dialpad on ConfigurationManager\n");
return state;
}
......@@ -1203,13 +997,10 @@ dbus_set_dialpad( )