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