Are you using the Java ESL library? If so it should have what you need to do sync vs. async on sending execute commands to the event socket. If you are not using ESL I would advise you to do so since it has solved this problem (and others) already.<br>
<br>More info here:<br><a href="http://wiki.freeswitch.org/wiki/Event_Socket_Library">http://wiki.freeswitch.org/wiki/Event_Socket_Library</a><br><br>-MC<br><br><br><div class="gmail_quote">On Thu, Jan 31, 2013 at 11:18 AM, Hector Geraldino <span dir="ltr"><<a href="mailto:Hector.Geraldino@ipsoft.com" target="_blank">Hector.Geraldino@ipsoft.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div link="blue" vlink="purple" lang="EN-US">
<div>
<p class="MsoNormal">Hi,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I have a java app that uses mod_event_socket (inbound mode) to control FreeSWITCH. I can send api commands which, by default, are synchronous, so the thread locks until the command is successfully executed. The problem I’m facing is when
I have to execute commands that are in other modules (like playback, or speak). As they are not api commands, I must send an execute appName + arguments, which by nature is executed in async mode.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">What I want to achieve is to execute an speak command and wait until the TTS operation ends (blocking the thread). This sounds like a trivial use case: play some audio (TTS, file) and then execute the rest of the logic. It is easy to accomplish
on the dialplan, but I just can’t figure out how to do it on an ESL application. Here’s what I’ve tried so far:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">+ send execute speak command + api sleep and wait for the CHANNEL_EXECUTE_COMPLETE (to simulate a lock [sleep] and continue [break after event is received]), but the event arrives after the sleep command completes.
<u></u><u></u></p>
<p class="MsoNormal">+ use uuid_broadcast uuid speak::args, doesn’t work<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Any hints, ideas are welcomed.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Thank you!<span class="HOEnZb"><font color="#888888"><u></u><u></u></font></span></p><span class="HOEnZb"><font color="#888888">
<p class="MsoNormal">Hector<u></u><u></u></p>
</font></span></div>
</div>
<br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">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></blockquote></div><br><br clear="all"><br>-- <br>Michael S Collins<br>Twitter: @mercutioviz<br><a href="http://www.FreeSWITCH.org" target="_blank">http://www.FreeSWITCH.org</a><br><a href="http://www.ClueCon.com" target="_blank">http://www.ClueCon.com</a><br>
<a href="http://www.OSTAG.org" target="_blank">http://www.OSTAG.org</a><br><br>