Getting started with Lua
Enabling Lua (via mod_lua
) is very similar to the process we used in Chapter 2, Building and Installation, where we enabled
mod_flite.
It is done in the following way:
Open
modules.
conf
in the FreeSWITCH source directory and locate the following line:#languages/mod_lua
Remove the
#
and save the file.Open
modules.conf.
xml
in theconf/autoload_configs
directory and locate the following line:<!-- <load module="mod_lua"/> -->
Remove the
<!--
and-->
tags and save the file.Build and compile
mod_lua
from the FreeSWITCH source directory:make mod_lua-install
Wait for the installation to finish, and then restart FreeSWITCH. Launch
fs_cli
and typeshow application
. If Lua loaded successfully, then you will see thatlua
is now available as a Dialplan application as follows:lua,Launch LUA ivr,<script>,mod_lua
You are almost ready to write scripts in Lua.
Note
Later versions of FreeSWITCH have mod_lua
enabled by default.