[sr-dev] git:master: textopsx: documented keep_hf() function

Daniel-Constantin Mierla miconda at gmail.com
Fri Dec 16 22:34:40 CET 2011


Module: sip-router
Branch: master
Commit: d05746ee5bfb1dee1e7cd206bfa08765225358ce
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=d05746ee5bfb1dee1e7cd206bfa08765225358ce

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Fri Dec 16 22:30:08 2011 +0100

textopsx: documented keep_hf() function

---

 modules/textopsx/README            |   23 +++++++++++++++++++----
 modules/textopsx/doc/functions.xml |   27 +++++++++++++++++++++++++--
 2 files changed, 44 insertions(+), 6 deletions(-)

diff --git a/modules/textopsx/README b/modules/textopsx/README
index 6e28690..d4e51e8 100644
--- a/modules/textopsx/README
+++ b/modules/textopsx/README
@@ -9,7 +9,7 @@ Daniel-Constantin Mierla
    asipto.com
    <miconda at gmail.com>
 
-   Copyright © 2003 FhG FOKUS
+   Copyright © 2003 FhG FOKUS
      __________________________________________________________________
 
    1.1. Overview
@@ -18,6 +18,7 @@ Daniel-Constantin Mierla
         1.2.1. msg_apply_changes()
         1.2.2. change_reply_status(code, reason)
         1.2.3. remove_body()
+        1.2.4. keep_hf(regexp)
 
 1.1. Overview
 
@@ -27,7 +28,7 @@ Daniel-Constantin Mierla
 
 1.2. Functions
 
-1.2.1.  msg_apply_changes()
+1.2.1. msg_apply_changes()
 
    Use this function to apply changes performed on SIP request content. Be
    careful when using this function; due to special handling of changes
@@ -49,7 +50,7 @@ if(msg_apply_changes())
 }
 ...
 
-1.2.2.  change_reply_status(code, reason)
+1.2.2. change_reply_status(code, reason)
 
    Intercept a SIP reply (in an onreply_route) and change its status code
    and reason phrase prior to propogating it.
@@ -70,7 +71,7 @@ onreply_route {
 }
 ...
 
-1.2.3.  remove_body()
+1.2.3. remove_body()
 
    Use this function to remove body of SIP requests or replies.
 
@@ -80,3 +81,17 @@ onreply_route {
 ...
 remove_body();
 ...
+
+1.2.4. keep_hf(regexp)
+
+   Remove headers that don't match the regular expression regexp. Several
+   header are ignored always (thus not removed): Via, From, To, Call-ID,
+   CSeq, Content-Lenght, Content-Type, Max-Forwards, Contact, Route,
+   Record-Route -- these can be removed one by one with remove_hf().
+
+   This function can be used from ANY_ROUTE.
+
+   Example 4. keep_hf() usage
+...
+keep_hf("User-Agent");
+...
diff --git a/modules/textopsx/doc/functions.xml b/modules/textopsx/doc/functions.xml
index 0e837a1..eec3144 100644
--- a/modules/textopsx/doc/functions.xml
+++ b/modules/textopsx/doc/functions.xml
@@ -5,7 +5,7 @@
 <section id="textopsx.functions" xmlns:xi="http://www.w3.org/2001/XInclude">
     <title>Functions</title>
 
-	<section id="msg_apply_changes">
+	<section id="textopsx.msg_apply_changes">
 		<title>
 		<function moreinfo="none">msg_apply_changes()</function>
 		</title>
@@ -36,7 +36,7 @@ if(msg_apply_changes())
 		</example>
 	</section>
 
-    <section id="change_reply_status">
+    <section id="textopsx.change_reply_status">
 	<title>
 	    <function>change_reply_status(code, reason)</function>
 	</title>
@@ -93,5 +93,28 @@ remove_body();
 		</example>
 	</section>
 
+	<section id="textopsx.keep_hf">
+		<title>
+		<function moreinfo="none">keep_hf(regexp)</function>
+		</title>
+		<para>
+			Remove headers that don't match the regular expression regexp.
+			Several header are ignored always (thus not removed): Via, From,
+			To, Call-ID, CSeq, Content-Lenght, Content-Type, Max-Forwards,
+			Contact, Route, Record-Route -- these can be removed one by one
+			with remove_hf().
+		</para>
+		<para>
+		This function can be used from ANY_ROUTE.
+		</para>
+		<example>
+		<title><function>keep_hf()</function> usage</title>
+		<programlisting format="linespecific">
+...
+keep_hf("User-Agent");
+...
+</programlisting>
+		</example>
+	</section>
 
 </section>




More information about the sr-dev mailing list