<blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><p style="white-space: pre-wrap; word-wrap: break-word;">You can use the pjsip endpoint callerid_tag option string to<br>indicate which tenant the<br>endpoint represents.  The interception routine can compare the<br>channel's callerid tag<br>with the updated connected line's tag.  (You could compare the<br>connected line tag with<br>a parameter set on the interception routine's arguments instead<br>of<br>the callerid tag.)<br>If they match you know it is one tenant member talking with<br>another.  If they don't<br>match then you can use the fixed "public" identity of the<br>connected<br>line tenant.</p></blockquote><p style="white-space: pre-wrap; word-wrap: break-word;">The callerid_tag... it's an interesting thing.<br>If I'm correct there is only one way to get the channel caller id<br>tag<br>inside the interception route using<br>${PJSIP_ENDPOINT(${CHANNEL(endpoint)},callerid_tag)}</p><p style="white-space: pre-wrap; word-wrap: break-word;">What do you think if the callerid_tag can be retrieved by the<br>CHANNEL function<br>directly using ast_sip_session.id.tag<br>like<br>${CHANNEL(pjsip,callerid_tag)}) or ${CHANNEL(callerid_tag)})</p><p style="white-space: pre-wrap; word-wrap: break-word;">If you agree I can do a new patch which will add this to<br>channels/pjsip/dialplan_functions.c</p></blockquote><p style="white-space: pre-wrap; word-wrap: break-word;">There is no need for a patch.  The endpoint's configured<br>callerid_tag string is set in the channel's CALLERID(tag) whenever<br>a PJSIP channel is created.  Other channel drivers should do<br>the same for their equivalent callerid tag setting.  That means<br>you can get the tag string using CALLERID(tag) when the channel<br>comes into asterisk.  And for the outgoing channel, you can get<br>the tag using CALLERID(tag) in the predial handler.</p><p style="white-space: pre-wrap; word-wrap: break-word;">Unless you set the CALLERID(tag) in your dialplan to something else,<br>that string should stay there.</p><p><a href="https://gerrit.asterisk.org/10286">View Change</a></p><ul style="list-style: none; padding: 0;"></ul><p>To view, visit <a href="https://gerrit.asterisk.org/10286">change 10286</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/10286"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-MessageType: comment </div>
<div style="display:none"> Gerrit-Change-Id: I6ce9e151a2220ce9e95aa66666933cfb9e2a4a01 </div>
<div style="display:none"> Gerrit-Change-Number: 10286 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: Alexei Gradinari <alex2grad@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: Alexei Gradinari <alex2grad@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 (1000185) </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Thu, 04 Oct 2018 23:00:13 +0000 </div>
<div style="display:none"> Gerrit-HasComments: No </div>
<div style="display:none"> Gerrit-HasLabels: No </div>