[Freeswitch-trunk] [commit] r13843 - freeswitch/trunk/scripts/lua
FreeSWITCH SVN
brian at freeswitch.org
Thu Jun 18 11:03:11 PDT 2009
Author: brian
Date: Thu Jun 18 13:03:10 2009
New Revision: 13843
Log:
adding zrtp enrollment script, we do auto enrollment and verification
Added:
freeswitch/trunk/scripts/lua/zrtp_agent.lua
Added: freeswitch/trunk/scripts/lua/zrtp_agent.lua
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/lua/zrtp_agent.lua Thu Jun 18 13:03:10 2009
@@ -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);
More information about the Freeswitch-trunk
mailing list