[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
Sun Sep 26 16:45:35 CDT 2010


branch "master" has been updated
       via  fbc440a50481867ea9be9661fc6171feff128704 (commit)
       via  d25dedef4444d3d354b763d806e6a386267758cd (commit)
       via  39f1177c502a1bc73f3c87ed3faed47df6e4d5c2 (commit)
       via  a5156eeecc316af9013f96db5bccb4037616cb46 (commit)
       via  f0fbfdb5cc421b27a73dba3a0b481a06efb54a1c (commit)
       via  6e1db94edb8e49afd9945d9a8f11fe19e6afaa60 (commit)
       via  f7a2375467eb012f76d4e8f8dcb59e84d7d7a5ac (commit)
       via  1cb00be05521dad74c58ef5e9b4ab34635076c8f (commit)
      from  e5d12167a35edbe36d6e4ba1a3d13e1759d8e75a (commit)

Summary of changes:
 src/PJSipSessionModule.cpp |   45 ++++++++++++++++++++++++++++---------------
 1 files changed, 29 insertions(+), 16 deletions(-)


- Log -----------------------------------------------------------------
commit fbc440a50481867ea9be9661fc6171feff128704
Author: Joshua Colp <jcolp at digium.com>
Date:   Sun Sep 26 18:48:45 2010 -0300

    Fix last crash due to transaction mod info not being present.

diff --git a/src/PJSipSessionModule.cpp b/src/PJSipSessionModule.cpp
index d5f2002..28b76e5 100644
--- a/src/PJSipSessionModule.cpp
+++ b/src/PJSipSessionModule.cpp
@@ -631,6 +631,11 @@ static void invOnTransactionStateChanged(pjsip_inv_session *inv, pjsip_transacti
 
    pjsip_module *module = SipChannelServiceDataModel::getInstance().getPJSipManager()->getSessionModule();
 	PJSipTransactionModInfo *tsx_mod_info = static_cast<PJSipTransactionModInfo *> (tsx->mod_data[module->id]);
+	// TODO: Determine if this is perfectly acceptable, since it occurs when the call is going bye bye
+	if (!tsx_mod_info)
+	{
+	   return;
+	}
 	if (tsx->state != PJSIP_TSX_STATE_DESTROYED)
 	{
 		tsx_mod_info->updateTransactionState(tsx);

commit d25dedef4444d3d354b763d806e6a386267758cd
Author: Joshua Colp <jcolp at digium.com>
Date:   Sun Sep 26 18:44:49 2010 -0300

    Don't assume an invite transaction will be present since, apparently, it won't be.

diff --git a/src/PJSipSessionModule.cpp b/src/PJSipSessionModule.cpp
index 7abff9a..d5f2002 100644
--- a/src/PJSipSessionModule.cpp
+++ b/src/PJSipSessionModule.cpp
@@ -584,7 +584,7 @@ static void invOnStateChanged(pjsip_inv_session *inv, pjsip_event *event)
 	  //See comment in invOnTransactionStateChanged() for explanation of this.
 
 	  //Compare branches to see if this got handled by the transaction layer.
-	  if (pj_strcmp(&event->body.rx_msg.rdata->msg_info.via->branch_param, &inv->invite_tsx->branch) != 0)
+	  if (inv->invite_tsx && pj_strcmp(&event->body.rx_msg.rdata->msg_info.via->branch_param, &inv->invite_tsx->branch) != 0)
 	  {
 	     //Mismatched branch!
 		 invOnTransactionStateChanged(inv, inv->invite_tsx, event);

commit 39f1177c502a1bc73f3c87ed3faed47df6e4d5c2
Author: Joshua Colp <jcolp at digium.com>
Date:   Sun Sep 26 18:31:44 2010 -0300

    Only deal with responses that come in on an outgoing leg.

diff --git a/src/PJSipSessionModule.cpp b/src/PJSipSessionModule.cpp
index 4eb8a95..7abff9a 100644
--- a/src/PJSipSessionModule.cpp
+++ b/src/PJSipSessionModule.cpp
@@ -533,7 +533,8 @@ static void invOnTransactionStateChanged(pjsip_inv_session *inv, pjsip_transacti
 static void invOnStateChanged(pjsip_inv_session *inv, pjsip_event *event)
 {
    if ((inv->state == PJSIP_INV_STATE_EARLY || inv->state == PJSIP_INV_STATE_CONNECTING) &&
-         event->type == PJSIP_EVENT_TSX_STATE)
+       event->type == PJSIP_EVENT_TSX_STATE &&
+      inv->role == PJSIP_ROLE_UAC)
    {
       //Received a 1XX or 2XX message in response to our initial outgoing INVITE.
 	  handle_invite_response(inv, event->body.tsx_state.src.rdata, inv->dlg);

commit a5156eeecc316af9013f96db5bccb4037616cb46
Author: Joshua Colp <jcolp at digium.com>
Date:   Sun Sep 26 18:29:32 2010 -0300

    Bring the various modinfo classes into existence on the outgoing leg.

diff --git a/src/PJSipSessionModule.cpp b/src/PJSipSessionModule.cpp
index deeab45..4eb8a95 100644
--- a/src/PJSipSessionModule.cpp
+++ b/src/PJSipSessionModule.cpp
@@ -589,7 +589,7 @@ static void invOnStateChanged(pjsip_inv_session *inv, pjsip_event *event)
 		 invOnTransactionStateChanged(inv, inv->invite_tsx, event);
 	  }
    }
-   if (event->type == PJSIP_EVENT_TX_MSG && inv->state == PJSIP_INV_STATE_CALLING)
+   if (event->type == PJSIP_EVENT_TSX_STATE && inv->state == PJSIP_INV_STATE_CALLING && inv->role == PJSIP_ROLE_UAC)
    {
       //We have sent an INVITE out. We need to set up the transaction and dialog structures
 	  //to have the appropriate mod_data and initiate some state replication here as well.

commit f0fbfdb5cc421b27a73dba3a0b481a06efb54a1c
Author: Joshua Colp <jcolp at digium.com>
Date:   Sun Sep 26 18:21:41 2010 -0300

    Move creation of the transaction state class to earlier in handle_new_invite since the act of sending a 100 Trying will cause it to be updated.

diff --git a/src/PJSipSessionModule.cpp b/src/PJSipSessionModule.cpp
index 3ab75da..deeab45 100644
--- a/src/PJSipSessionModule.cpp
+++ b/src/PJSipSessionModule.cpp
@@ -352,6 +352,10 @@ static void handle_new_invite(pjsip_rx_data *rdata)
 
 	PJSipDialogModInfo *dlg_mod_info = new PJSipDialogModInfo(dlg);
 
+	pjsip_transaction *tsx = pjsip_rdata_get_tsx(rdata);
+	PJSipTransactionModInfo *tsx_mod_info = new PJSipTransactionModInfo(tsx);
+	tsx->mod_data[module->id] = (void *)tsx_mod_info;
+
 	//XXX The sdp argument is NULL for now, but can be changed if we
 	//know what has been configured for this particular caller.
 	pjsip_inv_session *inv_session;
@@ -439,9 +443,6 @@ static void handle_new_invite(pjsip_rx_data *rdata)
 	}
 	// All the actual call routing is taken care of, so let's tell the state replicator
 	// what all we learned.
-	pjsip_transaction *tsx = pjsip_rdata_get_tsx(rdata);
-	PJSipTransactionModInfo *tsx_mod_info = new PJSipTransactionModInfo(tsx);
-	tsx->mod_data[module->id] = (void *)tsx_mod_info;
 	replicateState(dlg_mod_info, tsx_mod_info, session_mod_info);
 }
 

commit 6e1db94edb8e49afd9945d9a8f11fe19e6afaa60
Author: Joshua Colp <jcolp at digium.com>
Date:   Sun Sep 26 18:17:49 2010 -0300

    Whoops, use the correct member variable.

diff --git a/src/PJSipSessionModule.cpp b/src/PJSipSessionModule.cpp
index c50f57e..3ab75da 100644
--- a/src/PJSipSessionModule.cpp
+++ b/src/PJSipSessionModule.cpp
@@ -157,7 +157,7 @@ TransactionState PJSipTransactionModInfo::transactionStateTranslate(pjsip_tsx_st
    return retState;
 }
 
-PJSipSessionModInfo::PJSipSessionModInfo(pjsip_inv_session *inv_session) : mSessionState(new SipSessionStateItem), mInviteSessionState(new SipInviteSessionStateItem), mNeedsReplication(true)
+PJSipSessionModInfo::PJSipSessionModInfo(pjsip_inv_session *inv_session) : mSessionState(new SipSessionStateItem), mInviteState(new SipInviteSessionStateItem), mNeedsReplication(true)
 {
    mSessionState->key = IceUtil::generateUUID();
    updateSessionState(inv_session);

commit f7a2375467eb012f76d4e8f8dcb59e84d7d7a5ac
Author: Joshua Colp <jcolp at digium.com>
Date:   Sun Sep 26 18:11:08 2010 -0300

    Actually make an invite session state item appear out of thin air.

diff --git a/src/PJSipSessionModule.cpp b/src/PJSipSessionModule.cpp
index a109a3e..c50f57e 100644
--- a/src/PJSipSessionModule.cpp
+++ b/src/PJSipSessionModule.cpp
@@ -157,7 +157,7 @@ TransactionState PJSipTransactionModInfo::transactionStateTranslate(pjsip_tsx_st
    return retState;
 }
 
-PJSipSessionModInfo::PJSipSessionModInfo(pjsip_inv_session *inv_session) : mSessionState(new SipSessionStateItem), mNeedsReplication(true)
+PJSipSessionModInfo::PJSipSessionModInfo(pjsip_inv_session *inv_session) : mSessionState(new SipSessionStateItem), mInviteSessionState(new SipInviteSessionStateItem), mNeedsReplication(true)
 {
    mSessionState->key = IceUtil::generateUUID();
    updateSessionState(inv_session);

commit 1cb00be05521dad74c58ef5e9b4ab34635076c8f
Author: Joshua Colp <jcolp at digium.com>
Date:   Sun Sep 26 18:10:22 2010 -0300

    Fix an assumption that mSession is always set. This is not true when the class is initially instantiated.

diff --git a/src/PJSipSessionModule.cpp b/src/PJSipSessionModule.cpp
index fcf9581..a109a3e 100644
--- a/src/PJSipSessionModule.cpp
+++ b/src/PJSipSessionModule.cpp
@@ -165,19 +165,25 @@ PJSipSessionModInfo::PJSipSessionModInfo(pjsip_inv_session *inv_session) : mSess
 
 PJSipSessionModInfo::~PJSipSessionModInfo()
 {
-   mSession->destroy();
-   mSession = 0;
+   if (mSession)
+   {
+      mSession->destroy();
+      mSession = 0;
+   }
 }
 
 void PJSipSessionModInfo::updateSessionState(pjsip_inv_session *inv_session)
 {
-   mSessionState->mSources = mSession->getSources();
-   mSessionState->mSinks = mSession->getSinks();
-   //getMediaSession requires an Ice::Current reference. Since
-   //it's not actually used, we can get away with passing a dummy
-   //instead.
-   Ice::Current dummy;
-   mSessionState->mMediaSession = mSession->getMediaSession(dummy);
+   if (mSession)
+   {
+      mSessionState->mSources = mSession->getSources();
+      mSessionState->mSinks = mSession->getSinks();
+      //getMediaSession requires an Ice::Current reference. Since
+      //it's not actually used, we can get away with passing a dummy
+      //instead.
+      Ice::Current dummy;
+      mSessionState->mMediaSession = mSession->getMediaSession(dummy);
+   }
 
    //Now we get stuff from the inv_session itself.
    mInviteState->mCancelling = inv_session->cancelling == PJ_TRUE ? true : false;

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


-- 
asterisk-scf/integration/sip.git



More information about the asterisk-scf-commits mailing list