<div dir="ltr"><div><div><div>Well, your provider is right, the top most VIA header define the sender address where the replies are expected. Each hop in the path adds its own VIA at top till the request reaches the final destination. At final destination, the list of VIA headers reflects the reply path from top to bottom (i.e. first to last VIA header, where last via is the final user who sent the request and wants the reply from the destination). For example,<br><br></div><div>A send request to D via proxy B and C, then at D the VIA header list will look like this,<br><br></div><div>VIA: <address of C><br></div><div>VIA: <address of B><br></div><div>VIA: <address of A><br></div><div><br></div><div>Therefore D will reply to A via C and B respectively. When C receives the reply from D, it will remove its VIA header and forward the reply to B with this VIA list,<br><br><div>VIA: <address of B><br></div>VIA: <address of A><br><br></div><div>The B does the same, it see that top most VIA its own address, so it deletes that and forward the reply to A with this VIA list,<br><br></div><div>VIA: <address of A><br><br></div><div>When A receives replies it too removes topmost VIA (since it points to itself) and see there are no more VIA left, this means that reply has reached its final destination.<br></div><div><br></div><div>Of course there may be some other SIP routing headers/ elements which may change this behavior, e.g. Route, Record-Route, SIP Aliases, custom headers etc. etc.<br></div><div><br><br>Here is a detailed discussion on it,<br><br><a href="https://andrewjprokop.wordpress.com/2014/03/06/understanding-the-sip-via-header/" target="_blank">https://andrewjprokop.wordpress.com/2014/03/06/understanding-the-sip-via-header/</a><br><br></div>You kamailio is configure incorrectly, it is not suppose to sent top most via to private ip unless your provider can reach you via private ip (e.g. through some vpn tunnel between you and your provider etc.).<br><br></div>So basically it seem your kamailio is miss configured. A good example and explanation of implementing load balancing can be found here,<br><br><a href="http://www.kamailio.org/events/2013-KamailioWorld/23-Daniel-Constantin.Mierla-Load-Balancing-Load-Balancers.pdf">http://www.kamailio.org/events/2013-KamailioWorld/23-Daniel-Constantin.Mierla-Load-Balancing-Load-Balancers.pdf</a><br><br></div><div>Thank you.<br><br><div><div><br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 4, 2015 at 1:14 PM, Chad <span dir="ltr"><<a href="mailto:ccolumbu@hotmail.com" target="_blank">ccolumbu@hotmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi list,<br>
I need a little help, I am a business owner trying to get Kamailio up and running as a SIP load balancer.<br>
I hired a Kamailio consultant to help me do so, but Kamailio is not working and I am getting conflicting information.<br>
<br>
My Kamailio consultant and my VOIP provider are telling me 2 different things and I don't know which one is right.<br>
<br>
Kamailio sends SIP traffic to the VOIP provider with 2 VIA headers like this (in this order):<br>
Via: SIP/2.0/UDP 10.10.10.254;branch=z9hG4bK7291.6a0bbd2e8fd639a47d7d2de606779e47.0.<br>
Via: SIP/2.0/UDP 209.170.201.25:5060;received=10.10.10.102;branch=z9hG4bK742dc03d;rport=5060.<br>
<br>
The VOIP provider says that is incorrect because they are supposed to reply back to the topmost VIA header so they reply to the 10.10.10.254 IP (which is not public) and the call ends.<br>
The VOIP provider says Kamailio should send the VIA headers like this instead:<br>
Via: SIP/2.0/UDP 209.170.201.25:5060;received=10.10.10.102;branch=z9hG4bK742dc03d;rport=5060.<br>
Via: SIP/2.0/UDP 10.10.10.254;branch=z9hG4bK7291.6a0bbd2e8fd639a47d7d2de606779e47.0.<br>
<br>
My Kamailio consultant says the way we are sending it is right and that the VOIP provider is processing the call incorrectly.<br>
<br>
I read that the SIP proxy is supposed to remove the internal header from the 1st example above based on this RFC:<br>
<a href="https://tools.ietf.org/html/rfc3261#section-16.7" rel="noreferrer" target="_blank">https://tools.ietf.org/html/rfc3261#section-16.7</a><br>
Item: 3. Via<br>
"The proxy removes the topmost Via header field value from the response."<br>
<br>
If that applies to this situation (which I don't know if it does) then Kamailio should be removing the 10.10.10.254 VIA line and only sending 1 VIA header like this:<br>
Via: SIP/2.0/UDP 209.170.201.25:5060;received=10.10.10.102;branch=z9hG4bK742dc03d;rport=5060.<br>
<br>
Which would sort of make the VOIP provider right in that the topmost VIA line would then be the external IP, but how they said to fix it (reversing the VIA lines) is wrong.<br>
<br>
Does anyone know what the right answer is here?<br>
Please let me know.<br>
<br>
THANKS for your help.<span class="HOEnZb"><font color="#888888"><br>
<br>
-- <br>
<br>
^C<br>
<br>
<br>
_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</font></span></blockquote></div><br></div>