diff --git a/libs/esl/perl/ESL/IVR.pm b/libs/esl/perl/ESL/IVR.pm index 6ea8063cef..e36b8c9029 100644 --- a/libs/esl/perl/ESL/IVR.pm +++ b/libs/esl/perl/ESL/IVR.pm @@ -75,13 +75,13 @@ sub setVar($;) { sub playAndGetDigits($;) { my $self = shift; - my ($min, $max, $tries, $to, $term, $file, $invalid_file, $var) = @_; + my ($min, $max, $tries, $to, $term, $file, $invalid_file, $var, $regex) = @_; if (!$self->{_esl}->connected()) { return undef; } - $self->execute("play_and_get_digits", "$min $max $tries $to $term $file $invalid_file $var"); + $self->execute("play_and_get_digits", "$min $max $tries $to $term $file $invalid_file $var $regex"); return $self->getVar($var); diff --git a/src/switch_ivr_play_say.c b/src/switch_ivr_play_say.c index 2fa391de29..3f9badd590 100644 --- a/src/switch_ivr_play_say.c +++ b/src/switch_ivr_play_say.c @@ -1561,6 +1561,8 @@ SWITCH_DECLARE(switch_status_t) switch_play_and_get_digits(switch_core_session_t } if (switch_regex_match(digit_buffer, digits_regex) == SWITCH_STATUS_SUCCESS) { return SWITCH_STATUS_SUCCESS; + } else { + switch_channel_set_variable(channel, var_name, NULL); } } }