[asterisk-commits] mmichelson: branch group/pimp_my_sip r379962 - /team/group/pimp_my_sip/res/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jan 22 17:48:15 CST 2013


Author: mmichelson
Date: Tue Jan 22 17:48:12 2013
New Revision: 379962

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=379962
Log:
Get method of incoming response so we can limit which supplements are called.

I still have not figured out a good way to get the method of an outbound response
though, so it remains unchanged. Likely, I will need to modify the handle_outgoing
and handle_outgoing_response to take a transaction as an argument so that the method
can be retrieved.


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=379962&r1=379961&r2=379962
==============================================================================
--- team/group/pimp_my_sip/res/res_sip_session.c (original)
+++ team/group/pimp_my_sip/res/res_sip_session.c Tue Jan 22 17:48:12 2013
@@ -750,18 +750,16 @@
 {
 	struct ast_sip_session_supplement *supplement;
 	struct pjsip_status_line status = rdata->msg_info.msg->line.status;
-	char method[16];
-	pj_str_t *pj_method = &rdata->msg_info.cseq->method.name;
-
-	/* TODO: Is using the method from the CSeq good enough? */
-	ast_copy_pj_str(method, pj_method, sizeof(method));
+	char method[15];
+	pjsip_transaction *tsx = pjsip_rdata_get_tsx(rdata);
+	ast_copy_pj_str(method, &tsx->method.name, sizeof(method));
 
 	ast_debug(3, "Response is %d %.*s\n", status.code, (int) pj_strlen(&status.reason),
 			pj_strbuf(&status.reason));
 
 	AST_LIST_TRAVERSE(&session->supplements, supplement, next) {
 		if (supplement->incoming_response && (
-			    !supplement->method || !strcmp(supplement->method, method))) {
+				!supplement->method || !strcmp(supplement->method, method))) {
 			supplement->incoming_response(session, rdata);
 		}
 	}




More information about the asterisk-commits mailing list