Hi Zhan,
At first glance, it does not appear that anything about the second request is grammatically invalid.
I suspect the problem you are encountering is UDP fragmentation, as explained in my blog post here:
http://www.evaristesys.com/blog/sip-udp-fragmentation-and-kamailio-the-sip-h...
The size of the second INVITE you pasted is 1198 bytes. Add 463 bytes of encapsulated SDP body (Content-Length header), and it's 1661 bytes - over the UDP fragmentation threshold of ~1480 based on an MTU of 1500 bytes.
This is due to the additional "contributions" of the second Kamailio - extra Via and Record-Route headers. Removing these extras probably puts the message length at just under the fragmentation threshold.
Because the receiver does not get a fully reassembled UDP datagram, the message arrives partly formed (first UDP fragment is the only one received), the Polycom's SIP stack is confused.
-- Alex
On Fri, Jan 24, 2020 at 10:34:21AM -0700, Zhan Bazarov wrote:
We have Kamailio-cluster via route53(round-robin) some-domain.net
we have two kamailio with public IP's
phone1 is registered on kam1 phone2 is registered on kam2
when we are calling from phone1 to phone2 callflow looks:
phone1 => kam1 => asterisk => kam1 => t_relay(address of second kamailio:5078) => kam2 => phone2
it works perfectly, but in case when we are using polycom as phone2 - we are getting 404 response from polycom...
*Invite from second kamailio
2020/01/20 10:31:21.799327 10.199.240.19:5078 -> 37.17.41.5:49811 INVITE sip:jyu3xsfkrz6c5qn@10.3.0.116;transport=tcp SIP/2.0 Record-Route: sip:10.199.240.19:5078;transport=tcp;r2=on;lr;nat=yes;rtp=bridge Record-Route: sip:10.199.240.191:5078;r2=on;lr;nat=yes;rtp=bridge Record-Route: sip:10.199.240.135:5078;lr Via: SIP/2.0/TCP some-domain.net:5078;branch=z9hG4bK9ca3.93c2345f3eb1d4b0e1244e722a9bfb6e.0 Via: SIP/2.0/UDP some-domain.net:5078;rport=5078;received=10.199.240.135;branch=z9hG4bK9ca3.89b66f1dd6e86a5922180b8ed8475072.0 Via: SIP/2.0/UDP 10.199.240.179:7060;received=10.199.240.179;rport=7060;branch=z9hG4bKPj269365e0-798d-404b-bb77-2ad78472905c From: "Penny" sip:1015@10.199.240.179;tag=ba402508-a640-409f-ba30-dffdfe499f43 To: sip:jyu3xsfkrz6c5qn@10.199.240.135 Contact: sip:asterisk@10.199.240.179:7060;alias=10.199.240.179~7060~1 Call-ID: c3a406ca-9ac7-423d-9697-06d0603f48d5 CSeq: 22619 INVITE Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, MESSAGE, REFER Supported: timer, replaces, norefersub Session-Expires: 1800 Min-SE: 90 P-Asserted-Identity: "Penny" sip:1015@10.199.240.179 Max-Forwards: 68 User-Agent: Awesome Calling Platform 3.0 Content-Type: application/sdp Content-Length: 463
*Response from POLYCOM
2020/01/20 10:31:22.054766 37.17.41.5:49811 -> 10.199.240.19:5078 SIP/2.0 400 Bad Request Via: SIP/2.0/TCP some-domain.net:5078;branch=z9hG4bK9ca3.93c2345f3eb1d4b0e1244e722a9bfb6e.0 Via: SIP/2.0/UDP some-domain.net:5078;rport=5078;received=10.199.240.135;branch=z9hG4bK9ca3.89b66f1dd6e86a5922180b8ed8475072.0 Via: SIP/2.0/UDP 10.199.240.179:7060;received=10.199.240.179;rport=7060;branch=z9hG4bKPj269365e0-798d-404b-bb77-2ad78472905c From: "Penny" sip:1015@10.199.240.179;tag=ba402508-a640-409f-ba30-dffdfe499f43 To: sip:jyu3xsfkrz6c5qn@10.199.240.135;tag=8BC58304-83D9B045 CSeq: 22619 INVITE Call-ID: c3a406ca-9ac7-423d-9697-06d0603f48d5 Record-Route: sip:10.199.240.19:5078;transport=tcp;r2=on;lr;nat=yes;rtp=bridge, sip:10.199.240.19:5078;r2=on;lr;nat=yes;rtp=bridge, sip:10.199.240.235:5078;lr User-Agent: PolycomVVX-VVX_450-UA/5.8.0.12848 Accept-Language: en Content-Length: 0
Any ideas how to fix it?
-- Sent from: http://sip-router.1086192.n5.nabble.com/Users-f3.html
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users