提交 ad2d74c5 authored 作者: João Mesquita's avatar João Mesquita

Make mod_qsettings not a mod... LOL

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16156 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 1dc7a3b4
...@@ -96,6 +96,8 @@ ...@@ -96,6 +96,8 @@
<load module="mod_sndfile"/> <load module="mod_sndfile"/>
<load module="mod_tone_stream"/> <load module="mod_tone_stream"/>
<load module="mod_local_stream"/> <load module="mod_local_stream"/>
<load module="mod_portaudio"/>
<load module="mod_event_socket"/>
</modules> </modules>
</configuration> </configuration>
......
...@@ -112,7 +112,7 @@ void FSHost::run(void) ...@@ -112,7 +112,7 @@ void FSHost::run(void)
/* If you need to override configuration directories, you need to change them in the SWITCH_GLOBAL_dirs global structure */ /* If you need to override configuration directories, you need to change them in the SWITCH_GLOBAL_dirs global structure */
printf("Initializing core...\n"); printf("Initializing core...\n");
/* Initialize the core and load modules, that will startup FS completely */ /* Initialize the core and load modules, that will startup FS completely */
if (switch_core_init_and_modload(flags, console, &err) != SWITCH_STATUS_SUCCESS) { if (switch_core_init(flags, console, &err) != SWITCH_STATUS_SUCCESS) {
fprintf(stderr, "Failed to initialize FreeSWITCH's core: %s\n", err); fprintf(stderr, "Failed to initialize FreeSWITCH's core: %s\n", err);
emit coreLoadingError(err); emit coreLoadingError(err);
} }
...@@ -124,13 +124,16 @@ void FSHost::run(void) ...@@ -124,13 +124,16 @@ void FSHost::run(void)
} }
/* Load our QSettings module */ /* Load our QSettings module */
if (switch_loadable_module_build_dynamic("mod_qsettings",mod_qsettings_load,NULL,mod_qsettings_shutdown,SWITCH_FALSE) != SWITCH_STATUS_SUCCESS) if (mod_qsettings_load() != SWITCH_STATUS_SUCCESS)
{ {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't load mod_qsettings\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't load mod_qsettings\n");
} }
QString res;
sendCmd("load", "mod_event_socket", &res); if (switch_core_init_and_modload(flags, console, &err) != SWITCH_STATUS_SUCCESS) {
sendCmd("load", "mod_portaudio", &res); fprintf(stderr, "Failed to initialize FreeSWITCH's core: %s\n", err);
emit coreLoadingError(err);
}
emit ready(); emit ready();
/* Go into the runtime loop. If the argument is true, this basically sets runtime.running = 1 and loops while that is set /* Go into the runtime loop. If the argument is true, this basically sets runtime.running = 1 and loops while that is set
* If its false, it initializes the libedit for the console, then does the same thing * If its false, it initializes the libedit for the console, then does the same thing
......
...@@ -35,10 +35,6 @@ ...@@ -35,10 +35,6 @@
#include <QDir> #include <QDir>
#include "mod_qsettings/mod_qsettings.h" #include "mod_qsettings/mod_qsettings.h"
static struct {
switch_memory_pool_t* pool;
} globals;
switch_xml_t XMLBinding::getConfigXML(QString tmpl) switch_xml_t XMLBinding::getConfigXML(QString tmpl)
{ {
switch_event_t *e; switch_event_t *e;
...@@ -129,30 +125,15 @@ static switch_status_t do_config(void) ...@@ -129,30 +125,15 @@ static switch_status_t do_config(void)
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
SWITCH_MODULE_LOAD_FUNCTION(mod_qsettings_load) switch_status_t mod_qsettings_load(void)
{ {
/*switch_api_interface_t *qsettings_api_interface;*/
/* connect my internal structure to the blank pointer passed to me */
*module_interface = switch_loadable_module_create_module_interface(pool, "mod_qsettings");
memset(&globals,0,sizeof(globals));
globals.pool = pool;
if (do_config() == SWITCH_STATUS_SUCCESS) { if (do_config() == SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Sucessfully configured.\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Sucessfully configured.\n");
} else { } else {
return SWITCH_STATUS_FALSE; return SWITCH_STATUS_FALSE;
} }
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "We loaded mod_qsettings.\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "We loaded mod_qsettings.\n");
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_SUCCESS;
}
SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_qsettings_shutdown)
{
switch_xml_unbind_search_function_ptr(xml_url_fetch);
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
...@@ -34,8 +34,7 @@ ...@@ -34,8 +34,7 @@
#include <QSettings> #include <QSettings>
#include <switch.h> #include <switch.h>
SWITCH_MODULE_LOAD_FUNCTION(mod_qsettings_load); switch_status_t mod_qsettings_load(void);
SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_qsettings_shutdown);
class XMLBinding class XMLBinding
{ {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论