[asterisk-commits] kmoore: branch kmoore/pjsip_path_support r403362 - /team/kmoore/pjsip_path_su...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Dec 4 14:06:57 CST 2013


Author: kmoore
Date: Wed Dec  4 14:06:55 2013
New Revision: 403362

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=403362
Log:
Propagate NULL correctly, match on the correct method, and move documentation

Modified:
    team/kmoore/pjsip_path_support/res/res_pjsip.c
    team/kmoore/pjsip_path_support/res/res_pjsip_registrar.c

Modified: team/kmoore/pjsip_path_support/res/res_pjsip.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/pjsip_path_support/res/res_pjsip.c?view=diff&rev=403362&r1=403361&r2=403362
==============================================================================
--- team/kmoore/pjsip_path_support/res/res_pjsip.c (original)
+++ team/kmoore/pjsip_path_support/res/res_pjsip.c Wed Dec  4 14:06:55 2013
@@ -665,15 +665,6 @@
 						set to <literal>sdes</literal> or <literal>dtls</literal>.
 					</para></description>
 				</configOption>
-				<configOption name="support_path">
-					<synopsis>Enables Path support for REGISTER requests and Route support for other requests.</synopsis>
-					<description><para>
-						When this option is enabled, the Path header in register requests will be saved
-						and its contents will be used in Route headers for outbound out-of-dialog requests
-						and in Path headers for outbound 200 responses. Path support will also be indicated
-						in the Supported header.
-					</para></description>
-				</configOption>
 			</configObject>
 			<configObject name="auth">
 				<synopsis>Authentication type</synopsis>
@@ -971,6 +962,15 @@
 					<description><para>
 						If true and a qualify request receives a challenge or authenticate response
 						authentication is attempted before declaring the contact available.
+					</para></description>
+				</configOption>
+				<configOption name="support_path">
+					<synopsis>Enables Path support for REGISTER requests and Route support for other requests.</synopsis>
+					<description><para>
+						When this option is enabled, the Path header in register requests will be saved
+						and its contents will be used in Route headers for outbound out-of-dialog requests
+						and in Path headers for outbound 200 responses. Path support will also be indicated
+						in the Supported header.
 					</para></description>
 				</configOption>
 			</configObject>
@@ -2101,10 +2101,11 @@
 int ast_sip_send_response(pjsip_endpoint *endpt, pjsip_response_addr *res_addr, pjsip_tx_data *tdata, struct ast_sip_endpoint *sip_endpoint)
 {
 	struct ast_sip_supplement *supplement;
+	pjsip_cseq_hdr *cseq = pjsip_msg_find_hdr(tdata->msg, PJSIP_H_CSEQ, NULL);
 
 	AST_RWLIST_RDLOCK(&supplements);
 	AST_LIST_TRAVERSE(&supplements, supplement, next) {
-		if (supplement->outgoing_response && does_method_match(&tdata->msg->line.req.method.name, supplement->method)) {
+		if (supplement->outgoing_response && does_method_match(&cseq->method.name, supplement->method)) {
 			supplement->outgoing_response(sip_endpoint, tdata);
 		}
 	}

Modified: team/kmoore/pjsip_path_support/res/res_pjsip_registrar.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/pjsip_path_support/res/res_pjsip_registrar.c?view=diff&rev=403362&r1=403361&r2=403362
==============================================================================
--- team/kmoore/pjsip_path_support/res/res_pjsip_registrar.c (original)
+++ team/kmoore/pjsip_path_support/res/res_pjsip_registrar.c Wed Dec  4 14:06:55 2013
@@ -460,7 +460,7 @@
 			}
 
 			ast_sip_location_add_contact(task_data->aor, contact_uri, ast_tvadd(ast_tvnow(),
-				ast_samp2tv(expiration, 1)), &path_hdr->hvalue);
+				ast_samp2tv(expiration, 1)), (path_hdr ? &path_hdr->hvalue : NULL));
 			ast_verb(3, "Added contact '%s' to AOR '%s' with expiration of %d seconds\n",
 				contact_uri, aor_name, expiration);
 			ast_test_suite_event_notify("AOR_CONTACT_ADDED",




More information about the asterisk-commits mailing list