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 : <action application="bridge" data="{record_waste_resources=true,ignore_early_media=true}sofia/external/${fwdno}"/>
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}