sanityStandard This module aims to implement several sanity checks on incoming requests which are suggested or even required by a RFC, but are not available yet in the core of SERi. This checks are not required by SER itself for its functionality. But on the other side it makes not much sence if a broken request traverses through a SIP network if it is rejected sooner or later by a SIP device any way. As every sanity cost extra performance because of additional parsing and evaluation it is now with this module up to the SER adminstrator which checks should be done on which request. Nils Ohlmeier Copyright © 2006 iptelorg GmbH
This module aims to implement several sanity checks on incoming requests which are suggested or even required by a RFC, but are not available yet in the core of SERi. This checks are not required by SER itself for its functionality. But on the other side it makes not much sence if a broken request traverses through a SIP network if it is rejected sooner or later by a SIP device any way. As every sanity cost extra performance because of additional parsing and evaluation it is now with this module up to the SER adminstrator which checks should be done on which request. The following checks are available:
This parameter determines which of the checks from the sanity module are executed if no parameter was given to the sanity_check function call. By default all implemented checks are included in the execution of the sanity_check function. The integer value is the sum of the check numbers which should be executed by default. Default value is 999. This resolves to the following list of checks: ruri_sip_version (1), ruri_scheme (2), required_headers (4), cseq_method (32), cseq_value (64), cotent_length (128), expires_value (256), proxy_require (512). This parameter determines which URIs are going to be checked if the 'parse uri' will be executed. Default value is 7. This resolves to the following list of parsed URIs: Request RUI (1), From URI (2) and To URI (4). This parameter set the list of supported extensions for this SER. The value is expected as comma seperated list of the extensions. This list is seperated into single tokens. Each token from a proxy require header will be compare to the tokens from this list. This function makes a row of sanity checks on the given request. The function returns true if one of the checks failed. If one of the checks fails the module sends a precise error reply via sl_send_reply. Thus their is no need to reply with a generic error message. Optionally the function takes an integer argument which overwrites the global module parameter default_checks. This allows to make certain test from script regions. The integer value is again the sum of the checks (like for the module parameter) which should be executed at this function call. Example 4. sanity_check usage with parameter ...
if (method=="REGISTER" && sanity_check("256")) {
/* the register contains an invalid expires value and is replied with a 400 */
break;
}
...
Optionally the function takes a second integer argument which overwrites the global module parameter uri_checks and thus determines which URIs will be checked if the parse uri test will be executed. |
Navigation |
||||