Browse code

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

Kamailio Dev authored on 29/09/2020 08:46:15
Showing 1 changed files
... ...
@@ -36,10 +36,12 @@ Daniel-Constantin Mierla
36 36
               3.9. sanity_checks (integer)
37 37
               3.10. uri_prefix_checks (integer)
38 38
               3.11. event_callback (str)
39
+              3.12. event_mode (int)
39 40
 
40 41
         4. Event Routes
41 42
 
42 43
               4.1. event_route[topoh:msg-outgoing]
44
+              4.2. event_route[topoh:msg-sending]
43 45
 
44 46
    List of Examples
45 47
 
... ...
@@ -54,7 +56,9 @@ Daniel-Constantin Mierla
54 56
    1.9. Set sanity_checks parameter
55 57
    1.10. Set uri_prefix_checks parameter
56 58
    1.11. Set event_callback parameter
57
-   1.12. Usage of event_route[topoh:msg-outgoing]
59
+   1.12. Set event_mode parameter
60
+   1.13. Usage of event_route[topoh:msg-outgoing]
61
+   1.14. Usage of event_route[topoh:msg-sending]
58 62
 
59 63
 Chapter 1. Admin Guide
60 64
 
... ...
@@ -79,10 +83,12 @@ Chapter 1. Admin Guide
79 83
         3.9. sanity_checks (integer)
80 84
         3.10. uri_prefix_checks (integer)
81 85
         3.11. event_callback (str)
86
+        3.12. event_mode (int)
82 87
 
83 88
    4. Event Routes
84 89
 
85 90
         4.1. event_route[topoh:msg-outgoing]
91
+        4.2. event_route[topoh:msg-sending]
86 92
 
87 93
 1. Overview
88 94
 
... ...
@@ -130,6 +136,7 @@ Chapter 1. Admin Guide
130 136
    3.9. sanity_checks (integer)
131 137
    3.10. uri_prefix_checks (integer)
132 138
    3.11. event_callback (str)
139
+   3.12. event_mode (int)
133 140
 
134 141
 3.1. mask_key (str)
135 142
 
... ...
@@ -284,9 +291,23 @@ function ksr_topoh_event(evname)
284 291
 end
285 292
 ...
286 293
 
294
+3.12. event_mode (int)
295
+
296
+   Control what event_route blocks to be executed. It is a bitmask of: 1 -
297
+   execute event_route[topoh:msg-outgoing]; 2 - execute
298
+   event_route[topoh:msg-sending].
299
+
300
+   Default value is 3 (execute both event_route blocks).
301
+
302
+   Example 1.12. Set event_mode parameter
303
+...
304
+modparam("topoh", "event_mode", 2)
305
+...
306
+
287 307
 4. Event Routes
288 308
 
289 309
    4.1. event_route[topoh:msg-outgoing]
310
+   4.2. event_route[topoh:msg-sending]
290 311
 
291 312
 4.1. event_route[topoh:msg-outgoing]
292 313
 
... ...
@@ -300,7 +321,7 @@ end
300 321
    reparsing the outgoing SIP message for the cases when topology hiding
301 322
    is not wanted.
302 323
 
303
-   Example 1.12. Usage of event_route[topoh:msg-outgoing]
324
+   Example 1.13. Usage of event_route[topoh:msg-outgoing]
304 325
 ...
