AsteriskNow to AsteriskNow IAX fails for outbound calls

Hi,
I’ve followed the excellent http://www.voip4d.org/wiki/images/e/e2/VoIP4D_Laboratory_Tutorial_AsteriskNOW.pdf
guide step by step and the plan is to have two pbxs with sip softphones on each talking to each other

Basically I get “user not found” on my Ekiga softphone when dialling to the other PBX’s extension, unless I move the relevant outgoing dial string from context numberplan-custom-1 to the default context.
In short the sequence I’ve followed is :-

  • install from cd
  • add local user extension - 68414
  • add trunk user extension - 46464
  • add service provider -> custom iax -> remote pbx ip-> user/pass 46464
  • add outgoing call rule -> numbers 88 followed by 3 digits use previously specified trunk_provider

from extn 68414 I dial remote user 88714 and the message in Ekgia is user not found
If I then copy in these 2 lines to default context the call works:-

exten = _88XXX,1,Macro(trunkdial,${trunk_1}/${EXTEN:0}) comment = _88XXX,1,InterIAXAus,standard

extensions.conf

[code][general]
static = yes
writeprotect = no
clearglobalvars = no
[globals]
CONSOLE = Console/dsp ; Console interface for demo
IAXINFO = guest ; IAXtel username/password
TRUNK = Zap/g2 ; Trunk interface
TRUNKMSD = 1 ; MSD digits to strip (usually 1 or 0)
trunk_1 = IAX2/trunk_1
[dundi-e164-canonical]
[dundi-e164-customers]
[dundi-e164-via-pstn]
[dundi-e164-local]
include => dundi-e164-canonical
include => dundi-e164-customers
include => dundi-e164-via-pstn

[dundi-e164-switch]
switch => DUNDi/e164

[dundi-e164-lookup]
include => dundi-e164-local
include => dundi-e164-switch
[macro-dundi-e164]
exten => s,1,Goto(${ARG1},1)
include => dundi-e164-lookup
[iaxtel700]
exten => _91700XXXXXXX,1,Dial(IAX2/${GLOBAL(IAXINFO)}@iaxtel.com/${EXTEN:1}@iaxtel)
[iaxprovider]
[trunkint]
exten => _9011.,1,Macro(dundi-e164,${EXTEN:4})
exten => _9011.,n,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}})

[trunkld]
exten => _91NXXNXXXXXX,1,Macro(dundi-e164,${EXTEN:1})
exten => _91NXXNXXXXXX,n,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}})

[trunklocal]
exten => _9NXXXXXX,1,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}})

[trunktollfree]
exten => _91800NXXXXXX,1,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}})
exten => _91888NXXXXXX,1,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}})
exten => _91877NXXXXXX,1,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}})
exten => _91866NXXXXXX,1,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}})

[international]
ignorepat => 9
include => longdistance
include => trunkint

[longdistance]
ignorepat => 9
include => local
include => trunkld

[local]
ignorepat => 9
include => default
include => trunklocal
include => iaxtel700
include => trunktollfree
include => iaxprovider
include => parkedcalls
[macro-trunkdial]
exten => s,1,Dial(${ARG1})
exten => s,n,Goto(s-${DIALSTATUS},1)
exten => s-NOANSWER,1,Hangup
exten => s-BUSY,1,Hangup
exten => _s-.,1,NoOp

[macro-stdexten];
exten => s,1,Dial(${ARG2},20) ; Ring the interface, 20 seconds maximum
exten => s,2,Goto(s-${DIALSTATUS},1) ; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER)
exten => s-NOANSWER,1,Voicemail(${ARG1},u) ; If unavailable, send to voicemail w/ unavail announce
exten => s-NOANSWER,2,Goto(default,s,1) ; If they press #, return to start
exten => s-BUSY,1,Voicemail(${ARG1},b) ; If busy, send to voicemail w/ busy announce
exten => s-BUSY,2,Goto(default,s,1) ; If they press #, return to start
exten => _s-.,1,Goto(s-NOANSWER,1) ; Treat anything else as no answer
exten => a,1,VoicemailMain(${ARG1}) ; If they press *, send the user into VoicemailMain

