char *cf = "presence_map.conf";
switch_xml_t cfg, xml, x_domains, x_domain, x_exten;
char *r = NULL;
+ switch_event_t *params = NULL;
switch_regex_t *re = NULL;
int proceed = 0, ovector[100];
- if (!(xml = switch_xml_open_cfg(cf, &cfg, NULL))) {
+ switch_event_create(¶ms, SWITCH_EVENT_REQUEST_PARAMS);
+ switch_assert(params);
+
+ if ( !zstr(domain_name) ) {
+ switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "domain", domain_name);
+ }
+
+ if ( !zstr(exten_name) ) {
+ switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "exten", exten_name);
+ }
+
+ if (!(xml = switch_xml_open_cfg(cf, &cfg, params))) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Open of %s failed\n", cf);
- return NULL;
+ goto end;
}
if (!(x_domains = switch_xml_child(cfg, "domains"))) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't find any domains!\n");
- return NULL;
+ goto end;
}
for (x_domain = switch_xml_child(x_domains, "domain"); x_domain; x_domain = x_domain->next) {
}
end:
-
+ switch_event_destroy(¶ms);
+
if (xml) {
switch_xml_free(xml);
}