[Asterisk-code-review] res_pjsip: Channel variable SIPFROMDOMAIN (...asterisk[master])
Stas Kobzar
asteriskteam at digium.com
Tue Jul 30 12:13:16 CDT 2019
Stas Kobzar has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/11651
Change subject: res_pjsip: Channel variable SIPFROMDOMAIN
......................................................................
res_pjsip: Channel variable SIPFROMDOMAIN
In chan_sip, there was variable SIPFROMDOMAIN that allows to set
>From header URI domain per channel. This patch introduces res_pjsip
variable SIPFROMDOMAIN for backward compatibility with chan_sip.
ASTERISK-28489
Change-Id: I715133e43172ce2a1e82093538dc39f9e99e5f2e
---
M res/res_pjsip_session.c
1 file changed, 7 insertions(+), 0 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/51/11651/1
diff --git a/res/res_pjsip_session.c b/res/res_pjsip_session.c
index 52db333..840015a 100644
--- a/res/res_pjsip_session.c
+++ b/res/res_pjsip_session.c
@@ -1458,6 +1458,7 @@
pjsip_sip_uri *dlg_info_uri;
pjsip_sip_uri *dlg_contact_uri;
int restricted;
+ const char *sipfromdomain;
if (!session->channel || session->saved_from_hdr) {
return;
@@ -1501,6 +1502,12 @@
pj_strdup2(dlg_pool, &dlg_info_uri->host, session->endpoint->fromdomain);
}
+ /* SIPFROMDOMAIN channel variable for back compatibility with chan_sip */
+ sipfromdomain = pbx_builtin_getvar_helper(session->channel, "SIPFROMDOMAIN");
+ if (!ast_strlen_zero(sipfromdomain)) {
+ ast_debug(3, "From header domain reset by channel variable SIPFROMDOMAIN (%s)\n", sipfromdomain);
+ pj_strdup2(dlg_pool, &dlg_info_uri->host, sipfromdomain);
+ }
/* We need to save off the non-anonymized From for RPID/PAI generation (for domain) */
session->saved_from_hdr = pjsip_hdr_clone(dlg_pool, dlg_info);
ast_sip_add_usereqphone(session->endpoint, dlg_pool, session->saved_from_hdr->uri);
--
To view, visit https://gerrit.asterisk.org/c/asterisk/+/11651
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: I715133e43172ce2a1e82093538dc39f9e99e5f2e
Gerrit-Change-Number: 11651
Gerrit-PatchSet: 1
Gerrit-Owner: Stas Kobzar <stas at modulis.ca>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190730/dc18fe54/attachment-0001.html>
More information about the asterisk-code-review
mailing list