freeswitch perl测试脚本不起作用

时间:2015-11-13 07:33:58

标签: perl freeswitch

我有FreeSWITCH版本1.4.23~64bit(64bit)

我成功安装了ESL perl并尝试运行脚本来测试入站模式。

#!/usr/bin/perl
require ESL;

my $command = shift;
my $args = join(" ", @ARGV);

my $host = "localhost";
my $port = "8021";
my $pass = "ClueCon";
my $con  = new ESL::ESLconnection($host, $port, $pass);
if (! $con) { die "Unable to establish connection to $host:$port\n";
        }
        else { print "Success!\n";
        }
my $e = $con->api($command, $args);
print $e->getBody();

跑完后我得到一个错误:

Success!
Can't call method "getBody" on an undefined value at /usr/src/freeswitch/libs/esl/perl/single_command.pl line 16.

怎么了?

0 个答案:

没有答案