It's session.ready (session dot ready) not session:ready (session colon ready)<div><br></div><div>-Steve</div><div><br><div><br><br><div class="gmail_quote">On 7 June 2013 12:11, Vincent Xia <span dir="ltr"><<a href="mailto:gmangudai@gmail.com" target="_blank">gmangudai@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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('%s%s', 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't know how to pass "session" from the default dialplan to lua in the following sentence:</div><div><br></div><div><action application="lua" data="record.lua ${caller_id_number} ${destination_number} $${recordings_dir}"/></div>
<div><br></div><div>any response is apprieciated!</div><div><br></div></div>
<br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org" target="_blank">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" target="_blank">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></div>
</div>