[Asterisk-code-review] res/res_pjsip_messaging.c: Fix: unstable domain filed in To header (asterisk[18])

Yang Chen asteriskteam at digium.com
Fri Apr 23 02:43:57 CDT 2021


Hello Sean Bright, Friendly Automation, 

I'd like you to reexamine a change. Please visit

    https://gerrit.asterisk.org/c/asterisk/+/15727

to look at the new patch set (#2).

Change subject: res/res_pjsip_messaging.c: Fix: unstable domain filed in To header
......................................................................

res/res_pjsip_messaging.c: Fix: unstable domain filed in To header

This issue happens when client IP address changed like from wifi to 4G.
The domain filed in To header should be a fix string, this patch provide
a method of rewriting to a predefined domian string.

Usage: append ';x-to_domain=mydomain.com' to the end of full uri
which usually retrieved from ${PJSIP_DIAL_CONTACTS(${EXTEN})}
e.g.:
same => n,Set(ToContacts=${PJSIP_DIAL_CONTACTS(${EXTEN})})
same => n,While($["${SET(ToContact=${SHIFT(ToContacts,&):6})}" != ""])
same => n,Set(TOURI=pjsip:${ToContact}\;x-to_domain=mydomain.com)
same => n,MessageSend(${TOURI},${MESSAGE(from)})

ASTERISK-28928
ASTERISK-28513
Reported-by: Yang Chen <yang.chen at linuxe.org>
Reported-by: Brian J. Murrell <brian at interlinx.bc.ca>

Change-Id: Ib164d5274ffe73db15811d4decfc50e6eddcf80c
Signed-off-by: Yang Chen <yang.chen at linuxe.org>
---
M res/res_pjsip_messaging.c
1 file changed, 24 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/27/15727/2
-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/15727
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 18
Gerrit-Change-Id: Ib164d5274ffe73db15811d4decfc50e6eddcf80c
Gerrit-Change-Number: 15727
Gerrit-PatchSet: 2
Gerrit-Owner: Yang Chen <yang.chen at linuxe.org>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Sean Bright <sean at seanbright.com>
Gerrit-CC: Joshua Colp <jcolp at sangoma.com>
Gerrit-MessageType: newpatchset
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210423/d7d405b9/attachment.html>


More information about the asterisk-code-review mailing list