jizhask
1/13/2018 - 1:58 PM

handle_ai.lua

handle_ai.lua

dofile("./commscript/handle_ai.lua")

function key_press(session, input_type, data, args)
  fslog("debug","*************Key pressed:", "digit");
   if input_type == "dtmf" then
     --session:consoleLog("info", "******************************Key pressed: " .. data["digit"])
     fslog("debug","*************Key pressed:", data["digit"]);
     return "break"
   end
 end

function my_cb(s, type, obj, arg)
  fslog("debug","lua--ai2playfile.lua--callback",s);
   if (type == "dtmf") then
    if obj['digit'] == "#" then
    return false;
    end
   end
end

function recoredFile(telnum)
  --fslog("debug",argv[0],"这个是我的中文测试", telnum);
    local uuid = getUUIDByNum(api,telnum);
    --local request_body = [[{"cfg": "xtw","phonenum": "]]..telnum..[[","seqid": "]]..uuid..[["}]]
    --local url = "http://172.16.8.221:7000/restore"

    --local uuid=getUUIDByNum(api,telnum);
--fslog("debug",argv[0],"&&&&&&&&&&&&&&&&&&&&&222:", telnum);
    local cmd = "originate loopback/evd"..telnum.." &eavesdrop("..uuid..")"
    api:executeString(cmd);
    --fslog("debug",argv[0],"&&&&&&&&&&&&&&&&&&&&&333:", telnum);

    local ai_voice_name = "";
    local ai_calltate = "";
    --session:setVariable("ai_voice_name", voicename)
end