6. NAT Traversal
Brekeke SIP Server decides automatically whether to handle NAT traversal. The Administrator can also specify whether Brekeke SIP Server handles NAT traversal or not for each session using Dial Plan.
The following handling variables will be related to NAT traversal:
$nat = true or false
Whether to apply NAT traversal or not
$ifdst = IP address or FQDN
The interface address of Brekeke SIP Server for communicating with the session’s destination (the callee).
This address is used for Via, Record-Route and etc.
$ifsrc = IP address or FQDN
The interface address of Brekeke SIP Server for communicating with the session’s source (the caller).
This address is used for Via, Record-Route and etc.
6.1 Setting NAT Traversal ON/OFF
Ex 1. Enabling NAT Traversal if the callee’s domain name is “host.domain”
Matching Patterns | Deploy Patterns |
$request = ^INVITE $geturi( To ) = @host.domain |
$nat = true |
Ex 2. Disabling NAT Traversal if the call is from 192.168.0.1
Matching Patterns | Deploy Patterns |
$request = ^INVITE $addr = 192\.168\.0\.1$ |
$nat = false |
6.2. Specifying the Interface Address
Ex 3. Using “192.168.1.1” as the interface address if the prefix of callee’s contact address is “192.168.1”
Matching Patterns | Deploy Patterns |
$request = ^INVITE $registeredaddr = ^192\.168\.1\. |
$ifdst = 192.168.0.1.1 |
Ex 4. Using “192.168.2.1” as the interface address if the call is from an IP address with the prefix “192.168.2”
Matching Patterns | Deploy Patterns |
$request = ^INVITE $ addr = ^192\.168\.2\. |
$ifsrc = 192.168.0.2.1 |