[Freeswitch-users] Event Socket not displaying all events
Raimundo Pérez Nieves
raimundo.perez.cuba at gmail.com
Mon Jan 15 15:03:23 UTC 2018
Hi,
I can’t receive all events, like ringtone, exchange media, answered, etc, from sofia/external/550075372035172 at 64.34.75.23
What I am missing?
Thanks
iam using this dial plan:
<extension name="outbound event socket">
<condition field="destination_number" data="^(5004)$">\
<action application="socket" data="127.0.0.1:8040 async"/>
</condition>
</extension>
And this is my perl script:
require ESL;
use IO::Socket::INET;
my $ip = "127.0.0.1";
my $sock = new IO::Socket::INET ( LocalHost => $ip, LocalPort => '8040', Proto => 'tcp', Listen => 1, Reuse => 1 );
my $dial_string = 'sofia/external/550075372035172 at 64.34.75.23';
my $codec_string = 'G729';
die "Could not create socket: $!\n" unless $sock;
for(;;) {
my $new_sock = $sock->accept();
my $pid = fork();
if ($pid) {
print "New child pid $pid created...\n";
close($new_sock);
next;
}
my $fd = fileno($new_sock);
my $con = new ESL::ESLconnection($fd);
my $info = $con->getInfo();
my $uuid = $info->getHeader("unique-id");
printf "Connected call %s, from %s\n", $uuid, $info->getHeader("caller-caller-id-number");
$con->sendRecv("event plain ALL");
$con->execute("export","nolocal:absolute_codec_string=$codec_string");
$con->execute("bridge",$dial_string);
while($con->connected()) {
my $e = $con->recvEvent();
if ($e) {
my $name = $e->getHeader("event-name");
print "EVENT [$name]\n";
}
}
print "BYE\n";
close($new_sock);
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20180115/5fd3f73a/attachment.html>
More information about the FreeSWITCH-users
mailing list