Browse code

mangler Update README with section IDs, minor changes

Olle E. Johansson authored on 17/12/2014 20:44:15
Showing 3 changed files
... ...
@@ -1,4 +1,3 @@
1
-
2 1
 The Mangler Module - SDP mangling
3 2
 
4 3
 Gabriel Vasile
... ...
@@ -6,7 +5,7 @@ Gabriel Vasile
6 6
    FhG FOKUS
7 7
 
8 8
    Copyright � 2003 FhG FOKUS
9
-     _________________________________________________________________
9
+     __________________________________________________________________
10 10
 
11 11
    Table of Contents
12 12
 
... ...
@@ -19,11 +18,11 @@ Gabriel Vasile
19 19
 
20 20
         3. Functions
21 21
 
22
-              3.1. sdp_mangle_ip(pattern, newip) 
23
-              3.2. sdp_mangle_port(offset) 
24
-              3.3. encode_contact(encoding_prefix) 
25
-              3.4. decode_contact() 
26
-              3.5. decode_contact_header() 
22
+              3.1. sdp_mangle_ip(pattern, newip)
23
+              3.2. sdp_mangle_port(offset)
24
+              3.3. encode_contact(encoding_prefix)
25
+              3.4. decode_contact()
26
+              3.5. decode_contact_header()
27 27
 
28 28
    List of Examples
29 29
 
... ...
@@ -45,11 +44,11 @@ Chapter 1. Admin Guide
45 45
 
46 46
    3. Functions
47 47
 
48
-        3.1. sdp_mangle_ip(pattern, newip) 
49
-        3.2. sdp_mangle_port(offset) 
50
-        3.3. encode_contact(encoding_prefix) 
51
-        3.4. decode_contact() 
52
-        3.5. decode_contact_header() 
48
+        3.1. sdp_mangle_ip(pattern, newip)
49
+        3.2. sdp_mangle_port(offset)
50
+        3.3. encode_contact(encoding_prefix)
51
+        3.4. decode_contact()
52
+        3.5. decode_contact_header()
53 53
 
54 54
 1. Overview
55 55
 
... ...
@@ -61,16 +60,16 @@ Chapter 1. Admin Guide
61 61
 
62 62
 2.1. contact_flds_separator (string)
63 63
 
64
-   First   char   of   this   parameter   is   used   as   separator  for
65
-   encoding/decoding  Contact  header.  If you set this parameter to "-",
66
-   then an encoded uri might look
67
-   sip:user-password-ip-port-protocol@PublicIP
64
+   First char of this parameter is used as a separator for
65
+   encoding/decoding Contact headers. If you set this parameter to "-",
66
+   then an encoded URI will look like
67
+   "sip:user-password-ip-port-protocol@PublicIP"
68 68
 
69 69
 Warning
70 70
 
71
-   First  char  of  this  field  must be set to a value which is not used
72
-   inside  username,password  or  other fields of contact.Otherwise it is
73
-   possible for the decoding step to fail/produce wrong results.
71
+   The first character of this field must be set to a value which is not
72
+   used inside username, password or other fields of contact.Otherwise it
73
+   is possible for the decoding step to fail/produce wrong results.
74 74
 
75 75
    Default value is "*".
76 76
 
... ...
@@ -81,27 +80,26 @@ modparam("mangler", "contact_flds_separator", "-")
81 81
 
82 82
 3. Functions
83 83
 
84
-   3.1. sdp_mangle_ip(pattern, newip) 
85
-   3.2. sdp_mangle_port(offset) 
86
-   3.3. encode_contact(encoding_prefix) 
87
-   3.4. decode_contact() 
88
-   3.5. decode_contact_header() 
84
+   3.1. sdp_mangle_ip(pattern, newip)
85
+   3.2. sdp_mangle_port(offset)
86
+   3.3. encode_contact(encoding_prefix)
87
+   3.4. decode_contact()
88
+   3.5. decode_contact_header()
89 89
 
90
-3.1.  sdp_mangle_ip(pattern, newip)
90
+3.1. sdp_mangle_ip(pattern, newip)
91 91
 
