Summary:ASTERISK-10667: [patch] pbx_lua.so: a lua pbx switch that allows dialplans written in pure lua
Reporter:Matthew Nicholson (mnicholson)Labels:
Date Opened:2007-11-01 18:49:08Date Closed:2007-11-02 10:36:40
Versions:Frequency of
Environment:Attachments:( 0) pbx_lua1.diff
Description:This module allows users to write dialplans completely in lua, see the included extensions.lua.sample file for more information.  I have lightly tested the code and it has worked for me.


In order to implement this module I had to export the ext_cmp() function from pbx.c.  I did this by adding an additional function named ast_extension_cmp() that calls ext_cmp().  This was necessary to that my pbx_lua module knows what order to match extensions in.

I updated configure.ac as well as several of the other build and menuconfig related files.  I updated the ./configure script as well using autoreconf, but I am not sure if that was done correctly.

The code is fully documented internally, and the syntax for extensions.lua is documented in the sample file, it might be worthwhile to add an extensions.lua.tex or pbx_lua.tex file, but this patch does not include one.

I have also included the utils/build-extensions-conf.lua which can be used to include the proper contexts from your extensions.lua file into extensions.conf using #exec (requires execincludes=yes in asterisk.conf).  This is documented in the extensions.lua.sample file and in the script itself.

I am looking forward to the inclusion of this code in asterisk as it will make writing complex dialplans much easier.
Comments:By: Leif Madsen (lmadsen) 2007-11-01 22:32:39

You and your lua :)

By: Tilghman Lesher (tilghman) 2007-11-02 08:25:07

Is there something in your code that requires lua 5.1?  I'm showing Ubuntu, for example, only has packages for lua40 and lua50.

By: Matthew Nicholson (mnicholson) 2007-11-02 09:48:22

Yes.  I believe there is some code that requires lua5.1.

By: Matthew Nicholson (mnicholson) 2007-11-02 10:13:20

Every version of ubuntu since dapper has lua 5.1.  The packages are named lua5.1 and liblua5.1 and such.  liblua5.1-0-dev is the one you would need for this code.

By: Digium Subversion (svnbot) 2007-11-02 10:36:40

Repository: asterisk
Revision: 88250

U   trunk/build_tools/menuselect-deps.in
A   trunk/configs/extensions.lua.sample
U   trunk/configure
U   trunk/configure.ac
U   trunk/include/asterisk/autoconfig.h.in
U   trunk/include/asterisk/pbx.h
U   trunk/main/pbx.c
U   trunk/makeopts.in
A   trunk/pbx/pbx_lua.c
A   trunk/utils/build-extensions-conf.lua

r88250 | tilghman | 2007-11-02 10:36:34 -0500 (Fri, 02 Nov 2007) | 5 lines

Add pbx_lua as a method of doing extensions
Reported by: mnicholson
Patch by: mnicholson
Closes issue ASTERISK-10667