[Freeswitch-users] ESL on Ruby 1.9.2

Claudio Álvarez claudio at clickfono.com
Tue Oct 25 18:08:25 MSD 2011

Hi everyone,

I've been able to compile the ESL wrapper for Ruby 1.9.2, however, I'm 
getting an abnormal behavior with a small script (100% functional with 
Ruby 1.8.7) which basically opens an ESL socket connection and listens 
to channel events:

The event loop looks like the following:

con = ESL::ESLconnection.new('localhost', '8021', 'ClueCon')

i = 0
EM.run do
   while (con.connected)
     e = con.recvEvent()
     EM.defer do
       if (!e.nil? && !e.getHeader("variable_medularis_uuid").nil? && 
         on_event(e, con, i)
         i = i + 1

The problem I'm experiencing is that the event loop seems to be reading 
events from the socket out of sync. For example, when I answer a call, 
nothing happens (i.e. no event is processed), however, when I hangup, 
the CHANNEL_ANSWER event is read from the socket. As you can see, I'm 
using EventMachine, however, I've also tried Ruby threads and I'm 
getting the same behavior.

Any clues on this issue? Has anyone tried Ruby 1.9.2 successfully with ESL?



Claudio Álvarez, Ph.D.
Arquitecto de Sistemas / Systems Architect
Medularis S.p.A. - ClickFono
Tel:  56 2 934 40 74
Cel: 56 9 9079 4951
claudio at clickfono.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20111025/3fff6e3d/attachment-0001.html 

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