416ccd6b0e73e3d0b44c895506350dac9c290085
[project/luci.git] / applications / luci-app-asterisk / luasrc / model / cbi / asterisk-sip-connections.lua
1 -- Copyright 2008 Steven Barth <steven@midlink.org>
2 -- Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
3 -- Licensed to the public under the Apache License 2.0.
4
5 cbimap = Map("asterisk", "asterisk", "")
6
7 sip = cbimap:section(TypedSection, "sip", "SIP Connection", "")
8 sip.addremove = true
9
10 alwaysinternational = sip:option(Flag, "alwaysinternational", "Always Dial International", "")
11 alwaysinternational.optional = true
12
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
19
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 )
24
25 countrycode = sip:option(Value, "countrycode", "Country Code for connection", "")
26 countrycode.optional = true
27
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
33
34 extension = sip:option(Value, "extension", "Add as Extension", "")
35 extension.optional = true
36
37 fromdomain = sip:option(Value, "fromdomain", "Primary domain identity for From: headers", "")
38 fromdomain.optional = true
39
40 fromuser = sip:option(Value, "fromuser", "From user (required by many SIP providers)", "")
41 fromuser.optional = true
42
43 host = sip:option(Value, "host", "Host name (or blank)", "")
44 host.optional = true
45
46 incoming = sip:option(DynamicList, "incoming", "Ring on incoming dialplan contexts", "")
47 incoming.optional = true
48
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
54
55 internationalprefix = sip:option(Value, "internationalprefix", "International Dial Prefix", "")
56 internationalprefix.optional = true
57
58 mailbox = sip:option(Value, "mailbox", "Mailbox for MWI", "")
59 mailbox.optional = true
60
61 nat = sip:option(Flag, "nat", "NAT between phone and Asterisk", "")
62 nat.optional = true
63
64 pedantic = sip:option(Flag, "pedantic", "Check tags in headers", "")
65 pedantic.optional = true
66
67 port = sip:option(Value, "port", "SIP Port", "")
68 port.optional = true
69
70 prefix = sip:option(Value, "prefix", "Dial Prefix (for external line)", "")
71 prefix.optional = true
72
73 qualify = sip:option(Value, "qualify", "Reply Timeout (ms) for down connection", "")
74 qualify.optional = true
75
76 register = sip:option(Flag, "register", "Register connection", "")
77 register.optional = true
78
79 secret = sip:option(Value, "secret", "Secret", "")
80 secret.optional = true
81
82 selfmailbox = sip:option(Flag, "selfmailbox", "Dial own extension for mailbox", "")
83 selfmailbox.optional = true
84
85 timeout = sip:option(Value, "timeout", "Dial Timeout (sec)", "")
86 timeout.optional = true
87
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)")
92 type.optional = true
93
94 username = sip:option(Value, "username", "Username", "")
95 username.optional = true
96
97
98 return cbimap