92
-   Changes   IP   addresses   inside  SDP  package  in  lines  describing
93
-   connections  like  c=IN IP4 . Currently this function only changes IP4
92
+   Changes IP addresses inside SDP document in lines describing
93
+   connections like c=IN IP4 . Currently this function only changes IP4
94 94
    addresses since IP6 probably will not need to traverse NAT :)
95 95
 
96 96
    The function returns negative on error, or number of replacements + 1.
97 97
 
98 98
    Meaning of the parameters is as follows:
99
-     * pattern - A ip address/mask pair used to match IP's located inside
100
-       SDP  package  in lines c=IN IP4 ip. This line will only be changed
101
-       if  located  IP  is  in  the  network  described  by this pattern.
102
-       Examples   of   valid   patterns   are   "10.0.0.0/255.0.0.0"   or
103
-       "10.0.0.0/8" etc.
104
-     * newip  -  A  string  representing  the new IP to be put inside SDP
99
+     * pattern - An IP address/mask pair used to match IP's located inside
100
+       SDP package in lines c=IN IP4 ip. This line will only be changed if
101
+       located IP is in the network described by this pattern. Examples of
102
+       valid patterns are "10.0.0.0/255.0.0.0" or "10.0.0.0/8" etc.
103
+     * newip - A string representing the new IP to be put inside SDP
105 104
        package if old IP address matches pattern.
106 105
 
107 106
    Example 1.2. sdp_mangle_ip usage
... ...
@@ -109,15 +107,15 @@ modparam("mangler", "contact_flds_separator", "-")
109 109
 sdp_mangle_ip("10.0.0.0/8","193.175.135.38");
110 110
 ...
111 111
 
112
-3.2.  sdp_mangle_port(offset)
112
+3.2. sdp_mangle_port(offset)
113 113
 
114
-   Changes  ports  inside  SDP  package  in  lines  describing media like
115
-   m=audio 13451.
114
+   Changes ports in SDP document in lines starting a media section like
115
+   "m=audio 13451".
116 116
 
117 117
    The function returns negative on error, or number of replacements + 1.
118 118
 
119 119
    Meaning of the parameters is as follows:
120
-     * offset   -   A  string  representing  an  integer  which  will  be
120
+     * offset - A string representing an integer which will be
121 121
        added/subtracted from the located port.
122 122
 
123 123
    Example 1.3. sdp_mangle_port usage
... ...
@@ -125,36 +123,35 @@ sdp_mangle_ip("10.0.0.0/8","193.175.135.38");
125 125
 sdp_mangle_port("-12000");
126 126
 ...
127 127
 
128
-3.3.  encode_contact(encoding_prefix)
128
+3.3. encode_contact(encoding_prefix)
129 129
 
130
-   This function will encode uri-s inside Contact header in the following
131
-   manner      sip:username:password@ip:port;transport=protocol      goes
132
-   sip:enc_pref*username*ip*port*protocol@public_ip.  "*"  (asterisk)  is
133
-   the default separator.
130
+   This function will encode URIs inside the "Contact" header in the
131
+   following manner "sip:username:password@ip:port;transport=protocol"
132
+   goes sip:enc_pref*username*ip*port*protocol@public_ip. "*" (asterisk)
133
+   is the default separator.
134 134
 
135 135
    The function returns negative on error, 1 on success.
136 136
 
137 137
    Meaning of the parameters is as follows:
138
-     * encoding_prefix  -  Something  to  allow  us  to  determine that a
139
-       contact  is  encoded  public  ip--a routable IP, most probably you
140
-       should put your external IP of your NAT box.
138
+     * encoding_prefix - Something to allow us to determine that a contact
139
+       is encoded public IP--a routable IP, most probably you should put
140
+       your external IP of your NAT box.
141 141
 
142 142
    Example 1.4. encode_contact usage
143 143
 ...
144 144
 if (src_ip == 10.0.0.0/8) encode_contact("enc_prefix","193.175.135.38");
145 145
 ...
