[Asterisk-code-review] res_pjsip: Channel variable SIPFROMDOMAIN (...asterisk[master])

Sean Bright asteriskteam at digium.com
Wed Jul 31 15:33:00 CDT 2019


Sean Bright has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/11651 )

Change subject: res_pjsip: Channel variable SIPFROMDOMAIN
......................................................................


Patch Set 1: Code-Review-1

(1 comment)

I'm not a huge fan of using "magic variables" to change behavior in new code. Our goal with chan_pjsip is feature parity with chan_sip, not necessarily compatibility. If we _were_ to allow a channel variable to influence behavior, we should at least make it a variable name that we can live with long term, like PJSIP_FROM_DOMAIN.

I'm not that passionate about it, so I won't prevent the inclusion. Just some food for thought.

https://gerrit.asterisk.org/#/c/11651/1/res/res_pjsip_session.c 
File res/res_pjsip_session.c:

https://gerrit.asterisk.org/#/c/11651/1/res/res_pjsip_session.c@1506 
PS1, Line 1506: sipfromdomain = pbx_builtin_getvar_helper(session->channel, "SIPFROMDOMAIN");
You need to hold the channel lock until after the call to pj_strdup2. See the pbx_builtin_getvar_helper() documentation in include/asterisk/pbx.h for an explanation and code sample. You might consider doing some of this work within the lock above (line 1469), rather than acquiring the lock a second time.



-- 
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-Reviewer: Friendly Automation
Gerrit-Reviewer: Sean Bright <sean.bright at gmail.com>
Gerrit-Comment-Date: Wed, 31 Jul 2019 20:33:00 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190731/6c278424/attachment.html>


More information about the asterisk-code-review mailing list