305 326
 event_route[topoh:msg-outgoing] {
306 327
   if($sndto(ip)=="10.1.1.10") {
... ...
@@ -308,3 +329,22 @@ event_route[topoh:msg-outgoing] {
308 329
   }
309 330
 }
310 331
 ...
332
+
333
+4.2. event_route[topoh:msg-sending]
334
+
335
+   It is executed before doing topology hiding processing for a SIP
336
+   message to be sent out, being executed after
337
+   event_route[topoh:msg-outgoing].
338
+
339
+   Inside the event route the variables $sndto(ip), $sndto(port) and
340
+   $sndto(proto) point to the destination. The SIP message is the one to
341
+   be sent out.
342
+
343
+   Example 1.14. Usage of event_route[topoh:msg-sending]
344
+...
345
+event_route[topoh:msg-sending] {
346
+  if(is_request() and $fU=="alice") {
347
+    drop;
348
+  }
349
+}
350
+...
Browse code

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

Kamailio Dev authored on 28/02/2018 17:03:37 • The Root committed on 28/02/2018 19:11:36
Showing 1 changed files
... ...
@@ -93,7 +93,7 @@ Chapter 1. Admin Guide
93 93
 
94 94
    The module is transparent for the configuration writer. It only needs
95 95
    to be loaded (tune the parameters if needed). The SIP server can be
96
-   restarted whitout affecting ongoing calls - once it is up, can
96
+   restarted without affecting ongoing calls - once it is up, can
97 97
    encode/decode topology details, thus no call will be lost.
98 98
 
99 99
    By using same mask_key, many SIP servers can decode the message, for
... ...
@@ -234,7 +234,7 @@ modparam("topoh", "callid_prefix", "***")
234 234
 
235 235
    If set to 1, topoh module will bind to sanity module in order to
236 236
    perform sanity checks over received SIP request. Default sanity checks
237
-   are done. It is useful to check if received request is well formated
237
+   are done. It is useful to check if received request is well formatted
238 238
    before proceeding to encoding/decoding.
239 239
 
240 240
    Default value is 0 (do not bind to sanity module).
... ...
@@ -253,8 +253,8 @@ modparam("topoh", "sanity_checks", 1)
253 253
 
254 254
    Note: do not enable this option if you have SIP devices that can alter
255 255
    the URI values it takes from Contact or Record-Route headers (like
256
-   adding port 5060 when no port is in received URIs, or thet introduce
257
-   new parameters at unknown position).
256
+   adding port 5060 when no port is in received URIs, or that introduces
257
+   new parameters at an unknown position).
258 258
 
259 259
    Default value is 0.
260 260
 
Browse code

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

Kamailio Dev authored on 21/08/2017 15:01:27
Showing 1 changed files
... ...
@@ -87,7 +87,7 @@ Chapter 1. Admin Guide
87 87
 1. Overview
88 88
 
89 89
    This module hides the SIP routing headers that show topology details.
90
-   It it is not affected by the server being transaction stateless or
90
+   It is not affected by the server being transaction stateless or
91 91
    stateful. The script interpreter gets the SIP messages decoded, so all
92 92
    existing functionality is preserved.
93 93
 
Browse code

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

Kamailio Dev authored on 25/06/2017 08:16:40
Showing 1 changed files
... ...
@@ -34,6 +34,8 @@ Daniel-Constantin Mierla
34 34
               3.7. vparam_prefix (str)
35 35
               3.8. callid_prefix (str)
36 36
               3.9. sanity_checks (integer)
37
+              3.10. uri_prefix_checks (integer)
38
+              3.11. event_callback (str)
37 39
 
38 40
         4. Event Routes
39 41
 
... ...
@@ -50,7 +52,9 @@ Daniel-Constantin Mierla
50 52
    1.7. Set vparam_prefix parameter
51 53
    1.8. Set callid_prefix parameter
52 54
    1.9. Set sanity_checks parameter
53
-   1.10. Usage of event_route[topoh:msg-outgoing]
55
+   1.10. Set uri_prefix_checks parameter
56
+   1.11. Set event_callback parameter
57
+   1.12. Usage of event_route[topoh:msg-outgoing]
54 58
 
55 59
 Chapter 1. Admin Guide
56 60
 
... ...
@@ -73,6 +77,8 @@ Chapter 1. Admin Guide
73 77
         3.7. vparam_prefix (str)
74 78
         3.8. callid_prefix (str)
75 79
         3.9. sanity_checks (integer)
80
+        3.10. uri_prefix_checks (integer)
81
+        3.11. event_callback (str)
76 82
 
77 83
    4. Event Routes
78 84
 
... ...
@@ -122,6 +128,8 @@ Chapter 1. Admin Guide
122 128
    3.7. vparam_prefix (str)
123 129
    3.8. callid_prefix (str)
124 130
    3.9. sanity_checks (integer)
131
+   3.10. uri_prefix_checks (integer)
132
+   3.11. event_callback (str)
125 133
 
126 134
 3.1. mask_key (str)
127 135
 
