[core][mod_sofia] remove ZRTP (deemed obsolete).

[unit-tests][build-system][docs] remove references to ZRTP.
This commit is contained in:
Dragos Oancea
2022-10-28 18:34:18 +03:00
parent 2ab600c71a
commit 8e59603d98
329 changed files with 35 additions and 90031 deletions

View File

@@ -42,7 +42,6 @@ tbl_types = {
['phonetic-ascii'] = 1,
['time'] = 1,
['voicemail'] = 1,
['zrtp'] = 1
};
tbl_rates = {['8000'] = 1 ,['16000'] = 1, ['32000'] = 1, ['48000'] = 1};
@@ -71,4 +70,4 @@ else
else
freeswitch.consoleLog("ERR","Result of system call: " .. what .. " " .. code .. "\n");
end
end
end

View File

@@ -1,38 +0,0 @@
-- ZRTP Enrollment Agent
session:setVariable("zrtp_secure_media", "true");
session:setVariable("zrtp_enrollment", "true");
session:sleep(100);
session:answer();
session:streamFile("zrtp/zrtp-status_securing.wav");
session:sleep(3000);
-- Give the agent time to bring up ZRTP.
local zrtp_secure_media_confirmed = session:getVariable("zrtp_secure_media_confirmed_audio");
local zrtp_new_user_enrolled = session:getVariable("zrtp_new_user_enrolled_audio");
local zrtp_already_enrolled = session:getVariable("zrtp_already_enrolled_audio");
if zrtp_secure_media_confirmed == "true" then
session:streamFile("zrtp/zrtp-status_secure.wav");
else
session:streamFile("zrtp/zrtp-status_notsecure.wav");
end
session:streamFile("zrtp/zrtp-enroll_welcome.wav");
session:sleep(1000);
if zrtp_secure_media_confirmed == "true" then
if zrtp_new_user_enrolled == "true" then
session:streamFile("zrtp/zrtp-enroll_confirmed.wav");
session:sleep(3000);
else
if zrtp_already_enrolled == "true" then
session:streamFile("zrtp/zrtp-enroll_already_enrolled.wav");
end
end
else
session:streamFile("zrtp/zrtp-enroll_notzrtp.wav");
end
session:sleep(1000);
session:streamFile("zrtp/zrtp-thankyou_goodbye.wav");
session:sleep(1000);

View File

@@ -1,87 +0,0 @@
-- Copyright (c) 2011-2012, Travis Cross.
--
-- The contents of this file are subject to the Mozilla Public License
-- Version 1.1 (the "License"); you may not use this file except in
-- compliance with the License. You may obtain a copy of the License
-- at http://www.mozilla.org/MPL/
--
-- Software distributed under the License is distributed on an "AS IS"
-- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-- the License for the specific language governing rights and
-- limitations under the License.
--
-- zrtp_proxy_media.lua
--
-- The logic in this script enables ZRTP sessions to negotiate
-- end-to-end security associations, which is desirable whether or not
-- the switch natively supports ZRTP itself.
--
-- To enable this logic, call the script from the top of your dialplan
-- as so:
--
-- <extension name="global" continue="true">
-- <condition break="never">
-- <action application="lua" data="lua/zrtp_proxy_media.lua"/>
-- </condition>
-- </extension>
--
-- If any particular call flow should never have proxy_media enabled,
-- such as for connecting to voicemail systems or conferences, make
-- sure this is called before the bridge:
--
-- <action application="lua" data="lua/zrtp_proxy_media.lua disable"/>
api=freeswitch.API()
function sappend(s1,s2) if s1 and #s1>0 then return s1..s2 else return s2 end end
function log(level,msg) return freeswitch.consoleLog(level,msg.."\n") end
function ready() return session:ready() end
function getvar(var) return session:getVariable(var) end
function getvarp(var) return getvar(var)=="true" end
function setvar_a(k,v) return session:setVariable(k,v) end
function append_var(k,v) return setvar_a(k,sappend(getvar(k),v)) end
function export(k) return append_var("export_vars",","..k) end
function setvar_ab(k,v) if v then setvar_a(k,v) end return export(k) end
function setvar_b(k,v) return setvar_ab("nolocal:"..k,v) end
function enable_zd(msg)
log("info",msg)
setvar_ab("zrtp_set","true")
setvar_ab("proxy_media","true")
setvar_ab("zrtp_secure_media","false")
end
function disable_zd(msg)
log("info",msg)
setvar_ab("zrtp_set","true")
setvar_ab("proxy_media","false")
setvar_ab("zrtp_secure_media","true")
end
function xfer(x)
return session:transfer(x,getvar("dialplan"),getvar("context"))
end
function main()
if ready() then
session:setAutoHangup(false)
local dst=getvar("destination_number")
if argv[1]=="disable" then
return disable_zd("zrtp-direct disabled on this call flow")
elseif getvarp("zrtp_set") then
return log("notice","zrtp already decided; doing nothing") end
local x=dst:match("^%*%*%*(.*)$")
if x then
enable_zd("going zrtp-direct based on star code")
return xfer(x) end
local x=dst:match("^%*%*(.*)$")
if x then
disable_zd("going zrtp-indirect based on star code")
return xfer(x) end
if getvar("switch_r_sdp"):match("a=zrtp%-hash:") then
return enable_zd("going zrtp-direct based on a=zrtp-hash") end
return disable_zd("not going zrtp-direct")
end
end
main()

