Browse code

- docs updated - please review

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@1433 689a6050-402a-0410-94f2-e92a70836424

Klaus Darilion authored on 19/12/2006 16:33:01
Showing 2 changed files
... ...
@@ -26,6 +26,7 @@ Bogdan-Andrei Iancu
26 26
         1.1. Overview
27 27
 
28 28
               1.1.1. Per-Branch flags
29
+              1.1.2. Timer-Based Failover
29 30
 
30 31
         1.2. Dependencies
31 32
 
... ...
@@ -221,6 +222,34 @@ Chapter 1. User's Guide
221 222
    implemented.
222 223
      _________________________________________________________
223 224
 
225
+1.1.2. Timer-Based Failover
226
+
227
+   Timers can be used to trigger failover behavior. E.g. if we
228
+   send a call a gateway and the gateway does not send a
229
+   provisional response within 3 seconds, we want to cancel this
230
+   call and send the call to another gateway. Another example is
231
+   to ring a SIP client only for 30 seconds and then redirect the
232
+   call to the voicebox.
233
+
234
+   There are two timers in OpenSER :
235
+
236
+     * fr_timer - this timer is used when no response was
237
+       received yet. If there is no response after fr_timer
238
+       seconds the timer triggers (and failure route will be
239
+       executed if t_on_failure() was called). If a provisional
240
+       response was received, the timer is set to fr_inv_timer
241
+       for INVITE transactions, and RT_T2 for all other
242
+       transactions. If a final reponse is received, the
243
+       transaction has finished.
244
+     * fr_inv_timer - this timer is used when a provisional
245
+       reponse was received for an INVITE transaction.
246
+
247
+   For example: You want to have failover if there is no
248
+   provisional response after 3 seconds, but you want to ring for
249
+   60 seconds. Thuse, set the fr_timer to 3 and fr_inv_timer to
250
+   60.
251
+     _________________________________________________________
252
+
224 253
 1.2. Dependencies
225 254
 
226 255
 1.2.1. OpenSER Modules
... ...
@@ -256,7 +285,10 @@ modparam("tm", "fr_timer", 10)
256 285
 1.3.2. fr_inv_timer (integer)
257 286
 
258 287
    Timer which hits if no final reply for an INVITE arrives after
259
-   a provisional message was received (in seconds).
288
+   a provisional message was received (in seconds). This timer is
289
+   started after the first provisional response. Thus, fast
290
+   failover (no 100 trying from gateway) can be achieved by
291
+   setting fr_timer to low values. See example below
260 292
 
261 293
    Default value is 120 seconds. 
262 294
 
... ...
@@ -973,6 +1005,11 @@ branch_route[1] {
973 1005
        branch) of the branch for which is executed the
974 1006
        branch_route[]. If used outside of branch_route[] block,
975 1007
        the value is '0'.
1008
+     * $T_reply_code - the code of the reply, as follows: in
1009
+       request_route will be the last stateful sent reply; in
1010
+       reply_route will be the current processed reply; in
1011
+       failure_route will be the negative winning reply. In case
1012
+       of no-reply or error, '0' value is returned.
976 1013
      _________________________________________________________
977 1014
 
978 1015
 Chapter 2. Developer's Guide
... ...
@@ -118,6 +118,44 @@
118 118
 		this, NAT traversal per branch may be implemented.
119 119
 		</para>
120 120
 	</section>
121
+	<section id="timer-based-failover">
122
+		<title>Timer-Based Failover</title>
123
+		<para>
124
+		Timers can be used to trigger failover behavior. E.g. if we send a call
125
+		a gateway and the gateway does not send a provisional response within 3
126
+		seconds, we want to cancel this call and send the call to another gateway.
127
+		Another example is to ring a SIP client only for 30 seconds and then 
128
+		redirect the call to the voicebox.
129
+		</para>
130
+		<para>
131
+		There are two timers in &ser; :
132
+		</para>
133
+			<itemizedlist>
134
+			<listitem>
135
+			<para>
136
+				<emphasis>fr_timer</emphasis> - this timer is used when
137
+				no response was received yet. If there is no response after
138
+				<emphasis>fr_timer</emphasis> seconds the timer triggers
139
+				(and failure route will be executed if t_on_failure() was
140
+				called). If a provisional response was received, the timer
141
+				is set to fr_inv_timer for INVITE transactions, and RT_T2
142
+				for all other transactions. If a final reponse is received, 
143
+				the transaction has finished.
144
+			</para>
145
+			</listitem>
146
+			<listitem>
147
+			<para>
148
+				<emphasis>fr_inv_timer</emphasis> - this timer is used when 
149
+				a provisional reponse was received for an INVITE transaction.
150
+			</para>
151
+			</listitem>
152
+			</itemizedlist>
153
+		<para>
154
+		For example: You want to have failover if there is no provisional response 
155
+		after 3 seconds, but you want to ring for 60 seconds. Thuse, set the fr_timer 
156
+		to 3 and fr_inv_timer to 60.
157
+		</para>
158
+	</section>
121 159
 	</section>
122 160
 
123 161
 	<section>
... ...
@@ -178,7 +216,11 @@ modparam("tm", "fr_timer", 10)
178 216
 		<title><varname>fr_inv_timer</varname> (integer)</title>
179 217
 		<para>
180 218
 		Timer which hits if no final reply for an INVITE arrives after a 
181
-		provisional message was received (in seconds).
219
+		provisional message was received (in seconds). This timer is started
220
+                after the first provisional response. Thus, fast failover (no 100 
221
+		trying from gateway) can be achieved by setting fr_timer to low 
222
+		values. See example below
223
+
182 224
 		</para>
183 225
 		<para>
184 226
 		<emphasis>