Functions
<function>blst_add([timeout])</function> Adds the source of the current message to the blacklist for timeout seconds. If timeout is missing or 0 it uses the default blacklist timeout (dst_blacklist_expire). <function>blst_add</function> usage ... if (src_ip==10.0.0.0/9) blst_add(30); # 30 s else blst_add(); # use default blacklist timeout ...
<function>blst_add_retry_after(min, max)</function> Adds the source of the current message to the blacklist for the time interval specified in the Retry-After header. If the Retry-After header is missing, it will fail (returns false). If the Retry-After value is less than min, then min seconds will be used instead. If the Retry-After value is greater than max, then max seconds will be used instead. <function>blst_add_retry_after</function> usage ... # on_reply route if (msg_status==503){ # blacklist 503 source for Retry-After seconds if (! blst_add_retry_after(30, 3600)) blst_add(60); # if no retry_after header add it for 60s } ...
<function>blst_del()</function> Removes the source of the current message from the blacklist. If the address is not present in the blacklist at the time of the call it returns false. <function>blst_del</function> usage ... blst_del(); ...
<function>blst_is_blacklisted()</function> Returns true if the source of the current message is blacklisted. <function>blst_is_blacklisted</function> usage ... if (blst_is_blacklisted()){ log("message from a blacklisted source"); drop; } ...
<function>blst_set_ignore([flags])</function> Set errors that will not be taken into account when deciding whether to blacklist a destination for the current message or a local reply to the current message. blst_set_ignore(..) works for forwarding the current message and blst_rpl_set_ignore(...) works for local replies to the current message. The variants of these functions with no parameters will ignore everything (equivalent to passing 0xff). The flags are stored internally as a bitmask, and are applied by bitwise ANDing them together. The following flags are available: 0x02 - generic send error (send denied/ failed). 0x04 - connect failed (TCP, TLS or SCTP). 0x08 - ICMP error (not currently used). 0x10 - SIP transaction timeout. 0x20 - 503 reply (statefull mode only). For more details see tm blst_503. TCP and TLS send and connect errors are handled per connection and not per message. The connection blacklist ignore flags are inherithed from the message that caused the connection establishment. <function>blst_set_ignore</function> usage blst_set_ignore(6); # ignore send and connect errors
<function>blst_rpl_set_ignore([flags])</function> See function blst_set_ignore([flags]).
<function>blst_clear_ignore([flags])</function> Clears blacklist ignore flags previously set by the corresponding blst_set_ignore(...) or blst_rpl_set_ignore(...) functions. See also blst_set_ignore. <function>blst_clear_ignore</function> usage blst_clear_ignore(4); # ignore connect errors
<function>blst_rpl_clear_ignore([flags])</function> See function blst_clear_ignore([flags]).