I am using an Asterisk 13.13.1 server behind a NAT firewall with FreePBX 22.214.171.124 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.
And in RTP configuration file (rtp_custom.conf) I have added STUN and TURN Server Details as follows.
[general] stunaddr=global.stun.twilio.com turnaddr=global.turn.twilio.com turnusername=myturnusername turnpassword=myturnpassword
And in res_stun_monitor.conf file I added following configuration
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 126.96.36.199 37254
When I tested by making phone calls between the extensions I got the sip INVITE packages with only two ice candidates. There is no server reflexive candidate present. The body of request as follows
Content-Length: 527 v=0 o=root 788094571 788094571 IN IP4 188.8.131.52 s=Asterisk PBX 13.13.1 c=IN IP4 184.108.40.206 t=0 0 m=audio 11498 RTP/AVP 0 8 3 101 a=rtpmap:0 PCMU/8000 a=rtpmap:8 PCMA/8000 a=rtpmap:3 GSM/8000 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-16 a=ptime:20 a=maxptime:150 a=ice-ufrag:4c6f2e480272342342341f37d7d37f012a6f a=ice-pwd:07e09ffd290b1e7e2342342348a3451f3452 a=candidate:H22c66e1f 1 UDP 2130706431 10.10.10.10 11498 typ host a=candidate:H22c66e1f 2 UDP 2130706430 10.10.10.10 11499 typ host a=sendrecv
And my question is, How to properly configure ICE in order to get all necessary candidates.?