[asterisk-scf-commits] asterisk-scf/integration/sip.git branch "srtp-support" updated.
Commits to the Asterisk SCF project code repositories
asterisk-scf-commits at lists.digium.com
Tue Jul 12 07:51:30 CDT 2011
branch "srtp-support" has been updated
via cfec4e219a70134f607888d309025fa219f1a8e9 (commit)
via 5c058d2ef2e1c96e9eb538ed6cd8c8ac1614d967 (commit)
via 5846372d877d813e35164d59177c7dffd3324d65 (commit)
from 726751650fb57aea3497979a4e3a43d97ca99e3a (commit)
Summary of changes:
src/STUNTransport.cpp | 1 +
src/SipSession.cpp | 92 ++++++++++++++++++++++++++----------------------
2 files changed, 51 insertions(+), 42 deletions(-)
mode change 100644 => 100755 src/SipSession.cpp
- Log -----------------------------------------------------------------
commit cfec4e219a70134f607888d309025fa219f1a8e9
Merge: 5c058d2 5846372
Author: Brent Eagles <beagles at digium.com>
Date: Tue Jul 12 10:09:53 2011 -0230
Update srtp-support with latest commits pushed to nat-support.
Acquired and resolved some conflicts:
src/SipSession.cpp
diff --cc src/SipSession.cpp
index d9bba00,43f12c7..8f613ad
mode 100644,100755..100755
--- a/src/SipSession.cpp
+++ b/src/SipSession.cpp
@@@ -1340,61 -1301,51 +1340,69 @@@ void SipSession::requestRTPSessions(Ast
params->category = "rtp";
params->formats = formats;
params->ipv6 = ipv6;
+ params->srtpCapable = (config.srtpConfig.supportOptions != SipEndpointMediaSRTPConfig::Disabled);
- AsteriskSCF::Media::RTP::V1::RTPMediaServicePrx factory =
- AsteriskSCF::Media::RTP::V1::RTPMediaServicePrx::uncheckedCast(mImplPriv->mServiceLocator->locate(params));
- if (!factory)
+ try
{
- assert("Location request has returned a nil proxy, this should throw!" == 0);
- //
- // TODO: throw!
- //
- }
- AsteriskSCF::Media::RTP::V1::RTPSessionPrx session = factory->allocate(params);
+ AsteriskSCF::Media::RTP::V1::RTPMediaServicePrx factory =
+ AsteriskSCF::Media::RTP::V1::RTPMediaServicePrx::uncheckedCast(mImplPriv->mServiceLocator->locate(params));
+ if (!factory)
+ {
+ assert("Location request has returned a nil proxy, this should throw!" == 0);
+ //
+ // TODO: throw!
+ //
+ }
+ AsteriskSCF::Media::RTP::V1::RTPSessionPrx session = factory->allocate(params);
- if (!session)
- {
- assert("Allocation of rtp streams failed! This should've thrown an exception!" == 0);
- //
- // TODO Throw!
- //
- }
- mImplPriv->mRTPSessions.push_back(session);
+ if (!session)
+ {
+ assert("Allocation of rtp streams failed! This should've thrown an exception!" == 0);
+ //
+ // TODO Throw!
+ //
+ }
+ mImplPriv->mRTPSessions.push_back(session);
- // Create a local copy of the sources, this won't get changed by the RTP session so it's all good
- mImplPriv->mSources = session->getSources();
+ // Create a local copy of the sources, this won't get changed by the RTP session so it's all good
+ mImplPriv->mSources = session->getSources();
- // Create a local copy of the sinks, this won't get changed by the RTP session so it's all good
- mImplPriv->mSinks = session->getSinks();
+ // Create a local copy of the sinks, this won't get changed by the RTP session so it's all good
+ mImplPriv->mSinks = session->getSinks();
- // For testing push a static payload mapping for ULAW into the RTP session
- AsteriskSCF::Media::RTP::V1::PayloadMap payloads;
- AsteriskSCF::Media::V1::AudioFormatPtr format = new AsteriskSCF::Media::V1::AudioFormat();
- format->name = "ulaw";
- format->sampleRate = 8000;
- format->frameSize = 20;
- format->maximumFrameSize = 20;
- format->minimumFrameSize = 20;
- payloads.insert(std::make_pair(0, format));
+ // For testing push a static payload mapping for ULAW into the RTP session
+ AsteriskSCF::Media::RTP::V1::PayloadMap payloads;
+ AsteriskSCF::Media::V1::AudioFormatPtr format = new AsteriskSCF::Media::V1::AudioFormat();
+ format->name = "ulaw";
+ format->sampleRate = 8000;
+ format->frameSize = 20;
+ format->maximumFrameSize = 20;
+ format->minimumFrameSize = 20;
+ payloads.insert(std::make_pair(0, format));
- session->associatePayloads(payloads);
+ session->associatePayloads(payloads);
+
- if (params->srtpCapable && !config.srtpConfig.cryptoKeys.empty())
- {
- SRTPSessionPrx srtpPrx = SRTPSessionPrx::checkedCast(session);
- if (!srtpPrx && config.srtpConfig.supportOptions == SipEndpointMediaSRTPConfig::Required)
++ if (params->srtpCapable && !config.srtpConfig.cryptoKeys.empty())
+ {
++ SRTPSessionPrx srtpPrx = SRTPSessionPrx::checkedCast(session);
++ if (!srtpPrx && config.srtpConfig.supportOptions == SipEndpointMediaSRTPConfig::Required)
++ {
++ //
++ // TODO throw.
++ //
++ assert("Cannot access SRTP functionality in the RTPSession." == 0);
++ }
+ //
- // TODO throw.
++ // This effectively treats this as if it is required SRTP.
+ //
- assert("Cannot access SRTP functionality in the RTPSession." == 0);
++ srtpPrx->setOptions(config.srtpConfig.cryptoKeys[0].suite, config.srtpConfig.cryptoKeys[0].cryptoKey,
++ config.srtpConfig.enableAuthentication, config.srtpConfig.enableEncryption);
+ }
- //
- // This effectively treats this as if it is required SRTP.
- //
- srtpPrx->setOptions(config.srtpConfig.cryptoKeys[0].suite, config.srtpConfig.cryptoKeys[0].cryptoKey,
- config.srtpConfig.enableAuthentication, config.srtpConfig.enableEncryption);
+ }
+ catch (const Ice::Exception& ex)
+ {
+ lg(Debug) << "Exception caught while trying to allocate RTP session. " << ex.what();
+ throw;
}
}
commit 5c058d2ef2e1c96e9eb538ed6cd8c8ac1614d967
Author: Brent Eagles <beagles at digium.com>
Date: Tue Jul 12 10:02:08 2011 -0230
Fix missing return value.
diff --git a/src/STUNTransport.cpp b/src/STUNTransport.cpp
index 1b509b4..076ee72 100644
--- a/src/STUNTransport.cpp
+++ b/src/STUNTransport.cpp
@@ -120,6 +120,7 @@ private:
{
data->op_key.tdata = 0;
}
+ return PJ_SUCCESS;
}
static pj_status_t shutdownImplCB(pjsip_transport*)
-----------------------------------------------------------------------
--
asterisk-scf/integration/sip.git
More information about the asterisk-scf-commits
mailing list