<p> Attention is currently required from: Michael Bradeen, Joshua Colp, Benjamin Keith Ford. </p>
<p>Patch set 4:<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/+/18892">View Change</a></p><p>11 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="null">Patchset:</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/+/18892?tab=comments">Patch Set #4:</a> </p><p style="white-space: pre-wrap; word-wrap: break-word;">It's probably already in the existing code but where do we explicitly prevent sending tel uris?  </p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="null">File configs/samples/pjsip.conf.sample:</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/+/18892/comment/75b86763_855048ab">Patch Set #4, Line 1511:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;">; You can match a TEL URI to an endpoint using a config object of type<br>; "identify". Set the endpoint you want it to be associated with, and match<br>; based on IP. For example:<br>;<br>; [tel-uri-identify]<br>; type=identify<br>; endpoint=my-endpoint<br>; match=127.0.0.1:5061<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">This is a bit "strange" since match-by-ip applies to anything whether it has a tel uri or not.  However, you might want to explain that if the From header is a tel-uri, the endpoint can only be matched by ip, header, or auth_username.  not username.</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="null">File include/asterisk/res_pjsip.h:</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/+/18892/comment/b7cfe30d_9b99c9b4">Patch Set #4, Line 3501:</a> <code style="font-family:monospace,monospace">User string or empty string if not present</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Do we really need to return an empty pj_str on error or can we just return NULL.  I get that ast_copy_pj_str doesn't have NULL checking but it probably should.</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="null">File res/res_pjsip.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/+/18892/comment/7255d397_61a33a88">Patch Set #4, Line 2372:</a> <code style="font-family:monospace,monospace">const pj_str_t *ast_sip_pjsip_uri_get_username(pjsip_uri *uri)</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Do we really need to return an empty pj_str on error or can we just return NULL.  I get that ast_copy_pj_str doesn't have NULL checking but it probably should.</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="null">File res/res_pjsip/pjsip_message_filter.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/+/18892/comment/ca28790d_8c992c19">Patch Set #4, Line 491:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;">!ast_sip_is_uri_sip_sips(rdata->msg_info.msg->line.req.uri)<br>                && <br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">I don't think you need this any more do you?  Just test for TEL?</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="null">File res/res_pjsip_dialog_info_body_generator.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/+/18892/comment/deb6f87f_e3b3bbfb">Patch Set #4, Line 193:</a> <code style="font-family:monospace,monospace">                   ast_copy_pj_str(dlg_remote_uri, ast_sip_pjsip_uri_get_hostname(dlg->local.info->uri), sizeof(dlg_remote_uri));</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">So dlg_remote-uri is going to be empty if this is a tel-uri.  I think that means an invalid sip uri is going to be created wherever from_domain_sanitized is used below.</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="null">File res/res_pjsip_endpoint_identifier_anonymous.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/+/18892/comment/dbc561a8_f814907c">Patch Set #4, Line 39:</a> <code style="font-family:monospace,monospace">        ast_copy_pj_str(domain, ast_sip_pjsip_uri_get_hostname(from), domain_size);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Same as before.  For a tel-uri the domain will be empty which will produce invalid uris below.</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="null">File res/res_pjsip_endpoint_identifier_user.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/+/18892/comment/17bcb46b_fa6d63fc">Patch Set #4, Line 40:</a> <code style="font-family:monospace,monospace">        ast_copy_pj_str(username, ast_sip_pjsip_uri_get_username(from), username_size);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">I thought we weren't going to allow an identify-by username for a tel uri?</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/18892/comment/f0df205c_5138eee6">Patch Set #4, Line 41:</a> <code style="font-family:monospace,monospace"> ast_copy_pj_str(domain, ast_sip_pjsip_uri_get_hostname(from), domain_size);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Same as before.  An empty domain will produce invalid uris below.</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="null">File res/res_pjsip_nat.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/+/18892/comment/1475fd45_a24c8fdc">Patch Set #4, Line 115:</a> <code style="font-family:monospace,monospace"></code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Just a whitespace change?</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="null">File res/res_pjsip_path.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/+/18892/comment/6d4417db_62473948">Patch Set #4, Line 53:</a> <code style="font-family:monospace,monospace">     domain_name = ast_alloca(uri_hostname->slen + 1);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Same as before.  In this case we're going to attempt to look up a domain alias of "" which will always fail so why bother?</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/18892">change 18892</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/+/18892"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 16 </div>
<div style="display:none"> Gerrit-Change-Id: If5729e6cd583be7acf666373bf9f1b9d653ec29a </div>
<div style="display:none"> Gerrit-Change-Number: 18892 </div>
<div style="display:none"> Gerrit-PatchSet: 4 </div>
<div style="display:none"> Gerrit-Owner: Benjamin Keith Ford <bford@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-Reviewer: Michael Bradeen <mbradeen@sangoma.com> </div>
<div style="display:none"> Gerrit-CC: Alexei Gradinari <alex2grad@gmail.com> </div>
<div style="display:none"> Gerrit-Attention: Michael Bradeen <mbradeen@sangoma.com> </div>
<div style="display:none"> Gerrit-Attention: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-Attention: Benjamin Keith Ford <bford@digium.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Fri, 19 Aug 2022 09:52:13 +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>