FS-9319 [mod_dptools] Support "both" in clear_digit_action
Add support for "both" as target parameter to clear_digit_action. CDA previously only supported target values of: "", "self" or "peer" CDA Behaviour now corresponds with documentation. For example, the follow will work as expected: <action application="clear_digit_action" data="all,both"/> FS-9319 #resolve
This commit is contained in:
parent
732b6e75fe
commit
6e8508f2a0
|
@ -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…
Reference in New Issue