And now for something completely different!
In both of our cookbook and FreeSWITCH book you can find different examples and snippets of basic and intermediate Lua FreeSWITCH scripting. I will not repeat that.
What follows in this chapter is a moderately complex IVR application that makes use of different Lua FreeSWITCH techniques: logging, nesting, multiple files, setting and getting channel variables, accounting, asynchronous execution, web access, database access, error handling, post-hangup execution, functions, and so on.
Because this is not a basic snippet, and because it must strike a balance between comprehensibility and number of pages, I ask you to be patient and to bear with me while I describe the various steps.
I promise you will find reusable techniques, common patterns, and perhaps some inspiration.