if (cli_init()
|| channel_metrics_init()
|| endpoint_metrics_init()
- || bridge_metrics_init()
- || pjsip_outbound_registration_metrics_init()) {
+ || bridge_metrics_init()) {
+ goto cleanup;
+ }
+
+ if(ast_module_check("res_pjsip_outbound_registration.so")) {
+ /* Call a local function, used in the core prometheus code only */
+ if (pjsip_outbound_registration_metrics_init())
goto cleanup;
}
.load_pri = AST_MODPRI_DEFAULT,
#ifdef HAVE_PJPROJECT
/* This module explicitly calls into res_pjsip if Asterisk is built with PJSIP support, so they are required. */
- .requires = "res_pjsip,res_pjsip_outbound_registration",
+ .requires = "res_pjsip",
+ .optional_modules = "res_pjsip_outbound_registration",
#endif
);