[asterisk-scf-commits] asterisk-scf/integration/sip.git branch "transfer" updated.
Commits to the Asterisk SCF project code repositories
asterisk-scf-commits at lists.digium.com
Thu Oct 14 07:53:33 CDT 2010
branch "transfer" has been updated
via f719d3d9c1fd646e5765657eb8712d2d9c9c32a9 (commit)
from 9bc2c4cf3c7b265ba02e2f23354f946a05dd96cb (commit)
Summary of changes:
local-slice/SipStateReplicationIf.ice | 1 +
src/PJSipSessionModule.cpp | 2 ++
src/SipSession.cpp | 16 ++++++++++++++--
src/SipSession.h | 1 +
src/SipStateReplicatorListener.cpp | 1 +
5 files changed, 19 insertions(+), 2 deletions(-)
- Log -----------------------------------------------------------------
commit f719d3d9c1fd646e5765657eb8712d2d9c9c32a9
Author: Joshua Colp <jcolp at digium.com>
Date: Thu Oct 14 09:51:15 2010 -0300
Add most of the replication support for the bridge proxy. This does not yet call replicateState since that is not exposed yet.
diff --git a/local-slice/SipStateReplicationIf.ice b/local-slice/SipStateReplicationIf.ice
index baf856b..c395448 100644
--- a/local-slice/SipStateReplicationIf.ice
+++ b/local-slice/SipStateReplicationIf.ice
@@ -134,6 +134,7 @@ module V1
AsteriskSCF::Media::V1::StreamSinkSeq mSinks;
AsteriskSCF::Media::V1::Session *mMediaSession;
SessionListenerSeq mListeners;
+ AsteriskSCF::SessionCommunications::V1::Bridge *mBridge;
};
}; //module V1
diff --git a/src/PJSipSessionModule.cpp b/src/PJSipSessionModule.cpp
index 637b512..2d6ac1a 100644
--- a/src/PJSipSessionModule.cpp
+++ b/src/PJSipSessionModule.cpp
@@ -75,6 +75,8 @@ void PJSipSessionModInfo::updateSessionState(pjsip_inv_session *inv_session)
mSessionState->mSinks = mSession->getSinks();
mSessionState->mMediaSession = mSession->getHiddenMediaSession();
mSessionState->mListeners = mSession->getListeners();
+ Ice::Current current;
+ mSessionState->mBridge = mSession->getBridge(current);
}
//Now we get stuff from the inv_session itself.
diff --git a/src/SipSession.cpp b/src/SipSession.cpp
index becb24d..515fd2e 100644
--- a/src/SipSession.cpp
+++ b/src/SipSession.cpp
@@ -199,6 +199,8 @@ SipSession::SipSession(Ice::ObjectAdapterPtr adapter, SipEndpointPtr endpoint, c
AsteriskSCF::SessionCommunications::V1::SessionInfoPtr SipSession::addListener(const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx& listener, const Ice::Current& current)
{
mImplPriv->mListeners.push_back(listener);
+ PJSipSessionModInfo *session_mod_info = static_cast<PJSipSessionModInfo*>(mImplPriv->mInviteSession->mod_data[mImplPriv->mManager->getSessionModule().id]);
+ session_mod_info->updateSessionState(mImplPriv->mInviteSession);
return getInfo(current);
}
@@ -302,12 +304,20 @@ AsteriskSCF::SessionCommunications::V1::SessionInfoPtr SipSession::setBridge(con
const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx& listener,
const Ice::Current& current)
{
- mImplPriv->mBridge = bridge;
+ setBridge(bridge);
addListener(listener, current);
return getInfo(current);
}
/**
+ * A local function which simply sets the bridge, used in replication.
+ */
+void SipSession::setBridge(const AsteriskSCF::SessionCommunications::V1::BridgePrx& bridge)
+{
+ mImplPriv->mBridge = bridge;
+}
+
+/**
* An implementation of the removeBridge method as defined in SessionCommunications.ice
*/
void SipSession::removeBridge(const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx& listener, const Ice::Current& current)
@@ -317,7 +327,7 @@ void SipSession::removeBridge(const AsteriskSCF::SessionCommunications::V1::Sess
throw new AsteriskSCF::SessionCommunications::V1::NotBridged();
}
- mImplPriv->mBridge = 0;
+ setBridge(0);
removeListener(listener, current);
}
@@ -359,6 +369,8 @@ void SipSession::progress(const AsteriskSCF::SessionCommunications::V1::Response
void SipSession::removeListener(const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx& listener, const Ice::Current&)
{
mImplPriv->mListeners.erase(std::remove(mImplPriv->mListeners.begin(), mImplPriv->mListeners.end(), listener), mImplPriv->mListeners.end());
+ PJSipSessionModInfo *session_mod_info = static_cast<PJSipSessionModInfo*>(mImplPriv->mInviteSession->mod_data[mImplPriv->mManager->getSessionModule().id]);
+ session_mod_info->updateSessionState(mImplPriv->mInviteSession);
}
/**
diff --git a/src/SipSession.h b/src/SipSession.h
index 5703f0e..5743278 100644
--- a/src/SipSession.h
+++ b/src/SipSession.h
@@ -75,6 +75,7 @@ public:
AsteriskSCF::Media::V1::SessionPrx getMediaSession(const Ice::Current&);
AsteriskSCF::SessionCommunications::V1::BridgePrx getBridge(const Ice::Current&);
AsteriskSCF::SessionCommunications::V1::SessionInfoPtr setBridge(const AsteriskSCF::SessionCommunications::V1::BridgePrx&, const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx&, const Ice::Current&);
+ void setBridge(const AsteriskSCF::SessionCommunications::V1::BridgePrx&);
void removeBridge(const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx&, const Ice::Current&);
void hold(const Ice::Current&);
void progress(const AsteriskSCF::SessionCommunications::V1::ResponseCodePtr&, const Ice::Current&);
diff --git a/src/SipStateReplicatorListener.cpp b/src/SipStateReplicatorListener.cpp
index e241fe9..d6ebf79 100644
--- a/src/SipStateReplicatorListener.cpp
+++ b/src/SipStateReplicatorListener.cpp
@@ -100,6 +100,7 @@ public:
}
localitem->getSession()->setListeners(session->mListeners);
+ localitem->getSession()->setBridge(session->mBridge);
}
else if ((dialog = SipDialogStateItemPtr::dynamicCast((*item))))
{
-----------------------------------------------------------------------
--
asterisk-scf/integration/sip.git
More information about the asterisk-scf-commits
mailing list