Hi,
I am running Certified Asterisk 13 with chan_sip (pjsip is no option for me at the moment as I am required to use Asterisk 13). I am trying to use STUN or ICE, but it does not work. Reference for the STUN/ICE configuration is the asterisk wiki.
My configuration for STUN:
sip.conf:
icesupport = yes
rtp.conf:
icesupport=yes
stunaddr=stun.sipgate.net
res_stun_monitor.conf is also set up, the module is loaded
In wireshark I can see STUN packets being sent to and answered by the STUN server.
When enabling STUN debug, I see
STUN Packet, msg Binding Response (0101), length: 68
Found STUN Attribute Mapped Address (0001), length 8
Ignoring STUN attribute Mapped Address (0001), length 8
Found STUN Attribute Source Address (0004), length 8
Ignoring STUN attribute Source Address (0004), length 8
Found STUN Attribute Changed Address (0005), length 8
Ignoring STUN attribute Changed Address (0005), length 8
Found STUN Attribute Non-RFC3489 Attribute (8020), length 8
Ignoring STUN attribute Non-RFC3489 Attribute (8020), length 8
Found STUN Attribute Non-RFC3489 Attribute (8022), length 16
Ignoring STUN attribute Non-RFC3489 Attribute (8022), length 16
Dunno what to do with STUN message 0101 (Binding Response)
However, “stun show status” gives a correct external IP, so STUN seems to work nevertheless.
Hostname Port Period Retries Status ExternAddr ExternPort
stun.sipgate.net 3478 30 3 OK <correct external IP> 58499
Now, I would expect the SDP then to contain the external address instead of the private IP my asterisk instance has (being behind a NAT). But there is always the private IP address, never the public IP. Also, the IP in the SIP header only contains the private IP address. The external IP address is never used in any SIP message.
My questions regarding this:
- Should not STUN/ICE make asterisk replace the private address with the public address
(a) in the SIP header
(b) in the SDP header? - The Asterisk Wiki suggests that there should be lines for ice in the SDP. But there are none according to the output I get from sip debug in the asterisk log.
- Main question is: Is there something I am doing wrong? What are my options for further debugging or fixing this?
Thanks,
Marcel