I have an asterisk server 13.23.1 running on CentOS 7 64bit on which I can’t use PJSIP peers with TLS. After few minutes, the connection drops and I see the message:
[2018-10-24 15:28:50] VERBOSE[2939] res_pjsip_registrar.c: Removed contact ‘sip:105-AA@64.183.170.34:62702;transport=TLS’ from AOR ‘105-AA’ due to transport shutdown
Browsing past messages, I read it was caused by the underlying TCP being interrupted, so I start sniffing the packets and discovered it was the asterisk server to send to the phone a FIN packet. In this example I have IP 192.168.75.172 being the asterisk server (behind NAT) and 64.183.170.34 being the TLS phone.
Any idea about the reason?
15:28:48.301051 IP 64.183.170.34.62702 > 192.168.75.172.5071: Flags [S], seq 2266015870, win 5840, options [mss 1380,nop,nop,sackOK,nop,wscale 1], length 0
15:28:48.301103 IP 192.168.75.172.5071 > 64.183.170.34.62702: Flags [S.], seq 2281072057, ack 2266015871, win 29200, options [mss 1460,nop,nop,sackOK,nop,wscale 7], length 0
15:28:48.394515 IP 64.183.170.34.62702 > 192.168.75.172.5071: Flags [.], ack 1, win 2920, length 0
15:28:48.802368 IP 64.183.170.34.62702 > 192.168.75.172.5071: Flags [P.], seq 1:119, ack 1, win 2920, length 118
15:28:48.802416 IP 192.168.75.172.5071 > 64.183.170.34.62702: Flags [.], ack 119, win 229, length 0
15:28:48.802624 IP 192.168.75.172.5071 > 64.183.170.34.62702: Flags [.], seq 1:2761, ack 119, win 229, length 2760
15:28:48.802666 IP 192.168.75.172.5071 > 64.183.170.34.62702: Flags [P.], seq 2761:2831, ack 119, win 229, length 70
15:28:48.888256 IP 64.183.170.34.62702 > 192.168.75.172.5071: Flags [.], ack 1381, win 4300, length 0
15:28:48.888660 IP 64.183.170.34.62702 > 192.168.75.172.5071: Flags [.], ack 2761, win 5680, length 0
15:28:48.888683 IP 64.183.170.34.62702 > 192.168.75.172.5071: Flags [.], ack 2831, win 5680, length 0
15:28:49.250706 IP 64.183.170.34.62702 > 192.168.75.172.5071: Flags [.], seq 119:1499, ack 2831, win 5680, length 1380
15:28:49.256499 IP 64.183.170.34.62702 > 192.168.75.172.5071: Flags [P.], seq 1499:3584, ack 2831, win 5680, length 2085
15:28:49.256536 IP 192.168.75.172.5071 > 64.183.170.34.62702: Flags [.], ack 3584, win 284, length 0
15:28:49.262413 IP 192.168.75.172.5071 > 64.183.170.34.62702: Flags [P.], seq 2831:4217, ack 3584, win 284, length 1386
15:28:49.354870 IP 64.183.170.34.62702 > 192.168.75.172.5071: Flags [.], ack 4211, win 7060, length 0
15:28:49.354905 IP 64.183.170.34.62702 > 192.168.75.172.5071: Flags [.], ack 4217, win 7060, length 0
15:28:49.799647 IP 64.183.170.34.62702 > 192.168.75.172.5071: Flags [P.], seq 3584:4245, ack 4217, win 7060, length 661
15:28:49.813391 IP 192.168.75.172.5071 > 64.183.170.34.62702: Flags [P.], seq 4217:4835, ack 4245, win 306, length 618
15:28:49.896120 IP 64.183.170.34.62702 > 192.168.75.172.5071: Flags [.], ack 4835, win 8440, length 0
15:28:49.903251 IP 64.183.170.34.62702 > 192.168.75.172.5071: Flags [P.], seq 4245:5178, ack 4835, win 8440, length 933
15:28:49.925962 IP 192.168.75.172.5071 > 64.183.170.34.62702: Flags [P.], seq 4835:5405, ack 5178, win 327, length 570
15:28:49.930361 IP 192.168.75.172.5071 > 64.183.170.34.62702: Flags [P.], seq 5405:5943, ack 5178, win 327, length 538
15:28:50.031505 IP 64.183.170.34.62702 > 192.168.75.172.5071: Flags [.], ack 5943, win 8440, length 0
15:28:50.041858 IP 64.183.170.34.62702 > 192.168.75.172.5071: Flags [P.], seq 5178:5711, ack 5943, win 8440, length 533
15:28:50.042241 IP 192.168.75.172.5071 > 64.183.170.34.62702: Flags [F.], seq 5943, ack 5711, win 349, length 0
15:28:50.121339 IP 64.183.170.34.62702 > 192.168.75.172.5071: Flags [P.], seq 5711:6116, ack 5944, win 8440, length 405
15:28:50.121391 IP 192.168.75.172.5071 > 64.183.170.34.62702: Flags [R], seq 2281078001, win 0, length 0