From eabb398d71772ee47c81220faba2781d4f4fbf2a Mon Sep 17 00:00:00 2001 From: Matt Jordan Date: Wed, 8 Jun 2016 12:26:29 -0500 Subject: res_hep_{pjsip|rtcp}: Decline module loads if res_hep had not loaded A crash can occur in res_hep_pjsip or res_hep_rtcp if res_hep has not loaded and does not have a configuration file. Previously when this occurred, checks were put in to see if the configuration was loaded successfully. While this is a good idea - and has been added to the offending function in res_hep - the reality is res_hep_pjsip and res_hep_rtcp have no business running if res_hep isn't also running. As such, this patch also adds a function to res_hep that returns whether or not it successfully loaded. Oddly enough, ast_module_check returns "everything is peachy" even if a module declined its load - so it cannot be solely relied on. res_hep_pjsip and res_hep_rtcp now also check this function to see if they should continue to load; if it fails, they decline their load as well. ASTERISK-26096 #close Change-Id: I007e535fcc2e51c2ca48534f48c5fc2ac38935ea --- include/asterisk/res_hep.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include/asterisk/res_hep.h') diff --git a/include/asterisk/res_hep.h b/include/asterisk/res_hep.h index bd0129eea..cfd213ad7 100644 --- a/include/asterisk/res_hep.h +++ b/include/asterisk/res_hep.h @@ -118,6 +118,14 @@ int hepv3_send_packet(struct hepv3_capture_info *capture_info); */ enum hep_uuid_type hepv3_get_uuid_type(void); +/*! + * \brief Return whether or not we're currently loaded and active + * + * \retval 0 The module is not loaded + * \retval 1 The module is loaded + */ +int hepv3_is_loaded(void); + #if defined(__cplusplus) || defined(c_plusplus) } #endif -- cgit v1.2.3