Re: [Freeswitch-users] Flushing the Event buffer in Perl Event Socket

2009-11-10 Thread lakshmanan

Hi anthony,
I was in a need of flushing the events buffer without reading it.I've done
the following ESL(Async) program to flush the events.

First I register for events.
I answered the call and playback some message. Now the events would have
been queued.
I, then send noevents.

After sending that, I again register for events, and when I receive the
events, I've not got the old events. I got only new events.

But I don't know whether it is exactly a way to flush the events or not. I
just need your suggestions or your thoughts on this.
Here is the script:
use lib /usr/local/freeswitch/scripts/esl;
require ESL;
use IO::Socket::INET;
use Data::Dumper;
my $ip = 192.168..0.0;
my $sock = new IO::Socket::INET ( LocalHost = $ip,  LocalPort = '8447', 
Proto = 'tcp',  Listen = 2,  Reuse = 1 );
die Could not create socket: $!\n unless $sock;
my $con;
for(;;) {
my $new_sock = $sock-accept();
my $pid = fork();
if ($pid) {
close($new_sock);
next;
}
my $host = $new_sock-sockhost();
my $fd = fileno($new_sock);
print Host name is $host\n;
$con = new ESL::ESLconnection($fd);
my $info = $con-getInfo();
my $uuid = $info-getHeader(unique-id);
printf Connected call %s, from %s to %s\n, $uuid,
$info-getHeader(caller-caller-id-number),
$info-getHeader(caller-destination-number);
$con-filter(Unique-Id, $uuid);
$con-events(plain, all);
$con-execute(answer);
$con-setEventLock(true);

$con-execute(playback,/usr/local/freeswitch/sounds/en/us/callie/ivr/8000/ivr-welcome_to_freeswitch.wav);
$con-send(noevents);
sleep(5);
$con-events(plain, all);
while(my $e = $con-recvEvent())
{
print $e-serialize();
}
}


Anthony Minessale-2 wrote:
 
 read them in a timed loop of some small number of MS until you get a
 timeout
 meaning you have flushed them all.
 
 
 On Fri, Oct 30, 2009 at 1:57 AM, velusamy velu
 velu.techni...@gmail.comwrote:
 
 Dear All,
   I receiving the events in while loop by using recvEventTimed method
 in ESL.pm. I have to flush that Event buffer after some particular time.
 How
 can I do it?

 Thanks,
 Velusamy

 ___
 FreeSWITCH-users mailing list
 FreeSWITCH-users@lists.freeswitch.org
 http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
 UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
 http://www.freeswitch.org


 
 
 -- 
 Anthony Minessale II
 
 FreeSWITCH http://www.freeswitch.org/
 ClueCon http://www.cluecon.com/
 Twitter: http://twitter.com/FreeSWITCH_wire
 
 AIM: anthm
 MSN:anthony_miness...@hotmail.com msn%3aanthony_miness...@hotmail.com
 GTALK/JABBER/PAYPAL:anthony.miness...@gmail.compaypal%3aanthony.miness...@gmail.com
 IRC: irc.freenode.net #freeswitch
 
 FreeSWITCH Developer Conference
 sip:8...@conference.freeswitch.org sip%3a...@conference.freeswitch.org
 iax:gu...@conference.freeswitch.org/888
 googletalk:conf+...@conference.freeswitch.orggoogletalk%3aconf%2b...@conference.freeswitch.org
 pstn:213-799-1400
 
 ___
 FreeSWITCH-users mailing list
 FreeSWITCH-users@lists.freeswitch.org
 http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
 UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
 http://www.freeswitch.org
 
 

-- 
View this message in context: 
http://old.nabble.com/Flushing-the-Event-buffer-in-Perl-Event-Socket-tp26125824p26281493.html
Sent from the Freeswitch-users mailing list archive at Nabble.com.


___
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org


Re: [Freeswitch-users] Flushing the Event buffer in Perl Event Socket

2009-11-10 Thread Brian West
$| = 1;

I think that is what you're lookin for.

/b

On Nov 10, 2009, at 4:51 AM, lakshmanan wrote:

 I was in a need of flushing the events buffer without reading  
 it.I've done
 the following ESL(Async) program to flush the events.


___
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org


Re: [Freeswitch-users] Flushing the Event buffer in Perl Event Socket

2009-11-10 Thread lakshmanan ganapathy
That doesn't seems to work for me.
Here is my need.
I'm using Async in the Event socket outbound.

I'll register for events plain all
I'll answer the call.
I'll playback a message.
I'll sleep for 5 seconds.
After that, I'll receive the events.
I don't need the events that are for answer and playback. That action is
completed and don't want to receive events for those application.

I set $|=1 in my ESL script.
But it doesn't seems to solve the above issue.
Any helppls!!!

On Tue, Nov 10, 2009 at 7:41 PM, Brian West br...@freeswitch.org wrote:

 $| = 1;

 I think that is what you're lookin for.

 /b

 On Nov 10, 2009, at 4:51 AM, lakshmanan wrote:

  I was in a need of flushing the events buffer without reading
  it.I've done
  the following ESL(Async) program to flush the events.


 ___
 FreeSWITCH-users mailing list
 FreeSWITCH-users@lists.freeswitch.org
 http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
 UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
 http://www.freeswitch.org

___
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org


[Freeswitch-users] Flushing the Event buffer in Perl Event Socket

2009-10-30 Thread velusamy velu
Dear All,
  I receiving the events in while loop by using recvEventTimed method in
ESL.pm. I have to flush that Event buffer after some particular time. How
can I do it?

Thanks,
Velusamy
___
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org


Re: [Freeswitch-users] Flushing the Event buffer in Perl Event Socket

2009-10-30 Thread Anthony Minessale
read them in a timed loop of some small number of MS until you get a timeout
meaning you have flushed them all.


On Fri, Oct 30, 2009 at 1:57 AM, velusamy velu velu.techni...@gmail.comwrote:

 Dear All,
   I receiving the events in while loop by using recvEventTimed method
 in ESL.pm. I have to flush that Event buffer after some particular time. How
 can I do it?

 Thanks,
 Velusamy

 ___
 FreeSWITCH-users mailing list
 FreeSWITCH-users@lists.freeswitch.org
 http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
 UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
 http://www.freeswitch.org




-- 
Anthony Minessale II

FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/
Twitter: http://twitter.com/FreeSWITCH_wire

AIM: anthm
MSN:anthony_miness...@hotmail.com msn%3aanthony_miness...@hotmail.com
GTALK/JABBER/PAYPAL:anthony.miness...@gmail.compaypal%3aanthony.miness...@gmail.com
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:8...@conference.freeswitch.org sip%3a...@conference.freeswitch.org
iax:gu...@conference.freeswitch.org/888
googletalk:conf+...@conference.freeswitch.orggoogletalk%3aconf%2b...@conference.freeswitch.org
pstn:213-799-1400
___
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org