How to use the SIP NAT Traversal Controller API

The SIP NAT Traversal Controller API provides interfaces to the SIP stack to perform the following tasks:

The SIP stack and NAT Traversal Controller plug-in share a socket for sending messages over UDP or TCP. It uses the same source IP address and UDP/TCP port for sending SIP and UNSAF protocol messages over UDP or TCP. SIP stack manages the shared socket when you use the following interfaces:

  • The SIP stack notifies NAT Traversal Controller plug-in when the next move for NAT binding keepalives changes by calling CSIPNATTraversalController::UpdateNextHop.

  • If the SIP stack receives data from the shared socket that it does not identify, it passes the data to the external NAT Traversal Controller plug-in when you call CSIPNATTraversalController::DataReceivedL.

  • Before the SIP stack releases the resources used by the NAT Traversal Controller plug-in, the SIP stack calls CSIPNATTraversalController::FreeResources.

  • Synchronize the control to the shared socket to prevent NAT Traversal Controller plug-in and SIP stack that try to send the data using the same socket at the same time. SIP stack can allow or deny the NAT Traversal Controller plug-in permission to use the shared socket by calling CSIPNATTraversalController::SocketIdle.