[asterisk-bugs] [JIRA] (ASTERISK-23767) Dynamic IAX2 registration stops trying if ever not able to resolve
David Herselman (JIRA)
noreply at issues.asterisk.org
Thu May 29 02:07:43 CDT 2014
[ https://issues.asterisk.org/jira/browse/ASTERISK-23767?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=218582#comment-218582 ]
David Herselman commented on ASTERISK-23767:
--------------------------------------------
We manage our Asterisk installations by installing and using the FreePBX GUI. FreePBX generates various iax configuration files which are pulled in by iax.conf so I've combined the switches and options in the exact order Asterisk's IAX module essentially sees them:
/etc/asterisk/iax.conf:
{noformat}
[general]
mailboxdetail=yes
tos=ef
disallow=all
allow=ulaw
allow=alaw
allow=gsm
calltokenoptional=10.0.0.0/255.0.0.0
calltokenoptional=172.16.0.0/255.240.0.0
calltokenoptional=192.168.0.0/255.255.0.0
register=Alpha:*******@sip.crffac.golden-era.co.za
allow=adpcm
allow=g729
allow=g723
allow=g722
allow=gsm
allow=slin
allow=speex
allow=lpc10
allow=ilbc
allow=g726aal2
allow=g726
allow=h261
allow=h263
allow=h263p
allow=h264
videosupport=yes
tcpenable=yes
[guest]
disallow=ulaw,alaw,adpcm
type=user
context=from-trunk
[Omega]
disallow=all
host=dynamic
username=Alpha
secret=************
requirecalltoken=yes
qualify=yes
allow=g729
trunk=yes
trunktimestamps=yes
jitterbuffer=yes
transfer=no
type=friend
context=from-internal
{noformat}
/etc/asterisk/dnsmgr.conf:
{noformat}
[general]
{noformat}
We are not using Asterisk's dnsmgr module, as it correclty switches the IP from 0.0.0.0 to whatever it should be but doesn't restore the port from 0 (when unavailable) to 4569 (when available). The dnsmgr issue is, as such, a separate issue from the one reported here.
To reproduce:
1. Create a DNS record with a short (eg 60 second) TTL (or simply reference sip.crffac.golden-era.co.za).
2. Don't bother configuring a trunk, the issue affects Asterisk's ability to perform a remote registration so simply add the following to /etc/asterisk/iax.conf (yes, use it 'as is' with the 'InvalidUser' and 'InvalidPassword'):
{noformat}
register=InvalidUser:InvalidPassword at sip.crffac.golden-era.co.za
{noformat}
3. Issue 'iax2 reload' to have Asterisk reload the configuration file and verify that Asterisk is attempting the registration with the 'iax2 show registry' command:
{noformat}
sip*CLI> iax2 show registry
Host dnsmgr Username Perceived Refresh State
165.145.108.250:4569 N InvalidUse <Unregistered> 60 Request Sent
1 IAX2 registrations.
{noformat}
4. Break your DNS resolution and wait about 2 minutes for the DNS record to expire and for Asterisk to retry the registration. Perhaps simply load a firewall rule to drop outgoing DNS requests:
{noformat}
iptables -I OUTPUT -p udp --dport 53 -j DROP
{noformat}
5. Review the Asterisk registration configuration:
{noformat}
sip*CLI> module unload chan_iax2
Unloaded chan_iax2
sip*CLI> module load chan_iax2
Loaded chan_iax2
[2014-05-29 08:59:42] ERROR[26485]: netsock2.c:269 ast_sockaddr_resolve: getaddrinfo("sip.crffac.golden-era.co.za", "(null)", ...): Temporary failure in name resolution
[2014-05-29 08:59:42] WARNING[26485]: acl.c:833 resolve_first: Unable to lookup 'sip.crffac.golden-era.co.za'
sip*CLI> iax2 show registry
Host dnsmgr Username Perceived Refresh State
(null) N InvalidUse <Unregistered> 60 Unregistered
4 IAX2 registrations.
{noformat}
6. Restore DNS resolution:
{noformat}
[root at sip ~]# iptables -D OUTPUT -p udp --dport 53 -j DROP
[root at sip ~]# host sip.crffac.golden-era.co.za
sip.crffac.golden-era.co.za is an alias for dynamic2.crffac.golden-era.co.za.
dynamic2.crffac.golden-era.co.za has address 165.145.108.250
{noformat}
7. Asterisk never retries registration:
{noformat}
sip*CLI> iax2 show registry
Host dnsmgr Username Perceived Refresh State
(null) N InvalidUse <Unregistered> 60 Unregistered
1 IAX2 registrations.
{noformat}
> Dynamic IAX2 registration stops trying if ever not able to resolve
> ------------------------------------------------------------------
>
> Key: ASTERISK-23767
> URL: https://issues.asterisk.org/jira/browse/ASTERISK-23767
> Project: Asterisk
> Issue Type: Bug
> Security Level: None
> Components: Channels/chan_iax2
> Affects Versions: 11.9.0
> Environment: IAX2 registration to dynamic hostname
> Reporter: David Herselman
> Assignee: David Herselman
>
> Upgraded Asterisk from 10.7.1 to 11.9.0 on 55 hosts and are now experiencing an issue relating to IAX2 registrations, when the remote host is utilising a dynamic hostname.
> Alpha and Omega register with each other using IAX2 trunks. Both sides are set as 'host=dynamic' and rely on registrations to ascertain the remote point's IP address. This has been extremely reliable prior to our upgrade to 11.9.0.
>
>
> Problem: If DNS resolution is ever unavailable (Telco here kicks ADSL sessions off after 24 hours so that they reconnect) the registration gets set with a '(null)' host address and never retries the registration. Issuing a 'iax2 reload' doesn't help either, only completely unloading and reloading the chan_iax2 module works.
>
> Alpha has the following iax registration:
> {noformat}
> register=Alpha:*******@sip.crffac.golden-era.co.za{noformat}
>
>
> Alpha shows the host for the registration as being '(null)' although DNS resolution is currently operational (interruption was 6+ hours ago):
> {noformat}
> alpha*CLI> iax2 show registry
> Host dnsmgr Username Perceived Refresh State
> (null) N Alpha <Unregistered> 60 Unregistered
> 1 IAX2 registrations.
> alpha*CLI> iax2 show peers
> Name/Username Host Mask Port Status Description
> Omega/Alpha 165.145.109.36 (D) 255.255.255.255 4569 (T) OK (27 ms)
> 1 iax2 peers [1 online, 0 offline, 0 unmonitored]
> {noformat}
> Omega correctly shows the Alpha peer as being unavailable, as it hasn't registered:
> {noformat}
> omega*CLI> iax2 show registry
> Host dnsmgr Username Perceived Refresh State
> 196.15.196.130:4569 N Omega 165.145.109.36:4569 60 Registered
> 1 IAX2 registrations.
> omega*CLI> iax2 show peers
> Name/Username Host Mask Port Status Description
> Alpha/Omega (null) (D) 255.255.255.255 0 (T) UNKNOWN
> 1 iax2 peers [0 online, 1 offline, 0 unmonitored]
> {noformat}
>
>
> Issuing a 'reload iax2' does absolutely nothing, only completely unloading the chan_iax2 module and reloading it restores operation:
> {noformat}
> alpha*CLI> module unload chan_iax2.so
> Unloaded chan_iax2.so
> alpha*CLI> module load chan_iax2.so
> Loaded chan_iax2.so
> alpha*CLI> iax2 show registry
> Host dnsmgr Username Perceived Refresh State
> 165.145.109.36:4569 N Alpha 196.15.196.130:4569 60 Registered
> 1 IAX2 registrations.
> omega*CLI> iax2 show peers
> Name/Username Host Mask Port Status Description
> Alpha/Omega 196.15.196.130 (D) 255.255.255.255 4569 (T) OK (27 ms)
> 1 iax2 peers [1 online, 0 offline, 0 unmonitored]
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.2#6252)
More information about the asterisk-bugs
mailing list