asterisk-sip-connections.lua 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. sip = cbimap:section(TypedSection, "sip", "SIP Connection", "")
  6. sip.addremove = true
  7. alwaysinternational = sip:option(Flag, "alwaysinternational", "Always Dial International", "")
  8. alwaysinternational.optional = true
  9. canreinvite = sip:option(ListValue, "canreinvite", "Reinvite/redirect media connections", "")
  10. canreinvite:value("yes", "Yes")
  11. canreinvite:value("nonat", "Yes when not behind NAT")
  12. canreinvite:value("update", "Use UPDATE rather than INVITE for path redirection")
  13. canreinvite:value("no", "No")
  14. canreinvite.optional = true
  15. context = sip:option(ListValue, "context", "Context to use", "")
  16. context.titleref = luci.dispatcher.build_url( "admin", "services", "asterisk", "dialplans" )
  17. cbimap.uci:foreach( "asterisk", "dialplan", function(s) context:value(s['.name']) end )
  18. cbimap.uci:foreach( "asterisk", "dialzone", function(s) context:value(s['.name']) end )
  19. countrycode = sip:option(Value, "countrycode", "Country Code for connection", "")
  20. countrycode.optional = true
  21. dtmfmode = sip:option(ListValue, "dtmfmode", "DTMF mode", "")
  22. dtmfmode:value("info", "Use RFC2833 or INFO for the BudgeTone")
  23. dtmfmode:value("rfc2833", "Use RFC2833 for the BudgeTone")
  24. dtmfmode:value("inband", "Use Inband (only with ulaw/alaw)")
  25. dtmfmode.optional = true
  26. extension = sip:option(Value, "extension", "Add as Extension", "")
  27. extension.optional = true
  28. fromdomain = sip:option(Value, "fromdomain", "Primary domain identity for From: headers", "")
  29. fromdomain.optional = true
  30. fromuser = sip:option(Value, "fromuser", "From user (required by many SIP providers)", "")
  31. fromuser.optional = true
  32. host = sip:option(Value, "host", "Host name (or blank)", "")
  33. host.optional = true
  34. incoming = sip:option(DynamicList, "incoming", "Ring on incoming dialplan contexts", "")
  35. incoming.optional = true
  36. insecure = sip:option(ListValue, "insecure", "Allow Insecure for", "")
  37. insecure:value("port", "Allow mismatched port number")
  38. insecure:value("invite", "Do not require auth of incoming INVITE")
  39. insecure:value("port,invite", "Allow mismatched port and Do not require auth of incoming INVITE")
  40. insecure.optional = true
  41. internationalprefix = sip:option(Value, "internationalprefix", "International Dial Prefix", "")
  42. internationalprefix.optional = true
  43. mailbox = sip:option(Value, "mailbox", "Mailbox for MWI", "")
  44. mailbox.optional = true
  45. nat = sip:option(Flag, "nat", "NAT between phone and Asterisk", "")
  46. nat.optional = true
  47. pedantic = sip:option(Flag, "pedantic", "Check tags in headers", "")
  48. pedantic.optional = true
  49. port = sip:option(Value, "port", "SIP Port", "")
  50. port.optional = true
  51. prefix = sip:option(Value, "prefix", "Dial Prefix (for external line)", "")
  52. prefix.optional = true
  53. qualify = sip:option(Value, "qualify", "Reply Timeout (ms) for down connection", "")
  54. qualify.optional = true
  55. register = sip:option(Flag, "register", "Register connection", "")
  56. register.optional = true
  57. secret = sip:option(Value, "secret", "Secret", "")
  58. secret.optional = true
  59. selfmailbox = sip:option(Flag, "selfmailbox", "Dial own extension for mailbox", "")
  60. selfmailbox.optional = true
  61. timeout = sip:option(Value, "timeout", "Dial Timeout (sec)", "")
  62. timeout.optional = true
  63. type = sip:option(ListValue, "type", "Client Type", "")
  64. type:value("friend", "Friend (outbound/inbound)")
  65. type:value("user", "User (inbound - authenticate by \"from\")")
  66. type:value("peer", "Peer (outbound - match by host)")
  67. type.optional = true
  68. username = sip:option(Value, "username", "Username", "")
  69. username.optional = true
  70. return cbimap