I played around with a couple options and found that issuing a hupall normal_clearing on the initiated call after a few seconds was the most reliable way to do this. The next best option I found was hanging up after a few seconds of receiving CS_EXECUTE state update, though this seemed to cause the timing to vary.<div>

<br></div><div>Are there other events that come over ESL on a PRI call that are good to anchor to? For some of the suggestions above like &quot;progressing&quot;, it isn&#39;t clear what event that corresponds to.<br><br>

<div class="gmail_quote">On Thu, May 13, 2010 at 5:14 PM, Neil Patel <span dir="ltr">&lt;<a href="mailto:neilp@cs.stanford.edu">neilp@cs.stanford.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Thanks Michael, I was looking for code examples to receive events over ESL, and found them in libs/esl/.<div><br></div><div>I&#39;m still not clear on the following:</div><div><ol><li>I have a controller script that originates calls; it runs &quot;show channels&quot; between calls and parses out the number of active channels. If below threshold, originate next call. If not, wait a couple seconds and run &quot;show channels&quot; again, repeating till below threshold. Is this the best way? Can this be done more efficiently through events? How?</li>


<li>For placing missed calls to SIP endpoints, it sounds like<i> </i>I can wait for a signal 180 or 183 to know when to hang up. How do I check for those signals? Is this another job for events?</li><li>For placing missed calls over openzap/PRI, it sounds like I can check for call states PROGRESS or ALERTING? Where are those states from, and how do I check them? Again, can I use events? The other option you gave is checking for endpoint_disposition. This is in the cdr, but how do I use it for detecting when I should hang up for a missed call? Is there an event associated with it? What are the call states it goes through?</li>


</ol><div>-Neil</div><font color="#888888"><br></font><div class="gmail_quote"><div><div></div><div class="h5">On Wed, May 12, 2010 at 2:47 PM, Michael Collins <span dir="ltr">&lt;<a href="mailto:msc@freeswitch.org" target="_blank">msc@freeswitch.org</a>&gt;</span> wrote:<br>

</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div></div><div class="h5">
<br><div class="gmail_quote"><div>On Wed, May 12, 2010 at 11:59 AM, Neil Patel <span dir="ltr">&lt;<a href="mailto:neilp@cs.stanford.edu" target="_blank">neilp@cs.stanford.edu</a>&gt;</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&#39;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><div>Neil,<br><br>Check out the event socket documentation, specifically the &quot;events plain all&quot; and &quot;filter&quot; commands. You can listen to all events or just specific ones:<br>



<a href="http://wiki.freeswitch.org/wiki/Event_socket" target="_blank">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 &quot;/log 0&quot; 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&#39;s a &quot;filter in&quot; not filter out. Another way of saying it is &quot;show me events named CHANNEL_STATE&quot; and &quot;show me events named CHANNEL_HANGUP&quot;<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" target="_blank">http://wiki.freeswitch.org/wiki/Esl#ESLconnection_Object</a><br>



<br>I hope that helps! Have fun.<br><font color="#888888">-MC<br>
</font><br></div></div><div class="im">_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></div></blockquote></div><br></div>
</blockquote></div><br></div>