What is the difference in contact and from header?
Asked Answered
Q

2

5

Can anyone please clarify - if both, contact and from header, contains the address of originator of SIP INVITE request, then what is the difference between them?

Quadriga answered 24/6, 2015 at 18:39 Comment(0)
U
6

From header is the logical identity of the user that will be used for auth/callerid (i.e. sip:[email protected]). The Contact header is the TCP/IP network address where you should send all packets to (i.e. sip:[email protected]:43085;transport=tcp) - IP/port/transport info. While it's not entirely accurate, this is a good way to think about it in most cases.

Undulant answered 25/6, 2015 at 13:56 Comment(2)
so in this example , 192.168.1.1 is IP adress of hostname "company.com"?Quadriga
No, 192.168.1.1 is just the IP address where your phone or server will receive requests. You phone may be at home, at some other office, completely unrelated place to your company.com address. For example you are at home but you have a sip account in [email protected]. Your phone at home will send an INVITE where the Contact header is sip:me@your_home_ip however when you send this request to att.com they will check the From header to determine your identity [email protected] and if you send sip:me@your_home_ip instead they will generally reject it because they are not responsible for your home ip.Undulant
H
1

Contact header does not necessary contain address of originator, but lists URLs used to redirect future requests. It may be same as From, but doesn't have to. One common example is registration when SIP stacks (e.g. one used by Nokia E52 or re/baresip) are replacing user part with some unique identifier that helps distinguish following incoming requests.

Helladic answered 25/6, 2015 at 7:46 Comment(4)
can you give any reference for you point ? because I have read in several places that , contact header address is the address of caller (which can be only one) , so that at time of session establishment , callee can directally contact to caller , without going through proxy.Quadriga
Registration and redirection (and I'm not sure if only these services) can use multiple URIs in Contact, see tools.ietf.org/html/rfc3261#section-20.10 or less formal: cisco.com/c/en/us/td/docs/voice_ip_comm/pgw/9/feature/module/…Helladic
Late edit: I've missed that you've asked for INVITE only.Helladic
yes....register request can contain multiple value in contact header , because register message use to update location database in location server , and there may be multiple location where SIP end user B , want to receive the INVITE request , but my Q was , if feels like , that From and contact field is same in SIP INVITE request..Quadriga

© 2022 - 2024 — McMap. All rights reserved.