<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.30.3">
</HEAD>
<BODY>
Hi,<BR>
<BR>
Your&nbsp; missing an &quot;V&quot; in the arg name, &quot;argv&quot;.<BR>
<BR>
You can try do the following:<BR>
<BR>
in diaplan:<BR>
<BR>
&lt;extension name=&quot;call lua script&quot; continue=&quot;true&quot;&gt;<BR>
&lt;condition&gt;<BR>
&lt;action application=&quot;lua&quot; data=&quot;yourcript.lua var1 var2&quot;/&gt;<BR>
&lt;/condition&gt;<BR>
&lt;/extension&gt;<BR>
<BR>
<BR>
in the lua:<BR>
<BR>
var1 = argv[1] or &quot;default value to avoid errors&quot;<BR>
var2 = argv[1] or &quot;default value var2&quot;<BR>
<BR>
freeswitch.consoleLog(&quot;info&quot;, tostring(var1) .. &quot;\n&quot;)<BR>
freeswitch.consoleLog(&quot;info&quot;, tostring(var2) .. &quot;\n&quot;)<BR>
<BR>
<BR>
you can also call the lua script directly from the cli:<BR>
<BR>
fs:&gt; luarun yourcript.lua var1 var2<BR>
<BR>
<BR>
Regards,<BR>
Ant&#243;nio<BR>
<BR>
<BR>
<BR>
On Tue, 2012-03-13 at 02:46 -0700, king2kin wrote: <BR>
<BLOCKQUOTE TYPE=CITE>
    Hi all, <BR>
    &nbsp;<BR>
    It's said we could access the arguments passed to lua script by variable 'arg[i]' where i &gt; 0.<BR>
    &nbsp;<BR>
    for example,&nbsp; { lua dummy.lua&nbsp; aa 100 }<BR>
    then, we will have as follows:<BR>
    arg[1] -&gt; aa<BR>
    arg[2] -&gt; 100<BR>
    &nbsp;<BR>
    However, I always get 'nil' values for 'arg[i]' or 'arg' while running the lua script.<BR>
    &nbsp;<BR>
    How can I pass and retrieve arguments or parameters to a lua script of FreeSwitch?<BR>
    &nbsp;<BR>
    &nbsp;<BR>
    &nbsp;<BR>
    &nbsp;<BR>
    &nbsp;<BR>
    &nbsp;<BR>
    &nbsp;<BR>
    &nbsp;
<PRE>
_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
<A HREF="mailto:consulting@freeswitch.org">consulting@freeswitch.org</A>
<A HREF="http://www.freeswitchsolutions.com">http://www.freeswitchsolutions.com</A>

FreeSWITCH-powered IP PBX: The CudaTel Communication Server
<A HREF="http://www.cudatel.com">http://www.cudatel.com</A>

Official FreeSWITCH Sites
<A HREF="http://www.freeswitch.org">http://www.freeswitch.org</A>
<A HREF="http://wiki.freeswitch.org">http://wiki.freeswitch.org</A>
<A HREF="http://www.cluecon.com">http://www.cluecon.com</A>

FreeSWITCH-users mailing list
<A HREF="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</A>
<A HREF="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</A>
UNSUBSCRIBE:<A HREF="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</A>
<A HREF="http://www.freeswitch.org">http://www.freeswitch.org</A>
</PRE>
</BLOCKQUOTE>
<BR>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
<PRE>
-- 

Un cordial saludo / Best regards, 

&nbsp;_________________________

Ant&#243;nio Silva

E-mail:<A HREF="mailto:asilva@wirelessmundi.com">asilva@wirelessmundi.com</A>
</PRE>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>