Browse code

New texops function added: remove_hf_re("regexp") to filter message headers out by matching the header name field against a regular expression.

Closes SER-340.

Bogdan Pintea authored on 23/04/2008 21:20:43
Showing 3 changed files
... ...
@@ -8,6 +8,10 @@ $Id$
8 8
 2.1.0 changes
9 9
 
10 10
 modules:
11
+ - textops   - functions:
12
+                        - remove_hf_re("regexp") -- filter message headers out
13
+                          by matching the header name field against a regular
14
+                          expression.
11 15
  - avp       - export new selects table to allow dissecting the content of an
12 16
                attribute by interpreting it as a "name-addr" value 
13 17
  - auth      - added extra authentication checks support, to protect
... ...
@@ -1088,3 +1088,21 @@ int get_int_fparam(int* dst, struct sip_msg* msg, fparam_t* param)
1088 1088
 
1089 1089
     return 0;
1090 1090
 }
1091
+
1092
+/**
1093
+ * Retrieve the compiled RegExp.
1094
+ * @return: 0 for success, negative on error.
1095
+ */
1096
+int get_regex_fparam(regex_t *dst, struct sip_msg* msg, fparam_t* param)
1097
+{
1098
+	switch (param->type) {
1099
+		case FPARAM_REGEX:
1100
+			*dst = *param->v.regex;
1101
+			return 0;
1102
+
1103
+		default:
1104
+			ERR("unexpected parameter type (%d), instead of regexp.\n", 
1105
+					param->type);
1106
+	}
1107
+	return -1;
1108
+}
... ...
@@ -323,4 +323,10 @@ int get_str_fparam(str* dst, struct sip_msg* msg, fparam_t* param);
323 323
  */
324 324
 int get_int_fparam(int* dst, struct sip_msg* msg, fparam_t* param);
325 325
 
326
+
327
+/**
328
+ * Retrieve the compiled RegExp.
329
+ * @return: 0 for success, negative on error.
330
+ */
331
+int get_regex_fparam(regex_t *dst, struct sip_msg* msg, fparam_t* param);
326 332
 #endif /* sr_module_h */