... ...
@@ -236,6 +244,46 @@ modparam("topoh", "callid_prefix", "***")
236 244
 modparam("topoh", "sanity_checks", 1)
237 245
 ...
238 246
 
247
+3.10. uri_prefix_checks (integer)
248
+
249
+   If set to 1, topoh module will check if URIs to be decoded match the
250
+   expected prefix composed from mask IP and parameter name prefix. It can
251
+   make the topoh processing safer by avoiding to try decoding URIs which
252
+   were not encoded previously by topoh.
253
+
254
+   Note: do not enable this option if you have SIP devices that can alter
255
+   the URI values it takes from Contact or Record-Route headers (like
256
+   adding port 5060 when no port is in received URIs, or thet introduce
257
+   new parameters at unknown position).
258
+
259
+   Default value is 0.
260
+
261
+   Example 1.10. Set uri_prefix_checks parameter
262
+...
263
+modparam("topoh", "uri_prefix_checks", 1)
264
+...
265
+
266
+3.11. event_callback (str)
267
+
268
+   The name of the function in the KEMI configuration file (embedded
269
+   scripting language such as Lua, Python, ...) to be executed instead of
270
+   event_route[...] blocks.
271
+
272
+   The function receives a string parameter with the name of the event.
273
+
274
+   Default value is 'empty' (no function is executed for events).
275
+
276
+   Example 1.11. Set event_callback parameter
277
+...
278
+modparam("topoh", "event_callback", "ksr_topoh_event")
279
+...
280
+-- event callback function implemented in Lua
281
+function ksr_topoh_event(evname)
282
+        KSR.info("===== topoh module triggered event: " .. evname .. "\n");
283
+        return 1;
284
+end
285
+...
286
+
239 287
 4. Event Routes
240 288
 
241 289
    4.1. event_route[topoh:msg-outgoing]
... ...
@@ -252,7 +300,7 @@ modparam("topoh", "sanity_checks", 1)
252 300
    reparsing the outgoing SIP message for the cases when topology hiding
253 301
    is not wanted.
254 302
 
255
-   Example 1.10. Usage of event_route[topoh:msg-outgoing]
303
+   Example 1.12. Usage of event_route[topoh:msg-outgoing]
256 304
 ...
