How to add multiple stun servers to pjsip sip settings

I tried add ing multiple stun servers to the sip settings module but get errors

grep -i stun /var/log/asterisk/full

[root@pbx ~]# grep -i stun /var/log/asterisk/full
[2024-11-16 22:48:56] VERBOSE[31240] loader.c: Loading res_stun_monitor.so.
[2024-11-16 22:48:56] WARNING[31240] res_stun_monitor.c: Unable to load config res_stun_monitor.conf
[2024-11-16 22:48:57] ERROR[31240] loader.c: res_stun_monitor declined to load.
[2024-11-16 22:52:32] WARNING[31297] res_rtp_asterisk.c: Failed to resolve stunaddr 'stun.1und1.de:3478, stun.1und1.de:3478, stun.l.google.com:19302, stun.freemax.de:3478'. Cancelling recurring resolution.
[root@pbx ~]# 
[root@pbx ~]# 
[root@pbx ~]# 
[root@pbx ~]# grep -i stun /var/log/asterisk/full
[2024-11-16 22:48:56] VERBOSE[31240] loader.c: Loading res_stun_monitor.so.
[2024-11-16 22:48:56] WARNING[31240] res_stun_monitor.c: Unable to load config res_stun_monitor.conf
[2024-11-16 22:48:57] ERROR[31240] loader.c: res_stun_monitor declined to load.
[2024-11-16 22:52:32] WARNING[31297] res_rtp_asterisk.c: Failed to resolve stunaddr 'stun.1und1.de:3478, stun.1und1.de:3478, stun.l.google.com:19302, stun.freemax.de:3478'. Cancelling recurring resolution.
[2024-11-16 22:56:32] WARNING[31297] res_rtp_asterisk.c: Failed to resolve stunaddr 'stun.1und1.de:3478 stun.1und1.de:3478 stun.l.google.com:19302 stun.freemax.de:3478'. Cancelling recurring resolution.
[root@pbx ~]# 
[root@pbx ~]#

what is the correct way of doing this.

Multiple STUN servers is not supported in Asterisk.

any work around ?

Your options are to not use a STUN server at all, or to use a single STUN server. There is no code support or functionality for multiple. Note that if possible the usage of a STUN server should be avoided, because it means that your Asterisk is then reliant on an outside service and it can block things.

1 Like

Thanks! Got It.

What about if we use it on the endpoint app.

Iā€™m not sure what you mean by that or the ramifications. STUN is used to discover the public IP address+port. If that is already known by something (like Asterisk) then using it is unnecessary. For the use of ICE, as long as one side is reachable then ICE in most circumstances will work.

1 Like

Thanks!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.