]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-4015 --resolve
authorKen Rice <krice@freeswitch.org>
Tue, 27 Mar 2012 20:40:05 +0000 (15:40 -0500)
committerKen Rice <krice@freeswitch.org>
Tue, 27 Mar 2012 20:40:05 +0000 (15:40 -0500)
src/mod/languages/mod_lua/freeswitch_lua.cpp
src/mod/languages/mod_lua/mod_lua.cpp

index 96897a24c951f0c8989b459f385d0173aa90d87a..679c9fbee40c9e27ada852a63de4cf8193aab496 100644 (file)
@@ -4,7 +4,7 @@
 using namespace LUA;
 
 extern "C" {
-       int docall(lua_State * L, int narg, int clear, int perror);
+       int docall(lua_State * L, int narg, int nresults, int perror);
 };
 
 Session::Session():CoreSession()
@@ -147,7 +147,7 @@ void Session::do_hangup_hook()
                        arg_count++;
                }
 
-               docall(L, arg_count, 0, 1);
+               docall(L, arg_count, 1, 1);
 
                const char *err = lua_tostring(L, -1);
                
@@ -294,7 +294,7 @@ switch_status_t Session::run_dtmf_callback(void *input, switch_input_type_t ityp
                                arg_count++;
                        }
 
-                       docall(L, arg_count, 0, 1);
+                       docall(L, arg_count, 1, 1);
 
                        ret = lua_tostring(L, -1);
                        lua_pop(L, 1);
@@ -319,7 +319,7 @@ switch_status_t Session::run_dtmf_callback(void *input, switch_input_type_t ityp
                                arg_count++;
                        }
 
-                       docall(L, arg_count, 0, 1);
+                       docall(L, arg_count, 1, 1);
                        ret = lua_tostring(L, -1);
                        lua_pop(L, 1);
 
@@ -397,7 +397,7 @@ int Dbh::query_callback(void *pArg, int argc, char **argv, char **cargv)
     lua_settable(lua_fun->L, -3);
   }
 
-       docall(lua_fun->L, 1, 0, 1);
+       docall(lua_fun->L, 1, 1, 1);
        ret = lua_tonumber(lua_fun->L, -1);
        lua_pop(lua_fun->L, 1);
 
index 765bdfcc9804d2b89507054609263ccd4e440979..1a2814a8011bd8146133f4b1c47760f3ad8f29d1 100644 (file)
@@ -80,7 +80,7 @@ static int traceback(lua_State * L)
        return 1;
 }
 
-int docall(lua_State * L, int narg, int clear, int perror)
+int docall(lua_State * L, int narg, int nresults, int perror)
 {
        int status;
        int base = lua_gettop(L) - narg;        /* function index */
@@ -88,7 +88,7 @@ int docall(lua_State * L, int narg, int clear, int perror)
        lua_pushcfunction(L, traceback);        /* push traceback function */
        lua_insert(L, base);            /* put it under chunk and args */
 
-       status = lua_pcall(L, narg, (clear ? 0 : LUA_MULTRET), base);
+       status = lua_pcall(L, narg, nresults, base);
 
        lua_remove(L, base);            /* remove traceback function */
        /* force a complete garbage collection in case of errors */