how to pass session from dialplan xml to lua script?
hi all, i have a lua script(record.lua) to record the call: record.lua -------------------------------------- callerid = argv[1] dest = argv[2] recording_dir = argv[3] filename = callerid ..dest recording_filename = string.format('%s%s', recording_dir, filename) if session:ready() then -- NOTE: the session here is nil! max_len_secs = 30 silence_threshold = 30 silence_secs = 5 test = session:recordFile(recording_filename, max_len_secs, silence_threshold, silence_secs); end but i don't know how to pass "session" from the default dialplan to lua in the following sentence: <action application="lua" data="record.lua ${caller_id_number} ${destination_number} $${recordings_dir}"/> any response is apprieciated!
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. -J On 7/06/13 9:11 PM, Vincent Xia wrote:
hi all,
i have a lua script(record.lua) to record the call:
record.lua -------------------------------------- callerid = argv[1] dest = argv[2] recording_dir = argv[3] filename = callerid ..dest recording_filename = string.format('%s%s', recording_dir, filename)
if session:ready() then -- NOTE: the session here is nil! max_len_secs = 30 silence_threshold = 30 silence_secs = 5 test = session:recordFile(recording_filename, max_len_secs, silence_threshold, silence_secs); end
but i don't know how to pass "session" from the default dialplan to lua in the following sentence:
<action application="lua" data="record.lua ${caller_id_number} ${destination_number} $${recordings_dir}"/>
any response is apprieciated!
_________________________________________________________________________ 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
Session object is available in the lua script itself once the session is established. You don't have to pass it through dialpan. On Fri, Jun 7, 2013 at 5:32 PM, Telecube - John <john@telecube.com.au>wrote:
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.
-J
On 7/06/13 9:11 PM, Vincent Xia wrote:
hi all,
i have a lua script(record.lua) to record the call:
record.lua -------------------------------------- callerid = argv[1] dest = argv[2] recording_dir = argv[3] filename = callerid ..dest recording_filename = string.format('%s%s', recording_dir, filename)
if session:ready() then -- NOTE: the session here is nil! max_len_secs = 30 silence_threshold = 30 silence_secs = 5 test = session:recordFile(recording_filename, max_len_secs, silence_threshold, silence_secs); end
but i don't know how to pass "session" from the default dialplan to lua in the following sentence:
<action application="lua" data="record.lua ${caller_id_number} ${destination_number} $${recordings_dir}"/>
any response is apprieciated!
_________________________________________________________________________ Professional FreeSWITCH Consulting Services:consulting@freeswitch.orghttp://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Serverhttp://www.cudatel.com
Official FreeSWITCH Siteshttp://www.freeswitch.orghttp://wiki.freeswitch.orghttp://www.cluecon.com
FreeSWITCH-users mailing listFreeSWITCH-users@lists.freeswitch.orghttp://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-usershttp://www.frees...
_________________________________________________________________________ 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
-- Ashish Gautam Nucleus Microsystems (Pvt.) Ltd. Ph. 011 47574758
It's session.ready (session dot ready) not session:ready (session colon ready) -Steve On 7 June 2013 12:11, Vincent Xia <gmangudai@gmail.com> wrote:
hi all,
i have a lua script(record.lua) to record the call:
record.lua -------------------------------------- callerid = argv[1] dest = argv[2] recording_dir = argv[3] filename = callerid ..dest recording_filename = string.format('%s%s', recording_dir, filename)
if session:ready() then -- NOTE: the session here is nil! max_len_secs = 30 silence_threshold = 30 silence_secs = 5 test = session:recordFile(recording_filename, max_len_secs, silence_threshold, silence_secs); end
but i don't know how to pass "session" from the default dialplan to lua in the following sentence:
<action application="lua" data="record.lua ${caller_id_number} ${destination_number} $${recordings_dir}"/>
any response is apprieciated!
_________________________________________________________________________ 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
participants (4)
-
Ashish gautam
-
Steven Ayre
-
Telecube - John
-
Vincent Xia