Browse code

modules: readme files regenerated - path ... [skip ci]

Kamailio Dev authored on 29/03/2021 13:31:11
Showing 1 changed files
... ...
@@ -31,8 +31,9 @@ Richard Fuchs
31 31
 
32 32
               3.1. use_received (int)
33 33
               3.2. received_format (int)
34
-              3.3. enable_r2 (int)
35
-              3.4. sockname_mode (int)
34
+              3.3. received_name (str)
35
+              3.4. enable_r2 (int)
36
+              3.5. sockname_mode (int)
36 37
 
37 38
         4. Functions
38 39
 
... ...
@@ -48,14 +49,15 @@ Richard Fuchs
48 49
    1.1. Add Supported header
49 50
    1.2. Set use_received parameter
50 51
    1.3. Set received_format parameter
51
-   1.4. Set enable_r2 parameter
52
-   1.5. Set sockname_mode parameter
53
-   1.6. add_path usage
54
-   1.7. add_path(user) usage
55
-   1.8. add_path(user, parameters) usage
56
-   1.9. add_path_received() usage
57
-   1.10. add_path_received(user) usage
58
-   1.11. add_path_received(user, parameters) usage
52
+   1.4. Set received_name parameter
53
+   1.5. Set enable_r2 parameter
54
+   1.6. Set sockname_mode parameter
55
+   1.7. add_path usage
56
+   1.8. add_path(user) usage
57
+   1.9. add_path(user, parameters) usage
58
+   1.10. add_path_received() usage
59
+   1.11. add_path_received(user) usage
60
+   1.12. add_path_received(user, parameters) usage
59 61
 
60 62
 Chapter 1. Admin Guide
61 63
 
... ...
@@ -75,8 +77,9 @@ Chapter 1. Admin Guide
75 77
 
76 78
         3.1. use_received (int)
77 79
         3.2. received_format (int)
78
-        3.3. enable_r2 (int)
79
-        3.4. sockname_mode (int)
80
+        3.3. received_name (str)
81
+        3.4. enable_r2 (int)
82
+        3.5. sockname_mode (int)
80 83
 
81 84
    4. Functions
82 85
 
... ...
@@ -162,8 +165,9 @@ append_hf("Supported: path\r\n");
162 165
 
163 166
    3.1. use_received (int)
164 167
    3.2. received_format (int)
165
-   3.3. enable_r2 (int)
166
-   3.4. sockname_mode (int)
168
+   3.3. received_name (str)
169
+   3.4. enable_r2 (int)
170
+   3.5. sockname_mode (int)
167 171
 
168 172
 3.1. use_received (int)
169 173
 
... ...
@@ -195,7 +199,18 @@ modparam("path", "use_received", 1)
195 199
 modparam("path", "received_format", 1)
196 200
 ...
197 201
 
198
-3.3. enable_r2 (int)
202
+3.3. received_name (str)
203
+
204
+   Set the name of the header parameter to add the “received” value.
205
+
206
+   Default value is "received".
207
+
208
+   Example 1.4. Set received_name parameter
209
+...
210
+modparam("path", "received_name", "rcv")
211
+...
212
+
213
+3.4. enable_r2 (int)
199 214
 
200 215
    If set to 1, the module will add two Path headers, similar to the
201 216
    double Record-Route done by rr module. One Path headers corresponds to
... ...
@@ -210,19 +225,19 @@ modparam("path", "received_format", 1)
210 225
 
211 226
    Default value is 0.
212 227
 
213
-   Example 1.4. Set enable_r2 parameter
228
+   Example 1.5. Set enable_r2 parameter
214 229
 ...
215 230
 modparam("path", "enable_r2", 1)
216 231
 ...
217 232
 
218
-3.4. sockname_mode (int)
233
+3.5. sockname_mode (int)
219 234
 
220 235
    If set to 1, the Path URI is built to contain socket name in 'sn'
221 236
    parameter.
222 237
 
223 238
    Default value is 0.
224 239
 
225
-   Example 1.5. Set sockname_mode parameter
240
+   Example 1.6. Set sockname_mode parameter
226 241
 ...
227 242
 modparam("path", "sockname_mode", 1)
228 243
 ...
... ...
@@ -251,7 +266,7 @@ modparam("path", "sockname_mode", 1)
251 266
 
252 267
    This function can be used from REQUEST_ROUTE.
253 268
 
254
-   Example 1.6. add_path usage
269
+   Example 1.7. add_path usage
255 270
 ...