146 146
 
147
-3.4.  decode_contact()
147
+3.4. decode_contact()
148 148
 
149
-   This  function will decode the URI in first line in packets which come
149
+   This function will decode the URI in first line in packets which come
150 150
    with encoded URI in the following manner
151
-   sip:enc_pref*username*ip*port*protocol*src_ip*src_port*src_proto@publi
152
-   c_ip;parameters is converted to
153
-   sip:username:password@ip:port;parameters  and will set destination URI
154
-   to sip:src_ip:src_port;transport=src_proto (so that the next forward()
155
-   or  t_relay()  will  send  the  message  back to src_ip:src_port using
156
-   src_proto).  It  uses  the  default set parameter for contact encoding
157
-   separator.
151
+   sip:enc_pref*username*ip*port*protocol*src_ip*src_port*src_proto@public
152
+   _ip;parameters is converted to sip:username:password@ip:port;parameters
153
+   and will set destination URI to sip:src_ip:src_port;transport=src_proto
154
+   (so that the next forward() or t_relay() will send the message back to
155
+   src_ip:src_port using src_proto). It uses the default set parameter for
156
+   contact encoding separator.
158 157
 
159 158
    The function returns negative on error, 1 on success.
160 159
 
... ...
@@ -163,12 +160,12 @@ if (src_ip == 10.0.0.0/8) encode_contact("enc_prefix","193.175.135.38");
163 163
 if (uri =~ "^enc*") { decode_contact(); }
164 164
 ...
165 165
 
166
-3.5.  decode_contact_header()
166
+3.5. decode_contact_header()
167 167
 
168
-   This  function  will  decode  URIs  inside  Contact header in the same
169
-   manner  as  decode_contact(). The difference is that no dst_uri is set
170
-   (src_ip,  src_port  and src_proto are ignored) and instead of changing
171
-   the  request  uri,  the  Contact  header  URI is modified. It uses the
168
+   This function will decode URIs inside the "Contact" header in the same
169
+   manner as decode_contact(). The difference is that no dst_uri is set
170
+   (src_ip, src_port and src_proto are ignored) and instead of changing
171
+   the request URI, the Contact header URI is modified. It uses the
172 172
    default set parameter for contact encoding separator.
173 173
 
174 174
    The function returns negative on error, 1 on success.
... ...
@@ -8,12 +8,12 @@
8 8
 
9 9
     <title>Functions</title>
10 10
 
11
-    <section id="sdp_mangle_ip">
11
+    <section id="mangler.f.sdp_mangle_ip">
12 12
 	<title>
13 13
 	    <function>sdp_mangle_ip(pattern, newip)</function>
14 14
 	</title>
15 15
 	<para>
16
-	    Changes IP addresses inside SDP package in lines describing
16
+	    Changes IP addresses inside SDP document in lines describing
17 17
 	    connections like c=IN IP4 . Currently this function only changes 
18 18
 	    IP4 addresses since IP6 probably will not need to traverse NAT :)
19 19
 	</para>
... ...
@@ -24,7 +24,7 @@
24 24
 	<itemizedlist>
25 25
 	    <listitem>
26 26
 		<para>
27
-		    <emphasis>pattern</emphasis> - A ip address/mask pair used to match
27
+		    <emphasis>pattern</emphasis> - An IP address/mask pair used to match
28 28
 		    IP's located inside SDP package in lines c=IN IP4 ip. This
29 29
 		    line will only be changed if located IP is in the network
30 30
 		    described by this pattern. Examples of valid patterns are
... ...
@@ -49,13 +49,13 @@ sdp_mangle_ip("10.0.0.0/8","193.175.135.38");
49 49
 	    </example>
50 50
     </section>
51 51
     
52
-    <section id="sdp_mangle_port">
52
+    <section id="mangler.f.sdp_mangle_port">
53 53
 	<title>
54 54
 	    <function>sdp_mangle_port(offset)</function>
55 55
 	</title>
56 56
 	<para>
