[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 May 27 07:58:59 CDT 2011


branch "master" has been updated
       via  700a00bcbae0ee7d6e04353b35007daedd87e2cf (commit)
      from  b4996480a53d71759531ca0ddd8c78fc2b3c96aa (commit)

Summary of changes:
 src/PJSipModule.cpp        |    2 +-
 src/PJSipModule.h          |    1 +
 src/PJSipSessionModule.cpp |   11 ++++++++++-
 3 files changed, 12 insertions(+), 2 deletions(-)


- Log -----------------------------------------------------------------
commit 700a00bcbae0ee7d6e04353b35007daedd87e2cf
Author: Joshua Colp <jcolp at digium.com>
Date:   Fri May 27 09:17:47 2011 -0300

    Set dialog state item to initial pending stay so it does not get prematurely replicated, and update session state information before replicating.

diff --git a/src/PJSipModule.cpp b/src/PJSipModule.cpp
index b545251..dd4645b 100644
--- a/src/PJSipModule.cpp
+++ b/src/PJSipModule.cpp
@@ -37,7 +37,7 @@ namespace SipSessionManager
 const int URI_SIZE = 64;
 
 PJSipDialogModInfo::PJSipDialogModInfo(pjsip_dialog *dialog) :
-    mDialogState(new SipDialogStateItem) , mNeedsReplication(true), mNeedsRemoval(false)
+    mDialogState(new SipDialogStateItem) , mNeedsReplication(true), mNeedsRemoval(false), mPending(true)
 {
     //XXX Is there a way to tell ICE to make the default
     //constructor for SipStateItem set key?
diff --git a/src/PJSipModule.h b/src/PJSipModule.h
index 5862d16..451a02a 100644
--- a/src/PJSipModule.h
+++ b/src/PJSipModule.h
@@ -62,6 +62,7 @@ public:
     SipDialogStateItemPtr mDialogState;
     bool mNeedsReplication;
     bool mNeedsRemoval;
+    bool mPending;
 };
 
 class PJSipTransactionModInfo
diff --git a/src/PJSipSessionModule.cpp b/src/PJSipSessionModule.cpp
index 234c29a..429b4e0 100644
--- a/src/PJSipSessionModule.cpp
+++ b/src/PJSipSessionModule.cpp
@@ -187,7 +187,11 @@ void PJSipSessionModule::replicateState(PJSipDialogModInfo *dlgInfo, PJSipTransa
         lg(Debug) << "Transport: " << dlgInfo->mDialogState->mTransport;
         lg(Debug) << "UAC Has 2xx: " << dlgInfo->mDialogState->mUacHas2xx;
         lg(Debug) << "Is Uac: " << dlgInfo->mDialogState->mIsUac;
-        if (dlgInfo->mNeedsRemoval == true)
+	if (dlgInfo->mPending == true)
+	{
+	    lg(Debug) << "Dialog is in pending state, not replicating";
+	}
+        else if (dlgInfo->mNeedsRemoval == true)
         {
             lg(Debug) << "Removing dialog";
             removeItems.push_back(dlgInfo->mDialogState->key);
@@ -354,6 +358,10 @@ protected:
         PJSipSessionModInfo *session_mod_info = (PJSipSessionModInfo*)mInv->mod_data[mSessionModule->getModule().id];
         // Now we can actually set a for-real non-NULL session on the session module information.
         session_mod_info->setSessionPtr(mSession);
+
+	dlg_mod_info->mPending = false;
+
+	session_mod_info->updateSessionState(mInv);
     
         lg(Debug) << "Replicating state on reception of new SIP INVITE.";
         mSessionModule->replicateState(dlg_mod_info, tsx_mod_info, session_mod_info);
@@ -1246,6 +1254,7 @@ void PJSipSessionModule::invOnStateChanged(pjsip_inv_session *inv, pjsip_event *
         inv->invite_tsx->mod_data[mModule.id] = (void *) tsx_mod_info;
         inv->dlg->mod_data[mModule.id] = (void *) dlg_mod_info;
         dlg_mod_info->mDialogState->mSessionId = session_mod_info->mSessionState->mSessionId;
+	dlg_mod_info->mPending = false;
         tsx_mod_info->mTransactionState->mSessionId = session_mod_info->mSessionState->mSessionId;
         lg(Debug) << "Replicating state on new outbound INVITE.";
         replicateState(dlg_mod_info, tsx_mod_info, session_mod_info);

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


-- 
asterisk-scf/release/sip.git



More information about the asterisk-scf-commits mailing list