[asterisk-bugs] [JIRA] (ASTERISK-23818) PBX_Lua: after asterisk startup module is loaded, but dialplan not available

Dennis Guse (JIRA) noreply at issues.asterisk.org
Wed Jun 18 03:09:56 CDT 2014


    [ https://issues.asterisk.org/jira/browse/ASTERISK-23818?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=219598#comment-219598 ] 

Dennis Guse edited comment on ASTERISK-23818 at 6/18/14 3:09 AM:
-----------------------------------------------------------------

Configuration files that reproduce the problem on Ubuntu 14.04

Modules.conf could not be uploaded (Cannot attach file modules.conf: Unable to communicate with JIRA.) It is the default from 11.7.0~dfsg


_____
;
; Asterisk configuration file
;
; Module Loader configuration file
;

[modules]
autoload=yes
;
; Any modules that need to be loaded before the Asterisk core has been
; initialized (just after the logger has been initialized) can be loaded
; using 'preload'. This will frequently be needed if you wish to map all
; module configuration files into Realtime storage, since the Realtime
; driver will need to be loaded before the modules using those configuration
; files are initialized.
;
; An example of loading ODBC support would be:
;preload => res_odbc.so
;preload => res_config_odbc.so
;
; If you want, load the GTK console right away.  
; Don't load the KDE console since
; it's not as sophisticated right now.
;
noload => pbx_gtkconsole.so
;load => pbx_gtkconsole.so
noload => pbx_kdeconsole.so
;
; Intercom application is obsoleted by
; chan_oss.  Don't load it.
;
noload => app_intercom.so
;
; The 'modem' channel driver and its subdrivers are
; obsolete, don't load them.
;
noload => chan_modem.so
noload => chan_modem_aopen.so
noload => chan_modem_bestdata.so
noload => chan_modem_i4l.so
;
; Comment this out (after installing CAPI middleware and hardware
; drivers) if you have CAPI-able hardware and wish to use it in
; Asterisk.
;
noload => chan_capi.so
;
load => res_musiconhold.so
;
; Load either OSS or ALSA, not both
; By default, load OSS only (automatically) and do not load ALSA
;
noload => chan_alsa.so
;noload => chan_oss.so
;
; Disable CDR logging to SQLite by default since it writes unconditionally to 
; cdr.db without a way to rotate it.
;
noload => cdr_sqlite.so
;
; These conflict with app_directory.so and each other.
noload => app_directory_odbc.so
;
; Enable these if you want to configure Asterisk in a database
;
noload => res_config_odbc.so
noload => res_config_pgsql.so
;
; Module names listed in "global" section will have symbols globally
; exported to modules loaded after them.
;
[global]


was (Author: dennis.guse):
Configuration files that reproduce the problem on Ubuntu 14.04

Modules.conf could not be uploaded (Cannot attach file modules.conf: Unable to communicate with JIRA.) It is the default from 11.7.0~dfsg

> 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: 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
>         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