Discussion:
[Freeswitch-users] api:execute vs session:execute
John Nash
2015-02-08 05:43:57 UTC
Permalink
While reading documentation I saw that to call another lua script from
inside a lua script we use ..

api = freeswitch.API();
reply = api:executeString("luarun another.lua");

But we can also run another lua script using session:execute. I was
wondering what is the difference, which one should be preferred?
Денис
2015-02-09 13:24:23 UTC
Permalink
Post by John Nash
While reading documentation I saw that to call another lua script from
inside a lua script we use ..
api = freeswitch.API();
reply = api:executeString("luarun another.lua");
But we can also run another lua script using session:execute. I was
wondering what is the difference, which one should be preferred?
on api no session variables?
imho - different array of variables.

_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
***@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-***@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Christopher Rienzo
2015-02-09 13:38:30 UTC
Permalink
session:execute("lua"... = run as application in your session's thread
(calling lua script will wait for completion).

api:execute("luarun" ... = run in separate thread with no association to
the session (calling lua script will continue executing in session's thread)

Alternatively, you can call a different lua script or module using
"require".
Post by Денис
Post by John Nash
While reading documentation I saw that to call another lua script from
inside a lua script we use ..
api = freeswitch.API();
reply = api:executeString("luarun another.lua");
But we can also run another lua script using session:execute. I was
wondering what is the difference, which one should be preferred?
on api no session variables?
imho - different array of variables.
_________________________________________________________________________
http://www.freeswitchsolutions.com
Official FreeSWITCH Sites
http://www.freeswitch.org
http://confluence.freeswitch.org
http://www.cluecon.com
FreeSWITCH-users mailing list
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Loading...