add lookup params to presence_map
This commit is contained in:
parent
4841670777
commit
ea7f6a1857
|
@ -3142,17 +3142,29 @@ SWITCH_DECLARE(char *) switch_ivr_check_presence_mapping(const char *exten_name,
|
|||
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) {
|
||||
|
@ -3179,6 +3191,7 @@ SWITCH_DECLARE(char *) switch_ivr_check_presence_mapping(const char *exten_name,
|
|||
}
|
||||
|
||||
end:
|
||||
switch_event_destroy(¶ms);
|
||||
|
||||
if (xml) {
|
||||
switch_xml_free(xml);
|
||||
|
|
Loading…
Reference in New Issue