[Freeswitch-users] Execute app in sync mode when using event sockets

Michael Collins msc at freeswitch.org
Fri Feb 1 00:06:26 MSK 2013


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.

More info here:
http://wiki.freeswitch.org/wiki/Event_Socket_Library

-MC


On Thu, Jan 31, 2013 at 11:18 AM, Hector Geraldino <
Hector.Geraldino at ipsoft.com> wrote:

>  Hi,****
>
> ** **
>
> 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.***
> *
>
> ** **
>
> 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:****
>
> ** **
>
> + 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. ****
>
> + use uuid_broadcast uuid speak::args, doesn’t work****
>
> ** **
>
> Any hints, ideas are welcomed.****
>
> ** **
>
> Thank you!****
>
> Hector****
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> 
> 
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
>


-- 
Michael S Collins
Twitter: @mercutioviz
http://www.FreeSWITCH.org
http://www.ClueCon.com
http://www.OSTAG.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20130131/ff1a8bcd/attachment.html 


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