<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 2, 2018 at 5:41 PM, Joshua Colp <span dir="ltr"><<a href="mailto:jcolp@digium.com" target="_blank">jcolp@digium.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">On Tue, Jan 2, 2018, at 7:14 PM, Richard Mudgett wrote:<br>
> The patch for <a href="https://issues.asterisk.org/jira/browse/ASTERISK-27206" rel="noreferrer" target="_blank">https://issues.asterisk.org/<wbr>jira/browse/ASTERISK-27206</a> which<br>
> is committed in 7385d1e017e562afe64431606e857e<wbr>704f86a16d causes a<br>
> configuration regression by requiring the endpoint and identifier method<br>
> to agree to match the endpoint. Doing so is redundant for methods that<br>
> explicitly specify which endpoints they match. The redundancy allows<br>
> configuration errors that cannot be caught when the configuration is<br>
> loaded.<br>
<br>
</span>Can you clarify what the precise regression you are referring to is? Even after reading this email I'm still unclear.<br></blockquote><div><br></div><div>The regression is the new requirement for the endpoint identify_by option to list ip in order for</div><div> the type=identify method to be accepted by the endpoint. This new requirement is unnecessary</div><div>as the type=identify section must specify an endpoint name to know which endpoint it recognizes.</div><div><br></div><div>More specifically, the change to res/res_pjsip_endpoint_identifier_ip.c:ip_identify() enforces this</div><div> new requirement.<br></div><div><br></div><div>I should have used the term complexity instead of redundancy.</div><div><br></div><div>The new requirement adds configuration complexity because the endpoint identify_by option and</div><div>the type=identify method must agree to match the endpoint. The added complexity doesn't add any</div><div> value, can needlessly break existing installations regardless of the note in CHANGES saying it will,</div><div> makes match by ip configuration more error prone, and the error is not recognizable on configuration</div><div> load.</div><div><br></div><div>In addition, as I pointed out, I think the entire ASTERISK-27206 patch was unnecessary. Before</div><div>the patch, setting the identify_by option to an empty string would disable the username</div><div> identification method from matching the endpoint.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div><div class="gmail-h5"><br>
><br>
> Relevant endpoint 101 configuration values:<br>
><br>
> [global]<br>
> ; The order by which endpoint identifier methods are given priority.<br>
> ; The endpoint_identifier_order default is<br>
> ;endpoint_identifier_order=ip,<wbr>username,anonymous<br>
><br>
> [101]<br>
> type=endpoint<br>
> ; The identify_by default is<br>
> ;identify_by=username<br>
><br>
> [identify_me]<br>
> type=identify<br>
> endpoint=101<br>
> ; Match by some IP address<br>
> match=<a href="http://127.0.0.1/24" rel="noreferrer" target="_blank">127.0.0.1/24</a><br>
><br>
> Before the patch, the 101 endpoint above would identify by either the<br>
> username endpoint identifier method or the<br>
> res_pjsip_endpoint_identifier_<wbr>ip endpoint identifier method's<br>
> [identify_me] section.<br>
><br>
> After the patch, the 101 endpoint is still matched by either method.<br>
> However, the identify_by default had to change to "username,ip" and the<br>
> option meaning had to change slightly do it. I think this is wrong. If<br>
> you went to the trouble to create an [identify_me] section which must<br>
> explicitly specify the endpoint it matches then the endpoint should not<br>
> need to also specify in the identify_by value that it is identified by the<br>
> res_pjsip_endpoint_identifier_<wbr>ip method. Doing so is redundant and will<br>
> cause unnecessary configuration errors.<br>
<br>
</div></div>I think removing the redundant requirement is a nice improvement for the future, but that comes at a cost to do it in a way that is user friendly and automatic.<br>
<span class="gmail-"><br>
> The goal of ASTERISK-27206 is to prevent the endpoint from being<br>
> identified by the username identification method so it could only be<br>
> identified by the res_pjsip_endpoint_identifier_<wbr>ip method. The key<br>
> difference between the two methods is the username identification method<br>
> has no other configuration than the endpoint's identify_by value available<br>
> to specify to which endpoint the method applies.<br>
><br>
> I think the previous and current identify_by documentation is a bit<br>
> misleading in any case. The identify_by option historically specified<br>
> which identification methods that have no other configuration requirements<br>
> can match the endpoint. i.e., The username and auth_username<br>
> identification methods. To satisfy ASTERISK-27206, what is needed for the<br>
> identify_by option is a value to prevent methods that have no other<br>
> configuration requirements from matching the endpoint.<br>
<br>
</span>The identify_by option was originally an option which listed the endpoint identifiers that an endpoint could be identified by. That was its original goal. It later evolved slightly with the addition of auth_username to also influence how. The addition of "ip" goes back to its original goal. Over all the option has muddied meaning.<br></blockquote><div><br></div><div>Listing how an endpoint is to be identified may have been the identify_by option's original goal. That is not how it was coded to behave by the original v12.0.0 release. See <a href="https://issues.asterisk.org/jira/browse/ASTERISK-22135">https://issues.asterisk.org/jira/browse/ASTERISK-22135</a> (895c8e0d2c97cd04299f3f179e99d8a3873c06c6) which removed the identify_by "location" value in 2013 apparently because it wasn't used anywhere. The ASTERISK-22135 patch "redefined" identify_by to how I've described it historically behaves above.</div><div><br></div><div>Restoring the original definition and actually implementing that behavior correctly is the huge scope creep we wish to avoid at this time. Partially implementing it as the ASTERISK-27206 patch attempts will require changes to res_pjsip to add a new widgit identification method to identify_by. In fact <a href="https://issues.asterisk.org/jira/browse/ASTERISK-27491">https://issues.asterisk.org/jira/browse/ASTERISK-27491</a> would need to do just that if the original definition is "restored" by the ASTERISK-27206 patch. That was something I know we tried to avoid in the beginning. We were attempting to add or extend functionality by just loading modules.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
I disagree that whether an endpoint identifier is configurable or not has a bearing on its naming or meaning in identify_by. The configuration may imply that it should only be matched using that identifier, but that is not currently something that is done and is of a greater scope. I think having a global identify_by option which could actually mean multiple endpoint identifiers by itself is also confusing and hard to define the behavior of.<br></blockquote><div><br></div><div>Agree or not, that is how it was coded when v12 was originally released. I am not expanding the scope. I am preserving how the option actually behaves; not redefining it.</div><div><br></div><div>What global identify_by option? I did not mention such an option. The identify_by option is per endpoint as it is part of the endpoint definition config section.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Really what this just illustrates is that the option itself has evolved and hasn't been clearly defined with a strict purpose. I don't think now is the right time to solve that particular problem. If there is a defined use case which is currently broken by the change though, that is something we need to fix.<br></blockquote><div><br></div>The ASTERISK-27206 patch incompletely attempts to restore the originally intended option behavior and actually is not needed to fix the issue.<br><div><br></div><div>Richard</div><br></div></div></div>