[macro-stdPrivacyexten];
exten => s,1,Dial(${ARG2},20|p) ; Ring the interface, 20 seconds maximum, call screening
exten => s,2,Goto(s-${DIALSTATUS},1) ; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER)
exten => s-NOANSWER,1,Voicemail(${ARG1},u) ; If unavailable, send to voicemail w/ unavail announce
exten => s-NOANSWER,2,Goto(default,s,1) ; If they press #, return to start
exten => s-BUSY,1,Voicemail(${ARG1},b) ; If busy, send to voicemail w/ busy announce
exten => s-BUSY,2,Goto(default,s,1) ; If they press #, return to start
exten => s-DONTCALL,1,Goto(${ARG3},s,1) ; Callee chose to send this call to a polite “Don’t call again” script.
exten => s-TORTURE,1,Goto(${ARG4},s,1) ; Callee chose to send this call to a telemarketer torture script.
exten => _s-.,1,Goto(s-NOANSWER,1) ; Treat anything else as no answer
exten => a,1,VoicemailMain(${ARG1}) ; If they press *, send the user into VoicemailMain

[macro-page];
exten => s,1,ChanIsAvail(${ARG1}|js) ; j is for Jump and s is for ANY call
exten => s,n,GoToIf([${AVAILSTATUS} = “1”]?autoanswer:fail)
exten => s,n(autoanswer),Set(_ALERT_INFO=“RA”) ; This is for the PolyComs
exten => s,n,SIPAddHeader(Call-Info: Answer-After=0) ; This is for the Grandstream, Snoms, and Others
exten => s,n,NoOp() ; Add others here and Post on the Wiki!!!
exten => s,n,Dial(${ARG1}||)
exten => s,n(fail),Hangup