View File

@@ -1,103 +0,0 @@
-- zrtp_sas_proxy.lua
--
-- Copyright (c) 2011-2013 Travis Cross
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
-- in the Software without restriction, including without limitation the rights
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-- copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
--
-- The above copyright notice and this permission notice shall be included in
-- all copies or substantial portions of the Software.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-- THE SOFTWARE.
--
--
-- When we're acting as a ZRTP man-in-the-middle, proxy the SAS (Short
-- Authentication String) from one leg of the call to the other.
--
-- This script should be called asynchonously with luarun. e.g.:
--
-- <action application="export" data="nolocal:api_on_answer=luarun zrtp_sas_proxy.lua ${uuid}"/>
--
aleg=argv[1]
api=freeswitch.API()
function log(level,msg) return freeswitch.consoleLog(level,"zrtp_sas: "..msg.."\n") end
function sleep(sec) return freeswitch.msleep(sec*1000) end
function ready() return api:execute("uuid_exists",aleg)=="true" end
function getvar(uuid,var)
local x=api:execute("uuid_getvar",uuid.." "..var)
if x=="_undef_" then return nil end
return x
end
function getvarp(uuid,var) return getvar(uuid,var)=="true" end
function display(uuid,msg)
local cidn=getvar(uuid,"caller_id_name")
return api:execute("uuid_display",uuid.." "..msg.." "..cidn)
end
function mk_sas(sas1,sas2)
if sas1 and sas2 then return sas1.." "..sas2
else return sas1 or sas2 or "" end
end
function get_sas(uuid)
return mk_sas(getvar(uuid,"zrtp_sas1_string_audio"),
getvar(uuid,"zrtp_sas2_string"))
end
function log_sas(leg,uuid)
return log("notice",leg..": "..uuid.." sas: "..get_sas(uuid))
end
function display_sas(to,from)
return display(to," ("..get_sas(from)..")")
end
function get_bleg(aleg)
local retries=15 bleg=nil
while ready() do
if retries<1 then return nil end
local bleg=getvar(aleg,"signal_bond")
if bleg then return bleg end
log("debug","waiting for bleg uuid...")
sleep(1)
retries=retries-1
end
end
function handle_sas(aleg,bleg)
local retries=45 af=false bf=false
while ready() do
if retries<1 then return nil end
if not af and getvarp(aleg,"zrtp_secure_media_confirmed_audio") then
af=true
log_sas("aleg",aleg)
display_sas(bleg,aleg)
end
if not bf and getvarp(bleg,"zrtp_secure_media_confirmed_audio") then
bf=true
log_sas("bleg",bleg)
display_sas(aleg,bleg)
end
if (af and bf) then break
elseif af then log("debug","waiting on bleg zrtp...")
elseif bf then log("debug","waiting on aleg zrtp...")
else log("debug","waiting for zrtp...") end
sleep(1)
retries=retries-1
end
end
if not (getvarp(aleg,"zrtp_passthru") or getvarp(aleg,"proxy_media")) then
handle_sas(aleg,get_bleg(aleg))
end