- onsend_route - executed when a SIP request is sent to network
- event_route - will be presented in the next post of this series
The newly introduced onsend_route comes to fill the gap. The actions in this routing block are executed just before sending the message to network, meaning:
- you get access to the buffer with the version of the SIP request that is sent
- you get access to all attributes of destination address: address family, transport protocol, ip address and port.
- $snd(name), where 'name' can be 'ip', 'af', 'port' or 'proto'- get access via PV to destination's ip address, address family, port or transport protocol. In addition to details of destination address, when name is 'buf' or 'len' you get access to content of output buffer and its length.
- snd_ip, snd_af, snd_port, snd_proto - same as above about destination address, but implemented as config keywords
The typical usage is to implement outgoing filtering, a good option to protect against DNS poisoning and malicious DNS records:
onsend_route {
if(isflagset(2) && $snd(ip)=="10.10.10.10"){
drop;
}
}
No comments:
Post a Comment