[Freeswitch-users] how to pass session from dialplan xml to lua script?

Steven Ayre steveayre at gmail.com
Fri Jun 7 16:23:31 MSD 2013


It's session.ready (session dot ready) not session:ready (session colon
ready)

-Steve



On 7 June 2013 12:11, Vincent Xia <gmangudai at 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 at freeswitch.org
> http://www.freeswitchsolutions.com
>
> 
> 
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20130607/a6960d98/attachment-0001.html 


Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list