[Freeswitch-users] Catch events from ESL socket

Anton Vojlenko stargray at bigmir.net
Thu Apr 18 11:14:38 MSD 2013


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?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20130418/ec552861/attachment.html 


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