IAX Trunk sending wrong username after adding IAX Extension

Good evening!

I have a fresh install of asterisk 11.6.0, no DAHDI, no Libpri (It’s on a cloud server, solely used for IAX and/or SIP), on top of Ubuntu 13.10 64-bit. I’m using FreePBX to aid in configuration. I got my IAX2 trunk working (VoipStreet) as well as my desk phone working. Inbound and outbound calls work great. The second I add an IAX2 extension, I can no longer receive inbound calls through the trunk. It rings once, then returns the busy/line-disconnected tone.

I enabled IAX2 debugging and watched while I placed a few calls. With the extension enabled, it appears to try to authenticate against the trunk with my extension number:

[code]Tx-Frame Retry[-01] – OSeqno: 000 ISeqno: 001 Type: IAX Subclass: ACK
Timestamp: 00011ms SCall: 04680 DCall: 05883 [64.136.174.24:4569]
Tx-Frame Retry[000] – OSeqno: 000 ISeqno: 001 Type: IAX Subclass: AUTHREQ
Timestamp: 00011ms SCall: 04680 DCall: 05883 [64.136.174.24:4569]
AUTHMETHODS : 3
CHALLENGE : \x31\x37\x31\x39\x38\x36\x35\x32\x36
USERNAME : 503

Rx-Frame Retry[ No] – OSeqno: 001 ISeqno: 001 Type: IAX Subclass: AUTHREP
Timestamp: 00030ms SCall: 05883 DCall: 04680 [64.136.174.24:4569]
MD5 RESULT : 30234300ab54109ae840a5d3d8ac4b5b

Tx-Frame Retry[-01] – OSeqno: 001 ISeqno: 002 Type: IAX Subclass: ACK
Timestamp: 00030ms SCall: 04680 DCall: 05883 [64.136.174.24:4569]
Tx-Frame Retry[000] – OSeqno: 001 ISeqno: 002 Type: IAX Subclass: REJECT
Timestamp: 01029ms SCall: 04680 DCall: 05883 [64.136.174.24:4569]
CAUSE : No authority found
CAUSE CODE : 50
[/code]

Which will, of course, be denied by VoipStreet. If I delete the extension, I can see the trunk authenticating with the appropriate username:

Tx-Frame Retry[-01] -- OSeqno: 000 ISeqno: 001 Type: IAX     Subclass: ACK
   Timestamp: 00001ms  SCall: 00767  DCall: 03867 [64.136.174.24:4569]
Tx-Frame Retry[000] -- OSeqno: 000 ISeqno: 001 Type: IAX     Subclass: AUTHREQ
   Timestamp: 00002ms  SCall: 00767  DCall: 03867 [64.136.174.24:4569]
   AUTHMETHODS     : 3
   CHALLENGE       : \x31\x35\x30\x31\x31\x36\x35\x39\x34
   USERNAME        : voipstreet

Rx-Frame Retry[ No] -- OSeqno: 001 ISeqno: 001 Type: IAX     Subclass: AUTHREP
   Timestamp: 00020ms  SCall: 03867  DCall: 00767 [64.136.174.24:4569]
   MD5 RESULT      : 47aa8e387330075a325572c925c0700e

Tx-Frame Retry[-01] -- OSeqno: 001 ISeqno: 002 Type: IAX     Subclass: ACK
   Timestamp: 00020ms  SCall: 00767  DCall: 03867 [64.136.174.24:4569]
Tx-Frame Retry[000] -- OSeqno: 001 ISeqno: 002 Type: IAX     Subclass: ACCEPT
   Timestamp: 00020ms  SCall: 00767  DCall: 03867 [64.136.174.24:4569]
   FORMAT          : 4
   FORMAT2         : ulaw

I have included my iax conf file:

[503]
deny=0.0.0.0/0.0.0.0
secret=android503
transfer=yes
context=from-internal
host=dynamic
type=friend
port=4569
qualify=yes
dial=IAX2/503
mailbox=503@device
permit=0.0.0.0/0.0.0.0
requirecalltoken=yes
callerid=Test Cell IAX <503>
setvar=REALCALLERIDNUM=503

[voipstreet]
disallow=all
allow=ulaw
host=chi-out.voipstreet.com
secret=[DELETED]
type=friend
username=ntomsheck-[DELETED]
context=from-trunk

[voipstreet_in]
disallow=all
allow=ulaw
context=from-trunk
host=chi-in.voipstreet.com
secret=[DELETED]
type=friend
user=ntomsheck-[DELETED]
username=ntomsheck-[DELETED]

My knowledge of asterisk is quite low, but I’m handy with the shell and networks, so I’m open to any suggestions you may have! Thanks for reading!

So just to eliminate variables, I spun up a ubuntu 12.04 server and installed asterisk 11.6 on that. After reconfiguring everything (I’m getting quite fast at this :smiley: ), I was able to place and receive calls. Once I added that IAX extension, the same exact issue came up again. As one final check, I upgraded to the asterisk 11.7 RC1. Again, same issue.