Ver código fonte

textopsx: documented keep_hf() function

Daniel-Constantin Mierla 13 anos atrás
pai
commit
d05746ee5b
2 arquivos alterados com 44 adições e 6 exclusões
  1. 19 4
      modules/textopsx/README
  2. 25 2
      modules/textopsx/doc/functions.xml

+ 19 - 4
modules/textopsx/README

@@ -9,7 +9,7 @@ Daniel-Constantin Mierla
    asipto.com
    <[email protected]>
 
-   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");
+...

+ 25 - 2
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>