|
@@ -97,6 +97,7 @@ Ovidiu Sas
|
|
4.46. get_body_part(content_type, opv)
|
|
4.46. get_body_part(content_type, opv)
|
|
4.47. get_body_part_raw(content_type, opv)
|
|
4.47. get_body_part_raw(content_type, opv)
|
|
4.48. remove_body_part(content_type)
|
|
4.48. remove_body_part(content_type)
|
|
|
|
+ 4.49. regex_substring(itext, regexp, mindex, mcount, dpv)
|
|
|
|
|
|
2. Developer Guide
|
|
2. Developer Guide
|
|
|
|
|
|
@@ -155,6 +156,7 @@ Ovidiu Sas
|
|
1.47. get_body_part usage
|
|
1.47. get_body_part usage
|
|
1.48. get_body_part_raw usage
|
|
1.48. get_body_part_raw usage
|
|
1.49. remove_body_part usage
|
|
1.49. remove_body_part usage
|
|
|
|
+ 1.50. _regex_substring usage
|
|
|
|
|
|
Chapter 1. Admin Guide
|
|
Chapter 1. Admin Guide
|
|
|
|
|
|
@@ -219,6 +221,7 @@ Chapter 1. Admin Guide
|
|
4.46. get_body_part(content_type, opv)
|
|
4.46. get_body_part(content_type, opv)
|
|
4.47. get_body_part_raw(content_type, opv)
|
|
4.47. get_body_part_raw(content_type, opv)
|
|
4.48. remove_body_part(content_type)
|
|
4.48. remove_body_part(content_type)
|
|
|
|
+ 4.49. regex_substring(itext, regexp, mindex, mcount, dpv)
|
|
|
|
|
|
1. Overview
|
|
1. Overview
|
|
|
|
|
|
@@ -305,6 +308,7 @@ From: medabeda
|
|
4.46. get_body_part(content_type, opv)
|
|
4.46. get_body_part(content_type, opv)
|
|
4.47. get_body_part_raw(content_type, opv)
|
|
4.47. get_body_part_raw(content_type, opv)
|
|
4.48. remove_body_part(content_type)
|
|
4.48. remove_body_part(content_type)
|
|
|
|
+ 4.49. regex_substring(itext, regexp, mindex, mcount, dpv)
|
|
|
|
|
|
4.1. search(re)
|
|
4.1. search(re)
|
|
|
|
|
|
@@ -1160,6 +1164,7 @@ if (starts_with("$rU", "+358"))
|
|
set_body_multipart("test", "text/plain", "delimiter");
|
|
set_body_multipart("test", "text/plain", "delimiter");
|
|
msg_apply_changes();
|
|
msg_apply_changes();
|
|
append_body_part(...);
|
|
append_body_part(...);
|
|
|
|
+msg_apply_changes();
|
|
|
|
|
|
...
|
|
...
|
|
|
|
|
|
@@ -1195,11 +1200,15 @@ text
|
|
The core will take care of the last boundary ending "--". Detecting
|
|
The core will take care of the last boundary ending "--". Detecting
|
|
wich one is the last and fixing the others if needed.
|
|
wich one is the last and fixing the others if needed.
|
|
|
|
|
|
|
|
+ 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.44. append_body_part usage
|
|
Example 1.44. append_body_part usage
|
|
...
|
|
...
|
|
$var(b) = "7e Od 04 55 75 69 20 4d 61 6b 65 43 61 6c 6c";
|
|
$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
|
|
append_body_part("$var(b)", "application/vnd.cirpack.isdn-ext", "signal;handling
|
|
=required");
|
|
=required");
|
|
|
|
+msg_apply_changes();
|
|
...
|
|
...
|
|
|
|
|
|
# Will append this to the body:
|
|
# Will append this to the body:
|
|
@@ -1221,6 +1230,7 @@ Content-Disposition: signal;handling=required
|
|
...
|
|
...
|
|
$var(b) = "";
|
|
$var(b) = "";
|
|
append_body_part("$var(b)", "application/xml\r\nX-Header: xyz");
|
|
append_body_part("$var(b)", "application/xml\r\nX-Header: xyz");
|
|
|
|
+msg_apply_changes();
|
|
...
|
|
...
|
|
|
|
|
|
# Will append this to the body:
|
|
# Will append this to the body:
|
|
@@ -1255,10 +1265,14 @@ Content-Disposition: signal;handling=required
|
|
The core will take care of the last boundary ending "--". Detecting
|
|
The core will take care of the last boundary ending "--". Detecting
|
|
wich one is the last and fixing the others if needed.
|
|
wich one is the last and fixing the others if needed.
|
|
|
|
|
|
|
|
+ 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.46. append_body_part_hex usage
|
|
Example 1.46. append_body_part_hex usage
|
|
...
|
|
...
|
|
$var(b) = "6b 61 6d 61 69 6c 69 6f";
|
|
$var(b) = "6b 61 6d 61 69 6c 69 6f";
|
|
append_body_part_hex("$var(b)", "application/my-custom-ext");
|
|
append_body_part_hex("$var(b)", "application/my-custom-ext");
|
|
|
|
+msg_apply_changes();
|
|
...
|
|
...
|
|
|
|
|
|
# Will append this to the body:
|
|
# Will append this to the body:
|
|
@@ -1326,11 +1340,47 @@ get_body_part("application/vnd.cirpack.isdn-ext", "$var(hbody)");
|
|
The core will take care of the last boundary ending "--". Detecting
|
|
The core will take care of the last boundary ending "--". Detecting
|
|
wich one is the last and fixing the others if needed.
|
|
wich one is the last and fixing the others if needed.
|
|
|
|
|
|
|
|
+ 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.49. remove_body_part usage
|
|
Example 1.49. remove_body_part usage
|
|
...
|
|
...
|
|
remove_body_part("application/vnd.cirpack.isdn-ext");
|
|
remove_body_part("application/vnd.cirpack.isdn-ext");
|
|
|
|
+msg_apply_changes();
|
|
...
|
|
...
|
|
|
|
|
|
|
|
+4.49. regex_substring(itext, regexp, mindex, mcount, dpv)
|
|
|
|
+
|
|
|
|
+ Search in text with given regular expression then sets dpv
|
|
|
|
+ pseudo-variable with the matched token at provided index.
|
|
|
|
+
|
|
|
|
+ Meaning of the parameters is as follows:
|
|
|
|
+ * itext - text to be searched (dynamic string)
|
|
|
|
+ * regexp - regular expression (dynamic string)
|
|
|
|
+ * mindex - index of the matched token (int or variable holding int)
|
|
|
|
+ * mcount - the number of maximum expected matches (int or variable
|
|
|
|
+ holding int)
|
|
|
|
+ * dpv - variable to be set with matched token (static string with a
|
|
|
|
+ name of a variable)
|
|
|
|
+
|
|
|
|
+ This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
|
|
|
|
+ BRANCH_ROUTE.
|
|
|
|
+
|
|
|
|
+ Note that the regular expression extended is used. More info at:
|
|
|
|
+ https://www.regular-expressions.info/posix.html.
|
|
|
|
+
|
|
|
|
+ Example 1.50. _regex_substring usage
|
|
|
|
+ ...
|
|
|
|
+ regex_substring("___ abc123def ___ ghi456 ___", "([a-z]*)([0-9]+)([a-z]*
|
|
|
|
+)",
|
|
|
|
+ 1, 3, "$var(asd)");
|
|
|
|
+ xlog("L_WARN","RESULT: $var(asd)\r\n");
|
|
|
|
+ ------
|
|
|
|
+ result:
|
|
|
|
+ abc
|
|
|
|
+ ----
|
|
|
|
+ ...
|
|
|
|
+
|
|
Chapter 2. Developer Guide
|
|
Chapter 2. Developer Guide
|
|
|
|
|
|
Table of Contents
|
|
Table of Contents
|