简体   繁体   中英

What is the difference between the INVITE field and the To field in a SIP INVITE message?

In a SIP INVITE message, what is the difference between the INVITE field address and the To field in the Message Header? Shouldn't the SIP URI in the INVITE field the same as SIP URI in the 'To' field in the message header?

Thanks

I think you are talking about the difference between RequestUri and To Uri.

Request URI:

INVITE sip:+919100548751@85.13.246.222 SIP/2.0

To URI:

sip:+919100548751@52.10.15.196;transport=UDP

The differece between them is Request Uri contain the next HOP ip adrress where as to uri contains the destination Number.

From source to Destination address...we can have many hops.

I hpoe i answered your question

For a request URI the specification RFC3261 8.1.1.1 says:

The initial Request-URI of the message SHOULD be set to the value of the URI in the To field. One notable exception is the REGISTER method;

For the To header the specification RFC3261 8.1.1.2 says:

The To header field first and foremost specifies the desired "logical" recipient of the request, or the address-of-record of the user or resource that is the target of this request. This may or may not be the ultimate recipient of the request.

For non-REGISTER requests the To header URI is a "logical" value and it's typically left up to the agent that processes the request to decide how to use it (often nothing is done with it). The request URI is much more critical. It dictates where and how the request needs to be sent.

One example that may help is when a request needs to be sent over a TCP transport. The request URI could get produced as:

sip:1234@localhost;transport=tcp

Whereas the To URI will remain:

 sip:1234@localhost

In a SIP INVITE message, what is the difference between the INVITE field address and the To field in the Message Header?

The 'to' header field contains the desired address-of-record ; that address-of-record is constant in nature (with exceptions). The INVITE field address aka Request-URI contains the current SIP-URI target and is variable in nature.

Shouldn't the SIP URI in the INVITE field the same as SIP URI in the 'To' field in the message header?

Short answer: Yes when forming the initial INVITE and no when SIP routing occurs.

Longer stuff: If the user agent Alice initiates a call to a specific Bob SIP endpoint, it retrieves the Bob address-of-record from somewhere and then create a initial INVITE request with the desired address-of-record placed in the Request-URI field, place the same address-of-record in the URI of the to header field.

The initial INVITE is sent and routed... at one SIP proxy the Request-URI field is refined using the procedure as specified in [RFC3261] section 16.

If it receives a request targeted at the address-of-record that belongs to the domain that this proxy is responsible for then:

  • It is supposed to access a SIP location service to compute the request targets , note that more than one target-URI is possible!
  • In a simple case, the request-URI is filed with registered contact of the desired address-of-record using REGISTRAR database.
  • the proxy creates related INVITE request with the request URI changed to newly fetched target URI ,
  • then if more target-URI exist then proceed in the same way for forking purpose.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM