In SIP, why the Contact header field MUST be present in the Invite request

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-05 05:11:31

The contact field contains the address at which the callee can reach the caller for future requests. For example, it's necessary so that the callee can send a BYE or a re-INVITE to the caller.

The Contact header says where you are (or rather, where your User Agent is), while the From header says who you are.

You might have several SIP devices all registered to the same Address of Record (the URI you put in the From header).

Further, REGISTER requests use Contact headers to maintain SIP's location service: they let a user agent update a registrar's location information.

(As an aside, if Alice calls Bob, the Contact header needs to be in a 2xx response so that Alice can route the 2xx's ACK to Bob. This points to DarkDust's comment about some SIP proxies mangling Contact headers: if it doesn't, you find yourself in the uncomfortable position of having a call that's only half established: Alice thinks the call's set up because she sent her ACK, but Bob never receives it. An alternative to a Contact-mangling Proxy is using a B2BUA as a network gateway; it wouldn't need to mangle the Contact header because the header would point to the B2BUA itself.)

In response to Phoenix Luo's comments, because of the shortcomings of using LAN IPs in a Contact header, RFC 5627 describes a solution - using globally routable user agent URIs (GRUUs) in the Contact header/s.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!