SWITCH_DECLARE(const char *) switch_channel_get_hold_music(switch_channel_t *channel);
SWITCH_DECLARE(const char *) switch_channel_get_hold_music_partner(switch_channel_t *channel);
+SWITCH_DECLARE(uint32_t) switch_channel_del_variable_prefix(switch_channel_t *channel, const char *prefix);
+
#define switch_channel_set_variable(_channel, _var, _val) switch_channel_set_variable_var_check(_channel, _var, _val, SWITCH_TRUE)
#define switch_channel_set_variable_partner(_channel, _var, _val) switch_channel_set_variable_partner_var_check(_channel, _var, _val, SWITCH_TRUE)
int fail = 0;
int total = 0;
+ switch_channel_del_variable_prefix(channel, "DP_REGEX_MATCH");
+
for (xregex = switch_xml_child(xcond, "regex"); xregex; xregex = xregex->next) {
time_match = switch_xml_std_datetime_check(xregex);
}
if (field && strchr(expression, '(')) {
+ char var[256];
+ switch_snprintf(var, sizeof(var), "DP_REGEX_MATCH_%d", total);
+
+ switch_channel_set_variable(channel, var, NULL);
+ switch_capture_regex(re, proceed, field_data, ovector, var, switch_regex_set_var_callback, session);
switch_safe_free(save_expression);
switch_safe_free(save_field_data);
return status;
}
+
+SWITCH_DECLARE(uint32_t) switch_channel_del_variable_prefix(switch_channel_t *channel, const char *prefix)
+{
+ switch_event_t *event;
+ switch_event_header_t *hp;
+ uint32_t r = 0;
+
+ switch_channel_get_variables(channel, &event);
+
+ if (event) {
+ for (hp = event->headers; hp; hp = hp->next) {
+ if (zstr(prefix) || !strncasecmp(hp->name, prefix, strlen(prefix))) {
+ switch_channel_set_variable(channel, hp->name, NULL);
+ }
+ }
+ }
+
+ switch_event_destroy(&event);
+
+ return r;
+}
+
SWITCH_DECLARE(switch_status_t) switch_channel_set_variable_var_check(switch_channel_t *channel,
const char *varname, const char *value, switch_bool_t var_check)
{