|
@@ -79,16 +79,17 @@ Ovidiu Sas
|
|
|
4.32. is_audio_on_hold()
|
|
|
4.33. is_privacy(privacy_type)
|
|
|
4.34. in_list(subject, list, separator)
|
|
|
- 4.35. cmp_str(str1, str2)
|
|
|
- 4.36. cmp_istr(str1, str2)
|
|
|
- 4.37. starts_with(str1, str2)
|
|
|
- 4.38. set_body_multipart([txt,content_type][,boundary])
|
|
|
- 4.39. append_body_part(txt,content_type[,
|
|
|
+ 4.35. in_list_prefix(subject, list, separator)
|
|
|
+ 4.36. cmp_str(str1, str2)
|
|
|
+ 4.37. cmp_istr(str1, str2)
|
|
|
+ 4.38. starts_with(str1, str2)
|
|
|
+ 4.39. set_body_multipart([txt,content_type][,boundary])
|
|
|
+ 4.40. append_body_part(txt,content_type[,
|
|
|
content_disposition])
|
|
|
|
|
|
- 4.40. get_body_part(content_type, opv)
|
|
|
- 4.41. get_body_part_raw(content_type, opv)
|
|
|
- 4.42. remove_body_part(content_type)
|
|
|
+ 4.41. get_body_part(content_type, opv)
|
|
|
+ 4.42. get_body_part_raw(content_type, opv)
|
|
|
+ 4.43. remove_body_part(content_type)
|
|
|
|
|
|
2. Developer Guide
|
|
|
|
|
@@ -132,14 +133,15 @@ Ovidiu Sas
|
|
|
1.32. is_audio_on_hold usage
|
|
|
1.33. is_privacy usage
|
|
|
1.34. in_list() usage
|
|
|
- 1.35. cmp_str usage
|
|
|
+ 1.35. in_list() usage
|
|
|
1.36. cmp_str usage
|
|
|
- 1.37. starts_with usage
|
|
|
- 1.38. set_body_multipart usage
|
|
|
- 1.39. append_body_part usage
|
|
|
- 1.40. get_body_part usage
|
|
|
- 1.41. get_body_part_raw usage
|
|
|
- 1.42. remove_body_part usage
|
|
|
+ 1.37. cmp_str usage
|
|
|
+ 1.38. starts_with usage
|
|
|
+ 1.39. set_body_multipart usage
|
|
|
+ 1.40. append_body_part usage
|
|
|
+ 1.41. get_body_part usage
|
|
|
+ 1.42. get_body_part_raw usage
|
|
|
+ 1.43. remove_body_part usage
|
|
|
|
|
|
Chapter 1. Admin Guide
|
|
|
|
|
@@ -188,14 +190,15 @@ Chapter 1. Admin Guide
|
|
|
4.32. is_audio_on_hold()
|
|
|
4.33. is_privacy(privacy_type)
|
|
|
4.34. in_list(subject, list, separator)
|
|
|
- 4.35. cmp_str(str1, str2)
|
|
|
- 4.36. cmp_istr(str1, str2)
|
|
|
- 4.37. starts_with(str1, str2)
|
|
|
- 4.38. set_body_multipart([txt,content_type][,boundary])
|
|
|
- 4.39. append_body_part(txt,content_type[, content_disposition])
|
|
|
- 4.40. get_body_part(content_type, opv)
|
|
|
- 4.41. get_body_part_raw(content_type, opv)
|
|
|
- 4.42. remove_body_part(content_type)
|
|
|
+ 4.35. in_list_prefix(subject, list, separator)
|
|
|
+ 4.36. cmp_str(str1, str2)
|
|
|
+ 4.37. cmp_istr(str1, str2)
|
|
|
+ 4.38. starts_with(str1, str2)
|
|
|
+ 4.39. set_body_multipart([txt,content_type][,boundary])
|
|
|
+ 4.40. append_body_part(txt,content_type[, content_disposition])
|
|
|
+ 4.41. get_body_part(content_type, opv)
|
|
|
+ 4.42. get_body_part_raw(content_type, opv)
|
|
|
+ 4.43. remove_body_part(content_type)
|
|
|
|
|
|
1. Overview
|
|
|
|
|
@@ -268,14 +271,15 @@ From: medabeda
|
|
|
4.32. is_audio_on_hold()
|
|
|
4.33. is_privacy(privacy_type)
|
|
|
4.34. in_list(subject, list, separator)
|
|
|
- 4.35. cmp_str(str1, str2)
|
|
|
- 4.36. cmp_istr(str1, str2)
|
|
|
- 4.37. starts_with(str1, str2)
|
|
|
- 4.38. set_body_multipart([txt,content_type][,boundary])
|
|
|
- 4.39. append_body_part(txt,content_type[, content_disposition])
|
|
|
- 4.40. get_body_part(content_type, opv)
|
|
|
- 4.41. get_body_part_raw(content_type, opv)
|
|
|
- 4.42. remove_body_part(content_type)
|
|
|
+ 4.35. in_list_prefix(subject, list, separator)
|
|
|
+ 4.36. cmp_str(str1, str2)
|
|
|
+ 4.37. cmp_istr(str1, str2)
|
|
|
+ 4.38. starts_with(str1, str2)
|
|
|
+ 4.39. set_body_multipart([txt,content_type][,boundary])
|
|
|
+ 4.40. append_body_part(txt,content_type[, content_disposition])
|
|
|
+ 4.41. get_body_part(content_type, opv)
|
|
|
+ 4.42. get_body_part_raw(content_type, opv)
|
|
|
+ 4.43. remove_body_part(content_type)
|
|
|
|
|
|
4.1. search(re)
|
|
|
|
|
@@ -965,12 +969,30 @@ if(is_privacy("id"))
|
|
|
...
|
|
|
$var(subject) = "fi";
|
|
|
$var(list) = "dk,fi,no,se";
|
|
|
-if (in_list("$var(subject)", "$var(list)", ",") {
|
|
|
+if (in_list("$var(subject)", "$var(list)", ",")) {
|
|
|
xlog("L_INFO", "subject is found in list\n");
|
|
|
}
|
|
|
...
|
|
|
|
|
|
-4.35. cmp_str(str1, str2)
|
|
|
+4.35. in_list_prefix(subject, list, separator)
|
|
|
+
|
|
|
+ Function checks if any element in list string is a prefix for subject
|
|
|
+ string where list items are separated by separator string. Subject and
|
|
|
+ list strings may contain pseudo variables. Separator string needs to be
|
|
|
+ one character long. Returns 1 if subject is found and -1 otherwise.
|
|
|
+
|
|
|
+ Function can be used from all kinds of routes.
|
|
|
+
|
|
|
+ Example 1.35. in_list() usage
|
|
|
+...
|
|
|
+$var(subject) = "final";
|
|
|
+$var(list) = "dk,fi,no,se";
|
|
|
+if (in_list_prefix("$var(subject)", "$var(list)", ",")) {
|
|
|
+ xlog("L_INFO", "prefix for subject is found in list\n");
|
|
|
+}
|
|
|
+...
|
|
|
+
|
|
|
+4.36. cmp_str(str1, str2)
|
|
|
|
|
|
The function returns true if the two parameters matches as string case
|
|
|
sensitive comparison.
|
|
@@ -978,7 +1000,7 @@ if (in_list("$var(subject)", "$var(list)", ",") {
|
|
|
This function can be used from REQUEST_ROUTE, ONREPLY_ROUTE,
|
|
|
FAILURE_ROUTE and BRANCH_ROUTE.
|
|
|
|
|
|
- Example 1.35. cmp_str usage
|
|
|
+ Example 1.36. cmp_str usage
|
|
|
...
|
|
|
if(cmp_str("$rU", "kamailio"))
|
|
|
{
|
|
@@ -986,7 +1008,7 @@ if(cmp_str("$rU", "kamailio"))
|
|
|
}
|
|
|
...
|
|
|
|
|
|
-4.36. cmp_istr(str1, str2)
|
|
|
+4.37. cmp_istr(str1, str2)
|
|
|
|
|
|
The function returns true if the two parameters matches as string case
|
|
|
insensitive comparison.
|
|
@@ -994,7 +1016,7 @@ if(cmp_str("$rU", "kamailio"))
|
|
|
This function can be used from REQUEST_ROUTE, ONREPLY_ROUTE,
|
|
|
FAILURE_ROUTE and BRANCH_ROUTE.
|
|
|
|
|
|
- Example 1.36. cmp_str usage
|
|
|
+ Example 1.37. cmp_str usage
|
|
|
...
|
|
|
if(cmp_istr("$rU@you", "kamailio@YOU"))
|
|
|
{
|
|
@@ -1002,7 +1024,7 @@ if(cmp_istr("$rU@you", "kamailio@YOU"))
|
|
|
}
|
|
|
...
|
|
|
|
|
|
-4.37. starts_with(str1, str2)
|
|
|
+4.38. starts_with(str1, str2)
|
|
|
|
|
|
The function returns true if the first string starts with the second
|
|
|
string.
|
|
@@ -1010,7 +1032,7 @@ if(cmp_istr("$rU@you", "kamailio@YOU"))
|
|
|
This function can be used from REQUEST_ROUTE, ONREPLY_ROUTE,
|
|
|
FAILURE_ROUTE and BRANCH_ROUTE.
|
|
|
|
|
|
- Example 1.37. starts_with usage
|
|
|
+ Example 1.38. starts_with usage
|
|
|
...
|
|
|
if (starts_with("$rU", "+358"))
|
|
|
{
|
|
@@ -1018,7 +1040,7 @@ if (starts_with("$rU", "+358"))
|
|
|
}
|
|
|
...
|
|
|
|
|
|
-4.38. set_body_multipart([txt,content_type][,boundary])
|
|
|
+4.39. 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.
|
|
@@ -1039,7 +1061,7 @@ if (starts_with("$rU", "+358"))
|
|
|
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.38. set_body_multipart usage
|
|
|
+ Example 1.39. set_body_multipart usage
|
|
|
...
|
|
|
set_body_multipart("test", "text/plain", "delimiter");
|
|
|
msg_apply_changes();
|
|
@@ -1061,7 +1083,7 @@ text
|
|
|
--delimiter
|
|
|
...
|
|
|
|
|
|
-4.39. append_body_part(txt,content_type[, content_disposition])
|
|
|
+4.40. append_body_part(txt,content_type[, content_disposition])
|
|
|
|
|
|
Append a part on multipart body SIP message. Will use
|
|
|
"unique-boundary-1" as boundary.
|
|
@@ -1079,7 +1101,7 @@ text
|
|
|
The core will take care of the last boundary ending "--". Detecting
|
|
|
wich one is the last and fixing the others if needed.
|
|
|
|
|
|
- Example 1.39. append_body_part usage
|
|
|
+ Example 1.40. 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
|
|
@@ -1097,7 +1119,7 @@ Content-Disposition: signal;handling=required
|
|
|
--unique-boundary-1
|
|
|
...
|
|
|
|
|
|
-4.40. get_body_part(content_type, opv)
|
|
|
+4.41. get_body_part(content_type, opv)
|
|
|
|
|
|
Return the content of a multipart body SIP message, storing it in opv.
|
|
|
|
|
@@ -1110,12 +1132,12 @@ Content-Disposition: signal;handling=required
|
|
|
This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
|
|
|
BRANCH_ROUTE, ONREPLY_ROUTE.
|
|
|
|
|
|
- Example 1.40. get_body_part usage
|
|
|
+ Example 1.41. get_body_part usage
|
|
|
...
|
|
|
get_body_part("application/vnd.cirpack.isdn-ext", "$var(pbody)");
|
|
|
...
|
|
|
|
|
|
-4.41. get_body_part_raw(content_type, opv)
|
|
|
+4.42. 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.
|
|
@@ -1129,12 +1151,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.41. get_body_part_raw usage
|
|
|
+ Example 1.42. get_body_part_raw usage
|
|
|
...
|
|
|
get_body_part("application/vnd.cirpack.isdn-ext", "$var(hbody)");
|
|
|
...
|
|
|
|
|
|
-4.42. remove_body_part(content_type)
|
|
|
+4.43. remove_body_part(content_type)
|
|
|
|
|
|
Remove a part on a multipart body SIP message.
|
|
|
|
|
@@ -1149,7 +1171,7 @@ get_body_part("application/vnd.cirpack.isdn-ext", "$var(hbody)");
|
|
|
The core will take care of the last boundary ending "--". Detecting
|
|
|
wich one is the last and fixing the others if needed.
|
|
|
|
|
|
- Example 1.42. remove_body_part usage
|
|
|
+ Example 1.43. remove_body_part usage
|
|
|
...
|
|
|
remove_body_part("application/vnd.cirpack.isdn-ext");
|
|
|
...
|