lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Thu, 17 Feb 2011 10:09:30 -0500, David Favro <lua@meta-dynamic.com>
wrote:
>What's the "task" and why does it require calling a Lua script?

I need to make a callback. Apparently, this requires making a call
from the outside, through either AMI or AGI. I naively thought I could
just use Dial() in the "h" extension, ie. after the channel is closed,
but nothing happens.

I'm stuck with a 1.4 which doesn't have pbx_lua.

Is there a way to tell Asterisk that the script must be fed to the Lua
interpreter? I could use a shell script to run "lua callback.lua", but
maybe there's a simpler way.

Here's how I'm trying to call the Lua script:
======
[from_fxo]
exten => s,1,Wait(2)
exten => s,n,Set(CID=${CALLERID(num)})
exten => s,n,Hangup()

exten => h,1,AGI(/var/tmp/callback.lua,${CID})
======

And here are the two files:
======
-rw-r--r--    1 root     root           35 Feb 17 16:04 callback.lua
-rwxr-xr-x    1 root     root       127428 Feb 17 14:05 lua
======

>If you do find a lua library for parsing AGI headers, please let me know...
>and ditto if you write an open-source one.

If I can come up with something useful, will do.

Thank you.