[Home]

Summary:ASTERISK-18230: sometimes dialplan switches disappear when merging contexts between pbx_lua and pbx_config
Reporter:Matthew Nicholson (mnicholson)Labels:
Date Opened:2011-08-05 16:22:04Date Closed:2014-06-20 14:21:23
Priority:MinorRegression?
Status:Closed/CompleteComponents:PBX/General
Versions:1.8.5.0 10.0.0-beta1 Frequency of
Occurrence
Constant
Related
Issues:
is duplicated byASTERISK-23818 PBX_Lua: after asterisk startup module is loaded, but dialplan not available
Environment:Attachments:
Description:When using the same context in pbx_config and pbx_lua (and pbx_ael), the pbx_lua switch added to the context appears to disappear. Reloading pbx_lua after asterisk starts results in the switch being added as expected.

To reproduce:
# Create a context with the same name in pbx_config and pbx_lua.
# Start asterisk, unload pbx_lua.so, pbx_ael.so, and pbx_config.so (or start asterisk without them loaded).
# Load pbx_lua.so, then run 'dialplan show' (note the 'Lua/' switch).
# Load pbx_config.so, then run 'dialplan show' (notice the 'Lua/' switch has disappeared).


This seems to happen when the 'Lua/' switch is the only thing registered in a context and then pbx_config merges some extensions in. It does not occur if you load pbx_config before loading pbx_lua, or if there are extensions (say from pbx_ael) in the context when pbx_config is loaded. Sample pbx_config and pbx_lua config files to reproduce this follow.

{code:title=extensions.conf (pbx_config)}
[test]
exten => 1,1,Noop
exten => 1,n,Answer
{code}

{code:title=extensions.lua (pbx_config)}
extensions = {}
extensions.test = {}
extensions.test[2] = function()
   app.answer()
end
{code}

There is a pbx/merge_contexts test (currently disabled) in the testsuite that demonstrates this. Loading the ast2 configs should result in a context with extensions '12', '123', and a 'Lua/' dialplan switch, but only the two extensions are added.

Note: I didn't actually test with 1.8 but I suspect it is a problem in 1.8 as well.
Comments:By: Leif Madsen (lmadsen) 2011-09-14 16:47:49.038-0500

There seems to be enough information for a community developer to work on this, so I'm marking this as Acknowledged.

By: Heiko Wundram (modelnine) 2013-08-21 10:00:25.198-0500

Same problem exists on the current Debian Asterisk (1.8.13.1~dfsg-3) - and can be resolved by reloading pbx_lua.so after updating the dial-plan.

By: Richard Mudgett (rmudgett) 2014-06-20 14:21:23.108-0500

See ASTERISK-23818