[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
Mon Oct 18 17:00:15 CDT 2010
branch "master" has been updated
via f851c92d442a922b5924bdf3ab113fa6ce949a3f (commit)
from 403266007b0859000ddefa87439ab0f090a95dbf (commit)
Summary of changes:
src/PJSipManager.cpp | 8 ++++----
src/PJSipManager.h | 4 ++--
src/PJSipSessionModule.h | 2 +-
src/SipSession.cpp | 10 ++++++----
src/SipStateReplicatorListener.cpp | 4 ++--
5 files changed, 15 insertions(+), 13 deletions(-)
- Log -----------------------------------------------------------------
commit f851c92d442a922b5924bdf3ab113fa6ce949a3f
Author: Mark Michelson <mmichelson at digium.com>
Date: Mon Oct 18 17:02:49 2010 -0500
Replicate state when session listeners are added and removed.
diff --git a/src/PJSipManager.cpp b/src/PJSipManager.cpp
index fc614a9..be0e26f 100644
--- a/src/PJSipManager.cpp
+++ b/src/PJSipManager.cpp
@@ -84,14 +84,14 @@ pjsip_endpoint *PJSipManager::getEndpoint()
return mEndpoint;
}
-pjsip_module &PJSipManager::getSessionModule()
+PJSipSessionModule *PJSipManager::getSessionModule()
{
- return mSessionModule->getModule();
+ return mSessionModule;
}
-pjsip_module &PJSipManager::getLoggingModule()
+PJSipLoggingModule *PJSipManager::getLoggingModule()
{
- return mLoggingModule->getModule();
+ return mLoggingModule;
}
bool PJSipManager::setTransports(pjsip_endpoint *endpoint, Ice::PropertiesPtr props)
diff --git a/src/PJSipManager.h b/src/PJSipManager.h
index b2e27c8..5a6d36a 100644
--- a/src/PJSipManager.h
+++ b/src/PJSipManager.h
@@ -47,12 +47,12 @@ public:
/**
* Get a reference to the PJSIP session module
*/
- pjsip_module &getSessionModule();
+ PJSipSessionModule *getSessionModule();
/**
* Get a reference to the PJSIP logging module
*/
- pjsip_module &getLoggingModule();
+ PJSipLoggingModule *getLoggingModule();
/**
* Register the PJSipSessionModule, responsible
diff --git a/src/PJSipSessionModule.h b/src/PJSipSessionModule.h
index 9d59acd..323ddcf 100644
--- a/src/PJSipSessionModule.h
+++ b/src/PJSipSessionModule.h
@@ -67,9 +67,9 @@ public:
pjsip_redirect_op invOnRedirected(pjsip_inv_session *inv, const pjsip_uri *target, const pjsip_event *e);
pjsip_dialog *uaOnDialogForked(pjsip_dialog *first_set, pjsip_rx_data *rdata);
// Missing onsendack for now
-private:
void replicateState(PJSipDialogModInfo *dlgInfo, PJSipTransactionModInfo *tsxInfo,
PJSipSessionModInfo *sessionInfo);
+private:
void handleNewInvite(pjsip_rx_data *rdata);
void handleInviteResponse(pjsip_inv_session *inv, pjsip_rx_data *rdata, pjsip_dialog *dlg);
void handleRefer(pjsip_inv_session *inv, pjsip_rx_data *rdata);
diff --git a/src/SipSession.cpp b/src/SipSession.cpp
index 8d1fcc3..ac0d150 100644
--- a/src/SipSession.cpp
+++ b/src/SipSession.cpp
@@ -201,8 +201,9 @@ AsteriskSCF::SessionCommunications::V1::SessionInfoPtr SipSession::addListener(c
mImplPriv->mListeners.push_back(listener);
if (mImplPriv->mInviteSession)
{
- PJSipSessionModInfo *session_mod_info = static_cast<PJSipSessionModInfo*>(mImplPriv->mInviteSession->mod_data[mImplPriv->mManager->getSessionModule().id]);
+ PJSipSessionModInfo *session_mod_info = static_cast<PJSipSessionModInfo*>(mImplPriv->mInviteSession->mod_data[mImplPriv->mManager->getSessionModule()->getModule().id]);
session_mod_info->updateSessionState(mImplPriv->mInviteSession);
+ mImplPriv->mManager->getSessionModule()->replicateState(NULL, NULL, session_mod_info);
}
return getInfo(current);
}
@@ -374,8 +375,9 @@ void SipSession::removeListener(const AsteriskSCF::SessionCommunications::V1::Se
mImplPriv->mListeners.erase(std::remove(mImplPriv->mListeners.begin(), mImplPriv->mListeners.end(), listener), mImplPriv->mListeners.end());
if (mImplPriv->mInviteSession)
{
- PJSipSessionModInfo *session_mod_info = static_cast<PJSipSessionModInfo*>(mImplPriv->mInviteSession->mod_data[mImplPriv->mManager->getSessionModule().id]);
+ PJSipSessionModInfo *session_mod_info = static_cast<PJSipSessionModInfo*>(mImplPriv->mInviteSession->mod_data[mImplPriv->mManager->getSessionModule()->getModule().id]);
session_mod_info->updateSessionState(mImplPriv->mInviteSession);
+ mImplPriv->mManager->getSessionModule()->replicateState(NULL, NULL, session_mod_info);
}
}
@@ -437,12 +439,12 @@ void SipSession::start(const Ice::Current&)
return;
}
- pjsip_dlg_add_usage(dialog, &mImplPriv->mManager->getSessionModule(), NULL);
+ pjsip_dlg_add_usage(dialog, &mImplPriv->mManager->getSessionModule()->getModule(), NULL);
// Record our session within the dialog so code handling pjsip events can do STUFF
SipSessionPtr session = new SipSession(*this);
PJSipSessionModInfo *session_mod_info = new PJSipSessionModInfo(inviteSession, session);
- inviteSession->mod_data[mImplPriv->mManager->getSessionModule().id] = (void*)session_mod_info;
+ inviteSession->mod_data[mImplPriv->mManager->getSessionModule()->getModule().id] = (void*)session_mod_info;
// Create the actual INVITE packet
pjsip_tx_data *packet;
diff --git a/src/SipStateReplicatorListener.cpp b/src/SipStateReplicatorListener.cpp
index d6ebf79..bc1f13e 100644
--- a/src/SipStateReplicatorListener.cpp
+++ b/src/SipStateReplicatorListener.cpp
@@ -133,7 +133,7 @@ public:
i->second->getSession()->setDialog(localDialog);
PJSipDialogModInfo *dlg_mod_info = new PJSipDialogModInfo(localDialog);
- localDialog->mod_data[mManager->getSessionModule().id] = (void *) dlg_mod_info;
+ localDialog->mod_data[mManager->getSessionModule()->getModule().id] = (void *) dlg_mod_info;
}
localDialog->state = (dialog->mIsDialogEstablished == true) ? PJSIP_DIALOG_STATE_ESTABLISHED : PJSIP_DIALOG_STATE_NULL;
@@ -181,7 +181,7 @@ public:
localInviteSession->role = localDialog->role;
PJSipSessionModInfo *session_mod_info = new PJSipSessionModInfo(localInviteSession, i->second->getSession());
- localInviteSession->mod_data[mManager->getSessionModule().id] = session_mod_info;
+ localInviteSession->mod_data[mManager->getSessionModule()->getModule().id] = session_mod_info;
i->second->getSession()->setInviteSession(localInviteSession);
}
-----------------------------------------------------------------------
--
asterisk-scf/integration/sip.git
More information about the asterisk-scf-commits
mailing list