It is not easy to figure out how to route SIP packets. We will present in this section some of the basic concepts to route SIP packets over the proxy server. The first important concept is the one involving transactions and dialogs.
A transaction starts with a request and finishes, usually, with a response code. The branch parameter in the VIA header field identifies a transaction. A dialog may start with an INVITE transaction and finish with a BYE transaction. A dialog is identified by the combination of the FROM, TO, and CALL-ID header fields. Not all SIP methods start a dialog, the REGISTER and MESSAGE methods do not.
It is important to understand the difference between initial requests and sequential requests. For initial requests, you have to decide how to route using a discovery mechanism, usually based on DNS or in a location table.
The initial request records the routing information using the VIA header and if...