[Asterisk-code-review] pbx lua: On configuration errors report module load failure ... (asterisk[master])

Dennis Guse asteriskteam at digium.com
Wed Nov 23 15:02:03 CST 2016


Dennis Guse has uploaded a new change for review. ( https://gerrit.asterisk.org/4493 )

Change subject: pbx_lua: On configuration errors report module load failure instead of decline.
......................................................................

pbx_lua: On configuration errors report module load failure instead of decline.

Switched from AST_MODULE_LOAD_DECLINE to AST_MODULE_LOAD_FAILURE.
Therefore, if pbx_lua fails to load and pbx_lua is marked as required,
Asterisk exits as expected.

Change-Id: I8e5a0037e69b41743db60c568541ebb2f52a7a8f
---
M pbx/pbx_lua.c
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/93/4493/1

diff --git a/pbx/pbx_lua.c b/pbx/pbx_lua.c
index 01f468d..fc117c5 100644
--- a/pbx/pbx_lua.c
+++ b/pbx/pbx_lua.c
@@ -1625,13 +1625,13 @@
 	lua_State *L = luaL_newstate();
 	if (!L) {
 		ast_log(LOG_ERROR, "Error allocating lua_State, no memory\n");
-		return AST_MODULE_LOAD_DECLINE;
+		return AST_MODULE_LOAD_FAILURE;
 	}
 
 	if (lua_reload_extensions(L)) {
 		const char *error = lua_tostring(L, -1);
 		ast_log(LOG_ERROR, "Error loading extensions.lua: %s\n", error);
-		res = AST_MODULE_LOAD_DECLINE;
+		res = AST_MODULE_LOAD_FAILURE;
 	}
 
 	if (!res) {
@@ -1664,7 +1664,7 @@
 
 	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_FAILURE;
 	}
 
 	return AST_MODULE_LOAD_SUCCESS;

-- 
To view, visit https://gerrit.asterisk.org/4493
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8e5a0037e69b41743db60c568541ebb2f52a7a8f
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Dennis Guse <dennis.guse at alumni.tu-berlin.de>



More information about the asterisk-code-review mailing list