[asterisk-commits] file: trunk r403272 - in /trunk: ./ res/res_pjsip_session.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Sun Dec 1 15:13:22 CST 2013
Author: file
Date: Sun Dec 1 15:13:20 2013
New Revision: 403272
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=403272
Log:
res_pjsip_session: Apply fromuser and fromdomain to all requests as documented.
........
Merged revisions 403271 from http://svn.asterisk.org/svn/asterisk/branches/12
Modified:
trunk/ (props changed)
trunk/res/res_pjsip_session.c
Propchange: trunk/
------------------------------------------------------------------------------
--- branch-12-merged (original)
+++ branch-12-merged Sun Dec 1 15:13:20 2013
@@ -1,1 +1,1 @@
-/branches/12:1-398558,398560-398577,398579-399305,399307-401390,401392-403175,403179,403207,403209,403221,403223,403240,403256,403258
+/branches/12:1-398558,398560-398577,398579-399305,399307-401390,401392-403175,403179,403207,403209,403221,403223,403240,403256,403258,403271
Modified: trunk/res/res_pjsip_session.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_pjsip_session.c?view=diff&rev=403272&r1=403271&r2=403272
==============================================================================
--- trunk/res/res_pjsip_session.c (original)
+++ trunk/res/res_pjsip_session.c Sun Dec 1 15:13:20 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