[Freeswitch-users] Event Socket not displaying all events

Adrian Worutowicz adrian.worutowicz at esifrance.net
Mon Jan 15 15:43:54 UTC 2018


Hi,

 

I doubt if you really need ALL events.

 

I send:

event xml BACKGROUND_JOB CHANNEL_CALLSTATE

 

I receive:

Reply-Text: +OK event listener enabled xml

 

… and then all events I need (in XML)

 

 

De : FreeSWITCH-users [mailto:freeswitch-users-bounces at lists.freeswitch.org] De la part de Raimundo Pérez Nieves
Envoyé : lundi 15 janvier 2018 16:03
À : FreeSWITCH Users Help
Objet : [Freeswitch-users] Event Socket not displaying all events

 

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/174b161b/attachment-0001.html>


More information about the FreeSWITCH-users mailing list