0

there are two format about history-info part.

  1. History-Info:<sip:xxxx@xx.com;user=phone?Reason=SIP%3Bcause%3D486>;index=1
  2. History-Info:<sip:xxxx@xx.com;user=phone;Reason=SIP%3Bcause%3D486>;index=1

just confuse which symbol need use,? or ; and which scenario use ?, which scenario use ; thanks

yxxxxx
  • 1
  • 1
    Does this answer your question? [Different query/parameter separators in URIs](https://stackoverflow.com/questions/20512652/different-query-parameter-separators-in-uris) – gst Oct 22 '21 at 09:09

1 Answers1

0

SIP defines URI decoration in its own way. After a semicolon, it is called uri parameters. After the question mark, it is called header fields.

in your case, the first one is correct because Reason is a standardized header in SIP https://datatracker.ietf.org/doc/html/rfc3326 - The Reason Header Field for the Session Initiation Protocol (SIP)

History-Info:<sip:xxxx@xx.com;user=phone?Reason=SIP%3Bcause%3D486>;index=1

The received reason header is copied into the header fields of the history-info URI.

The same apply to other well-known header fields like privacy.

so far, so good but what about the second one ?

History-Info:<sip:xxxx@xx.com;user=phone;Reason=SIP%3Bcause%3D486>;index=1

Well, it is valid too in the context of history-info because it is easier to accept both for compatibility purpose i guess, please see Mapping and Interworking of Diversion Information between Diversion and History-Info Header Fields in the Session Initiation Protocol (SIP)https://datatracker.ietf.org/doc/html/rfc7544

In summary, if the piece of information is coming from a SIP header, it is maybe better to put it in the header fields part of the URI.

tomrtc
  • 517
  • 6
  • 10
  • SIP defines URI decoration in its own way. After a semicolon, it is called uri parameters. After the question mark, it is called header fields。------- hello, do you have any rfc about this discription? – yxxxxx Oct 25 '21 at 03:08
  • rfc3261#section-19.1.1 SIP and SIPS URI Components Its general form, in the case of a SIP URI, is: sip:user:password@host:port;uri-parameters?headers URI parameters: Parameters affecting a request constructed from the URI. URI parameters are added after the hostport component and are separated by semi-colons. Headers: Header fields to be included in a request constructed from the URI.Headers fields in the SIP request can be specified with the "?" mechanism within a URI. – tomrtc Oct 25 '21 at 14:08
  • ok,thanks, bro, you are very pro – yxxxxx Oct 30 '21 at 00:41