[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
Thu Oct 7 18:36:01 CDT 2010


branch "master" has been updated
       via  50459f2ed91c10efb5aa802126981cfdeb4beff8 (commit)
      from  85373c17bc0f89441d4b76376d737c4bf6938f80 (commit)

Summary of changes:
 src/SipSession.cpp |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)


- Log -----------------------------------------------------------------
commit 50459f2ed91c10efb5aa802126981cfdeb4beff8
Author: Mark Michelson <mmichelson at digium.com>
Date:   Thu Oct 7 18:38:49 2010 -0500

    Clear up an edge case that could trigger an assertion in PJSIP.
    
    See the newly added comments in src/SipSession.cpp SipSession::stop()
    for more details. I'm not going to type it all out *again* sheesh.

diff --git a/src/SipSession.cpp b/src/SipSession.cpp
index d102a13..2fe61d5 100644
--- a/src/SipSession.cpp
+++ b/src/SipSession.cpp
@@ -406,7 +406,11 @@ void SipSession::stop(const AsteriskSCF::SessionCommunications::V1::ResponseCode
       code = 486;
    }
 
-   if ((pjsip_inv_end_session(mImplPriv->mInviteSession, code, NULL, &packet)) == PJ_SUCCESS)
+   // We have to check the existence of packet due to an edge case that we can trigger here.
+   // On an outbound call, if we have not received a provisional response yet, then PJSIP will
+   // set packet NULL but still return PJ_SUCCESS. In this case, if we attempt to call pjsip_inv_send_msg,
+   // then we will trigger an assertion since the packet we pass in is NULL.
+   if ((pjsip_inv_end_session(mImplPriv->mInviteSession, code, NULL, &packet)) == PJ_SUCCESS && packet)
    {
       pjsip_inv_send_msg(mImplPriv->mInviteSession, packet);
    }

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


-- 
asterisk-scf/integration/sip.git



More information about the asterisk-scf-commits mailing list