-
Notifications
You must be signed in to change notification settings - Fork 96
/
drachtio.conf.xml
198 lines (164 loc) · 7.35 KB
/
drachtio.conf.xml
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
<drachtio>
<!-- udp port to listen on for client connections (default 9022), and shared secret used to authenticate clients -->
<admin port="9022" secret="cymru">127.0.0.1</admin>
<!-- the server can either accept inbound connections from node apps, or make outbound requests
to node apps. You must globally choose one or the other approach but not both.
Inbound connections requires no configuration other than the <admin/> tag above, and are useful
when a server is hosting a single application, or has one primary function.
If, on the other hand, you want a server to support multiple applications, then we have the issue
of determining how to route an incoming request (INVITE, REGISTER, etc) to the appropriate application.
This is what outbound connections are designed for.
By uncommenting the <request-handlers/> configuration below, you are placing the server into outbound mode, and
providing an HTTP URL that the server will hit to determine how to route an incoming request.
The following parameters will be passed to the http service as query string parameters in an HTTP GET:
callingNumber - the user part of the From header
calledNumber - the user part of the To header
contentType - the Content-Type header (if any)
domain - the domain in the request uri
method - the sip method
protocol - the transport protocol
source_address - the sending address
uriUser - the user part of the sip uri
uri - the complete sip uri
It is the responsibility of the HTTP server that receives the request to return a json response
with a top-level "action" of either "reject", "redirect", "proxy", or "route".
reject - reject the call with a specified status code
redirect = redirect the call to one or more specified sip uris
proxy - proxy the call to one or more specified sip uris
route - connect to a nodejs application that is listening on the specified host:port
example responses:
{
"action": "reject":
"data": {
"status": 503,
"reason": "Max Calls Exceeded"
}
}
{
"action": "redirect":
"data": {
"contacts": [
"sip:[email protected]"
]
}
}
{
"action": "proxy":
"data": {
"destination": [
"sip:[email protected]"
],
recordRoute: true
}
}
{
"action": "route":
"data": {
"url": "call-recording.default.svc.cluster.local:4000"
}
}
{
"action": "route":
"data": {
"tag": "my-conferencing-app"
}
}
-->
<!-- comment this in and edit http url to use outbound connections
Note: currently only HTTP GET is supported as an HTTP METHOD
<request-handlers>
<request-handler sip-method="INVITE" http-method="GET">http://35.187.89.96:80</request-handler>
</request-handlers>
-->
<!-- sip configuration -->
<sip>
<contacts>
<contact>sip:*;transport=udp,tcp</contact>
<!-- local sip address to bind to. Default: 'sip:*', which means listens on port 5060 on all interfaces and transports -->
<!--
Other examples:
sip:192.168.1.100 listen on a specific address
sip:*;transport=tcp tcp connections only
sip:*:5061 listen on port 5061
-->
<!-- here's how to listen for every protocol on their default ports -->
<!--
<contact>sip:*:80;transport=ws</contact>
<contact>sips:*;transport=tls</contact>
<contact>sips:*:443;transport=wss</contact>
-->
</contacts>
<!-- uncomment and modify these if you want to change the sip stack timers (globally)
<timers>
<t1>500</t1>
<t2>4000</t2>
<t4>5000</t4>
<t1x64>32000</t1x64>
</timers>
-->
<!-- uncomment this if you send encapsulated SIP messages to homer
<capture-server port="9060" hep-version="3" id="101">127.0.0.1</capture-server>
-->
<!-- if you want to terminate SIP over TLS connections (example shows letsencrypt.org typical file locations, but use any CA)
<tls>
<key-file>/etc/letsencrypt/live/yourdomain/privkey.pem</key-file>
<cert-file>/etc/letsencrypt/live/yourdomain/cert.pem</cert-file>
<chain-file>/etc/letsencrypt/live/yourdomain/chain.pem</chain-file>
<dh-param>/var/local/dh4096.pem</dh-param>
</tls>
-->
<!-- if you want to increase the default mtu size for udp packets; stack will force tcp when sending larger packets
<mtu-size>4096</mtu-size>
-->
<!-- uncommenting this will cause all outbound new requests (i.e. requests outside of a dialog) to go through the specified proxy -->
<!--
<outbound-proxy>sip:10.10.10.1</outbound-proxy>
-->
<!-- optional list of header values which, if encountered in a message will trigger an action
[tcp-]action="reject|discard"
reject means send a sip non-success response immediately
discard means sliently discard the request, generating no response
-->
<spammers action="reject" tcp-action="discard">
<header name="User-Agent">
<value>sip-cli</value>
<value>sipcli</value>
<value>friendly-scanner</value>
</header>
<header name="To">
<value>sipvicious</value>
</header>
</spammers>
</sip>
<!-- set to true if you want the server to cdr events to a connected client -->
<cdrs>false</cdrs>
<monitoring>
<prometheus port="8088">127.0.0.1</prometheus>
</monitoring>
<!-- logging configuration -->
<logging>
<!-- uncomment this if you want logging dumped to console, in addition to any other log destinations
<console/>
-->
<!-- uncomment if you want logging sent to syslog (over UDP) -->
<!--
<syslog>
<address>my.syslog.serve</address>
<port>514</port>
<facility>local6</facility>
</syslog>
-->
<!-- file-based logging -->
<file>
<name>/var/log/drachtio/drachtio.log</name>
<archive>/var/log/drachtio/archive</archive>
<size>100</size>
<maxFiles>20</maxFiles>
<auto-flush>true</auto-flush>
</file>
<!-- sofia (internal sip library) log level, from 0 (minimal) to 9 (verbose) -->
<sofia-loglevel>3</sofia-loglevel>
<!-- general process log level: notice, warning, error, info, debug. Default: info -->
<loglevel>info</loglevel>
</logging>
</drachtio>