[Home]

Summary:ASTERISK-21856: STUN never works when asterisk started without internet access
Reporter:Jeremy Kister (jkister)Labels:
Date Opened:2013-06-03 10:53:22Date Closed:2017-04-19 16:18:12
Priority:MinorRegression?
Status:Closed/CompleteComponents:Resources/res_stun_monitor
Versions:11.4.0 Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:If asterisk is started when it has no access to Internet/DNS, STUN will never come online even when internet access is restored.  An asterisk stop/start fixed the problem.
Comments:By: Jeremy Kister (jkister) 2013-06-03 10:54:38.096-0500

{noformat}
pbx1*CLI> stun show status
Hostname                  Port  Period  Retries  Status  ExternAddr       ExternPort
(null)                    0     90      3        INIT    0.0.0.0          0
pbx1*CLI> module reload res_stun_monitor.so
   -- Reloading module 'res_stun_monitor.so' (STUN Network Monitor)
pbx1*CLI> stun show status
Hostname                  Port  Period  Retries  Status  ExternAddr       ExternPort
(null)                    0     90      3        INIT    0.0.0.0          0
{noformat}

By: Matt Jordan (mjordan) 2013-06-03 10:56:57.607-0500

This probably occurred because the configuration of {{res_stun_monitor}} wasn't changed.

If you touch the configuration file for the module, does the reload restart monitoring?

By: Jeremy Kister (jkister) 2013-06-03 11:08:00.326-0500

you were right- touching {{res_stun_monitor}} before 'module reload res_stun_monitor.so' does make asterisk get back in the groove.


I'd expect this behavior to be more automatic, like SIP:
{noformat}
[Jun  3 12:02:44] NOTICE[20313]: chan_sip.c:29125 sip_poke_noanswer: Peer 's4' is now UNREACHABLE!  Last qualify: 0
[Jun  3 12:02:44] NOTICE[20313]: chan_sip.c:29125 sip_poke_noanswer: Peer 's2' is now UNREACHABLE!  Last qualify: 0
[Jun  3 12:02:44] NOTICE[20313]: chan_sip.c:29125 sip_poke_noanswer: Peer 's3' is now UNREACHABLE!  Last qualify: 0
[Jun  3 12:02:44] NOTICE[20313]: chan_sip.c:29125 sip_poke_noanswer: Peer 's1' is now UNREACHABLE!  Last qualify: 0
{noformat}

fix internet here

{noformat}
[Jun  3 12:03:08] NOTICE[20313]: chan_sip.c:23248 handle_response_peerpoke: Peer 's4' is now Reachable. (11ms / 2000ms)
[Jun  3 12:03:08] NOTICE[20313]: chan_sip.c:23248 handle_response_peerpoke: Peer 's2' is now Reachable. (12ms / 2000ms)
[Jun  3 12:03:08] NOTICE[20313]: chan_sip.c:23248 handle_response_peerpoke: Peer 's3' is now Reachable. (15ms / 2000ms)
[Jun  3 12:03:08] NOTICE[20313]: chan_sip.c:23248 handle_response_peerpoke: Peer 's1' is now Reachable. (17ms / 2000ms)
{noformat}

If i shouldn't expect that, surely safe to close this issue.

By: Rusty Newton (rnewton) 2013-06-05 14:20:24.478-0500

@Jeremy, it's unexpected behavior. It's either an oversight or a straight out bug. It should start working once connectivity resumes or defer loading. I'd presume that you didn't notice res_stun_monitor.so spitting out any DEBUG or other messages while it's not working? If it is please attach a log(set debug to 5 at least).

By: Jeremy Kister (jkister) 2013-06-07 17:41:24.002-0500

starting asterisk without a default gateway shows:
{noformat}
[Jun  7 18:29:39] VERBOSE[24700] config.c:   == Parsing '/etc/asterisk/res_stun_monitor.conf': Found
[Jun  7 18:29:39] ERROR[24700] netsock2.c: getaddrinfo("stun.voipbuster.com", "(null)", ...): Temporary failure in name resolution
[Jun  7 18:29:39] WARNING[24700] acl.c: Unable to lookup 'stun.voipbuster.com'
[Jun  7 18:29:39] WARNING[24700] res_stun_monitor.c: Unable to lookup STUN server 'stun.voipbuster.com'
[Jun  7 18:29:39] WARNING[24700] res_stun_monitor.c: Invalid STUN server address: stun.voipbuster.com at line 21
[Jun  7 18:29:39] VERBOSE[24700] loader.c:  res_stun_monitor.so => (STUN Network Monitor)
{noformat}

By: Friendly Automation (friendly-automation) 2017-04-19 16:18:13.283-0500

Change 5488 merged by George Joseph:
res_stun_monitor: Don't fail to load if DNS resolution fails

[https://gerrit.asterisk.org/5488|https://gerrit.asterisk.org/5488]

By: Friendly Automation (friendly-automation) 2017-04-20 07:20:39.453-0500

Change 5487 merged by George Joseph:
res_stun_monitor: Don't fail to load if DNS resolution fails

[https://gerrit.asterisk.org/5487|https://gerrit.asterisk.org/5487]

By: Friendly Automation (friendly-automation) 2017-04-20 07:21:05.637-0500

Change 5489 merged by George Joseph:
res_stun_monitor: Don't fail to load if DNS resolution fails

[https://gerrit.asterisk.org/5489|https://gerrit.asterisk.org/5489]