提交 e5b47762 authored 作者: Christopher Rienzo's avatar Christopher Rienzo

Merge pull request #1786 in FS/freeswitch from ~LAZEDO/freeswitch:feature/FS-11982 to master

* commit '88448ebf':
  FS-11982 [mod_kazoo] add expand-headers-on-fetch
...@@ -205,6 +205,7 @@ struct globals_s { ...@@ -205,6 +205,7 @@ struct globals_s {
int legacy_events; int legacy_events;
uint8_t tweaks[KZ_TWEAK_MAX]; 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) { ...@@ -203,6 +203,9 @@ switch_status_t kazoo_ei_config(switch_xml_t cfg) {
} else if (!strcmp(var, "legacy-events")) { } else if (!strcmp(var, "legacy-events")) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set legacy-events: %s\n", val); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set legacy-events: %s\n", val);
kazoo_globals.legacy_events = switch_true(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 ...@@ -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?! */ /* after all that did we get what we were after?! */
if (reply.xml_str) { if (reply.xml_str) {
/* HELL YA WE DID */ /* 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" switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Received %s XML (%s) after %dms: %s\n"
,section ,section
,reply.uuid_str ,reply.uuid_str
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论