<div dir="ltr">Hello!<div><br></div><div>We use trunk with Twilio through a SIP/TLS.</div><div>They establish incoming calls from random ports, like:</div><div>(Twilio)<a href="http://3.3.3.3:54321">3.3.3.3:54321</a> --> (Kamailio)<a href="http://2.2.2.2:5061">2.2.2.2:5061</a><br></div><div><br></div><div>In case of sending in-dialog requests to them, Kamailio should establish an outgoing connection to the dst port 5061 (as per Route), like:</div><div>(Kamailio)2.2.2.2 --> (Twilio)<a href="http://3.3.3.3:5061">3.3.3.3:5061</a><br></div><div><br></div><div>But as per tcpdump traces and logs, Kamailio does not even try to establish an outgoing connection to Twilio.</div><div>There should be no problems with routes and the network on that server, as regular telnet to Twilio shows that 5061 is open.<br></div><div><br></div><div>What could be the reason and how to debug?</div><div><br></div><div><u>Script:</u><br clear="all"><div>onsend_route {<br></div><div>        xlog("L_ERR","[$cfg(route)]*RELAY ONSEND* $rm / $du / $fs / $fsn / [$ci]\n");<br>}<br></div><div><br></div><div><u>Syslog:</u><br>DEBUG <core> [core/resolve.c:1259]: srv_sip_resolvehost(): <a href="http://3.3.3.3:5061">3.3.3.3:5061</a> proto=3<br>DEBUG <core> [core/resolve.c:1371]: srv_sip_resolvehost(): returning 0x55acd63a63c0 (<a href="http://3.3.3.3:5061">3.3.3.3:5061</a> proto=3)<br>ERROR <script>: [DEFAULT_SEND]*RELAY ONSEND* REFER / sip:3.3.3.3:5061;transport=tls / tls:<a href="http://10.1.1.1:5061">10.1.1.1:5061</a> / sip_wan_tls / [123]<br>DEBUG tm [../../core/forward.h:277]: msg_send_buffer(): sending to: <a href="http://3.3.3.3:5061">3.3.3.3:5061</a>, force_socket=4, send_sock=0x7f090049b8e8<br>DEBUG tm [../../core/forward.h:292]: msg_send_buffer(): tcp_send failed<br>DEBUG tm [t_fwd.c:1568]: t_send_branch(): send to <a href="http://3.3.3.3:5061">3.3.3.3:5061</a> (3) failed<br>WARNING: tm [t_fwd.c:1588]: t_send_branch(): sending request on branch 0 failed<br>DEBUG tm [t_funcs.c:335]: t_relay_to(): t_forward_nonack returned error -1 (-477)<br>DEBUG tm [t_funcs.c:353]: t_relay_to(): -477 error reply generation delayed<br>DEBUG sl [sl_funcs.c:558]: sl_run_callbacks(): execute callback for event type 1<br><br><u>Software:</u><br>- Kamailio is listening on (+udp, +tcp):<br></div><div>  tls: <a href="http://10.1.1.1:5061">10.1.1.1:5061</a> name sip_wan_tls advertise <a href="http://2.2.2.2:5061">2.2.2.2:5061</a><br></div><div><br></div><div>- OS is Debian 11.5</div><div><br></div><div>- # kamailio -v<br></div><div> version: kamailio 5.6.2 (x86_64/linux)<br> flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLOCKLIST, HAVE_RESOLV_RES,  TLS_PTHREAD_MUTEX_SHARED<br>ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB <br>poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.<br> id: unknown<br>compiled with gcc 10.2.1<br></div><div><br></div><div><div>- # dpkg -l | grep ssl<br></div><div> ii  libssl1.1:amd64                     1.1.1n-0+deb11u3               amd64        Secure Sockets Layer toolkit - shared libraries<br> ii  openssl                             1.1.1n-0+deb11u3               amd64        Secure Sockets Layer toolkit - cryptographic utility<br></div><div><br></div><br class="gmail-Apple-interchange-newline"></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><br><div><div>BR,</div><div>Denys Pozniak<br></div><div><br></div><div><br></div></div></div></div></div></div>