[Freeswitch-users] IVR apps in lua

Neil Patel neilp at cs.stanford.edu
Fri Dec 4 07:58:58 PST 2009


Hi All,

I haven't found a substantial example of IVR applications implemented in
lua. Can anyone suggest where to look? My issue has to do with appropriate
coding style.

I am implementing a voice message board application in lua. I want to allow
the user to dial buttons to navigate forward and back in the list of
messages. One way to implement playmessage() is to check for a forward/back
command while playing the current message, and if a command is given to
invoke playmessage() with the prev/next message in the list. However, this
leaves a chain of unreturned playmessage calls on the execution stack (a
recursive function).

Alternatively, the playmessage() function can return control to its caller
(perhaps a while loop that spins forever) and pass back a code to indicate
the command. The caller acts accordingly. This is non-recursive, but for
anything but simple applications this style becomes tedious as you start
needing to pass back more info and up longer chains of functions.

Any guidance on this would be appreciated.

Thanks,
Neil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20091204/392ebb7f/attachment-0002.html 


More information about the FreeSWITCH-users mailing list