[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
Wed Sep 22 08:16:26 CDT 2010


branch "master" has been updated
       via  f6c5d04774ec99050fbb7146a56946bd14120504 (commit)
      from  936ad79cdb9b6db021cbe53d2942bfe547d0d2c5 (commit)

Summary of changes:
 local-slice/SipStateReplicationIf.ice |    2 ++
 src/SipStateReplicatorListener.cpp    |    6 +++++-
 2 files changed, 7 insertions(+), 1 deletions(-)


- Log -----------------------------------------------------------------
commit f6c5d04774ec99050fbb7146a56946bd14120504
Author: Joshua Colp <jcolp at digium.com>
Date:   Wed Sep 22 10:18:29 2010 -0300

    Add some more required items to the dialog state item, and make sure the dialog is in the UA with the proper hash.

diff --git a/local-slice/SipStateReplicationIf.ice b/local-slice/SipStateReplicationIf.ice
index 5c2497b..f723e0e 100644
--- a/local-slice/SipStateReplicationIf.ice
+++ b/local-slice/SipStateReplicationIf.ice
@@ -56,6 +56,8 @@ module V1
 	  string mRemoteUri;
 	  Ice::StringSeq mRouteSet;
 	  string mTransport;
+	  bool mUacHas2xx;
+	  bool mIsUac;
    };
 
    enum TransactionState
diff --git a/src/SipStateReplicatorListener.cpp b/src/SipStateReplicatorListener.cpp
index 3dc0771..7e0229e 100644
--- a/src/SipStateReplicatorListener.cpp
+++ b/src/SipStateReplicatorListener.cpp
@@ -112,7 +112,8 @@ public:
 		  // For some reason we failed to create a dialog and can go no further ;(
 		  continue;
 	       }
-	       // TODO: Change role to be UAS if need be
+
+	       localDialog->role = (dialog->mIsUac == true) ? PJSIP_ROLE_UAC : PJSIP_ROLE_UAS;
 
 	       // Since the Call ID will never change for the lifetime of the dialog we only mess with it here when creating the dialog itself
 	       pj_strdup2(localDialog->pool, &localDialog->call_id->id, dialog->mCallId.c_str());
@@ -124,14 +125,17 @@ public:
 	    }
 
 	    localDialog->state = (dialog->mIsDialogEstablished == true) ? PJSIP_DIALOG_STATE_ESTABLISHED : PJSIP_DIALOG_STATE_NULL;
+	    localDialog->uac_has_2xx = (dialog->mUacHas2xx == true) ? PJ_TRUE : PJ_FALSE;
 	    localDialog->local.cseq = dialog->mLocalCSeq;
 	    localDialog->remote.cseq = dialog->mRemoteCSeq;
 
 	    // Strings we do not just set since doing so could needlessly increase memory usage, and we have to be careful of that
 	    if (pj_strcmp2(&localDialog->local.info->tag, dialog->mLocalTag.c_str()))
 	    {
+	       pjsip_ua_unregister_dlg(pjsip_ua_instance(), localDialog);
 	       pj_strdup2(localDialog->pool, &localDialog->local.info->tag, dialog->mLocalTag.c_str());
 	       localDialog->local.tag_hval = pj_hash_calc(0, localDialog->local.info->tag.ptr, localDialog->local.info->tag.slen);
+	       pjsip_ua_register_dlg(pjsip_ua_instance(), localDialog);
 	    }
 
 	    if (pj_strcmp2(&localDialog->remote.info->tag, dialog->mRemoteTag.c_str()))

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


-- 
asterisk-scf/integration/sip.git



More information about the asterisk-scf-commits mailing list