Session object is available in the lua script itself once the session is established. You don&#39;t have to pass it through dialpan.<br><br><div class="gmail_quote">On Fri, Jun 7, 2013 at 5:32 PM, Telecube - John <span dir="ltr">&lt;<a href="mailto:john@telecube.com.au" target="_blank">john@telecube.com.au</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    I *think* you will have had to answer the call first before the
    session is ready .. but it should already be available in the Lua
    script.<br>
    <br>
    -J<br>
    <br>
    <div>On 7/06/13 9:11 PM, Vincent Xia wrote:<br>
    </div>
    <blockquote type="cite">
      <div dir="ltr">
        <div>hi all,<br>
        </div>
        <div><br>
        </div>
        <div>i have a lua script(record.lua) to record the call:</div>
        <div><br>
        </div>
        <div>record.lua</div>
        <div>--------------------------------------</div>
        <div>callerid = argv[1]</div>
        <div>dest = argv[2]</div>
        <div>recording_dir = argv[3]</div>
        <div>filename = callerid ..dest</div>
        <div>recording_filename = string.format(&#39;%s%s&#39;, recording_dir,
          filename)</div>
        <div><br>
        </div>
        <div>if session:ready() then  -- NOTE: the session here is nil!</div>
        <div>    max_len_secs = 30</div>
        <div>    silence_threshold = 30</div>
        <div>    silence_secs = 5</div>
        <div>    test = session:recordFile(recording_filename,
          max_len_secs, silence_threshold, silence_secs);</div>
        <div>end</div>
        <div><br>
        </div>
        <div>but i don&#39;t know how to pass &quot;session&quot; from the default
          dialplan to lua in the following sentence:</div>
        <div><br>
        </div>
        <div>&lt;action application=&quot;lua&quot; data=&quot;record.lua
          ${caller_id_number} ${destination_number}
          $${recordings_dir}&quot;/&gt;</div>
        <div><br>
        </div>
        <div>any response is apprieciated!</div>
        <div><br>
        </div>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
      <pre>_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
<a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a>

FreeSWITCH-powered IP PBX: The CudaTel Communication Server
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a>

Official FreeSWITCH Sites
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a>

FreeSWITCH-users mailing list
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a>
</pre>
    </blockquote>
    <br>
  </div>

<br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><span style="color:rgb(0,0,102);font-family:georgia,serif">Ashish Gautam</span><br><font face="georgia, serif" color="#000066"><br>Nucleus Microsystems (Pvt.) Ltd.<br>
<br>Ph. 011 47574758</font>