|
@@ -33,16 +33,17 @@ Daniel-Constantin Mierla
|
|
|
4.1. pos_append(idx, val)
|
|
|
4.2. pos_insert(idx, val)
|
|
|
4.3. pos_rm(idx, len)
|
|
|
- 4.4. pos_headers_start()
|
|
|
- 4.5. pos_headers_end()
|
|
|
- 4.6. pos_body_start()
|
|
|
- 4.7. pos_body_end()
|
|
|
- 4.8. pos_find_str(idx, val)
|
|
|
- 4.9. pos_findi_str(idx, val)
|
|
|
- 4.10. pos_rfind_str(idx, val)
|
|
|
- 4.11. pos_rfindi_str(idx, val)
|
|
|
- 4.12. pos_search(idx, re)
|
|
|
- 4.13. pos_rsearch(idx, re)
|
|
|
+ 4.4. pos_set_char(idx, val)
|
|
|
+ 4.5. pos_headers_start()
|
|
|
+ 4.6. pos_headers_end()
|
|
|
+ 4.7. pos_body_start()
|
|
|
+ 4.8. pos_body_end()
|
|
|
+ 4.9. pos_find_str(idx, val)
|
|
|
+ 4.10. pos_findi_str(idx, val)
|
|
|
+ 4.11. pos_rfind_str(idx, val)
|
|
|
+ 4.12. pos_rfindi_str(idx, val)
|
|
|
+ 4.13. pos_search(idx, re)
|
|
|
+ 4.14. pos_rsearch(idx, re)
|
|
|
|
|
|
5. Pseudo Variables
|
|
|
|
|
@@ -52,16 +53,17 @@ Daniel-Constantin Mierla
|
|
|
1.2. pos_append() usage
|
|
|
1.3. pos_insert() usage
|
|
|
1.4. pos_rm() usage
|
|
|
- 1.5. pos_headers_start() usage
|
|
|
- 1.6. pos_headers_end() usage
|
|
|
- 1.7. pos_body_start() usage
|
|
|
- 1.8. pos_body_end() usage
|
|
|
- 1.9. pos_find_str() usage
|
|
|
- 1.10. pos_findi_str() usage
|
|
|
- 1.11. pos_find_str() usage
|
|
|
- 1.12. pos_rfindi_str() usage
|
|
|
- 1.13. pos_search() usage
|
|
|
- 1.14. pos_rsearch() usage
|
|
|
+ 1.5. pos_set_char() usage
|
|
|
+ 1.6. pos_headers_start() usage
|
|
|
+ 1.7. pos_headers_end() usage
|
|
|
+ 1.8. pos_body_start() usage
|
|
|
+ 1.9. pos_body_end() usage
|
|
|
+ 1.10. pos_find_str() usage
|
|
|
+ 1.11. pos_findi_str() usage
|
|
|
+ 1.12. pos_find_str() usage
|
|
|
+ 1.13. pos_rfindi_str() usage
|
|
|
+ 1.14. pos_search() usage
|
|
|
+ 1.15. pos_rsearch() usage
|
|
|
|
|
|
Chapter 1. Admin Guide
|
|
|
|
|
@@ -82,16 +84,17 @@ Chapter 1. Admin Guide
|
|
|
4.1. pos_append(idx, val)
|
|
|
4.2. pos_insert(idx, val)
|
|
|
4.3. pos_rm(idx, len)
|
|
|
- 4.4. pos_headers_start()
|
|
|
- 4.5. pos_headers_end()
|
|
|
- 4.6. pos_body_start()
|
|
|
- 4.7. pos_body_end()
|
|
|
- 4.8. pos_find_str(idx, val)
|
|
|
- 4.9. pos_findi_str(idx, val)
|
|
|
- 4.10. pos_rfind_str(idx, val)
|
|
|
- 4.11. pos_rfindi_str(idx, val)
|
|
|
- 4.12. pos_search(idx, re)
|
|
|
- 4.13. pos_rsearch(idx, re)
|
|
|
+ 4.4. pos_set_char(idx, val)
|
|
|
+ 4.5. pos_headers_start()
|
|
|
+ 4.6. pos_headers_end()
|
|
|
+ 4.7. pos_body_start()
|
|
|
+ 4.8. pos_body_end()
|
|
|
+ 4.9. pos_find_str(idx, val)
|
|
|
+ 4.10. pos_findi_str(idx, val)
|
|
|
+ 4.11. pos_rfind_str(idx, val)
|
|
|
+ 4.12. pos_rfindi_str(idx, val)
|
|
|
+ 4.13. pos_search(idx, re)
|
|
|
+ 4.14. pos_rsearch(idx, re)
|
|
|
|
|
|
5. Pseudo Variables
|
|
|
|
|
@@ -142,16 +145,17 @@ modparam("posops", "idx0", -200)
|
|
|
4.1. pos_append(idx, val)
|
|
|
4.2. pos_insert(idx, val)
|
|
|
4.3. pos_rm(idx, len)
|
|
|
- 4.4. pos_headers_start()
|
|
|
- 4.5. pos_headers_end()
|
|
|
- 4.6. pos_body_start()
|
|
|
- 4.7. pos_body_end()
|
|
|
- 4.8. pos_find_str(idx, val)
|
|
|
- 4.9. pos_findi_str(idx, val)
|
|
|
- 4.10. pos_rfind_str(idx, val)
|
|
|
- 4.11. pos_rfindi_str(idx, val)
|
|
|
- 4.12. pos_search(idx, re)
|
|
|
- 4.13. pos_rsearch(idx, re)
|
|
|
+ 4.4. pos_set_char(idx, val)
|
|
|
+ 4.5. pos_headers_start()
|
|
|
+ 4.6. pos_headers_end()
|
|
|
+ 4.7. pos_body_start()
|
|
|
+ 4.8. pos_body_end()
|
|
|
+ 4.9. pos_find_str(idx, val)
|
|
|
+ 4.10. pos_findi_str(idx, val)
|
|
|
+ 4.11. pos_rfind_str(idx, val)
|
|
|
+ 4.12. pos_rfindi_str(idx, val)
|
|
|
+ 4.13. pos_search(idx, re)
|
|
|
+ 4.14. pos_rsearch(idx, re)
|
|
|
|
|
|
4.1. pos_append(idx, val)
|
|
|
|
|
@@ -206,51 +210,68 @@ pos_insert("100", "kamailio-$si");
|
|
|
pos_insert("100", "10");
|
|
|
...
|
|
|
|
|
|
-4.4. pos_headers_start()
|
|
|
+4.4. pos_set_char(idx, val)
|
|
|
+
|
|
|
+ Set the char at position index to first character in val.
|
|
|
+
|
|
|
+ The idx can be an integer value or a variable holding an integer. If
|
|
|
+ the value is negative, the position is counted from the end of the
|
|
|
+ buffer.
|
|
|
+
|
|
|
+ The val can be a static string or variables.
|
|
|
+
|
|
|
+ This function can be used from ANY_ROUTE.
|
|
|
+
|
|
|
+ Example 1.5. pos_set_char() usage
|
|
|
+...
|
|
|
+pos_set_char("100", "x");
|
|
|
+...
|
|
|
+
|
|
|
+4.5. pos_headers_start()
|
|
|
|
|
|
Return the position in the message buffer where headers start.
|
|
|
|
|
|
This function can be used from ANY_ROUTE.
|
|
|
|
|
|
- Example 1.5. pos_headers_start() usage
|
|
|
+ Example 1.6. pos_headers_start() usage
|
|
|
...
|
|
|
$var(pos) = pos_headers_start();
|
|
|
...
|
|
|
|
|
|
-4.5. pos_headers_end()
|
|
|
+4.6. pos_headers_end()
|
|
|
|
|
|
Return the position in the message buffer where headers end.
|
|
|
|
|
|
This function can be used from ANY_ROUTE.
|
|
|
|
|
|
- Example 1.6. pos_headers_end() usage
|
|
|
+ Example 1.7. pos_headers_end() usage
|
|
|
...
|
|
|
$var(pos) = pos_headers_end();
|
|
|
...
|
|
|
|
|
|
-4.6. pos_body_start()
|
|
|
+4.7. pos_body_start()
|
|
|
|
|
|
Return the position in the message buffer where body starts.
|
|
|
|
|
|
This function can be used from ANY_ROUTE.
|
|
|
|
|
|
- Example 1.7. pos_body_start() usage
|
|
|
+ Example 1.8. pos_body_start() usage
|
|
|
...
|
|
|
$var(pos) = pos_body_start();
|
|
|
...
|
|
|
|
|
|
-4.7. pos_body_end()
|
|
|
+4.8. pos_body_end()
|
|
|
|
|
|
Return the position in the message buffer where body ends.
|
|
|
|
|
|
This function can be used from ANY_ROUTE.
|
|
|
|
|
|
- Example 1.8. pos_body_end() usage
|
|
|
+ Example 1.9. pos_body_end() usage
|
|
|
...
|
|
|
$var(pos) = pos_body_end();
|
|
|
...
|
|
|
|
|
|
-4.8. pos_find_str(idx, val)
|
|
|
+4.9. pos_find_str(idx, val)
|
|
|
|
|
|
Return the position of the val in message buffer starting at idx. In
|
|
|
case of not finding it or error, the return code is negative. If val is
|
|
@@ -264,12 +285,12 @@ $var(pos) = pos_body_end();
|
|
|
|
|
|
This function can be used from ANY_ROUTE.
|
|
|
|
|
|
- Example 1.9. pos_find_str() usage
|
|
|
+ Example 1.10. pos_find_str() usage
|
|
|
...
|
|
|
$var(idx) = pos_find_str("100", "kamailio");
|
|
|
...
|
|
|
|
|
|
-4.9. pos_findi_str(idx, val)
|
|
|
+4.10. pos_findi_str(idx, val)
|
|
|
|
|
|
Return the position of the val (matching case insensitive) in message
|
|
|
buffer starting at idx. In case of not finding it or error, the return
|
|
@@ -284,12 +305,12 @@ $var(idx) = pos_find_str("100", "kamailio");
|
|
|
|
|
|
This function can be used from ANY_ROUTE.
|
|
|
|
|
|
- Example 1.10. pos_findi_str() usage
|
|
|
+ Example 1.11. pos_findi_str() usage
|
|
|
...
|
|
|
$var(idx) = pos_findi_str("100", "kamailio");
|
|
|
...
|
|
|
|
|
|
-4.10. pos_rfind_str(idx, val)
|
|
|
+4.11. pos_rfind_str(idx, val)
|
|
|
|
|
|
Return the last position of the val in message buffer starting at idx
|
|
|
(reverse search). In case of not finding it or error, the return code
|
|
@@ -304,12 +325,12 @@ $var(idx) = pos_findi_str("100", "kamailio");
|
|
|
|
|
|
This function can be used from ANY_ROUTE.
|
|
|
|
|
|
- Example 1.11. pos_find_str() usage
|
|
|
+ Example 1.12. pos_find_str() usage
|
|
|
...
|
|
|
$var(idx) = pos_rfind_str("100", "kamailio");
|
|
|
...
|
|
|
|
|
|
-4.11. pos_rfindi_str(idx, val)
|
|
|
+4.12. pos_rfindi_str(idx, val)
|
|
|
|
|
|
Return the last position of the val (matching case insensitive) in
|
|
|
message buffer starting at idx (reverse search). In case of not finding
|
|
@@ -324,12 +345,12 @@ $var(idx) = pos_rfind_str("100", "kamailio");
|
|
|
|
|
|
This function can be used from ANY_ROUTE.
|
|
|
|
|
|
- Example 1.12. pos_rfindi_str() usage
|
|
|
+ Example 1.13. pos_rfindi_str() usage
|
|
|
...
|
|
|
$var(idx) = pos_rfindi_str("100", "kamailio");
|
|
|
...
|
|
|
|
|
|
-4.12. pos_search(idx, re)
|
|
|
+4.13. pos_search(idx, re)
|
|
|
|
|
|
Return the position that starts matching the regular expression re in
|
|
|
message buffer starting at idx. In case of not finding it or error, the
|
|
@@ -344,12 +365,12 @@ $var(idx) = pos_rfindi_str("100", "kamailio");
|
|
|
|
|
|
This function can be used from ANY_ROUTE.
|
|
|
|
|
|
- Example 1.13. pos_search() usage
|
|
|
+ Example 1.14. pos_search() usage
|
|
|
...
|
|
|
$var(idx) = pos_search("100", "[0-9]+");
|
|
|
...
|
|
|
|
|
|
-4.13. pos_rsearch(idx, re)
|
|
|
+4.14. pos_rsearch(idx, re)
|
|
|
|
|
|
Return the position of last match that starts matching the regular
|
|
|
expression re in message buffer starting at idx. In case of not finding
|
|
@@ -364,7 +385,7 @@ $var(idx) = pos_search("100", "[0-9]+");
|
|
|
|
|
|
This function can be used from ANY_ROUTE.
|
|
|
|
|
|
- Example 1.14. pos_rsearch() usage
|
|
|
+ Example 1.15. pos_rsearch() usage
|
|
|
...
|
|
|
$var(idx) = pos_rsearch("100", "[0-9]+");
|
|
|
...
|