<p style="white-space: pre-wrap; word-wrap: break-word;">Just thoughts on code reuse mainly.</p><p>Patch set 2:<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/+/15130">View Change</a></p><p>4 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.asterisk.org/c/asterisk/+/15130/2/res/res_pjsip_outbound_registration.c">File res/res_pjsip_outbound_registration.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/+/15130/2/res/res_pjsip_outbound_registration.c@544">Patch Set #2, Line 544:</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;">pjsip_regc_info info;<br><br>   pjsip_regc_get_info(client_state->client, &info);<br><br>    callback_invoked = ast_threadstorage_get(&register_callback_invoked, sizeof(int));<br>        if (!callback_invoked) {<br>              pjsip_tx_data_dec_ref(tdata);<br>         ast_log(LOG_ERROR, "Failed to get threadstorage for registration to server '%.*s' from client '%.*s'\n",<br>                            (int) info.server_uri.slen, info.server_uri.ptr,<br>                              (int) info.client_uri.slen, info.client_uri.ptr);<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Since info is really only used here in off nominal paths maybe only retrieve it when that happens?</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/15130/2/res/res_pjsip_outbound_registration.c@613">Patch Set #2, Line 613:</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;">       pjsip_regc_get_info(client_state->client, &info);<br><br>    if (pjsip_regc_register(client_state->client, PJ_FALSE, &tdata) != PJ_SUCCESS) {<br>               ast_log(LOG_ERROR, "Failed to create registration to server '%.*s' from client '%.*s'\n",<br>                           (int) info.server_uri.slen, info.server_uri.ptr,<br>                              (int) info.client_uri.slen, info.client_uri.ptr);<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Similar to above. Only retrieve when used by off nominal? Maybe move to own error log function since being used in this capacity multiple times?</p><p style="white-space: pre-wrap; word-wrap: break-word;">Might could do similar for debug as well? Might not be worth it though?</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/15130/2/res/res_pjsip_outbound_registration.c@1457">Patch Set #2, Line 1457:</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;">     pjsip_regc_get_info(state->client_state->client, &info);<br><br>  ast_debug(1, "Performing register to server '%s' from client '%s'  Expiration: %d\n",<br>               state->registration->server_uri, state->registration->client_uri, registration->expiration);<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">This can be surrounded with a DEBUG_ATLEAST</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/15130/2/res/res_pjsip_outbound_registration.c@1644">Patch Set #2, Line 1644:</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;">  pjsip_regc_get_info(state->client_state->client, &info);<br><br>  ast_debug(1, "Queueing register to server '%s' from client '%s'\n",<br>         state->registration->server_uri, state->registration->client_uri);<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">This too can be surrounded by a DEBUG_ATLEAST</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/15130">change 15130</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/+/15130"/><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: I4534a0fc78c7cb69f23b7b449dda9748c90daca2 </div>
<div style="display:none"> Gerrit-Change-Number: 15130 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Tue, 03 Nov 2020 23:27:53 +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>