[asterisk-commits] file: branch 12 r403271 - /branches/12/res/res_pjsip_session.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Dec 1 15:12:39 CST 2013


Author: file
Date: Sun Dec  1 15:12:37 2013
New Revision: 403271

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=403271
Log:
res_pjsip_session: Apply fromuser and fromdomain to all requests as documented.

Modified:
    branches/12/res/res_pjsip_session.c

Modified: branches/12/res/res_pjsip_session.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/res/res_pjsip_session.c?view=diff&rev=403271&r1=403270&r2=403271
==============================================================================
--- branches/12/res/res_pjsip_session.c (original)
+++ branches/12/res/res_pjsip_session.c Sun Dec  1 15:12:37 2013
@@ -935,6 +935,19 @@
 
 	ast_sip_mod_data_set(tdata->pool, tdata->mod_data, session_module.id,
 			     MOD_DATA_ON_RESPONSE, on_response);
+
+	if (!ast_strlen_zero(session->endpoint->fromuser) ||
+		!ast_strlen_zero(session->endpoint->fromdomain)) {
+		pjsip_fromto_hdr *from = pjsip_msg_find_hdr(tdata->msg, PJSIP_H_FROM, tdata->msg->hdr.next);
+		pjsip_sip_uri *uri = pjsip_uri_get_uri(from->uri);
+
+		if (!ast_strlen_zero(session->endpoint->fromuser)) {
+			pj_strdup2(tdata->pool, &uri->user, session->endpoint->fromuser);
+		}
+		if (!ast_strlen_zero(session->endpoint->fromdomain)) {
+			pj_strdup2(tdata->pool, &uri->host, session->endpoint->fromdomain);
+		}
+	}
 
 	handle_outgoing_request(session, tdata);
 	pjsip_inv_send_msg(session->inv_session, tdata);




More information about the asterisk-commits mailing list