Hi, Your missing an "V" in the arg name, "argv". You can try do the following: in diaplan: <extension name="call lua script" continue="true"> <condition> <action application="lua" data="yourcript.lua var1 var2"/> </condition> </extension> in the lua: var1 = argv[1] or "default value to avoid errors" var2 = argv[1] or "default value var2" freeswitch.consoleLog("info", tostring(var1) .. "\n") freeswitch.consoleLog("info", tostring(var2) .. "\n") you can also call the lua script directly from the cli: fs:> luarun yourcript.lua var1 var2 Regards, António On Tue, 2012-03-13 at 02:46 -0700, king2kin wrote:
Hi all,
It's said we could access the arguments passed to lua script by variable 'arg[i]' where i > 0.
for example, { lua dummy.lua aa 100 } then, we will have as follows: arg[1] -> aa arg[2] -> 100
However, I always get 'nil' values for 'arg[i]' or 'arg' while running the lua script.
How can I pass and retrieve arguments or parameters to a lua script of FreeSwitch?
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.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
-- Un cordial saludo / Best regards, _________________________ António Silva E-mail:asilva@wirelessmundi.com