mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-05-06 16:02:23 +00:00
fix fifo queue_manager placement
This commit is contained in:
parent
444f7924e5
commit
f0c47ede91
@ -4034,20 +4034,6 @@ static switch_status_t load_config(int reload, int del_all)
|
|||||||
globals.dbname = "fifo";
|
globals.dbname = "fifo";
|
||||||
}
|
}
|
||||||
|
|
||||||
switch_sql_queue_manager_init_name("fifo",
|
|
||||||
&globals.qm,
|
|
||||||
2,
|
|
||||||
globals.odbc_dsn ? globals.odbc_dsn : globals.dbname,
|
|
||||||
SWITCH_MAX_TRANS,
|
|
||||||
globals.pre_trans_execute,
|
|
||||||
globals.post_trans_execute,
|
|
||||||
globals.inner_pre_trans_execute,
|
|
||||||
globals.inner_post_trans_execute);
|
|
||||||
|
|
||||||
switch_sql_queue_manager_start(globals.qm);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (!(dbh = fifo_get_db_handle())) {
|
if (!(dbh = fifo_get_db_handle())) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Cannot open DB!\n");
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Cannot open DB!\n");
|
||||||
goto done;
|
goto done;
|
||||||
@ -4499,6 +4485,19 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_fifo_load)
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (globals.odbc_dsn || globals.dbname) {
|
||||||
|
switch_sql_queue_manager_init_name("fifo",
|
||||||
|
&globals.qm,
|
||||||
|
2,
|
||||||
|
globals.odbc_dsn ? globals.odbc_dsn : globals.dbname,
|
||||||
|
SWITCH_MAX_TRANS,
|
||||||
|
globals.pre_trans_execute,
|
||||||
|
globals.post_trans_execute,
|
||||||
|
globals.inner_pre_trans_execute,
|
||||||
|
globals.inner_post_trans_execute);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* connect my internal structure to the blank pointer passed to me */
|
/* connect my internal structure to the blank pointer passed to me */
|
||||||
*module_interface = switch_loadable_module_create_module_interface(pool, modname);
|
*module_interface = switch_loadable_module_create_module_interface(pool, modname);
|
||||||
SWITCH_ADD_APP(app_interface, "fifo", "Park with FIFO", FIFO_DESC, fifo_function, FIFO_USAGE, SAF_NONE);
|
SWITCH_ADD_APP(app_interface, "fifo", "Park with FIFO", FIFO_DESC, fifo_function, FIFO_USAGE, SAF_NONE);
|
||||||
@ -4529,6 +4528,8 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_fifo_shutdown)
|
|||||||
fifo_node_t *node, *this_node;
|
fifo_node_t *node, *this_node;
|
||||||
switch_mutex_t *mutex = globals.mutex;
|
switch_mutex_t *mutex = globals.mutex;
|
||||||
|
|
||||||
|
switch_sql_queue_manager_destroy(&globals.qm);
|
||||||
|
|
||||||
switch_event_unbind(&globals.node);
|
switch_event_unbind(&globals.node);
|
||||||
switch_event_free_subclass(FIFO_EVENT);
|
switch_event_free_subclass(FIFO_EVENT);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user