<p>Friendly Automation <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/19366">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span></span><br></pre><div style="white-space:pre-wrap">Approvals:
  George Joseph: Looks good to me, approved
  Friendly Automation: Approved for Submit

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_pjsip_geolocation: Change some notices to debugs.<br><br>If geolocation is not in use for an endpoint, the NOTICE<br>log level is currently spammed with messages about this,<br>even though nothing is wrong and these messages provide<br>no real value. These log messages are therefore changed<br>to debugs.<br><br>ASTERISK-30241 #close<br><br>Change-Id: I656b355d812f67cc0f0fdf09b00b0e1458598bb4<br>---<br>M res/res_pjsip_geolocation.c<br>1 file changed, 32 insertions(+), 10 deletions(-)<br><br></pre>
<pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/res/res_pjsip_geolocation.c b/res/res_pjsip_geolocation.c</span><br><span>index d0e8d46..422c56d 100644</span><br><span>--- a/res/res_pjsip_geolocation.c</span><br><span>+++ b/res/res_pjsip_geolocation.c</span><br><span>@@ -145,7 +145,7 @@</span><br><span>       char *geoloc_routing_hdr_value = NULL;</span><br><span>       char *geoloc_uri = NULL;</span><br><span>     int rc = 0;</span><br><span style="color: hsl(0, 100%, 40%);">-     RAII_VAR(struct ast_str *, buf, ast_str_create(1024), ast_free);</span><br><span style="color: hsl(120, 100%, 40%);">+      RAII_VAR(struct ast_str *, buf, NULL, ast_free);</span><br><span>     pjsip_generic_string_hdr *geoloc_hdr = NULL;</span><br><span>         pjsip_generic_string_hdr *geoloc_routing_hdr = NULL;</span><br><span>         SCOPE_ENTER(3, "%s\n", session_name);</span><br><span>@@ -191,7 +191,7 @@</span><br><span>                                "Done.\n", session_name,</span><br><span>                           PJSTR_PRINTF_VAR(geoloc_hdr->hvalue));</span><br><span>            } else {</span><br><span style="color: hsl(0, 100%, 40%);">-                        SCOPE_EXIT_LOG_RTN_VALUE(0, LOG_NOTICE, "%s: Endpoint has no geoloc_incoming_call_profile. "</span><br><span style="color: hsl(120, 100%, 40%);">+                        SCOPE_EXIT_RTN_VALUE(0, "%s: Endpoint has no geoloc_incoming_call_profile. "</span><br><span>                               "Done.\n", session_name);</span><br><span>          }</span><br><span>    }</span><br><span>@@ -209,6 +209,11 @@</span><br><span>             }</span><br><span>    }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ buf = ast_str_create(1024);</span><br><span style="color: hsl(120, 100%, 40%);">+   if (!buf) {</span><br><span style="color: hsl(120, 100%, 40%);">+           SCOPE_EXIT_LOG_RTN_VALUE(0, LOG_WARNING, "%s: Unable to allocate buf\n", session_name);</span><br><span style="color: hsl(120, 100%, 40%);">+     }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>  if (config_profile->precedence != AST_GEOLOC_PRECED_DISCARD_CONFIG) {</span><br><span>             config_eprofile = ast_geoloc_eprofile_create_from_profile(config_profile);</span><br><span>           if (!config_eprofile) {</span><br><span>@@ -469,7 +474,7 @@</span><br><span>        RAII_VAR(struct ast_geoloc_eprofile *, config_eprofile, NULL, ao2_cleanup);</span><br><span>  RAII_VAR(struct ast_geoloc_eprofile *, incoming_eprofile, NULL, ao2_cleanup);</span><br><span>        struct ast_geoloc_eprofile *final_eprofile = NULL;</span><br><span style="color: hsl(0, 100%, 40%);">-      RAII_VAR(struct ast_str *, buf, ast_str_create(1024), ast_free);</span><br><span style="color: hsl(120, 100%, 40%);">+      RAII_VAR(struct ast_str *, buf, NULL, ast_free);</span><br><span>     struct ast_datastore *ds = NULL;  /* The channel cleans up ds */</span><br><span>     pjsip_msg_body *orig_body = NULL;</span><br><span>    pjsip_generic_string_hdr *geoloc_hdr = NULL;</span><br><span>@@ -478,11 +483,6 @@</span><br><span>  const char *uri;</span><br><span>     SCOPE_ENTER(3, "%s\n", session_name);</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-     if (!buf) {</span><br><span style="color: hsl(0, 100%, 40%);">-             SCOPE_EXIT_LOG_RTN(LOG_WARNING, "%s: Unable to allocate buf\n",</span><br><span style="color: hsl(0, 100%, 40%);">-                       session_name);</span><br><span style="color: hsl(0, 100%, 40%);">-  }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span>    if (!endpoint) {</span><br><span>             SCOPE_EXIT_LOG_RTN(LOG_WARNING, "%s: Session has no endpoint.  Skipping.\n",</span><br><span>                       session_name);</span><br><span>@@ -494,8 +494,8 @@</span><br><span>         }</span><br><span> </span><br><span>        if (ast_strlen_zero(endpoint->geoloc_outgoing_call_profile)) {</span><br><span style="color: hsl(0, 100%, 40%);">-                       SCOPE_EXIT_LOG_RTN(LOG_NOTICE, "%s: Endpoint has no geoloc_outgoing_call_profile. "</span><br><span style="color: hsl(0, 100%, 40%);">-                           "Skipping.\n", session_name);</span><br><span style="color: hsl(120, 100%, 40%);">+               SCOPE_EXIT_RTN("%s: Endpoint has no geoloc_outgoing_call_profile. Skipping.\n",</span><br><span style="color: hsl(120, 100%, 40%);">+                     session_name);</span><br><span>       }</span><br><span> </span><br><span>        config_profile = ast_geoloc_get_profile(endpoint->geoloc_outgoing_call_profile);</span><br><span>@@ -578,6 +578,11 @@</span><br><span>           ast_geoloc_eprofile_refresh_location(final_eprofile);</span><br><span>        }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ buf = ast_str_create(1024);</span><br><span style="color: hsl(120, 100%, 40%);">+   if (!buf) {</span><br><span style="color: hsl(120, 100%, 40%);">+           SCOPE_EXIT_LOG_RTN(LOG_WARNING, "%s: Unable to allocate buf\n", session_name);</span><br><span style="color: hsl(120, 100%, 40%);">+      }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>  if (final_eprofile->format == AST_GEOLOC_FORMAT_URI) {</span><br><span>            uri = ast_geoloc_eprofile_to_uri(final_eprofile, channel, &buf, session_name);</span><br><span>           if (!uri) {</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/19366">change 19366</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/+/19366"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: certified/18.9 </div>
<div style="display:none"> Gerrit-Change-Id: I656b355d812f67cc0f0fdf09b00b0e1458598bb4 </div>
<div style="display:none"> Gerrit-Change-Number: 19366 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </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: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-CC: N A <mail@interlinked.x10host.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>