mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-03-12 20:27:19 +00:00
Merge pull request #1040 in FS/freeswitch from ~PERRO/freeswitch:FS-9319 to master
* commit '6e8508f2a078963594129a83b15b4f919c496d61': FS-9319 [mod_dptools] Support "both" in clear_digit_action
This commit is contained in:
commit
76b990a503
@ -286,7 +286,7 @@ SWITCH_STANDARD_APP(clear_digit_action_function)
|
||||
switch_ivr_dmachine_t *dmachine;
|
||||
char *realm = NULL;
|
||||
char *target_str;
|
||||
switch_digit_action_target_t target = DIGIT_TARGET_SELF;
|
||||
switch_digit_action_target_t t, target = DIGIT_TARGET_SELF;
|
||||
|
||||
if (zstr((char *)data)) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "clear_digit_action called with no args");
|
||||
@ -300,16 +300,27 @@ SWITCH_STANDARD_APP(clear_digit_action_function)
|
||||
target = str2target(target_str);
|
||||
}
|
||||
|
||||
clear_next:
|
||||
if (target == DIGIT_TARGET_BOTH) {
|
||||
t = DIGIT_TARGET_PEER;
|
||||
} else {
|
||||
t = target;
|
||||
}
|
||||
|
||||
if ((dmachine = switch_core_session_get_dmachine(session, target))) {
|
||||
if ((dmachine = switch_core_session_get_dmachine(session, t))) {
|
||||
if (zstr(realm) || !strcasecmp(realm, "all")) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Digit parser %s: Clearing all realms\n", switch_ivr_dmachine_get_name(dmachine));
|
||||
switch_core_session_set_dmachine(session, NULL, target);
|
||||
switch_core_session_set_dmachine(session, NULL, t);
|
||||
switch_ivr_dmachine_destroy(&dmachine);
|
||||
} else {
|
||||
switch_ivr_dmachine_clear_realm(dmachine, realm);
|
||||
}
|
||||
}
|
||||
|
||||
if (target == DIGIT_TARGET_BOTH) {
|
||||
target = DIGIT_TARGET_SELF;
|
||||
goto clear_next;
|
||||
}
|
||||
}
|
||||
|
||||
#define DIGIT_ACTION_SET_REALM_USAGE "<realm>[,<target>]"
|
||||
|
Loading…
x
Reference in New Issue
Block a user