[Freeswitch-users] moh background in Lua
anthony.minessale at gmail.com
Thu Mar 18 13:19:11 PDT 2010
The script is executing in the foreground and is being executed on your
You cannot tell the channel to do something else because it's already
running your script so
it can only run something else on top of it.
you have 2 choices:
1) use the socket app in async mode and external scripts with an ESL plugin.
2) instead of executing the script on the session launch a script in a sep
thread with the current uuid
ad an argument then execute park and let the script control the channel
Even better reconsider what you want to do and avoid working against the
grain of how the existing architecture is flowing and you will have the best
On Thu, Mar 18, 2010 at 3:02 PM, Tjardick van der Kraan <
tjardick at vanderkraan.net> wrote:
> I'm trying to create a lua script but would like a certain task (music
> on hold) to be 'backgrounded':
> -- Loop while the call is active
> while (session:ready() == true) do
> -- do something here
> session:execute("playback", moh)
> freeswitch.consoleLog("INFO","Started music on hold.\n");
> -- do some stuff while playing music
> -- Maybe we need a way to stop music or playback will stop
> session:execute("playback", "/sounds/we_will_answer_asap.wav")
> freeswitch.consoleLog("INFO","Play'ed announcement.\n");
> "ofcourse" currently the only thin that happens is the music and my
> loop does not continue.
> Is there a way to start/stop music in the background?
> I guess in Asterisk language i will need the command StartMusicOnHold...
> Thanks for any suggestions.
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
Anthony Minessale II
MSN:anthony_minessale at hotmail.com <MSN%3Aanthony_minessale at hotmail.com>
GTALK/JABBER/PAYPAL:anthony.minessale at gmail.com<PAYPAL%3Aanthony.minessale at gmail.com>
IRC: irc.freenode.net #freeswitch
FreeSWITCH Developer Conference
sip:888 at conference.freeswitch.org <sip%3A888 at conference.freeswitch.org>
iax:guest at conference.freeswitch.org/888
googletalk:conf+888 at conference.freeswitch.org<googletalk%3Aconf%2B888 at conference.freeswitch.org>
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the FreeSWITCH-users