257 305
 event_route[topoh:msg-outgoing] {
258 306
   if($sndto(ip)=="10.1.1.10") {
Browse code

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

Kamailio Dev authored on 15/06/2017 15:16:22
Showing 1 changed files
... ...
@@ -35,6 +35,10 @@ Daniel-Constantin Mierla
35 35
               3.8. callid_prefix (str)
36 36
               3.9. sanity_checks (integer)
37 37
 
38
+        4. Event Routes
39
+
40
+              4.1. event_route[topoh:msg-outgoing]
41
+
38 42
    List of Examples
39 43
 
40 44
    1.1. Set mask_key parameter
... ...
@@ -46,6 +50,7 @@ Daniel-Constantin Mierla
46 50
    1.7. Set vparam_prefix parameter
47 51
    1.8. Set callid_prefix parameter
48 52
    1.9. Set sanity_checks parameter
53
+   1.10. Usage of event_route[topoh:msg-outgoing]
49 54
 
50 55
 Chapter 1. Admin Guide
51 56
 
... ...
@@ -69,6 +74,10 @@ Chapter 1. Admin Guide
69 74
         3.8. callid_prefix (str)
70 75
         3.9. sanity_checks (integer)
71 76
 
77
+   4. Event Routes
78
+
79
+        4.1. event_route[topoh:msg-outgoing]
80
+
72 81
 1. Overview
73 82
 
74 83
    This module hides the SIP routing headers that show topology details.
... ...
@@ -226,3 +235,28 @@ modparam("topoh", "callid_prefix", "***")
226 235
 ...
227 236
 modparam("topoh", "sanity_checks", 1)
228 237
 ...
238
+
239
+4. Event Routes
240
+
241
+   4.1. event_route[topoh:msg-outgoing]
242
+
243
+4.1. event_route[topoh:msg-outgoing]
244
+
245
+   It is executed before doing topology hiding processing for an outgoing
246
+   SIP message. If 'drop' is executed inside the event route, then the
247
+   module skips doing the topology hiding.
248
+
249
+   Inside the event route the variables $sndto(ip), $sndto(port) and
250
+   $sndto(proto) point to the destination. The SIP message is not the one
251
+   to be sent out, but an internally generated one at startup, to avoid
252
+   reparsing the outgoing SIP message for the cases when topology hiding
253
+   is not wanted.
254
+
255
+   Example 1.10. Usage of event_route[topoh:msg-outgoing]
256
+...
257
+event_route[topoh:msg-outgoing] {
258
+  if($sndto(ip)=="10.1.1.10") {
259
+    drop;
260
+  }
261
+}
262
+...
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,228 @@
1
+topoh Module
2
+
3
+Daniel-Constantin Mierla
4
+
5
+   <miconda@gmail.com>
6
+
7
+Edited by
8
+
9
+Daniel-Constantin Mierla
10
+
11
+   <miconda@gmail.com>
12
+
13
+   Copyright © 2009 FhG FOKUS
14
+     __________________________________________________________________
15
+
16
+   Table of Contents
17
+
18
+   1. Admin Guide
19
+
20
+        1. Overview
21
+        2. Dependencies
22
+
23
+              2.1. Kamailio Modules
24
+              2.2. External Libraries or Applications
25
+
26
+        3. Parameters
27
+
28
+              3.1. mask_key (str)
29
+              3.2. mask_ip (str)
30
+              3.3. mask_callid (integer)
31
+              3.4. uparam_name (str)
32
+              3.5. uparam_prefix (str)
33
+              3.6. vparam_name (str)
34
+              3.7. vparam_prefix (str)
35
+              3.8. callid_prefix (str)
36
+              3.9. sanity_checks (integer)
37
+
38
+   List of Examples
39
+
40
+   1.1. Set mask_key parameter
41
+   1.2. Set mask_ip parameter
42
+   1.3. Set mask_callid parameter
43
+   1.4. Set uparam_name parameter
44
+   1.5. Set uparam_prefix parameter
45
+   1.6. Set vparam_name parameter
46
+   1.7. Set vparam_prefix parameter
47
+   1.8. Set callid_prefix parameter
48
+   1.9. Set sanity_checks parameter
49
+
50
+Chapter 1. Admin Guide
51
+
52
+   Table of Contents
53
+
54
+   1. Overview
55
+   2. Dependencies
56
+
57
+        2.1. Kamailio Modules
58
+        2.2. External Libraries or Applications
59
+
60
+   3. Parameters
61
+
62
+        3.1. mask_key (str)
63
+        3.2. mask_ip (str)
64
+        3.3. mask_callid (integer)
65
+        3.4. uparam_name (str)
66
+        3.5. uparam_prefix (str)
67
+        3.6. vparam_name (str)
68
+        3.7. vparam_prefix (str)
69
+        3.8. callid_prefix (str)
70
+        3.9. sanity_checks (integer)
71
+
72
+1. Overview
73
+
74
+   This module hides the SIP routing headers that show topology details.
75
+   It it is not affected by the server being transaction stateless or
76
+   stateful. The script interpreter gets the SIP messages decoded, so all
77
+   existing functionality is preserved.
78
+
79
+   The module is transparent for the configuration writer. It only needs
80
+   to be loaded (tune the parameters if needed). The SIP server can be
81
+   restarted whitout affecting ongoing calls - once it is up, can
82
+   encode/decode topology details, thus no call will be lost.
83
+
84
+   By using same mask_key, many SIP servers can decode the message, for
85
+   example, applicable for servers behind load balancers.
86
+
87
+2. Dependencies
88
+
89
+   2.1. Kamailio Modules
90
+   2.2. External Libraries or Applications
91
+
92
+2.1. Kamailio Modules
93
+
94
+   The following modules must be loaded before this module:
95
+     * rr module - server must perform record routing to ensure in-dialog
96
+       requests are encoded/decoded.
97
+
98
+2.2. External Libraries or Applications
99
+
100
+   The following libraries or applications must be installed before
101
+   running Kamailio with this module loaded:
102
+     * None. In the future the module can be enhanced to use a stronger
103
+       encryption algorithm.
104
+
105
+3. Parameters
106
+
107
+   3.1. mask_key (str)
108
+   3.2. mask_ip (str)
109
+   3.3. mask_callid (integer)
110
+   3.4. uparam_name (str)
111
+   3.5. uparam_prefix (str)
112
+   3.6. vparam_name (str)
113
+   3.7. vparam_prefix (str)
114
+   3.8. callid_prefix (str)
115
+   3.9. sanity_checks (integer)
116
+
117
+3.1. mask_key (str)
118
+
119
+   Keyword to mask the headers.
120
+
121
+   Default value is "_static_value_".
122
+
123
+   Example 1.1. Set mask_key parameter
124
+...
125
+modparam("topoh", "mask_key", "some secret here")
126
+...
127
+
128
+3.2. mask_ip (str)
129
+
130
+   IP address to be used in masked headers to build valid SIP URIs. Can be
131
+   any IP address, even a private-space or non-existing IP address (e.g.,
132
+   192.168.1.1, 127.0.0.2), including the SIP server address, but must not
133
+   be an address potentially used by clients. It is not used at all for
134
+   SIP routing.
135
+
136
+   Default value is "127.0.0.8".
137
+
138
+   Example 1.2. Set mask_ip parameter
139
+...
140
+modparam("topoh", "mask_ip", "192.168.0.1")
141
+...
142
+
143
+3.3. mask_callid (integer)
144
+
145
+   Whether to encode the Call-id: header. Some SIP extensions include the
146
+   Call-id in the SIP message payload or header, so it is safe to not
147
+   encode Call-id in such cases. Well-known extensions such as call
148
+   transfer or conference join will be added to work with encoded Call-id.
149
+
150
+   NOTE: if you are using dialog module to terminate calls and this
151
+   parameter is enabled, you must set the dialog module parameter
152
+   'lreq_callee_headers' to include the header: 'TH: dlh\r\n'.
153
+
154
+   Default value is 0 (do not mask).
155
+
156
+   Example 1.3. Set mask_callid parameter
157
+...
158
+modparam("topoh", "mask_callid", 1)
159
+...
160
+
161
+3.4. uparam_name (str)
162
+
163
+   Name of URI parameter where to store encoded value.
164
+
165
+   Default value is "line".
166
+
167
+   Example 1.4. Set uparam_name parameter
168
+...
169
+modparam("topoh", "uparam_name", "myparam")
170
+...
171
+
172
+3.5. uparam_prefix (str)
173
+
174
+   Prefix to be added in encoded URI parameters.
175
+
176
+   Default value is "sr-".
177
+
178
+   Example 1.5. Set uparam_prefix parameter
179
+...
180
+modparam("topoh", "uparam_prefix", "xyz")
181
+...
182
+
183
+3.6. vparam_name (str)
184
+
185
+   Name of Via: parameter used to store encoded value.
186
+
187
+   Default value is "branch".
188
+
189
+   Example 1.6. Set vparam_name parameter
190
+...
191
+modparam("topoh", "vparam_name", "myv")
192
+...
193
+
194
+3.7. vparam_prefix (str)
195
+
196
+   Prefix to be added in encoded Via: parameters.
197
+
198
+   Default value is "z9hG4bKsr-".
199
+
200
+   Example 1.7. Set vparam_prefix parameter
201
+...
202
+modparam("topoh", "vparam_prefix", "xyz")
203
+...
204
+
205
+3.8. callid_prefix (str)
206
+
207
+   Prefix to be added in encoded Call-ID: headers.
208
+
209
+   Default value is "!!:".
210
+
211
+   Example 1.8. Set callid_prefix parameter
212
+...
213
+modparam("topoh", "callid_prefix", "***")
214
+...
215
+
216
+3.9. sanity_checks (integer)
217
+
218
+   If set to 1, topoh module will bind to sanity module in order to
219
+   perform sanity checks over received SIP request. Default sanity checks
220
+   are done. It is useful to check if received request is well formated
221
+   before proceeding to encoding/decoding.
222
+
223
+   Default value is 0 (do not bind to sanity module).
224
+
225
+   Example 1.9. Set sanity_checks parameter
226
+...
227
+modparam("topoh", "sanity_checks", 1)
228
+...