mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-11-15 22:08:33 +00:00
move some modules to use the new module interface macros.
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5343 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
1 parent
50fe6fbac8
commit
b67f9c5b2a
34 files changed
+161
-113
No files matched your search
@@ -40,7 +40,11 @@
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
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);
|
||||
|
||||
@@ -32,7 +32,10 @@
|
||||
#include <switch.h>
|
||||
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 };
|
||||
|
||||
@@ -32,7 +32,11 @@
|
||||
#include <switch.h>
|
||||
#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;
|
||||
|
||||
@@ -31,7 +31,8 @@
|
||||
*/
|
||||
#include <switch.h>
|
||||
|
||||
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;
|
||||
|
||||
@@ -32,7 +32,10 @@
|
||||
#include <switch.h>
|
||||
#include <iksemel.h>
|
||||
|
||||
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);
|
||||
|
||||
@@ -35,7 +35,10 @@
|
||||
#endif
|
||||
#include <howl.h>
|
||||
|
||||
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;
|
||||
|
||||
Reference in new issue
Block a user