Asterisk 1.8 IAX Registration

Home » Asterisk Users » Asterisk 1.8 IAX Registration
Asterisk Users 14 Comments

Hi,

Have just been testing asterisk 1.8.0, 1.8.0-rc5 and a trunk version from about half an hour ago.

IAX Friends (Zoiper Softphones) don’t stay registered for more than a few seconds they start out with status unknown and quickly become unreachable, I am using realtime with postgresql, with tables and configuration that have worked fine for IAX in 1.6 and a trunk release from a few months ago.
I have not tested any other IAX clients other than Zoiper Softphones.
Operating system is Ubuntu 9.10, with the default kernel recompiled for AMD CPUs and a couple of other small changes.
I get the following errors on the console after a registration followed by unregistration of the zoiper client:
[Oct 23 15:22:50] ERROR[695]: chan_iax2.c:11917 iax2_poke_peer: Bad address cast to IPv4
[Oct 23 15:22:50] ERROR[695]: chan_iax2.c:1742 iax2_getpeername: Bad address cast to IPv4
[Oct 23 15:22:50] ERROR[695]: chan_iax2.c:8770 update_registry: Bad address cast to IPv4
[Oct 23 15:22:53] ERROR[702]: chan_iax2.c:1742 iax2_getpeername: Bad address cast to IPv4
[Oct 23 15:22:53] ERROR[703]: chan_iax2.c:1742 iax2_getpeername: Bad address cast to IPv4
[Oct 23 15:22:53] ERROR[694]: chan_iax2.c:1742 iax2_getpeername: Bad address cast to IPv4
[Oct 23 15:22:53] NOTICE[702]: chan_iax2.c:8618 reg_source_db: IAX/Registry astdb host:port invalid – ‘192.168.1.111:4569’
[Oct 23 15:22:53] ERROR[693]: netsock2.c:94 ast_sockaddr_stringify_fmt: getnameinfo(): ai_family not supported
[Oct 23 15:22:53] NOTICE[703]: chan_iax2.c:8618 reg_source_db: IAX/Registry astdb host:port invalid – ‘192.168.1.111:4569’
[Oct 23 15:22:53] NOTICE[694]: chan_iax2.c:8618 reg_source_db: IAX/Registry astdb host:port invalid – ‘192.168.1.111:4569’
[Oct 23 15:22:53] ERROR[695]: netsock2.c:94 ast_sockaddr_stringify_fmt: getnameinfo(): ai_family not supported
[Oct 23 15:22:53] ERROR[695]: chan_iax2.c:2305 peercnt_modify: Bad address cast to IPv4

Is this a configuration issue or something in asterisk?

Thanks in advnace.
Nic Colledge

14 thoughts on - Asterisk 1.8 IAX Registration

  • Sorry forgot to add this into my initial email.

    The same happens with phones configured in iax.conf and the Realtime database table.

    [Oct 23 16:49:52] ERROR[1220]: chan_iax2.c:8770 update_registry: Bad address cast to IPv4 etc.

    Nic.

    href=”mailto:asterisk-users-bounces@lists.digium.com”>asterisk-users-bounces@lists.digium.com [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of Olivier
    Sent: 23 October 2010 16:07

    What happens without using Realtime ?

  • On Sat, Oct 23, 2010 at 3:03 PM, Paul Belanger wrote:
    Ok, think I fixed it. You can either apply this patch to 1.8.0, or
    svn update the branch I’m working on. Feedback is welcome.

  • Paul,
    Thanks for your reply, I saw that issue on the tracker when I was trying to find a solution earlier but it looked completely different so I didn’t give it much thought.
    This happens on my install with both Realtime phones and those configured in iax.conf
    I have just tried the branch you suggested and the problem remains. It’s worse with qualify=yes but still happens (albeit less frequently) with qualify=no.

    My iax.conf general section:
    [general]
    bindport=4569
    bindaddr=0.0.0.0
    srvlookup=yes
    jitterbuffer=no
    forcejitterbuffer=no
    context=default
    rtcachefriends=yes
    rtautoclear=yes

    A typicall iax.conf user:
    [111]
    type=friend
    auth=md5
    host=dynamic
    context=internal
    mailbox=111
    accountcode=IAX/111
    disallow=all
    allow=ulaw
    allow=alaw
    allow=g729
    requirecalltoken=auto
    qualify=yes
    secret=secret111

    Thanks again,
    Nic.

  • Paul,
    I applied your patch to 1.8.0 and I’m happy to report it has fixed the problem I was experiencing.
    Thanks again.
    Nic.

  • Paul,
    Further to my last, I think I found another small related issue with IAX which is generating the following error:
    [Oct 24 14:42:12] ERROR[15589]: netsock2.c:94 ast_sockaddr_stringify_fmt: getnameinfo(): ai_family not supported
    To reproduce this issue, setup a phone in iax.conf or your realtime table, goto Zoiper press register in the Preferences / IAX Account.
    The phone will register correctly when your patch is applied.
    Then press unregister in Zoiper.
    On my realtime peers the error then shows up on the console, but for my static iax.conf peers it does not.
    If you then do a “iax2 show peers” on the console, the error is displayed. Notice that the value for “Host” in the command output is a empty string (example below).
    Name/Username Host Mask Port Status
    111 (D) 255.255.255.255 0 Unmonitored

    Initially (for static iax.conf peers) before registration this value is null and does not cause the error to be displayed on a “iax2 show peers” command (example below). So I’m guessing that somewhere on un-registration this is set to “” when it should be set to null.
    Name/Username Host Mask Port Status
    111 (null) (D) 255.255.255.255 0 Unmonitored

    Thanks,
    Nic.

  • Paul,
    I made a debug log of the register and unregister process for a single Zoiper client using IAX and have emailed it direct to you.
    The error shows in the file as:
    [Oct 24 19:07:32] ERROR[1403] netsock2.c: getnameinfo(): ai_family not supported

    Thanks,
    Nic.