IAX trunks not working as expected

I am trying to get one system to be able to dial external numbers from another system. I had this working at one point and rebuilt my demo system and upgraded to 2.5 of FreePBX. Since then I have not been able to make this work again.

The following is my configuration of the two IAX trunks. I can call extensions on each system without any problems. Also, before the change I was able to add extensions on System 2 to a ring group on System 1. That no longer works either.

System 1 is behind a router with all the appropriate ports open.

Any ideas?

System 1:

Trunk name: IAX-System2
host=10.0.0.8
deny=all
allow=alaw&ulaw
type=peer
qualify=yes
context=from-internal

System 2:

Trunk name: IAX-System1

deny=all
allow=alaw&ulaw
type=peer
host=10.0.0.2
qualify=yes
context=from-internal

The easiest way to do this is with dundi. You have to advertise your outbound routes to the other system. If you go to this link http://cohutta.com/Dundi_How_to.pdf there is an excellent tutorial to get you started. If you follow it exactly, you will be able to call each others extensions, dial out of each others systems and use ring groups, queues etc.

Once you set up your dundi stuff if you run into problems just shout.

Rob

I followed the document and it was worst. It took over 30 seconds to connect to extensions on each system and still could not reach external numbers.

I went back to a simple IAX trunk which should work. I have tried several configurations and did a bit of debugging.

Debug output from system 2:
[Dec 9 16:04:13] VERBOSE[6455] logger.c: VERSION : 2
[Dec 9 16:04:13] VERBOSE[6455] logger.c: CALLED NUMBER : xxxxxxxxxx
[Dec 9 16:04:13] VERBOSE[6455] logger.c: CODEC_PREFS : (ulaw|gsm|alaw)
[Dec 9 16:04:13] VERBOSE[6455] logger.c: CALLING NUMBER : 7000
[Dec 9 16:04:13] VERBOSE[6455] logger.c: CALLING PRESNTN : 0
[Dec 9 16:04:13] VERBOSE[6455] logger.c: CALLING TYPEOFN : 0
[Dec 9 16:04:13] VERBOSE[6455] logger.c: CALLING TRANSIT : 0
[Dec 9 16:04:13] VERBOSE[6455] logger.c: CALLING NAME : Operator
[Dec 9 16:04:13] VERBOSE[6455] logger.c: LANGUAGE : en
[Dec 9 16:04:13] VERBOSE[6455] logger.c: FORMAT : 4
[Dec 9 16:04:13] VERBOSE[6455] logger.c: CAPABILITY : 57358
[Dec 9 16:04:13] VERBOSE[6455] logger.c: ADSICPE : 2
[Dec 9 16:04:13] VERBOSE[6455] logger.c: DATE TIME : 2008-12-09 16:04:12
[Dec 9 16:04:13] VERBOSE[6455] logger.c:
[Dec 9 16:04:13] VERBOSE[6448] logger.c: Rx-Frame Retry[ No] – OSeqno: 000 ISeqno: 001 Type: IAX Subclass: REJECT
[Dec 9 16:04:13] VERBOSE[6448] logger.c: Timestamp: 00007ms SCall: 13924 DCall: 16384 [10.0.0.8:4569]
[Dec 9 16:04:13] VERBOSE[6448] logger.c: CAUSE : No such context/extension
[Dec 9 16:04:13] VERBOSE[6448] logger.c: CAUSE CODE : 3
[Dec 9 16:04:13] VERBOSE[6448] logger.c:
[Dec 9 16:04:13] WARNING[6448] chan_iax2.c: Call rejected by 10.0.0.8: No such context/extension

Error message on System 1
[Dec 9 16:04:13] NOTICE[20963] chan_iax2.c: Rejected connect attempt from 10.0.0.2, request ‘xxxxxxxxxx@default’ does not exist

Just for testing purposes only I place an include from-internal statement in the default context and was able to make calls. I was told from an asterisk developer that this is because a peer connection will use default context for unauthenticated connections.

So I added the following to each configuration:

System 2:

username=1004
secret=1234

Reg String: 1004:[email protected]

Ststem 1:

username=7001
secret=1234

Reg String: 7001:[email protected]

This time I received a No Authority error on system 2 and the following error on system 1.

Rejected connect attempt from 10.0.0.2, who was trying to reach ‘8004664411@’

As you can see there is no context being identified in the connection attempt. I am not sure but this looks like a bug. Any ideas?

Invert the registration strings between the two machines and it should work. The way you described the system it is registering with itself.

I did not think they were inverted but I gave it a try and here is the error I received.

System 1:

USERNAME : 1004
REFRESH : 60

No registration for peer ‘1004’ (from 10.0.0.8)
Registration Refused

Ext 1004 is on System 1 10.0.0.8 so the inverted way is self registering.