Browse code

textops: docs for remove_hf_idx() function

Daniel-Constantin Mierla authored on 26/05/2021 13:43:50
Showing 1 changed files
... ...
@@ -1497,6 +1497,44 @@ if(remove_hf_exp_pv("^$var(match)", "^$var(keep)"))
1497 1497
 		</example>
1498 1498
 	</section>
1499 1499
 
1500
+	<section id="textops.f.remove_hf_idx">
1501
+		<title>
1502
+		<function moreinfo="none">remove_hf_idx(hname, idx)</function>
1503
+		</title>
1504
+		<para>
1505
+			Remove from message the headers matching by name 'hname' with
1506
+			the index 'idx'.
1507
+		</para>
1508
+		<para>
1509
+		Returns true if the header is removed.
1510
+		</para>
1511
+		<para>Meaning of the parameters is as follows:</para>
1512
+		<itemizedlist>
1513
+		<listitem>
1514
+			<para><emphasis>hname</emphasis> - header name.</para>
1515
+		</listitem>
1516
+		<listitem>
1517
+			<para><emphasis>idx</emphasis> - index of the header, starting
1518
+			from 0 with first header; negative values count from the end of
1519
+			the headers, -1 being the last header matching the name.</para>
1520
+		</listitem>
1521
+		</itemizedlist>
1522
+		<para>
1523
+			The parameters can be config variables.
1524
+		</para>
1525
+		<para>
1526
+		This function can be used from ANY_ROUTE.
1527
+		</para>
1528
+		<example>
1529
+		<title><function>remove_hf_idx</function> usage</title>
1530
+		<programlisting format="linespecific">
1531
+...
1532
+remove_hf_idx("X-My-Header", "-1");
1533
+...
1534
+</programlisting>
1535
+		</example>
1536
+	</section>
1537
+
1500 1538
 	<section id="textops.f.has_body">
1501 1539
 		<title>
1502 1540
 		<function moreinfo="none">has_body()</function>,