<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi everyone,<br>
<br>
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:<br>
<br>
The event loop looks like the following:<br>
<small><small><tt><br>
con = ESL::ESLconnection.new('localhost', '8021', 'ClueCon')<br>
con.events('plain', 'CHANNEL_ANSWER CHANNEL_HANGUP_COMPLETE
CHANNEL_BRIDGE CHANNEL_EXECUTE_COMPLETE')<br>
<br>
i = 0<br>
EM.run do<br>
while (con.connected)<br>
e = con.recvEvent()<br>
EM.defer do<br>
if (!e.nil? &&
!e.getHeader("variable_medularis_uuid").nil? &&
!e.getHeader("variable_clicktocall").nil?)<br>
on_event(e, con, i)<br>
i = i + 1<br>
end<br>
end<br>
end</tt></small></small><br>
<br>
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. <br>
<br>
Any clues on this issue? Has anyone tried Ruby 1.9.2 successfully
with ESL?<br>
<br>
Thanks!<br>
<br>
Best,<br>
<pre class="moz-signature" cols="72">--
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
<a class="moz-txt-link-abbreviated" href="mailto:claudio@clickfono.com">claudio@clickfono.com</a></pre>
</body>
</html>