IAX Trunk issue.

I’m testing a few IAX trunk scenarios in a controlled lab. From server2 extension 5000 (Server IP Address 172.16.200.212) I dial 6001 which goes across the IAX trunk to server 1 (IP address 172.16.200.210). Instead of ringing the 6001 phone, it plays tt-weasels (the s extension). When I dial 6099 it also plays tt-weasels as it’s supposed to, but it’s not the tt-weasels under its extension. It also dials the s extension.

I only placed the s extension in the dial plan to verify that the traffic was going across the IAX trunk and hitting the correct context.

Any help would be greatly appreciated.

Thanks Mitch

Asterisk-1

IP Address 172.16.200.210

SIP.CONF

[6001]
type=friend
host=dynamic
context=internal_users
secret=xxxxxxx
nat=yes

[6002]
type=friend
host=dynamic
context=internal_users
secret=xxxxxxx
nat=yes

extensions.conf

[internal_users]
exten => 6000,1,Answer()
exten => 6000,2,Playback(hello-world)
exten => 6000,3,Hangup()
exten => 6001,1,Dial(SIP/6001)
exten => 6002,1,Dial(SIP/6002)
exten => 6099,1,Playback(tt-weasels)
exten => 6099,n,HangUp
exten => _5XXX,1,Dial(${IAXTrunk}/${EXTEN})
same => n,Hangup()
exten => s,1,Answer()
exten => s,n,Playback(tt-weasels)
exten => s,n,Hangup()

IAX.conf

[trunk-1]
type=friend
username=trunk-1
trunk=yes
requiretoken=no
secret=password
host=172.16.200.212
context=internal_users
auth=plaintext
disallow=all
;allow=ulaw
;allow=alaw
allow=gsm

Asterisk-2

IP Address 172.16.200.212

sip.conf

[5000]
type=friend
context=phones
host=dynamic
disallow=all
allow=ulaw
secret=xxxxxxx

extensions.conf

[phones]
exten => _60XX,1,Dial(IAX2/trunk-1)
exten => _X.,1,Dial(IAX2/trunk-1)
exten => 5000,1,Dial(SIP/${EXTEN})
exten => 5000,n,Hangup
same => n,Hangup()
exten => 5099,1,Playback(tt-monkeys)
exten => 5099,n,HangUp

iax.conf

[trunk-1]
type=friend
username=trunk-1
trunk=yes
requiretoken=no
secret=password
host=172.16.200.210
context=phones
auth=plaintext
disallow=all
;allow=ulaw
;allow=alaw
allow=gsm

One Response to “IAX Trunk issue.”

  1. Dale Noll said:

    Jun 25, 12 at 6:44 am

    You are not telling asterisk-1 where you want the call to go, so it is going to ‘s’.

    Try adding the extension to the Dial() command on asterisk-2. Change

    Dial(IAX2/trunk-1)

    to

    Dial(IAX2/trunk-1/${EXTEN})

    Note: It appears that you are doing it correctly from asterisk-1
    towards asterisk-2

    exten => _5XXX,1,Dial(${IAXTrunk}/${EXTEN})

    Assuming, of course, that the variable IAXTrunk is properly set.

    Dale