[SR-Users] Wrong Record-Route and Via header fields when TCP is used

Daniel-Constantin Mierla miconda at gmail.com
Mon Jul 8 20:01:45 CEST 2019


when you look at the network traffic 9e.g., with ngrep, sngrep, ...)
what is shown as source address for outbound leg?


On 08.07.19 19:21, Leonid Fainshtein wrote:
> I just found Daniel's response to a similar question (ref.:
> https://lists.kamailio.org/pipermail/sr-users/2019-February/104853.html):
> "check the routing rules/table of the operating systems, there should be
> some differences between the two servers.
> If you mhomed=1 and an unexpected interface is used for routing out the
> traffic, it means that the operating system has internal routing rules that
> allow going from that interface to the target address."
> Don't see anything suspicious in my server routing table:
> default via dev eno1 proto static
> dev lxdbr0 proto kernel scope link src
> dev eno1 proto kernel scope link src
> dev eno1 proto kernel scope link src
> The request is received on the lxdbr0 interface ( and sent
> out from the eno1 interface (
> I even tried to delete the default route but nothing helped. The
> request is sent out with in the via and Record-Route
> fields...
> Best regards,
> Leonid
> On Thu, Jul 4, 2019 at 6:20 PM Leonid Fainshtein
> <leonid.fainshtein at xorcom.com> wrote:
>> Hi,
>> Kamailio server has two legs that are connected to different networks.
>> I'm using Kamailio v.5.2.3 and the "enable_double_rr" is implicitly set to "1".
>> The leg "A" IP address is
>> The leg "B" IP address is
>> The call is initiated from
>> According to the "rr" module documentation, function record_route()
>> should insert two "Record_Route" header fields when a request is
>> accepted on one leg is should go out via the second leg. This works as
>> expected in case of UDP protocol:
>> INVITE sip:2000 at;transport=UDP SIP/2.0
>> Record-Route: <sip:;r2=on;lr;did=e2c.a191>
>> Record-Route: <sip:;r2=on;lr;did=e2c.a191>
>> Via: SIP/2.0/UDP
>> Via: SIP/2.0/UDP;rport=5060;branch=z9hG4bK3a9e9a4d
>> But when the TCP protocol is used then the outbound message looks like this:
>> INVITE sip:2005 at;transport=tcp SIP/2.0
>> Record-Route: <sip:;transport=tcp;lr;did=bb6.7dc1>
>> Via: SIP/2.0/TCP
>> Via: SIP/2.0/TCP;rport=58616;branch=z9hG4bK1469331f
>> There are two problems there:
>> a) only one Record-Route with leg is inserted
>> b) the added "Via" header field contains the leg "A" IP address
>> instead of expected leg "B" IP address ( In the LAN
>> trace I see that in reality the message was sent from leg "B".
>> Is it a bug?
>> Best regards,
>> Leonid Fainshtein
> _______________________________________________
> Kamailio (SER) - Users Mailing List
> sr-users at lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda

More information about the sr-users mailing list