Hi,
I am trying to use ESL with Perl but I am having difficulties receiving events from the FS. I tested a simple Perl script to connect to FS (inbound connection) and execute an API command (show status). I can connect successfully but not receiving the response of the API command. I have listed the simple Perl script and the error I receive.
However I can telnet and execute the same API command successfully using telnet command (> telnet 127.0.0.1 8021).
I am running FS 1.4.6 on Debian release 7.5 32-bit.
Any suggestion on how to troubleshoot this is appreciated.
Here is the Perl script I am using to test ESL inbound connection.
# perl test.pl
$VAR1 = undef;
Can't call method "serialize" on an undefined value at test1.pl line 29.
----------------------------------------------------------------------------------------
use Data::Dumper;
require ESL;
my $host = "localhost";
my $port = "8021";
my $pass = "ClueCon";
# Establish an event socket connection to FreeSWITCH
my $con = new ESL::ESLconnection($host, $port, $pass);
if (! $con) {
die "Unable to establish connection to $host:$port\n";
}
my $cmd = "sofia status";
my $args = "";
my $e = $con->api($cmd, $args);
print Dumper $e;
print $e->serialize("plain");
# disconnect from FreeSWITCH
$con->disconnect();
|
This email is free from viruses and malware because avast! Antivirus protection is active. |