[Freeswitch-users] ESL

Zuhair Raza engineerzuhairraza at gmail.com
Mon Jul 19 12:29:42 PDT 2010


Dear list,
I am trying perl esl by this link
http://wiki.freeswitch.org/wiki/Perl_ESL
my dialplan is
<extension name="ivrd-example1">

<condition field="destination_number" expression="^99$">
     <action application="log" data="INFO Let's do some ivrd, shall we?"/>
     <action application="set" data="ivr_path=/usr/local/freeswitch/conf/
ivr1.pl"/>
     <action application="socket" data="127.0.0.1:9090 full"/>
   </condition>
 </extension>

when i call to the freeswitch box it reads the ivr file and hangs up the
call and even doesn't print the line "Starting ivrd-hello_world.pl...\n\n"
as written in ivr1.pl

2010-07-19 11:43:35.352121 [INFO] mod_dptools.c:984 Let's do some ivrd,
shall we?
EXECUTE sofia/external/5555 at 74.55.234.106set(ivr_path=/usr/local/freeswitch/scripts/
ivr1.pl)
2010-07-19 11:43:35.352121 [DEBUG] mod_dptools.c:854 sofia/external/
5555 at 74.55.234.106 SET [ivr_path]=[/usr/local/freeswitch/scripts/ivr1.pl]
EXECUTE sofia/external/5555 at 74.55.234.106 socket(127.0.0.1:9090 full)
2010-07-19 11:43:35.360110 [NOTICE] switch_core_state_machine.c:185
sofia/external/5555 at 74.55.234.106 has executed the last dialplan
instruction, hanging up.
2010-07-19 11:43:35.360110 [DEBUG] switch_channel.c:2261 (sofia/external/
5555 at 74.55.234.106) Callstate Change RINGING -> HANGUP


my ivr1.pl is

#!/usr/bin/perl
#
# ivrd-hello_world.pl
#
# Launched from FreeSWITCH using socket app and ${ivr_path} variable
#
use strict;
use warnings;

# Use lib is easy, but you can also install your ESL.pm and esl/perl/ESL/*
into site_perl
use lib '/root/freeswitch/libs/esl/perl';
use ESL::IVR

$| = 1;        # Turn off buffering
select STDERR; # We'll take this stream, thanks
print "Starting ivrd-hello_world.pl...\n\n";

## Set the root dir for sound files
my $sound_root = '/usr/local/freeswitch/sounds/en/us/callie';

## Create the connection object which is basically an IVR
my $con = new ESL::IVR;

## Get this channel's uuid and dialed number
my $uuid = $con->{_uuid};
my $dest = $con->getVar('destination_number'};

## Answer call, sleep for half second to let media get up and running
$con->execute('answer','',$uuid);
$con->execute('sleep','500');


## Play a simple greeting
$con->playback('/usr/local/freeswitch/sounds/en/us/callie/ivr/8000/ivr-welcome_to_freeswitch.wav');


## Tell the call what he/she dialed
$con->execute('sleep','500');
$con->execute('say', "en number iterated $dest");

## Politely disconnect
$con->execute('sleep','1000');
$con->playback('/usr/local/freeswitch/sounds/en/us/callie/ivr/8000/ivr-thank_you.wav');
$con->execute('sleep','500');
$con->playback('voicemail/vm-goodbye.wav');

-- 

Can any one suggest me from where i  am going wrong.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20100720/a3246a4b/attachment.html 


More information about the FreeSWITCH-users mailing list