脚本代码
脚本名称:setrandomcaller.lua
调用方式:在拨号方案中调用
local callerNumbers={
"02012344566",
"02012344567"
}
math.randomseed(tostring(os.time()):reverse():sub(1, 6))
id = math.random(1,#callerNumbers)
destNum = session:getVariable("destination_number") or "";
freeswitch.consoleLog("info", "___" .. argv[0] .. ":" .. destNum .. "___change caller number to " .. callerNumbers[id] .. "\n");
session:setVariable("effective_caller_id_number", callerNumbers[id])