[Freeswitch-users] [ERR] mod_lua.cpp:103 attempt to call a nil value in recordFile function

Akshaya j akshaya18j at gmail.com
Thu Oct 26 11:41:07 UTC 2017


Hi team,
Spec:
OS - Debian
FS server Version -1.6.15
I use Zoiper clients (in Ubuntu machine) directly connected to FS server.
I'm supposed to write voicemail scripts where i get the call and bridge to
Avaya gateway if there is no response i load a lua script.
    The lua script contains...........
             if session:ready() then
                   session:speak("Record your message now, to end recording
press pound");
                    session:setInputCallback('onInput','');
                    test = session:recordFile(recording_filename, 60, 30, 5)
                     session:consoleLog("info", "session:recordFile() = "
.. test )

And my Input CallBack function has got.....
function onInput(session, input_type, data)
        session:consoleLog("info", "inside" )
        if input_type == "dtmf" then
                return "break"
        end
end
Now my problem is I dont see any log which is inside the callback
function.I can record the voice and getting saved but there is an error....
[DEBUG] switch_rtp.c:7255 RTP RECV DTMF #:1280
[INFO] switch_channel.c:515 RECV DTMF #:1280
[ERR] mod_lua.cpp:103 attempt to call a nil value
stack traceback:
[C]: in function 'recordFile'
/usr/local/freeswitch/scripts/test.lua:19: in main chunk

   I can witness that the session is receiving the DTMF signal but then the
function is not getting executed. I tried commenting the func call of
callback and I can witness the DTMF is not sensed and hence the record
termination happens only after silence_threshold.
    I badly need to process the keypress DTMF for more options without
console err.
    NOTE: instead of recordFile() I tried speak() even by then i get the
same error "attempt to call a nil value" in speak function.
Please save me FS.!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20171026/313b0595/attachment.html>


More information about the FreeSWITCH-users mailing list