local function record_session() recording_dir = '/tmp/' filename = freeswitch_call_uuid .. '.wav' recording_filename = string.format('%s%s', recording_dir, filename) recording_filename_str = string.format('%s%s', recording_dir, filename) if session:ready() then session:setInputCallback('onInputCBF', '') max_len_secs = 240 silence_threshold = 500 silence_secs = 3 recording_file = session:recordFile(recording_filename, max_len_secs, silence_threshold, silence_secs); recording_ended = os.time() currently_recording_session = false end end function onInputCBF(s, _type, obj, arg) local k, v = nil, nil local _debug = true if _debug then for k, v in pairs(obj) do printSessionFunctions(obj) print(string.format('obj k-> %s v->%s\n', tostring(k), tostring(v))) end if _type == 'table' then for k, v in pairs(_type) do print(string.format('_type k-> %s v->%s\n', tostring(k), tostring(v))) end end print(string.format('\n(%s == dtmf) and (obj.digit [%s])\n', _type, obj.digit)) end if (_type == "dtmf") then return 'break' else return '' end end Dial string is :