[asterisk-scf-commits] asterisk-scf/integration/sip.git branch "t38udptl" updated.
Commits to the Asterisk SCF project code repositories
asterisk-scf-commits at lists.digium.com
Wed Sep 21 06:36:05 CDT 2011
branch "t38udptl" has been updated
via eed77ce1acd136d75a485f792e7733f0853a0ae0 (commit)
via d85a8aac72b2b1de415c139f296b376b2bc565b4 (commit)
via 0e71a122835c01326de86039b23cec8b46f4acb8 (commit)
via 089f8aee9f0f9f6e61d410fca83cab0fae6a0b33 (commit)
from 5dcb2757c2cf0498bf1f8d15543f8d48d8641c7e (commit)
Summary of changes:
config/SipConfigurator.py | 3 ++
.../SipSessionManager/SipConfigurationIf.ice | 16 +++++++++++
src/SipConfiguration.cpp | 10 +++++++
src/SipEndpoint.cpp | 21 ++++++++++++++
src/SipEndpoint.h | 9 ++++++
src/SipSession.cpp | 29 +++++++++++++++++--
src/SipSession.h | 1 +
src/SipStateReplicatorListener.cpp | 3 +-
8 files changed, 88 insertions(+), 4 deletions(-)
- Log -----------------------------------------------------------------
commit eed77ce1acd136d75a485f792e7733f0853a0ae0
Author: Joshua Colp <jcolp at digium.com>
Date: Wed Sep 21 08:42:33 2011 -0300
Obey the configuration for error correction and maximum datagram override.
diff --git a/src/SipEndpoint.cpp b/src/SipEndpoint.cpp
index e9ebcf9..63a5b16 100644
--- a/src/SipEndpoint.cpp
+++ b/src/SipEndpoint.cpp
@@ -685,6 +685,20 @@ SDPDescriptorPtr SipEndpoint::getInterpretedDescriptor(const FormatPtr& format)
return 0;
}
+FormatPtr SipEndpoint::getFormat(const FormatPtr& format)
+{
+ for (std::vector<ConfiguredFormatPtr>::const_iterator configuredFormat = mImplPriv->mFormats.begin();
+ configuredFormat != mImplPriv->mFormats.end();
+ ++configuredFormat)
+ {
+ if ((*configuredFormat)->getFormat()->name == format->name)
+ {
+ return (*configuredFormat)->getFormat();
+ }
+ }
+
+ return 0;
+}
StreamInformationDict SipEndpoint::getStreamTopology()
{
diff --git a/src/SipEndpoint.h b/src/SipEndpoint.h
index 66f1104..cad0110 100644
--- a/src/SipEndpoint.h
+++ b/src/SipEndpoint.h
@@ -356,6 +356,11 @@ public:
AsteriskSCF::Media::SDP::V1::SDPDescriptorPtr getInterpretedDescriptor(const AsteriskSCF::Media::V1::FormatPtr&);
/**
+ * API call which returns the local format given a media format.
+ */
+ AsteriskSCF::Media::V1::FormatPtr getFormat(const AsteriskSCF::Media::V1::FormatPtr&);
+
+ /**
* API call which returns the stream topology to be used for an SDP offer.
*/
void setMediaNATOptions(bool useICE, bool useTURN);
diff --git a/src/SipSession.cpp b/src/SipSession.cpp
index 108adb0..cc09d39 100755
--- a/src/SipSession.cpp
+++ b/src/SipSession.cpp
@@ -2233,6 +2233,11 @@ pjmedia_sdp_session *SipSession::createSDPOffer(const AsteriskSCF::Media::V1::St
media->desc.port = (pj_uint16_t) source->getLocalPort();
media->desc.port_count = 1;
+ // Use the configured format to set the error correction
+ T38UdptlFormatPtr t38Configuration = T38UdptlFormatPtr::dynamicCast(mImplPriv->mEndpoint->getFormat(t38));
+
+ t38->errorCorrection = t38Configuration->errorCorrection;
+
SDPDescriptorPtr ourDescriptor = mImplPriv->mEndpoint->getInterpretedDescriptor(t38);
for (SDPFormatParameterSeq::const_iterator parameter = ourDescriptor->parameters.begin();
parameter != ourDescriptor->parameters.end();
@@ -2646,6 +2651,12 @@ pjmedia_sdp_session *SipSession::createSDPAnswer(const pjmedia_sdp_session* offe
}
else if ((t38 = T38UdptlFormatPtr::dynamicCast(formats.front())))
{
+ // Ensure the offer is valid
+ if (t38->faxRateManagement == UNSPECIFIED_TCF)
+ {
+ continue;
+ }
+
// If this is a modified stream make sure the transport is UDPTL, if not clear things out
if (!ourStream->sinks.empty())
{
@@ -2760,7 +2771,18 @@ pjmedia_sdp_session *SipSession::createSDPAnswer(const pjmedia_sdp_session* offe
return 0;
}
- sink->setFarMaxDatagram(t38->maxDatagram);
+ T38UdptlFormatPtr t38Configuration = T38UdptlFormatPtr::dynamicCast(mImplPriv->mEndpoint->getFormat(t38));
+
+ // If the max datagram has been overridden then use that instead of what they offered
+ if (t38Configuration->maxDatagram)
+ {
+ sink->setFarMaxDatagram(t38Configuration->maxDatagram);
+ }
+ else
+ {
+ sink->setFarMaxDatagram(t38->maxDatagram);
+ }
+
sink->setErrorCorrectionScheme(t38->errorCorrection);
break;
commit d85a8aac72b2b1de415c139f296b376b2bc565b4
Author: Joshua Colp <jcolp at digium.com>
Date: Tue Sep 20 13:41:21 2011 -0300
Replicate UDPTL sessions being used.
diff --git a/src/SipEndpoint.cpp b/src/SipEndpoint.cpp
index 0cba8b2..e9ebcf9 100644
--- a/src/SipEndpoint.cpp
+++ b/src/SipEndpoint.cpp
@@ -466,6 +466,7 @@ AsteriskSCF::SipSessionManager::SipSessionPtr SipEndpoint::createSession(const s
const Ice::Identity& sessionid, const Ice::Identity& controllerid,
const Ice::Identity& mediaid,
const AsteriskSCF::Replication::SipSessionManager::V1::RTPMediaSessionSeq& mediasessions,
+ const AsteriskSCF::Replication::SipSessionManager::V1::UDPTLMediaSessionSeq& udptlMediaSessions,
const AsteriskSCF::Media::V1::StreamSourceSeq& sources,
const AsteriskSCF::Media::V1::StreamSinkSeq& sinks)
{
@@ -477,6 +478,7 @@ AsteriskSCF::SipSessionManager::SipSessionPtr SipEndpoint::createSession(const s
controllerid,
mediaid,
mediasessions,
+ udptlMediaSessions,
sources,
sinks,
mImplPriv->mManager,
diff --git a/src/SipEndpoint.h b/src/SipEndpoint.h
index 07e6027..66f1104 100644
--- a/src/SipEndpoint.h
+++ b/src/SipEndpoint.h
@@ -321,6 +321,7 @@ public:
AsteriskSCF::SipSessionManager::SipSessionPtr createSession(const std::string&);
AsteriskSCF::SipSessionManager::SipSessionPtr createSession(const std::string&, const Ice::Identity&, const Ice::Identity&,
const Ice::Identity&, const AsteriskSCF::Replication::SipSessionManager::V1::RTPMediaSessionSeq&,
+ const AsteriskSCF::Replication::SipSessionManager::V1::UDPTLMediaSessionSeq&,
const AsteriskSCF::Media::V1::StreamSourceSeq&, const AsteriskSCF::Media::V1::StreamSinkSeq&);
void removeSession(const AsteriskSCF::SessionCommunications::V1::SessionPtr&);
diff --git a/src/SipSession.cpp b/src/SipSession.cpp
index ed31d77..108adb0 100755
--- a/src/SipSession.cpp
+++ b/src/SipSession.cpp
@@ -851,6 +851,7 @@ SipSession::SipSession(const Ice::ObjectAdapterPtr& adapter,
const Ice::Identity& controllerid,
const Ice::Identity& mediaid,
const AsteriskSCF::Replication::SipSessionManager::V1::RTPMediaSessionSeq& mediasessions,
+ const AsteriskSCF::Replication::SipSessionManager::V1::UDPTLMediaSessionSeq& udptlMediaSessions,
const AsteriskSCF::Media::V1::StreamSourceSeq& sources,
const AsteriskSCF::Media::V1::StreamSinkSeq& sinks,
const PJSipManagerPtr& manager,
@@ -874,6 +875,7 @@ SipSession::SipSession(const Ice::ObjectAdapterPtr& adapter,
AsteriskSCF::SessionCommunications::V1::SessionControllerPrx::uncheckedCast(adapter->add(mImplPriv->mOurSessionController, controllerid));
mImplPriv->mRTPSessions = mediasessions;
+ mImplPriv->mUDPTLSessions = udptlMediaSessions;
mImplPriv->mSources = sources;
mImplPriv->mSinks = sinks;
diff --git a/src/SipSession.h b/src/SipSession.h
index 515682f..2c93670 100644
--- a/src/SipSession.h
+++ b/src/SipSession.h
@@ -131,6 +131,7 @@ public:
const Ice::Identity&,
const Ice::Identity&,
const AsteriskSCF::Replication::SipSessionManager::V1::RTPMediaSessionSeq&,
+ const AsteriskSCF::Replication::SipSessionManager::V1::UDPTLMediaSessionSeq&,
const AsteriskSCF::Media::V1::StreamSourceSeq&,
const AsteriskSCF::Media::V1::StreamSinkSeq&,
const PJSipManagerPtr& manager,
diff --git a/src/SipStateReplicatorListener.cpp b/src/SipStateReplicatorListener.cpp
index 168b25d..689785a 100644
--- a/src/SipStateReplicatorListener.cpp
+++ b/src/SipStateReplicatorListener.cpp
@@ -326,7 +326,8 @@ public:
// Now that all is well we can create an actual session
SipSessionPtr localSession = endpoint->createSession("", session->sessionObjectId,
session->sessionControllerObjectId,
- session->mediaSessionObjectId, session->rtpMediaSessions, session->sources, session->sinks);
+ session->mediaSessionObjectId, session->rtpMediaSessions,
+ session->udptlMediaSessions, session->sources, session->sinks);
localitem->setSession(localSession);
}
else
commit 0e71a122835c01326de86039b23cec8b46f4acb8
Author: Joshua Colp <jcolp at digium.com>
Date: Tue Sep 20 13:34:21 2011 -0300
Obey the configuration law for UDPTL over IPv6.
diff --git a/src/SipSession.cpp b/src/SipSession.cpp
index 5131573..ed31d77 100755
--- a/src/SipSession.cpp
+++ b/src/SipSession.cpp
@@ -2165,8 +2165,7 @@ pjmedia_sdp_session *SipSession::createSDPOffer(const AsteriskSCF::Media::V1::St
{
UDPTLServiceLocatorParamsPtr params = new UDPTLServiceLocatorParams();
params->category = "udptl";
- params->ipv6 = false;
-// params->ipv6 = mImplPriv->mEndpoint->getConfig().sessionConfig.rtpOverIPv6;
+ params->ipv6 = mImplPriv->mEndpoint->getConfig().sessionConfig.udptlOverIPv6;
UDPTLMediaServicePrx factory = UDPTLMediaServicePrx::uncheckedCast(mImplPriv->mServiceLocator->locate(params));
if (factory == 0)
commit 089f8aee9f0f9f6e61d410fca83cab0fae6a0b33
Author: Joshua Colp <jcolp at digium.com>
Date: Tue Sep 20 13:32:53 2011 -0300
Add support for enabling UDPTL over IPv6.
diff --git a/config/SipConfigurator.py b/config/SipConfigurator.py
index e20050c..89bda8e 100755
--- a/config/SipConfigurator.py
+++ b/config/SipConfigurator.py
@@ -168,6 +168,9 @@ class SipSectionVisitors(Configurator.SectionVisitors):
item = AsteriskSCF.Configuration.SipSessionManager.V1.SipRTPMediaServiceItem()
mapper.map('rtpoveripv6', item, 'requireIPv6', 'mediaservice', config.getboolean, None)
+ item = AsteriskSCF.Configuration.SipSessionManager.V1.SipUDPTLMediaServiceItem()
+ mapper.map('udptloveripv6', item, 'requireIPv6', 'udptlmediaservice', config.getboolean, None)
+
item = AsteriskSCF.Configuration.SipSessionManager.V1.SipCryptoCertificateItem()
mapper.map('certificateauthorityfile', item, 'certificateAuthority', 'cryptocert', config.get, None)
mapper.map('certificatefile', item, 'certificate', 'cryptocert', config.get, None)
diff --git a/slice/AsteriskSCF/Configuration/SipSessionManager/SipConfigurationIf.ice b/slice/AsteriskSCF/Configuration/SipSessionManager/SipConfigurationIf.ice
index 6bddae5..9fc2f6a 100644
--- a/slice/AsteriskSCF/Configuration/SipSessionManager/SipConfigurationIf.ice
+++ b/slice/AsteriskSCF/Configuration/SipSessionManager/SipConfigurationIf.ice
@@ -298,6 +298,22 @@ class SipRTPMediaServiceItem extends SipConfigurationItem
};
/**
+ * UDPTL Media service configuration item
+ */
+class SipUDPTLMediaServiceItem extends SipConfigurationItem
+{
+ /**
+ * Name of the UDPTL media service to use
+ */
+ string mediaServiceName;
+
+ /**
+ * Whether to choose an IPv6 UDPTL media service or not
+ */
+ bool requireIPv6 = false;
+};
+
+/**
* Signaling NAT configuration item
*/
class SipSignalingNATItem extends SipConfigurationItem
diff --git a/src/SipConfiguration.cpp b/src/SipConfiguration.cpp
index d6a342a..1f48577 100644
--- a/src/SipConfiguration.cpp
+++ b/src/SipConfiguration.cpp
@@ -210,6 +210,11 @@ class EndpointConfigHelper : public boost::enable_shared_from_this<EndpointConfi
mUpdates.push_back(boost::bind(&EndpointConfigHelper::updateMediaService, mConfig, service));
};
+ void visitSipUDPTLMediaServiceItem(const SipUDPTLMediaServiceItemPtr& service)
+ {
+ mUpdates.push_back(boost::bind(&EndpointConfigHelper::updateUDPTLMediaService, mConfig, service));
+ };
+
void visitSipEndpointTransportItem(const SipEndpointTransportItemPtr& transport)
{
mUpdates.push_back(boost::bind(&EndpointConfigHelper::updateTransport, mConfig, transport));
@@ -303,6 +308,11 @@ public:
mEndpoint->setRTPOverIPv6(service->requireIPv6);
}
+ void updateUDPTLMediaService(const SipUDPTLMediaServiceItemPtr& service)
+ {
+ mEndpoint->setUDPTLOverIPv6(service->requireIPv6);
+ }
+
void updateTransport(const SipEndpointTransportItemPtr& transport)
{
mEndpoint->setSecureTransport(translateCallDirection(transport->secureTransport));
diff --git a/src/SipEndpoint.cpp b/src/SipEndpoint.cpp
index 7e18d27..0cba8b2 100644
--- a/src/SipEndpoint.cpp
+++ b/src/SipEndpoint.cpp
@@ -314,6 +314,11 @@ void SipEndpoint::setRTPOverIPv6(bool enabled)
mImplPriv->mConfig.sessionConfig.rtpOverIPv6 = enabled;
}
+void SipEndpoint::setUDPTLOverIPv6(bool enabled)
+{
+ mImplPriv->mConfig.sessionConfig.udptlOverIPv6 = enabled;
+}
+
void SipEndpoint::setMediaNATOptions(bool useICE, bool useTURN)
{
mImplPriv->mConfig.sessionConfig.rtpOverICE = useICE;
diff --git a/src/SipEndpoint.h b/src/SipEndpoint.h
index 349015b..07e6027 100644
--- a/src/SipEndpoint.h
+++ b/src/SipEndpoint.h
@@ -159,6 +159,8 @@ public:
// Whether we are using IPv6 for media transport
// or not.
bool rtpOverIPv6;
+ // Whether we are using IPv6 for UDPTL transport or not.
+ bool udptlOverIPv6;
// The method by which we will transmit
// DTMF to an endpoint
AsteriskSCF::Configuration::SipSessionManager::V1::SipDTMFOption dtmf;
@@ -333,6 +335,7 @@ public:
void setCallDirection(enum Direction);
void setSecureTransport(enum Direction);
void setRTPOverIPv6(bool);
+ void setUDPTLOverIPv6(bool);
void addFormat(const std::string& name, int sampleRate, int frameSize, const Ice::StringSeq& formatSpecific);
/**
-----------------------------------------------------------------------
--
asterisk-scf/integration/sip.git
More information about the asterisk-scf-commits
mailing list