<p>Richard Mudgett has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/6141">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_pjsip_outbound_registration.c: Misc fixes.<br><br>* Remove unnecessary CMP_STOP.<br><br>* In handle_client_registration() use DEBUG_ATLEAST() to only do work<br>needed for the debug log message when the debug log message is needed.<br><br>* In sip_outbound_registration_state_destroy() check state->registration<br>for NULL.<br><br>Change-Id: I656d0fa11dda0b00048103efb1558e67a426fd80<br>---<br>M res/res_pjsip_outbound_registration.c<br>1 file changed, 12 insertions(+), 10 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/41/6141/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/res/res_pjsip_outbound_registration.c b/res/res_pjsip_outbound_registration.c<br>index 8a840ff..7b605b9 100644<br>--- a/res/res_pjsip_outbound_registration.c<br>+++ b/res/res_pjsip_outbound_registration.c<br>@@ -459,7 +459,7 @@<br>     struct sip_outbound_registration_state *state = obj;<br>  pjsip_param *line = arg;<br> <br>-  return !pj_strcmp2(&line->value, state->client_state->line) ? CMP_MATCH | CMP_STOP : 0;<br>+ return !pj_strcmp2(&line->value, state->client_state->line) ? CMP_MATCH : 0;<br> }<br> <br> static struct pjsip_param *get_uri_option_line(const void *uri)<br>@@ -558,20 +558,21 @@<br> {<br>         RAII_VAR(struct sip_outbound_registration_client_state *, client_state, data, ao2_cleanup);<br>   pjsip_tx_data *tdata;<br>-        pjsip_regc_info info;<br>-        char server_uri[PJSIP_MAX_URL_SIZE];<br>- char client_uri[PJSIP_MAX_URL_SIZE];<br> <br>       if (client_state->status == SIP_REGISTRATION_STOPPED<br>               || pjsip_regc_register(client_state->client, PJ_FALSE, &tdata) != PJ_SUCCESS) {<br>                return 0;<br>     }<br> <br>- pjsip_regc_get_info(client_state->client, &info);<br>-     ast_copy_pj_str(server_uri, &info.server_uri, sizeof(server_uri));<br>-       ast_copy_pj_str(client_uri, &info.client_uri, sizeof(client_uri));<br>-       ast_debug(1, "Outbound REGISTER attempt %u to '%s' with client '%s'\n",<br>-            client_state->retries + 1, server_uri, client_uri);<br>+       if (DEBUG_ATLEAST(1)) {<br>+              pjsip_regc_info info;<br>+<br>+             pjsip_regc_get_info(client_state->client, &info);<br>+             ast_log(LOG_DEBUG, "Outbound REGISTER attempt %u to '%.*s' with client '%.*s'\n",<br>+                  client_state->retries + 1,<br>+                        (int) info.server_uri.slen, info.server_uri.ptr,<br>+                     (int) info.client_uri.slen, info.client_uri.ptr);<br>+    }<br> <br>  if (client_state->support_path) {<br>          pjsip_supported_hdr *hdr;<br>@@ -987,7 +988,8 @@<br>        struct sip_outbound_registration_state *state = obj;<br> <br>       ast_debug(3, "Destroying registration state for registration to server '%s' from client '%s'\n",<br>-                   state->registration->server_uri, state->registration->client_uri);<br>+               state->registration ? state->registration->server_uri : "",<br>+               state->registration ? state->registration->client_uri : "");<br>       ao2_cleanup(state->registration);<br> <br>       if (!state->client_state) {<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/6141">change 6141</a>. To unsubscribe, 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/6141"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 14 </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I656d0fa11dda0b00048103efb1558e67a426fd80 </div>
<div style="display:none"> Gerrit-Change-Number: 6141 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Richard Mudgett <rmudgett@digium.com> </div>