[Freeswitch-users] Lua scripts

Michael Collins msc at freeswitch.org
Tue May 17 20:12:04 MSD 2016


Lua does not require a semi-colon at the end of each line of code, although
it typically does not object either.

How are you launching this script?

-MSC

On Tue, May 17, 2016 at 8:58 AM, Nduwayezu, Joselyne <35633 at heb.be> wrote:

> 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
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://confluence.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20160517/ba6d90f0/attachment.html 


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