1
0

meetme.lua 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. -- Copyright 2009 Jo-Philipp Wich <jow@openwrt.org>
  2. -- Licensed to the public under the Apache License 2.0.
  3. local ast = require "luci.asterisk"
  4. cbimap = Map("asterisk", "MeetMe - Rooms")
  5. meetme = cbimap:section(TypedSection, "meetme", "MeetMe Rooms")
  6. meetme.addremove = true
  7. meetme.anonymous = true
  8. meetme.template = "cbi/tblsection"
  9. meetme:option(Value, "_description", "Description", "Short room description")
  10. room = meetme:option(Value, "room", "Room Number", "Unique room identifier")
  11. function room.write(self, s, val)
  12. if val and #val > 0 then
  13. local old = self:cfgvalue(s)
  14. self.map.uci:foreach("asterisk", "dialplanmeetme",
  15. function(v)
  16. if v.room == old then
  17. self.map:set(v['.name'], "room", val)
  18. end
  19. end)
  20. Value.write(self, s, val)
  21. end
  22. end
  23. meetme:option(Value, "pin", "PIN", "PIN required to access")
  24. meetme:option(Value, "adminpin", "Admin PIN", "PIN required for administration")
  25. function meetme.remove(self, s)
  26. return ast.meetme.remove(self.map:get(s, "room"), self.map.uci)
  27. end
  28. return cbimap