Figure 2.16 SIP dialogue
Some messages establish a dialogue and some do not.This is used to explicitly express the relationship of messages and also to send messages that are not related to other messages outside a dialogue.
That is easier to implement because user agents do not have to maintain the dialogue state.
For instance, an INVITE message establishes a dialogue, because it will later be followed by a BYE request, which will tear down the session established by the INVITE.This BYE is sent within the dialogue established by the INVITE.
But, if a user agent sends a MESSAGE request, such a request does not establish any dialogue. Any subsequent messages (even MESSAGE) will be sent independently of the previous one.
2.2.2.5.1. Dialogues facilitate routing
Dialogues are also used to route the messages between user agents, as described briefly.
Suppose that user sip:bob@a.com wants to talk to user sip:pete@b.com. He knows the SIP
address of the called party (sip:pete@b.com) but this address does not say anything about current location of the user, i.e., the calling party does not know to which host to send the request.Therefore, the INVITE request will be sent to a proxy server.
The request will be sent from proxy to proxy until it reaches one that knows the current location of the called party.This process is called routing. Once the request reaches the called party, the called party's user agent will create a response that will be sent back to the calling party.
The called party's user agent will also put a contact header field into the response which will contain the current location of the user.The original request also contained a contact header field which means that both user agents know the current location of the peer.
P.42
[IP Telephony Cookbook] / Technological Background
Because the user agents know the location of each other, it is not necessary to send further requests to any proxy.They can be sent directly from user agent to user agent.That is exactly how dialogues facilitate routing.
Further messages within a dialogue are sent directly from user agent to user agent.This is a significant performance improvement because proxies do not see all the messages within a dialogue.They are used to route just the first request that establishes the dialogue.The direct messages are also delivered with much smaller latency because a typical proxy usually implements complex routing logic. Figure 2.17 contains an example of a message within a dialogue (BYE) that bypasses the proxies.
Proxy 1
Proxy 2
INVITE
INVITE
INVITE
BYE
Calling party