AppendixA. More About SIP
oftenopens up certain protocols and ports in advance, but now you don’t know which ports to open. To handle SIP
througha firewall which doesn’t understand the SIP concept, all ports must be open all the time, which would make
thefirewall somewhat unnecessary. A firewall that understands SIP can open up the ports for the right protocols just
whenthe SIP traffic needs it.
Inthe SIP headers there is a lot of information concerning what IP numbers the session participants use. This is a
problemif a SIP session should be established through a firewall using NAT.The IP number on the hidden side
(whichappears in the SIP headers) won’t be the same as the one that clients on the outside should use.
SIP sessions

Establishing a SIP session

Youstart a call (a session) by sending a request to the address of the person you want to communicate with. The
formatof the address is <sip:user@host>, where user can be a user name or a telephone number, and host can be a
domainname (e.g. example.com) or a numerical network address (e.g. 172.15.253.12). This means that it usually
looksa lot like a standard e-mail address. In this request information about which media streams the client wants to
send/receiveand what ports should be used is also included.
TheSIP client sends this request to its default SIP proxy. This proxy resolves the SIP domain in DNS, and sends the
requestto the SIP registrar for that domain. The proxy also adds information stating that the request was routed
throughthe proxy, thus ensuring that the reply will be routed the same way.
Theregistrar for the domain looks up the user to see where he is registered, and forwards the request to the machine
inquestion. The SIP client on this machine alerts the user, indicating that someone wants to initiate a SIP session.
Theuser confirms that he, too, wants the SIP session. The client sends a reply with necessary information about
whatports should be used by this client for sending and receiving media streams.
Thefirst client receives the reply and sends a confirmation packet. After this, the media streams can be sent.
126