mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-23 12:42:02 +00:00
FS-9638
This commit is contained in:
@@ -47,6 +47,8 @@ void Session::destroy(const char *err)
|
||||
switch_safe_free(cb_function);
|
||||
switch_safe_free(cb_arg);
|
||||
|
||||
unsetInputCallback();
|
||||
|
||||
CoreSession::destroy();
|
||||
|
||||
|
||||
@@ -240,6 +242,7 @@ void Session::unsetInputCallback(void)
|
||||
switch_safe_free(cb_arg);
|
||||
args.input_callback = NULL;
|
||||
ap = NULL;
|
||||
switch_channel_clear_flag_recursive(channel, CF_QUEUE_TEXT_EVENTS);
|
||||
}
|
||||
|
||||
void Session::setInputCallback(char *cbfunc, char *funcargs)
|
||||
@@ -262,6 +265,9 @@ void Session::setInputCallback(char *cbfunc, char *funcargs)
|
||||
|
||||
args.input_callback = dtmf_callback;
|
||||
ap = &args;
|
||||
|
||||
switch_channel_set_flag_recursive(channel, CF_QUEUE_TEXT_EVENTS);
|
||||
|
||||
}
|
||||
|
||||
switch_status_t Session::run_dtmf_callback(void *input, switch_input_type_t itype)
|
||||
|
||||
@@ -688,7 +688,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_lua_load)
|
||||
SWITCH_ADD_API(api_interface, "luarun", "run a script", luarun_api_function, "<script>");
|
||||
SWITCH_ADD_API(api_interface, "lua", "run a script as an api function", lua_api_function, "<script>");
|
||||
SWITCH_ADD_APP(app_interface, "lua", "Launch LUA ivr", "Run a lua ivr on a channel", lua_function, "<script>",
|
||||
SAF_SUPPORT_NOMEDIA | SAF_ROUTING_EXEC | SAF_ZOMBIE_EXEC);
|
||||
SAF_SUPPORT_NOMEDIA | SAF_ROUTING_EXEC | SAF_ZOMBIE_EXEC | SAF_SUPPORT_TEXT_ONLY);
|
||||
SWITCH_ADD_DIALPLAN(dp_interface, "LUA", lua_dialplan_hunt);
|
||||
|
||||
SWITCH_ADD_CHAT_APP(chat_app_interface, "lua", "execute a lua script", "execute a lua script", lua_chat_function, "<script>", SCAF_NONE);
|
||||
|
||||
@@ -4967,6 +4967,33 @@ fail:
|
||||
}
|
||||
|
||||
|
||||
static int _wrap_CoreSession_print(lua_State* L) {
|
||||
int SWIG_arg = 0;
|
||||
CoreSession *arg1 = (CoreSession *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
int result;
|
||||
|
||||
SWIG_check_num_args("CoreSession::print",2,2)
|
||||
if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::print",1,"CoreSession *");
|
||||
if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("CoreSession::print",2,"char *");
|
||||
|
||||
if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
|
||||
SWIG_fail_ptr("CoreSession_print",1,SWIGTYPE_p_CoreSession);
|
||||
}
|
||||
|
||||
arg2 = (char *)lua_tostring(L, 2);
|
||||
result = (int)(arg1)->print(arg2);
|
||||
lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
|
||||
return SWIG_arg;
|
||||
|
||||
if(0) SWIG_fail;
|
||||
|
||||
fail:
|
||||
lua_error(L);
|
||||
return SWIG_arg;
|
||||
}
|
||||
|
||||
|
||||
static int _wrap_CoreSession_preAnswer(lua_State* L) {
|
||||
int SWIG_arg = 0;
|
||||
CoreSession *arg1 = (CoreSession *) 0 ;
|
||||
@@ -6579,6 +6606,7 @@ delete arg1;
|
||||
static swig_lua_method swig_CoreSession_methods[] = {
|
||||
{"insertFile", _wrap_CoreSession_insertFile},
|
||||
{"answer", _wrap_CoreSession_answer},
|
||||
{"print", _wrap_CoreSession_print},
|
||||
{"preAnswer", _wrap_CoreSession_preAnswer},
|
||||
{"hangup", _wrap_CoreSession_hangup},
|
||||
{"hangupState", _wrap_CoreSession_hangupState},
|
||||
|
||||
Reference in New Issue
Block a user