<br><div class="gmail_quote">On Wed, May 12, 2010 at 11:59 AM, Neil Patel <span dir="ltr"><<a href="mailto:neilp@cs.stanford.edu">neilp@cs.stanford.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Thanks for the tips.<div><br></div><div>Where are there examples of using ESL to register and handle events? For e.g. I don't see any example of how to register for a change in channel variable endpoint_disposition. Or even to check the CHANNEL_STATE event.</div>
<div><br></div><div>-Neil<br><br></div></blockquote><div>Neil,<br><br>Check out the event socket documentation, specifically the "events plain all" and "filter" commands. You can listen to all events or just specific ones:<br>
<a href="http://wiki.freeswitch.org/wiki/Event_socket">http://wiki.freeswitch.org/wiki/Event_socket</a><br><br>If you want to experiment with the event socket and the various events then use fs_cli. Connect with fs_cli and then issue "/log 0" which turns off all debug messages. Now you have basically a raw event socket. Try some of these commands:<br>
</div></div><br>/event plain all<br><br>watch the fun messages fly. :)<br><br>You can filter them as well:<br><br>/filter Event-Name CHANNEL_STATE<br>/filter Event-Name CHANNEL_HANGUP<br><br>when you apply a filter you will receive only those things you choose. A it's a "filter in" not filter out. Another way of saying it is "show me events named CHANNEL_STATE" and "show me events named CHANNEL_HANGUP"<br>
<br>just note that in your script you will be using the ESL abstractions for these:<br><br><a href="http://wiki.freeswitch.org/wiki/Esl#ESLconnection_Object">http://wiki.freeswitch.org/wiki/Esl#ESLconnection_Object</a><br>
<br>I hope that helps! Have fun.<br>-MC<br>