Skip to content
Snippets Groups Projects
Commit f1e52396 authored by Alexandre Savard's avatar Alexandre Savard
Browse files

[#4243] Implement initLocalCryptoInfo to be called at different momment

parent e741b917
No related branches found
No related tags found
No related merge requests found
...@@ -135,10 +135,6 @@ void AudioRtpFactory::initAudioRtpSession (SIPCall * ca) ...@@ -135,10 +135,6 @@ void AudioRtpFactory::initAudioRtpSession (SIPCall * ca)
_rtpSession = new AudioSrtpSession (&Manager::instance(), ca); _rtpSession = new AudioSrtpSession (&Manager::instance(), ca);
_rtpSessionType = Sdes; _rtpSessionType = Sdes;
static_cast<AudioSrtpSession *> (_rtpSession)->initLocalCryptoInfo ();
ca->getLocalSDP()->set_srtp_crypto (static_cast<AudioSrtpSession *> (_rtpSession)->getLocalCryptoInfo());
break; break;
default: default:
...@@ -262,10 +258,12 @@ sfl::AudioZrtpSession * AudioRtpFactory::getAudioZrtpSession() ...@@ -262,10 +258,12 @@ sfl::AudioZrtpSession * AudioRtpFactory::getAudioZrtpSession()
} }
} }
void sfl::AudioRtpFactory::initLocalCryptoInfo () void sfl::AudioRtpFactory::initLocalCryptoInfo (SIPCall * ca)
{ {
if (_rtpSession && _rtpSessionType && (_rtpSessionType == Sdes)) { if (_rtpSession && _rtpSessionType && (_rtpSessionType == Sdes)) {
static_cast<AudioSrtpSession *> (_rtpSession)->initLocalCryptoInfo (); static_cast<AudioSrtpSession *> (_rtpSession)->initLocalCryptoInfo ();
ca->getLocalSDP()->set_srtp_crypto (static_cast<AudioSrtpSession *> (_rtpSession)->getLocalCryptoInfo());
} }
} }
......
...@@ -166,7 +166,7 @@ class AudioRtpFactory ...@@ -166,7 +166,7 @@ class AudioRtpFactory
*/ */
sfl::AudioZrtpSession * getAudioZrtpSession(); sfl::AudioZrtpSession * getAudioZrtpSession();
void initLocalCryptoInfo (void); void initLocalCryptoInfo (SIPCall *ca);
/** /**
* Set remote cryptographic info. Should be called after negotiation in SDP * Set remote cryptographic info. Should be called after negotiation in SDP
......
...@@ -820,6 +820,7 @@ SIPVoIPLink::newOutgoingCall (const CallID& id, const std::string& toUrl) ...@@ -820,6 +820,7 @@ SIPVoIPLink::newOutgoingCall (const CallID& id, const std::string& toUrl)
_info ("UserAgent: Creating new rtp session"); _info ("UserAgent: Creating new rtp session");
call->getAudioRtp()->initAudioRtpConfig (call); call->getAudioRtp()->initAudioRtpConfig (call);
call->getAudioRtp()->initAudioRtpSession (call); call->getAudioRtp()->initAudioRtpSession (call);
call->getAudioRtp()->initLocalCryptoInfo (call);
} catch (...) { } catch (...) {
_error ("UserAgent: Error: Failed to create rtp thread from newOutGoingCall"); _error ("UserAgent: Error: Failed to create rtp thread from newOutGoingCall");
} }
...@@ -1737,6 +1738,7 @@ bool SIPVoIPLink::new_ip_to_ip_call (const CallID& id, const std::string& to) ...@@ -1737,6 +1738,7 @@ bool SIPVoIPLink::new_ip_to_ip_call (const CallID& id, const std::string& to)
try { try {
call->getAudioRtp()->initAudioRtpConfig (call); call->getAudioRtp()->initAudioRtpConfig (call);
call->getAudioRtp()->initAudioRtpSession (call); call->getAudioRtp()->initAudioRtpSession (call);
call->getAudioRtp()->initLocalCryptoInfo (call);
} catch (...) { } catch (...) {
_debug ("UserAgent: Unable to create RTP Session in new IP2IP call (%s:%d)", __FILE__, __LINE__); _debug ("UserAgent: Unable to create RTP Session in new IP2IP call (%s:%d)", __FILE__, __LINE__);
} }
...@@ -3363,6 +3365,7 @@ void call_on_media_update (pjsip_inv_session *inv, pj_status_t status) ...@@ -3363,6 +3365,7 @@ void call_on_media_update (pjsip_inv_session *inv, pj_status_t status)
try { try {
call->getAudioRtp()->setRemoteCryptoInfo (sdesnego); call->getAudioRtp()->setRemoteCryptoInfo (sdesnego);
call->getAudioRtp()->initLocalCryptoInfo (call);
} catch (...) {} } catch (...) {}
DBusManager::instance().getCallManager()->secureSdesOn (call->getCallId()); DBusManager::instance().getCallManager()->secureSdesOn (call->getCallId());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment