<p>Friendly Automation <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/18676">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Joshua Colp: Looks good to me, approved
  Kevin Harwell: Looks good to me, but someone else must approve
  Friendly Automation: Approved for Submit

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_prometheus: Optional load res_pjsip_outbound_registration.so<br><br>Switched res_pjsip_outbound_registration.so dep to optional. Added<br>module loaded check before using it.<br><br>ASTERISK-30101 #close<br><br>Change-Id: Ia34f1684d984e821fbdd4de8911f930337703666<br>---<br>M res/res_prometheus.c<br>1 file changed, 9 insertions(+), 3 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/res/res_prometheus.c b/res/res_prometheus.c</span><br><span>index 4aacf6e..5d277f1 100644</span><br><span>--- a/res/res_prometheus.c</span><br><span>+++ b/res/res_prometheus.c</span><br><span>@@ -974,8 +974,13 @@</span><br><span>     if (cli_init()</span><br><span>               || channel_metrics_init()</span><br><span>            || endpoint_metrics_init()</span><br><span style="color: hsl(0, 100%, 40%);">-              || bridge_metrics_init()</span><br><span style="color: hsl(0, 100%, 40%);">-                || pjsip_outbound_registration_metrics_init()) {</span><br><span style="color: hsl(120, 100%, 40%);">+              || bridge_metrics_init()) {</span><br><span style="color: hsl(120, 100%, 40%);">+           goto cleanup;</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+     </span><br><span style="color: hsl(120, 100%, 40%);">+      if(ast_module_check("res_pjsip_outbound_registration.so")) {</span><br><span style="color: hsl(120, 100%, 40%);">+                /* Call a local function, used in the core prometheus code only */</span><br><span style="color: hsl(120, 100%, 40%);">+            if (pjsip_outbound_registration_metrics_init())</span><br><span>              goto cleanup;</span><br><span>        }</span><br><span> </span><br><span>@@ -1004,6 +1009,7 @@</span><br><span>        .load_pri = AST_MODPRI_DEFAULT,</span><br><span> #ifdef HAVE_PJPROJECT</span><br><span>     /* This module explicitly calls into res_pjsip if Asterisk is built with PJSIP support, so they are required. */</span><br><span style="color: hsl(0, 100%, 40%);">-        .requires = "res_pjsip,res_pjsip_outbound_registration",</span><br><span style="color: hsl(120, 100%, 40%);">+    .requires = "res_pjsip",</span><br><span style="color: hsl(120, 100%, 40%);">+    .optional_modules = "res_pjsip_outbound_registration",</span><br><span> #endif</span><br><span> );</span><br><span></span><br></pre><div style="white-space:pre-wrap"></div><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/18676">change 18676</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/+/18676"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 19 </div>
<div style="display:none"> Gerrit-Change-Id: Ia34f1684d984e821fbdd4de8911f930337703666 </div>
<div style="display:none"> Gerrit-Change-Number: 18676 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: Boris P. Korzun <drtr0jan@yandex.ru> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>