-
Notifications
You must be signed in to change notification settings - Fork 564
/
README
341 lines (242 loc) · 9.36 KB
/
README
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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
UAC Registrant Module
Ovidiu Sas
<osas@voipembedded.com>
Edited by
Ovidiu Sas
<osas@voipembedded.com>
Copyright © 2011-2014 VoIP Embedded, Inc.
Revision History
Revision $Revision$ $Date$
__________________________________________________________
Table of Contents
1. Admin Guide
1.1. Overview
1.2. Dependencies
1.2.1. OpenSIPS Modules
1.2.2. External Libraries or Applications
1.3. Exported Parameters
1.3.1. hash_size (integer)
1.3.2. timer_interval (integer)
1.3.3. db_url (string)
1.3.4. table_name (string)
1.3.5. registrar_column (string)
1.3.6. proxy_column (string)
1.3.7. aor_column (string)
1.3.8. third_party_registrant_column (string)
1.3.9. username_column (string)
1.3.10. password_column (string)
1.3.11. binding_URI_column (string)
1.3.12. binding_params_column (string)
1.3.13. expiry_column (string)
1.3.14. forced_socket_column (string)
1.4. Exported Functions
1.5. Exported MI Functions
1.5.1. reg_list
1.5.2. reg_reload
List of Examples
1.1. Set hash_size parameter
1.2. Set timer_interval parameter
1.3. Set “db_url” parameter
1.4. Set “table_name” parameter
1.5. Set “registrar_column” parameter
1.6. Set “proxy_column” parameter
1.7. Set “aor_column” parameter
1.8. Set “third_party_registrant_column” parameter
1.9. Set “username_column” parameter
1.10. Set “password_column” parameter
1.11. Set “binding_URI_column” parameter
1.12. Set “binding_params_column” parameter
1.13. Set “expiry_column” parameter
1.14. Set “forced_socket_column” parameter
Chapter 1. Admin Guide
1.1. Overview
The module enable OpenSIPS to register itself on a remote SIP
registrar.
At startup, the registrant records are loaded into a hash table
in memory and a timer is started. The hash index is computed
over the AOR field.
The timer interval for checking records in a hash bucket is
computed by dividing the timer_interval module param by the
number of hash buckets. When the timer fires for the first
time, the first hash bucket will be checked and REGISTERs will
be sent out for each record that is found. On the next timeout
fire, the second hash bucket will be checked and so on. If the
configured timer_interval module param is lower then the number
of buckets, the module will fail to start.
Example: setting the timer_interval module to 8 with a
hash_size of 2, will result in having 4 hash buckets (2^2=4)
and buckets will be checked one by one every 2s (8/4=2).
Each registrant has it's own state. Registranr's status can be
inspected via "reg_list" MI comand.
UAC registrant states:
* 0 - NOT_REGISTERED_STATE - the initial state (no REGISTER
has been sent out yet);
* 1 - REGISTERING_STATE - waiting for a reply from the
registrar after a REGISTER without authentication header
was sent;
* 2 - AUTHENTICATING_STATE - waiting for a reply from the
registrar after a REGISTER with authentication header was
sent;
* 3 - REGISTERED_STATE - the uac is successfully registered;
* 4 - REGISTER_TIMEOUT_STATE : no reply received from the
registrar;
* 5 - INTERNAL_ERROR_STATE - some errors were
found/encountered during the processing of a reply;
* 6 - WRONG_CREDENTIALS_STATE - credentials rejected by the
registrar;
* 7 - REGISTRAR_ERROR_STATE - error reply received from the
registrar;
1.2. Dependencies
1.2.1. OpenSIPS Modules
The following modules must be loaded before this module:
* uac_auth - UAC authentication module
1.2.2. External Libraries or Applications
None.
1.3. Exported Parameters
1.3.1. hash_size (integer)
The size of the hash table internally used to keep the
registrants. A larger table distributes better the registration
load in time but consumes more memory. The hash size is a power
of number two.
Default value is 1.
Example 1.1. Set hash_size parameter
...
modparam("uac_registrant", "hash_size", 2)
...
1.3.2. timer_interval (integer)
Defines the periodic timer for checking the registrations
status.
Default value is 100.
Example 1.2. Set timer_interval parameter
...
modparam("uac_registrant", "timer_interval", 120)
...
1.3.3. db_url (string)
Database where to load the registrants from.
Default value is “NULL” (use default DB URL from core).
Example 1.3. Set “db_url” parameter
...
modparam("uac_registrant", "db_url", "mysql://user:passw@localhost/data
base")
...
1.3.4. table_name (string)
The database table that holds the registrant records.
Default value is “registrant”.
Example 1.4. Set “table_name” parameter
...
modparam("uac_registrant", "table_name", "my_registrant")
...
1.3.5. registrar_column (string)
The column's name in the database storing the URI pointing to
the remote registrar (mandatory field). OpenSIPS expects a
valid URI.
Default value is “registrar”.
Example 1.5. Set “registrar_column” parameter
...
modparam("uac_registrant", "registrar_column", "registranr_uri")
...
1.3.6. proxy_column (string)
The column's name in the database storing the URI pointing to
the outbond proxy (not mandatory field). An empty or NULL value
means no outbound proxy, otherwise OpenSIPS expects a valid
URI.
Default value is “proxy”.
Example 1.6. Set “proxy_column” parameter
...
modparam("uac_registrant", "proxy_column", "proxy_uri")
...
1.3.7. aor_column (string)
The column's name in the database storing the URI defining the
address of record (mandatory field). The URI stored here will
be used in the To URI of the REGISTER. OpenSIPS expects a valid
URI.
Default value is “aor”.
Example 1.7. Set “aor_column” parameter
...
modparam("uac_registrant", "aor_column", "to_uri")
...
1.3.8. third_party_registrant_column (string)
The column's name in the database storing the URI defining the
third party registrant (not mandatory field). The URI stored
here will be used in the From URI of the REGISTER. An empty or
NULL value means no third party registration (the From URI will
be identical to To URI), otherwise OpenSIPS expects a valid
URI.
Default value is “third_party_registrant”.
Example 1.8. Set “third_party_registrant_column” parameter
...
modparam("uac_registrant", "third_party_registrant_column", "from_uri")
...
1.3.9. username_column (string)
The column's name in the database storing the username for
authentication (mandatory if the registrar requires
authentication).
Default value is “username”.
Example 1.9. Set “username_column” parameter
...
modparam("uac_registrant", "username_column", "auth_username")
...
1.3.10. password_column (string)
The column's name in the database storing the password for
authentication (mandatory if the registrar requires
authntication).
Default value is “password”.
Example 1.10. Set “password_column” parameter
...
modparam("uac_registrant", "password_column", "auth_passowrd")
...
1.3.11. binding_URI_column (string)
The column's name in the database storing the binding URI in
REGISTER (mandatory field). The URI stored here will be used in
the Contact URI of the REGISTER. OpenSIPS expects a valid URI.
Default value is “binding_URI”.
Example 1.11. Set “binding_URI_column” parameter
...
modparam("uac_registrant", "binding_URI_column", "contact_uri")
...
1.3.12. binding_params_column (string)
The column's name in the database storing the binding params in
REGISTER (not mandatory field). If not NULL or not empty, the
string stored here will be added as paramns to the Contact URI
in REGISTER (it MUST start with “;”. There is no validation on
the string stored here.
Default value is “binding_params”.
Example 1.12. Set “binding_params_column” parameter
...
modparam("uac_registrant", "binding_params_column", "contact_params")
...
1.3.13. expiry_column (string)
The column's name in the database storing the expiration time
(not mandatory).
Default value is “expiry”.
Example 1.13. Set “expiry_column” parameter
...
modparam("uac_registrant", "expiry_column", "registration_timeout")
...
1.3.14. forced_socket_column (string)
The column's name in the database storing the socket for
sending the REGISTER (not mandatory). If a forced socket is
provided, the socket MUST be explicitely set as a global
listening socket in the config (see “listen” core parameter).
Default value is “forced_socket”.
Example 1.14. Set “forced_socket_column” parameter
...
modparam("uac_registrant", "forced_socket_column", "fs")
...
1.4. Exported Functions
None to be used in configuration file.
1.5. Exported MI Functions
1.5.1. reg_list
Lists the registrant records and their status.
Name: reg_list
Parameters: none
MI FIFO Command Format:
:reg_list:_reply_fifo_file_
_empty_line_
1.5.2. reg_reload
Reloads the registrant records from the database.
Name: reg_reload
Parameters: none
MI FIFO Command Format:
:reg_reload:_reply_fifo_file_
_empty_line_