|
@@ -65,9 +65,14 @@ Chapter 1. Admin Guide
|
|
|
|
|
|
1. Overview
|
|
|
|
|
|
- The module implements all the operations regarding MaX-Forward header
|
|
|
- field, like adding it (if not present) or decrementing and checking the
|
|
|
- value of the existent one.
|
|
|
+ The module implements all of the operations that handle the Max-Forward
|
|
|
+ SIP header field, like adding it (if not present) or decrementing and
|
|
|
+ checking the value of the existent one.
|
|
|
+
|
|
|
+ The SIP Max-Forward header is used to prevent loops in a SIP network.
|
|
|
+ Every server that process and forward a SIP request lowers the
|
|
|
+ Max-Forward value with one. When the value reaches zero, the request is
|
|
|
+ not forwarded and an error response is sent to the UAC.
|
|
|
|
|
|
2. Dependencies
|
|
|
|
|
@@ -99,7 +104,7 @@ Chapter 1. Admin Guide
|
|
|
Note: This check is done when calling the maxfwd_process() function.
|
|
|
|
|
|
The range of values stretches from 1 to 256, which is the maximum
|
|
|
- MAX-FORWARDS value allowed by RFC 3261. Its value can be changed at
|
|
|
+ MAX-FORWARDS value allowed by RFC 3261. The value can be changed at
|
|
|
runtime.
|
|
|
|
|
|
Default value is "256".
|
|
@@ -118,14 +123,14 @@ modparam("maxfwd", "max_limit", 32)
|
|
|
4.5. maxfwd_at_least(max_value)
|
|
|
4.6. mf_lowlimit(max_value)
|
|
|
|
|
|
-4.1. maxfwd_process(max_value)
|
|
|
+4.1. maxfwd_process(max_value)
|
|
|
|
|
|
If no Max-Forward header is present in the received request, a header
|
|
|
will be added having the original value equal with "max_value". If a
|
|
|
Max-Forward header is already present, its value will be decremented
|
|
|
(if not 0). The parameter can be a variable.
|
|
|
|
|
|
- Retuning codes:
|
|
|
+ Return codes:
|
|
|
* 2 (true) - header was not found and a new header was succesfully
|
|
|
added.
|
|
|
* 1 (true) - header was found and its value was successfully
|
|
@@ -153,15 +158,15 @@ if (!maxfwd_process("10") && $retcode==-1) {
|
|
|
};
|
|
|
...
|
|
|
|
|
|
-4.2. mf_process_maxfwd_header(max_value)
|
|
|
+4.2. mf_process_maxfwd_header(max_value)
|
|
|
|
|
|
Same as maxfwd_process(max_value).
|
|
|
|
|
|
-4.3. process_maxfwd(max_value)
|
|
|
+4.3. process_maxfwd(max_value)
|
|
|
|
|
|
Same as maxfwd_process(max_value).
|
|
|
|
|
|
-4.4. is_maxfwd_lt(max_value)
|
|
|
+4.4. is_maxfwd_lt(max_value)
|
|
|
|
|
|
Checks if the Max-Forward header value is less then the "max_value"
|
|
|
parameter value. It considers also the value of the new inserted header
|
|
@@ -184,7 +189,7 @@ if (!maxfwd_process("10") && $retcode==-1) {
|
|
|
|
|
|
Example 1.3. is_maxfwd_lt usage
|
|
|
...
|
|
|
-# next hope is a gateway, so make no sens to
|
|
|
+# next hop is a gateway, so make no sense to
|
|
|
# forward if MF is 0 (after decrement)
|
|
|
if ( is_maxfwd_lt("1") ) {
|
|
|
sl_send_reply("483","Too Many Hops");
|
|
@@ -192,10 +197,10 @@ if ( is_maxfwd_lt("1") ) {
|
|
|
};
|
|
|
...
|
|
|
|
|
|
-4.5. maxfwd_at_least(max_value)
|
|
|
+4.5. maxfwd_at_least(max_value)
|
|
|
|
|
|
Same as is_maxfwd_lt(max_value).
|
|
|
|
|
|
-4.6. mf_lowlimit(max_value)
|
|
|
+4.6. mf_lowlimit(max_value)
|
|
|
|
|
|
Same as is_maxfwd_lt(max_value).
|