Summary
In this chapter we delved right into the middle of a moderately complex LuaIVR.
We saw an example of how to implement 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 more.
First, we introduced how to create interactive voice menus with PlayAndGetDigits()
, the workhorse of FreeSWITCH LuaIVR scripting.
At the same time we showed TTS usage with say()
, which is very useful both for prototyping and for reading arbitrary messages to the caller.
Then we originated a new call leg and connected the incoming call to the outbound leg, bridging them in an end-to-end call.
We used the basic curl()
API function to access the Web, and used the power of FreeSWITCH's Dbh to access both local and remote databases.
We switched back and forth between different menus using the despised gotoLua
construct.
Then we showed you some techniques...