From d6928d411f12f7b1f76ac30e33c72ded73329a64 Mon Sep 17 00:00:00 2001 From: Alexandre Savard <alexandresavard@alexandresavard-desktop.(none)> Date: Tue, 2 Mar 2010 17:52:04 -0500 Subject: [PATCH] [#2926] Cleanup --- sflphone-common/src/sip/sdp.cpp | 20 +++++++++----------- sflphone-common/src/sip/sipvoiplink.cpp | 11 ++++++----- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/sflphone-common/src/sip/sdp.cpp b/sflphone-common/src/sip/sdp.cpp index b46d35bb46..4d6505740f 100644 --- a/sflphone-common/src/sip/sdp.cpp +++ b/sflphone-common/src/sip/sdp.cpp @@ -134,7 +134,7 @@ int Sdp::create_local_offer (CodecOrder selectedCodecs) { pj_status_t status; - _debug ("Create local offer"); + _info("SDP: Create local offer"); // Build local media capabilities set_local_media_capabilities (selectedCodecs); @@ -173,12 +173,12 @@ int Sdp::create_initial_offer (CodecOrder selectedCodecs) { pj_status_t status; pjmedia_sdp_neg_state state; - _debug ("Create initial offer"); + _info("SDP: Create initial offer"); // Build the SDP session descriptor status = create_local_offer (selectedCodecs); if (status != PJ_SUCCESS) { - _warn (" Error: Failed to create initial offer"); + _error ("SDP: Error: Failed to create initial offer"); return status; } @@ -186,7 +186,7 @@ int Sdp::create_initial_offer (CodecOrder selectedCodecs) { status = pjmedia_sdp_neg_create_w_local_offer (_pool, get_local_sdp_session(), &_negociator); if (status != PJ_SUCCESS) { - _error (" Error: Failed to create an initial SDP negociator"); + _error ("SDP: Error: Failed to create an initial SDP negociator"); return status; } @@ -194,8 +194,6 @@ int Sdp::create_initial_offer (CodecOrder selectedCodecs) { PJ_ASSERT_RETURN (status == PJ_SUCCESS, 1); - _debug (" Initial offer created succesfully"); - return PJ_SUCCESS; } @@ -213,6 +211,7 @@ int Sdp::receiving_initial_offer (pjmedia_sdp_session* remote, CodecOrder select status = create_local_offer (selectedCodecs); if (status != PJ_SUCCESS) { + _error ("SDP: Error: Failed to create initial offer"); return status; } @@ -220,7 +219,7 @@ int Sdp::receiving_initial_offer (pjmedia_sdp_session* remote, CodecOrder select this->set_media_transport_info_from_remote_sdp (remote); status = pjmedia_sdp_neg_create_w_remote_offer (_pool, - get_local_sdp_session(), remote, &_negociator); + get_local_sdp_session(), remote, &_negociator); PJ_ASSERT_RETURN (status == PJ_SUCCESS, 1); @@ -262,17 +261,17 @@ pj_status_t Sdp::check_sdp_answer (pjsip_inv_session *inv, pjsip_rx_data *rdata) } if (status != PJ_SUCCESS) { - _debug ("SDP cannot be validated"); + _warn ("SDP: cannot be validated"); return PJMEDIA_SDP_EINSDP; } // This is an answer - _debug ("Got SDP answer %s", pjsip_rx_data_get_info (rdata)); + _debug ("SDP: Got SDP answer %s", pjsip_rx_data_get_info (rdata)); status = pjmedia_sdp_neg_set_remote_answer (inv->pool, inv->neg, remote_sdp); if (status != PJ_SUCCESS) { - _debug ("An error occured while processing remote answer %s", pjsip_rx_data_get_info (rdata)); + _error ("SDP: Error: while processing remote answer %s", pjsip_rx_data_get_info (rdata)); return PJMEDIA_SDP_EINSDP; } @@ -359,7 +358,6 @@ void Sdp::sdp_add_media_description() } } -// @TODO crypto should be a vector of string void Sdp::sdp_add_sdes_attribute (std::vector<std::string>& crypto) { diff --git a/sflphone-common/src/sip/sipvoiplink.cpp b/sflphone-common/src/sip/sipvoiplink.cpp index c4fb1fb8ee..fdbbd7f59e 100644 --- a/sflphone-common/src/sip/sipvoiplink.cpp +++ b/sflphone-common/src/sip/sipvoiplink.cpp @@ -738,7 +738,7 @@ SIPVoIPLink::newOutgoingCall (const CallID& id, const std::string& toUrl) account = dynamic_cast<SIPAccount *> (Manager::instance().getAccount (Manager::instance().getAccountFromCall (id))); if (account == NULL) { - _debug ("Error retrieving the account to the make the call with"); + _error ("UserAgent: Error: Could not retrieving account to make call with"); call->setConnectionState (Call::Disconnected); call->setState (Call::Error); delete call; @@ -764,16 +764,17 @@ SIPVoIPLink::newOutgoingCall (const CallID& id, const std::string& toUrl) loadSIPLocalIP (&addrSdp); try { - _debug ("Creating new rtp session in newOutgoingCall"); - call->getAudioRtp()->initAudioRtpConfig (call); + _info ("UserAgent: Creating new rtp session"); + call->getAudioRtp()->initAudioRtpConfig (call); call->getAudioRtp()->initAudioRtpSession (call); } catch (...) { - _error ("Failed to create rtp thread from newOutGoingCall"); + _error ("UserAgent: Error: Failed to create rtp thread from newOutGoingCall"); } call->initRecFileName(); - _debug ("Try to make a call to: %s with call ID: %s", toUrl.data(), id.data()); + _debug ("UserAgent: Try to make a call to: %s with call ID: %s", toUrl.data(), id.data()); + // Building the local SDP offer call->getLocalSDP()->set_ip_address (addrSdp); status = call->getLocalSDP()->create_initial_offer (account->getActiveCodecs ()); -- GitLab