[asterisk-bugs] [JIRA] (ASTERISK-23818) PBX_Lua: after asterisk startup module is loaded, but dialplan not available
Timo Teräs (JIRA)
noreply at issues.asterisk.org
Tue Aug 5 02:11:56 CDT 2014
[ https://issues.asterisk.org/jira/browse/ASTERISK-23818?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=221204#comment-221204 ]
Timo Teräs edited comment on ASTERISK-23818 at 8/5/14 2:11 AM:
---------------------------------------------------------------
Please revert the change to making pbx_lua.so symbols non-global. This completely broke lua modules (written in C).
The main binary is expected to export globally the lua_* symbols, so lua modules can use them.
See: http://lua-users.org/wiki/BuildingModules
Please fix this issue in an alternate way that does not break existing functionality.
was (Author: fabled):
Please revert the change to making pbx_lua.so symbols global. This completely broke lua modules (written in C).
The main binary is expected to export globally the lua_* symbols, so lua modules can use them.
See: http://lua-users.org/wiki/BuildingModules
Please fix this issue in an alternate way that does not break existing functionality.
> PBX_Lua: after asterisk startup module is loaded, but dialplan not available
> ----------------------------------------------------------------------------
>
> Key: ASTERISK-23818
> URL: https://issues.asterisk.org/jira/browse/ASTERISK-23818
> Project: Asterisk
> Issue Type: Bug
> Security Level: None
> Components: PBX/pbx_lua
> Affects Versions: 1.8.28.2, 11.7.0, 12.3.2
> Environment: Ubuntu 14.04 64bit
> Linux x201 3.13.0-27-generic #50-Ubuntu SMP Thu May 15 18:06:16 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
> Reporter: Dennis Guse
> Assignee: George Joseph
> Severity: Minor
> Target Release: 1.8.29.0, 11.11.0, 12.4.0
>
> Attachments: 23818-start.log, 23818-unload-load.log, extensions.conf, extensions.lua, sip.conf
>
>
> The pbx_lua module is loaded successfully on Asterisk startup, but the defined dialplan is not available, resulting in "extension unknown"-messages.
> Using either: module reload pbx_lua.so
> or module unload pbx_lua.so + module load pbx_lua.so
> solves the problem as the configuration is loaded properly.
> modules.conf was not changed (default from Ubuntu maintainers).
> Most probable the configuration done by pbx_lua are overwritten by a component that is loaded later.
> In addition, core reload does not kill the pbx_lua configuration...
> ------
> Hi,
> using the pbx_lua module for almost everything we have found a little annoying "bug". On Asterisk startup the module is loaded - however the configuration (extensions.lua) is not loaded and therefore the lua-defined dialplan is not available. By applying "module reload pbx_lua" the dialplan is loaded as expected (lua dialplan is correct).
> ------
> How to reproduce the problem.
> Details: Asterisk 11.7 running on Ubuntu 14.04
> - Module is loaded on start
> # asterisk -fvvv
> ..SNIP
> [1;30m -- [0mRegistered extension context 'default'; registrar: pbx_lua
> [1;30m -- [0mIncluding switch 'Lua/' in context 'default'
> [1;30m -- [0mRegistered extension context 'parkedcalls'; registrar: features
> [1;30m -- [0mmerging incls/swits/igpats from old(parkedcalls) to new(parkedcalls) context, registrar = pbx_lua
> [1;30m -- [0mAdded extension '700' priority 1 to parkedcalls
> [1;30m -- [0mTime to scan old dialplan and merge leftovers back into the new: 0.000043 sec
> [1;30m -- [0mTime to restore hints and swap in new dialplan: 0.000003 sec
> [1;30m -- [0mTime to delete the old dialplan: 0.000005 sec
> [1;30m -- [0mTotal time merge_contexts_delete: 0.000051 sec
> [1;30m [0mpbx_lua.so => ( [0;33mLua PBX Switch [0m)
> ..SNIP
> - Module is really loaded and thus fails:
> #asterisk -rc "module load pbx_lua"
> - Let the started Asterisk reload pbx_lua
> # sudo asterisk -rxvvvvv
> > module reload pbx_lua.so
> -- Reloading module 'pbx_lua.so' (Lua PBX Switch)
> -- Registered extension context 'default'; registrar: pbx_lua
> -- Including switch 'Lua/' in context 'default'
> -- Registered extension context 'parkedcalls'; registrar: features
> -- merging incls/swits/igpats from old(parkedcalls) to new(parkedcalls) context, registrar = pbx_lua
> -- Added extension '700' priority 1 to parkedcalls
> -- Registered extension context 'ael-builtin-h-bubble'; registrar: pbx_ael
> -- merging incls/swits/igpats from old(ael-builtin-h-bubble) to new(ael-builtin-h-bubble) context, registrar = pbx_lua
> -- Added extension 'h' priority 9996 to ael-builtin-h-bubble
> -- Added extension 'h' priority 9995 to ael-builtin-h-bubble
> -- Added extension 'h' priority 9994 to ael-builtin-h-bubble
> -- Added extension 'h' priority 9993 to ael-builtin-h-bubble
> -- Added extension 'h' priority 9992 to ael-builtin-h-bubble
> -- Added extension 'h' priority 9991 to ael-builtin-h-bubble
> -- Added extension 'h' priority 1 to ael-builtin-h-bubble
> -- Registered extension context 'ael-default'; registrar: pbx_ael
> -- merging incls/swits/igpats from old(ael-default) to new(ael-default) context, registrar = pbx_lua
> -- Including context 'ael-demo' in context 'ael-default'
> -- Registered extension context 'ael-demo'; registrar: pbx_ael
> -- merging incls/swits/igpats from old(ael-demo) to new(ael-demo) context, registrar = pbx_lua
> ...SNIP
> ----
> Investigation:
> I took a look into pbx/pbx_lua.c and actually "load" identical to reload + registering the module at Asterisk. Looks neat.
> {code}
> static int reload(void)
> {
> return load_or_reload_lua_stuff();
> }
> static int load_module(void)
> {
> int res;
> if ((res = load_or_reload_lua_stuff()))
> return res;
> if (ast_register_switch(&lua_switch)) {
> ast_log(LOG_ERROR, "Unable to register LUA PBX switch\n");
> return AST_MODULE_LOAD_DECLINE;
> }
> return AST_MODULE_LOAD_SUCCESS;
> }
> {code}
> ----
> Could it be that the pbx_lua is loaded to early and the dialplan overwritten by some other dialplan-module that is later loaded?
--
This message was sent by Atlassian JIRA
(v6.2#6252)
More information about the asterisk-bugs
mailing list