ALERT Beware STUN Server Setting! - Can cause incoming SIP trunk calls to fail.

jerrm

Guru
Joined
Sep 23, 2015
Messages
838
Reaction score
405
Be careful of what you put in Settings->SIP Settings->Stun Server Address. An unresponsive STUN Server can cause incoming calls from standard, registered SIP trunks to fail.

This may be old news to some, but caused me grief this week.

Had a site experimenting with UCP/WebRTC support.

Performance had been solid for months, but we started getting incoming call "hangups" and CHANUNAVAIL alerts from Vitelity. At first very sporadically and infrequently, but really bad the past week or so. Testing showed the same behavior with other providers as well.

Turns out the STUN server from whatever source I was referencing when setting WebRTC up started failing and timing out. Asterisk was retrying STUN four times during call setup. By the time asterisk gave up and continued, the provider had failed the call.

Moral of the story - if non-blank, the STUN Server setting is critical even for registered trunks, even if it isn't really needed for a particular call. If set, make sure it is a 100% uptime server with fast response. I personally will not use the setting again without a separate job running to monitor status and responsiveness of the server.
 
Last edited:

jerrm

Guru
Joined
Sep 23, 2015
Messages
838
Reaction score
405
Even about half of the first list in that thread is bad.

I'm just surprised there was so little log feedback. Asterisk needs to fail/fall back sooner, probably after two tries would be OK.

If I really need a stun server, I'll point it to a hosts file defined name with a cron job to test a set of servers and update the hosts file as necessary.

Combined a couple of lists from the above thread and tested this morning. The results are attached.

The top 20 response times:
Code:
01.0296 | UP   | stun.ipcomms.net               | Primary: Independent Mapping, Independent Filter, preserves ports, no hairpin 
01.0528 | UP   | stun1.l.google.com:19302       | Primary: Independent Mapping, Independent Filter, preserves ports, no hairpin 
01.1084 | UP   | stun.rounds.com                | Primary: Independent Mapping, Independent Filter, preserves ports, no hairpin 
01.1097 | UP   | stun.l.google.com:19302        | Primary: Independent Mapping, Independent Filter, preserves ports, no hairpin 
01.1106 | UP   | numb.viagenie.ca               | Primary: Independent Mapping, Independent Filter, preserves ports, no hairpin 
01.1388 | UP   | stun.voip.blackberry.com       | Primary: Independent Mapping, Independent Filter, preserves ports, no hairpin 
01.1618 | UP   | stun2.l.google.com:19302       | Primary: Independent Mapping, Independent Filter, preserves ports, no hairpin 
01.1647 | UP   | 23.21.150.121                  | Primary: Indepndent Mapping, Port Dependent Filter, preserves ports, no hairpin 
01.1752 | UP   | stun.stunprotocol.org          | Primary: Indepndent Mapping, Port Dependent Filter, preserves ports, no hairpin 
01.1788 | UP   | stun.comfi.com                 | Primary: Indepndent Mapping, Port Dependent Filter, preserves ports, no hairpin 
01.1849 | UP   | stun.epygi.com                 | Primary: Indepndent Mapping, Port Dependent Filter, preserves ports, no hairpin 
01.1897 | UP   | stun.usfamily.net              | Primary: Indepndent Mapping, Port Dependent Filter, preserves ports, no hairpin 
01.1900 | UP   | stun.callwithus.com            | Primary: Indepndent Mapping, Port Dependent Filter, preserves ports, no hairpin 
01.1902 | UP   | stun.ideasip.com               | Primary: Indepndent Mapping, Port Dependent Filter, preserves ports, no hairpin 
01.1932 | UP   | stun.counterpath.com           | Primary: Indepndent Mapping, Port Dependent Filter, preserves ports, no hairpin 
01.2004 | UP   | stun.b2b2c.ca                  | Primary: Indepndent Mapping, Port Dependent Filter, preserves ports, no hairpin 
01.2012 | UP   | stun.vivox.com                 | Primary: Indepndent Mapping, Port Dependent Filter, preserves ports, no hairpin 
01.2161 | UP   | stun.3clogic.com               | Primary: Indepndent Mapping, Port Dependent Filter, preserves ports, no hairpin 
01.2166 | UP   | stun.whoi.edu                  | Primary: Indepndent Mapping, Port Dependent Filter, preserves ports, no hairpin 
01.2170 | UP   | stun.sippeer.dk                | Primary: Independent Mapping, Independent Filter, preserves ports, no hairpin
 

Attachments

  • STUN Server Test Results.txt
    31.4 KB · Views: 9
Last edited:

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
IIRC: I think you need a stun server with PJsip extensions and trunks.
 

jerrm

Guru
Joined
Sep 23, 2015
Messages
838
Reaction score
405
IIRC: I think you need a stun server with PJsip extensions and trunks.
Not extensions, at least not in our scenarios. We have multiple users using the multiple endpoints(home/office/zoiper) with a single pjsip extension. Home and zoiper are across nat with no stun and no issues.

I don't use pjsip for trunks, so can't comment.
 
Last edited:

Members online

No members online now.

Forum statistics

Threads
25,782
Messages
167,509
Members
19,202
Latest member
pbxnewguy
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top