mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-28 22:24:16 +00:00
add more modules to new mod loader macros/api.
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5405 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
1 parent
ae02cbef83
commit
4e434aff7f
7 files changed
+34
-161
No files matched your search
@@ -91,22 +91,12 @@ static switch_state_handler_table_t state_handlers = {
|
||||
/*.on_transmit */ NULL
|
||||
};
|
||||
|
||||
|
||||
static switch_loadable_module_interface_t xml_cdr_module_interface = {
|
||||
/*.module_name = */ modname,
|
||||
/*.endpoint_interface = */ NULL,
|
||||
/*.timer_interface = */ NULL,
|
||||
/*.dialplan_interface = */ NULL,
|
||||
/*.codec_interface = */ NULL,
|
||||
/*.application_interface */ NULL
|
||||
};
|
||||
|
||||
SWITCH_MODULE_LOAD_FUNCTION(mod_xml_cdr_load)
|
||||
{
|
||||
/* test global state handlers */
|
||||
switch_core_add_state_handler(&state_handlers);
|
||||
|
||||
*module_interface = &xml_cdr_module_interface;
|
||||
*module_interface = switch_loadable_module_create_module_interface(pool, modname);
|
||||
|
||||
/* indicate that the module should continue to be loaded */
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
|
||||
@@ -143,20 +143,6 @@ static switch_xml_t xml_url_fetch(const char *section, const char *tag_name, con
|
||||
return xml;
|
||||
}
|
||||
|
||||
|
||||
static switch_loadable_module_interface_t xml_curl_module_interface = {
|
||||
/*.module_name */ modname,
|
||||
/*.endpoint_interface */ NULL,
|
||||
/*.timer_interface */ NULL,
|
||||
/*.dialplan_interface */ NULL,
|
||||
/*.codec_interface */ NULL,
|
||||
/*.application_interface */ NULL,
|
||||
/*.api_interface */ NULL,
|
||||
/*.file_interface */ NULL,
|
||||
/*.speech_interface */ NULL,
|
||||
/*.directory_interface */ NULL
|
||||
};
|
||||
|
||||
static switch_status_t do_config(void)
|
||||
{
|
||||
char *cf = "xml_curl.conf";
|
||||
@@ -234,7 +220,7 @@ static switch_status_t do_config(void)
|
||||
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;
|
||||
*module_interface = switch_loadable_module_create_module_interface(pool, modname);
|
||||
|
||||
if (do_config() == SWITCH_STATUS_SUCCESS) {
|
||||
curl_global_init(CURL_GLOBAL_ALL);
|
||||
|
||||
@@ -47,19 +47,6 @@ 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,
|
||||
/*.endpoint_interface */ NULL,
|
||||
/*.timer_interface */ NULL,
|
||||
/*.dialplan_interface */ NULL,
|
||||
/*.codec_interface */ NULL,
|
||||
/*.application_interface */ NULL,
|
||||
/*.api_interface */ NULL,
|
||||
/*.file_interface */ NULL,
|
||||
/*.speech_interface */ NULL,
|
||||
/*.directory_interface */ NULL
|
||||
};
|
||||
|
||||
static struct {
|
||||
uint16_t port;
|
||||
uint8_t running;
|
||||
@@ -69,10 +56,10 @@ static struct {
|
||||
} globals;
|
||||
|
||||
SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_realm, globals.realm)
|
||||
SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_user, globals.user)
|
||||
SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_pass, globals.pass)
|
||||
SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_user, globals.user)
|
||||
SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_pass, globals.pass)
|
||||
|
||||
static switch_status_t do_config(void)
|
||||
static switch_status_t do_config(void)
|
||||
{
|
||||
char *cf = "xml_rpc.conf";
|
||||
switch_xml_t cfg, xml, settings, param;
|
||||
@@ -118,7 +105,7 @@ SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_realm, globals.realm)
|
||||
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;
|
||||
*module_interface = switch_loadable_module_create_module_interface(pool, modname);
|
||||
|
||||
memset(&globals, 0, sizeof(globals));
|
||||
|
||||
|
||||
Reference in new issue
Block a user