[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 Sep 27 13:25:08 CDT 2010


branch "master" has been updated
       via  3544960e1f73dd11af6160c1d838970c7f3f3edf (commit)
       via  bc6eb5fe1d67a4d6cbe96064e21a5c80b381e366 (commit)
       via  00531f21b4b1c2a0dd29980198f9f00674c7de94 (commit)
       via  cbf5d4f33301566764a48fb9bd255380193f229a (commit)
      from  043ce31eef3dd46fb835cdb38a7d347fe947c1d8 (commit)

Summary of changes:
 config/test_sip.conf         |    3 +++
 src/PJSipSessionModule.cpp   |   25 +++++++++++++++++--------
 src/SipChannelServiceApp.cpp |    9 ++++++++-
 src/SipSession.cpp           |    2 +-
 4 files changed, 29 insertions(+), 10 deletions(-)


- Log -----------------------------------------------------------------
commit 3544960e1f73dd11af6160c1d838970c7f3f3edf
Author: Joshua Colp <jcolp at digium.com>
Date:   Mon Sep 27 15:25:21 2010 -0300

    Update state information when transaction events occur.

diff --git a/src/PJSipSessionModule.cpp b/src/PJSipSessionModule.cpp
index c086594..0ecb4db 100644
--- a/src/PJSipSessionModule.cpp
+++ b/src/PJSipSessionModule.cpp
@@ -690,7 +690,7 @@ static void invOnTransactionStateChanged(pjsip_inv_session *inv, pjsip_transacti
 	{
 		tsx_mod_info->mNeedsRemoval = true;
 	}
-	if (e->type == PJSIP_EVENT_TX_MSG || e->type == PJSIP_EVENT_RX_MSG)
+	if (e->type == PJSIP_EVENT_TSX_STATE)
 	{
 		pjsip_dialog *dlg = pjsip_tsx_get_dlg(tsx);
 		PJSipDialogModInfo *dlg_mod_info = NULL;

commit bc6eb5fe1d67a4d6cbe96064e21a5c80b381e366
Author: Joshua Colp <jcolp at digium.com>
Date:   Mon Sep 27 15:24:53 2010 -0300

    Add a configurtion option which sets whether the instance of the SIP component is a listener or not.

diff --git a/config/test_sip.conf b/config/test_sip.conf
index 75a6f36..1877ee3 100644
--- a/config/test_sip.conf
+++ b/config/test_sip.conf
@@ -25,6 +25,9 @@ Sip.Transport.UdpBindAddr=0.0.0.0:5060
 # The name of the State replicator to use
 Sip.StateReplicatorName=default
 
+# Whether we are only a listener or not
+Sip.StateReplicatorListener=no
+
 # Endpoints that we know about
 Sip.Endpoints=cisco 18005558355
 
diff --git a/src/PJSipSessionModule.cpp b/src/PJSipSessionModule.cpp
index 1471a54..c086594 100644
--- a/src/PJSipSessionModule.cpp
+++ b/src/PJSipSessionModule.cpp
@@ -323,14 +323,17 @@ static void replicateState(PJSipDialogModInfo *dlgInfo, PJSipTransactionModInfo
 		}
 	}
 	std::cout << "========== End State Replication Dump ==========" << std::endl;
-	SipStateReplicatorPrx replicator = SipChannelServiceDataModel::getInstance().getStateReplicator();
-	if (setItems.size() != 0 && replicator)
+	if (SipChannelServiceDataModel::getInstance().getCommunicator()->getProperties()->getPropertyWithDefault("Sip.StateReplicatorListener", "no") == "no")
 	{
-		replicator->setState(setItems);
-	}
-	if (removeItems.size() != 0 && replicator)
-	{
-		replicator->removeState(removeItems);
+	   SipStateReplicatorPrx replicator = SipChannelServiceDataModel::getInstance().getStateReplicator();
+	   if (setItems.size() != 0 && replicator)
+	   {
+	      replicator->setState(setItems);
+	   }
+	   if (removeItems.size() != 0 && replicator)
+	   {
+	      replicator->removeState(removeItems);
+	   }
 	}
 }
 
diff --git a/src/SipChannelServiceApp.cpp b/src/SipChannelServiceApp.cpp
index 518ff94..771d2bf 100644
--- a/src/SipChannelServiceApp.cpp
+++ b/src/SipChannelServiceApp.cpp
@@ -383,7 +383,14 @@ void SipChannelServiceApp::locateStateReplicator()
    {
    Ice::ObjectPrx objectPrx = mDataModelInstance.mServiceLocator->locate(replicatorParams);
    mDataModelInstance.mStateReplicator = SIP::V1::SipStateReplicatorPrx::checkedCast(objectPrx);
-   mDataModelInstance.mStateReplicator->addListener(mReplicatorListenerProxy);
+
+   // Are we a listener?
+   if (communicator()->getProperties()->getPropertyWithDefault("Sip.StateReplicatorListener", "no") == "yes")
+   {
+      mDataModelInstance.mStateReplicator->addListener(mReplicatorListenerProxy);
+      SipStateItemSeq state = mDataModelInstance.mStateReplicator->getAllState();
+      mReplicatorListener->stateSet(state);
+   }
    }
    catch (...)
    {

commit 00531f21b4b1c2a0dd29980198f9f00674c7de94
Author: Joshua Colp <jcolp at digium.com>
Date:   Mon Sep 27 15:00:08 2010 -0300

    Store the session identifier on other state items so everything can be linked together nicely.

diff --git a/src/PJSipSessionModule.cpp b/src/PJSipSessionModule.cpp
index e6a619e..1471a54 100644
--- a/src/PJSipSessionModule.cpp
+++ b/src/PJSipSessionModule.cpp
@@ -161,6 +161,8 @@ PJSipSessionModInfo::PJSipSessionModInfo(pjsip_inv_session *inv_session, SipSess
 									   mNeedsRemoval(false), mSession(session)
 {
    mSessionState->key = IceUtil::generateUUID();
+   mSessionState->mSessionId = mSessionState->key;
+   mInviteState->mSessionId = mSessionState->key;
    updateSessionState(inv_session);
 }
 
@@ -457,6 +459,8 @@ static void handle_new_invite(pjsip_rx_data *rdata)
 	session->setInviteSession(inv_session);
 	session->setDialog(dlg);
 	PJSipSessionModInfo *session_mod_info = new PJSipSessionModInfo(inv_session, session);
+	dlg_mod_info->mDialogState->mSessionId = session_mod_info->mSessionState->mSessionId;
+	tsx_mod_info->mTransactionState->mSessionId = session_mod_info->mSessionState->mSessionId;
 
 	inv_session->mod_data[module->id] = (void *)session_mod_info;
 	dlg->mod_data[module->id] = (void *)dlg_mod_info;
@@ -638,6 +642,8 @@ static void invOnStateChanged(pjsip_inv_session *inv, pjsip_event *event)
 	  PJSipSessionModInfo *session_mod_info = static_cast<PJSipSessionModInfo *>(inv->mod_data[SipChannelServiceDataModel::getInstance().getPJSipManager()->getSessionModule()->id]);
 	  inv->invite_tsx->mod_data[SipChannelServiceDataModel::getInstance().getPJSipManager()->getSessionModule()->id] = (void *) tsx_mod_info;
 	  inv->dlg->mod_data[SipChannelServiceDataModel::getInstance().getPJSipManager()->getSessionModule()->id] = (void *) dlg_mod_info;
+	  dlg_mod_info->mDialogState->mSessionId = session_mod_info->mSessionState->mSessionId;
+	  tsx_mod_info->mTransactionState->mSessionId = session_mod_info->mSessionState->mSessionId;
 	  replicateState(dlg_mod_info, tsx_mod_info, session_mod_info);
    }
 }

commit cbf5d4f33301566764a48fb9bd255380193f229a
Author: Joshua Colp <jcolp at digium.com>
Date:   Mon Sep 27 14:17:17 2010 -0300

    Ensure the dialog and invite session pointers point to NOTHING by default.

diff --git a/src/SipSession.cpp b/src/SipSession.cpp
index 289aa18..2d2bf51 100644
--- a/src/SipSession.cpp
+++ b/src/SipSession.cpp
@@ -62,7 +62,7 @@ public:
     * Constructor for the SipSessionPriv class.
     */
 SipSessionPriv(Ice::ObjectAdapterPtr adapter, SipEndpointPtr endpoint, const std::string& destination)
-   : mAdapter(adapter), mEndpoint(endpoint), mDestination(destination) { };
+	: mAdapter(adapter), mDialog(0), mInviteSession(0), mEndpoint(endpoint), mDestination(destination) { };
 
    /**
     * An instance of a media session.

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


-- 
asterisk-scf/integration/sip.git



More information about the asterisk-scf-commits mailing list