Module: kamailio
Branch: master
Commit: a60734e552d2520fdd0253d5413c507c2e2974d7
URL:
https://github.com/kamailio/kamailio/commit/a60734e552d2520fdd0253d5413c507…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2018-07-10T10:03:14+02:00
textops: documentation for replace_str(...)
---
Modified: src/modules/textops/doc/textops_admin.xml
---
Diff:
https://github.com/kamailio/kamailio/commit/a60734e552d2520fdd0253d5413c507…
Patch:
https://github.com/kamailio/kamailio/commit/a60734e552d2520fdd0253d5413c507…
---
diff --git a/src/modules/textops/doc/textops_admin.xml
b/src/modules/textops/doc/textops_admin.xml
index 966169d2dd..3e62d7ac44 100644
--- a/src/modules/textops/doc/textops_admin.xml
+++ b/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>