浏览代码

textops: documentation for replace_str(...)

Daniel-Constantin Mierla 7 年之前
父节点
当前提交
a60734e552
共有 1 个文件被更改,包括 39 次插入1 次删除
  1. 39 1
      src/modules/textops/doc/textops_admin.xml

+ 39 - 1
src/modules/textops/doc/textops_admin.xml

@@ -395,7 +395,45 @@ replace_body_all("openser", "&kamailio; SIP Proxy");
 ...
 # strip the whole body from the message:
 if(has_body() && replace_body_atonce("^.+$", ""))
-        remove_hf("Content-Type"); 
+        remove_hf("Content-Type");
+...
+</programlisting>
+		</example>
+	</section>
+
+	<section id="textops.f.replace_str">
+		<title>
+		<function moreinfo="none">replace_str(match, repl, mode)</function>
+		</title>
+		<para>
+		Replaces the first or all occurrence of 'match' with 'repl' by doing
+		string comparison for matching. It is applied over headers and message
+		body (not over the first line).
+		</para>
+		<para>Meaning of the parameters is as follows:</para>
+		<itemizedlist>
+		<listitem>
+			<para><emphasis>match</emphasis> - string to be matched.
+			</para>
+		</listitem>
+		<listitem>
+			<para><emphasis>repl</emphasis> - string to be used as replacement.
+			</para>
+		</listitem>
+		<listitem>
+			<para><emphasis>mode</emphasis> - 'f' - replace only first match;
+				'a' - replace all matches.
+			</para>
+		</listitem>
+		</itemizedlist>
+		<para>
+		This function can be used from ANY_ROUTE.
+		</para>
+		<example>
+		<title><function>replace_str</function> usage</title>
+		<programlisting format="linespecific">
+...
+replace_str("&kamailio;", "&kamailio; SIP Proxy", "a");
 ...
 </programlisting>
 		</example>