[asterisk-scf-commits] asterisk-scf/release/sip.git branch "master" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Wed Sep 14 17:43:34 CDT 2011


branch "master" has been updated
       via  ee3a950ea3930a81c156217bf614f5b0512fc0aa (commit)
       via  712a66be46d2e2944440e097f88568182b405f4d (commit)
       via  57aae578b562047e1e8fa949a2ca597d73f36645 (commit)
      from  c18c1c9ca971b3b08c0224f059c45052e71f636a (commit)

Summary of changes:
 src/SipEndpoint.cpp |   22 ++++++++++++++++++++++
 src/SipSession.cpp  |   35 +++++++++++++++++++++++++++++++++--
 2 files changed, 55 insertions(+), 2 deletions(-)


- Log -----------------------------------------------------------------
commit ee3a950ea3930a81c156217bf614f5b0512fc0aa
Merge: 712a66b c18c1c9
Author: Mark Michelson <mmichelson at digium.com>
Date:   Wed Sep 14 17:32:50 2011 -0500

    Merge branch 'master' into telephone-events


commit 712a66be46d2e2944440e097f88568182b405f4d
Author: Mark Michelson <mmichelson at digium.com>
Date:   Fri Aug 5 11:01:38 2011 -0500

    Add the RFC4733 format to configured formats if relevant.
    
    I also added some error messages for failures, since I was having a name
    mismatch issue when looking up the format I wanted.

diff --git a/src/SipEndpoint.cpp b/src/SipEndpoint.cpp
index f8e0cf5..e34f455 100644
--- a/src/SipEndpoint.cpp
+++ b/src/SipEndpoint.cpp
@@ -63,8 +63,17 @@ public:
 	mDescriptorService->begin_getNamedFormat(mName, mSampleRate, mFrameSize, mFormatSpecific, descriptorCB);
     }
 
+    std::string printFormat()
+    {
+        std::stringstream str;
+        //We could add frameSize here later.
+        str << mName << "/" << mSampleRate;
+        return str.str();
+    }
+
     void locateFailureCB(const Ice::Exception&)
     {
+        lg(Error) << "Couldn't locate format " << printFormat();
     }
 
     void getNamedFormatCB(const FormatPtr& format)
@@ -82,6 +91,7 @@ public:
 
     void getNamedFormatFailureCB(const Ice::Exception&)
     {
+        lg(Error) << "getNamedFormat failed for format " << printFormat();
     }
 
     void getDescriptorCB(const SDPDescriptorPtr& descriptor)
@@ -95,6 +105,7 @@ public:
 
     void getDescriptorFailureCB(const Ice::Exception&)
     {
+        lg(Error) << "getDescriptor failed for format " << printFormat();
     }
 
     SDPDescriptorServicePrx getDescriptorService()
@@ -288,6 +299,17 @@ void SipEndpoint::setSecureTransport(enum Direction direction)
 void SipEndpoint::setDTMFMethod(AsteriskSCF::Configuration::SipSessionManager::V1::SipDTMFOption dtmf)
 {
     mImplPriv->mConfig.sessionConfig.dtmf = dtmf;
+    if (mImplPriv->mConfig.sessionConfig.dtmf ==
+            AsteriskSCF::Configuration::SipSessionManager::V1::RFC4733)
+    {
+        //For RFC 4733, we need to include information in the SDP about
+        //the format, so we need to add a new format to the endpoint's
+        //configured formats.
+
+        //XXX For now, we're just adding some hard-coded values. We should probably
+        //be a bit more flexible here in the face of changes or something.
+        addFormat("rfc4733", 8000, 0, Ice::StringSeq());
+    }
 }
 
 void SipEndpoint::setRTPOverIPv6(bool enabled)

commit 57aae578b562047e1e8fa949a2ca597d73f36645
Author: Mark Michelson <mmichelson at digium.com>
Date:   Tue Aug 2 14:26:10 2011 -0500

    Adjust for media API changes.

diff --git a/src/SipSession.cpp b/src/SipSession.cpp
index aa2c3f5..8d94fd0 100755
--- a/src/SipSession.cpp
+++ b/src/SipSession.cpp
@@ -1971,7 +1971,17 @@ pjmedia_sdp_session *SipSession::createSDPOffer(const AsteriskSCF::Media::V1::St
         }
 
         // Allocate a new RTP session to carry the media formats we have in common
-        RTPSessionPrx session = factory->allocate(params);
+        
+        RTPOptionsPtr options(new RTPOptions());
+        RTPAllocationOutputsPtr outputs;
+
+        SipEndpointConfig& config = mImplPriv->mEndpoint->getConfig();
+        if (config.sessionConfig.dtmf == AsteriskSCF::Configuration::SipSessionManager::V1::RFC4733)
+        {
+            options->handleTelephonyEvents = true;
+        }
+
+        RTPSessionPrx session = factory->allocate(params, options, outputs);
 
         // Double check to make sure they actually gave us a sesson back... they could have had a problem
         if (session == 0)
@@ -1979,6 +1989,12 @@ pjmedia_sdp_session *SipSession::createSDPOffer(const AsteriskSCF::Media::V1::St
             continue;
         }
 
+        if (outputs)
+        {
+            mImplPriv->mExternalEventSources = outputs->eventSources;
+            mImplPriv->mExternalEventSinks = outputs->eventSinks;
+        }
+
         // RTP sessions should only provide a single sink, so grab it and update the connection details with that
         // of the remote party
         StreamSinkRTPPrx sink = StreamSinkRTPPrx::uncheckedCast(session->getSinks().front());
@@ -2277,9 +2293,18 @@ pjmedia_sdp_session *SipSession::createSDPAnswer(const pjmedia_sdp_session* offe
                 newStreams.erase(boost::lexical_cast<std::string>(stream));
                 continue;
             }
+        
+            RTPOptionsPtr options(new RTPOptions());
+            RTPAllocationOutputsPtr outputs;
+
+            SipEndpointConfig& config = mImplPriv->mEndpoint->getConfig();
+            if (config.sessionConfig.dtmf == AsteriskSCF::Configuration::SipSessionManager::V1::RFC4733)
+            {
+                options->handleTelephonyEvents = true;
+            }
 
             // Allocate a new RTP session to carry the media formats we have in common
-            session = factory->allocate(params);
+            session = factory->allocate(params, options, outputs);
 
             // Double check to make sure they actually gave us a sesson back... they could have had a problem
             if (session == 0)
@@ -2291,6 +2316,12 @@ pjmedia_sdp_session *SipSession::createSDPAnswer(const pjmedia_sdp_session* offe
                 continue;
             }
 
+            if (outputs)
+            {
+                mImplPriv->mExternalEventSources = outputs->eventSources;
+                mImplPriv->mExternalEventSinks = outputs->eventSinks;
+            }
+
             // RTP sessions only provide a single sink and source so that makes this easy
             StreamSinkRTPPrx sink = StreamSinkRTPPrx::uncheckedCast(session->getSinks().front());
             mImplPriv->mSinks.push_back(sink);

-----------------------------------------------------------------------


-- 
asterisk-scf/release/sip.git



More information about the asterisk-scf-commits mailing list