<p> Attention is currently required from: Joshua Colp, Richard Mudgett. </p>
<p><a href="https://gerrit.asterisk.org/c/asterisk/+/18369">View Change</a></p><p>1 comment:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="null">File main/core_local.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/asterisk/+/18369/comment/de59998f_dc98f15b">Patch Set #3, Line 907:</a> <code style="font-family:monospace,monospace">  if ((opts = strrchr(parse, '/')) && really_local_options(opts)) {</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">That's certainly possible.</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Okay, so it seems the problem with this is that local_devicestate gets called without any options (as there shouldn't be any). However, it has a check to remove everything after the last slash, so even with strrchr, it will do something like this:</p><p style="white-space: pre-wrap; word-wrap: break-word;">[2022-04-26 19:40:01] NOTICE[25922]: core_local.c:319 local_devicestate: exten was PJSIP/ATAxGrandstream1@astrex-outgoing<br>[2022-04-26 19:40:01] NOTICE[25922]: core_local.c:324 local_devicestate: exten was PJSIP<br>[2022-04-26 19:40:01] WARNING[25922]: core_local.c:328 local_devicestate: Someone used Local/PJSIP/ATAxGrandstream1@astrex-outgoing somewhere without a @context. This is bad.</p><p style="white-space: pre-wrap; word-wrap: break-word;">The actual dialing part works all right with the dummy /z option at the end, but the devicestate function isn't getting that.</p><p style="white-space: pre-wrap; word-wrap: break-word;"><br>My main thought right now is that if there are options, it should appear after the '@'. However, there is also a check to see that there is an '@' in the first place. In other words, we can't rely on there being either an '/' or an '@' present, apparently.</p><p style="white-space: pre-wrap; word-wrap: break-word;">So to avoid doing anything hacky here, I'm thinking something like:</p><p style="white-space: pre-wrap; word-wrap: break-word;">IF an '@' is present, then check for options starting at the '@', to the end of the string. (Right now, the reverse is done, first check for '/', then '@')<br>Else, '@' is not present, so we're malformed anyways. So perhaps just do it the way we do now, since this is an edge case as it is already that means something has gone wrong.</p><p style="white-space: pre-wrap; word-wrap: break-word;">Any thoughts?</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/18369">change 18369</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/+/18369"/><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: I8e85bc14072e452d0537a801aba17779569d0360 </div>
<div style="display:none"> Gerrit-Change-Number: 18369 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: N A <mail@interlinked.x10host.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>
<div style="display:none"> Gerrit-Attention: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-Attention: Richard Mudgett <rmudgett@digium.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Tue, 26 Apr 2022 19:47:06 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: No </div>
<div style="display:none"> Comment-In-Reply-To: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Comment-In-Reply-To: N A <mail@interlinked.x10host.com> </div>
<div style="display:none"> Gerrit-MessageType: comment </div>