Advanced IVR concepts
In addition to important programming constructs such as conditionals and looping, there are other things that are possible by utilizing a scripting language. One of the advanced functions of a really useful IVR is the ability to interact with a third-party database. In some cases, this is a simple web lookup function. In other cases, it involves asking the caller for an account or ID number and a PIN code, and then polling a database. Let's consider simple examples of each method.
Connecting to a database with LuaSQL
The LuaSQL interface implements a simple interface between Lua and a DBMS. (The LuaSQL interface is provided by the Kepler project. More information is available at http://www.keplerproject.org/luasql/.)
Tip
The examples in this section require some working knowledge of databases and the ability to compile LuaSQL, for the target database type to which you will be connecting. It is beyond the scope of this book to describe all the possible installation scenarios...