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

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Tue Sep 7 22:07:40 CDT 2010


branch "master" has been updated
       via  a75e8099c8befd7f11c721e81562b8217f309145 (commit)
      from  68b58eac7851d644c648e07e3ed3c9ee8539fc04 (commit)

Summary of changes:
 src/SipEndpoint.cpp |    9 ++++++---
 src/SipSession.cpp  |   15 ++++++++++++---
 src/SipSession.h    |    2 +-
 3 files changed, 19 insertions(+), 7 deletions(-)


- Log -----------------------------------------------------------------
commit a75e8099c8befd7f11c721e81562b8217f309145
Author: Joshua Colp <jcolp at digium.com>
Date:   Wed Sep 8 00:13:02 2010 -0300

    Implement createSession. It now does what it says. Next up is creation of the session for INVITE (incoming) calls.

diff --git a/src/SipEndpoint.cpp b/src/SipEndpoint.cpp
index 7dd069d..64bedb7 100644
--- a/src/SipEndpoint.cpp
+++ b/src/SipEndpoint.cpp
@@ -172,10 +172,13 @@ std::string SipEndpoint::getId(const Ice::Current&)
    return "";
 }
 
-AsteriskSCF::SessionCommunications::V1::SessionPrx SipEndpoint::createSession(const std::string&, const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx&, const Ice::Current&)
+AsteriskSCF::SessionCommunications::V1::SessionPrx SipEndpoint::createSession(const std::string& destination, const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx& listener, const Ice::Current&)
 {
-   AsteriskSCF::SessionCommunications::V1::SessionPrx session;
-   return session;
+   // Based on the configuration are we permitted to call this endpoint?
+
+   SipSessionPtr session = new SipSession(mImplPriv->mAdapter, this, destination, listener);
+   mImplPriv->mSessions.push_back(session);
+   return session->getSessionProxy();
 }
 
 AsteriskSCF::SessionCommunications::V1::SessionSeq SipEndpoint::getSessions(const Ice::Current&)
diff --git a/src/SipSession.cpp b/src/SipSession.cpp
index 2790456..e64c7a7 100644
--- a/src/SipSession.cpp
+++ b/src/SipSession.cpp
@@ -61,7 +61,9 @@ public:
    /**
     * Constructor for the SipSessionPriv class.
     */
-SipSessionPriv(Ice::ObjectAdapterPtr adapter, SipEndpointPtr endpoint) : mAdapter(adapter), mEndpoint(endpoint) { };
+SipSessionPriv(Ice::ObjectAdapterPtr adapter, SipEndpointPtr endpoint, const std::string& destination)
+   : mAdapter(adapter), mEndpoint(endpoint), mDestination(destination) { };
+
    /**
     * An instance of a media session.
     */
@@ -113,6 +115,11 @@ SipSessionPriv(Ice::ObjectAdapterPtr adapter, SipEndpointPtr endpoint) : mAdapte
    SipEndpointPtr mEndpoint;
 
    /**
+    * The destination that is the target of the session.
+    */
+   std::string mDestination;
+
+   /**
     * A vector of listeners that want to be notified of responses from the SIP endpoint.
     */
    std::vector<AsteriskSCF::SessionCommunications::V1::SessionListenerPrx> mListeners;
@@ -121,9 +128,11 @@ SipSessionPriv(Ice::ObjectAdapterPtr adapter, SipEndpointPtr endpoint) : mAdapte
 /**
  * Default constructor.
  */
-SipSession::SipSession(Ice::ObjectAdapterPtr adapter, SipEndpointPtr endpoint)
-   : mImplPriv(new SipSessionPriv(adapter, endpoint))
+SipSession::SipSession(Ice::ObjectAdapterPtr adapter, SipEndpointPtr endpoint, const std::string& destination, const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx& listener)
+: mImplPriv(new SipSessionPriv(adapter, endpoint, destination))
 {
+   mImplPriv->mListeners.push_back(listener);
+
    mImplPriv->mSessionProxy = AsteriskSCF::SessionCommunications::V1::SessionPrx::uncheckedCast(adapter->addWithUUID(this));
 
    mImplPriv->mMediaSession = new SipMediaSession(this);
diff --git a/src/SipSession.h b/src/SipSession.h
index 559a56c..2882904 100644
--- a/src/SipSession.h
+++ b/src/SipSession.h
@@ -42,7 +42,7 @@ class SipSessionPriv;
 class SipSession : public AsteriskSCF::SessionCommunications::V1::Session
 {
 public:
-   SipSession(Ice::ObjectAdapterPtr, SipEndpointPtr);
+   SipSession(Ice::ObjectAdapterPtr, SipEndpointPtr, const std::string&, const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx&);
 
    bool operator==(const SipSession &other) const;
 

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


-- 
asterisk-scf/integration/sip.git



More information about the asterisk-scf-commits mailing list