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

[#4243] Init audio srtp remote crypto context in call_on_media_update

parent 277655f6
Branches
Tags
No related merge requests found
......@@ -45,6 +45,8 @@
#include <cerrno>
bool remoteIsSet;
namespace sfl
{
......@@ -59,6 +61,7 @@ AudioSrtpSession::AudioSrtpSession (ManagerImpl * manager, SIPCall * sipcall) :
_remoteMasterSaltLength (0)
{
remoteIsSet = false;
// initLocalCryptoInfo();
}
......@@ -113,7 +116,7 @@ std::vector<std::string> AudioSrtpSession::getLocalCryptoInfo()
void AudioSrtpSession::setRemoteCryptoInfo (sfl::SdesNegotiator& nego)
{
if (!remoteIsSet) {
_debug ("----------------------------------------------- AudioSrtp: Set remote Cryptographic info for Srtp");
_debug ("%s", nego.getKeyInfo().c_str());
......@@ -135,6 +138,9 @@ void AudioSrtpSession::setRemoteCryptoInfo (sfl::SdesNegotiator& nego)
setInQueueCryptoContext (_remoteCryptoCtx);
// initLocalCryptoInfo();
remoteIsSet = true;
}
}
......
......@@ -3337,7 +3337,7 @@ void call_on_media_update (pjsip_inv_session *inv, pj_status_t status)
}
/*
// Get the crypto attribute containing srtp's cryptographic context (keys, cipher)
CryptoOffer crypto_offer;
call->getLocalSDP()->get_remote_sdp_crypto_from_offer (remote_sdp, crypto_offer);
......@@ -3365,7 +3365,7 @@ void call_on_media_update (pjsip_inv_session *inv, pj_status_t status)
try {
call->getAudioRtp()->setRemoteCryptoInfo (sdesnego);
call->getAudioRtp()->initLocalCryptoInfo (call);
// call->getAudioRtp()->initLocalCryptoInfo (call);
} catch (...) {}
DBusManager::instance().getCallManager()->secureSdesOn (call->getCallId());
......@@ -3399,7 +3399,6 @@ void call_on_media_update (pjsip_inv_session *inv, pj_status_t status)
// enabled for this call, make a try using RTP only...
_debug ("UserAgent: SDES not initialized for this call\n");
}
*/
Sdp *sdpSession = call->getLocalSDP();
......@@ -3965,7 +3964,6 @@ mod_on_rx_request (pjsip_rx_data *rdata)
call->getAudioRtp()->initAudioRtpConfig (call);
call->getAudioRtp()->initAudioRtpSession (call);
call->getAudioRtp()->setRemoteCryptoInfo (sdesnego);
_debug ("------------------------------------------------ init local crypto info");
call->getAudioRtp()->initLocalCryptoInfo (call);
} catch (...) {
_warn ("UserAgent: Error: Failed to create rtp thread from answer");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment