SIP Via Header

The SIP Via header is added by a proxy when it forwards a SIP message onto another destination,

When a response is sent the reverse is done, each SIP proxy removes their details from the Via header and forwards to the next Via header along.

SIP Via headers in action
SIP Via headers in action

As we can see in the example above, each proxy adds it’s own address as a Via header, before it uses it’s internal logic to work out where to forward it to, and then forward on the INVITE.

Now because all our routing information is stored in Via headers when we need to route a Response back, each proxy doesn’t need to consult it’s internal logic to work out where to route to, but can instead just strip it’s own address out of the Via header, and then forward it to the next Via header IP Address down in the list.

SIP Via headers in action

Via headers are also used to detect looping, a proxy can check when it receives a SIP message if it’s own IP address is already in a Via header, if it is, there’s a loop there.

4 thoughts on “SIP Via Header

  1. Thanks for your article(s). Small bug: For the Ringing, the Via headers are switched on host 10.10.10.1.

  2. Hi Nick,
    Was the image ever corrected? I still see the headers switched at the Blah.com proxy in the SIP 180 Ringing

Leave a Reply to MartinvH Cancel reply

Your email address will not be published. Required fields are marked *