application/luci-asterisk:
[project/luci.git] / applications / luci-asterisk / luasrc / model / cbi / asterisk-iax-connections.lua
1 --[[
2 LuCI - Lua Configuration Interface
3
4 Copyright 2008 Steven Barth <steven@midlink.org>
5 Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
6
7 Licensed under the Apache License, Version 2.0 (the "License");
8 you may not use this file except in compliance with the License.
9 You may obtain a copy of the License at
10
11         http://www.apache.org/licenses/LICENSE-2.0
12
13 $Id$
14 ]]--
15
16 cbimap = Map("asterisk", "asterisk", "")
17
18 iax = cbimap:section(TypedSection, "iax", "IAX Connection", "")
19 iax.addremove = true
20
21 alwaysinternational = iax:option(Flag, "alwaysinternational", "Always Dial International", "")
22 alwaysinternational.optional = true
23
24 context = iax:option(ListValue, "context", "Context to use", "")
25 context.titleref = luci.dispatcher.build_url( "admin", "services", "asterisk", "dialplans" )
26 cbimap.uci:foreach( "asterisk", "dialplan", function(s) context:value(s['.name']) end )
27 cbimap.uci:foreach( "asterisk", "dialzone", function(s) context:value(s['.name']) end )
28
29 countrycode = iax:option(Value, "countrycode", "Country Code for connection", "")
30 countrycode.optional = true
31
32 extension = iax:option(Value, "extension", "Add as Extension", "")
33 extension.optional = true
34
35 host = iax:option(Value, "host", "Host name (or blank)", "")
36 host.optional = true
37
38 internationalprefix = iax:option(Value, "internationalprefix", "International Dial Prefix", "")
39 internationalprefix.optional = true
40
41 prefix = iax:option(Value, "prefix", "Dial Prefix (for external line)", "")
42 prefix.optional = true
43
44 secret = iax:option(Value, "secret", "Secret", "")
45 secret.optional = true
46
47 timeout = iax:option(Value, "timeout", "Dial Timeout (sec)", "")
48 timeout.optional = true
49
50 type = iax:option(ListValue, "type", "Option type", "")
51 type:value("friend", "Friend (outbound/inbound)")
52 type:value("user", "User (inbound - authenticate by \"from\")")
53 type:value("peer", "Peer (outbound - match by host)")
54 type.optional = true
55
56 username = iax:option(Value, "username", "User name", "")
57 username.optional = true
58
59
60 return cbimap