diff --git a/sflphone-client-gnome/src/actions.c b/sflphone-client-gnome/src/actions.c index a741ce1e83e4dcac42b27537208c424a8b28132e..d8903ad6fd4a8e46e896fa70331ebbeb1f3a9d88 100644 --- a/sflphone-client-gnome/src/actions.c +++ b/sflphone-client-gnome/src/actions.c @@ -305,7 +305,9 @@ sflphone_hang_up() sflphone_pick_up() { DEBUG("sflphone_pick_up\n"); - callable_obj_t * selectedCall = calltab_get_selected_call(active_calltree); + callable_obj_t * selectedCall = NULL; + selectedCall = calltab_get_selected_call(active_calltree); + if(selectedCall) { switch(selectedCall->_state) @@ -804,6 +806,7 @@ sflphone_display_selected_codec (const gchar* codecName) 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); diff --git a/sflphone-client-gnome/src/callable_obj.c b/sflphone-client-gnome/src/callable_obj.c index 8cff3894f7e88fe714cd8ab5a93ba3d0e567db67..7332c87ba624fe4cd6384ddfc1cd57ff104330b4 100644 --- a/sflphone-client-gnome/src/callable_obj.c +++ b/sflphone-client-gnome/src/callable_obj.c @@ -243,7 +243,6 @@ gchar* get_call_duration (callable_obj_t *obj) duration = (int) difftime(end, start); - DEBUG("END: %d START: %d DURATION: %d", end, start, duration); if( duration / 60 == 0 ) { if( duration < 10 ) diff --git a/sflphone-client-gnome/src/config/accountwindow.c b/sflphone-client-gnome/src/config/accountwindow.c index 4b3855064e0597cae2fbc0b6f4aa5de84040cc4e..44548d79ca4a4a60bb6d55c8174abf634b4509cf 100644 --- a/sflphone-client-gnome/src/config/accountwindow.c +++ b/sflphone-client-gnome/src/config/accountwindow.c @@ -392,4 +392,5 @@ show_account_window (account_t * a) } } gtk_widget_destroy (GTK_WIDGET(dialog)); + } diff --git a/sflphone-client-gnome/src/dbus/dbus.c b/sflphone-client-gnome/src/dbus/dbus.c index ad4fc09a2a5810a8c5fb9cb1e07045225f195e16..b4ad2226dfcaa819ac46eda8f8d09b4ef3d15952 100644 --- a/sflphone-client-gnome/src/dbus/dbus.c +++ b/sflphone-client-gnome/src/dbus/dbus.c @@ -129,6 +129,7 @@ call_state_cb (DBusGProxy *proxy UNUSED, stop_notification(); sflphone_hung_up (c); calltree_update_call( history, c ); + status_bar_display_account(); } else if ( strcmp(state, "UNHOLD_CURRENT") == 0 ) { diff --git a/sflphone-client-gnome/src/menus.c b/sflphone-client-gnome/src/menus.c index aac5a60be32da2f70e0f7da8b7417cde06147d69..3c66607f877780ab6427abb64b8f4995e7d9a0c0 100644 --- a/sflphone-client-gnome/src/menus.c +++ b/sflphone-client-gnome/src/menus.c @@ -122,6 +122,7 @@ help_about ( void * foo UNUSED) "Alexandre Savard <alexandre.savard@savoirfairelinux.com>", "Jean-Philippe Barrette-LaPierre", "Laurielle Lea", + "Pierre-Luc Bacon <pierre-luc.bacon@savoifairelinux.com>", NULL}; gchar *artists[] = { "Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com>", diff --git a/sflphone-common/src/managerimpl.cpp b/sflphone-common/src/managerimpl.cpp index fcbd0d6e2e4132445db7abf8f75d53b195138942..3fc1494d63ace7153b3f107087d4fd52c6207a7b 100644 --- a/sflphone-common/src/managerimpl.cpp +++ b/sflphone-common/src/managerimpl.cpp @@ -284,30 +284,38 @@ ManagerImpl::answerCall (const CallID& id) stopTone (true); - AccountID currentaccountid = getAccountFromCall (id); - Call* currentcall = getAccountLink (currentaccountid)->getCall (getCurrentCallId()); - - if (currentcall->getState() == 1) - isActive = true; - - // stopTone(false); - _debug ("Try to answer call: %s\n", id.data()); - - AccountID accountid = getAccountFromCall (id); - - if (accountid == AccountNULL) { - _debug ("Answering Call: Call doesn't exists\n"); - //return false; + AccountID currentAccountId; + currentAccountId = getAccountFromCall (id); + if(currentAccountId == AccountNULL) { + _debug("ManagerImpl::answerCall : AccountId is null\n"); + return false; + } + + Call* currentCall = NULL; + currentCall = getAccountLink (currentAccountId)->getCall (id); + if (currentCall == NULL) { + _debug("ManagerImpl::answerCall : currentCall is null\n"); + } + + Call* lastCall = NULL; + if (!getCurrentCallId().empty()) { + lastCall = getAccountLink (currentAccountId)->getCall (getCurrentCallId()); + if (lastCall == NULL) { + _debug("ManagerImpl::answerCall : lastCall is null\n"); + } } - // if (id != getCurrentCallId()) { - if (isActive) { - _debug ("* Manager Info: there is currently a call, try to hold it\n"); + _debug ("ManagerImpl::answerCall :: current call->getState %i \n", currentCall->getState()); + _debug ("Try to answer call: %s\n", id.data()); - onHoldCall (getCurrentCallId()); + if (lastCall != NULL) { + if (lastCall->getState() == Call::Active) { + _debug ("* Manager Info: there is currently a call, try to hold it\n"); + onHoldCall (getCurrentCallId()); + } } - if (!getAccountLink (accountid)->answer (id)) { + if (!getAccountLink (currentAccountId)->answer (id)) { // error when receiving... removeCallAccount (id); return false; @@ -315,15 +323,14 @@ ManagerImpl::answerCall (const CallID& id) // if it was waiting, it's waiting no more if (_dbus) _dbus->getCallManager()->callStateChanged (id, "CURRENT"); - + + std::string codecName = Manager::instance().getCurrentCodecName (id); + if (_dbus) _dbus->getCallManager()->currentSelectedCodec (id,codecName.c_str()); + removeWaitingCall (id); switchCall (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()); - return true; } diff --git a/sflphone-common/src/sipvoiplink.cpp b/sflphone-common/src/sipvoiplink.cpp index 1a5fa6f93250a75743cfeb4651d9b5f70062677a..338f0e3214319604306af47801d7828359efa775 100644 --- a/sflphone-common/src/sipvoiplink.cpp +++ b/sflphone-common/src/sipvoiplink.cpp @@ -2174,9 +2174,9 @@ void call_on_media_update (pjsip_inv_session *inv, pj_status_t status) try { call->setAudioStart (true); - link->getAudioRtp()->start(); - } catch (exception& rtpException) { - _debug ("%s\n", rtpException.what()); + link->getAudioRtp()->start(); + } catch(exception& rtpException) { + _debug("%s\n", rtpException.what()); } }