我有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.
怎么了?