[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
Fri Sep 17 17:01:03 CDT 2010


branch "master" has been updated
       via  7c246ecf103d050bd710dd53e0adfcb47cf92793 (commit)
      from  bfaedd83bd0142fdb5a3175249b278b8379ba8c0 (commit)

Summary of changes:
 src/PJSipSessionModule.cpp |   77 +++++++-------------------------------------
 1 files changed, 12 insertions(+), 65 deletions(-)


- Log -----------------------------------------------------------------
commit 7c246ecf103d050bd710dd53e0adfcb47cf92793
Author: Mark Michelson <mmichelson at digium.com>
Date:   Fri Sep 17 16:48:11 2010 -0500

    Remove another function that won't be called ever.

diff --git a/src/PJSipSessionModule.cpp b/src/PJSipSessionModule.cpp
index 3760f61..afa8cee 100644
--- a/src/PJSipSessionModule.cpp
+++ b/src/PJSipSessionModule.cpp
@@ -430,7 +430,6 @@ static pj_bool_t sessionOnReceiveRequest(pjsip_rx_data *rdata)
 	switch (rdata->msg_info.msg->line.req.method.id)
 	{
 	case PJSIP_INVITE_METHOD:
-	{
 		if (dlg == NULL)
 		{
 			handle_new_invite(rdata);
@@ -440,12 +439,9 @@ static pj_bool_t sessionOnReceiveRequest(pjsip_rx_data *rdata)
 			std::cerr << "[WARNING] on_rx_request called back in mid-dialog?" << std::endl;
 		}
 		break;
-	}
 	default:
-	{
 		return PJ_FALSE;
 	}
-	}
 
 	return PJ_TRUE;
 }
@@ -510,62 +506,6 @@ static void handle_invite_response(pjsip_inv_session *inv, pjsip_rx_data *rdata,
 	}
 }
 
-static pj_bool_t sessionOnReceiveResponse(pjsip_rx_data *rdata)
-{
-	//stub
-	pjsip_dialog *dlg = pjsip_rdata_get_dlg(rdata);
-	if (dlg == NULL)
-	{
-		//Out of dialog response? Ouch!
-	}
-	//Message is in dialog. So now let's find out what
-	//method we're dealing with here so we'll know how to 
-	//handle the message.
-	switch (rdata->msg_info.msg->line.req.method.id)
-	{
-	case PJSIP_INVITE_METHOD:
-	{
-		break;
-	}
-	case PJSIP_BYE_METHOD:
-	{
-		//Giving it some thought, it seems like we really don't
-		//care what the response is here. The only response that
-		//actually warrants action is a 401/407, and that's taken
-		//care of for us.
-		break;
-	}
-	case PJSIP_CANCEL_METHOD:
-	{
-		//Same as BYE, afaik.
-		break;
-	}
-	default:
-	{
-		//Like with the request reception function, we'll need
-		//to handle INFO and REFER in the future.
-		break;
-	}
-	}
-	return PJ_TRUE;
-}
-
-static pj_status_t sessionOnTransmitRequest(pjsip_tx_data *data)
-{
-	return PJ_SUCCESS;
-}
-
-static pj_status_t sessionOnTransmitResponse(pjsip_tx_data *data)
-{
-	//stub
-	return PJ_SUCCESS;
-}
-
-static void sessionOnTransactionStateChange(pjsip_transaction *tsx, pjsip_event *event)
-{
-	
-}
-
 static void invOnStateChanged(pjsip_inv_session *inv, pjsip_event *event)
 {
    if (inv->state == PJSIP_INV_STATE_EARLY || inv->state == PJSIP_INV_STATE_CONNECTING &&
@@ -634,7 +574,14 @@ static void invOnTransactionStateChanged(pjsip_inv_session *inv, pjsip_transacti
 	
 	pjsip_module *module = pjsip_ua_instance();
 	PJSipTransactionModInfo *tsx_mod_info = static_cast<PJSipTransactionModInfo *> (tsx->mod_data[module->id]);
-	tsx_mod_info->updateTransactionState(tsx);
+	if (tsx->state != PJSIP_TSX_STATE_DESTROYED)
+	{
+		tsx_mod_info->updateTransactionState(tsx);
+	}
+	else
+	{
+		tsx_mod_info->mNeedsRemoval = true;
+	}
 	if (e->type == PJSIP_EVENT_TX_MSG)
 	{
 		pjsip_dialog *dlg = pjsip_tsx_get_dlg(tsx);
@@ -792,10 +739,10 @@ PJSipSessionModule::PJSipSessionModule() : mName("Session Module")
 	mModule.stop = sessionStop;
 	mModule.unload = sessionUnload;
 	mModule.on_rx_request = sessionOnReceiveRequest;
-	mModule.on_rx_response = sessionOnReceiveResponse;
-	mModule.on_tx_request = sessionOnTransmitRequest;
-	mModule.on_tx_response = sessionOnTransmitResponse;
-	mModule.on_tsx_state = sessionOnTransactionStateChange;
+	mModule.on_rx_response = NULL;
+	mModule.on_tx_request = NULL;
+	mModule.on_tx_response = NULL;
+	mModule.on_tsx_state = NULL;
 
 	if (pjsip_ua_instance()->id == -1)
 	{

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


-- 
asterisk-scf/integration/sip.git



More information about the asterisk-scf-commits mailing list