57
-	    Changes ports inside SDP package in lines describing media like
58
-	    m=audio 13451.
57
+	    Changes ports in SDP document in lines starting a media section like
58
+	    "m=audio 13451".
59 59
 	</para>
60 60
 	<para>
61 61
 	    The function returns negative on error, or number of replacements + 1.
... ...
@@ -80,13 +80,13 @@ sdp_mangle_port("-12000");
80 80
 	</example>
81 81
     </section>
82 82
     
83
-    <section id="encode_contact">
83
+    <section id="mangler.f.encode_contact">
84 84
 	<title>
85 85
 	    <function>encode_contact(encoding_prefix)</function>
86 86
 	</title>
87 87
 	<para>
88
-	    This function will encode uri-s inside Contact header in the
89
-	    following manner sip:username:password@ip:port;transport=protocol
88
+	    This function will encode URIs inside the "Contact" header in the
89
+	    following manner "sip:username:password@ip:port;transport=protocol"
90 90
 	    goes <emphasis>sip:enc_pref*username*ip*port*protocol@public_ip</emphasis>.
91 91
 	    "*" (asterisk) is the default separator.
92 92
 	</para>
... ...
@@ -98,7 +98,7 @@ sdp_mangle_port("-12000");
98 98
 	    <listitem>
99 99
 		<para>
100 100
 		    <emphasis>encoding_prefix</emphasis> - Something to allow
101
-		    us to determine that a contact is encoded public ip--a
101
+		    us to determine that a contact is encoded public IP--a
102 102
 		    routable IP, most probably you should put your external IP
103 103
 		    of your NAT box.
104 104
 		</para>
... ...
@@ -114,7 +114,7 @@ if (src_ip == 10.0.0.0/8) encode_contact("enc_prefix","193.175.135.38");
114 114
 	</example>
115 115
     </section>
116 116
     
117
-    <section id="decode_contact">
117
+    <section id="mangler.f.decode_contact">
118 118
 	<title>
119 119
 	    <function>decode_contact()</function>
120 120
 	</title>
... ...
@@ -150,15 +150,15 @@ if (uri =~ "^enc*") { decode_contact(); }
150 150
 	</example>
151 151
     </section>
152 152
     
153
-    <section id="decode_contact_header">
153
+    <section id="mangler.f.decode_contact_header">
154 154
 	<title>
155 155
 	    <function>decode_contact_header()</function>
156 156
 	</title>
157 157
 	<para>
158
-	    This function will decode URIs inside Contact header in the
158
+	    This function will decode URIs inside the "Contact" header in the
159 159
 	    same manner as decode_contact(). The difference is that no dst_uri is set
160 160
 		 (src_ip, src_port and src_proto are ignored) and instead of changing
161
-		 the request uri, the Contact header URI is modified.
161
+		 the request URI, the Contact header URI is modified.
162 162
 		 It uses the default set parameter for contact encoding separator.
163 163
 	</para>
164 164
 	<para>
... ...
@@ -8,18 +8,18 @@
8 8
 
9 9
     <title>Parameters</title>
10 10
 
11
-    <section id="contact_flds_separator">
11
+    <section id="mangler.p.contact_flds_separator">
12 12
 	<title><varname>contact_flds_separator</varname> (string)</title>
13 13
 	<para>
14
-	    First char of this parameter is used as separator for
15
-	    encoding/decoding Contact header.
14
+	    First char of this parameter is used as a separator for
15
+	    encoding/decoding Contact headers.
16 16
 	    If you set this parameter to "-", 
17
-	    then an encoded uri might look sip:user-password-ip-port-protocol@PublicIP
17
+	    then an encoded URI will look like "sip:user-password-ip-port-protocol@PublicIP"
18 18
 	</para>
19 19
 	<warning>
20 20
 	    <para>
21
-		First char of this field must be set to a value which is not
22
-		used inside username,password or other fields of
21
+		The first character of this field must be set to a value which is not
22
+		used inside username, password or other fields of
23 23
 		contact.Otherwise it is possible for the decoding step to
24 24
 		fail/produce wrong results.
25 25
 	    </para>