]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add ESL::IVR::setVar from intralanman
authorMichael Jerris <mike@jerris.com>
Mon, 6 Apr 2009 17:39:07 +0000 (17:39 +0000)
committerMichael Jerris <mike@jerris.com>
Mon, 6 Apr 2009 17:39:07 +0000 (17:39 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12917 d0543943-73ff-0310-b7d9-9358b9ac24b2

libs/esl/perl/ESL/IVR.pm

index cbb37b7bb9387016ae7c9360a76a050bf49d91cd..6ea8063cefbe47e9ca87772735d336b32f29453b 100644 (file)
@@ -55,6 +55,24 @@ sub getVar($;) {
 
 }
 
+sub setVar($;) {
+  my $self = shift;
+  my ($var, $val) = @_;
+  my $e = $self->api("uuid_setvar", "$self->{_uuid} $var $val");
+  my $input;
+  if ($e) {
+    $input = $e->getBody() . "\n";
+    if ($input eq "_undef_") {
+      $input = undef;
+    }
+  }
+
+  chomp $input;
+
+  return $input;
+
+}
+
 sub playAndGetDigits($;) {
   my $self = shift;
   my ($min, $max, $tries, $to, $term, $file, $invalid_file, $var) = @_;