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".

On Mon, Feb 9, 2015 at 8:24 AM, Денис <denis@ringme.ru> wrote:

On 08.02.2015 08:43, John Nash wrote:
> 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:
consulting@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@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org