IAX bug when sending calls to external service provider

So here a weird issue, I expect that it is an Asterisk bug but maybe there’s something I’m missing. I’m attempting to send autopatch calls to voip.ms and would like to use IAX vs. SIP since I am behind a firewall that causes issues with SIP RTP, making IAX preferable (if I can get it to work.) I can register/authenticate with the service provider with no problem and call setup seems to be correct, but the call attempt is rejected with a ‘No such context/extension’ error even though the call format is correct. I tore my hair out over this for a while and then finally found the problem in an IAX debug trace, and that is for some reason Asterisk seems to be populating the USERNAME field with the called number, and the CALLED NUMBER field simply contains an ‘s’ character (which explains the call failure since this obviously does not fit the service provider’s expected dialplan.)

I have included pertinent config and call trace info below. Has anyone else ever run into this bug? Nothing I can think of is able to remedy it. I will open a ticket with voip.ms but I’m sure that they will inform me that the problem is on my end, which I already know. I have searched for similar issues on the Internet and I see a few mentions of this sort of problem, but no resolution. Thought it was at least worth a try to ask here in case anyone else has run into this.

Thanks -

Call result:

-- Executing [4086342850@voipms:1] Dial("DAHDI/pseudo-1540264133", "IAX2/14086551234@voipms") in new stack
WARNING[18045]: chan_iax2.c:9366 socket_process: Call rejected by 75.127.65.130: No such context/extension

IAX trace:

-- Called 14086342850@voipms
   CALLED NUMBER   : s                          <------- wrong
   CODEC_PREFS     : (ulaw)
   CALLING NUMBER  :
   CALLING PRESNTN : 0
   CALLING TYPEOFN : 0
   CALLING TRANSIT : 0
   CALLING NAME    :
   LANGUAGE        : en
   USERNAME        : 14086551234           <--------- incorrect field placement
   FORMAT          : 4                                (this is the called number)
   CAPABILITY      : 49156
   ADSICPE         : 2
   DATE TIME       : 2098-01-01  17:01:32


iax.conf config: (as recommended by voip.ms)

[voipms]
type=friend
username=12345_503630
secret=axxxxxxxxxb
context=voipms
host=atlanta1.voip.ms
disallow=all
allow=ulaw
; allow=g729
insecure=port,invite
requirecalltoken=no

IAX2 thru voip.ms certainly works, I use it now. I doubt the issue is at their end.

I guess the [voipms] stanza “username=” parameter in iax.conf is set correctly? What about the in-bound and out-bound extensions.conf stanzas?

Thanks, good to know that it is known working.

There does not seem to be any authentication problem and username and secret is correct (masked in my example, but correct in the file.) My iax.conf config is above, and I am including my extensions.conf config below. Does anything in either differ materially from your working configuration?

[voipms]
;include => voipms-inbound
include => voipms-outbound

;[voipms-inbound]
;exten => _X.,1,Ringing
;exten => _X.,n,Answer()
;exten => _X.,n,Rpt(503630|Rrpt/node:NODE:rpt/in-call:digits/0:PARKED|120) 75
;exten => _X.,n,Hangup

[voipms-outbound]
exten => _1NXXNXXXXXX,1,Dial(IAX2/${EXTEN}@voipms)
exten => _1NXXNXXXXXX,n,Hangup()
exten => _NXXNXXXXXX,1,Dial(IAX2/1${EXTEN}@voipms)
exten => _NXXNXXXXXX,n,Hangup()
exten => _011.,1,Dial(IAX2/${EXTEN}@voipms)
exten => _011.,n,Hangup()
exten => _00.,1,Dial(IAX2/${EXTEN}@voipms)
exten => _00.,n,Hangup()

When Jim was around we had a buddy phone network. One example:

iax.conf

[timnorth]
type=friend
host=dynamic
auth=md5
context=timnorth
secret=rxxxxxxxxxx
transfer=no
disallow=all
allow=ulaw

extensions.conf Note the Dial() syntax is different than you show. Maybe that will help.

; Outbound to Chris
exten => _5XX,1,Set(CALLERID(num)=600)
exten => _5XX,n,Set(CALLERID(name)="Tim Sawyer WD6AWP")
exten => _5XX,n,Dial(IAX2/timnorth@timnorth/${EXTEN})
exten => _5XX,n,Congestion

I’m pretty sure that the dial pattern is correct and as voip.ms wants it, I’m just not sure why the IAX header is screwed up and has incorrect data in the username and called number fields. I did find some info suggesting that this was fixed in later versions of Asterisk (1.4 as used in the Allstar fork is kind of long in the tooth), and FWIW I tried this with both the ASL and HamVoip flavors but the problem is identical with both.

But David’s experience would indicate that it can work, so that is hopeful. David, can you post your relevant iax.conf and extensions.conf sections? A known working viop.ms config would sure help!

I don’t know but I think that’s a pretty big hint the Dial() format is wrong. What you show looks like SIP Dial() format.

Oh darn you, I tried your format and it worked first time :wink: A bit of checking revealed that you are exactly correct, I had somehow substituted the SIP format for IAX. Thanks for straightening me out.

1 Like