... | ... |
@@ -20,33 +20,34 @@ Daniel-Constantin Mierla |
20 | 20 |
2. Functions |
21 | 21 |
|
22 | 22 |
2.1. msg_apply_changes() |
23 |
- 2.2. change_reply_status(code, reason) |
|
24 |
- 2.3. change_reply_status_code(vcode) |
|
25 |
- 2.4. remove_body() |
|
26 |
- 2.5. keep_hf([regexp]) |
|
27 |
- 2.6. fnmatch(value, expr [, flags]) |
|
28 |
- 2.7. append_hf_value(hf, hvalue) |
|
29 |
- 2.8. insert_hf_value(hf, hvalue) |
|
30 |
- 2.9. remove_hf_value(hf_par) |
|
31 |
- 2.10. remove_hf_value2(hf_par) |
|
32 |
- 2.11. assign_hf_value(hf, hvalue) |
|
33 |
- 2.12. assign_hf_value2(hf, hvalue) |
|
34 |
- 2.13. include_hf_value(hf, hvalue) |
|
35 |
- 2.14. exclude_hf_value(hf, hvalue) |
|
36 |
- 2.15. hf_value_exists(hf, hvalue) |
|
37 |
- 2.16. hf_iterator_start(iname) |
|
38 |
- 2.17. hf_iterator_end(iname) |
|
39 |
- 2.18. textopsx.f.hf_iterator_next(iname) |
|
40 |
- 2.19. textopsx.f.hf_iterator_prev(iname) |
|
41 |
- 2.20. hf_iterator_rm(iname) |
|
42 |
- 2.21. hf_iterator_append(iname, htext) |
|
43 |
- 2.22. hf_iterator_insert(iname, htext) |
|
44 |
- 2.23. bl_iterator_start(iname) |
|
45 |
- 2.24. bl_iterator_end(iname) |
|
46 |
- 2.25. textopsx.f.bl_iterator_next(iname) |
|
47 |
- 2.26. bl_iterator_rm(iname) |
|
48 |
- 2.27. bl_iterator_append(iname, text) |
|
49 |
- 2.28. bl_iterator_insert(iname, text) |
|
23 |
+ 2.2. msg_set_buffer(data) |
|
24 |
+ 2.3. change_reply_status(code, reason) |
|
25 |
+ 2.4. change_reply_status_code(vcode) |
|
26 |
+ 2.5. remove_body() |
|
27 |
+ 2.6. keep_hf([regexp]) |
|
28 |
+ 2.7. fnmatch(value, expr [, flags]) |
|
29 |
+ 2.8. append_hf_value(hf, hvalue) |
|
30 |
+ 2.9. insert_hf_value(hf, hvalue) |
|
31 |
+ 2.10. remove_hf_value(hf_par) |
|
32 |
+ 2.11. remove_hf_value2(hf_par) |
|
33 |
+ 2.12. assign_hf_value(hf, hvalue) |
|
34 |
+ 2.13. assign_hf_value2(hf, hvalue) |
|
35 |
+ 2.14. include_hf_value(hf, hvalue) |
|
36 |
+ 2.15. exclude_hf_value(hf, hvalue) |
|
37 |
+ 2.16. hf_value_exists(hf, hvalue) |
|
38 |
+ 2.17. hf_iterator_start(iname) |
|
39 |
+ 2.18. hf_iterator_end(iname) |
|
40 |
+ 2.19. textopsx.f.hf_iterator_next(iname) |
|
41 |
+ 2.20. textopsx.f.hf_iterator_prev(iname) |
|
42 |
+ 2.21. hf_iterator_rm(iname) |
|
43 |
+ 2.22. hf_iterator_append(iname, htext) |
|
44 |
+ 2.23. hf_iterator_insert(iname, htext) |
|
45 |
+ 2.24. bl_iterator_start(iname) |
|
46 |
+ 2.25. bl_iterator_end(iname) |
|
47 |
+ 2.26. textopsx.f.bl_iterator_next(iname) |
|
48 |
+ 2.27. bl_iterator_rm(iname) |
|
49 |
+ 2.28. bl_iterator_append(iname, text) |
|
50 |
+ 2.29. bl_iterator_insert(iname, text) |
|
50 | 51 |
|
51 | 52 |
3. Selects |
52 | 53 |
|
... | ... |
@@ -57,34 +58,35 @@ Daniel-Constantin Mierla |
57 | 58 |
List of Examples |
58 | 59 |
|
59 | 60 |
1.1. msg_apply_changes() usage |
60 |
- 1.2. change_reply_status usage |
|
61 |
- 1.3. change_reply_status_code usage |
|
62 |
- 1.4. remove_body() usage |
|
63 |
- 1.5. keep_hf() usage |
|
64 |
- 1.6. fnmatch() usage |
|
65 |
- 1.7. append_hf_value usage |
|
66 |
- 1.8. insert_hf_value usage |
|
67 |
- 1.9. remove_hf_value usage |
|
68 |
- 1.10. remove_hf_value2 usage |
|
69 |
- 1.11. assign_hf_value usage |
|
70 |
- 1.12. assign_hf_value2 usage |
|
71 |
- 1.13. include_hf_value usage |
|
72 |
- 1.14. exclude_hf_value usage |
|
73 |
- 1.15. hf_value_exists usage |
|
74 |
- 1.16. hf_iterator_start usage |
|
75 |
- 1.17. hf_iterator_end usage |
|
76 |
- 1.18. hf_iterator_next usage |
|
77 |
- 1.19. hf_iterator_prev usage |
|
78 |
- 1.20. hf_iterator_rm usage |
|
79 |
- 1.21. hf_iterator_append usage |
|
80 |
- 1.22. hf_iterator_insert usage |
|
81 |
- 1.23. bl_iterator_start usage |
|
82 |
- 1.24. bl_iterator_end usage |
|
83 |
- 1.25. bl_iterator_next usage |
|
84 |
- 1.26. bl_iterator_rm usage |
|
85 |
- 1.27. bl_iterator_append usage |
|
86 |
- 1.28. bl_iterator_insert usage |
|
87 |
- 1.29. @hf_value select usage |
|
61 |
+ 1.2. msg_set_buffer() usage |
|
62 |
+ 1.3. change_reply_status usage |
|
63 |
+ 1.4. change_reply_status_code usage |
|
64 |
+ 1.5. remove_body() usage |
|
65 |
+ 1.6. keep_hf() usage |
|
66 |
+ 1.7. fnmatch() usage |
|
67 |
+ 1.8. append_hf_value usage |
|
68 |
+ 1.9. insert_hf_value usage |
|
69 |
+ 1.10. remove_hf_value usage |
|
70 |
+ 1.11. remove_hf_value2 usage |
|
71 |
+ 1.12. assign_hf_value usage |
|
72 |
+ 1.13. assign_hf_value2 usage |
|
73 |
+ 1.14. include_hf_value usage |
|
74 |
+ 1.15. exclude_hf_value usage |
|
75 |
+ 1.16. hf_value_exists usage |
|
76 |
+ 1.17. hf_iterator_start usage |
|
77 |
+ 1.18. hf_iterator_end usage |
|
78 |
+ 1.19. hf_iterator_next usage |
|
79 |
+ 1.20. hf_iterator_prev usage |
|
80 |
+ 1.21. hf_iterator_rm usage |
|
81 |
+ 1.22. hf_iterator_append usage |
|
82 |
+ 1.23. hf_iterator_insert usage |
|
83 |
+ 1.24. bl_iterator_start usage |
|
84 |
+ 1.25. bl_iterator_end usage |
|
85 |
+ 1.26. bl_iterator_next usage |
|
86 |
+ 1.27. bl_iterator_rm usage |
|
87 |
+ 1.28. bl_iterator_append usage |
|
88 |
+ 1.29. bl_iterator_insert usage |
|
89 |
+ 1.30. @hf_value select usage |
|
88 | 90 |
|
89 | 91 |
Chapter 1. Admin Guide |
90 | 92 |
|
... | ... |
@@ -94,33 +96,34 @@ Chapter 1. Admin Guide |
94 | 96 |
2. Functions |
95 | 97 |
|
96 | 98 |
2.1. msg_apply_changes() |
97 |
- 2.2. change_reply_status(code, reason) |
|
98 |
- 2.3. change_reply_status_code(vcode) |
|
99 |
- 2.4. remove_body() |
|
100 |
- 2.5. keep_hf([regexp]) |
|
101 |
- 2.6. fnmatch(value, expr [, flags]) |
|
102 |
- 2.7. append_hf_value(hf, hvalue) |
|
103 |
- 2.8. insert_hf_value(hf, hvalue) |
|
104 |
- 2.9. remove_hf_value(hf_par) |
|
105 |
- 2.10. remove_hf_value2(hf_par) |
|
106 |
- 2.11. assign_hf_value(hf, hvalue) |
|
107 |
- 2.12. assign_hf_value2(hf, hvalue) |
|
108 |
- 2.13. include_hf_value(hf, hvalue) |
|
109 |
- 2.14. exclude_hf_value(hf, hvalue) |
|
110 |
- 2.15. hf_value_exists(hf, hvalue) |
|
111 |
- 2.16. hf_iterator_start(iname) |
|
112 |
- 2.17. hf_iterator_end(iname) |
|
113 |
- 2.18. textopsx.f.hf_iterator_next(iname) |
|
114 |
- 2.19. textopsx.f.hf_iterator_prev(iname) |
|
115 |
- 2.20. hf_iterator_rm(iname) |
|
116 |
- 2.21. hf_iterator_append(iname, htext) |
|
117 |
- 2.22. hf_iterator_insert(iname, htext) |
|
118 |
- 2.23. bl_iterator_start(iname) |
|
119 |
- 2.24. bl_iterator_end(iname) |
|
120 |
- 2.25. textopsx.f.bl_iterator_next(iname) |
|
121 |
- 2.26. bl_iterator_rm(iname) |
|
122 |
- 2.27. bl_iterator_append(iname, text) |
|
123 |
- 2.28. bl_iterator_insert(iname, text) |
|
99 |
+ 2.2. msg_set_buffer(data) |
|
100 |
+ 2.3. change_reply_status(code, reason) |
|
101 |
+ 2.4. change_reply_status_code(vcode) |
|
102 |
+ 2.5. remove_body() |
|
103 |
+ 2.6. keep_hf([regexp]) |
|
104 |
+ 2.7. fnmatch(value, expr [, flags]) |
|
105 |
+ 2.8. append_hf_value(hf, hvalue) |
|
106 |
+ 2.9. insert_hf_value(hf, hvalue) |
|
107 |
+ 2.10. remove_hf_value(hf_par) |
|
108 |
+ 2.11. remove_hf_value2(hf_par) |
|
109 |
+ 2.12. assign_hf_value(hf, hvalue) |
|
110 |
+ 2.13. assign_hf_value2(hf, hvalue) |
|
111 |
+ 2.14. include_hf_value(hf, hvalue) |
|
112 |
+ 2.15. exclude_hf_value(hf, hvalue) |
|
113 |
+ 2.16. hf_value_exists(hf, hvalue) |
|
114 |
+ 2.17. hf_iterator_start(iname) |
|
115 |
+ 2.18. hf_iterator_end(iname) |
|
116 |
+ 2.19. textopsx.f.hf_iterator_next(iname) |
|
117 |
+ 2.20. textopsx.f.hf_iterator_prev(iname) |
|
118 |
+ 2.21. hf_iterator_rm(iname) |
|
119 |
+ 2.22. hf_iterator_append(iname, htext) |
|
120 |
+ 2.23. hf_iterator_insert(iname, htext) |
|
121 |
+ 2.24. bl_iterator_start(iname) |
|
122 |
+ 2.25. bl_iterator_end(iname) |
|
123 |
+ 2.26. textopsx.f.bl_iterator_next(iname) |
|
124 |
+ 2.27. bl_iterator_rm(iname) |
|
125 |
+ 2.28. bl_iterator_append(iname, text) |
|
126 |
+ 2.29. bl_iterator_insert(iname, text) |
|
124 | 127 |
|
125 | 128 |
3. Selects |
126 | 129 |
|
... | ... |
@@ -141,33 +144,34 @@ Chapter 1. Admin Guide |
141 | 144 |
2. Functions |
142 | 145 |
|
143 | 146 |
2.1. msg_apply_changes() |
144 |
- 2.2. change_reply_status(code, reason) |
|
145 |
- 2.3. change_reply_status_code(vcode) |
|
146 |
- 2.4. remove_body() |
|
147 |
- 2.5. keep_hf([regexp]) |
|
148 |
- 2.6. fnmatch(value, expr [, flags]) |
|
149 |
- 2.7. append_hf_value(hf, hvalue) |
|
150 |
- 2.8. insert_hf_value(hf, hvalue) |
|
151 |
- 2.9. remove_hf_value(hf_par) |
|
152 |
- 2.10. remove_hf_value2(hf_par) |
|
153 |
- 2.11. assign_hf_value(hf, hvalue) |
|
154 |
- 2.12. assign_hf_value2(hf, hvalue) |
|
155 |
- 2.13. include_hf_value(hf, hvalue) |
|
156 |
- 2.14. exclude_hf_value(hf, hvalue) |
|
157 |
- 2.15. hf_value_exists(hf, hvalue) |
|
158 |
- 2.16. hf_iterator_start(iname) |
|
159 |
- 2.17. hf_iterator_end(iname) |
|
160 |
- 2.18. textopsx.f.hf_iterator_next(iname) |
|
161 |
- 2.19. textopsx.f.hf_iterator_prev(iname) |
|
162 |
- 2.20. hf_iterator_rm(iname) |
|
163 |
- 2.21. hf_iterator_append(iname, htext) |
|
164 |
- 2.22. hf_iterator_insert(iname, htext) |
|
165 |
- 2.23. bl_iterator_start(iname) |
|
166 |
- 2.24. bl_iterator_end(iname) |
|
167 |
- 2.25. textopsx.f.bl_iterator_next(iname) |
|
168 |
- 2.26. bl_iterator_rm(iname) |
|
169 |
- 2.27. bl_iterator_append(iname, text) |
|
170 |
- 2.28. bl_iterator_insert(iname, text) |
|
147 |
+ 2.2. msg_set_buffer(data) |
|
148 |
+ 2.3. change_reply_status(code, reason) |
|
149 |
+ 2.4. change_reply_status_code(vcode) |
|
150 |
+ 2.5. remove_body() |
|
151 |
+ 2.6. keep_hf([regexp]) |
|
152 |
+ 2.7. fnmatch(value, expr [, flags]) |
|
153 |
+ 2.8. append_hf_value(hf, hvalue) |
|
154 |
+ 2.9. insert_hf_value(hf, hvalue) |
|
155 |
+ 2.10. remove_hf_value(hf_par) |
|
156 |
+ 2.11. remove_hf_value2(hf_par) |
|
157 |
+ 2.12. assign_hf_value(hf, hvalue) |
|
158 |
+ 2.13. assign_hf_value2(hf, hvalue) |
|
159 |
+ 2.14. include_hf_value(hf, hvalue) |
|
160 |
+ 2.15. exclude_hf_value(hf, hvalue) |
|
161 |
+ 2.16. hf_value_exists(hf, hvalue) |
|
162 |
+ 2.17. hf_iterator_start(iname) |
|
163 |
+ 2.18. hf_iterator_end(iname) |
|
164 |
+ 2.19. textopsx.f.hf_iterator_next(iname) |
|
165 |
+ 2.20. textopsx.f.hf_iterator_prev(iname) |
|
166 |
+ 2.21. hf_iterator_rm(iname) |
|
167 |
+ 2.22. hf_iterator_append(iname, htext) |
|
168 |
+ 2.23. hf_iterator_insert(iname, htext) |
|
169 |
+ 2.24. bl_iterator_start(iname) |
|
170 |
+ 2.25. bl_iterator_end(iname) |
|
171 |
+ 2.26. textopsx.f.bl_iterator_next(iname) |
|
172 |
+ 2.27. bl_iterator_rm(iname) |
|
173 |
+ 2.28. bl_iterator_append(iname, text) |
|
174 |
+ 2.29. bl_iterator_insert(iname, text) |
|
171 | 175 |
|
172 | 176 |
2.1. msg_apply_changes() |
173 | 177 |
|
... | ... |
@@ -203,7 +207,25 @@ if(msg_apply_changes()) |
203 | 207 |
} |
204 | 208 |
... |
205 | 209 |
|
206 |
-2.2. change_reply_status(code, reason) |
|
210 |
+2.2. msg_set_buffer(data) |
|
211 |
+ |
|
212 |
+ Set the content of the SIP message buffer, replacing the exiting data. |
|
213 |
+ The parameter can contain variables, its value must be a valid SIP |
|
214 |
+ request or reply, a matter of what the old message is. |
|
215 |
+ |
|
216 |
+ This function can be used from REQUEST_ROUTE or core REPLY_ROUTE. |
|
217 |
+ |
|
218 |
+ Note: It must be used before the transaction is created in |
|
219 |
+ request_route and not inside the onreply_route[name] executed by tm |
|
220 |
+ module. Also, do not use after resuming a suspended request or reply, |
|
221 |
+ at that moment the transaction is already created. |
|
222 |
+ |
|
223 |
+ Example 1.2. msg_set_buffer() usage |
|
224 |
+... |
|
225 |
+msg_set_buffer("INVITE sip:..."); |
|
226 |
+... |
|
227 |
+ |
|
228 |
+2.3. change_reply_status(code, reason) |
|
207 | 229 |
|
208 | 230 |
Intercept a SIP reply (in an onreply_route) and change its status code |
209 | 231 |
and reason phrase prior to forwarding it. |
... | ... |
@@ -214,7 +236,7 @@ if(msg_apply_changes()) |
214 | 236 |
|
215 | 237 |
This function can be used from ONREPLY_ROUTE. |
216 | 238 |
|
217 |
- Example 1.2. change_reply_status usage |
|
239 |
+ Example 1.3. change_reply_status usage |
|
218 | 240 |
... |
219 | 241 |
reply_route { |
220 | 242 |
if (status == "603") { |
... | ... |
@@ -224,7 +246,7 @@ reply_route { |
224 | 246 |
} |
225 | 247 |
... |
226 | 248 |
|
227 |
-2.3. change_reply_status_code(vcode) |
|
249 |
+2.4. change_reply_status_code(vcode) |
|
228 | 250 |
|
229 | 251 |
Change the status code for a SIP reply . |
230 | 252 |
|
... | ... |
@@ -233,7 +255,7 @@ reply_route { |
233 | 255 |
|
234 | 256 |
This function can be used from ONREPLY_ROUTE. |
235 | 257 |
|
236 |
- Example 1.3. change_reply_status_code usage |
|
258 |
+ Example 1.4. change_reply_status_code usage |
|
237 | 259 |
... |
238 | 260 |
reply_route { |
239 | 261 |
if (status == "604") { |
... | ... |
@@ -243,18 +265,18 @@ reply_route { |
243 | 265 |
} |
244 | 266 |
... |
245 | 267 |
|
246 |
-2.4. remove_body() |
|
268 |
+2.5. remove_body() |
|
247 | 269 |
|
248 | 270 |
Use this function to remove the body of SIP requests or replies. |
249 | 271 |
|
250 | 272 |
This function can be used from ANY_ROUTE. |
251 | 273 |
|
252 |
- Example 1.4. remove_body() usage |
|
274 |
+ Example 1.5. remove_body() usage |
|
253 | 275 |
... |
254 | 276 |
remove_body(); |
255 | 277 |
... |
256 | 278 |
|
257 |
-2.5. keep_hf([regexp]) |
|
279 |
+2.6. keep_hf([regexp]) |
|
258 | 280 |
|
259 | 281 |
Remove headers that don't match the regular expression regexp. Several |
260 | 282 |
header are ignored always (thus not removed): Via, From, To, Call-ID, |
... | ... |
@@ -265,12 +287,12 @@ remove_body(); |
265 | 287 |
|
266 | 288 |
This function can be used from ANY_ROUTE. |
267 | 289 |
|
268 |
- Example 1.5. keep_hf() usage |
|
290 |
+ Example 1.6. keep_hf() usage |
|
269 | 291 |
... |
270 | 292 |
keep_hf("User-Agent"); |
271 | 293 |
... |
272 | 294 |
|
273 |
-2.6. fnmatch(value, expr [, flags]) |
|
295 |
+2.7. fnmatch(value, expr [, flags]) |
|
274 | 296 |
|
275 | 297 |
Match the value against the expr using shell-style pattern for file |
276 | 298 |
name matching (see man page for C function fnmatch()). It is known to |
... | ... |
@@ -281,7 +303,7 @@ keep_hf("User-Agent"); |
281 | 303 |
|
282 | 304 |
This function can be used from ANY_ROUTE. |
283 | 305 |
|
284 |
- Example 1.6. fnmatch() usage |
|
306 |
+ Example 1.7. fnmatch() usage |
|
285 | 307 |
... |
286 | 308 |
if(fnmatch("$rU", "123*")) |
287 | 309 |
{ |
... | ... |
@@ -289,7 +311,7 @@ if(fnmatch("$rU", "123*")) |
289 | 311 |
} |
290 | 312 |
... |
291 | 313 |
|
292 |
-2.7. append_hf_value(hf, hvalue) |
|
314 |
+2.8. append_hf_value(hf, hvalue) |
|
293 | 315 |
|
294 | 316 |
Append new header value after an existing header, if no index acquired |
295 | 317 |
append at the end of list. Note that a header may consist of comma |
... | ... |
@@ -301,7 +323,7 @@ if(fnmatch("$rU", "123*")) |
301 | 323 |
message. The index 1 correxponds to the first header. |
302 | 324 |
* hvalue - Value to be added, config var formatting supported. |
303 | 325 |
|
304 |
- Example 1.7. append_hf_value usage |
|
326 |
+ Example 1.8. append_hf_value usage |
|
305 | 327 |
... |
306 | 328 |
append_hf_value("foo", "gogo;stamp=$Ts") # add new header |
307 | 329 |
append_hf_value("foo[1]", "gogo") # add new value behind first value |
... | ... |
@@ -309,7 +331,7 @@ append_hf_value("foo[-1]", "$var(Bar)") # try add value to the last header, if n |
309 | 331 |
ot exists add new header |
310 | 332 |
... |
311 | 333 |
|
312 |
-2.8. insert_hf_value(hf, hvalue) |
|
334 |
+2.9. insert_hf_value(hf, hvalue) |
|
313 | 335 |
|
314 | 336 |
Insert new header value before an existing header, if no index acquired |
315 | 337 |
insert before first hf header. Note that a header may consist of comma |
... | ... |
@@ -322,14 +344,14 @@ ot exists add new header |
322 | 344 |
message. The index 1 correxponds to the first header. |
323 | 345 |
* hvalue - Value to be added, config var formatting supported. |
324 | 346 |
|
325 |
- Example 1.8. insert_hf_value usage |
|
347 |
+ Example 1.9. insert_hf_value usage |
|
326 | 348 |
... |
327 | 349 |
insert_hf_value("foo[2]", "gogo") |
328 | 350 |
insert_hf_value("foo", "$avp(foo)") # add new header at the top of list |
329 | 351 |
insert_hf_value("foo[1]", "gogo") # try add to the first header |
330 | 352 |
... |
331 | 353 |
|
332 |
-2.9. remove_hf_value(hf_par) |
|
354 |
+2.10. remove_hf_value(hf_par) |
|
333 | 355 |
|
334 | 356 |
Remove the header value from existing header, Note that a header may |
335 | 357 |
consist of comma delimited list of values. |
... | ... |
@@ -339,7 +361,7 @@ insert_hf_value("foo[1]", "gogo") # try add to the first header |
339 | 361 |
[. PARAM ] If asterisk is specified as index then all values are |
340 | 362 |
affected. The index 1 correxponds to the first header. |
341 | 363 |
|
342 |
- Example 1.9. remove_hf_value usage |
|
364 |
+ Example 1.10. remove_hf_value usage |
|
343 | 365 |
... |
344 | 366 |
remove_hf_value("foo") # remove foo[1] |
345 | 367 |
remove_hf_value("foo[*]") # remove all foo's headers |
... | ... |
@@ -348,7 +370,7 @@ remove_hf_value("foo.bar") # delete parameter |
348 | 370 |
remove_hf_value("foo[*].bar") # for each foo delete bar parameters |
349 | 371 |
... |
350 | 372 |
|
351 |
-2.10. remove_hf_value2(hf_par) |
|
373 |
+2.11. remove_hf_value2(hf_par) |
|
352 | 374 |
|
353 | 375 |
Remove specified header or parameter. It is expected header in |
354 | 376 |
Authorization format (comma delimiters are not treated as multi-value |
... | ... |
@@ -359,7 +381,7 @@ remove_hf_value("foo[*].bar") # for each foo delete bar parameters |
359 | 381 |
PARAM ] If asterisk is specified as index then all values are |
360 | 382 |
affected. The index 1 correxponds to the first header. |
361 | 383 |
|
362 |
- Example 1.10. remove_hf_value2 usage |
|
384 |
+ Example 1.11. remove_hf_value2 usage |
|
363 | 385 |
... |
364 | 386 |
remove_hf_value2("foo") # remove foo[1] |
365 | 387 |
remove_hf_value2("foo[*]") # remove all foo's headers, the same as remove_hf_he |
... | ... |
@@ -369,7 +391,7 @@ remove_hf_value2("foo.bar") # delete parameter |
369 | 391 |
remove_hf_value2("foo[*].bar") # for each foo delete bar parameters |
370 | 392 |
... |
371 | 393 |
|
372 |
-2.11. assign_hf_value(hf, hvalue) |
|
394 |
+2.12. assign_hf_value(hf, hvalue) |
|
373 | 395 |
|
374 | 396 |
Assign value to specified header value / param. |
375 | 397 |
|
... | ... |
@@ -380,7 +402,7 @@ remove_hf_value2("foo[*].bar") # for each foo delete bar parameters |
380 | 402 |
* hvalue - Value to be assigned, config var formatting supported. If |
381 | 403 |
value is empty then no equal sign appears in param. |
382 | 404 |
|
383 |
- Example 1.11. assign_hf_value usage |
|
405 |
+ Example 1.12. assign_hf_value usage |
|
384 | 406 |
... |
385 | 407 |
assign_hf_value("foo", "gogo") # foo[1] |
386 | 408 |
assign_hf_value("foo[-1]", "gogo") # foo[last_foo] |
... | ... |
@@ -391,7 +413,7 @@ assign_hf_value("foo[*]", "") # remove all foo's, empty value remains |
391 | 413 |
assign_hf_value("foo[*].bar", "") # set empty value (ex. lr) |
392 | 414 |
... |
393 | 415 |
|
394 |
-2.12. assign_hf_value2(hf, hvalue) |
|
416 |
+2.13. assign_hf_value2(hf, hvalue) |
|
395 | 417 |
|
396 | 418 |
Assign value to specified header. It is expected header in |
397 | 419 |
Authorization format (comma delimiters are not treated as multi-value |
... | ... |
@@ -404,14 +426,14 @@ assign_hf_value("foo[*].bar", "") # set empty value (ex. lr) |
404 | 426 |
* hvalue - Value to be assigned, config var formatting supported. If |
405 | 427 |
value is empty then no equal sign appears in param. |
406 | 428 |
|
407 |
- Example 1.12. assign_hf_value2 usage |
|
429 |
+ Example 1.13. assign_hf_value2 usage |
|
408 | 430 |
... |
409 | 431 |
assign_hf_value2("Authorization.integrity-protected", "\"yes\"") |
410 | 432 |
assign_hf_value2("foo[-1]", "gogo") # foo[last_foo] |
411 | 433 |
assign_hf_value2("foo[*].bar", "") # set empty value (ex. lr) |
412 | 434 |
... |
413 | 435 |
|
414 |
-2.13. include_hf_value(hf, hvalue) |
|
436 |
+2.14. include_hf_value(hf, hvalue) |
|
415 | 437 |
|
416 | 438 |
Add value in set if not exists, eg. "Supported: path,100rel". |
417 | 439 |
|
... | ... |
@@ -419,12 +441,12 @@ assign_hf_value2("foo[*].bar", "") # set empty value (ex. lr) |
419 | 441 |
* hf - Header field name to be affected. |
420 | 442 |
* hvalue - config var formatting supported. |
421 | 443 |
|
422 |
- Example 1.13. include_hf_value usage |
|
444 |
+ Example 1.14. include_hf_value usage |
|
423 | 445 |
... |
424 | 446 |
include_hf_value("Supported", "path"); |
425 | 447 |
... |
426 | 448 |
|
427 |
-2.14. exclude_hf_value(hf, hvalue) |
|
449 |
+2.15. exclude_hf_value(hf, hvalue) |
|
428 | 450 |
|
429 | 451 |
Remove value from set if exists, eg. "Supported: path,100rel". |
430 | 452 |
|
... | ... |
@@ -432,12 +454,12 @@ include_hf_value("Supported", "path"); |
432 | 454 |
* hf - Header field name to be affected. |
433 | 455 |
* hvalue - config formatting supported. |
434 | 456 |
|
435 |
- Example 1.14. exclude_hf_value usage |
|
457 |
+ Example 1.15. exclude_hf_value usage |
|
436 | 458 |
... |
437 | 459 |
exclude_hf_value("Supported", "100rel"); |
438 | 460 |
... |
439 | 461 |
|
440 |
-2.15. hf_value_exists(hf, hvalue) |
|
462 |
+2.16. hf_value_exists(hf, hvalue) |
|
441 | 463 |
|
442 | 464 |
Check if value exists in set. Alternate select |
443 | 465 |
@hf_value_exists.HF.VALUE may be used. It returns one or zero. |
... | ... |
@@ -447,7 +469,7 @@ exclude_hf_value("Supported", "100rel"); |
447 | 469 |
dashes. |
448 | 470 |
* hvalue - config var formatting supported. |
449 | 471 |
|
450 |
- Example 1.15. hf_value_exists usage |
|
472 |
+ Example 1.16. hf_value_exists usage |
|
451 | 473 |
... |
452 | 474 |
if (hf_value_exists("Supported", "100rel")) { |
453 | 475 |
|
... | ... |
@@ -458,7 +480,7 @@ if (@hf_value_exists.supported.path == "1") { |
458 | 480 |
} |
459 | 481 |
... |
460 | 482 |
|
461 |
-2.16. hf_iterator_start(iname) |
|
483 |
+2.17. hf_iterator_start(iname) |
|
462 | 484 |
|
463 | 485 |
Start an iterator for headers in the current SIP message. The parameter |
464 | 486 |
iname is used to identify the iterator. There can be up to 4 iterators |
... | ... |
@@ -468,12 +490,12 @@ if (@hf_value_exists.supported.path == "1") { |
468 | 490 |
|
469 | 491 |
This function can be used from ANY_ROUTE. |
470 | 492 |
|
471 |
- Example 1.16. hf_iterator_start usage |
|
493 |
+ Example 1.17. hf_iterator_start usage |
|
472 | 494 |
... |
473 | 495 |
hf_iterator_start("i1"); |
474 | 496 |
... |
475 | 497 |
|
476 |
-2.17. hf_iterator_end(iname) |
|
498 |
+2.18. hf_iterator_end(iname) |
|
477 | 499 |
|
478 | 500 |
Close the iterator identified by iname parameter. The iname value must |
479 | 501 |
be the same used for hf_iterator_start(). |
... | ... |
@@ -482,12 +504,12 @@ hf_iterator_start("i1"); |
482 | 504 |
|
483 | 505 |
This function can be used from ANY_ROUTE. |
484 | 506 |
|
485 |
- Example 1.17. hf_iterator_end usage |
|
507 |
+ Example 1.18. hf_iterator_end usage |
|
486 | 508 |
... |
487 | 509 |
hf_iterator_end("i1"); |
488 | 510 |
... |
489 | 511 |
|
490 |
-2.18. textopsx.f.hf_iterator_next(iname) |
|
512 |
+2.19. textopsx.f.hf_iterator_next(iname) |
|
491 | 513 |
|
492 | 514 |
Move the iterator to the next header. It must be called also after |
493 | 515 |
bl_iterator_start() to get the first header. |
... | ... |
@@ -501,7 +523,7 @@ hf_iterator_end("i1"); |
501 | 523 |
|
502 | 524 |
This function can be used from ANY_ROUTE. |
503 | 525 |
|
504 |
- Example 1.18. hf_iterator_next usage |
|
526 |
+ Example 1.19. hf_iterator_next usage |
|
505 | 527 |
... |
506 | 528 |
hf_iterator_start("i1"); |
507 | 529 |
while(hf_iterator_next("i1")) { |
... | ... |
@@ -510,7 +532,7 @@ hf_iterator_end("i1"); |
510 | 532 |
hf_iterator_end("i1"); |
511 | 533 |
... |
512 | 534 |
|
513 |
-2.19. textopsx.f.hf_iterator_prev(iname) |
|
535 |
+2.20. textopsx.f.hf_iterator_prev(iname) |
|
514 | 536 |
|
515 | 537 |
Move the iterator to the previous header. It must be called also after |
516 | 538 |
hf_iterator_start() and hf_iterator_next(). |
... | ... |
@@ -519,7 +541,7 @@ hf_iterator_end("i1"); |
519 | 541 |
|
520 | 542 |
This function can be used from ANY_ROUTE. |
521 | 543 |
|
522 |
- Example 1.19. hf_iterator_prev usage |
|
544 |
+ Example 1.20. hf_iterator_prev usage |
|
523 | 545 |
... |
524 | 546 |
hf_iterator_start("i1"); |
525 | 547 |
hf_iterator_next("i1"); |
... | ... |
@@ -531,7 +553,7 @@ hf_iterator_end("i1"); |
531 | 553 |
hf_iterator_end("i1"); |
532 | 554 |
... |
533 | 555 |
|
534 |
-2.20. hf_iterator_rm(iname) |
|
556 |
+2.21. hf_iterator_rm(iname) |
|
535 | 557 |
|
536 | 558 |
Remove the header at the current iterator position. |
537 | 559 |
|
... | ... |
@@ -539,7 +561,7 @@ hf_iterator_end("i1"); |
539 | 561 |
|
540 | 562 |
This function can be used from ANY_ROUTE. |
541 | 563 |
|
542 |
- Example 1.20. hf_iterator_rm usage |
|
564 |
+ Example 1.21. hf_iterator_rm usage |
|
543 | 565 |
... |
544 | 566 |
hf_iterator_start("i1"); |
545 | 567 |
while(hf_iterator_next("i1")) { |
... | ... |
@@ -550,7 +572,7 @@ hf_iterator_end("i1"); |
550 | 572 |
hf_iterator_end("i1"); |
551 | 573 |
... |
552 | 574 |
|
553 |
-2.21. hf_iterator_append(iname, htext) |
|
575 |
+2.22. hf_iterator_append(iname, htext) |
|
554 | 576 |
|
555 | 577 |
Add headers after the one at the current iterator possition. |
556 | 578 |
|
... | ... |
@@ -558,7 +580,7 @@ hf_iterator_end("i1"); |
558 | 580 |
|
559 | 581 |
This function can be used from ANY_ROUTE. |
560 | 582 |
|
561 |
- Example 1.21. hf_iterator_append usage |
|
583 |
+ Example 1.22. hf_iterator_append usage |
|
562 | 584 |
... |
563 | 585 |
hf_iterator_start("i1"); |
564 | 586 |
while(hf_iterator_next("i1")) { |
... | ... |
@@ -570,7 +592,7 @@ hf_iterator_end("i1"); |
570 | 592 |
hf_iterator_end("i1"); |
571 | 593 |
... |
572 | 594 |
|
573 |
-2.22. hf_iterator_insert(iname, htext) |
|
595 |
+2.23. hf_iterator_insert(iname, htext) |
|
574 | 596 |
|
575 | 597 |
Add headers before the one at the current iterator possition. |
576 | 598 |
|
... | ... |
@@ -578,7 +600,7 @@ hf_iterator_end("i1"); |
578 | 600 |
|
579 | 601 |
This function can be used from ANY_ROUTE. |
580 | 602 |
|
581 |
- Example 1.22. hf_iterator_insert usage |
|
603 |
+ Example 1.23. hf_iterator_insert usage |
|
582 | 604 |
... |
583 | 605 |
hf_iterator_start("i1"); |
584 | 606 |
while(hf_iterator_next("i1")) { |
... | ... |
@@ -590,7 +612,7 @@ hf_iterator_end("i1"); |
590 | 612 |
hf_iterator_end("i1"); |
591 | 613 |
... |
592 | 614 |
|
593 |
-2.23. bl_iterator_start(iname) |
|
615 |
+2.24. bl_iterator_start(iname) |
|
594 | 616 |
|
595 | 617 |
Start an iterator for lines in the body of the current SIP message. The |
596 | 618 |
parameter iname is used to identify the iterator. There can be up to 4 |
... | ... |
@@ -600,12 +622,12 @@ hf_iterator_end("i1"); |
600 | 622 |
|
601 | 623 |
This function can be used from ANY_ROUTE. |
602 | 624 |
|
603 |
- Example 1.23. bl_iterator_start usage |
|
625 |
+ Example 1.24. bl_iterator_start usage |
|
604 | 626 |
... |
605 | 627 |
bl_iterator_start("b1"); |
606 | 628 |
... |
607 | 629 |
|
608 |
-2.24. bl_iterator_end(iname) |
|
630 |
+2.25. bl_iterator_end(iname) |
|
609 | 631 |
|
610 | 632 |
Close the iterator identified by iname parameter. The iname value must |
611 | 633 |
be the same used for bl_iterator_start(). |
... | ... |
@@ -614,12 +636,12 @@ bl_iterator_start("b1"); |
614 | 636 |
|
615 | 637 |
This function can be used from ANY_ROUTE. |
616 | 638 |
|
617 |
- Example 1.24. bl_iterator_end usage |
|
639 |
+ Example 1.25. bl_iterator_end usage |
|
618 | 640 |
... |
619 | 641 |
bl_iterator_end("b1"); |
620 | 642 |
... |
621 | 643 |
|
622 |
-2.25. textopsx.f.bl_iterator_next(iname) |
|
644 |
+2.26. textopsx.f.bl_iterator_next(iname) |
|
623 | 645 |
|
624 | 646 |
Move the iterator to the next line in the body. It must be called also |
625 | 647 |
after bl_iterator_start() to get the first header. |
... | ... |
@@ -633,7 +655,7 @@ bl_iterator_end("b1"); |
633 | 655 |
|
634 | 656 |
This function can be used from ANY_ROUTE. |
635 | 657 |
|
636 |
- Example 1.25. bl_iterator_next usage |
|
658 |
+ Example 1.26. bl_iterator_next usage |
|
637 | 659 |
... |
638 | 660 |
bl_iterator_start("b1"); |
639 | 661 |
while(bl_iterator_next("b1")) { |
... | ... |
@@ -642,7 +664,7 @@ bl_iterator_end("b1"); |
642 | 664 |
bl_iterator_end("b1"); |
643 | 665 |
... |
644 | 666 |
|
645 |
-2.26. bl_iterator_rm(iname) |
|
667 |
+2.27. bl_iterator_rm(iname) |
|
646 | 668 |
|
647 | 669 |
Remove the body line at the current iterator position. |
648 | 670 |
|
... | ... |
@@ -650,7 +672,7 @@ bl_iterator_end("b1"); |
650 | 672 |
|
651 | 673 |
This function can be used from ANY_ROUTE. |
652 | 674 |
|
653 |
- Example 1.26. bl_iterator_rm usage |
|
675 |
+ Example 1.27. bl_iterator_rm usage |
|
654 | 676 |
... |
655 | 677 |
bl_iterator_start("b1"); |
656 | 678 |
while(bl_iterator_next("b1")) { |
... | ... |
@@ -661,7 +683,7 @@ bl_iterator_end("b1"); |
661 | 683 |
bl_iterator_end("b1"); |
662 | 684 |
... |
663 | 685 |
|
664 |
-2.27. bl_iterator_append(iname, text) |
|
686 |
+2.28. bl_iterator_append(iname, text) |
|
665 | 687 |
|
666 | 688 |
Add text after the line at the current iterator possition. |
667 | 689 |
|
... | ... |
@@ -669,7 +691,7 @@ bl_iterator_end("b1"); |
669 | 691 |
|
670 | 692 |
This function can be used from ANY_ROUTE. |
671 | 693 |
|
672 |
- Example 1.27. bl_iterator_append usage |
|
694 |
+ Example 1.28. bl_iterator_append usage |
|
673 | 695 |
... |
674 | 696 |
bl_iterator_start("b1"); |
675 | 697 |
while(bl_iterator_next("b1")) { |
... | ... |
@@ -681,7 +703,7 @@ bl_iterator_end("b1"); |
681 | 703 |
bl_iterator_end("b1"); |
682 | 704 |
... |
683 | 705 |
|
684 |
-2.28. bl_iterator_insert(iname, text) |
|
706 |
+2.29. bl_iterator_insert(iname, text) |
|
685 | 707 |
|
686 | 708 |
Add text before the line at the current iterator possition. |
687 | 709 |
|
... | ... |
@@ -689,7 +711,7 @@ bl_iterator_end("b1"); |
689 | 711 |
|
690 | 712 |
This function can be used from ANY_ROUTE. |
691 | 713 |
|
692 |
- Example 1.28. bl_iterator_insert usage |
|
714 |
+ Example 1.29. bl_iterator_insert usage |
|
693 | 715 |
... |
694 | 716 |
bl_iterator_start("b1"); |
695 | 717 |
while(bl_iterator_next("b1")) { |
... | ... |
@@ -736,7 +758,7 @@ bl_iterator_end("b1"); |
736 | 758 |
* IDX - Value index, negative value counts from bottom |
737 | 759 |
* PARAM_NAME - name of parameter |
738 | 760 |
|
739 |
- Example 1.29. @hf_value select usage |
|
761 |
+ Example 1.30. @hf_value select usage |
|
740 | 762 |
... |
741 | 763 |
$a = @hf_value.my_header[1].my_param; |
742 | 764 |
xplog("L_ERR", "$sel(@hf_value.via[-1]), $sel(@hf_value.from.tag)\n"); |