From: Kinsey Moore Date: Thu, 16 Oct 2014 14:24:55 +0000 (+0000) Subject: PJSIP: Enforce module load dependencies X-Git-Tag: 12.7.0-rc1~44 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6fc3f0e41383e210d1a2263cec7c366f20d4004e;p=thirdparty%2Fasterisk.git PJSIP: Enforce module load dependencies This enforces that res_pjsip, res_pjsip_session, and res_pjsip_pubsub have loaded properly before attempting to load any modules that depend on them since the module loader system is not currently capable of resolving module dependencies on its own. ASTERISK-24312 #close Reported by: Dafi Ni Review: https://reviewboard.asterisk.org/r/4062/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@425690 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_pjsip.c b/channels/chan_pjsip.c index c58f57233b..7819a910e8 100644 --- a/channels/chan_pjsip.c +++ b/channels/chan_pjsip.c @@ -2181,6 +2181,8 @@ static int load_module(void) { struct ao2_container *endpoints; + CHECK_PJSIP_SESSION_MODULE_LOADED(); + if (!(chan_pjsip_tech.capabilities = ast_format_cap_alloc(0))) { return AST_MODULE_LOAD_DECLINE; } diff --git a/include/asterisk/res_pjsip.h b/include/asterisk/res_pjsip.h index 05c78b0a14..d15d015cfd 100644 --- a/include/asterisk/res_pjsip.h +++ b/include/asterisk/res_pjsip.h @@ -1949,4 +1949,13 @@ void ast_sip_unregister_supplement(struct ast_sip_supplement *supplement); */ char *ast_sip_get_debug(void); +/*! \brief Determines whether the res_pjsip module is loaded */ +#define CHECK_PJSIP_MODULE_LOADED() \ + do { \ + if (!ast_module_check("res_pjsip.so") \ + || !ast_sip_get_pjsip_endpoint()) { \ + return AST_MODULE_LOAD_DECLINE; \ + } \ + } while(0) + #endif /* _RES_PJSIP_H */ diff --git a/include/asterisk/res_pjsip_pubsub.h b/include/asterisk/res_pjsip_pubsub.h index 128379d078..9535934eb1 100644 --- a/include/asterisk/res_pjsip_pubsub.h +++ b/include/asterisk/res_pjsip_pubsub.h @@ -739,4 +739,13 @@ const char *ast_sip_subscription_get_body_type(struct ast_sip_subscription *sub) */ const char *ast_sip_subscription_get_body_subtype(struct ast_sip_subscription *sub); +/*! \brief Determines whether the res_pjsip_pubsub module is loaded */ +#define CHECK_PJSIP_PUBSUB_MODULE_LOADED() \ + do { \ + CHECK_PJSIP_MODULE_LOADED(); \ + if (!ast_module_check("res_pjsip_pubsub.so")) { \ + return AST_MODULE_LOAD_DECLINE; \ + } \ + } while(0) + #endif /* RES_PJSIP_PUBSUB_H */ diff --git a/include/asterisk/res_pjsip_session.h b/include/asterisk/res_pjsip_session.h index 33afb797e0..d2cf852248 100644 --- a/include/asterisk/res_pjsip_session.h +++ b/include/asterisk/res_pjsip_session.h @@ -638,4 +638,13 @@ struct ast_sip_session *ast_sip_dialog_get_session(pjsip_dialog *dlg); */ void ast_sip_session_resume_reinvite(struct ast_sip_session *session); +/*! \brief Determines whether the res_pjsip_session module is loaded */ +#define CHECK_PJSIP_SESSION_MODULE_LOADED() \ + do { \ + CHECK_PJSIP_MODULE_LOADED(); \ + if (!ast_module_check("res_pjsip_session.so")) { \ + return AST_MODULE_LOAD_DECLINE; \ + } \ + } while(0) + #endif /* _RES_PJSIP_SESSION_H */ diff --git a/res/res_hep_pjsip.c b/res/res_hep_pjsip.c index 8874fe4bdb..6b0946de7a 100644 --- a/res/res_hep_pjsip.c +++ b/res/res_hep_pjsip.c @@ -160,6 +160,8 @@ static pjsip_module logging_module = { static int load_module(void) { + CHECK_PJSIP_MODULE_LOADED(); + ast_sip_register_service(&logging_module); return AST_MODULE_LOAD_SUCCESS; } diff --git a/res/res_pjsip_acl.c b/res/res_pjsip_acl.c index acb073d4bb..e01bf4862e 100644 --- a/res/res_pjsip_acl.c +++ b/res/res_pjsip_acl.c @@ -266,6 +266,8 @@ static void *acl_alloc(const char *name) static int load_module(void) { + CHECK_PJSIP_MODULE_LOADED(); + ast_sorcery_apply_default(ast_sip_get_sorcery(), SIP_SORCERY_ACL_TYPE, "config", "pjsip.conf,criteria=type=acl"); diff --git a/res/res_pjsip_authenticator_digest.c b/res/res_pjsip_authenticator_digest.c index 2a32ded24a..7bfc26ac9a 100644 --- a/res/res_pjsip_authenticator_digest.c +++ b/res/res_pjsip_authenticator_digest.c @@ -461,6 +461,8 @@ static int reload_module(void) static int load_module(void) { + CHECK_PJSIP_MODULE_LOADED(); + if (build_entity_id()) { return AST_MODULE_LOAD_DECLINE; } diff --git a/res/res_pjsip_caller_id.c b/res/res_pjsip_caller_id.c index b4f4bdedfc..c52f01ac76 100644 --- a/res/res_pjsip_caller_id.c +++ b/res/res_pjsip_caller_id.c @@ -730,6 +730,8 @@ static struct ast_sip_session_supplement caller_id_supplement = { static int load_module(void) { + CHECK_PJSIP_SESSION_MODULE_LOADED(); + ast_sip_session_register_supplement(&caller_id_supplement); return AST_MODULE_LOAD_SUCCESS; } diff --git a/res/res_pjsip_dialog_info_body_generator.c b/res/res_pjsip_dialog_info_body_generator.c index f7045e594b..fa9279389f 100644 --- a/res/res_pjsip_dialog_info_body_generator.c +++ b/res/res_pjsip_dialog_info_body_generator.c @@ -196,6 +196,8 @@ static struct ast_sip_pubsub_body_generator dialog_info_body_generator = { static int load_module(void) { + CHECK_PJSIP_PUBSUB_MODULE_LOADED(); + if (ast_sip_pubsub_register_body_generator(&dialog_info_body_generator)) { return AST_MODULE_LOAD_DECLINE; } diff --git a/res/res_pjsip_diversion.c b/res/res_pjsip_diversion.c index 0e824bd7c3..6e29590506 100644 --- a/res/res_pjsip_diversion.c +++ b/res/res_pjsip_diversion.c @@ -330,6 +330,8 @@ static struct ast_sip_session_supplement diversion_supplement = { static int load_module(void) { + CHECK_PJSIP_SESSION_MODULE_LOADED(); + ast_sip_session_register_supplement(&diversion_supplement); return AST_MODULE_LOAD_SUCCESS; } diff --git a/res/res_pjsip_dtmf_info.c b/res/res_pjsip_dtmf_info.c index 6a1ce20ff0..f913d2336b 100644 --- a/res/res_pjsip_dtmf_info.c +++ b/res/res_pjsip_dtmf_info.c @@ -150,6 +150,8 @@ static struct ast_sip_session_supplement dtmf_info_supplement = { static int load_module(void) { + CHECK_PJSIP_SESSION_MODULE_LOADED(); + ast_sip_session_register_supplement(&dtmf_info_supplement); return AST_MODULE_LOAD_SUCCESS; } diff --git a/res/res_pjsip_endpoint_identifier_anonymous.c b/res/res_pjsip_endpoint_identifier_anonymous.c index 902dc0276a..f48fdc0792 100644 --- a/res/res_pjsip_endpoint_identifier_anonymous.c +++ b/res/res_pjsip_endpoint_identifier_anonymous.c @@ -108,6 +108,8 @@ static struct ast_sip_endpoint_identifier anonymous_identifier = { static int load_module(void) { + CHECK_PJSIP_MODULE_LOADED(); + ast_sip_register_endpoint_identifier(&anonymous_identifier); return AST_MODULE_LOAD_SUCCESS; } diff --git a/res/res_pjsip_endpoint_identifier_ip.c b/res/res_pjsip_endpoint_identifier_ip.c index 757aca2e55..d812aec054 100644 --- a/res/res_pjsip_endpoint_identifier_ip.c +++ b/res/res_pjsip_endpoint_identifier_ip.c @@ -410,6 +410,8 @@ static struct ast_sip_cli_formatter_entry *cli_formatter; static int load_module(void) { + CHECK_PJSIP_MODULE_LOADED(); + ast_sorcery_apply_config(ast_sip_get_sorcery(), "res_pjsip_endpoint_identifier_ip"); ast_sorcery_apply_default(ast_sip_get_sorcery(), "identify", "config", "pjsip.conf,criteria=type=identify"); diff --git a/res/res_pjsip_endpoint_identifier_user.c b/res/res_pjsip_endpoint_identifier_user.c index 4b10bd3886..3c0ea5dec9 100644 --- a/res/res_pjsip_endpoint_identifier_user.c +++ b/res/res_pjsip_endpoint_identifier_user.c @@ -114,6 +114,8 @@ static struct ast_sip_endpoint_identifier username_identifier = { static int load_module(void) { + CHECK_PJSIP_MODULE_LOADED(); + ast_sip_register_endpoint_identifier(&username_identifier); return AST_MODULE_LOAD_SUCCESS; } diff --git a/res/res_pjsip_exten_state.c b/res/res_pjsip_exten_state.c index 2e133f926e..e3f8c11e15 100644 --- a/res/res_pjsip_exten_state.c +++ b/res/res_pjsip_exten_state.c @@ -528,6 +528,8 @@ static void to_ami(struct ast_sip_subscription *sub, static int load_module(void) { + CHECK_PJSIP_MODULE_LOADED(); + if (ast_sip_register_subscription_handler(&presence_handler)) { ast_log(LOG_WARNING, "Unable to register subscription handler %s\n", presence_handler.event_name); diff --git a/res/res_pjsip_header_funcs.c b/res/res_pjsip_header_funcs.c index dc9d6aad4f..39d1991704 100644 --- a/res/res_pjsip_header_funcs.c +++ b/res/res_pjsip_header_funcs.c @@ -604,6 +604,8 @@ static struct ast_sip_session_supplement header_funcs_supplement = { static int load_module(void) { + CHECK_PJSIP_SESSION_MODULE_LOADED(); + ast_sip_session_register_supplement(&header_funcs_supplement); ast_custom_function_register(&pjsip_header_function); diff --git a/res/res_pjsip_logger.c b/res/res_pjsip_logger.c index 1f7e0bd84b..7519b5c5cb 100644 --- a/res/res_pjsip_logger.c +++ b/res/res_pjsip_logger.c @@ -233,6 +233,8 @@ static const struct ast_sorcery_observer global_observer = { static int load_module(void) { + CHECK_PJSIP_MODULE_LOADED(); + if (ast_sorcery_observer_add(ast_sip_get_sorcery(), "global", &global_observer)) { ast_log(LOG_WARNING, "Unable to add global observer\n"); return AST_MODULE_LOAD_DECLINE; diff --git a/res/res_pjsip_messaging.c b/res/res_pjsip_messaging.c index dc8c0b4495..0d535679d9 100644 --- a/res/res_pjsip_messaging.c +++ b/res/res_pjsip_messaging.c @@ -723,6 +723,8 @@ static pjsip_module messaging_module = { static int load_module(void) { + CHECK_PJSIP_SESSION_MODULE_LOADED(); + if (ast_sip_register_service(&messaging_module) != PJ_SUCCESS) { return AST_MODULE_LOAD_DECLINE; } diff --git a/res/res_pjsip_multihomed.c b/res/res_pjsip_multihomed.c index ffa3795a9b..f109547d6d 100644 --- a/res/res_pjsip_multihomed.c +++ b/res/res_pjsip_multihomed.c @@ -201,6 +201,8 @@ static int load_module(void) { pj_sockaddr addr; + CHECK_PJSIP_MODULE_LOADED(); + if (!pj_gethostip(pj_AF_INET(), &addr)) { pj_sockaddr_print(&addr, host_ipv4, sizeof(host_ipv4), 2); } diff --git a/res/res_pjsip_mwi.c b/res/res_pjsip_mwi.c index f30e494478..b1ae6ee163 100644 --- a/res/res_pjsip_mwi.c +++ b/res/res_pjsip_mwi.c @@ -958,6 +958,8 @@ static int reload(void) static int load_module(void) { + CHECK_PJSIP_MODULE_LOADED(); + if (ast_sip_register_subscription_handler(&mwi_handler)) { return AST_MODULE_LOAD_DECLINE; } diff --git a/res/res_pjsip_mwi_body_generator.c b/res/res_pjsip_mwi_body_generator.c index 4e6f814d80..848fa2e1ec 100644 --- a/res/res_pjsip_mwi_body_generator.c +++ b/res/res_pjsip_mwi_body_generator.c @@ -94,6 +94,8 @@ static struct ast_sip_pubsub_body_generator mwi_generator = { static int load_module(void) { + CHECK_PJSIP_PUBSUB_MODULE_LOADED(); + if (ast_sip_pubsub_register_body_generator(&mwi_generator)) { return AST_MODULE_LOAD_DECLINE; } diff --git a/res/res_pjsip_nat.c b/res/res_pjsip_nat.c index 572421a56d..0b8e62a084 100644 --- a/res/res_pjsip_nat.c +++ b/res/res_pjsip_nat.c @@ -281,6 +281,8 @@ static int unload_module(void) static int load_module(void) { + CHECK_PJSIP_SESSION_MODULE_LOADED(); + if (ast_sip_register_service(&nat_module)) { ast_log(LOG_ERROR, "Could not register NAT module for incoming and outgoing requests\n"); return AST_MODULE_LOAD_FAILURE; diff --git a/res/res_pjsip_notify.c b/res/res_pjsip_notify.c index 58d703f593..f1fa3cbfd7 100644 --- a/res/res_pjsip_notify.c +++ b/res/res_pjsip_notify.c @@ -750,6 +750,8 @@ static int manager_notify(struct mansession *s, const struct message *m) static int load_module(void) { + CHECK_PJSIP_MODULE_LOADED(); + if (aco_info_init(¬ify_cfg)) { return AST_MODULE_LOAD_DECLINE; } diff --git a/res/res_pjsip_one_touch_record_info.c b/res/res_pjsip_one_touch_record_info.c index f0ecbbfbf8..5436ad96a5 100644 --- a/res/res_pjsip_one_touch_record_info.c +++ b/res/res_pjsip_one_touch_record_info.c @@ -107,6 +107,8 @@ static struct ast_sip_session_supplement info_supplement = { static int load_module(void) { + CHECK_PJSIP_SESSION_MODULE_LOADED(); + if (ast_sip_session_register_supplement(&info_supplement)) { ast_log(LOG_ERROR, "Unable to register One Touch Recording supplement\n"); return AST_MODULE_LOAD_FAILURE; diff --git a/res/res_pjsip_outbound_authenticator_digest.c b/res/res_pjsip_outbound_authenticator_digest.c index e7e77dbd5f..92ef53ad27 100644 --- a/res/res_pjsip_outbound_authenticator_digest.c +++ b/res/res_pjsip_outbound_authenticator_digest.c @@ -145,6 +145,8 @@ static struct ast_sip_outbound_authenticator digest_authenticator = { static int load_module(void) { + CHECK_PJSIP_MODULE_LOADED(); + if (ast_sip_register_outbound_authenticator(&digest_authenticator)) { return AST_MODULE_LOAD_DECLINE; } diff --git a/res/res_pjsip_outbound_registration.c b/res/res_pjsip_outbound_registration.c index 41a4c3368d..1b91918eb5 100644 --- a/res/res_pjsip_outbound_registration.c +++ b/res/res_pjsip_outbound_registration.c @@ -1241,6 +1241,8 @@ static struct ast_sip_cli_formatter_entry *cli_formatter; static int load_module(void) { + CHECK_PJSIP_MODULE_LOADED(); + ast_sorcery_apply_default(ast_sip_get_sorcery(), "registration", "config", "pjsip.conf,criteria=type=registration"); if (ast_sorcery_object_register(ast_sip_get_sorcery(), "registration", sip_outbound_registration_alloc, NULL, sip_outbound_registration_apply)) { diff --git a/res/res_pjsip_path.c b/res/res_pjsip_path.c index 28d8b589f4..950dd3bec9 100644 --- a/res/res_pjsip_path.c +++ b/res/res_pjsip_path.c @@ -224,6 +224,8 @@ static struct ast_sip_session_supplement path_session_supplement = { static int load_module(void) { + CHECK_PJSIP_SESSION_MODULE_LOADED(); + if (ast_sip_register_supplement(&path_supplement)) { return AST_MODULE_LOAD_DECLINE; } diff --git a/res/res_pjsip_phoneprov_provider.c b/res/res_pjsip_phoneprov_provider.c index e9e1b373d5..f396fb6937 100644 --- a/res/res_pjsip_phoneprov_provider.c +++ b/res/res_pjsip_phoneprov_provider.c @@ -370,6 +370,8 @@ static int users_apply_handler(const struct ast_sorcery *sorcery, void *obj) static int load_module(void) { + CHECK_PJSIP_MODULE_LOADED(); + if (!(sorcery = ast_sorcery_open())) { ast_log(LOG_ERROR, "Unable to open a sorcery instance.\n"); return AST_MODULE_LOAD_DECLINE; diff --git a/res/res_pjsip_pidf_body_generator.c b/res/res_pjsip_pidf_body_generator.c index cd4840e13a..7af612f1ac 100644 --- a/res/res_pjsip_pidf_body_generator.c +++ b/res/res_pjsip_pidf_body_generator.c @@ -118,6 +118,8 @@ static struct ast_sip_pubsub_body_generator pidf_body_generator = { static int load_module(void) { + CHECK_PJSIP_PUBSUB_MODULE_LOADED(); + if (ast_sip_pubsub_register_body_generator(&pidf_body_generator)) { return AST_MODULE_LOAD_DECLINE; } diff --git a/res/res_pjsip_pidf_digium_body_supplement.c b/res/res_pjsip_pidf_digium_body_supplement.c index 22cd01be76..813134be7d 100644 --- a/res/res_pjsip_pidf_digium_body_supplement.c +++ b/res/res_pjsip_pidf_digium_body_supplement.c @@ -95,6 +95,8 @@ static struct ast_sip_pubsub_body_supplement pidf_supplement = { static int load_module(void) { + CHECK_PJSIP_PUBSUB_MODULE_LOADED(); + if (ast_sip_pubsub_register_body_supplement(&pidf_supplement)) { return AST_MODULE_LOAD_DECLINE; } diff --git a/res/res_pjsip_pidf_eyebeam_body_supplement.c b/res/res_pjsip_pidf_eyebeam_body_supplement.c index 042cbf5e89..31cbdfb90c 100644 --- a/res/res_pjsip_pidf_eyebeam_body_supplement.c +++ b/res/res_pjsip_pidf_eyebeam_body_supplement.c @@ -94,6 +94,8 @@ static struct ast_sip_pubsub_body_supplement pidf_supplement = { static int load_module(void) { + CHECK_PJSIP_PUBSUB_MODULE_LOADED(); + if (ast_sip_pubsub_register_body_supplement(&pidf_supplement)) { return AST_MODULE_LOAD_DECLINE; } diff --git a/res/res_pjsip_pubsub.c b/res/res_pjsip_pubsub.c index 09a0ecdc19..a0e8d49f85 100644 --- a/res/res_pjsip_pubsub.c +++ b/res/res_pjsip_pubsub.c @@ -1867,7 +1867,11 @@ static int persistence_expires_struct2str(const void *obj, const intptr_t *args, static int load_module(void) { static const pj_str_t str_PUBLISH = { "PUBLISH", 7 }; - struct ast_sorcery *sorcery = ast_sip_get_sorcery(); + struct ast_sorcery *sorcery; + + CHECK_PJSIP_MODULE_LOADED(); + + sorcery = ast_sip_get_sorcery(); pjsip_evsub_init_module(ast_sip_get_pjsip_endpoint()); diff --git a/res/res_pjsip_refer.c b/res/res_pjsip_refer.c index b88396f7a4..fac82fa4b7 100644 --- a/res/res_pjsip_refer.c +++ b/res/res_pjsip_refer.c @@ -20,7 +20,6 @@ pjproject res_pjsip res_pjsip_session - res_pjsip_pubsub core ***/ @@ -985,6 +984,8 @@ static int load_module(void) { const pj_str_t str_norefersub = { "norefersub", 10 }; + CHECK_PJSIP_SESSION_MODULE_LOADED(); + pjsip_replaces_init_module(ast_sip_get_pjsip_endpoint()); pjsip_xfer_init_module(ast_sip_get_pjsip_endpoint()); pjsip_endpt_add_capability(ast_sip_get_pjsip_endpoint(), NULL, PJSIP_H_SUPPORTED, NULL, 1, &str_norefersub); diff --git a/res/res_pjsip_registrar.c b/res/res_pjsip_registrar.c index f7d082c18d..61f0ca55a6 100644 --- a/res/res_pjsip_registrar.c +++ b/res/res_pjsip_registrar.c @@ -793,6 +793,8 @@ static int load_module(void) { const pj_str_t STR_REGISTER = { "REGISTER", 8 }; + CHECK_PJSIP_MODULE_LOADED(); + if (!(serializers = ao2_container_alloc( SERIALIZER_BUCKETS, serializer_hash, serializer_cmp))) { return AST_MODULE_LOAD_DECLINE; diff --git a/res/res_pjsip_registrar_expire.c b/res/res_pjsip_registrar_expire.c index 53f34c614a..0645f46119 100644 --- a/res/res_pjsip_registrar_expire.c +++ b/res/res_pjsip_registrar_expire.c @@ -177,6 +177,8 @@ static void contact_expiration_initialize_existing(void) static int load_module(void) { + CHECK_PJSIP_MODULE_LOADED(); + if (!(contact_autoexpire = ao2_container_alloc_options(AO2_ALLOC_OPT_LOCK_NOLOCK, CONTACT_AUTOEXPIRE_BUCKETS, contact_expiration_hash, contact_expiration_cmp))) { ast_log(LOG_ERROR, "Could not create container for contact auto-expiration\n"); diff --git a/res/res_pjsip_rfc3326.c b/res/res_pjsip_rfc3326.c index 66594fef58..21593261a8 100644 --- a/res/res_pjsip_rfc3326.c +++ b/res/res_pjsip_rfc3326.c @@ -130,6 +130,8 @@ static struct ast_sip_session_supplement rfc3326_supplement = { static int load_module(void) { + CHECK_PJSIP_SESSION_MODULE_LOADED(); + ast_sip_session_register_supplement(&rfc3326_supplement); return AST_MODULE_LOAD_SUCCESS; } diff --git a/res/res_pjsip_sdp_rtp.c b/res/res_pjsip_sdp_rtp.c index 974363d9b5..343c4d5346 100644 --- a/res/res_pjsip_sdp_rtp.c +++ b/res/res_pjsip_sdp_rtp.c @@ -1254,6 +1254,8 @@ static int unload_module(void) */ static int load_module(void) { + CHECK_PJSIP_SESSION_MODULE_LOADED(); + ast_sockaddr_parse(&address_ipv4, "0.0.0.0", 0); ast_sockaddr_parse(&address_ipv6, "::", 0); diff --git a/res/res_pjsip_send_to_voicemail.c b/res/res_pjsip_send_to_voicemail.c index c8392de051..f7734c94d9 100644 --- a/res/res_pjsip_send_to_voicemail.c +++ b/res/res_pjsip_send_to_voicemail.c @@ -207,6 +207,8 @@ static struct ast_sip_session_supplement refer_supplement = { static int load_module(void) { + CHECK_PJSIP_SESSION_MODULE_LOADED(); + if (ast_sip_session_register_supplement(&refer_supplement)) { ast_log(LOG_ERROR, "Unable to register Send to Voicemail supplement\n"); return AST_MODULE_LOAD_FAILURE; diff --git a/res/res_pjsip_session.c b/res/res_pjsip_session.c index d5aee9b2db..7a640c8ce8 100644 --- a/res/res_pjsip_session.c +++ b/res/res_pjsip_session.c @@ -2405,6 +2405,8 @@ static int load_module(void) { pjsip_endpoint *endpt; + CHECK_PJSIP_MODULE_LOADED(); + if (!ast_sip_get_sorcery() || !ast_sip_get_pjsip_endpoint()) { return AST_MODULE_LOAD_DECLINE; } diff --git a/res/res_pjsip_t38.c b/res/res_pjsip_t38.c index 14f53235ec..b63a607e31 100644 --- a/res/res_pjsip_t38.c +++ b/res/res_pjsip_t38.c @@ -850,6 +850,8 @@ static int unload_module(void) */ static int load_module(void) { + CHECK_PJSIP_SESSION_MODULE_LOADED(); + ast_sockaddr_parse(&address_ipv4, "0.0.0.0", 0); ast_sockaddr_parse(&address_ipv6, "::", 0); diff --git a/res/res_pjsip_transport_websocket.c b/res/res_pjsip_transport_websocket.c index 228326dd7d..01aaabaf30 100644 --- a/res/res_pjsip_transport_websocket.c +++ b/res/res_pjsip_transport_websocket.c @@ -361,6 +361,8 @@ static struct ast_sip_session_supplement websocket_supplement = { static int load_module(void) { + CHECK_PJSIP_MODULE_LOADED(); + pjsip_transport_register_type(PJSIP_TRANSPORT_RELIABLE, "WS", 5060, &transport_type_ws); pjsip_transport_register_type(PJSIP_TRANSPORT_RELIABLE, "WSS", 5060, &transport_type_wss); diff --git a/res/res_pjsip_xpidf_body_generator.c b/res/res_pjsip_xpidf_body_generator.c index 42158ef39c..284c07200a 100644 --- a/res/res_pjsip_xpidf_body_generator.c +++ b/res/res_pjsip_xpidf_body_generator.c @@ -151,6 +151,8 @@ static void unregister_all(void) static int load_module(void) { + CHECK_PJSIP_PUBSUB_MODULE_LOADED(); + if (ast_sip_pubsub_register_body_generator(&xpidf_body_generator)) { goto fail; }