Re: Patch: don't teminate the session when it doesn't have proper credentials

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It seems that the patch didn't apply. Enclosed is an updated version.
--yas

On 20/09/16 22:34, Yaacov Akiba Slama wrote:

Hello,

When a 401/407 challenge is received after a "BYE" request is sent, sometimes (for instance in asterisk) the library doesn't have the required credentials.

So it's not appropriate to terminate the session.

Without the enclosed patch, asterisk cannot answer to the challenge request because the session is already terminated (PJSIP_INV_STATE_DISCONNECTED) and the sip trunk doesn't hangup when needed (see https://issues.asterisk.org/jira/browse/ASTERISK-26363).

Regards,

--yas



_______________________________________________
Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@xxxxxxxxxxxxxxx
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org


diff --git a/pjsip/src/pjsip-ua/sip_inv.c b/pjsip/src/pjsip-ua/sip_inv.c
index fbc8ebe..f278aff 100644
--- a/pjsip/src/pjsip-ua/sip_inv.c
+++ b/pjsip/src/pjsip-ua/sip_inv.c
@@ -3384,10 +3384,13 @@ static void inv_handle_bye_response( pjsip_inv_session *inv,
 	if (status != PJ_SUCCESS) {
 	    
 	    /* Does not have proper credentials. 
-	     * End the session anyway.
+	     * It's not a good idea to terminate the session since it can be
+	     * authenticated later.
 	     */
+	    /*
 	    inv_set_cause(inv, PJSIP_SC_OK, NULL);
 	    inv_set_state(inv, PJSIP_INV_STATE_DISCONNECTED, e);
+	     */
 	    
 	} else {
 	    struct tsx_inv_data *tsx_inv_data;
_______________________________________________
Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@xxxxxxxxxxxxxxx
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux