[Freeswitch-users] Catch events from ESL socket

João Mesquita jmesquita at freeswitch.org
Thu Apr 18 17:51:44 MSD 2013


Recveventtimed might return null if an event does not arrive in those ms time. Make sure to use recvevent only if you don't want that. 

Sent from my iPhone

On Apr 18, 2013, at 4:14 AM, Anton Vojlenko <stargray at bigmir.net> wrote:

> Hello,
> I am using skypopen module and i need catch API answers from skype client. I wrote simple perl script:
> 
> require ESL;
> my $con = new ESL::ESLconnection("localhost", "8021", "ClueCon");
> while (1){
>     $con->sendRecv("log 7");
>     $e = $con->bgapi("skypopen sk1 PING");
>     #$uuid = $e->getHeader("Job-UUID");
>     #print $e->serialize("plain");
>     $n = 2;
>     while($n){
>         $event = $con->recvEventTimed(100);
>         if ($event and $event->getHeader("Log-File") eq "skypopen_protocol.c") {
>             push(@dmesg, $event->getBody());
> 
>         }
>         $n--;
>     }
>         print "@dmesg\n";
>     sleep(3);
>     @dmesg = ();
> }
> 
> But sometimes I get empty array, because script catch differect events. How to catch events from ESL socket by UUID?
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
> 
> 
> 
> 
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
> 
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org



Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list