When a SIP phone behind NAT registers to the SIP proxy, the NAT router creates an internal “tunnel” between LAN and WAN, passing all communication for this network connection back and forth between the client and the server. If no packets are sent in either direction over a certain period of time, the NAT router regards the connection as terminated, and removes this “tunnel”. If an IP phone behind NAT sends data for this connection, a new “tunnel” will be created and the functionality restored. However, if the SIP server tries to send data (incoming call information) after the NAT “tunnel” has been closed, NAT will reject these packets (since it has no information as to where they should be sent on LAN). This may create problems, because if a NAT router removes a “tunnel” too soon, an IP phone may not receive some incoming calls.
To prevent this situation, PortaSIP includes the NAThelper module, which periodically sends small “ping” packets to registered SIP phones. These packets are small, and so do not create any significant network traffic, but they are sent often enough so that the NAT router keeps the connection open.