Browse code

modules: readme files regenerated - textops ... [skip ci]

Kamailio Dev authored on 08/02/2018 12:46:35
Showing 1 changed files
... ...
@@ -79,16 +79,17 @@ Ovidiu Sas
79 79
               4.32. is_audio_on_hold()
80 80
               4.33. is_privacy(privacy_type)
81 81
               4.34. in_list(subject, list, separator)
82
-              4.35. cmp_str(str1, str2)
83
-              4.36. cmp_istr(str1, str2)
84
-              4.37. starts_with(str1, str2)
85
-              4.38. set_body_multipart([txt,content_type][,boundary])
86
-              4.39. append_body_part(txt,content_type[,
82
+              4.35. in_list_prefix(subject, list, separator)
83
+              4.36. cmp_str(str1, str2)
84
+              4.37. cmp_istr(str1, str2)
85
+              4.38. starts_with(str1, str2)
86
+              4.39. set_body_multipart([txt,content_type][,boundary])
87
+              4.40. append_body_part(txt,content_type[,
87 88
                       content_disposition])
88 89
 
89
-              4.40. get_body_part(content_type, opv)
90
-              4.41. get_body_part_raw(content_type, opv)
91
-              4.42. remove_body_part(content_type)
90
+              4.41. get_body_part(content_type, opv)
91
+              4.42. get_body_part_raw(content_type, opv)
92
+              4.43. remove_body_part(content_type)
92 93
 
93 94
    2. Developer Guide
94 95
 
... ...
@@ -132,14 +133,15 @@ Ovidiu Sas
132 133
    1.32. is_audio_on_hold usage
133 134
    1.33. is_privacy usage
134 135
    1.34. in_list() usage
135
-   1.35. cmp_str usage
136
+   1.35. in_list() usage
136 137
    1.36. cmp_str usage
137
-   1.37. starts_with usage
138
-   1.38. set_body_multipart usage
139
-   1.39. append_body_part usage
140
-   1.40. get_body_part usage
141
-   1.41. get_body_part_raw usage
142
-   1.42. remove_body_part usage
138
+   1.37. cmp_str usage
139
+   1.38. starts_with usage
140
+   1.39. set_body_multipart usage
141
+   1.40. append_body_part usage
142
+   1.41. get_body_part usage
143
+   1.42. get_body_part_raw usage
144
+   1.43. remove_body_part usage
143 145
 
144 146
 Chapter 1. Admin Guide
145 147
 
... ...
@@ -188,14 +190,15 @@ Chapter 1. Admin Guide
188 190
         4.32. is_audio_on_hold()
189 191
         4.33. is_privacy(privacy_type)
190 192
         4.34. in_list(subject, list, separator)
191
-        4.35. cmp_str(str1, str2)
192
-        4.36. cmp_istr(str1, str2)
193
-        4.37. starts_with(str1, str2)
194
-        4.38. set_body_multipart([txt,content_type][,boundary])
195
-        4.39. append_body_part(txt,content_type[, content_disposition])
196
-        4.40. get_body_part(content_type, opv)
197
-        4.41. get_body_part_raw(content_type, opv)
198
-        4.42. remove_body_part(content_type)
193
+        4.35. in_list_prefix(subject, list, separator)
194
+        4.36. cmp_str(str1, str2)
195
+        4.37. cmp_istr(str1, str2)
196
+        4.38. starts_with(str1, str2)
197
+        4.39. set_body_multipart([txt,content_type][,boundary])
198
+        4.40. append_body_part(txt,content_type[, content_disposition])
199
+        4.41. get_body_part(content_type, opv)
200
+        4.42. get_body_part_raw(content_type, opv)
201
+        4.43. remove_body_part(content_type)
199 202
 
200 203
 1. Overview
201 204
 
... ...
@@ -268,14 +271,15 @@ From: medabeda
268 271
    4.32. is_audio_on_hold()
269 272
    4.33. is_privacy(privacy_type)
270 273
    4.34. in_list(subject, list, separator)
271
-   4.35. cmp_str(str1, str2)
272
-   4.36. cmp_istr(str1, str2)
273
-   4.37. starts_with(str1, str2)
274
-   4.38. set_body_multipart([txt,content_type][,boundary])
275
-   4.39. append_body_part(txt,content_type[, content_disposition])
276
-   4.40. get_body_part(content_type, opv)
277
-   4.41. get_body_part_raw(content_type, opv)
278
-   4.42. remove_body_part(content_type)
274
+   4.35. in_list_prefix(subject, list, separator)
275
+   4.36. cmp_str(str1, str2)
276
+   4.37. cmp_istr(str1, str2)
277
+   4.38. starts_with(str1, str2)
278
+   4.39. set_body_multipart([txt,content_type][,boundary])
279
+   4.40. append_body_part(txt,content_type[, content_disposition])
280
+   4.41. get_body_part(content_type, opv)
281
+   4.42. get_body_part_raw(content_type, opv)
282
+   4.43. remove_body_part(content_type)
279 283
 
280 284
 4.1.  search(re)
281 285
 
... ...
@@ -965,12 +969,30 @@ if(is_privacy("id"))
965 969
 ...
966 970
 $var(subject) = "fi";
967 971
 $var(list) = "dk,fi,no,se";
968
-if (in_list("$var(subject)", "$var(list)", ",") {
972
+if (in_list("$var(subject)", "$var(list)", ",")) {
969 973
     xlog("L_INFO", "subject is found in list\n");
970 974
 }
971 975
 ...
972 976
 
973
-4.35.  cmp_str(str1, str2)
977
+4.35.  in_list_prefix(subject, list, separator)
978
+
979
+   Function checks if any element in list string is a prefix for subject
980
+   string where list items are separated by separator string. Subject and
981
+   list strings may contain pseudo variables. Separator string needs to be
982
+   one character long. Returns 1 if subject is found and -1 otherwise.
983
+
984
+   Function can be used from all kinds of routes.
985
+
986
+   Example 1.35. in_list() usage
987
+...
988
+$var(subject) = "final";
989
+$var(list) = "dk,fi,no,se";
990
+if (in_list_prefix("$var(subject)", "$var(list)", ",")) {
991
+    xlog("L_INFO", "prefix for subject is found in list\n");
992
+}
993
+...
994
+
995
+4.36.  cmp_str(str1, str2)
974 996
 
975 997
    The function returns true if the two parameters matches as string case
976 998
    sensitive comparison.
... ...
@@ -978,7 +1000,7 @@ if (in_list("$var(subject)", "$var(list)", ",") {
978 1000
    This function can be used from REQUEST_ROUTE, ONREPLY_ROUTE,
979 1001
    FAILURE_ROUTE and BRANCH_ROUTE.
980 1002
 
981
-   Example 1.35. cmp_str usage
1003
+   Example 1.36. cmp_str usage
982 1004
 ...
983 1005
 if(cmp_str("$rU", "kamailio"))
984 1006
 {
... ...
@@ -986,7 +1008,7 @@ if(cmp_str("$rU", "kamailio"))
986 1008
 }
987 1009
 ...
988 1010
 
989
-4.36.  cmp_istr(str1, str2)
1011
+4.37.  cmp_istr(str1, str2)
990 1012
 
991 1013
    The function returns true if the two parameters matches as string case
992 1014
    insensitive comparison.
... ...
@@ -994,7 +1016,7 @@ if(cmp_str("$rU", "kamailio"))
994 1016
    This function can be used from REQUEST_ROUTE, ONREPLY_ROUTE,
995 1017
    FAILURE_ROUTE and BRANCH_ROUTE.
996 1018
 
997
-   Example 1.36. cmp_str usage
1019
+   Example 1.37. cmp_str usage
998 1020
 ...
999 1021
 if(cmp_istr("$rU@you", "kamailio@YOU"))
1000 1022
 {
... ...
@@ -1002,7 +1024,7 @@ if(cmp_istr("$rU@you", "kamailio@YOU"))
1002 1024
 }
1003 1025
 ...
1004 1026
 
1005
-4.37.  starts_with(str1, str2)
1027
+4.38.  starts_with(str1, str2)
1006 1028
 
1007 1029
    The function returns true if the first string starts with the second
1008 1030
    string.
... ...
@@ -1010,7 +1032,7 @@ if(cmp_istr("$rU@you", "kamailio@YOU"))
1010 1032
    This function can be used from REQUEST_ROUTE, ONREPLY_ROUTE,
1011 1033
    FAILURE_ROUTE and BRANCH_ROUTE.
1012 1034
 
1013
-   Example 1.37. starts_with usage
1035
+   Example 1.38. starts_with usage
1014 1036
 ...
1015 1037
 if (starts_with("$rU", "+358"))
1016 1038
 {
... ...
@@ -1018,7 +1040,7 @@ if (starts_with("$rU", "+358"))
1018 1040
 }
1019 1041
 ...
1020 1042
 
1021
-4.38.  set_body_multipart([txt,content_type][,boundary])
1043
+4.39.  set_body_multipart([txt,content_type][,boundary])
1022 1044
 
1023 1045
    Set multipart body to a SIP message. If called with no parameters, will
1024 1046
    convert present body to multipart.
... ...
@@ -1039,7 +1061,7 @@ if (starts_with("$rU", "+358"))
1039 1061
    Note: it may be required that msg_apply_changes() from textopsx module
1040 1062
    has to be executed if there are other operations over the new body.
1041 1063
 
1042
-   Example 1.38. set_body_multipart usage
1064
+   Example 1.39. set_body_multipart usage
1043 1065
 ...
1044 1066
 set_body_multipart("test", "text/plain", "delimiter");
1045 1067
 msg_apply_changes();
... ...
@@ -1061,7 +1083,7 @@ text
1061 1083
 --delimiter
1062 1084
 ...
1063 1085
 
1064
-4.39.  append_body_part(txt,content_type[, content_disposition])
1086
+4.40.  append_body_part(txt,content_type[, content_disposition])
1065 1087
 
1066 1088
    Append a part on multipart body SIP message. Will use
1067 1089
    "unique-boundary-1" as boundary.
... ...
@@ -1079,7 +1101,7 @@ text
1079 1101
    The core will take care of the last boundary ending "--". Detecting
1080 1102
    wich one is the last and fixing the others if needed.
1081 1103
 
1082
-   Example 1.39. append_body_part usage
1104
+   Example 1.40. append_body_part usage
1083 1105
 ...
1084 1106
 $var(b) = "7e Od 04 55 75 69 20 4d 61 6b 65 43 61 6c 6c"
1085 1107
 append_body_part("$var(b)", "application/vnd.cirpack.isdn-ext", "signal;handling
... ...
@@ -1097,7 +1119,7 @@ Content-Disposition: signal;handling=required
1097 1119
 --unique-boundary-1
1098 1120
 ...
1099 1121
 
1100
-4.40.  get_body_part(content_type, opv)
1122
+4.41.  get_body_part(content_type, opv)
1101 1123
 
1102 1124
    Return the content of a multipart body SIP message, storing it in opv.
1103 1125
 
... ...
@@ -1110,12 +1132,12 @@ Content-Disposition: signal;handling=required
1110 1132
    This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
1111 1133
    BRANCH_ROUTE, ONREPLY_ROUTE.
1112 1134
 
1113
-   Example 1.40. get_body_part usage
1135
+   Example 1.41. get_body_part usage
1114 1136
 ...
1115 1137
 get_body_part("application/vnd.cirpack.isdn-ext", "$var(pbody)");
1116 1138
 ...
1117 1139
 
1118
-4.41.  get_body_part_raw(content_type, opv)
1140
+4.42.  get_body_part_raw(content_type, opv)
1119 1141
 
1120 1142
    Return the content of a multipart body SIP message, including headers
1121 1143
    and boundary string, storing it in opv.
... ...
@@ -1129,12 +1151,12 @@ get_body_part("application/vnd.cirpack.isdn-ext", "$var(pbody)");
1129 1151
    This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
1130 1152
    BRANCH_ROUTE, ONREPLY_ROUTE.
1131 1153
 
1132
-   Example 1.41. get_body_part_raw usage
1154
+   Example 1.42. get_body_part_raw usage
1133 1155
 ...
1134 1156
 get_body_part("application/vnd.cirpack.isdn-ext", "$var(hbody)");
1135 1157
 ...
1136 1158
 
1137
-4.42.  remove_body_part(content_type)
1159
+4.43.  remove_body_part(content_type)
1138 1160
 
1139 1161
    Remove a part on a multipart body SIP message.
1140 1162
 
... ...
@@ -1149,7 +1171,7 @@ get_body_part("application/vnd.cirpack.isdn-ext", "$var(hbody)");
1149 1171
    The core will take care of the last boundary ending "--". Detecting
1150 1172
    wich one is the last and fixing the others if needed.
1151 1173
 
1152
-   Example 1.42. remove_body_part usage
1174
+   Example 1.43. remove_body_part usage
1153 1175
 ...
1154 1176
 remove_body_part("application/vnd.cirpack.isdn-ext");
1155 1177
 ...