Search code examples
sipvoipkamailio

Which takes precedence VIA or Contact header?


As the title says which should take precedence when replying back to a UAS. I have a provider that sends a VIA header that is different to the contact header. They are stating that I should be sending SIP signalling back to the URI in the contact header. But Kamailio is sending it back to URI in the VIA header.

I can not find an RFC which shows the precedence.

Thanks


Solution

  • Via and Contact Header serves different purpose:

    Via Header: It indicates the list of all the network node (server,proxy-server etc.) the request traversed from originating point to the endpoint.

    Via Header is used by the User Agent Server (UAS) to return/reply the SIP status responses (e.g. SIP 100 Trying, 180 Ringing, etc.)

    Contact Header: Contact header basically contains the SIP URI of the end user, that the originating user can use to send future requests to. That is, requests that belong to the same dialog, such as re-INVITE, BYE and ACK messages. (The Contact header field has a role similar to the Location header field in HTTP.)