[demo]
exten => s,1,Wait(1) ; Wait a second, just for fun
exten => s,n,Answer ; Answer the line
exten => s,n,Set(TIMEOUT(digit)=5) ; Set Digit Timeout to 5 seconds
exten => s,n,Set(TIMEOUT(response)=10) ; Set Response Timeout to 10 seconds
exten => s,n(restart),BackGround(demo-congrats) ; Play a congratulatory messageexten => s,n(instruct),BackGround(demo-instruct) ; Play some instructions
exten => s,n,WaitExten ; Wait for an extension to be dialed.
exten => 2,1,BackGround(demo-moreinfo) ; Give some more information.
exten => 2,n,Goto(s,instruct)
exten => 3,1,Set(LANGUAGE()=fr) ; Set language to french
exten => 3,n,Goto(s,restart) ; Start with the congratulations
exten => 1000,1,Goto(default,s,1)
exten => 1234,1,Playback(transfer,skip) ; "Please hold while…"
exten => 1234,n,Macro(stdexten,1234,${GLOBAL(CONSOLE)})
exten => 1235,1,Voicemail(1234,u) ; Right to voicemail
exten => 1236,1,Dial(Console/dsp) ; Ring forever
exten => 1236,n,Voicemail(1234,b) ; Unless busy
exten => #,1,Playback(demo-thanks) ; "Thanks for trying the demo"
exten => #,n,Hangup ; Hang them up.
exten => t,1,Goto(#,1) ; If they take too long, give up
exten => i,1,Playback(invalid) ; "That’s not valid, try again"
exten => 500,1,Playback(demo-abouttotry) ; Let them know what’s going on
exten => 500,n,Dial(IAX2/guest@misery.digium.com/s@default) ; Call the Asterisk demo
exten => 500,n,Playback(demo-nogo) ; Couldn’t connect to the demo site
exten => 500,n,Goto(s,6) ; Return to the start over message.
exten => 600,1,Playback(demo-echotest) ; Let them know what’s going on
exten => 600,n,Echo ; Do the echo test
exten => 600,n,Playback(demo-echodone) ; Let them know it’s over
exten => 600,n,Goto(s,6) ; Start over
exten => 76245,1,Macro(page,SIP/Grandstream1)
exten => _7XXX,1,Macro(page,SIP/${EXTEN})
exten => 7999,1,Set(TIMEOUT(absolute)=60)
exten => 7999,2,Page(Local/Grandstream1@page&Local/Xlite1@page&Local/1234@page/n|d)
exten => 8500,1,VoicemailMain
exten => 8500,n,Goto(s,6)
[page]
exten => _X.,1,Macro(page,SIP/${EXTEN})
[default]
exten => 85000,1,VoiceMailMain
exten => 8500,n,Hangup
include => voicemenu-custom-1

[voicemenu-custom-1]
comment = mainmenu
exten = s,1,Answer
exten = s,2,Background(thank-you-for-calling)
exten = s,3,Background(if-u-know-ext-dial)
exten = s,4,Background(otherwise)
exten = s,5,Background(pls-hold-while-try)
exten = s,6,Background(to-reach-operator)
include = default

[numberplan-custom-1]
plancomment = DialPlan1
include = default
exten = _91XXXXXXXXXX.,1,Macro(trunkdial,${}/${EXTEN:1})
comment = _91XXXXXXXXXX.,1,Longdistance,standard
exten = _91700XXXXXXX.,1,Macro(trunkdial,${}/${EXTEN:1})
comment = _91700XXXXXXX.,1,IAXTEL,standard
exten = _9256XXXXXXX.,1,Macro(trunkdial,${}/${EXTEN:4})
comment = _9256XXXXXXX.,1,Local,standard
exten = _9011XXXXXXX.,1,Macro(trunkdial,${}/${EXTEN:1})
comment = _9011XXXXXXX.,1,International,standard
exten = _9XXXXXXX.,1,Macro(trunkdial,${}/${EXTEN:1})
comment = _9XXXXXXX.,1,Local,standard
exten = _911.,1,Macro(trunkdial,${}/${EXTEN:0})
comment = _911.,1,911,standard
exten = _88XXX,1,Macro(trunkdial,${trunk_1}/${EXTEN:0})
comment = _88XXX,1,InterIAXAus,standard

[asterisk_guitools]
exten = executecommand,1,System(${command})
exten = executecommand,n,Hangup()
exten = record_vmenu,1,Answer
exten = record_vmenu,n,Playback(vm-intro)
exten = record_vmenu,n,Record(${var1})
exten = record_vmenu,n,Playback(vm-saved)
exten = record_vmenu,n,Playback(vm-goodbye)
exten = record_vmenu,n,Hangup
exten = play_file,1,Answer
exten = play_file,n,Playback(${var1})
exten = play_file,n,Hangup
hasbeensetup = Y

[DID_trunk_1]
include = default[/code]

users.conf

[code][general]
fullname = New User
userbase = 68100
hasvoicemail = yes
vmsecret = 1234
hassip = yes
hasiax = yes
hasmanager = no
callwaiting = yes
threewaycalling = yes
callwaitingcallerid = yes
transfer = yes
canpark = yes
cancallforward = yes
callreturn = yes
callgroup = 1
pickupgroup = 1
host = dynamic
localextenlength = 5
allow_aliasextns = no

[trunk_1]
disallow =
allow = all
callerid =
contact =
context = DID_trunk_1
dialformat = ${EXTEN:1}
fromdomain =
fromuser =
group =
hasexten = no
hasiax = yes
hassip = no
host = 10.4.38.35
insecure =
port = 4569
provider =
registeriax = yes
registersip = no
secret = 46464
trunkname = Custom - InterIAXAus
trunkstyle = customvoip
username = 46464

[68414]
callwaiting = yes
cid_number = 68414
context = numberplan-custom-1
email =
fullname = New User
group =
hasagent = no
hasdirectory = yes
hasiax = yes
hasmanager = no
hassip = yes
hasvoicemail = yes
host = dynamic
mailbox = 68414
secret = 68414
threewaycalling = yes
zapchan =

[46464]
callwaiting = yes
cid_number = 46464
context = numberplan-custom-1
email =
fullname = InterIAXAus
group =
hasagent = no
hasdirectory = no
hasiax = yes
hasmanager = no
hassip = yes
hasvoicemail = yes
host = dynamic
mailbox = 46464
secret = 46464
threewaycalling = yes
zapchan =[/code]

sip show peers localhost*CLI> sip show peers Name/username Host Dyn Nat ACL Port Status 46464 (Unspecified) D 0 Unmonitored 68414/68414 10.4.4.61 D 5061 Unmonitored

Thanks
Paul