diff --git a/sflphone-client-gnome/src/actions.c b/sflphone-client-gnome/src/actions.c index 817a72cc900f4aec6ad3d2743a9d594cb816c120..b7e25a0427b9697be544f1fd3e4a04883a62da8d 100644 --- a/sflphone-client-gnome/src/actions.c +++ b/sflphone-client-gnome/src/actions.c @@ -870,6 +870,8 @@ static int _place_registered_call(callable_obj_t * c) { void sflphone_place_call ( callable_obj_t * c ) { + gchar *msg = ""; + DEBUG("Placing call with %s @ %s and accountid %s", c->_peer_name, c->_peer_number, c->_accountID); if(c == NULL) { @@ -878,6 +880,10 @@ sflphone_place_call ( callable_obj_t * c ) } if(_is_direct_call(c)) { + msg = g_markup_printf_escaped (_("Direct SIP call")); + statusbar_pop_message(__MSG_ACCOUNT_DEFAULT); + statusbar_push_message( msg , __MSG_ACCOUNT_DEFAULT); + g_free(msg); if(_place_direct_call(c) < 0) { DEBUG("An error occured while placing direct call in %s at %d", __FILE__, __LINE__); return; @@ -890,50 +896,6 @@ sflphone_place_call ( callable_obj_t * c ) } } - void -sflphone_display_selected_codec (const gchar* codecName) -{ - - callable_obj_t * selectedCall; - gchar* msg; - account_t* acc; - - selectedCall = calltab_get_selected_call(current_calls); - if (selectedCall) { - if(selectedCall->_accountID != NULL){ - statusbar_pop_message(__MSG_ACCOUNT_DEFAULT); - acc = account_list_get_by_id(selectedCall->_accountID); - if (!acc) { - msg = g_markup_printf_escaped (_("IP call - %s"), codecName); - } - else { - - if (strcmp(codecName, "") != 0) { - msg = g_markup_printf_escaped("%s %s (%s) - %s %s" , - _("Using account"), - (gchar*)g_hash_table_lookup( acc->properties , ACCOUNT_ALIAS), - (gchar*)g_hash_table_lookup( acc->properties , ACCOUNT_TYPE), - _("Codec"), - codecName); - } else { - msg = g_markup_printf_escaped("%s %s (%s)" , - _("Using account"), - (gchar*)g_hash_table_lookup( acc->properties , ACCOUNT_ALIAS), - (gchar*)g_hash_table_lookup( acc->properties , ACCOUNT_TYPE)); - } - } - statusbar_push_message( msg , __MSG_ACCOUNT_DEFAULT); - g_free(msg); - } - } -} - - gchar* -sflphone_get_current_codec_name() -{ - callable_obj_t * selectedCall = calltab_get_selected_call(current_calls); - return dbus_get_current_codec_name(selectedCall); -} void sflphone_detach_participant(const gchar* callID) diff --git a/sflphone-client-gnome/src/actions.h b/sflphone-client-gnome/src/actions.h index 37db1185ea94ea619a93beac9de31b44b1290fba..2365243748bf9792fe31051dd71f68446d897160 100644 --- a/sflphone-client-gnome/src/actions.h +++ b/sflphone-client-gnome/src/actions.h @@ -185,10 +185,6 @@ void sflphone_record (callable_obj_t *c); void sflphone_rec_call (void); -gchar* sflphone_get_current_codec_name(); - -void sflphone_display_selected_codec (const gchar* codecName); - void status_bar_display_account (); void sflphone_fill_history (void); diff --git a/sflphone-client-gnome/src/callable_obj.c b/sflphone-client-gnome/src/callable_obj.c index 62a01b602a5785dcc3fb0f0b247ec147367b4f54..4100c99bdb51a0e663508dbbe04ae31cb94569bd 100644 --- a/sflphone-client-gnome/src/callable_obj.c +++ b/sflphone-client-gnome/src/callable_obj.c @@ -78,6 +78,16 @@ gchar* call_get_peer_number (const gchar *format) return number; } +gchar* call_get_audio_codec (callable_obj_t *obj) +{ + gchar *audio_codec = ""; + + if (obj) + { + audio_codec = dbus_get_current_codec_name (obj); + } + return audio_codec; +} void call_add_error(callable_obj_t * call, gpointer dialog) { diff --git a/sflphone-client-gnome/src/callable_obj.h b/sflphone-client-gnome/src/callable_obj.h index d23bc90cae333e7355b0f4984d9fdc31db4c6b2f..21311d8da72c9b81402a58b637883d13a421ffc6 100644 --- a/sflphone-client-gnome/src/callable_obj.h +++ b/sflphone-client-gnome/src/callable_obj.h @@ -135,6 +135,9 @@ typedef struct { */ GPtrArray * _error_dialogs; + /* The audio codec used for this call, if applicable */ + gchar *_audio_codec; + } callable_obj_t; void create_new_call (callable_type_t, call_state_t, gchar*, gchar*, gchar*, gchar*, callable_obj_t **); @@ -205,5 +208,6 @@ gchar* convert_timestamp_to_gchar (time_t); time_t convert_gchar_to_timestamp (gchar*); +gchar* call_get_audio_codec (callable_obj_t *obj); #endif diff --git a/sflphone-client-gnome/src/contacts/calltree.c b/sflphone-client-gnome/src/contacts/calltree.c index 510b8f92aa54bc76fa77ca736eaaa6a2f1abfd95..c1ef7644967feec5d52de38a61dc054af4a5b611 100644 --- a/sflphone-client-gnome/src/contacts/calltree.c +++ b/sflphone-client-gnome/src/contacts/calltree.c @@ -281,7 +281,7 @@ row_single_click(GtkTreeView *tree_view UNUSED, void * data UNUSED) // sflphone_selected_call_codec(selectedCall); // DEBUG("single click action: %s", dbus_get_current_codec_name(selectedCall)); - sflphone_display_selected_codec(dbus_get_current_codec_name(selectedCall)); + // sflphone_display_selected_codec(dbus_get_current_codec_name(selectedCall)); switch(selectedCall->_srtp_state) { @@ -524,6 +524,7 @@ calltree_update_call (calltab_t* tab, callable_obj_t * c, GtkTreeIter *parent) gchar* srtp_enabled = ""; gboolean display_sas = TRUE; account_t* account_details=NULL; + gchar *audio_codec = ""; int nbChild = gtk_tree_model_iter_n_children(GTK_TREE_MODEL(store), parent); @@ -571,6 +572,7 @@ calltree_update_call (calltab_t* tab, callable_obj_t * c, GtkTreeIter *parent) gchar * description; gchar * date=""; gchar * duration=""; + audio_codec = call_get_audio_codec (c); if(c->_state == CALL_STATE_TRANSFERT) { @@ -590,15 +592,17 @@ calltree_update_call (calltab_t* tab, callable_obj_t * c, GtkTreeIter *parent) } else { DEBUG("Updating state code %d %s", c->_state_code, c->_state_code_description); if (c->_state_code) { - description = g_markup_printf_escaped("<b>%s</b> <i>%s</i>\n<i>%s (%d)</i>", + description = g_markup_printf_escaped("<b>%s</b> <i>%s</i>\n<i>%s (%d)</i>\n<i>%s</i>", c->_peer_number, c->_peer_name, c->_state_code_description, - c->_state_code); + c->_state_code, + audio_codec); } else { - description = g_markup_printf_escaped("<b>%s</b> <i>%s</i>", + description = g_markup_printf_escaped("<b>%s</b> <i>%s</i>\n<i>%s</i>", c->_peer_number, - c->_peer_name ); + c->_peer_name, + audio_codec); } } } diff --git a/sflphone-client-gnome/src/dbus/dbus.c b/sflphone-client-gnome/src/dbus/dbus.c index 44e64f375b62949c7c1906d0e4812ea55786a639..c138dbf9093fb256ab73011c08f7ed19419b8822 100644 --- a/sflphone-client-gnome/src/dbus/dbus.c +++ b/sflphone-client-gnome/src/dbus/dbus.c @@ -94,8 +94,8 @@ curent_selected_codec (DBusGProxy *proxy UNUSED, const gchar* codecName, void * foo UNUSED ) { - DEBUG ("%s codec decided for call %s",codecName,callID); - sflphone_display_selected_codec (codecName); + // DEBUG ("%s codec decided for call %s",codecName,callID); + // sflphone_display_selected_codec (codecName); } static void @@ -1231,13 +1231,10 @@ dbus_codec_details( int payload ) return array; } - gchar* -dbus_get_current_codec_name(const callable_obj_t * c) +gchar* dbus_get_current_codec_name (const callable_obj_t * c) { - DEBUG("dbus_get_current_codec_name : CallID : %s", c->_callID); - - gchar* codecName; + gchar* codecName= ""; GError* error = NULL; org_sflphone_SFLphone_CallManager_get_current_codec_name ( diff --git a/sflphone-common/src/managerimpl.cpp b/sflphone-common/src/managerimpl.cpp index 24feb23d204aac3eb8a62867c3033a6e49afa46d..734e91d165f25a3f704ca1180d57a335c0944b1f 100644 --- a/sflphone-common/src/managerimpl.cpp +++ b/sflphone-common/src/managerimpl.cpp @@ -382,8 +382,8 @@ ManagerImpl::answerCall (const CallID& call_id) // if it was waiting, it's waiting no more if (_dbus) _dbus->getCallManager()->callStateChanged (call_id, "CURRENT"); - std::string codecName = Manager::instance().getCurrentCodecName (call_id); - if (_dbus) _dbus->getCallManager()->currentSelectedCodec (call_id, codecName.c_str()); + // std::string codecName = Manager::instance().getCurrentCodecName (call_id); + // if (_dbus) _dbus->getCallManager()->currentSelectedCodec (call_id, codecName.c_str()); removeWaitingCall (call_id); @@ -688,12 +688,10 @@ ManagerImpl::offHoldCall (const CallID& call_id) _audiodriver->flushMain(); } - codecName = getCurrentCodecName (call_id); + // codecName = getCurrentCodecName (call_id); // _debug("ManagerImpl::hangupCall(): broadcast codec name %s \n",codecName.c_str()); - if (_dbus) _dbus->getCallManager()->currentSelectedCodec (call_id,codecName.c_str()); - - + // if (_dbus) _dbus->getCallManager()->currentSelectedCodec (call_id,codecName.c_str()); return returnValue; } @@ -1866,10 +1864,10 @@ ManagerImpl::peerAnsweredCall (const CallID& id) if (_dbus) _dbus->getCallManager()->callStateChanged (id, "CURRENT"); - std::string codecName = getCurrentCodecName (id); + // std::string codecName = getCurrentCodecName (id); // _debug("ManagerImpl::hangupCall(): broadcast codec name %s \n",codecName.c_str()); - if (_dbus) _dbus->getCallManager()->currentSelectedCodec (id,codecName.c_str()); + // if (_dbus) _dbus->getCallManager()->currentSelectedCodec (id,codecName.c_str()); // Required if there have been no sip reinvite, in this case we must reinit buffers since the _audiodriver->flushMain();