summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-asterisk/luasrc/model/cbi/asterisk-sip-connections.lua
blob: efb84a01f73a49a40becb875e2216925d5154c89 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
--[[
LuCI - Lua Configuration Interface

Copyright 2008 Steven Barth <steven@midlink.org>
Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

	http://www.apache.org/licenses/LICENSE-2.0

$Id$
]]--

cbimap = Map("asterisk", "asterisk", "")

sip = cbimap:section(TypedSection, "sip", "SIP Connection", "")
sip.addremove = true

alwaysinternational = sip:option(Flag, "alwaysinternational", "Always Dial International", "")
alwaysinternational.optional = true

canreinvite = sip:option(ListValue, "canreinvite", "Reinvite/redirect media connections", "")
canreinvite:value("yes", "Yes")
canreinvite:value("nonat", "Yes when not behind NAT")
canreinvite:value("update", "Use UPDATE rather than INVITE for path redirection")
canreinvite:value("no", "No")
canreinvite.optional = true

context = sip:option(ListValue, "context", "Context to use", "")
context.titleref = luci.dispatcher.build_url( "admin", "services", "asterisk", "dialplans" )
cbimap.uci:foreach( "asterisk", "dialplan", function(s) context:value(s['.name']) end )
cbimap.uci:foreach( "asterisk", "dialzone", function(s) context:value(s['.name']) end )

countrycode = sip:option(Value, "countrycode", "Country Code for connection", "")
countrycode.optional = true

dtmfmode = sip:option(ListValue, "dtmfmode", "DTMF mode", "")
dtmfmode:value("info", "Use RFC2833 or INFO for the BudgeTone")
dtmfmode:value("rfc2833", "Use RFC2833 for the BudgeTone")
dtmfmode:value("inband", "Use Inband (only with ulaw/alaw)")
dtmfmode.optional = true

extension = sip:option(Value, "extension", "Add as Extension", "")
extension.optional = true

fromdomain = sip:option(Value, "fromdomain", "Primary domain identity for From: headers", "")
fromdomain.optional = true

fromuser = sip:option(Value, "fromuser", "From user (required by many SIP providers)", "")
fromuser.optional = true

host = sip:option(Value, "host", "Host name (or blank)", "")
host.optional = true

incoming = sip:option(DynamicList, "incoming", "Ring on incoming dialplan contexts", "")
incoming.optional = true

insecure = sip:option(ListValue, "insecure", "Allow Insecure for", "")
insecure:value("port", "Allow mismatched port number")
insecure:value("invite", "Do not require auth of incoming INVITE")
insecure:value("port,invite", "Allow mismatched port and Do not require auth of incoming INVITE")
insecure.optional = true

internationalprefix = sip:option(Value, "internationalprefix", "International Dial Prefix", "")
internationalprefix.optional = true

mailbox = sip:option(Value, "mailbox", "Mailbox for MWI", "")
mailbox.optional = true

nat = sip:option(Flag, "nat", "NAT between phone and Asterisk", "")
nat.optional = true

pedantic = sip:option(Flag, "pedantic", "Check tags in headers", "")
pedantic.optional = true

port = sip:option(Value, "port", "SIP Port", "")
port.optional = true

prefix = sip:option(Value, "prefix", "Dial Prefix (for external line)", "")
prefix.optional = true

qualify = sip:option(Value, "qualify", "Reply Timeout (ms) for down connection", "")
qualify.optional = true

register = sip:option(Flag, "register", "Register connection", "")
register.optional = true

secret = sip:option(Value, "secret", "Secret", "")
secret.optional = true

selfmailbox = sip:option(Flag, "selfmailbox", "Dial own extension for mailbox", "")
selfmailbox.optional = true

timeout = sip:option(Value, "timeout", "Dial Timeout (sec)", "")
timeout.optional = true

type = sip:option(ListValue, "type", "Client Type", "")
type:value("friend", "Friend (outbound/inbound)")
type:value("user", "User (inbound - authenticate by \"from\")")
type:value("peer", "Peer (outbound - match by host)")
type.optional = true

username = sip:option(Value, "username", "Username", "")
username.optional = true


return cbimap