diff --git a/src/include/switch_utils.h b/src/include/switch_utils.h index 8c1654ee2c..1b965b4a76 100644 --- a/src/include/switch_utils.h +++ b/src/include/switch_utils.h @@ -87,7 +87,20 @@ static inline switch_bool_t switch_is_moh(const char *s) } +static inline int switch_string_has_escaped_data(const char *in) +{ + const char *i = strchr(in, '\\'); + while (i && *i == '\\') { + i++; + if (*i == '\\' || *i == 'n' || *i == 's' || *i == 't') { + return 1; + } + i = strchr(i, '\\'); + } + + return 0; +} SWITCH_DECLARE(switch_status_t) switch_b64_encode(unsigned char *in, switch_size_t ilen, unsigned char *out, switch_size_t olen); SWITCH_DECLARE(switch_size_t) switch_b64_decode(char *in, char *out, switch_size_t olen); diff --git a/src/switch_channel.c b/src/switch_channel.c index 67fe38f682..aa0f03f74b 100644 --- a/src/switch_channel.c +++ b/src/switch_channel.c @@ -1916,7 +1916,7 @@ SWITCH_DECLARE(char *) switch_channel_expand_variables(switch_channel_t *channel return (char *) in; } - nv = switch_string_var_check_const(in); + nv = switch_string_var_check_const(in) || switch_string_has_escaped_data(in); if (!nv) { return (char *) in; diff --git a/src/switch_event.c b/src/switch_event.c index 40e0f5c98a..924c95b6c8 100644 --- a/src/switch_event.c +++ b/src/switch_event.c @@ -1331,7 +1331,7 @@ SWITCH_DECLARE(char *) switch_event_expand_headers(switch_event_t *event, const char *func_val = NULL; int nv = 0; - nv = switch_string_var_check_const(in); + nv = switch_string_var_check_const(in) || switch_string_has_escaped_data(in); if (!nv) { return (char *) in; diff --git a/src/switch_ivr_play_say.c b/src/switch_ivr_play_say.c index 3f9badd590..1935ea5f40 100644 --- a/src/switch_ivr_play_say.c +++ b/src/switch_ivr_play_say.c @@ -1559,6 +1559,7 @@ SWITCH_DECLARE(switch_status_t) switch_play_and_get_digits(switch_core_session_t if (switch_strlen_zero(digits_regex)) { return SWITCH_STATUS_SUCCESS; } + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Test Regex [%s][%s]\n", digit_buffer, digits_regex); if (switch_regex_match(digit_buffer, digits_regex) == SWITCH_STATUS_SUCCESS) { return SWITCH_STATUS_SUCCESS; } else { diff --git a/src/switch_utils.c b/src/switch_utils.c index 42f2e6e3c3..8ebf16e41c 100644 --- a/src/switch_utils.c +++ b/src/switch_utils.c @@ -61,7 +61,6 @@ int switch_inet_pton(int af, const char *src, void *dst) } #endif - SWITCH_DECLARE(switch_status_t) switch_frame_alloc(switch_frame_t **frame, switch_size_t size) { switch_frame_t *new_frame;