Brian Camp
2009-Aug-17 17:24 UTC
[asterisk-users] Accessing Asterisk gosub arguments in extensions.lua
How does one go about accessing gosub arguments from Asterisk in extensions.lua? For example, I have the following in extensions.conf: exten => 1000,1,Wait(1) exten => 1000,n,Gosub(functions,mytest,1("123")) exten => 1000,n,Hangup And then the following in extensions.lua: extensions = { functions = { ["mytest"] = function() app.saydigits("ARG1") app["return"]() end; }; } I would like the call to speak "one two three", but instead nothing happens because ARG1 isn't available to lua. Thanks much. -Brian
Tilghman Lesher
2009-Aug-17 23:03 UTC
[asterisk-users] Accessing Asterisk gosub arguments in extensions.lua
On Monday 17 August 2009 12:24:08 pm Brian Camp wrote:> How does one go about accessing gosub arguments from Asterisk in > extensions.lua?You cannot. The various methods of dialplan creation are not designed to be interoperable. Some people have made various methods work (such as between extensions.conf and extensions.ael) but those methods are not guaranteed to work, nor are they supported. Use one method and stick with it. -- Tilghman
Brian Camp
2009-Aug-19 16:29 UTC
[asterisk-users] Accessing Asterisk gosub arguments in extensions.lua
On Monday 17 August 2009 18:03:10 pm Tilghman Lesher wrote: >> How does one go about accessing gosub arguments from Asterisk in >> extensions.lua? > You cannot. The various methods of dialplan creation are not > designed to be > interoperable. Some people have made various methods work (such as > between > extensions.conf and extensions.ael) but those methods are not > guaranteed to > work, nor are they supported. Why does Asterisk even have functions in pbx_lua like app.return and app.gosub, which jump between extensions.conf and extensions.lua if its not supported or guaranteed to work. Theres nothing in extensions.lua or pbx_lua.c, which so far as I can tell are the only available sources of documentation for pbx_lua, that suggests extensions.conf interoperability doesn't work. > Use one method and stick with it. Deciding to switch between a 10,000+ line dialplan in an assembly-like language (extensions.conf) over to one in Lua in one all at once is not a good position to be in. -Brian