[Freeswitch-users] What is so dangeres in "freeswitch.msleep()" in LUA?
Seven Du
dujinfang at gmail.com
Mon Mar 7 02:24:09 MSK 2011
session-based means you have a session, so you can just use
if session:ready() ....
session:sleep(1000)
On Mon, Mar 7, 2011 at 6:48 AM, Dmitry Saratsky <simpot at simpot.com> wrote:
> Hi All,
>
>
>
> According to: http://wiki.freeswitch.org/wiki/Mod_lua#freeswitch.msleep
>
> It is not good to use: “freeswitch.msleep()” in session-based script:
>
> NOTE: Do not use this on a session-based script or bad things will happen.
>
>
>
> Can anyone explain please why not and what does author mean with
> “session-based script”.
>
>
>
> I want to use it inside some function between I originate session and hangup
> it in the following way:
>
>
>
> repeat
>
> -- os.execute("sleep 1");
>
> freeswitch.msleep(1000);
>
> until ((not new_session:ready() == true) or
> (new_session:getVariable("fax_result_code") >= "0"))
>
> new_session:hangup();
>
>
>
> Is it danger for me to use this?
>
> _______________________________________________
> 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
>
>
--
About: http://about.me/dujinfang
Blog: http://www.dujinfang.com
Proj: http://www.freeswitch.org.cn
More information about the FreeSWITCH-users
mailing list