Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function haveValue (a)
- return a and a ~= ""
- end
- local event = event
- local freeswitch = freeswitch
- freeswitch.consoleLog("info", event:serialize())
- local api = freeswitch.API()
- local uuid = tostring(event:getHeader("Other-Leg-Unique-ID"))
- if uuid and uuid ~= "" then
- local recording_leg_uuid = tostring(event:getHeader("Unique-ID"))
- local recording_file_name = tostring(event:getHeader("variable_record_file_name"))
- local a_number = tostring(event:getHeader("Caller-Caller-ID-Number"))
- local b_called_by_a = tostring(api:executeString("hash select/stop_recording_b_by_a/"..recording_leg_uuid))
- local c_called_by_b = tostring(event:getHeader("Caller-Callee-ID-Number"))
- local c_called_by_b_hash = tostring(api:executeString("hash select/stop_recording_c_by_b/"..b_called_by_a))
- if c_called_by_b == c_called_by_b_hash and
- haveValue(c_called_by_b) and
- api:executeString("uuid_getvar " .. uuid .. " sofia_profile_name") == "external" then
- api:executeString("uuid_broadcast " .. recording_leg_uuid .. " stop_record_session::" .. recording_file_name)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement