FS-11982 [mod_kazoo] add expand-headers-on-fetch
This commit is contained in:
parent
54d957f12d
commit
88448ebfba
|
@ -205,6 +205,7 @@ struct globals_s {
|
|||
|
||||
int legacy_events;
|
||||
uint8_t tweaks[KZ_TWEAK_MAX];
|
||||
switch_bool_t expand_headers_on_fetch;
|
||||
|
||||
|
||||
};
|
||||
|
|
|
@ -203,6 +203,9 @@ switch_status_t kazoo_ei_config(switch_xml_t cfg) {
|
|||
} else if (!strcmp(var, "legacy-events")) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set legacy-events: %s\n", val);
|
||||
kazoo_globals.legacy_events = switch_true(val);
|
||||
} else if (!strcmp(var, "expand-headers-on-fetch")) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set expand-headers-on-fetch: %s\n", val);
|
||||
kazoo_globals.expand_headers_on_fetch = switch_true(val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -301,7 +301,9 @@ static switch_xml_t fetch_handler(const char *section, const char *tag_name, con
|
|||
/* after all that did we get what we were after?! */
|
||||
if (reply.xml_str) {
|
||||
/* HELL YA WE DID */
|
||||
reply.xml_str = expand_vars(reply.xml_str);
|
||||
if (kazoo_globals.expand_headers_on_fetch) {
|
||||
reply.xml_str = expand_vars(reply.xml_str);
|
||||
}
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Received %s XML (%s) after %dms: %s\n"
|
||||
,section
|
||||
,reply.uuid_str
|
||||
|
|
Loading…
Reference in New Issue