mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-13 09:36:46 +00:00
Merge pull request #1043 in FS/freeswitch from ~PERRO/freeswitch:feature/FS-9325 to master
* commit 'b5266ed6b44a8219be55a3f81726dbde69e8994a': FS-9325 [mod_dptools] Priority flag for faster bind_digit_action matches
This commit is contained in:
@@ -357,6 +357,7 @@ static void bind_to_session(switch_core_session_t *session,
|
||||
switch_ivr_dmachine_t *dmachine;
|
||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||
const char *terminators = NULL;
|
||||
switch_byte_t is_priority = 0;
|
||||
|
||||
if (!(dmachine = switch_core_session_get_dmachine(session, target))) {
|
||||
uint32_t digit_timeout = 1500;
|
||||
@@ -383,8 +384,27 @@ static void bind_to_session(switch_core_session_t *session,
|
||||
act->value = switch_core_session_strdup(session, arg3);
|
||||
act->target = bind_target;
|
||||
act->session = session;
|
||||
switch_ivr_dmachine_bind(dmachine, act->realm, act->input, 0, digit_action_callback, act);
|
||||
|
||||
if (!strncasecmp(act->string, "exec", 4) || !strncasecmp(act->string, "api:", 4)) {
|
||||
char *flags, *e;
|
||||
char *string = switch_core_session_strdup(session, act->string);
|
||||
|
||||
string += 4;
|
||||
if (*string == '[') {
|
||||
flags = string;
|
||||
if ((e = switch_find_end_paren(flags, '[', ']'))) {
|
||||
if (e && *(e+1) == ':') {
|
||||
flags++;
|
||||
*e = '\0';
|
||||
if (strchr(flags, 'P'))
|
||||
is_priority = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch_ivr_dmachine_bind(dmachine, act->realm, act->input, is_priority, 0, digit_action_callback, act);
|
||||
|
||||
if ((terminators = switch_channel_get_variable(channel, "bda_terminators"))) {
|
||||
switch_ivr_dmachine_set_terminators(dmachine, terminators);
|
||||
}
|
||||
|
Reference in New Issue
Block a user