Although I do it using ESL it may be helpful for your case. When issuing the broadcast request I create a 'correlation ID' variable with a generated unique ID (can be any suitable string) for each file to be broadcast. The ID is passed back to the ESL app after each particular file stops playing back.

In the ESl language I issue the command "execute playback file_string://myfile.mp3{CorrelationID=myuniqueID}" and then wait for an event with the correct correlation ID.

Hynek



On Mon, Jan 30, 2012 at 5:40 PM, Michael Lutz <mytemike72@gmail.com> wrote:
Hi All,

I am dealing with a little problem...

To play asynchronous audio in my Lua script I use the api function
"uuid_broadcast {uuid} {fileName} aleg". This all works well and audio
is being buffered if I call my function multiple times.
When I want to abort all plays and flush the buffer I use "uuid_break
{uuid} all". This all works excellent!

My problem is I at certain points need to know if audio is being
played (or awaits in the buffer) and need to pause execution untill
all audio is beging played (or flushed).

Is there a way of doing this in either Lua or apiFunctions? or a
channel variable perhaps? I have looked and tryed but cannot seem to
find a way doing this.


Any hints (or solution ;-) appreciated!


Regards,
Michael Lutz

_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting@freeswitch.org
http://www.freeswitchsolutions.com

FreeSWITCH-powered IP PBX: The CudaTel Communication Server
http://www.cudatel.com

Official FreeSWITCH Sites
http://www.freeswitch.org
http://wiki.freeswitch.org
http://www.cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org