275e0fb994a4b5c287ea2abe4a8f243ef2e4c360
[project/luci.git] / applications / luci-app-asterisk / luasrc / model / cbi / asterisk-iax-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 iax = cbimap:section(TypedSection, "iax", "IAX Connection", "")
8 iax.addremove = true
9
10 alwaysinternational = iax:option(Flag, "alwaysinternational", "Always Dial International", "")
11 alwaysinternational.optional = true
12
13 context = iax:option(ListValue, "context", "Context to use", "")
14 context.titleref = luci.dispatcher.build_url( "admin", "services", "asterisk", "dialplans" )
15 cbimap.uci:foreach( "asterisk", "dialplan", function(s) context:value(s['.name']) end )
16 cbimap.uci:foreach( "asterisk", "dialzone", function(s) context:value(s['.name']) end )
17
18 countrycode = iax:option(Value, "countrycode", "Country Code for connection", "")
19 countrycode.optional = true
20
21 extension = iax:option(Value, "extension", "Add as Extension", "")
22 extension.optional = true
23
24 host = iax:option(Value, "host", "Host name (or blank)", "")
25 host.optional = true
26
27 internationalprefix = iax:option(Value, "internationalprefix", "International Dial Prefix", "")
28 internationalprefix.optional = true
29
30 prefix = iax:option(Value, "prefix", "Dial Prefix (for external line)", "")
31 prefix.optional = true
32
33 secret = iax:option(Value, "secret", "Secret", "")
34 secret.optional = true
35
36 timeout = iax:option(Value, "timeout", "Dial Timeout (sec)", "")
37 timeout.optional = true
38
39 type = iax:option(ListValue, "type", "Option type", "")
40 type:value("friend", "Friend (outbound/inbound)")
41 type:value("user", "User (inbound - authenticate by \"from\")")
42 type:value("peer", "Peer (outbound - match by host)")
43 type.optional = true
44
45 username = iax:option(Value, "username", "User name", "")
46 username.optional = true
47
48
49 return cbimap