[asterisk-commits] file: branch group/pimp_my_sip r389899 - /team/group/pimp_my_sip/res/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue May 28 13:07:22 CDT 2013


Author: file
Date: Tue May 28 13:07:19 2013
New Revision: 389899

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=389899
Log:
Add method filtering to outgoing response handling.

Modified:
    team/group/pimp_my_sip/res/res_sip_session.c

Modified: team/group/pimp_my_sip/res/res_sip_session.c
URL: http://svnview.digium.com/svn/asterisk/team/group/pimp_my_sip/res/res_sip_session.c?view=diff&rev=389899&r1=389898&r2=389899
==============================================================================
--- team/group/pimp_my_sip/res/res_sip_session.c (original)
+++ team/group/pimp_my_sip/res/res_sip_session.c Tue May 28 13:07:19 2013
@@ -1552,15 +1552,13 @@
 {
 	struct ast_sip_session_supplement *supplement;
 	struct pjsip_status_line status = tdata->msg->line.status;
-	ast_debug(3, "Response is %d %.*s\n", status.code, (int) pj_strlen(&status.reason),
-			pj_strbuf(&status.reason));
+	pjsip_cseq_hdr *cseq = pjsip_msg_find_hdr(tdata->msg, PJSIP_H_CSEQ, NULL);
+	ast_debug(3, "Method is %.*s, Response is %d %.*s\n", (int) pj_strlen(&cseq->method.name),
+		pj_strbuf(&cseq->method.name), status.code, (int) pj_strlen(&status.reason),
+		pj_strbuf(&status.reason));
 
 	AST_LIST_TRAVERSE(&session->supplements, supplement, next) {
-		/* XXX Not sure how to get the method from a response.
-		 * For now, just call supplements on all responses, no
-		 * matter the method. This is less than ideal
-		 */
-		if (supplement->outgoing_response) {
+		if (supplement->outgoing_response && does_method_match(&cseq->method.name, supplement->method)) {
 			supplement->outgoing_response(session, tdata);
 		}
 	}




More information about the asterisk-commits mailing list