From khorsmann@gmail.com Wed Jul 3 18:38:45 2019 From: Karsten Horsmann To: sr-users@lists.kamailio.org Subject: Re: [SR-Users] kamailio as UAC and NAPTR / sendsocket question Date: Wed, 03 Jul 2019 18:38:28 +0200 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1598728545==" --===============1598728545== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Hi List, Hi Daniel, any one here that can imagine why force sendsocket generates an udp packet if the target accept only tcp? And without fs it generates an tcp packet. For uac registrations outbound? In my lab it's working without force send socket, cos the Paket is generated with the first private ip that the linux server had configured (and where the default route is reachable). Network setup is like that : Firewall (routes public ip to Kamailio via an privat IP of Kamailio box) - - > Kamailio server (in DMZ). And back of course. All other szencarios (sip traffic proxy acting) works like a charm. Thanks Kind regards Karsten Horsmann schrieb am Mi., 26. Juni 2019, 14:50: > Hello Daniel > > > i verifed that can send tcp with that public ip (used nc for that). > Hopefully the linux-networking is not the problem. > > I tried method $fs="212.xx.xx.xx"; and force_send_socket("212.xx.xx.xx"); > Both versions (with and without transport=tcp param) but kamailio sends > out via UDP. > > Any ideas? > > event_route[tm:local-request] { > if(!is_method("OPTIONS")) { > xlog("L_INFO", "[tm:local-request] request rm:[$rm] from fu:[$fu] > to ru:[$ru] rP:[$rP] sut:[$sut] du:[$du] dP:[$dP] sas:[$sas]\n"); > } > if(is_method("REGISTER")) { > xlog("its [$rm] [$ru] sas:[$sas]\n"); > > #$fs="$sas"; > add_uri_param("transport=tcp"); > # First try > # $fs="212.xx.xx.xx"; > # Second try > # force_send_socket("212.xx.xx.xx"); > } > } > > tcpdump to see TCP or UDP outgoing: > > 212.xx.xx.xx.sip > 217.0.15.67.sip: [bad udp cksum 0xe921 -> 0x39df!] > SIP, length: 459 > REGISTER sip:sip-trunk.telekom.de;transport=tcp SIP/2.0 > Via: SIP/2.0/UDP > 212.xx.xx.xx;branch=z9hG4bKa4e7.2adf59a7000000000000000000000000.0;i=0 > To: > From: >;tag=4f1676d5afd8e4fcf22b77a7b449c44f-8d04 > CSeq: 10 REGISTER > Call-ID: 17110ff874fd4810-19875(a)212.xx.xx.xx > Max-Forwards: 70 > Content-Length: 0 > User-Agent: SBC-OS > Contact: > Expires: 360 > >