]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix play_and_get_digits to unset the var if the regex didn't match. and fix ESL/IVR...
authorMichael Jerris <mike@jerris.com>
Mon, 6 Apr 2009 19:25:02 +0000 (19:25 +0000)
committerMichael Jerris <mike@jerris.com>
Mon, 6 Apr 2009 19:25:02 +0000 (19:25 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12921 d0543943-73ff-0310-b7d9-9358b9ac24b2

libs/esl/perl/ESL/IVR.pm
src/switch_ivr_play_say.c

index 6ea8063cefbe47e9ca87772735d336b32f29453b..e36b8c9029d97f0f3e5e123b9078f3c6826f55ed 100644 (file)
@@ -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);
 
index 2fa391de293c0f681091b996df6f815c347045e9..3f9badd590ec649c71f9c109c4bcd0df6232d508 100644 (file)
@@ -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);
                                }
                        }
                }