[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 15:40:05 CDT 2010


branch "master" has been updated
       via  607afb93545b40c0a601616ed6e03e37c14853cb (commit)
      from  6c055089caec742815e4d33923f1157b9386b929 (commit)

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


- Log -----------------------------------------------------------------
commit 607afb93545b40c0a601616ed6e03e37c14853cb
Author: Mark Michelson <mmichelson at digium.com>
Date:   Mon Sep 27 15:40:24 2010 -0500

    Update some missing dialog state items.

diff --git a/src/PJSipSessionModule.cpp b/src/PJSipSessionModule.cpp
index 99e0cbe..8e4e5f2 100644
--- a/src/PJSipSessionModule.cpp
+++ b/src/PJSipSessionModule.cpp
@@ -98,6 +98,8 @@ void PJSipDialogModInfo::updateDialogState(pjsip_dialog *dialog)
    //I'll just hardcode this as UDP until we start wanting to actually implement
    //other transports.
    mDialogState->mTransport = "UDP";
+   mDialogState->mUacHas2xx = dialog->uac_has_2xx == PJ_TRUE ? true : false;
+   mDialogState->mIsUac = (dialog->role == PJSIP_ROLE_UAC || dialog->role == PJSIP_UAC_ROLE) ? true : false;
    mNeedsReplication = true;
 }
 
@@ -474,6 +476,8 @@ static void handle_new_invite(pjsip_rx_data *rdata)
 	inv_session->mod_data[module->id] = (void *)session_mod_info;
 	dlg->mod_data[module->id] = (void *)dlg_mod_info;
 
+	std::cerr << "[DEBUG] Replicating state on reception of new SIP INVITE." << std::endl;
+	replicateState(dlg_mod_info, tsx_mod_info, session_mod_info);
 	AsteriskSCF::SessionCommunications::V1::SessionRouterPrx router = dataModel.getSessionRouter();
 	try
 	{
@@ -493,9 +497,6 @@ static void handle_new_invite(pjsip_rx_data *rdata)
 		pjsip_inv_send_msg(inv_session, tdata);
 	   return;
 	}
-	// All the actual call routing is taken care of, so let's tell the state replicator
-	// what all we learned.
-	replicateState(dlg_mod_info, tsx_mod_info, session_mod_info);
 }
 
 static pj_bool_t sessionOnReceiveRequest(pjsip_rx_data *rdata)
@@ -624,6 +625,7 @@ static void invOnStateChanged(pjsip_inv_session *inv, pjsip_event *event)
 	  pjsip_dialog *dlg = inv->dlg;
 	  PJSipDialogModInfo *dlg_mod_info = (PJSipDialogModInfo*) dlg->mod_data[SipChannelServiceDataModel::getInstance().getPJSipManager()->getSessionModule()->id];
 	  dlg_mod_info->mNeedsRemoval = true;
+	  std::cerr << "Replicating state on DISCONNECTED inv_state." << std::endl;
 	  replicateState(dlg_mod_info, NULL, session_mod_info);
       delete session_mod_info;
 	  delete dlg_mod_info;
@@ -655,6 +657,7 @@ static void invOnStateChanged(pjsip_inv_session *inv, pjsip_event *event)
 	  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;
+	  std::cerr << "Replicating state on new outbound INVITE." << std::endl;
 	  replicateState(dlg_mod_info, tsx_mod_info, session_mod_info);
    }
 }
@@ -715,10 +718,12 @@ static void invOnTransactionStateChanged(pjsip_inv_session *inv, pjsip_transacti
 		{
 			session_mod_info->updateSessionState(inv);
 		}
+		std::cerr << "[DEBUG] Replicating state on transaction state change" << std::endl;
 		replicateState(dlg_mod_info, tsx_mod_info, session_mod_info);
 	}
 	else if (e->type == PJSIP_EVENT_TIMER)
 	{
+		std::cerr << "[DEBUG] Replicating state on transaction state change" << std::endl;
 		replicateState(NULL, tsx_mod_info, NULL);
 	}
 }

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


-- 
asterisk-scf/integration/sip.git



More information about the asterisk-scf-commits mailing list