[asterisk-scf-commits] asterisk-scf/integration/media_rtp_pjmedia.git branch "srtp-support" created.
Commits to the Asterisk SCF project code repositories
asterisk-scf-commits at lists.digium.com
Fri Jul 8 09:46:39 CDT 2011
branch "srtp-support" has been created
at 8f0b3e40aa59688ea63c22cfe2dfd3175cdfec1e (commit)
- Log -----------------------------------------------------------------
commit 8f0b3e40aa59688ea63c22cfe2dfd3175cdfec1e
Merge: 985f101 67595d5
Author: Brent Eagles <beagles at digium.com>
Date: Thu Jul 7 10:49:25 2011 -0230
Merge branch 'nat-support' into srtp-support
commit 985f101acb628c65f5c092e8b403ce4e1f90d5e6
Author: Brent Eagles <beagles at digium.com>
Date: Thu Jul 7 09:20:47 2011 -0230
Work on completing srtp support
diff --git a/slice/AsteriskSCF/Configuration/MediaRTPPJMedia/RtpConfigurationIf.ice b/slice/AsteriskSCF/Configuration/MediaRTPPJMedia/RtpConfigurationIf.ice
index 6341639..ec71e54 100644
--- a/slice/AsteriskSCF/Configuration/MediaRTPPJMedia/RtpConfigurationIf.ice
+++ b/slice/AsteriskSCF/Configuration/MediaRTPPJMedia/RtpConfigurationIf.ice
@@ -114,6 +114,24 @@ module V1
};
/**
+ * Name that the SRTP flag configuration item should be inserted as
+ **/
+ const string EnableSRTPItemName = "srtpEnable";
+
+ /**
+ *
+ * Enable SRTP on the current transport.
+ *
+ **/
+ class EnableSRTPItem extends RtpConfiguration
+ {
+ /**
+ * Flag to enable SRTP.
+ **/
+ bool enabled;
+ };
+
+ /**
* Name that the worker thread count configuration item should be inserted as
*/
const string WorkerThreadCountItemName = "workerThreadCount";
@@ -170,7 +188,7 @@ module V1
*/
string address;
};
-
+
/*
* Configuration group for ICE enabled RTP.
*/
diff --git a/src/RTPConfiguration.cpp b/src/RTPConfiguration.cpp
index 5e55b68..26859a7 100644
--- a/src/RTPConfiguration.cpp
+++ b/src/RTPConfiguration.cpp
@@ -114,6 +114,31 @@ public:
void replaceGroup(const RtpGeneralGroupPtr& group)
{
mGeneralGroup = group;
+
+ boost::unique_lock<boost::shared_mutex> lock(mLock);
+ if (mGeneralGroup)
+ {
+ ConfigurationItemDict::const_iterator item =
+ mGeneralGroup->configurationItems.find(EnableSRTPItemName);
+ if (item != mGeneralGroup->configurationItems.end())
+ {
+ EnableSRTPItemPtr srtpItem = EnableSRTPItemPtr::dynamicCast(item->second);
+ if (!mSRTPConfig)
+ {
+ mSRTPConfig = SRTPConfiguration::create(srtpItem->value);
+ }
+ else
+ {
+ //
+ // No point in allocating if it's the same.
+ //
+ if (mSRTPConfig->isSRTPEnabled() != srtpItem->value)
+ {
+ mSRTPConfig = SRTPConfiguration::create(srtpItem->value);
+ }
+ }
+ }
+ }
}
void replaceGroup(const RTPICEConfigurationGroupPtr& group)
-----------------------------------------------------------------------
--
asterisk-scf/integration/media_rtp_pjmedia.git
More information about the asterisk-scf-commits
mailing list