Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local event = event
- local freeswitch = freeswitch
- freeswitch.consoleLog("info", event:serialize())
- local api = freeswitch.API()
- local function haveValue (a)
- return a and a ~= ""
- end
- local function getValueByUuid(uuid, var)
- local val = api:executeString("uuid_getvar " .. uuid .. " " .. var)
- freeswitch.consoleLog("info", uuid..": "..var.."="..val.."\n")
- return val
- end
- local function viaExternal(uuid)
- return getValueByUuid(uuid, "sofia_profile_name") == "external"
- end
- local other_uuid = event:getHeader("Other-Leg-Unique-ID")
- local uuid = event:getHeader("Unique-ID")
- if haveValue(uuid) and haveValue(other_uuid) and viaExternal(uuid) and viaExternal(other_uuid) then
- api:executeString("uuid_broadcast " .. uuid .. " stop_record_session::all")
- api:executeString("uuid_broadcast " .. other_uuid .. " stop_record_session::all")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement