[mod_dptools] Fix handling of "exec" and "api" parsing of flags.
Without this, flags have no effect on api.
This commit is contained in:
parent
53abb53f2b
commit
1bd596000d
|
@ -185,28 +185,32 @@ static switch_status_t digit_action_callback(switch_ivr_dmachine_match_t *match)
|
||||||
switch_channel_get_name(channel), act->string, act->value);
|
switch_channel_get_name(channel), act->string, act->value);
|
||||||
|
|
||||||
if (!strncasecmp(string, "exec", 4)) {
|
if (!strncasecmp(string, "exec", 4)) {
|
||||||
char *e;
|
exec = 1;
|
||||||
|
|
||||||
string += 4;
|
string += 4;
|
||||||
if (*string == ':') {
|
if (*string == ':') {
|
||||||
string++;
|
string++;
|
||||||
exec = 1;
|
|
||||||
} else if (*string == '[') {
|
|
||||||
flags = string;
|
|
||||||
if ((e = switch_find_end_paren(flags, '[', ']'))) {
|
|
||||||
if (*++e == ':') {
|
|
||||||
flags++;
|
|
||||||
*e++ = '\0';
|
|
||||||
string = e;
|
|
||||||
exec = strchr(flags, 'i') ? 2 : 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else if (!strncasecmp(string, "api:", 4)) {
|
} else if (!strncasecmp(string, "api:", 4)) {
|
||||||
string += 4;
|
string += 4;
|
||||||
api = 1;
|
api = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (*string == '[') {
|
||||||
|
char *e;
|
||||||
|
|
||||||
|
flags = string;
|
||||||
|
if ((e = switch_find_end_paren(flags, '[', ']'))) {
|
||||||
|
if (e && *++e == ':') {
|
||||||
|
flags++;
|
||||||
|
*e++ = '\0';
|
||||||
|
string = e;
|
||||||
|
if (exec) {
|
||||||
|
exec = strchr(flags, 'i') ? 2 : 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, string, act->value);
|
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, string, act->value);
|
||||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "digits", match->match_digits);
|
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "digits", match->match_digits);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue