From c3fb7f0c2f58c3f9060d812bc958a20d4bbcab8a Mon Sep 17 00:00:00 2001 From: Brian West Date: Thu, 18 Jun 2009 18:03:10 +0000 Subject: [PATCH] adding zrtp enrollment script, we do auto enrollment and verification git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13843 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- scripts/lua/zrtp_agent.lua | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 scripts/lua/zrtp_agent.lua diff --git a/scripts/lua/zrtp_agent.lua b/scripts/lua/zrtp_agent.lua new file mode 100644 index 0000000000..6175228903 --- /dev/null +++ b/scripts/lua/zrtp_agent.lua @@ -0,0 +1,38 @@ +-- 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"); +local zrtp_new_user_enrolled = session:getVariable("zrtp_new_user_enrolled"); +local zrtp_already_enrolled = session:getVariable("zrtp_already_enrolled"); + +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);