From 815d21ca1569edcd9dfc5edf4f1e873fdada3b58 Mon Sep 17 00:00:00 2001 From: Kamailio Dev Date: Thu, 26 Jan 2023 15:01:15 +0100 Subject: [PATCH] modules: readme files regenerated - textops ... [skip ci] --- src/modules/textops/README | 106 ++++++++++++++++++++++--------------- 1 file changed, 62 insertions(+), 44 deletions(-) diff --git a/src/modules/textops/README b/src/modules/textops/README index 9bb0bf12eff..9c3399470f8 100644 --- a/src/modules/textops/README +++ b/src/modules/textops/README @@ -92,17 +92,18 @@ Ovidiu Sas 4.51. ends_with(str1, str2) 4.52. str_find(str1, str2) 4.53. str_ifind(str1, str2) - 4.54. set_body_multipart([txt, content_type][, boundary]) - 4.55. append_body_part(txt, content_type[, + 4.54. str_any_in(txt, clist) + 4.55. set_body_multipart([txt, content_type][, boundary]) + 4.56. append_body_part(txt, content_type[, content_disposition]) - 4.56. append_body_part_hex(txt, content_type[, + 4.57. append_body_part_hex(txt, content_type[, content_disposition]) - 4.57. get_body_part(content_type, opv) - 4.58. get_body_part_raw(content_type, opv) - 4.59. remove_body_part(content_type) - 4.60. regex_substring(itext, regexp, mindex, mcount, dpv) + 4.58. get_body_part(content_type, opv) + 4.59. get_body_part_raw(content_type, opv) + 4.60. remove_body_part(content_type) + 4.61. regex_substring(itext, regexp, mindex, mcount, dpv) 2. Developer Guide @@ -165,14 +166,15 @@ Ovidiu Sas 1.51. ends_with usage 1.52. str_find usage 1.53. str_ifind usage - 1.54. set_body_multipart usage - 1.55. append_body_part usage - 1.56. append_body_part with headers - 1.57. append_body_part_hex usage - 1.58. get_body_part usage - 1.59. get_body_part_raw usage - 1.60. remove_body_part usage - 1.61. _regex_substring usage + 1.54. str_any_in usage + 1.55. set_body_multipart usage + 1.56. append_body_part usage + 1.57. append_body_part with headers + 1.58. append_body_part_hex usage + 1.59. get_body_part usage + 1.60. get_body_part_raw usage + 1.61. remove_body_part usage + 1.62. _regex_substring usage Chapter 1. Admin Guide @@ -240,15 +242,16 @@ Chapter 1. Admin Guide 4.51. ends_with(str1, str2) 4.52. str_find(str1, str2) 4.53. str_ifind(str1, str2) - 4.54. set_body_multipart([txt, content_type][, boundary]) - 4.55. append_body_part(txt, content_type[, content_disposition]) - 4.56. append_body_part_hex(txt, content_type[, + 4.54. str_any_in(txt, clist) + 4.55. set_body_multipart([txt, content_type][, boundary]) + 4.56. append_body_part(txt, content_type[, content_disposition]) + 4.57. append_body_part_hex(txt, content_type[, content_disposition]) - 4.57. get_body_part(content_type, opv) - 4.58. get_body_part_raw(content_type, opv) - 4.59. remove_body_part(content_type) - 4.60. regex_substring(itext, regexp, mindex, mcount, dpv) + 4.58. get_body_part(content_type, opv) + 4.59. get_body_part_raw(content_type, opv) + 4.60. remove_body_part(content_type) + 4.61. regex_substring(itext, regexp, mindex, mcount, dpv) 1. Overview @@ -344,13 +347,14 @@ From: medabeda 4.51. ends_with(str1, str2) 4.52. str_find(str1, str2) 4.53. str_ifind(str1, str2) - 4.54. set_body_multipart([txt, content_type][, boundary]) - 4.55. append_body_part(txt, content_type[, content_disposition]) - 4.56. append_body_part_hex(txt, content_type[, content_disposition]) - 4.57. get_body_part(content_type, opv) - 4.58. get_body_part_raw(content_type, opv) - 4.59. remove_body_part(content_type) - 4.60. regex_substring(itext, regexp, mindex, mcount, dpv) + 4.54. str_any_in(txt, clist) + 4.55. set_body_multipart([txt, content_type][, boundary]) + 4.56. append_body_part(txt, content_type[, content_disposition]) + 4.57. append_body_part_hex(txt, content_type[, content_disposition]) + 4.58. get_body_part(content_type, opv) + 4.59. get_body_part_raw(content_type, opv) + 4.60. remove_body_part(content_type) + 4.61. regex_substring(itext, regexp, mindex, mcount, dpv) 4.1. search(re) @@ -1358,7 +1362,21 @@ if (str_ifind("$rU", "Alice")) { } ... -4.54. set_body_multipart([txt, content_type][, boundary]) +4.54. str_any_in(txt, clist) + + Return 1 (true) if any character in "clist" is found inside "txt". Both + paramters can contain variables. + + This function can be used from ANY_ROUTE. + + Example 1.54. str_any_in usage +... +if (str_any_in("$hdr(X-Hdr)", ";',:")) { + # do interesting stuff here +} +... + +4.55. set_body_multipart([txt, content_type][, boundary]) Set multipart body to a SIP message. If called with no parameters, will convert present body to multipart. @@ -1379,7 +1397,7 @@ if (str_ifind("$rU", "Alice")) { Note: it may be required that msg_apply_changes() from textopsx module has to be executed if there are other operations over the new body. - Example 1.54. set_body_multipart usage + Example 1.55. set_body_multipart usage ... set_body_multipart("test", "text/plain", "delimiter"); msg_apply_changes(); @@ -1402,7 +1420,7 @@ text --delimiter ... -4.55. append_body_part(txt, content_type[, content_disposition]) +4.56. append_body_part(txt, content_type[, content_disposition]) Append a part on multipart body SIP message. Will use "unique-boundary-1" as boundary. @@ -1423,7 +1441,7 @@ text Note: it may be required that msg_apply_changes() from textopsx module has to be executed if there are other operations over the new body. - Example 1.55. append_body_part usage + Example 1.56. append_body_part usage ... $var(b) = "7e Od 04 55 75 69 20 4d 61 6b 65 43 61 6c 6c"; append_body_part("$var(b)", "application/vnd.cirpack.isdn-ext", "signal;handling @@ -1446,7 +1464,7 @@ Content-Disposition: signal;handling=required appended after the value of the content-type parameter, separated by `\r\n` (at the very end do not add the '\r\n'). - Example 1.56. append_body_part with headers + Example 1.57. append_body_part with headers ... $var(b) = "7e Od 04 55 75 69 20 4d 61 6b 65 43 61 6c 6c"; append_body_part("$var(b)", "application/vnd.cirpack.isdn-ext\r\nX-Header: xyz", @@ -1466,7 +1484,7 @@ Content-Disposition: signal;handling=required --unique-boundary-1 ... -4.56. append_body_part_hex(txt, content_type[, content_disposition]) +4.57. append_body_part_hex(txt, content_type[, content_disposition]) Append a part on multipart body SIP message, with the content provided in hexa format. Will use "unique-boundary-1" as boundary. @@ -1490,7 +1508,7 @@ Content-Disposition: signal;handling=required Note: it may be required that msg_apply_changes() from textopsx module has to be executed if there are other operations over the new body. - Example 1.57. append_body_part_hex usage + Example 1.58. append_body_part_hex usage ... $var(b) = "6b 61 6d 61 69 6c 69 6f"; append_body_part_hex("$var(b)", "application/my-custom-ext"); @@ -1510,7 +1528,7 @@ kamailio If other headers should be added to a MIME body part, see the docs for append_body_part(...) function. -4.57. get_body_part(content_type, opv) +4.58. get_body_part(content_type, opv) Return the content of a multipart body SIP message, storing it in opv. @@ -1523,12 +1541,12 @@ kamailio This function can be used from REQUEST_ROUTE, FAILURE_ROUTE, BRANCH_ROUTE, ONREPLY_ROUTE. - Example 1.58. get_body_part usage + Example 1.59. get_body_part usage ... get_body_part("application/vnd.cirpack.isdn-ext", "$var(pbody)"); ... -4.58. get_body_part_raw(content_type, opv) +4.59. get_body_part_raw(content_type, opv) Return the content of a multipart body SIP message, including headers and boundary string, storing it in opv. @@ -1542,12 +1560,12 @@ get_body_part("application/vnd.cirpack.isdn-ext", "$var(pbody)"); This function can be used from REQUEST_ROUTE, FAILURE_ROUTE, BRANCH_ROUTE, ONREPLY_ROUTE. - Example 1.59. get_body_part_raw usage + Example 1.60. get_body_part_raw usage ... get_body_part("application/vnd.cirpack.isdn-ext", "$var(hbody)"); ... -4.59. remove_body_part(content_type) +4.60. remove_body_part(content_type) Remove a part on a multipart body SIP message. @@ -1565,13 +1583,13 @@ get_body_part("application/vnd.cirpack.isdn-ext", "$var(hbody)"); Note: it may be required that msg_apply_changes() from textopsx module has to be executed if there are other operations over the new body. - Example 1.60. remove_body_part usage + Example 1.61. remove_body_part usage ... remove_body_part("application/vnd.cirpack.isdn-ext"); msg_apply_changes(); ... -4.60. regex_substring(itext, regexp, mindex, mcount, dpv) +4.61. regex_substring(itext, regexp, mindex, mcount, dpv) Search in text with given regular expression then set dpv pseudo-variable with the matched token at provided index. @@ -1591,7 +1609,7 @@ msg_apply_changes(); Note that the regular expression extended is used. More info at: https://www.regular-expressions.info/posix.html. - Example 1.61. _regex_substring usage + Example 1.62. _regex_substring usage ... regex_substring("___ abc123def ___ ghi456 ___", "([a-z]*)([0-9]+)([a-z]* )",