diff --git a/src/mod/asr_tts/mod_cepstral/mod_cepstral.c b/src/mod/asr_tts/mod_cepstral/mod_cepstral.c index 2c5c3d2da3..8931cd1f76 100644 --- a/src/mod/asr_tts/mod_cepstral/mod_cepstral.c +++ b/src/mod/asr_tts/mod_cepstral/mod_cepstral.c @@ -51,7 +51,8 @@ #undef SWIFT_FAILED #define SWIFT_FAILED(r) ((void *)(r) < (void *)0) -static const char modname[] = "mod_cepstral"; +SWITCH_MODULE_LOAD_FUNCTION(mod_cepstral_load); +SWITCH_MODULE_DEFINITION(mod_cepstral, mod_cepstral_load, NULL, NULL); static swift_engine *engine; @@ -426,7 +427,7 @@ static const switch_loadable_module_interface_t cepstral_module_interface = { /*.directory_interface */ NULL }; -switch_status_t switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename) +SWITCH_MODULE_LOAD_FUNCTION(mod_cepstral_load) { /* Open the Swift TTS Engine */ diff --git a/src/mod/codecs/mod_amr/mod_amr.c b/src/mod/codecs/mod_amr/mod_amr.c index e6227f8b1d..2915054189 100644 --- a/src/mod/codecs/mod_amr/mod_amr.c +++ b/src/mod/codecs/mod_amr/mod_amr.c @@ -32,7 +32,9 @@ * */ #include "switch.h" -static const char modname[] = "mod_amr"; + +SWITCH_MODULE_LOAD_FUNCTION(mod_amr_load); +SWITCH_MODULE_DEFINITION(mod_amr, mod_amr_load, NULL, NULL); #ifndef AMR_PASSTHROUGH #include "amr/interf_enc.h" @@ -322,7 +324,7 @@ static switch_loadable_module_interface_t amr_module_interface = { /*.application_interface */ NULL }; -SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename) +SWITCH_MODULE_LOAD_FUNCTION(mod_amr_load) { #ifndef AMR_PASSTHROUGH char *cf = "amr.conf"; diff --git a/src/mod/codecs/mod_g711/mod_g711.c b/src/mod/codecs/mod_g711/mod_g711.c index 3ab8c5faaf..4fc632f80d 100644 --- a/src/mod/codecs/mod_g711/mod_g711.c +++ b/src/mod/codecs/mod_g711/mod_g711.c @@ -32,8 +32,8 @@ #include #include - -static const char modname[] = "mod_g711"; +SWITCH_MODULE_LOAD_FUNCTION(mod_g711_load); +SWITCH_MODULE_DEFINITION(mod_g711, mod_g711_load, NULL, NULL); static switch_status_t switch_g711u_init(switch_codec_t *codec, switch_codec_flag_t flags, const switch_codec_settings_t *codec_settings) @@ -415,7 +415,7 @@ static switch_loadable_module_interface_t g711_module_interface = { }; -SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename) +SWITCH_MODULE_LOAD_FUNCTION(mod_g711_load) { /* connect my internal structure to the blank pointer passed to me */ *module_interface = &g711_module_interface; diff --git a/src/mod/codecs/mod_g722/mod_g722.c b/src/mod/codecs/mod_g722/mod_g722.c index 86a60b1fe1..e722889089 100644 --- a/src/mod/codecs/mod_g722/mod_g722.c +++ b/src/mod/codecs/mod_g722/mod_g722.c @@ -33,7 +33,8 @@ #include #include "g7xx/g722.h" -static const char modname[] = "mod_g722"; +SWITCH_MODULE_LOAD_FUNCTION(mod_g722_load); +SWITCH_MODULE_DEFINITION(mod_g722, mod_g722_load, NULL, NULL); struct g722_context { g722_decode_state_t decoder_object; @@ -172,7 +173,7 @@ static switch_loadable_module_interface_t g722_module_interface = { /*.application_interface */ NULL }; -SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename) +SWITCH_MODULE_LOAD_FUNCTION(mod_g722_load) { /* connect my internal structure to the blank pointer passed to me */ *module_interface = &g722_module_interface; diff --git a/src/mod/codecs/mod_g723_1/mod_g723_1.c b/src/mod/codecs/mod_g723_1/mod_g723_1.c index 8a7bb28a6a..7b4710d650 100644 --- a/src/mod/codecs/mod_g723_1/mod_g723_1.c +++ b/src/mod/codecs/mod_g723_1/mod_g723_1.c @@ -49,7 +49,8 @@ Flag UseVx = True; enum Crate WrkRate = Rate63; #endif -static const char modname[] = "mod_g723_1"; +SWITCH_MODULE_LOAD_FUNCTION(mod_g723_1_load); +SWITCH_MODULE_DEFINITION(mod_g723_1, mod_g723_1_load, NULL, NULL); #ifndef G723_PASSTHROUGH struct g723_context { @@ -202,7 +203,7 @@ static switch_loadable_module_interface_t g723_module_interface = { /*.application_interface */ NULL }; -SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename) +SWITCH_MODULE_LOAD_FUNCTION(mod_g723_1_load) { /* connect my internal structure to the blank pointer passed to me */ *module_interface = &g723_module_interface; diff --git a/src/mod/codecs/mod_g726/mod_g726.c b/src/mod/codecs/mod_g726/mod_g726.c index f3225322f5..6525ca14de 100644 --- a/src/mod/codecs/mod_g726/mod_g726.c +++ b/src/mod/codecs/mod_g726/mod_g726.c @@ -33,7 +33,8 @@ #include "g72x.h" #include "switch_bitpack.h" -static const char modname[] = "mod_g726"; +SWITCH_MODULE_LOAD_FUNCTION(mod_g726_load); +SWITCH_MODULE_DEFINITION(mod_g726, mod_g726_load, NULL, NULL); typedef int (*encoder_t) (int, int, g726_state *); typedef int (*decoder_t) (int, int, g726_state *); @@ -427,7 +428,7 @@ static switch_loadable_module_interface_t g726_module_interface = { /*.application_interface */ NULL }; -SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename) +SWITCH_MODULE_LOAD_FUNCTION(mod_g726_load) { /* connect my internal structure to the blank pointer passed to me */ *module_interface = &g726_module_interface; diff --git a/src/mod/codecs/mod_g729/mod_g729.c b/src/mod/codecs/mod_g729/mod_g729.c index 555261891b..c4d07b6ccd 100644 --- a/src/mod/codecs/mod_g729/mod_g729.c +++ b/src/mod/codecs/mod_g729/mod_g729.c @@ -31,11 +31,11 @@ * mod_g729.c -- G729 Codec Module * */ - -static const char modname[] = "mod_g729"; - #include "switch.h" +SWITCH_MODULE_LOAD_FUNCTION(mod_g729_load); +SWITCH_MODULE_DEFINITION(mod_g729, mod_g729_load, NULL, NULL); + #ifndef G729_PASSTHROUGH #include "g729/g729.h" @@ -310,7 +310,7 @@ static switch_loadable_module_interface_t g729_module_interface = { /*.application_interface */ NULL }; -SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename) +SWITCH_MODULE_LOAD_FUNCTION(mod_g729_load) { /* connect my internal structure to the blank pointer passed to me */ *module_interface = &g729_module_interface; diff --git a/src/mod/codecs/mod_gsm/mod_gsm.c b/src/mod/codecs/mod_gsm/mod_gsm.c index bc73aa0dac..0dbb545b86 100644 --- a/src/mod/codecs/mod_gsm/mod_gsm.c +++ b/src/mod/codecs/mod_gsm/mod_gsm.c @@ -31,7 +31,10 @@ */ #include "switch.h" #include "gsm.h" -static const char modname[] = "mod_gsm"; + +SWITCH_MODULE_LOAD_FUNCTION(mod_gsm_load); +SWITCH_MODULE_DEFINITION(mod_gsm, mod_gsm_load, NULL, NULL); + struct gsm_context { gsm encoder; gsm decoder; @@ -162,7 +165,8 @@ static switch_loadable_module_interface_t gsm_module_interface = { /*.codec_interface */ &gsm_codec_interface, /*.application_interface */ NULL }; -SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename) + +SWITCH_MODULE_LOAD_FUNCTION(mod_gsm_load) { /* connect my internal structure to the blank pointer passed to me */ diff --git a/src/mod/codecs/mod_h26x/mod_h26x.c b/src/mod/codecs/mod_h26x/mod_h26x.c index c18420db78..c12e0db818 100644 --- a/src/mod/codecs/mod_h26x/mod_h26x.c +++ b/src/mod/codecs/mod_h26x/mod_h26x.c @@ -31,8 +31,8 @@ */ #include -static const char modname[] = "mod_h26x"; - +SWITCH_MODULE_LOAD_FUNCTION(mod_h26x_load); +SWITCH_MODULE_DEFINITION(mod_h26x, mod_h26x_load, NULL, NULL); static switch_status_t switch_h26x_init(switch_codec_t *codec, switch_codec_flag_t flags, const switch_codec_settings_t *codec_settings) { @@ -132,8 +132,7 @@ static switch_loadable_module_interface_t h26x_module_interface = { /*.api_interface */ NULL, }; - -SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename) +SWITCH_MODULE_LOAD_FUNCTION(mod_h26x_load) { /* connect my internal structure to the blank pointer passed to me */ *module_interface = &h26x_module_interface; diff --git a/src/mod/codecs/mod_ilbc/mod_ilbc.c b/src/mod/codecs/mod_ilbc/mod_ilbc.c index 1cc15c3ee1..a1a6cbde0a 100644 --- a/src/mod/codecs/mod_ilbc/mod_ilbc.c +++ b/src/mod/codecs/mod_ilbc/mod_ilbc.c @@ -34,7 +34,8 @@ #include "iLBC_decode.h" #include "iLBC_define.h" -static const char modname[] = "mod_ilbc"; +SWITCH_MODULE_LOAD_FUNCTION(mod_ilbc_load); +SWITCH_MODULE_DEFINITION(mod_ilbc, mod_ilbc_load, NULL, NULL); struct ilbc_context { iLBC_Enc_Inst_t encoder; @@ -314,9 +315,7 @@ static switch_loadable_module_interface_t ilbc_module_interface = { /*.application_interface */ NULL }; - - -SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename) +SWITCH_MODULE_LOAD_FUNCTION(mod_ilbc_load) { /* connect my internal structure to the blank pointer passed to me */ diff --git a/src/mod/codecs/mod_l16/mod_l16.c b/src/mod/codecs/mod_l16/mod_l16.c index 9e84129686..92b5e2fde1 100644 --- a/src/mod/codecs/mod_l16/mod_l16.c +++ b/src/mod/codecs/mod_l16/mod_l16.c @@ -31,8 +31,8 @@ */ #include -static const char modname[] = "mod_l16"; - +SWITCH_MODULE_LOAD_FUNCTION(mod_l16_load); +SWITCH_MODULE_DEFINITION(mod_l16, mod_l16_load, NULL, NULL); static switch_status_t switch_raw_init(switch_codec_t *codec, switch_codec_flag_t flags, const switch_codec_settings_t *codec_settings) { @@ -424,7 +424,7 @@ static switch_loadable_module_interface_t raw_module_interface = { }; -SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename) +SWITCH_MODULE_LOAD_FUNCTION(mod_l16_load) { /* connect my internal structure to the blank pointer passed to me */ *module_interface = &raw_module_interface; diff --git a/src/mod/codecs/mod_speex/mod_speex.c b/src/mod/codecs/mod_speex/mod_speex.c index d4b46874fb..60db8f5604 100644 --- a/src/mod/codecs/mod_speex/mod_speex.c +++ b/src/mod/codecs/mod_speex/mod_speex.c @@ -33,7 +33,8 @@ #include #include -static const char modname[] = "mod_speex"; +SWITCH_MODULE_LOAD_FUNCTION(mod_speex_load); +SWITCH_MODULE_DEFINITION(mod_speex, mod_speex_load, NULL, NULL); static const switch_codec_settings_t default_codec_settings = { /*.quality */ 5, @@ -403,7 +404,7 @@ static switch_loadable_module_interface_t speex_module_interface = { /*.application_interface */ NULL }; -SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename) +SWITCH_MODULE_LOAD_FUNCTION(mod_speex_load) { /* connect my internal structure to the blank pointer passed to me */ *module_interface = &speex_module_interface; diff --git a/src/mod/dialplans/mod_dialplan_directory/mod_dialplan_directory.c b/src/mod/dialplans/mod_dialplan_directory/mod_dialplan_directory.c index 46bf7225f9..03ea8054cc 100644 --- a/src/mod/dialplans/mod_dialplan_directory/mod_dialplan_directory.c +++ b/src/mod/dialplans/mod_dialplan_directory/mod_dialplan_directory.c @@ -34,8 +34,8 @@ #include #include - -static const char modname[] = "mod_dialplan_directory"; +SWITCH_MODULE_LOAD_FUNCTION(mod_dialplan_directory_load); +SWITCH_MODULE_DEFINITION(mod_dialplan_directory, mod_dialplan_directory_load, NULL, NULL); static struct { char *directory_name; @@ -166,7 +166,7 @@ static const switch_loadable_module_interface_t directory_dialplan_module_interf /*.application_interface = */ NULL }; -SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename) +SWITCH_MODULE_LOAD_FUNCTION(mod_dialplan_directory_load) { load_config(); diff --git a/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c b/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c index c0b6c4c875..3683e05110 100644 --- a/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c +++ b/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c @@ -34,7 +34,8 @@ #include #include -static const char modname[] = "mod_dialplan_xml"; +SWITCH_MODULE_LOAD_FUNCTION(mod_dialplan_xml_load); +SWITCH_MODULE_DEFINITION(mod_dialplan_xml, mod_dialplan_xml_load, NULL, NULL); typedef enum { BREAK_ON_TRUE, @@ -392,7 +393,7 @@ static const switch_loadable_module_interface_t dialplan_module_interface = { /*.application_interface = */ NULL }; -SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename) +SWITCH_MODULE_LOAD_FUNCTION(mod_dialplan_xml_load) { /* connect my internal structure to the blank pointer passed to me */ diff --git a/src/mod/directories/mod_ldap/mod_ldap.c b/src/mod/directories/mod_ldap/mod_ldap.c index 9bef0254ca..eb5f26e600 100644 --- a/src/mod/directories/mod_ldap/mod_ldap.c +++ b/src/mod/directories/mod_ldap/mod_ldap.c @@ -40,7 +40,8 @@ #include #endif -static const char modname[] = "mod_ldap"; +SWITCH_MODULE_LOAD_FUNCTION(mod_ldap_load); +SWITCH_MODULE_DEFINITION(mod_ldap, mod_ldap_load, NULL, NULL); struct ldap_context { LDAP *ld; @@ -207,7 +208,7 @@ static const switch_directory_interface_t ldap_directory_interface = { }; -static switch_loadable_module_interface_t skel_module_interface = { +static switch_loadable_module_interface_t ldap_module_interface = { /*.module_name */ modname, /*.endpoint_interface */ NULL, /*.timer_interface */ NULL, @@ -220,10 +221,10 @@ static switch_loadable_module_interface_t skel_module_interface = { /*.directory_interface */ &ldap_directory_interface }; -switch_status_t switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename) +SWITCH_MODULE_LOAD_FUNCTION(mod_ldap_load) { /* connect my internal structure to the blank pointer passed to me */ - *module_interface = &skel_module_interface; + *module_interface = &ldap_module_interface; /* indicate that the module should continue to be loaded */ return SWITCH_STATUS_SUCCESS; diff --git a/src/mod/endpoints/mod_dingaling/mod_dingaling.c b/src/mod/endpoints/mod_dingaling/mod_dingaling.c index ceb9d2689f..588440dec8 100644 --- a/src/mod/endpoints/mod_dingaling/mod_dingaling.c +++ b/src/mod/endpoints/mod_dingaling/mod_dingaling.c @@ -43,7 +43,9 @@ #define DL_EVENT_CONNECTED "dingaling::connected" #define MDL_CHAT_PROTO "jingle" -static const char modname[] = "mod_dingaling"; +SWITCH_MODULE_LOAD_FUNCTION(mod_dingaling_load); +SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_dingaling_shutdown); +SWITCH_MODULE_DEFINITION(mod_dingaling, mod_dingaling_load, mod_dingaling_shutdown, NULL); static switch_memory_pool_t *module_pool = NULL; @@ -1824,7 +1826,7 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi } -SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename) +SWITCH_MODULE_LOAD_FUNCTION(mod_dingaling_load) { if (switch_core_new_memory_pool(&module_pool) != SWITCH_STATUS_SUCCESS) { @@ -1927,8 +1929,7 @@ static switch_status_t init_profile(mdl_profile_t *profile, uint8_t login) return SWITCH_STATUS_SUCCESS; } - -SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void) +SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_dingaling_shutdown) { sign_off(); diff --git a/src/mod/endpoints/mod_portaudio/mod_portaudio.c b/src/mod/endpoints/mod_portaudio/mod_portaudio.c index a639f59b1a..8605cf8f8b 100644 --- a/src/mod/endpoints/mod_portaudio/mod_portaudio.c +++ b/src/mod/endpoints/mod_portaudio/mod_portaudio.c @@ -39,7 +39,9 @@ #define MY_EVENT_RINGING "portaudio::ringing" -static const char modname[] = "mod_portaudio"; +SWITCH_MODULE_LOAD_FUNCTION(mod_portaudio_load); +SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_portaudio_shutdown); +SWITCH_MODULE_DEFINITION(mod_portaudio, mod_portaudio_load, mod_portaudio_shutdown, NULL); static switch_memory_pool_t *module_pool = NULL; //static int running = 1; @@ -872,7 +874,7 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi } -SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename) +SWITCH_MODULE_LOAD_FUNCTION(mod_portaudio_load) { switch_status_t status; @@ -1039,7 +1041,7 @@ static switch_status_t load_config(void) return status; } -SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void) +SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_portaudio_shutdown) { if (globals.read_codec.implementation) { switch_core_codec_destroy(&globals.read_codec); diff --git a/src/mod/endpoints/mod_woomera/mod_woomera.c b/src/mod/endpoints/mod_woomera/mod_woomera.c index d8582b25d2..6b40761080 100644 --- a/src/mod/endpoints/mod_woomera/mod_woomera.c +++ b/src/mod/endpoints/mod_woomera/mod_woomera.c @@ -48,7 +48,10 @@ //#define MEDIA_ANSWER "ANSWER" //#define USE_ANSWER 1 -static const char modname[] = "mod_woomera"; +SWITCH_MODULE_LOAD_FUNCTION(mod_woomera_load); +SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_woomera_shutdown); +SWITCH_MODULE_RUNTIME_FUNCTION(mod_woomera_runtime); +SWITCH_MODULE_DEFINITION(mod_woomera, mod_woomera_load, mod_woomera_shutdown, mod_woomera_runtime); static switch_memory_pool_t *module_pool = NULL; @@ -1269,7 +1272,7 @@ static void *woomera_thread_run(void *obj) return NULL; } -SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void) +SWITCH_MODULE_RUNTIME_FUNCTION(mod_woomera_runtime) { woomera_thread_run(&default_profile); @@ -1277,7 +1280,7 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void) return SWITCH_STATUS_TERM; } -SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void) +SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_woomera_shutdown) { int x = 0; woomera_profile_thread_running(&default_profile, 1, 0); @@ -1291,7 +1294,7 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void) return SWITCH_STATUS_SUCCESS; } -SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename) +SWITCH_MODULE_LOAD_FUNCTION(mod_woomera_load) { struct woomera_profile *profile = &default_profile; diff --git a/src/mod/event_handlers/mod_cdr/mod_cdr.cpp b/src/mod/event_handlers/mod_cdr/mod_cdr.cpp index f96f7289a5..0761e5a343 100644 --- a/src/mod/event_handlers/mod_cdr/mod_cdr.cpp +++ b/src/mod/event_handlers/mod_cdr/mod_cdr.cpp @@ -40,7 +40,11 @@ #include #include -static const char modname[] = "mod_cdr - CDR Engine"; +SWITCH_MODULE_LOAD_FUNCTION(mod_cdr_load); +SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_cdr_shutdown); +SWITCH_MODULE_RUNTIME_FUNCTION(mod_cdr_runtime); +SWITCH_MODULE_DEFINITION(mod_cdr, mod_cdr_load, mod_cdr_shutdown, mod_cdr_runtime); + static int RUNNING = 0; static CDRContainer *newcdrcontainer; static switch_memory_pool_t *module_pool; @@ -122,10 +126,10 @@ static switch_status_t my_on_hangup(switch_core_session_t *session) return SWITCH_STATUS_SUCCESS; } -SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface **interface, char *filename) +SWITCH_MODULE_LOAD_FUNCTION(mod_cdr_load) { /* connect my internal structure to the blank pointer passed to me */ - *interface = &cdr_module_interface; + *module_interface = &cdr_module_interface; switch_core_add_state_handler(&state_handlers); @@ -142,7 +146,7 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_mod return SWITCH_STATUS_SUCCESS; } -SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void) +SWITCH_MODULE_RUNTIME_FUNCTION(mod_cdr_runtime) { RUNNING = 1; switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "mod_cdr made it to runtime. Wee!\n"); @@ -196,7 +200,7 @@ SWITCH_STANDARD_API(modcdr_show_available) return SWITCH_STATUS_SUCCESS; } -SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void) +SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_cdr_shutdown) { delete newcdrcontainer; switch_thread_rwlock_destroy(cdr_rwlock); diff --git a/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c b/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c index 50a0616e51..7fce2a0a86 100644 --- a/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c +++ b/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c @@ -32,7 +32,10 @@ #include static char *MARKER = "1"; -static const char modname[] = "mod_event_multicast"; +SWITCH_MODULE_LOAD_FUNCTION(mod_event_multicast_load); +SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_event_multicast_shutdown); +SWITCH_MODULE_RUNTIME_FUNCTION(mod_event_multicast_runtime); +SWITCH_MODULE_DEFINITION(mod_event_multicast, mod_event_multicast_load, mod_event_multicast_shutdown, mod_event_multicast_runtime); static switch_memory_pool_t *module_pool = NULL; @@ -183,7 +186,7 @@ static switch_loadable_module_interface_t event_test_module_interface = { }; -SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename) +SWITCH_MODULE_LOAD_FUNCTION(mod_event_multicast_load) { memset(&globals, 0, sizeof(globals)); @@ -246,7 +249,7 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_mod } -SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void) +SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_event_multicast_shutdown) { int x = 0; @@ -259,8 +262,7 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void) return SWITCH_STATUS_SUCCESS; } - -SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void) +SWITCH_MODULE_RUNTIME_FUNCTION(mod_event_multicast_runtime) { switch_event_t *local_event; char buf[65536] = { 0 }; diff --git a/src/mod/event_handlers/mod_event_socket/mod_event_socket.c b/src/mod/event_handlers/mod_event_socket/mod_event_socket.c index 8149ec62f4..7131d3f293 100644 --- a/src/mod/event_handlers/mod_event_socket/mod_event_socket.c +++ b/src/mod/event_handlers/mod_event_socket/mod_event_socket.c @@ -32,7 +32,11 @@ #include #define CMD_BUFLEN 1024 * 1000 -static const char modname[] = "mod_event_socket"; +SWITCH_MODULE_LOAD_FUNCTION(mod_event_socket_load); +SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_event_socket_shutdown); +SWITCH_MODULE_RUNTIME_FUNCTION(mod_event_socket_runtime); +SWITCH_MODULE_DEFINITION(mod_event_socket, mod_event_socket_load, mod_event_socket_shutdown, mod_event_socket_runtime); + static char *MARKER = "1"; typedef enum { @@ -280,7 +284,7 @@ static void close_socket(switch_socket_t ** sock) switch_mutex_unlock(listen_list.sock_mutex); } -SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void) +SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_event_socket_shutdown) { listener_t *l; @@ -300,8 +304,7 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void) } - -SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename) +SWITCH_MODULE_LOAD_FUNCTION(mod_event_socket_load) { /* connect my internal structure to the blank pointer passed to me */ *module_interface = &event_socket_module_interface; @@ -1188,7 +1191,7 @@ static int config(void) } -SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void) +SWITCH_MODULE_RUNTIME_FUNCTION(mod_event_socket_runtime) { switch_memory_pool_t *pool = NULL, *listener_pool = NULL; switch_status_t rv; diff --git a/src/mod/event_handlers/mod_event_test/mod_event_test.c b/src/mod/event_handlers/mod_event_test/mod_event_test.c index d5d1524393..98b502d060 100644 --- a/src/mod/event_handlers/mod_event_test/mod_event_test.c +++ b/src/mod/event_handlers/mod_event_test/mod_event_test.c @@ -31,7 +31,8 @@ */ #include -static const char modname[] = "mod_event_test"; +SWITCH_MODULE_LOAD_FUNCTION(mod_event_test_load); +SWITCH_MODULE_DEFINITION(mod_event_test, mod_event_test_load, NULL, NULL); //#define TORTURE_ME @@ -124,8 +125,7 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void) } #endif - -SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename) +SWITCH_MODULE_LOAD_FUNCTION(mod_event_test_load) { /* connect my internal structure to the blank pointer passed to me */ *module_interface = &event_test_module_interface; diff --git a/src/mod/event_handlers/mod_xmpp_event/mod_xmpp_event.c b/src/mod/event_handlers/mod_xmpp_event/mod_xmpp_event.c index 460fa7f7ac..b83d56b698 100644 --- a/src/mod/event_handlers/mod_xmpp_event/mod_xmpp_event.c +++ b/src/mod/event_handlers/mod_xmpp_event/mod_xmpp_event.c @@ -32,7 +32,10 @@ #include #include -static const char modname[] = "mod_xmpp_event"; +SWITCH_MODULE_LOAD_FUNCTION(mod_xmpp_event_load); +SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_xmpp_event_shutdown); +SWITCH_MODULE_RUNTIME_FUNCTION(mod_xmpp_event_runtime); +SWITCH_MODULE_DEFINITION(mod_xmpp_event, mod_xmpp_event_load, mod_xmpp_event_shutdown, mod_xmpp_event_runtime); static int RUNNING = 0; static iksfilter *my_filter; @@ -397,7 +400,7 @@ static switch_loadable_module_interface_t xmpp_event_module_interface = { /*.application_interface */ NULL }; -SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename) +SWITCH_MODULE_LOAD_FUNCTION(mod_xmpp_event_load) { /* connect my internal structure to the blank pointer passed to me */ *module_interface = &xmpp_event_module_interface; @@ -411,7 +414,7 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_mod } -SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void) +SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_xmpp_event_shutdown) { if (RUNNING) { @@ -424,7 +427,7 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void) return SWITCH_STATUS_SUCCESS; } -SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void) +SWITCH_MODULE_RUNTIME_FUNCTION(mod_xmpp_event_runtime) { RUNNING = 1; xmpp_connect(globals.jid, globals.passwd); diff --git a/src/mod/event_handlers/mod_zeroconf/mod_zeroconf.c b/src/mod/event_handlers/mod_zeroconf/mod_zeroconf.c index 99b19836ce..3f12329f8e 100644 --- a/src/mod/event_handlers/mod_zeroconf/mod_zeroconf.c +++ b/src/mod/event_handlers/mod_zeroconf/mod_zeroconf.c @@ -35,7 +35,10 @@ #endif #include -static const char modname[] = "mod_zeroconf"; +SWITCH_MODULE_LOAD_FUNCTION(mod_zeroconf_load); +SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_zeroconf_shutdown); +SWITCH_MODULE_RUNTIME_FUNCTION(mod_zeroconf_runtime); +SWITCH_MODULE_DEFINITION(mod_zeroconf, mod_zeroconf_load, mod_zeroconf_shutdown, mod_zeroconf_runtime); static switch_memory_pool_t *module_pool = NULL; @@ -249,7 +252,7 @@ static switch_loadable_module_interface_t zeroconf_module_interface = { static int RUNNING = 0; -SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void) +SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_zeroconf_shutdown) { if (RUNNING == 1) { RUNNING = -1; @@ -258,8 +261,7 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void) return SWITCH_STATUS_SUCCESS; } - -SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename) +SWITCH_MODULE_LOAD_FUNCTION(mod_zeroconf_load) { memset(&globals, 0, sizeof(globals)); @@ -298,7 +300,7 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_mod } -SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void) +SWITCH_MODULE_RUNTIME_FUNCTION(mod_zeroconf_runtime) { RUNNING = 1; diff --git a/src/mod/formats/mod_native_file/mod_native_file.c b/src/mod/formats/mod_native_file/mod_native_file.c index c33b0872ce..b48e013e67 100644 --- a/src/mod/formats/mod_native_file/mod_native_file.c +++ b/src/mod/formats/mod_native_file/mod_native_file.c @@ -31,7 +31,8 @@ */ #include -static const char modname[] = "mod_native_file"; +SWITCH_MODULE_LOAD_FUNCTION(mod_native_file_load); +SWITCH_MODULE_DEFINITION(mod_native_file, mod_native_file_load, NULL, NULL); struct native_file_context { switch_file_t *fd; @@ -163,7 +164,7 @@ static switch_loadable_module_interface_t native_file_module_interface = { -SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename) +SWITCH_MODULE_LOAD_FUNCTION(mod_native_file_load) { const switch_codec_implementation_t *codecs[SWITCH_MAX_CODECS]; diff --git a/src/mod/formats/mod_sndfile/mod_sndfile.c b/src/mod/formats/mod_sndfile/mod_sndfile.c index a453b0dcdd..52978985e2 100644 --- a/src/mod/formats/mod_sndfile/mod_sndfile.c +++ b/src/mod/formats/mod_sndfile/mod_sndfile.c @@ -32,7 +32,8 @@ #include #include -static const char modname[] = "mod_sndfile"; +SWITCH_MODULE_LOAD_FUNCTION(mod_sndfile_load); +SWITCH_MODULE_DEFINITION(mod_sndfile, mod_sndfile_load, NULL, NULL); static switch_memory_pool_t *module_pool = NULL; @@ -361,7 +362,7 @@ static switch_status_t setup_formats(void) return SWITCH_STATUS_SUCCESS; } -SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename) +SWITCH_MODULE_LOAD_FUNCTION(mod_sndfile_load) { if (switch_core_new_memory_pool(&module_pool) != SWITCH_STATUS_SUCCESS) { diff --git a/src/mod/languages/mod_perl/mod_perl.c b/src/mod/languages/mod_perl/mod_perl.c index d54d50d6f5..34a5d0a9f8 100644 --- a/src/mod/languages/mod_perl/mod_perl.c +++ b/src/mod/languages/mod_perl/mod_perl.c @@ -43,7 +43,9 @@ static char *embedding[] = { "", "-e", "" }; EXTERN_C void xs_init(pTHX); -static const char modname[] = "mod_perl"; +SWITCH_MODULE_LOAD_FUNCTION(mod_perl_load); +SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_perl_shutdown); +SWITCH_MODULE_DEFINITION(mod_perl, mod_perl_load, mod_perl_shutdown, NULL); static struct { PerlInterpreter *my_perl; @@ -100,7 +102,7 @@ static switch_loadable_module_interface_t perl_module_interface = { }; -SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void) +SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_perl_shutdown) { if (globals.my_perl) { perl_destruct(globals.my_perl); @@ -111,7 +113,7 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void) return SWITCH_STATUS_SUCCESS; } -SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename) +SWITCH_MODULE_LOAD_FUNCTION(mod_perl_load) { PerlInterpreter *my_perl; diff --git a/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c b/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c index ec27254ccd..efc8abbfd1 100644 --- a/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c +++ b/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c @@ -38,8 +38,9 @@ #include #endif -static const char modname[] = "mod_spidermonkey"; - +SWITCH_MODULE_LOAD_FUNCTION(mod_spidermonkey_load); +SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_spidermonkey_shutdown); +SWITCH_MODULE_DEFINITION(mod_spidermonkey, mod_spidermonkey_load, mod_spidermonkey_shutdown, NULL); static void session_destroy(JSContext * cx, JSObject * obj); static JSBool session_construct(JSContext * cx, JSObject * obj, uintN argc, jsval * argv, jsval * rval); @@ -3046,7 +3047,7 @@ static void message_query_handler(switch_event_t *event) } -SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename) +SWITCH_MODULE_LOAD_FUNCTION(mod_spidermonkey_load) { switch_status_t status; @@ -3069,7 +3070,7 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_mod return SWITCH_STATUS_SUCCESS; } -SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void) +SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_spidermonkey_shutdown) { curl_global_cleanup(); return SWITCH_STATUS_SUCCESS; diff --git a/src/mod/loggers/mod_console/mod_console.c b/src/mod/loggers/mod_console/mod_console.c index 0969cb527c..0b69aec025 100644 --- a/src/mod/loggers/mod_console/mod_console.c +++ b/src/mod/loggers/mod_console/mod_console.c @@ -31,7 +31,9 @@ */ #include -static const char modname[] = "mod_console"; +SWITCH_MODULE_LOAD_FUNCTION(mod_console_load); +SWITCH_MODULE_DEFINITION(mod_console, mod_console_load, NULL, NULL); + static const uint8_t STATIC_LEVELS[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; static int COLORIZE = 0; #ifdef WIN32 @@ -188,7 +190,7 @@ static switch_status_t switch_console_logger(const switch_log_node_t *node, swit return SWITCH_STATUS_SUCCESS; } -SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename) +SWITCH_MODULE_LOAD_FUNCTION(mod_console_load) { if (switch_core_new_memory_pool(&module_pool) != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "OH OH no pool\n"); diff --git a/src/mod/say/mod_say_en/mod_say_en.c b/src/mod/say/mod_say_en/mod_say_en.c index 52d8950122..0a08fde3e3 100644 --- a/src/mod/say/mod_say_en/mod_say_en.c +++ b/src/mod/say/mod_say_en/mod_say_en.c @@ -33,8 +33,8 @@ #include #include -static const char modname[] = "mod_say_en"; - +SWITCH_MODULE_LOAD_FUNCTION(mod_say_en_load); +SWITCH_MODULE_DEFINITION(mod_say_en, mod_say_en_load, NULL, NULL); #define say_num(num, t) { \ char tmp[80];\ @@ -537,7 +537,7 @@ static switch_loadable_module_interface_t say_en_module_interface = { /*.asr_interface */ NULL }; -SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename) +SWITCH_MODULE_LOAD_FUNCTION(mod_say_en_load) { /* connect my internal structure to the blank pointer passed to me */ *module_interface = &say_en_module_interface; diff --git a/src/mod/timers/mod_softtimer/mod_softtimer.c b/src/mod/timers/mod_softtimer/mod_softtimer.c index cc305d8c98..b26060685e 100644 --- a/src/mod/timers/mod_softtimer/mod_softtimer.c +++ b/src/mod/timers/mod_softtimer/mod_softtimer.c @@ -46,7 +46,11 @@ static struct { switch_mutex_t *mutex; } globals; -static const char modname[] = "mod_softtimer"; +SWITCH_MODULE_LOAD_FUNCTION(mod_softtimer_load); +SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_softtimer_shutdown); +SWITCH_MODULE_RUNTIME_FUNCTION(mod_softtimer_runtime); +SWITCH_MODULE_DEFINITION(mod_softtimer, mod_softtimer_load, mod_softtimer_shutdown, mod_softtimer_runtime); + #define MAX_ELEMENTS 1000 struct timer_private { @@ -191,13 +195,13 @@ static const switch_timer_interface_t timer_interface = { /*.timer_destroy */ timer_destroy }; -static const switch_loadable_module_interface_t mod_softtimer_module_interface = { +static const switch_loadable_module_interface_t softtimer_module_interface = { /*.module_name */ modname, /*.endpoint_interface */ NULL, /*.timer_interface */ &timer_interface }; -SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename) +SWITCH_MODULE_LOAD_FUNCTION(mod_softtimer_load) { if (switch_core_new_memory_pool(&module_pool) != SWITCH_STATUS_SUCCESS) { @@ -206,7 +210,7 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_mod } /* connect my internal structure to the blank pointer passed to me */ - *module_interface = &mod_softtimer_module_interface; + *module_interface = &softtimer_module_interface; /* indicate that the module should continue to be loaded */ return SWITCH_STATUS_SUCCESS; @@ -218,7 +222,8 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_mod #define STEP_MS 1 #define STEP_MIC 1000 -SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void) + +SWITCH_MODULE_RUNTIME_FUNCTION(mod_softtimer_runtime) { switch_time_t reference = switch_time_now(); uint32_t current_ms = 0; @@ -267,8 +272,7 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void) return SWITCH_STATUS_TERM; } - -SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void) +SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_softtimer_shutdown) { if (globals.RUNNING) { diff --git a/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c b/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c index 03643274a1..db25bff078 100644 --- a/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c +++ b/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c @@ -32,7 +32,8 @@ #include #include -static const char modname[] = "mod_xml_cdr"; +SWITCH_MODULE_LOAD_FUNCTION(mod_xml_cdr_load); +SWITCH_MODULE_DEFINITION(mod_xml_cdr, mod_xml_cdr_load, NULL, NULL); static switch_status_t my_on_hangup(switch_core_session_t *session) { @@ -91,7 +92,7 @@ static const switch_state_handler_table_t state_handlers = { }; -static const switch_loadable_module_interface_t mod_xml_cdr_module_interface = { +static const switch_loadable_module_interface_t xml_cdr_module_interface = { /*.module_name = */ modname, /*.endpoint_interface = */ NULL, /*.timer_interface = */ NULL, @@ -100,12 +101,12 @@ static const switch_loadable_module_interface_t mod_xml_cdr_module_interface = { /*.application_interface */ NULL }; -SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename) +SWITCH_MODULE_LOAD_FUNCTION(mod_xml_cdr_load) { /* test global state handlers */ switch_core_add_state_handler(&state_handlers); - *module_interface = &mod_xml_cdr_module_interface; + *module_interface = &xml_cdr_module_interface; /* indicate that the module should continue to be loaded */ return SWITCH_STATUS_SUCCESS; diff --git a/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c b/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c index 0a1fd9f2d7..9d44400e01 100644 --- a/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c +++ b/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c @@ -31,7 +31,9 @@ #include #include -static const char modname[] = "mod_xml_curl"; +SWITCH_MODULE_LOAD_FUNCTION(mod_xml_curl_load); +SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_xml_curl_shutdown); +SWITCH_MODULE_DEFINITION(mod_xml_curl, mod_xml_curl_load, mod_xml_curl_shutdown, NULL); struct xml_binding { char *url; @@ -229,7 +231,7 @@ static switch_status_t do_config(void) } -SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename) +SWITCH_MODULE_LOAD_FUNCTION(mod_xml_curl_load) { /* connect my internal structure to the blank pointer passed to me */ *module_interface = &xml_curl_module_interface; @@ -244,7 +246,7 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_mod return SWITCH_STATUS_SUCCESS; } -SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void) +SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_xml_curl_shutdown) { curl_global_cleanup(); return SWITCH_STATUS_SUCCESS; diff --git a/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c b/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c index e2ebb81a45..9861774454 100644 --- a/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c +++ b/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c @@ -42,7 +42,10 @@ #include #include -static const char modname[] = "mod_xml_rpc"; +SWITCH_MODULE_LOAD_FUNCTION(mod_xml_rpc_load); +SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_xml_rpc_shutdown); +SWITCH_MODULE_RUNTIME_FUNCTION(mod_xml_rpc_runtime); +SWITCH_MODULE_DEFINITION(mod_xml_rpc, mod_xml_rpc_load, mod_xml_rpc_shutdown, mod_xml_rpc_runtime); static switch_loadable_module_interface_t xml_rpc_module_interface = { /*.module_name */ modname, @@ -112,7 +115,7 @@ SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_realm, globals.realm) } -SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename) +SWITCH_MODULE_LOAD_FUNCTION(mod_xml_rpc_load) { /* connect my internal structure to the blank pointer passed to me */ *module_interface = &xml_rpc_module_interface; @@ -357,7 +360,7 @@ static xmlrpc_value *freeswitch_man(xmlrpc_env * const envP, xmlrpc_value * cons return val; } -SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void) +SWITCH_MODULE_RUNTIME_FUNCTION(mod_xml_rpc_runtime) { TServer abyssServer; xmlrpc_registry *registryP; @@ -402,7 +405,7 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void) -SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void) +SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_xml_rpc_shutdown) { globals.running = 0; return SWITCH_STATUS_SUCCESS;