asterisk-iax-connections.lua 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. -- Copyright 2008 Steven Barth <steven@midlink.org>
  2. -- Copyright 2008 Jo-Philipp Wich <jow@openwrt.org>
  3. -- Licensed to the public under the Apache License 2.0.
  4. cbimap = Map("asterisk", "asterisk", "")
  5. iax = cbimap:section(TypedSection, "iax", "IAX Connection", "")
  6. iax.addremove = true
  7. alwaysinternational = iax:option(Flag, "alwaysinternational", "Always Dial International", "")
  8. alwaysinternational.optional = true
  9. context = iax:option(ListValue, "context", "Context to use", "")
  10. context.titleref = luci.dispatcher.build_url( "admin", "services", "asterisk", "dialplans" )
  11. cbimap.uci:foreach( "asterisk", "dialplan", function(s) context:value(s['.name']) end )
  12. cbimap.uci:foreach( "asterisk", "dialzone", function(s) context:value(s['.name']) end )
  13. countrycode = iax:option(Value, "countrycode", "Country Code for connection", "")
  14. countrycode.optional = true
  15. extension = iax:option(Value, "extension", "Add as Extension", "")
  16. extension.optional = true
  17. host = iax:option(Value, "host", "Host name (or blank)", "")
  18. host.optional = true
  19. internationalprefix = iax:option(Value, "internationalprefix", "International Dial Prefix", "")
  20. internationalprefix.optional = true
  21. prefix = iax:option(Value, "prefix", "Dial Prefix (for external line)", "")
  22. prefix.optional = true
  23. secret = iax:option(Value, "secret", "Secret", "")
  24. secret.optional = true
  25. timeout = iax:option(Value, "timeout", "Dial Timeout (sec)", "")
  26. timeout.optional = true
  27. type = iax:option(ListValue, "type", "Option type", "")
  28. type:value("friend", "Friend (outbound/inbound)")
  29. type:value("user", "User (inbound - authenticate by \"from\")")
  30. type:value("peer", "Peer (outbound - match by host)")
  31. type.optional = true
  32. username = iax:option(Value, "username", "User name", "")
  33. username.optional = true
  34. return cbimap