IAX2 Trunking between Asterisk boxes

I’m pulling my hair out on this one…

I’ve got two boxes here, sitting on the same subnet, with static IPs.
I am trying to setup IAX2 trunking between them, and having huge problems.

I’ve made 2-3 successful calls, so I know it’s working, but now all of a sudden it doesn’t work at all.

I’m using Asterisk@Home 0.9 by the way.

Here’s my iax.conf setup
(Server A)

[general]
bindport = 4569 ; Port to bind to (IAX is 4569)
bindaddr = 0.0.0.0 ; Address to bind to (all addresses on machine)
delayreject=yes
disallow=all
allow=ulaw
allow=alaw
allow=gsm
jitterbuffer=yes
mailboxdetail=yes

[to183]
username=to183
type=peer
trunk=yes
secret=to183
host=172.20.16.183
auth=plaintext

[to231]
type=user
secret=to231
context=from-internal
auth=plaintext


(Server B)
[general]
bindport = 4569 ; Port to bind to (IAX is 4569)
bindaddr = 0.0.0.0 ; Address to bind to (all addresses on machine)
delayreject=yes
disallow=all
allow=ulaw
allow=alaw
allow=gsm
jitterbuffer=yes
mailboxdetail=yes
authdebug=yes

[to183]
type=user
secret=to183
context=from-internal
auth=plaintext

[to231]
username=to231
type=peer
trunk=yes
secret=to231
host=172.20.16.231
auth=plaintext

The outbound dialing options:
[outrt-002-routeto183]
include => outrt-002-routeto183-custom ; This is non-existent
exten => _5XXX,1,Macro(dialout-trunk,2,${EXTEN:1})
exten => _5XXX,2,Macro(outisbusy) ; No available circuits

(Basically I’d dial 5 + an extension, and it rings the other server’s corresponding extensions, which is why i used the from-internal context)

Now It worked for about 2 or 3 calls. Then it just “stopped” working.

Looking at the iax2 show debug logs I see:

Tx-Frame Retry[000] -- OSeqno: 000 ISeqno: 000 Type: IAX Subclass: NEW
Timestamp: 00005ms SCall: 16385 DCall: 00000 [172.20.16.183:4569]
VERSION : 2
CALLED NUMBER : 304
CALLING NUMBER : 313
CALLING NAME : test
LANGUAGE : en
USERNAME : to183
FORMAT : 4
CAPABILITY : 63502
ADSICPE : 2
DATE TIME : 177374925

Rx-Frame Retry[ No] -- OSeqno: 000 ISeqno: 001 Type: IAX Subclass: ACK
Timestamp: 00005ms SCall: 00001 DCall: 16385 [172.20.16.183:4569]
Rx-Frame Retry[ No] -- OSeqno: 000 ISeqno: 001 Type: IAX Subclass: AUTHREQ
Timestamp: 00011ms SCall: 16385 DCall: 16385 [172.20.16.183:4569]
AUTHMETHODS : 1
USERNAME : to183

-- Called to183/304
Tx-Frame Retry[000] -- OSeqno: 001 ISeqno: 000 Type: IAX Subclass: LAGRQ
Tx-Frame Retry[000] -- OSeqno: 001 ISeqno: 000 Type: IAX Subclass: LAGRQ
Timestamp: 09985ms SCall: 16385 DCall: 00001 [172.20.16.183:4569]
Tx-Frame Retry[000] -- OSeqno: 001 ISeqno: 000 Type: IAX Subclass: LAGRQ
Timestamp: 09985ms SCall: 16385 DCall: 00001 [172.20.16.183:4569]
Rx-Frame Retry[ No] -- OSeqno: 000 ISeqno: 000 Type: IAX Subclass: INVAL
Tx-Frame Retry[000] -- OSeqno: 001 ISeqno: 000 Type: IAX Subclass: LAGRQ
Timestamp: 09985ms SCall: 16385 DCall: 00001 [172.20.16.183:4569]
Rx-Frame Retry[ No] -- OSeqno: 000 ISeqno: 000 Type: IAX Subclass: INVAL
Timestamp: 00000ms SCall: 00001 DCall: 16385 [172.20.16.183:4569]

Apr 18 16:54:37 DEBUG[1350]: Immediately destroying 16385, having received INVAL
Apr 18 16:54:37 DEBUG[1350]: We're hanging up IAX2/to183/16385 now...
Apr 18 16:54:37 DEBUG[1350]: Really destroying IAX2/to183/16385 now...
Tx-Frame Retry[000] -- OSeqno: 001 ISeqno: 000 Type: IAX Subclass: LAGRQ
Timestamp: 09985ms SCall: 16385 DCall: 00001 [172.20.16.183:4569]
Rx-Frame Retry[ No] -- OSeqno: 000 ISeqno: 000 Type: IAX Subclass: INVAL
Timestamp: 00000ms SCall: 00001 DCall: 16385 [172.20.16.183:4569]
-- Hungup 'IAX2/to183/16385'
Apr 18 16:54:37 VERBOSE[1350]: == No one is available to answer at this time

After this I get the “All circuits are busy now” message.

My thinking is that there’s something up with the authentication somewhere.

I’ve tried using the register command, but that gives me registration refused errors (and neither servers are dynamic anyway).

Anyone have any ideas?

I’ll post more details / configs if you need it.

Solved it,

it’s that delayreject=yes parameter.

I commented it out, and it works again (both directions.)

Why it’s in there I don’t know.