mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-11-15 22:08:33 +00:00
XMLification (wave 1)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@1401 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
1 parent
d9e8100737
commit
93666f6dd7
36 files changed
+1025
-1093
No files matched your search
@@ -50,12 +50,11 @@ SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_address, globals.address)
|
||||
|
||||
static switch_status_t load_config(void)
|
||||
{
|
||||
switch_config_t cfg;
|
||||
switch_status_t status = SWITCH_STATUS_SUCCESS;
|
||||
char *var, *val;
|
||||
char *cf = "event_multicast.conf";
|
||||
switch_xml_t cfg, xml, settings, param;
|
||||
|
||||
if (!switch_config_open_file(&cfg, cf)) {
|
||||
if (!(xml = switch_xml_open_cfg(cf, &cfg))) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "open of %s failed\n", cf);
|
||||
return SWITCH_STATUS_TERM;
|
||||
}
|
||||
@@ -64,9 +63,12 @@ static switch_status_t load_config(void)
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass!");
|
||||
return SWITCH_STATUS_GENERR;
|
||||
}
|
||||
|
||||
if ((settings = switch_xml_child(cfg, "settings"))) {
|
||||
for (param = switch_xml_child(settings, "param"); param; param = param->next) {
|
||||
char *var = (char *) switch_xml_attr(param, "name");
|
||||
char *val = (char *) switch_xml_attr(param, "value");
|
||||
|
||||
while (switch_config_next_pair(&cfg, &var, &val)) {
|
||||
if (!strcasecmp(cfg.category, "settings")) {
|
||||
if (!strcasecmp(var, "address")) {
|
||||
set_global_address(val);
|
||||
} else if (!strcasecmp(var, "port")) {
|
||||
@@ -75,7 +77,7 @@ static switch_status_t load_config(void)
|
||||
}
|
||||
}
|
||||
|
||||
switch_config_close_file(&cfg);
|
||||
switch_xml_free(xml);
|
||||
|
||||
return status;
|
||||
|
||||
|
||||
@@ -97,21 +97,23 @@ SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_jid, globals.jid)
|
||||
|
||||
static switch_status_t load_config(void)
|
||||
{
|
||||
switch_config_t cfg;
|
||||
switch_status_t status = SWITCH_STATUS_FALSE;
|
||||
char *var, *val;
|
||||
char *cf = "xmpp_event.conf";
|
||||
switch_xml_t cfg, xml, settings, param;
|
||||
int count = 0;
|
||||
|
||||
memset(&globals, 0, sizeof(globals));
|
||||
|
||||
if (!switch_config_open_file(&cfg, cf)) {
|
||||
if (!(xml = switch_xml_open_cfg(cf, &cfg))) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "open of %s failed\n", cf);
|
||||
return SWITCH_STATUS_TERM;
|
||||
}
|
||||
|
||||
while (switch_config_next_pair(&cfg, &var, &val)) {
|
||||
if (!strcasecmp(cfg.category, "settings")) {
|
||||
if ((settings = switch_xml_child(cfg, "settings"))) {
|
||||
for (param = switch_xml_child(settings, "param"); param; param = param->next) {
|
||||
char *var = (char *) switch_xml_attr(param, "name");
|
||||
char *val = (char *) switch_xml_attr(param, "value");
|
||||
|
||||
if (!strcmp(var, "jid")) {
|
||||
set_global_jid(val);
|
||||
count++;
|
||||
@@ -127,7 +129,7 @@ SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_jid, globals.jid)
|
||||
}
|
||||
}
|
||||
|
||||
switch_config_close_file(&cfg);
|
||||
switch_xml_free(xml);
|
||||
|
||||
if (count == 3) {
|
||||
/* TBD use config to pick what events to bind to */
|
||||
|
||||
@@ -193,20 +193,22 @@ static void event_handler(switch_event_t *event)
|
||||
|
||||
static switch_status_t load_config(void)
|
||||
{
|
||||
switch_config_t cfg;
|
||||
switch_status_t status = SWITCH_STATUS_SUCCESS;
|
||||
char *var, *val;
|
||||
char *cf = "zeroconf.conf";
|
||||
int count = 0;
|
||||
sw_discovery_oid *oid;
|
||||
switch_xml_t cfg, xml, settings, param;
|
||||
|
||||
if (!switch_config_open_file(&cfg, cf)) {
|
||||
if (!(xml = switch_xml_open_cfg(cf, &cfg))) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "open of %s failed\n", cf);
|
||||
return SWITCH_STATUS_TERM;
|
||||
}
|
||||
|
||||
while (switch_config_next_pair(&cfg, &var, &val)) {
|
||||
if (!strcasecmp(cfg.category, "settings")) {
|
||||
if ((settings = switch_xml_child(cfg, "settings"))) {
|
||||
for (param = switch_xml_child(settings, "param"); param; param = param->next) {
|
||||
char *var = (char *) switch_xml_attr(param, "name");
|
||||
char *val = (char *) switch_xml_attr(param, "value");
|
||||
|
||||
if (!strcmp(var, "browse")) {
|
||||
if ((oid = switch_core_alloc(module_pool, sizeof(*oid))) != 0) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Bind browser to to %s\n", val);
|
||||
@@ -233,7 +235,7 @@ static switch_status_t load_config(void)
|
||||
}
|
||||
}
|
||||
|
||||
switch_config_close_file(&cfg);
|
||||
switch_xml_free(xml);
|
||||
|
||||
return status;
|
||||
|
||||
|
||||
Reference in new issue
Block a user