[sr-dev] git:master:5c59e96a: textops: docs for remove_hf_match()

Daniel-Constantin Mierla miconda at gmail.com
Fri Mar 11 13:22:26 CET 2022


Module: kamailio
Branch: master
Commit: 5c59e96a7d0a04bff13bde8be688fae8c4d664d9
URL: https://github.com/kamailio/kamailio/commit/5c59e96a7d0a04bff13bde8be688fae8c4d664d9

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2022-03-11T13:20:48+01:00

textops: docs for remove_hf_match()

---

Modified: src/modules/textops/doc/textops_admin.xml

---

Diff:  https://github.com/kamailio/kamailio/commit/5c59e96a7d0a04bff13bde8be688fae8c4d664d9.diff
Patch: https://github.com/kamailio/kamailio/commit/5c59e96a7d0a04bff13bde8be688fae8c4d664d9.patch

---

diff --git a/src/modules/textops/doc/textops_admin.xml b/src/modules/textops/doc/textops_admin.xml
index 2a166f37a9..9805aac6aa 100644
--- a/src/modules/textops/doc/textops_admin.xml
+++ b/src/modules/textops/doc/textops_admin.xml
@@ -1541,6 +1541,50 @@ remove_hf_idx("X-My-Header", "-1");
 		</example>
 	</section>
 
+	<section id="textops.f.remove_hf_match">
+		<title>
+		<function moreinfo="none">remove_hf_match(hname, op, expr)</function>
+		</title>
+		<para>
+			Remove from message all headers with name 'hname' matching the body
+			with expression <quote>expr</quote>, based on operator
+			<quote>op</quote>.
+		</para>
+		<para>
+		Returns true if at least one header is found and removed.
+		</para>
+		<para>Meaning of the parameters is as follows:</para>
+		<itemizedlist>
+		<listitem>
+			<para><emphasis>hanem</emphasis> - name of the header.
+			</para>
+		</listitem>
+		<listitem>
+			<para><emphasis>op</emphasis> - operator - it can be: 'eq' - equal;
+			'ne' - not equal; 'in' - include; 're' - regular expression match.
+			</para>
+		</listitem>
+		<listitem>
+			<para><emphasis>expr</emphasis> - expression to match.
+			</para>
+		</listitem>
+		</itemizedlist>
+		<para>
+		This function can be used from ANY_ROUTE.
+		</para>
+		<example>
+		<title><function>remove_hf_match</function> usage</title>
+		<programlisting format="linespecific">
+...
+if(remove_hf_match("X-Info", "in", "^data")) {
+    # all headers with name "X-Info" that have the body matching regular
+    # expression "^data" are removed
+}
+...
+</programlisting>
+		</example>
+	</section>
+
 	<section id="textops.f.has_body">
 		<title>
 		<function moreinfo="none">has_body()</function>,




More information about the sr-dev mailing list