zrtp_agent.lua 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. -- ZRTP Enrollment Agent
  2. session:setVariable("zrtp_secure_media", "true");
  3. session:setVariable("zrtp_enrollment", "true");
  4. session:sleep(100);
  5. session:answer();
  6. session:streamFile("zrtp/zrtp-status_securing.wav");
  7. session:sleep(3000);
  8. -- Give the agent time to bring up ZRTP.
  9. local zrtp_secure_media_confirmed = session:getVariable("zrtp_secure_media_confirmed_audio");
  10. local zrtp_new_user_enrolled = session:getVariable("zrtp_new_user_enrolled_audio");
  11. local zrtp_already_enrolled = session:getVariable("zrtp_already_enrolled_audio");
  12. if zrtp_secure_media_confirmed == "true" then
  13. session:streamFile("zrtp/zrtp-status_secure.wav");
  14. else
  15. session:streamFile("zrtp/zrtp-status_notsecure.wav");
  16. end
  17. session:streamFile("zrtp/zrtp-enroll_welcome.wav");
  18. session:sleep(1000);
  19. if zrtp_secure_media_confirmed == "true" then
  20. if zrtp_new_user_enrolled == "true" then
  21. session:streamFile("zrtp/zrtp-enroll_confirmed.wav");
  22. session:sleep(3000);
  23. else
  24. if zrtp_already_enrolled == "true" then
  25. session:streamFile("zrtp/zrtp-enroll_already_enrolled.wav");
  26. end
  27. end
  28. else
  29. session:streamFile("zrtp/zrtp-enroll_notzrtp.wav");
  30. end
  31. session:sleep(1000);
  32. session:streamFile("zrtp/zrtp-thankyou_goodbye.wav");
  33. session:sleep(1000);