If you WANT to crash FreeSWITCH to test your recovery, monitoring, etc you can run "fsctl crash". This sounds like a bug. -Avi On Sun, Dec 9, 2012 at 10:25 AM, Thomas Hoellriegel <admin@blindi.net>wrote:
Hi guys, i found a easy way to crash fs.
first, you must record a testsoundfile 5 secs, for example: /usr/local/freeswitch/sounds/test.alaw Write the following luascript in: /usr/local/freeswitch/script/simpy-crash.lua with:
-- simply script to crash freeswitch session:sleep(100); session:answer() session:sleep(200); session:setInputCallback("onInput", ""); function onInput(s, type, obj) freeswitch.consoleLog("info", "Callback with type " .. type .. "\n"); -- freeswitch.consoleLog("info", "DTMF Digit: " .. obj.digit .. "\n");
if ( obj['digit'] == '1' ) then
session:streamFile("/usr/local/freeswitch/sounds/test.alaw") read_msg_menu() return("false");
end
if ( obj['digit'] == '2' ) then
-- if (obj.digit == "2") then -- session:streamFile(msg_file_play) session:streamFile("/usr/local/freeswitch/sounds/test.alaw") read_msg_menu() return("false");
end
if ( obj['digit'] == '3' ) then
-- if (obj.digit == "3") then -- session:streamFile(msg_file_play) session:streamFile("/usr/local/freeswitch/sounds/test.alaw") read_msg_menu() return("false");
end
end
function read_msg_menu( ) session:setInputCallback("onInput"); session:streamFile("/usr/local/freeswitch/sounds/test.alaw") end
read_msg_menu()
-- end script
edit: /usr/local/freeswitch/dialplan/default/crash.xml
<!-- crash test lua --> <!-- -->
<extension name="crashtest" > <condition field="destination_number" expression="^104$"> <action application="lua" data="simply-crash.lua"/> <!-- <action application="start_dtmf" /> --> </condition> </extension>
reload the dialplan: fs_cli -x "reloadxml"
Dial extension 104, and heare your voice. you must break the voice: press 90 times 1. Fs is ready to crash. Fs crash with segfault. This is a good bug for sysadmins.-).
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org