Compare commits

...

2 Commits

Author SHA1 Message Date
Aron Podrigal 4431a25834
Merge 1bd596000d into 96de8fd377 2025-01-16 17:48:34 +01:00
Aron Podrigal 1bd596000d [mod_dptools] Fix handling of "exec" and "api" parsing of flags.
Without this, flags have no effect on api.
2025-01-15 14:37:18 -06:00
1 changed files with 17 additions and 13 deletions

View File

@ -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);
if (!strncasecmp(string, "exec", 4)) {
char *e;
exec = 1;
string += 4;
if (*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)) {
string += 4;
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, "digits", match->match_digits);