Răsfoiți Sursa

kamailio-kemi-framework: docs for KSR.hdr.match_content(...)

Daniel-Constantin Mierla 4 ani în urmă
părinte
comite
979513363b
1 a modificat fișierele cu 21 adăugiri și 0 ștergeri
  1. 21 0
      kamailio-kemi-framework/docs/core.md

+ 21 - 0
kamailio-kemi-framework/docs/core.md

@@ -1114,3 +1114,24 @@ Example:
 ```
 v = KSR.hdr.getw_idx("X-My-Hdr", 2);
 ```
+
+### KSR.hdr.match_content(...) ###
+
+`bool KSR.hdr.match_content(str "hname", str "op", str "mval", str "eidx")`
+
+Return `true` on matching the content of headers based on the expression from
+the parameters, otherwise `false`.
+
+The parameters are:
+  * `hname` - header name
+  * `op`- the matching operator, it can be: `eq` - equal; `ne` - not equal;
+  `sw` - starts with; `in` - includes;
+  * `mval` - matching value
+  * `eidx` - expression of the index, it can be: 'f' - first header only;
+  `l` - last header only; `a` - all headers; `o` - at least one header
+
+Example:
+
+```
+if(KSR.hdr.match_content("X-My-Hdr", "in", "test", "o")) { ... }
+```