[svn-commits] file: trunk r410307 - in /trunk: ./ res/ res/res_pjsip/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Mar 10 07:53:10 CDT 2014


Author: file
Date: Mon Mar 10 07:53:00 2014
New Revision: 410307

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=410307
Log:
res_pjsip: When handling 401/407 responses don't assume a request will have an endpoint.

This change removes the assumption that an outgoing request will always
have an endpoint and makes the authenticate_qualify option work once again.

(closes issue ASTERISK-23210)
Reported by: Joshua Colp
........

Merged revisions 410306 from http://svn.asterisk.org/svn/asterisk/branches/12

Modified:
    trunk/   (props changed)
    trunk/res/res_pjsip.c
    trunk/res/res_pjsip/pjsip_options.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-12-merged' - no diff available.

Modified: trunk/res/res_pjsip.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_pjsip.c?view=diff&rev=410307&r1=410306&r2=410307
==============================================================================
--- trunk/res/res_pjsip.c (original)
+++ trunk/res/res_pjsip.c Mon Mar 10 07:53:00 2014
@@ -1850,7 +1850,7 @@
 	}
 	AST_RWLIST_UNLOCK(&supplements);
 
-	if (tsx->status_code == 401 || tsx->status_code == 407) {
+	if ((tsx->status_code == 401 || tsx->status_code == 407) && req_data->endpoint) {
 		if (!ast_sip_create_request_with_auth(&req_data->endpoint->outbound_auths, challenge, tsx, &tdata)) {
 			pjsip_endpt_send_request(ast_sip_get_pjsip_endpoint(), tdata, -1, req_data->token, req_data->callback);
 		}

Modified: trunk/res/res_pjsip/pjsip_options.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_pjsip/pjsip_options.c?view=diff&rev=410307&r1=410306&r2=410307
==============================================================================
--- trunk/res/res_pjsip/pjsip_options.c (original)
+++ trunk/res/res_pjsip/pjsip_options.c Mon Mar 10 07:53:00 2014
@@ -226,7 +226,7 @@
 	RAII_VAR(struct ast_sip_endpoint *, endpoint_local, ao2_bump(endpoint), ao2_cleanup);
 
 
-	if (!endpoint_local) {
+	if (!endpoint_local && contact->authenticate_qualify) {
 		struct ao2_iterator *endpoint_iterator = find_endpoints(contact);
 
 		/* try to find endpoints that are associated with the contact */
@@ -256,7 +256,7 @@
 	init_start_time(contact);
 
 	ao2_ref(contact, +1);
-	if (ast_sip_send_request(tdata, NULL, endpoint_local, contact,
+	if (ast_sip_send_request(tdata, NULL, contact->authenticate_qualify ? endpoint_local : NULL, contact,
 		qualify_contact_cb) != PJ_SUCCESS) {
 		/* The callback will be called so we don't need to drop the contact ref*/
 		ast_log(LOG_ERROR, "Unable to send request to qualify contact %s\n",




More information about the svn-commits mailing list