[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
Fri Sep 30 17:54:02 CDT 2011


branch "master" has been updated
       via  ea9c1132ca848007552fa5763ec4a364e6e51e1b (commit)
      from  4558877dfa0be63ee1a06dad330c6a6dda84d147 (commit)

Summary of changes:
 src/SipSession.cpp |   65 +++++++++++----------------------------------------
 src/SipSession.h   |    2 +-
 2 files changed, 15 insertions(+), 52 deletions(-)


- Log -----------------------------------------------------------------
commit ea9c1132ca848007552fa5763ec4a364e6e51e1b
Author: Ken Hunt <ken.hunt at digium.com>
Date:   Fri Sep 30 17:25:35 2011 -0500

    Adapting to changes in Party ID api.

diff --git a/src/SipSession.cpp b/src/SipSession.cpp
index 98d5716..02af316 100755
--- a/src/SipSession.cpp
+++ b/src/SipSession.cpp
@@ -86,7 +86,7 @@ public:
 
         registerType(ConnectedLine::ice_staticId());
 
-        registerType(Redirecting::ice_staticId());
+        registerType(Redirections::ice_staticId());
     }
 
     bool contains(const std::string& cookieTypeId) const 
@@ -796,47 +796,6 @@ private:
     SipSessionPtr mSession;
 };
 
-class UpdateRedirectingOperation : public SuspendableWork
-{
-public:
-    UpdateRedirectingOperation(const RedirectingPtr& redirecting,
-                               const boost::shared_ptr<SipSessionPriv>& sessionPriv,
-                               const SipSessionPtr& session)
-        : mRedirecting(redirecting), mImplPriv(sessionPriv), mSession(session)
-    {
-    }
-
-    SuspendableWorkResult execute(const SuspendableWorkListenerPtr&)
-    {
-        lg(Debug) << "Executing an UpdateRedirecting operation";
-
-        AsteriskSCF::SessionCommunications::V1::SessionCookieDict cookies = mSession->getAllCookies();
-
-        AsteriskSCF::SessionCommunications::V1::SessionCookieDict::const_iterator search = mImplPriv->mSessionCookies.find(mRedirecting->ice_id());
-
-        int updatedCount = 1;
-        if (search != cookies.end())
-        {
-            RedirectingPtr found = RedirectingPtr::dynamicCast(search->second);
-            updatedCount = found->count + 1;
-        }
-
-        mRedirecting->count = updatedCount;
-
-        // Set or replace redirected info.
-        mImplPriv->mSessionCookies[mRedirecting->ice_id()] = mRedirecting;
-  
-        mImplPriv->cookiesUpdated();
-
-        return Complete;
-    }
-
-private:
-    RedirectingPtr mRedirecting;
-    boost::shared_ptr<SipSessionPriv> mImplPriv;
-    SipSessionPtr mSession;
-};
-
 class SetCookiesOperation : public SuspendableWork
 {
 public:
@@ -903,6 +862,10 @@ public:
         mSession->enqueueSessionWork(new RemoveStreamsOperation(cb, streams, mImplPriv, mSession));
     }
     
+    /**
+     * This operation allows the externally connected component (typically the bridge)
+     * to update this session's ConnectedLine information. 
+     */
     void updateConnectedLine(const ConnectedLinePtr& connected, const Ice::Current&) 
     {
         AsteriskSCF::SessionCommunications::V1::SessionCookies cookies;
@@ -911,13 +874,13 @@ public:
         mSession->enqueueSessionWork(new SetCookiesOperation(cookies, mImplPriv, true));
     }
 
-    void updateRedirecting(const RedirectingPtr& redirecting, const ::Ice::Current&) 
+    /**
+     * This operation provides notification that some other Session we are connected to
+     * has been redirected. 
+     */
+    void updateRedirections(const RedirectionsPtr& redirections, const ::Ice::Current&) 
     {
-        // TBD.. This merits discussion. I don't think the caller should pass in a new
-        // Redirecting record, but rather just the Id of who's being redirected to. 
-        // Counts and "from" should be maintained internally to the session that owns the record. 
-
-        mSession->enqueueSessionWork(new UpdateRedirectingOperation(redirecting, mImplPriv, mSession));
+        // TBD. 
     }
 
 private:
@@ -1628,7 +1591,7 @@ public:
                 // Set the ConnectedLine information on the other controller. 
                 SessionOwnerIdPtr owner = SessionOwnerIdPtr::dynamicCast(search->second);
                 ConnectedLinePtr connectedLine = new ConnectedLine(owner->ids);
-                mController->updateConnectedLine(connectedLine); // Need to be AMI?
+                mController->begin_updateConnectedLine(connectedLine); 
             }
             else
             {
@@ -2073,9 +2036,9 @@ void SipSession::getConnectedLine_async(const AMD_Session_getConnectedLinePtr& c
 /** 
  * Gets the Redirected party identification record for this Session.
  */
-void SipSession::getRedirecting_async(const AMD_Session_getRedirectingPtr& cb, const Ice::Current& )
+void SipSession::getRedirections_async(const AMD_Session_getRedirectionsPtr& cb, const Ice::Current& )
 {
-    enqueueSessionWork(new GetCookieAmdOperation<AMD_Session_getRedirectingPtr, Redirecting, RedirectingPtr>(cb, mImplPriv));
+    enqueueSessionWork(new GetCookieAmdOperation<AMD_Session_getRedirectionsPtr, Redirections, RedirectionsPtr>(cb, mImplPriv));
 }
 
 /**
diff --git a/src/SipSession.h b/src/SipSession.h
index 788e736..895e56e 100644
--- a/src/SipSession.h
+++ b/src/SipSession.h
@@ -225,7 +225,7 @@ public:
     void getDialed_async(const AsteriskSCF::SessionCommunications::V1::AMD_Session_getDialedPtr& cb, const Ice::Current&);
     void getSessionOwnerId_async(const AsteriskSCF::SessionCommunications::V1::AMD_Session_getSessionOwnerIdPtr& cb, const ::Ice::Current&);
     void getConnectedLine_async(const AsteriskSCF::SessionCommunications::V1::AMD_Session_getConnectedLinePtr& cb, const ::Ice::Current&);
-    void getRedirecting_async(const AsteriskSCF::SessionCommunications::V1::AMD_Session_getRedirectingPtr& cb, const Ice::Current& );
+    void getRedirections_async(const AsteriskSCF::SessionCommunications::V1::AMD_Session_getRedirectionsPtr& cb, const Ice::Current& );
 
     void getStreams_async(
         const AsteriskSCF::SessionCommunications::V1::AMD_Session_getStreamsPtr&,

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


-- 
asterisk-scf/release/sip.git



More information about the asterisk-scf-commits mailing list