From Anton, 7 Years ago, written in Plain Text.
- go back
Embed
Viewing differences between and sample script
  1. #!/usr/bin/perl
  2.  
  3. use strict;
  4. use warnings;
  5. our $session;
  6.  
  7.  
  8. if($session->ready()){
  9.  
  10.         my $current_uuid = $session->getVariable("uuid");
  11.  
  12.         my $api = new freeswitch::API;
  13.  
  14.         my $bleg_uuid = $session->getVariable('b_leg');
  15.  
  16.         my $current_exists = $api->execute( "uuid_exists ", $current_uuid );
  17.         my $bleg_exists = $api->execute( "uuid_exists ", $bleg_uuid );
  18.         if ( defined $bleg_exists and defined $current_exists and
  19.               $bleg_exists eq "true" and $current_exists eq "true" ) {
  20.  
  21.                         $api->executeString("uuid_bridge $current_uuid $bleg_uuid");
  22.  
  23.         }
  24.        
  25.  
  26. }
  27.  
  28.  
  29.  
  30. 1;
  31.