256 271
 if (!add_path()) {
257 272
         sl_send_reply("503", "Internal Path Error");
... ...
@@ -269,7 +284,7 @@ if (!add_path()) {
269 284
 
270 285
    This function can be used from REQUEST_ROUTE.
271 286
 
272
-   Example 1.7. add_path(user) usage
287
+   Example 1.8. add_path(user) usage
273 288
 ...
274 289
 if (!add_path("loadbalancer")) {
275 290
         sl_send_reply("503", "Internal Path Error");
... ...
@@ -291,7 +306,7 @@ if (!add_path("loadbalancer")) {
291 306
 
292 307
    This function can be used from REQUEST_ROUTE.
293 308
 
294
-   Example 1.8. add_path(user, parameters) usage
309
+   Example 1.9. add_path(user, parameters) usage
295 310
 ...
296 311
 if (!add_path("loadbalancer", "ob")) {
297 312
         sl_send_reply("503", "Internal Path Error");
... ...
@@ -315,7 +330,7 @@ if (!add_path("loadbalancer", "ob")) {
315 330
 
316 331
    This function can be used from REQUEST_ROUTE.
317 332
 
318
-   Example 1.9. add_path_received() usage
333
+   Example 1.10. add_path_received() usage
319 334
 ...
320 335
 if (!add_path_received()) {
321 336
         sl_send_reply("503", "Internal Path Error");
... ...
@@ -332,7 +347,7 @@ if (!add_path_received()) {
332 347
 
333 348
    This function can be used from REQUEST_ROUTE.
334 349
 
335
-   Example 1.10. add_path_received(user) usage
350
+   Example 1.11. add_path_received(user) usage
336 351
 ...
337 352
 if (!add_path_received("inbound")) {
338 353
         sl_send_reply("503", "Internal Path Error");
... ...
@@ -349,7 +364,7 @@ if (!add_path_received("inbound")) {
349 364
 
350 365
    This function can be used from REQUEST_ROUTE.
351 366
 
352
-   Example 1.11. add_path_received(user, parameters) usage
367
+   Example 1.12. add_path_received(user, parameters) usage
353 368
 ...
354 369
 if (!add_path_received("inbound", "ob")) {
355 370
         sl_send_reply("503", "Internal Path Error");
Browse code

modules: readme files regenerated - path ... [skip ci]

Kamailio Dev authored on 02/04/2020 12:31:10
Showing 1 changed files
... ...
@@ -8,8 +8,6 @@ Edited by
8 8
 
9 9
 Andreas Granig
10 10
 
11
-Edited by
12
-
13 11
 Richard Fuchs
14 12
 
15 13
    Copyright © 2006 Inode GmbH
... ...
@@ -34,6 +32,7 @@ Richard Fuchs
34 32
               3.1. use_received (int)
35 33
               3.2. received_format (int)
36 34
               3.3. enable_r2 (int)
35
+              3.4. sockname_mode (int)
37 36
 
38 37
         4. Functions
39 38
 
... ...
@@ -50,12 +49,13 @@ Richard Fuchs
50 49
    1.2. Set use_received parameter
51 50
    1.3. Set received_format parameter
52 51
    1.4. Set enable_r2 parameter
53
-   1.5. add_path usage
54
-   1.6. add_path(user) usage
55
-   1.7. add_path(user, parameters) usage
56
-   1.8. add_path_received() usage
57
-   1.9. add_path_received(user) usage
58
-   1.10. add_path_received(user, parameters) usage
52
+   1.5. Set sockname_mode parameter
53
+   1.6. add_path usage
54
+   1.7. add_path(user) usage
55
+   1.8. add_path(user, parameters) usage
56
+   1.9. add_path_received() usage
57
+   1.10. add_path_received(user) usage
58
+   1.11. add_path_received(user, parameters) usage
59 59
 
60 60
 Chapter 1. Admin Guide
61 61
 
... ...
@@ -76,6 +76,7 @@ Chapter 1. Admin Guide
76 76
         3.1. use_received (int)
77 77
         3.2. received_format (int)
78 78
         3.3. enable_r2 (int)
79
+        3.4. sockname_mode (int)
79 80
 
80 81
    4. Functions
81 82
 
... ...
@@ -162,6 +163,7 @@ append_hf("Supported: path\r\n");
162 163
    3.1. use_received (int)
163 164
    3.2. received_format (int)
164 165
    3.3. enable_r2 (int)
166
+   3.4. sockname_mode (int)
165 167
 
166 168
 3.1. use_received (int)
167 169
 
... ...
@@ -213,6 +215,18 @@ modparam("path", "received_format", 1)
213 215
 modparam("path", "enable_r2", 1)
214 216
 ...
215 217
 
218
+3.4. sockname_mode (int)
219
+
220
+   If set to 1, the Path URI is built to contain socket name in 'sn'
221
+   parameter.
222
+
223
+   Default value is 0.
224
+
225
+   Example 1.5. Set sockname_mode parameter
226
+...
227
+modparam("path", "sockname_mode", 1)
228
+...
229
+
216 230
 4. Functions
217 231
 
218 232
    4.1. add_path()
... ...
@@ -237,7 +251,7 @@ modparam("path", "enable_r2", 1)
237 251
 
238 252
    This function can be used from REQUEST_ROUTE.
239 253
 
240
-   Example 1.5. add_path usage
254
+   Example 1.6. add_path usage
241 255
 ...
242 256
 if (!add_path()) {
243 257
         sl_send_reply("503", "Internal Path Error");
... ...
@@ -255,7 +269,7 @@ if (!add_path()) {
255 269
 
256 270
    This function can be used from REQUEST_ROUTE.
257 271
 
258
-   Example 1.6. add_path(user) usage
272
+   Example 1.7. add_path(user) usage
259 273
 ...
260 274
 if (!add_path("loadbalancer")) {
261 275
         sl_send_reply("503", "Internal Path Error");
... ...
@@ -277,7 +291,7 @@ if (!add_path("loadbalancer")) {
277 291
 
278 292
    This function can be used from REQUEST_ROUTE.
279 293
 
280
-   Example 1.7. add_path(user, parameters) usage
294
+   Example 1.8. add_path(user, parameters) usage
281 295
 ...
282 296
 if (!add_path("loadbalancer", "ob")) {
283 297
         sl_send_reply("503", "Internal Path Error");
... ...
@@ -301,7 +315,7 @@ if (!add_path("loadbalancer", "ob")) {
301 315
 
302 316
    This function can be used from REQUEST_ROUTE.
303 317
 
304
-   Example 1.8. add_path_received() usage
318
+   Example 1.9. add_path_received() usage
305 319
 ...
306 320
 if (!add_path_received()) {
307 321
         sl_send_reply("503", "Internal Path Error");
... ...
@@ -318,7 +332,7 @@ if (!add_path_received()) {
318 332
 
319 333
    This function can be used from REQUEST_ROUTE.
320 334
 
321
-   Example 1.9. add_path_received(user) usage
335
+   Example 1.10. add_path_received(user) usage
322 336
 ...
323 337
 if (!add_path_received("inbound")) {
324 338
         sl_send_reply("503", "Internal Path Error");
... ...
@@ -335,7 +349,7 @@ if (!add_path_received("inbound")) {
335 349
 
336 350
    This function can be used from REQUEST_ROUTE.
337 351
 
338
-   Example 1.10. add_path_received(user, parameters) usage
352
+   Example 1.11. add_path_received(user, parameters) usage
339 353
 ...
340 354
 if (!add_path_received("inbound", "ob")) {
341 355
         sl_send_reply("503", "Internal Path Error");
Browse code

modules: readme files regenerated - path ... [skip ci]

Kamailio Dev authored on 09/10/2017 14:46:17
Showing 1 changed files
... ...
@@ -292,6 +292,13 @@ if (!add_path("loadbalancer", "ob")) {
292 292
    address as domain-part, and the address the request has been received
293 293
    from as received-parameter.
294 294
 
295
+   If the “outbound” module was loaded before this module, and outbound is
296
+   required for this request, the header will be in the form “Path:
297
+   <sip:flowtoken@1.2.3.4;lr;received=sip:2.3.4.5:1234;ob>”, where
298
+   “flowtoken” is the RFC 5626 flow-token that can be used to identify the
299
+   source and local address and transport the request was received on, and
300
+   where “1.2.3.4” is the address of the outgoing interface.
301
+
295 302
    This function can be used from REQUEST_ROUTE.
296 303
 
297 304
    Example 1.8. add_path_received() usage
Browse code

modules: readme files regenerated - path ... [skip ci]

Kamailio Dev authored on 27/06/2017 14:46:21
Showing 1 changed files
... ...
@@ -49,7 +49,7 @@ Richard Fuchs
49 49
    1.1. Add Supported header
50 50
    1.2. Set use_received parameter
51 51
    1.3. Set received_format parameter
52
-   1.4. Set use_received parameter
52
+   1.4. Set enable_r2 parameter
53 53
    1.5. add_path usage
54 54
    1.6. add_path(user) usage
55 55
    1.7. add_path(user, parameters) usage
... ...
@@ -208,9 +208,9 @@ modparam("path", "received_format", 1)
208 208
 
209 209
    Default value is 0.
210 210
 
211
-   Example 1.4. Set use_received parameter
211
+   Example 1.4. Set enable_r2 parameter
212 212
 ...
213
-modparam("path", "use_received", 1)
213
+modparam("path", "enable_r2", 1)
214 214
 ...
215 215
 
216 216
 4. Functions
Browse code

modules: readme files regenerated - path ... [skip ci]

Kamailio Dev authored on 27/06/2017 14:31:28
Showing 1 changed files
... ...
@@ -32,6 +32,8 @@ Richard Fuchs
32 32
         3. Parameters
33 33
 
34 34
               3.1. use_received (int)
35
+              3.2. received_format (int)
36
+              3.3. enable_r2 (int)
35 37
 
36 38
         4. Functions
37 39
 
... ...
@@ -46,12 +48,14 @@ Richard Fuchs
46 48
 
47 49
    1.1. Add Supported header
48 50
    1.2. Set use_received parameter
49
-   1.3. add_path usage
50
-   1.4. add_path(user) usage
51
-   1.5. add_path(user, parameters) usage
52
-   1.6. add_path_received() usage
53
-   1.7. add_path_received(user) usage
54
-   1.8. add_path_received(user, parameters) usage
51
+   1.3. Set received_format parameter
52
+   1.4. Set use_received parameter
53
+   1.5. add_path usage
54
+   1.6. add_path(user) usage
55
+   1.7. add_path(user, parameters) usage
56
+   1.8. add_path_received() usage
57
+   1.9. add_path_received(user) usage
58
+   1.10. add_path_received(user, parameters) usage
55 59
 
56 60
 Chapter 1. Admin Guide
57 61
 
... ...
@@ -70,6 +74,8 @@ Chapter 1. Admin Guide
70 74
    3. Parameters
71 75
 
72 76
         3.1. use_received (int)
77
+        3.2. received_format (int)
78
+        3.3. enable_r2 (int)
73 79
 
74 80
    4. Functions
75 81
 
... ...
@@ -154,6 +160,8 @@ append_hf("Supported: path\r\n");
154 160
 3. Parameters
155 161
 
156 162
    3.1. use_received (int)
163
+   3.2. received_format (int)
164
+   3.3. enable_r2 (int)
157 165
 
158 166
 3.1. use_received (int)
159 167
 
... ...
@@ -167,6 +175,44 @@ append_hf("Supported: path\r\n");
167 175
 modparam("path", "use_received", 1)
168 176
 ...
169 177
 
178
+3.2. received_format (int)
179
+
180
+   If set to 0, the “received” parameter value will be in the escaped SIP
181
+   URI format.
182
+
183
+   If set to 1, the “received” parameter value will be in the same format
184
+   as the “alias” parameter added by set_contact_alias() from “nathelper”
185
+   module (i.e., “ip~port~protid”). This is a solution with some SIP
186
+   applications that incorrectly match the transport from received
187
+   parameter instead of the one from the SIP URI.
188
+
189
+   Default value is 0.
190
+
191
+   Example 1.3. Set received_format parameter
192
+...
193
+modparam("path", "received_format", 1)
194
+...
195
+
196
+3.3. enable_r2 (int)
197
+
198
+   If set to 1, the module will add two Path headers, similar to the
199
+   double Record-Route done by rr module. One Path headers corresponds to
200
+   incoming network socket and the other to outgoing network socket. The
201
+   URIs in the Path headers will have the 'r2=on' parameter as well.
202
+
203
+   Note: if enabled, the module adds the two Path headers even when the
204
+   incoming socket is the same as outgoing socket. Improvements to skip
205
+   the second Path header in this case may be introduced in the future,
206
+   meanwhile, if you need to enable this parameter but also deal with same
207
+   socket routing, use 'insert_hf("Path: <$Ru>\r\n")'.
208
+
209
+   Default value is 0.
210
+
211
+   Example 1.4. Set use_received parameter
212
+...
213
+modparam("path", "use_received", 1)
214
+...
215
+
170 216
 4. Functions
171 217
 
172 218
    4.1. add_path()
... ...
@@ -191,7 +237,7 @@ modparam("path", "use_received", 1)
191 237
 
192 238
    This function can be used from REQUEST_ROUTE.
193 239
 
194
-   Example 1.3. add_path usage
240
+   Example 1.5. add_path usage
195 241
 ...
196 242
 if (!add_path()) {
197 243
         sl_send_reply("503", "Internal Path Error");
... ...
@@ -209,7 +255,7 @@ if (!add_path()) {
209 255
 
210 256
    This function can be used from REQUEST_ROUTE.
211 257
 
212
-   Example 1.4. add_path(user) usage
258
+   Example 1.6. add_path(user) usage
213 259
 ...
214 260
 if (!add_path("loadbalancer")) {
215 261
         sl_send_reply("503", "Internal Path Error");
... ...
@@ -231,7 +277,7 @@ if (!add_path("loadbalancer")) {
231 277
 
232 278
    This function can be used from REQUEST_ROUTE.
233 279
 
234
-   Example 1.5. add_path(user, parameters) usage
280
+   Example 1.7. add_path(user, parameters) usage
235 281
 ...
236 282
 if (!add_path("loadbalancer", "ob")) {
237 283
         sl_send_reply("503", "Internal Path Error");
... ...
@@ -248,7 +294,7 @@ if (!add_path("loadbalancer", "ob")) {
248 294
 
249 295
    This function can be used from REQUEST_ROUTE.
250 296
 
251
-   Example 1.6. add_path_received() usage
297
+   Example 1.8. add_path_received() usage
252 298
 ...
253 299
 if (!add_path_received()) {
254 300
         sl_send_reply("503", "Internal Path Error");
... ...
@@ -265,7 +311,7 @@ if (!add_path_received()) {
265 311
 
266 312
    This function can be used from REQUEST_ROUTE.
267 313
 
268
-   Example 1.7. add_path_received(user) usage
314
+   Example 1.9. add_path_received(user) usage
269 315
 ...
270 316
 if (!add_path_received("inbound")) {
271 317
         sl_send_reply("503", "Internal Path Error");
... ...
@@ -282,7 +328,7 @@ if (!add_path_received("inbound")) {
282 328
 
283 329
    This function can be used from REQUEST_ROUTE.
284 330
 
285
-   Example 1.8. add_path_received(user, parameters) usage
331
+   Example 1.10. add_path_received(user, parameters) usage
286 332
 ...
287 333
 if (!add_path_received("inbound", "ob")) {
288 334
         sl_send_reply("503", "Internal Path Error");
Browse code

modules: readme files regenerated - path ... [skip ci]

Kamailio Dev authored on 09/02/2017 10:46:13
Showing 1 changed files
... ...
@@ -21,7 +21,7 @@ Richard Fuchs
21 21
 
22 22
         1. Overview
23 23
 
24
-              1.1. Path insertion for registrations
24
+              1.1. Path Insertion For Registrations
25 25
               1.2. Outbound routing to NAT'ed UACs
26 26
 
27 27
         2. Dependencies
... ...
@@ -44,13 +44,14 @@ Richard Fuchs
44 44
 
45 45
    List of Examples
46 46
 
47
-   1.1. Set use_received parameter
48
-   1.2. add_path usage
49
-   1.3. add_path(user) usage
50
-   1.4. add_path(user, parameters) usage
51
-   1.5. add_path_received() usage
52
-   1.6. add_path_received(user) usage
53
-   1.7. add_path_received(user, parameters) usage
47
+   1.1. Add Supported header
48
+   1.2. Set use_received parameter
49
+   1.3. add_path usage
50
+   1.4. add_path(user) usage
51
+   1.5. add_path(user, parameters) usage
52
+   1.6. add_path_received() usage
53
+   1.7. add_path_received(user) usage
54
+   1.8. add_path_received(user, parameters) usage
54 55
 
55 56
 Chapter 1. Admin Guide
56 57
 
... ...
@@ -58,7 +59,7 @@ Chapter 1. Admin Guide
58 59
 
59 60
    1. Overview
60 61
 
61
-        1.1. Path insertion for registrations
62
+        1.1. Path Insertion For Registrations
62 63
         1.2. Outbound routing to NAT'ed UACs
63 64
 
64 65
    2. Dependencies
... ...
@@ -81,7 +82,7 @@ Chapter 1. Admin Guide
81 82
 
82 83
 1. Overview
83 84
 
84
-   1.1. Path insertion for registrations
85
+   1.1. Path Insertion For Registrations
85 86
    1.2. Outbound routing to NAT'ed UACs
86 87
 
87 88
    This module is designed to be used at intermediate sip proxies like
... ...
@@ -91,7 +92,7 @@ Chapter 1. Admin Guide
91 92
    mechanism for evaluating this parameter in subsequent requests and to
92 93
    set the destination URI according to it.
93 94
 
94
-1.1. Path insertion for registrations
95
+1.1. Path Insertion For Registrations
95 96
 
96 97
    For registrations in a scenario like “[UAC] -> [P1] -> [REG]”, the
97 98
    "path" module can be used at the intermediate proxy P1 to insert a Path
... ...
@@ -110,6 +111,15 @@ Chapter 1. Admin Guide
110 111
        If the function is called with a username, it's included in the
111 112
        Path URI too.
112 113
 
114
+   Note that some SIP registrars may check if header Supported includes
115
+   'path'. It can be added in Kamailio.cfg using append_hf() from textops
116
+   module.
117
+
118
+   Example 1.1. Add Supported header
119
+...
120
+append_hf("Supported: path\r\n");
121
+...
122
+
113 123
 1.2. Outbound routing to NAT'ed UACs
114 124
 
115 125
    If the NAT'ed address of an UAC is passed to the registrar, the
... ...
@@ -152,7 +162,7 @@ Chapter 1. Admin Guide
152 162
 
153 163
    Default value is 0.
154 164
 
155
-   Example 1.1. Set use_received parameter
165
+   Example 1.2. Set use_received parameter
156 166
 ...
157 167
 modparam("path", "use_received", 1)
158 168
 ...
... ...
@@ -181,7 +191,7 @@ modparam("path", "use_received", 1)
181 191
 
182 192
    This function can be used from REQUEST_ROUTE.
183 193
 
184
-   Example 1.2. add_path usage
194
+   Example 1.3. add_path usage
185 195
 ...
186 196
 if (!add_path()) {
187 197
         sl_send_reply("503", "Internal Path Error");
... ...
@@ -199,7 +209,7 @@ if (!add_path()) {
199 209
 
200 210
    This function can be used from REQUEST_ROUTE.
201 211
 
202
-   Example 1.3. add_path(user) usage
212
+   Example 1.4. add_path(user) usage
203 213
 ...
204 214
 if (!add_path("loadbalancer")) {
205 215
         sl_send_reply("503", "Internal Path Error");
... ...
@@ -221,7 +231,7 @@ if (!add_path("loadbalancer")) {
221 231
 
222 232
    This function can be used from REQUEST_ROUTE.
223 233
 
224
-   Example 1.4. add_path(user, parameters) usage
234
+   Example 1.5. add_path(user, parameters) usage
225 235
 ...
226 236
 if (!add_path("loadbalancer", "ob")) {
227 237
         sl_send_reply("503", "Internal Path Error");
... ...
@@ -238,7 +248,7 @@ if (!add_path("loadbalancer", "ob")) {
238 248
 
239 249
    This function can be used from REQUEST_ROUTE.
240 250
 
241
-   Example 1.5. add_path_received() usage
251
+   Example 1.6. add_path_received() usage
242 252
 ...
243 253
 if (!add_path_received()) {
244 254
         sl_send_reply("503", "Internal Path Error");
... ...
@@ -255,7 +265,7 @@ if (!add_path_received()) {
255 265
 
256 266
    This function can be used from REQUEST_ROUTE.
257 267
 
258
-   Example 1.6. add_path_received(user) usage
268
+   Example 1.7. add_path_received(user) usage
259 269
 ...
260 270
 if (!add_path_received("inbound")) {
261 271
         sl_send_reply("503", "Internal Path Error");
... ...
@@ -272,7 +282,7 @@ if (!add_path_received("inbound")) {
272 282
 
273 283
    This function can be used from REQUEST_ROUTE.
274 284
 
275
-   Example 1.7. add_path_received(user, parameters) usage
285
+   Example 1.8. add_path_received(user, parameters) usage
276 286
 ...
277 287
 if (!add_path_received("inbound", "ob")) {
278 288
         sl_send_reply("503", "Internal Path Error");
Browse code

core, lib, modules: restructured source code tree

- new folder src/ to hold the source code for main project applications
- main.c is in src/
- all core files are subfolder are in src/core/
- modules are in src/modules/
- libs are in src/lib/
- application Makefiles are in src/
- application binary is built in src/ (src/kamailio)

Daniel-Constantin Mierla authored on 07/12/2016 11:03:51
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,281 @@
1
+path Module
2
+
3
+Andreas Granig
4
+
5
+   Inode GmbH
6
+
7
+Edited by
8
+
9
+Andreas Granig
10
+
11
+Edited by
12
+
13
+Richard Fuchs
14
+
15
+   Copyright © 2006 Inode GmbH
16
+     __________________________________________________________________
17
+
18
+   Table of Contents
19
+
20
+   1. Admin Guide
21
+
22
+        1. Overview
23
+
24
+              1.1. Path insertion for registrations
25
+              1.2. Outbound routing to NAT'ed UACs
26
+
27
+        2. Dependencies
28
+
29
+              2.1. Kamailio Modules
30
+              2.2. External Libraries or Applications
31
+
32
+        3. Parameters
33
+
34
+              3.1. use_received (int)
35
+
36
+        4. Functions
37
+
38
+              4.1. add_path()
39
+              4.2. add_path(user)
40
+              4.3. add_path(user, parameters)
41
+              4.4. add_path_received()
42
+              4.5. add_path_received(user)
43
+              4.6. add_path_received(user, parameters)
44
+
45
+   List of Examples
46
+
47
+   1.1. Set use_received parameter
48
+   1.2. add_path usage
49
+   1.3. add_path(user) usage
50
+   1.4. add_path(user, parameters) usage
51
+   1.5. add_path_received() usage
52
+   1.6. add_path_received(user) usage
53
+   1.7. add_path_received(user, parameters) usage
54
+
55
+Chapter 1. Admin Guide
56
+
57
+   Table of Contents
58
+
59
+   1. Overview
60
+
61
+        1.1. Path insertion for registrations
62
+        1.2. Outbound routing to NAT'ed UACs
63
+
64
+   2. Dependencies
65
+
66
+        2.1. Kamailio Modules
67
+        2.2. External Libraries or Applications
68
+
69
+   3. Parameters
70
+
71
+        3.1. use_received (int)
72
+
73
+   4. Functions
74
+
75
+        4.1. add_path()
76
+        4.2. add_path(user)
77
+        4.3. add_path(user, parameters)
78
+        4.4. add_path_received()
79
+        4.5. add_path_received(user)
80
+        4.6. add_path_received(user, parameters)
81
+
82
+1. Overview
83
+
84
+   1.1. Path insertion for registrations
85
+   1.2. Outbound routing to NAT'ed UACs
86
+
87
+   This module is designed to be used at intermediate sip proxies like
88
+   loadbalancers in front of registrars and proxies. It provides functions
89
+   for inserting a Path header including a parameter for passing forward
90
+   the received-URI of a registration to the next hop. It also provides a
91
+   mechanism for evaluating this parameter in subsequent requests and to
92
+   set the destination URI according to it.
93
+
94
+1.1. Path insertion for registrations
95
+
96
+   For registrations in a scenario like “[UAC] -> [P1] -> [REG]”, the
97
+   "path" module can be used at the intermediate proxy P1 to insert a Path
98
+   header into the message before forwarding it to the registrar REG. Two
99
+   functions can be used to achieve this:
100
+     * add_path(...) adds a Path header in the form of “Path:
101
+       <sip:1.2.3.4;lr>” to the message using the address of the outgoing
102
+       interface. A port is only added if it's not the default port 5060.
103
+       If a username is passed to the function, it is also included in the
104
+       Path URI, like “Path: <sip:username@1.2.3.4;lr>”.
105
+     * add_path_received(...) also add a Path header in the same form as
106
+       above, but also adds a parameter indicating the received-URI of the
107
+       message, like “Path: <sip:1.2.3.4;received=sip:2.3.4.5:1234;lr>”.
108
+       This is especially useful if the proxy does NAT detection and wants
109
+       to pass the NAT'ed address to the registrar.
110
+       If the function is called with a username, it's included in the
111
+       Path URI too.
112
+
113
+1.2. Outbound routing to NAT'ed UACs
114
+
115
+   If the NAT'ed address of an UAC is passed to the registrar, the
116
+   registrar routes back subsequent requests using the Path header of the
117
+   registration as Route header of the current request. If the
118
+   intermediate proxy had inserted a Path header including the “received”
119
+   parameter during the registration, this parameter will show up in the
120
+   Route header of the new request as well, allowing the intermediate
121
+   proxy to route to this address instead of the one propagated in the
122
+   Route URI for tunneling through NAT. This behaviour can be activated by
123
+   setting the module parameter “use_received”.
124
+
125
+2. Dependencies
126
+
127
+   2.1. Kamailio Modules
128
+   2.2. External Libraries or Applications
129
+
130
+2.1. Kamailio Modules
131
+
132
+   The following modules must be loaded before this module:
133
+     * The "rr" module is needed for outbound routing according to the
134
+       “received” parameter.
135
+     * The "outbound" module is needed for outbound routing as per RFC
136
+       5626.
137
+
138
+2.2. External Libraries or Applications
139
+
140
+   The following libraries or applications must be installed before
141
+   running Kamailio with this module loaded:
142
+     * None.
143
+
144
+3. Parameters
145
+
146
+   3.1. use_received (int)
147
+
148
+3.1. use_received (int)
149
+
150
+   If set to 1, the “received” parameter of the first Route URI is
151
+   evaluated and used as destination-URI if present.
152
+
153
+   Default value is 0.
154
+
155
+   Example 1.1. Set use_received parameter
156
+...
157
+modparam("path", "use_received", 1)
158
+...
159
+
160
+4. Functions
161
+
162
+   4.1. add_path()
163
+   4.2. add_path(user)
164
+   4.3. add_path(user, parameters)
165
+   4.4. add_path_received()
166
+   4.5. add_path_received(user)
167
+   4.6. add_path_received(user, parameters)
168
+
169
+4.1.  add_path()
170
+
171
+   This function is used to insert a Path header in the form “Path:
172
+   <sip:1.2.3.4;lr>”, where “1.2.3.4” is the address of the outgoing
173
+   interface.
174
+
175
+   If the “outbound” module was loaded before this module, and outbound is
176
+   required for this request, the header will be in the form “Path:
177
+   <sip:flowtoken@1.2.3.4;lr;ob>”, where “flowtoken” is the RFC 5626
178
+   flow-token that can be used to identify the source and local address
179
+   and transport the request was received on, and where “1.2.3.4” is the
180
+   address of the outgoing interface.
181
+
182
+   This function can be used from REQUEST_ROUTE.
183
+
184
+   Example 1.2. add_path usage
185
+...
186
+if (!add_path()) {
187
+        sl_send_reply("503", "Internal Path Error");
188
+        ...
189
+};
190
+...
191
+
192
+4.2.  add_path(user)
193
+
194
+   This function adds a Path header in the form “Path:
195
+   <sip:user@1.2.3.4;lr>”.
196
+
197
+   Meaning of the parameters is as follows:
198
+     * user - The username to be inserted as user part. SPVE is supported.
199
+
200
+   This function can be used from REQUEST_ROUTE.
201
+
202
+   Example 1.3. add_path(user) usage
203
+...
204
+if (!add_path("loadbalancer")) {
205
+        sl_send_reply("503", "Internal Path Error");
206
+        ...
207
+};
208
+...
209
+
210
+4.3.  add_path(user, parameters)
211
+
212
+   This function adds a Path header in the form “Path:
213
+   <sip:user@1.2.3.4;lr>” and appends the given parameters as additional
214
+   URI parameters.
215
+
216
+   Meaning of the parameters is as follows:
217
+     * user - The username to be inserted as user part. SPVE is supported.
218
+     * parameters - Additional URI parameters to be appended to the URI.
219
+       The semicolon separator is added automatically. The script writer
220
+       is responsible for proper URI escaping. SPVE is supported.
221
+
222
+   This function can be used from REQUEST_ROUTE.
223
+
224
+   Example 1.4. add_path(user, parameters) usage
225
+...
226
+if (!add_path("loadbalancer", "ob")) {
227
+        sl_send_reply("503", "Internal Path Error");
228
+        ...
229
+};
230
+...
231
+
232
+4.4.  add_path_received()
233
+
234
+   This function adds a Path header in the form “Path:
235
+   <sip:1.2.3.4;received=sip:2.3.4.5:1234;lr>”, setting its own outgoing
236
+   address as domain-part, and the address the request has been received
237
+   from as received-parameter.
238
+
239
+   This function can be used from REQUEST_ROUTE.
240
+
241
+   Example 1.5. add_path_received() usage
242
+...
243
+if (!add_path_received()) {
244
+        sl_send_reply("503", "Internal Path Error");
245
+        ...
246
+};
247
+...
248
+
249
+4.5.  add_path_received(user)
250
+
251
+   This function adds a Path header in the form “Path:
252
+   <sip:user@1.2.3.4;received=sip:2.3.4.5:1234;lr>”, setting 'user' as
253
+   username part of address, its own outgoing address as domain-part, and
254
+   the address the request has been received from as received-parameter.
255
+
256
+   This function can be used from REQUEST_ROUTE.
257
+
258
+   Example 1.6. add_path_received(user) usage
259
+...
260
+if (!add_path_received("inbound")) {
261
+        sl_send_reply("503", "Internal Path Error");
262
+        ...
263
+};
264
+...
265
+
266
+4.6.  add_path_received(user, parameters)
267
+
268
+   This function adds a Path header in the form “Path:
269
+   <sip:user@1.2.3.4;received=sip:2.3.4.5:1234;lr>”, setting 'user' as
270
+   username part of address, its own outgoing address as domain-part, and
271
+   the address the request has been received from as received-parameter.
272
+
273
+   This function can be used from REQUEST_ROUTE.
274
+
275
+   Example 1.7. add_path_received(user, parameters) usage
276
+...
277
+if (!add_path_received("inbound", "ob")) {
278
+        sl_send_reply("503", "Internal Path Error");
279
+        ...
280
+};
281
+...