[Freeswitch-users] Lua scripts

Nduwayezu, Joselyne 35633 at heb.be
Tue May 17 19:58:45 MSD 2016


Hello i use this lua script tha i found on freeswitch wiki
But when i run it i have the errors:
syntax error near unexpected token ;
seesion.answer();

and when i remove the ";" i have the error on the while loop, syntax error
near the unexpected token ==, while (session:ready() == true.

I there something i did not conigure in order the script to work? do we put
";" after an instructtion like session:answer() or not.

Thank you or your reply.

session:answer();
while (session:ready() == true) do
    session:setAutoHangup(false);
    session:set_tts_params("flite", "kal");
    session:speak("Welcome. Welcome to the VoIp World!. this is a Blind
Users Programing Community. powered by Freeswitch, the free / ultimate PBX.
thank to toni!");
    session:sleep(100);
    session:speak("please select an Action.");
    session:sleep(100);
    session:speak("to call the conference, press 1");
    session:sleep(100);
    session:speak("to call Freeswitch IVR, press 2");
    session:sleep(100);
    session:speak("to call Voice Mail, press 3");
    session:sleep(100);
    session:speak("for Music on hold, press 4");
    session:sleep(100);
    session:speak("to call me, press 0");
    session:sleep(3000);
    digits = session:getDigits(1, "", 3000);
    if (digits == "1")  then
        session:execute("transfer","9888");
    end
    if (digits == "2")  then
        session:execute("transfer","5000");
    end
    if (digits == "3")  then
        session:execute("transfer","4000");
    end
    if (digits == "4")  then
        session:execute("transfer","9999");
    end
    if (digits == "0")  then
        session:execute("transfer","voipaware at sip.voipuser.org");
    end
end




NDUWAYEZU Joselyne

-- 
Haute École de Bruxelles
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20160517/eac5009c/attachment.html 


Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list