[Freeswitch-users] loops

Nazim Aghabayov nazim.aghabayov at gmail.com
Tue Dec 21 14:27:17 MSK 2010


You are trying to call the function which is not declared yet. First
define a function, then call it.
You should really read this: http://www.lua.org/manual/5.1/

Regards,
Nazim

On 12/21/2010 01:36 PM, Sam wrote:
> Hello,
>
> I am trying to get a loop done using if ... then .. return function,
> using below syntax but getting error on it.
>
>
> if (session:ready()) then return ack()
> end
>
>
> function ack()
>
> session:answer();
> session:streamFile("/usr/local/freeswitch/sounds/en/us/callie/zrtp/8000/zrtp-somethings_wrong.wav")
>
> end
>
>
>
> error:---
> EXECUTE sofia/internal/7001 at 192.168.2.190 lua(hello.lua)
> 2010-12-21 14:55:34.724790 [ERR] mod_lua.cpp:182
> /usr/local/freeswitch/scripts/hello.lua:1: attempt to call global 'ack' (a
> nil value)
> stack traceback:
>         /usr/local/freeswitch/scripts/hello.lua:1: in main chunk
>
>
> Any ideas to resolve this.
>
> Regards
> Sam
>
>
>
> _______________________________________________
> 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




More information about the FreeSWITCH-users mailing list