I am using an Asterisk 13.13.1 server behind a NAT firewall with FreePBX 13.0.190.17 and I have two chan_sip extensions.
And these extensions are also registered from behind NAT of different networks. I was able to register my extensions in Asterisk.
In order to successful voice communication over RTP, I noticed that it is essential to configure ICE for achieving my needs.
And I did the following steps
I have enabled ICE support for both extensions with FreePBX GUI, then configured STUN and TURN on SIP Settings.
And when I testing the stun status with asterisk CLI (using command: stun show status) , I got the following
Hostname Port Period Retries Status ExternAddr ExternPort
global.stun.twilio.com 3478 30 3 OK 123.123.123.123 37254
When I tested by making phone calls between the extensions I got the sip INVITE packets with STUN candidates as given below
But the problem is that I don’t getting any candidates related with TURN. What would be the reason for this?
Do i need to setup any additional configurations?
I can’t speak for the FreePBX GUI but TURN is configured in the rtp.conf file. Disregarding that - is the endpoint you are using capable of ICE? If not then even with the candidates it won’t use ICE.
I don’t know if Zoiper has support for ICE. As well like I said I don’t know how FreePBX configures things, if you provide rtp.conf then it can be seen if TURN is properly configured. Additionally most people don’t need/use ICE for NAT traversal, Asterisk can be configured to support the scenario without it for all endpoints. This is done by configuring Asterisk to know its public IP address and what the local network range is (if it is behind NAT) and also by configuring NAT support itself on the endpoint.
When I use the ICE enabled endpoint extensions, I could see that RTP packets have something related to ICE. But TURN candidates are not present in packet headers.
Sent RTP packet to 123.123.123.123:50821 (via ICE) (type 00, seq 018938, ts 033760, len 000160)
Got RTP packet from 123.123.123.123:50821 (type 00, seq 023113, ts 036000, len 000160)
Sent RTP packet to 123.123.123.123:50821 (via ICE) (type 00, seq 018939, ts 033920, len 000160)
Got RTP packet from 123.123.123.123:50821 (type 00, seq 023114, ts 036160, len 000160)
No, they are both equivalent in that. I don’t know why TURN candidates would not be present and am not set up to quickly test and narrow it down, it would take some time. If you feel it’s a bug you can file an issue[1] but I don’t have a time frame on when it would get looked into. TURN isn’t something many people use in Asterisk.