<p style="white-space: pre-wrap; word-wrap: break-word;">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.</p><p style="white-space: pre-wrap; word-wrap: break-word;">I'm not that passionate about it, so I won't prevent the inclusion. Just some food for thought.</p><p>Patch set 1:<span style="border-radius: 3px; display: inline-block; margin: 0 2px; padding: 4px;background-color: #ffd4d4; color: #000000;">Code-Review -1</span></p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/11651">View Change</a></p><p>1 comment:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.asterisk.org/#/c/11651/1/res/res_pjsip_session.c">File res/res_pjsip_session.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/11651/1/res/res_pjsip_session.c@1506">Patch Set #1, Line 1506:</a> <code style="font-family:monospace,monospace">sipfromdomain = pbx_builtin_getvar_helper(session->channel, "SIPFROMDOMAIN");</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">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.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/11651">change 11651</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/11651"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I715133e43172ce2a1e82093538dc39f9e99e5f2e </div>
<div style="display:none"> Gerrit-Change-Number: 11651 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Stas Kobzar <stas@modulis.ca> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: Sean Bright <sean.bright@gmail.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Wed, 31 Jul 2019 20:33:00 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: Yes </div>
<div style="display:none"> Gerrit-MessageType: comment </div>