diff --git a/sflphone-common/src/audio/audiortp/AudioSymmetricRtpSession.cpp b/sflphone-common/src/audio/audiortp/AudioSymmetricRtpSession.cpp index 6169df5926a2069fae5005084ced1a2429c95947..0f03d66c8a7aff5b30a36baedc957262b9761cb6 100644 --- a/sflphone-common/src/audio/audiortp/AudioSymmetricRtpSession.cpp +++ b/sflphone-common/src/audio/audiortp/AudioSymmetricRtpSession.cpp @@ -62,6 +62,7 @@ AudioSymmetricRtpSession::~AudioSymmetricRtpSession() void AudioSymmetricRtpSession::final() { delete _rtpThread; + _rtpThread = 0; } AudioSymmetricRtpSession::AudioRtpThread::AudioRtpThread (AudioSymmetricRtpSession *session) : running (true), rtpSession (session) diff --git a/sflphone-common/src/audio/audiortp/AudioSymmetricRtpSession.h b/sflphone-common/src/audio/audiortp/AudioSymmetricRtpSession.h index 7a5b4953697509af0abca5911546ca455818f022..e9d44ffdb1976725193fd083d5847d353dfae434 100644 --- a/sflphone-common/src/audio/audiortp/AudioSymmetricRtpSession.h +++ b/sflphone-common/src/audio/audiortp/AudioSymmetricRtpSession.h @@ -71,10 +71,12 @@ class AudioSymmetricRtpSession : public ost::TimerPort, public ost::SymmetricRTP virtual bool onRTPPacketRecv (ost::IncomingRTPPkt& pkt) { return AudioRtpSession::onRTPPacketRecv(pkt); } int startSymmetricRtpThread (void) { + assert(_rtpThread); return _rtpThread->start(); } void stopSymmetricRtpThread (void) { + assert(_rtpThread); _rtpThread->running = false; } diff --git a/sflphone-common/src/sip/sipvoiplink.cpp b/sflphone-common/src/sip/sipvoiplink.cpp index 8001baf75dcf64d7c11aeca025fdbd00e71b3182..750226c9d33ebba043a03a63e4d87ceb591a5275 100644 --- a/sflphone-common/src/sip/sipvoiplink.cpp +++ b/sflphone-common/src/sip/sipvoiplink.cpp @@ -658,9 +658,6 @@ Call *SIPVoIPLink::newOutgoingCall (const std::string& id, const std::string& to // Create a new SIP call SIPCall* call = new SIPCall (id, Call::Outgoing, _cp); - if(call == NULL) { - throw VoipLinkException("Could not create new SIP call"); - } // Find the account associated to this call account = dynamic_cast<SIPAccount *> (Manager::instance().getAccount (Manager::instance().getAccountFromCall (id))); @@ -669,7 +666,6 @@ Call *SIPVoIPLink::newOutgoingCall (const std::string& id, const std::string& to call->setConnectionState (Call::Disconnected); call->setState (Call::Error); delete call; - call = NULL; // TODO: We should investigate how we could get rid of this error and create a IP2IP call instead throw VoipLinkException("Could not get account for this call"); } @@ -709,7 +705,6 @@ Call *SIPVoIPLink::newOutgoingCall (const std::string& id, const std::string& to if (audiocodec == NULL) { _error ("UserAgent: Could not instantiate codec"); delete call; - call = NULL; throw VoipLinkException ("Could not instantiate codec for early media"); } @@ -732,7 +727,6 @@ Call *SIPVoIPLink::newOutgoingCall (const std::string& id, const std::string& to status = call->getLocalSDP()->createOffer (account->getActiveCodecs ()); if (status != PJ_SUCCESS) { delete call; - call = NULL; throw VoipLinkException ("Could not create local sdp offer for new call"); } @@ -742,7 +736,6 @@ Call *SIPVoIPLink::newOutgoingCall (const std::string& id, const std::string& to addCall (call); } else { delete call; - call = NULL; throw VoipLinkException("Could not send outgoing INVITE request for new call"); } @@ -1348,7 +1341,6 @@ SIPVoIPLink::terminateCall (const std::string& id) if (call) { // terminate the sip call delete call; - call = 0; } } @@ -1647,10 +1639,6 @@ SIPVoIPLink::SIPCallServerFailure (SIPCall *call) std::string id = call->getCallId(); Manager::instance().callFailure (id); removeCall (id); - - if (call->getAudioRtp ()) { - call->getAudioRtp()->stop(); - } } }