[asterisk-dev] Execution environment of Lua dialplan and persistent state?

dlakelan dlakelan at street-artists.org
Wed Apr 6 15:29:45 CDT 2011


I am writing a small dialplan in lua and want to have some persistent 
state. For example I want someone to be able to dial *DNR (*367) to set 
a "do not ring timeout". The idea is that asterisk will goto a context 
where the "s" extension simply prompts for the number of minutes they 
want to not have the phone ring and then an extension "*XXX" reads the 
extension dialed and sets the time until which the calling line should 
go directly to voicemail. It seemed straightforward to put into a lua 
table the timeout value.

What I've found is that it seems that every time a call is routed global 
variables seem to be reset to their original values so the timeout is 
erased. so I've taken to putting this persistent state into a mysql table.

It got me wondering what the situation is with lua dialplans? Every time 
a call is routed are all the commands in the extensions.lua executed in 
a clean environment?

Thanks,
Dan



More information about the asterisk-dev mailing list