IAX2 incoming call config

I have 2 systems A using Asterisk 1.6.2.9 talking to B using 1.4.22 over IAX

B registers with A
iax.conf on B

; Inter-Asterisk eXchange driver definition ; ; This configuration is re-read at reload ; or with the CLI command ; reload chan_iax2.so ; ; General settings, like port number to bind to, and ; an option address (the default is to bind to all ; local addresses). ; [general] bindport=4569 ; bindport and bindaddr may be specified register => slave:xxxxxxx@192.168.1.16 ; language = fr ; Default language setting for all users/peers bandwidth=high allow=all ; same as bandwidth=high disallow=g723.1 ; Hm... Proprietary, don't use it... disallow=lpc10 ; Icky sound quality... Mr. Roboto. jitterbuffer=no forcejitterbuffer=no autokill=yes calltokenoptional = 192.168.1.16/255.255.255.0 maxcallnumbers=16382 ; [call-master] type=friend context=outgoing host=dynamic username=slave auth=md5 secret=xxxxxxx
iax.conf on A

; Inter-Asterisk eXchange driver definition ; ; This configuration is re-read at reload ; or with the CLI command ; reload chan_iax2.so ; ; General settings, like port number to bind to, and ; an option address (the default is to bind to all ; local addresses). ; [general] bandwidth=low disallow=lpc10 ; Icky sound quality... Mr. Roboto. jitterbuffer=no forcejitterbuffer=no autokill=yes calltokenoptional=192.168.1.101/255.255.255.0 maxcallnumbers=16382 requirecalltoken=no ; [slave] type=friend host=dynamic username=call-master auth=md5 secret=xxxxxxxx

I can call B from A using DIAL(IAX2/slave)

This goes to the s extension of the outgoing contest as expected: here’s the extensions.conf file

[code];!
;! Automatically generated configuration file
;! Filename: extensions.conf (/etc/asterisk/extensions.conf)
;! Generator: Manager
;! Creation Date: Tue Mar 24 22:37:03 2009
;!
[globals]
PETE = SIP/pete
FIONA = SIP/fiona
AFIORE = SIP/afiore
PORTABLE = SIP/portable
RINGTIME = 20
language =fr
trunk_1 = SIP/trunk_1
; Conference rooms
; For the moment external (incoming) calls can only use 900
[rooms]
conf = 600
conf = 900

[internal]
exten = 2004,hint,PORTABLE
exten = 2004,1,Dial(${PORTABLE},10)
exten = 2004,2,Playback(vm-nobodyavail)
exten = 2004,3,VoiceMail(u1004@default)
exten = 2004,4,Hangup( )
exten = 2004,102,Playback(tt-allbusy)
exten = 2004,103,Hangup( )
exten = 2001,hint,PETE
exten = 2001,1,Dial(${PETE},10)
exten = 2001,2,Playback(vm-nobodyavail)
exten = 2001,3,VoiceMail(u1001@default)
exten = 2001,4,Hangup( )
exten = 2001,102,Playback(tt-allbusy)
exten = 2001,103,Hangup( )
exten = 2002,hint,FIONA
exten = 2002,1,Dial(${FIONA},10)
exten = 2002,2,Playback(vm-nobodyavail)
exten = 2002,3,VoiceMail(u1002@default)
exten = 2002,4,Hangup( )
exten = 2002,102,Playback(tt-allbusy)
exten = 2002,103,Hangup( )
exten = 2003,hint,AFIORE
exten = 2003,1,Dial(${AFIORE},10)
exten = 2003,2,Playback(vm-nobodyavail)
exten = 2003,3,VoiceMail(u1001@default)
exten = 2003,4,Hangup( )
exten = 2003,102,Playback(tt-allbusy)
exten = 2003,103,Hangup( )
[incoming]
include = internal
exten = s,1,NoOp(CallerID is ${CALLERID(all)})
exten = s,n,Answer( )
exten = s,n,Background(enter-ext-of-person)
exten => s,n,WaitExten(10)
exten => s,n(goodbye),Playback(vm-goodbye)
exten => s,n(end),Hangup()
; invalid and timeout options
exten = i,1,Playback(pbx-invalid)
exten = i,2,Goto(incoming,s,1)
exten = t,1,Playback(vm-goodbye)
exten = t,2,Hangup( )
; note Directory() fields are vm-context,dial-context,firstname or not
exten = 8,1,Directory(default,default,ef)
exten = 9,1,Directory(default,default,e)

[outbound-national-france]
; French National numbers are 9 digits starting with 1 for France
; Telecom
; Do we want to detect mobile numbers and handle them separately?
; Emergency numbers are 2 digits or 3 for European emergency number 113
; Do we want to authorise 0890 numbers?
; Since I have a cheap rate with Skype for French national fixed numbers
; I want to route calls for zones 01-09
;
exten = _0[1-9]XXXXXXXX,1,NoOp(Appel France via IAX)
exten = _0[1-9]XXXXXXXX,2,AGI(agi://127.0.0.1:4577/call_log)
exten = _0[1-9]XXXXXXXX,3,Dial(IAX2/slave@192.168.1.16/s@outgoing)
exten = _0[1-9]XXXXXXXX,4,Congestion( )
exten = _0[1-9]XXXXXXXX,104,Congestion( )
;
; French 2 digit emergency calls
exten = _ZX,1,NoOp(Appel d Urgence à ${EXTEN})
;exten = _ZX,1,Playback(No-emergency)
;exten = _ZX,2,Congestion( )
;exten = _ZX,102,Congestion( )
; European emergency call
exten = _Z12,1,NoOp(Appel d Urgence à ${EXTEN})
;exten = _ZXX,1,Playback(No-emergency)
;exten = _ZXX,2,Congestion( )
;exten = _ZXX,102,Congestion( )
; 4 digit service calls start with 3
exten = _3XXX,1,Dial(IAX2/guest@192.168.1.11/s@outgoing)
exten = _3XXX,2,Congestion( )
exten = _3XXX,102,Congestion( )

[outbound-international-france]
; for US try using Net2phone
exten = _00ZXXXXXXXXXX,1,NoOp(Appel US au ${EXTEN:3})
exten = _00ZXXXXXXXXXX,2,AGI(agi://127.0.0.1:4577/call_log)
exten = _00ZXXXXXXXXXX,3,Dial(SIP/net2phone/${EXTEN:3},To)
exten = _00ZXXXXXXXXXX,4,Congestion( )
exten = _00ZXXXXXXXXXX,104,Congestion( )
; French International dialing as elsewhere in Europe requires 00
; followed by country code
exten = _00XXXXXXXXXXXX,1,NoOp(Appel International non-US au ${EXTEN:3})
exten = _00XXXXXXXXXXXX,2,AGI(agi://127.0.0.1:4577/call_log)
exten = _00XXXXXXXXXXXX,3,Dial(IAX2/guest@192.168.1.11/s@outgoing))
exten = _00XXXXXXXXXXXX,4,Congestion( )
exten = _00XXXXXXXXXXXX,104,Congestion( )

[general]
static = yes
writeprotect = no
clearglobalvars = yes
[macro-sip-phone]
;
; Standard extension subroutine:
; ${ARG1} - Extension
; ${ARG2} - Sip Device
;exten => s,hint,${ARG2}
exten => s,1,NoOp(Appel vers ${ARG1})
exten => s,2,Dial(${${ARG2}},10)
exten => s,n,Voicemail(${ARG1},u) ; Voicemail (unavailable)
exten => s,s+1,Hangup ; s+1, same as n
exten => s,102,Voicemail(${ARG1},b) ; Voicemail (busy)
exten => s,s+1,Hangup ; s+1, same as n
;
[outgoing]
include = internal
include = outbound-national-france
include = outbound-international-france
exten = s,1,Answer( )
exten = s,2,Background(enter-ext-of-person)
exten => s,n,WaitExten(10)
exten => s,n(goodbye),Playback(vm-goodbye)
exten => s,n(end),Hangup()
;
exten = 1,1,Dial(${PETE},r)
exten = 1,2,Playback(vm-nobodyavail)
exten = 1,3,VoiceMail(1001@default,u)
exten = 1,4,Hangup( )
exten = 1,102,VoiceMail(1001@default,b)
exten = 2,1,Answer( )
exten = 2,2,Background(test)
exten = 3,1,Answer()
exten = 3,2,Set(CHANNEL(language)=fr)
exten = 3,3,SayDigits(12345)
exten = 3,4,DateTime(,kR)
exten = 3,5,Playback(/var/lib/asterisk/sounds/fr/digits/1)
exten = 3,6,Hangup()
exten = 4,1,Answer()
exten = 4,2,Set(CHANNEL(language)=fr)
exten = 4,3,AGI(festival_test.php)
exten = 4,4,Hangup()
exten = 5,1,Answer()
exten = 5,2,Set(CHANNEL(language)=fr)
exten = 5,3,Festival(‘hello pete’)
exten = 5,4,Hangup()
exten = 6,1,NoOp(Appel France via IAX)
exten = 6,2,Dial(IAX2/call-master:varazslo/s@outgoing)
; note Directory() fields are vm-context,dial-context,firstname or not
exten = 8,1,Directory(default,outgoing,ef)
exten = 9,1,Directory(default,outgoing,e)
;
; read your Voicemail
exten = 5000,1,VoiceMailMain( )
exten = 5000,2,Hangup()
; limit the conference room to 10 participants
exten = 6000,1,MeetMeCount(600,CONFCOUNT)
exten = 6000,2,GotoIf($[${CONFCOUNT} <= 10]?3:100)
exten = 6000,3,MeetMe(600,ivMx)
exten = 6000,100,Playback(conf-full)
exten = 9000,1,MeetMeCount(900,CONFCOUNT)
exten = 9000,2,GotoIf($[${CONFCOUNT} <= 10]?3:100)
exten = 9000,3,MeetMe(900,ivMx)
exten = 9000,100,Playback(conf-full)
;
exten = i,1,Set(LANGUAGE()=fr)
exten = i,n,Playback(pbx-invalid)
exten = i,n,Goto(incoming,s,1)
exten = t,1,Set(LANGUAGE()=fr)
exten = t,n,Playback(vm-goodbye)
exten = t,n,Hangup( )

[/code]

However when I try to DIAL(IAX2/slave/2001@internal)
I get on B Rejected connect ettempt from 192.168.1.16, who was trying to reach '2001@internal’
and on A I get Call rejected by 192.168.1.101: No authority found

I don’t understand why since the 1st one works the 2nd one doesn’t.
Also I don’t understand why with the IAX2 debug set on on B there seems to be no IAX2 activity to log in the 2nd case where in the 1st one there is a trace, which shows that the logging is on.

What have I missed?

Hello Pete,

What I can see is that on the one * you register with the other * server…

But then you do not do that vice versa.

So you can dial from a to b, but not from b to a.

I think you also have to register a with b.

The solution I use does not register with its peer.

I have two * connected over iax and they are not

My config.

iax.conf server a

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

[serverb]
type=friend
username=server_a
secret=XXXXXX
auth=plaintext
host=v.w.x.y
context=fromiax
peercontext=fromiax
qualify=yes
trunk=yes[/code]

iax.conf server b

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

[servera]
type=friend
username=server_b
secret=xxxxxxx
auth=plaintext
host=v.w.x.y
context=fromiax
peercontext=fromiax
qualify=yes
trunk=yes
requirecalltoken=no[/code]

Then I have on both servers I have a context fromiax, which includes the context where I have configured the extensions.

The Dial command is equal to yours.

Maybe this helps…

Thanks for your help, the results are positive.

I’ve changed the configuration to conform to yours and therefore no longer do the register.

The results are identical: if I call without specifying the extension@context then it works and I can key in the extension and get connected however if I specify the same extension@internal in the dial then I get the call rejected No authority found message. However if I use extension@incoming (which is the context defined in the user statement and contains internal) then the call goes through.

[code]
;!
;! Automatically generated configuration file
;! Filename: extensions.conf (/etc/asterisk/extensions.conf)
;! Generator: Manager
;! Creation Date: Tue Mar 24 22:37:03 2009
;!
[globals]
PETE = SIP/pete
FIONA = SIP/fiona
AFIORE = SIP/afiore
PORTABLE = SIP/portable
RINGTIME = 20
language =fr
trunk_1 = SIP/trunk_1
; Conference rooms
; For the moment external (incoming) calls can only use 900
[rooms]
conf = 600
conf = 900

[internal]
exten = 2004,hint,PORTABLE
exten = 2004,1,Dial(${PORTABLE},10)
exten = 2004,2,Playback(vm-nobodyavail)
exten = 2004,3,VoiceMail(u2004@default)
exten = 2004,4,Hangup( )
exten = 2004,102,Playback(tt-allbusy)
exten = 2004,103,Hangup( )
exten = 2001,hint,PETE
exten = 2001,1,Dial(${PETE},10)
exten = 2001,2,Playback(vm-nobodyavail)
exten = 2001,3,VoiceMail(u2001@default)
exten = 2001,4,Hangup( )
exten = 2001,102,Playback(tt-allbusy)
exten = 2001,103,Hangup( )
exten = 2002,hint,FIONA
exten = 2002,1,Dial(${FIONA},10)
exten = 2002,2,Playback(vm-nobodyavail)
exten = 2002,3,VoiceMail(u2002@default)
exten = 2002,4,Hangup( )
exten = 2002,102,Playback(tt-allbusy)
exten = 2002,103,Hangup( )
exten = 2003,hint,AFIORE
exten = 2003,1,Dial(${AFIORE},10)
exten = 2003,2,Playback(vm-nobodyavail)
exten = 2003,3,VoiceMail(u2003@default)
exten = 2003,4,Hangup( )
exten = 2003,102,Playback(tt-allbusy)
exten = 2003,103,Hangup( )
[incoming]
include = internal
exten = s,1,NoOp(CallerID is ${CALLERID(all)})
exten = s,n,Answer( )
exten = s,n,Background(enter-ext-of-person)
exten => s,n,WaitExten(10)
exten => s,n(goodbye),Playback(vm-goodbye)
exten => s,n(end),Hangup()
; invalid and timeout options
exten = i,1,Playback(pbx-invalid)
exten = i,2,Goto(incoming,s,1)
exten = t,1,Playback(vm-goodbye)
exten = t,2,Hangup( )
; note Directory() fields are vm-context,dial-context,firstname or not
exten = 8,1,Directory(default,default,ef)
exten = 9,1,Directory(default,default,e)

[outbound-national-france]
; French National numbers are 9 digits starting with 1 for France
; Telecom
; Do we want to detect mobile numbers and handle them separately?
; Emergency numbers are 2 digits or 3 for European emergency number 113
; Do we want to authorise 0890 numbers?
; Since I have a cheap rate with Skype for French national fixed numbers
; I want to route calls for zones 01-09
;
exten = _0[1-9]XXXXXXXX,1,NoOp(Appel France via IAX)
exten = _0[1-9]XXXXXXXX,2,AGI(agi://127.0.0.1:4577/call_log)
exten = _0[1-9]XXXXXXXX,3,Dial(IAX2/slave@192.168.1.16/${EXTEN}@outgoing)
exten = _0[1-9]XXXXXXXX,4,Congestion( )
exten = _0[1-9]XXXXXXXX,104,Congestion( )
;
; French 2 digit emergency calls
exten = _ZX,1,NoOp(Appel d Urgence à ${EXTEN})
;exten = _ZX,1,Playback(No-emergency)
;exten = _ZX,2,Congestion( )
;exten = _ZX,102,Congestion( )
; European emergency call
exten = _Z12,1,NoOp(Appel d Urgence à ${EXTEN})
;exten = _ZXX,1,Playback(No-emergency)
;exten = _ZXX,2,Congestion( )
;exten = _ZXX,102,Congestion( )
; 4 digit service calls start with 3
exten = _3XXX,1,Dial(IAX2/guest@192.168.1.11/${EXTEN}@outgoing)
exten = _3XXX,2,Congestion( )
exten = _3XXX,102,Congestion( )

[outbound-international-france]
; for US try using Net2phone
exten = _00ZXXXXXXXXXX,1,NoOp(Appel US au ${EXTEN:3})
exten = _00ZXXXXXXXXXX,2,AGI(agi://127.0.0.1:4577/call_log)
exten = _00ZXXXXXXXXXX,3,Dial(SIP/net2phone/${EXTEN:3},,To)
exten = _00ZXXXXXXXXXX,4,Congestion( )
exten = _00ZXXXXXXXXXX,104,Congestion( )
; French International dialing as elsewhere in Europe requires 00
; followed by country code
exten = _00XXXXXXXXXXXX,1,NoOp(Appel International non-US au ${EXTEN:3})
exten = _00XXXXXXXXXXXX,2,AGI(agi://127.0.0.1:4577/call_log)
exten = _00XXXXXXXXXXXX,3,Dial(IAX2/guest@192.168.1.11/${EXTEN}@outgoing))
exten = _00XXXXXXXXXXXX,4,Congestion( )
exten = _00XXXXXXXXXXXX,104,Congestion( )

[general]
static = yes
writeprotect = no
clearglobalvars = yes
[macro-sip-phone]
;
; Standard extension subroutine:
;   ${ARG1} - Extension
;   ${ARG2} - Sip Device
;exten => s,hint,${ARG2}
exten => s,1,NoOp(Appel vers ${ARG1})
exten => s,2,Dial(${${ARG2}},10)
exten => s,n,Voicemail(${ARG1},u)   ; Voicemail (unavailable)
exten => s,s+1,Hangup         ; s+1, same as n
exten => s,102,Voicemail(${ARG1},b)   ; Voicemail (busy)
exten => s,s+1,Hangup         ; s+1, same as n
;
[outgoing]
include = internal
include = outbound-national-france
include = outbound-international-france
exten = s,1,Answer( )
exten = s,2,Background(enter-ext-of-person)
exten => s,n,WaitExten(10)
exten => s,n(goodbye),Playback(vm-goodbye)
exten => s,n(end),Hangup()
;
exten = 1,1,Dial(${PETE},,r)
exten = 1,2,Playback(vm-nobodyavail)
exten = 1,3,VoiceMail(2001@default,u)
exten = 1,4,Hangup( )
exten = 1,102,VoiceMail(2001@default,b)
exten = 2,1,Answer( )
exten = 2,2,Background(test)
exten = 3,1,Answer()
exten = 3,2,Set(CHANNEL(language)=fr)
exten = 3,3,SayDigits(12345)
exten = 3,4,DateTime(,,kR)
exten = 3,5,Playback(/var/lib/asterisk/sounds/fr/digits/1)
exten = 3,6,Hangup()
exten = 4,1,Answer()
exten = 4,2,Set(CHANNEL(language)=fr)
exten = 4,3,AGI(festival_test.php)
exten = 4,4,Hangup()
exten = 5,1,Answer()
exten = 5,2,Set(CHANNEL(language)=fr)
exten = 5,3,Festival('hello pete')
exten = 5,4,Hangup()
exten = 6,1,NoOp(Appel France via IAX)
exten = 6,2,Dial(IAX2/call-master:varazslo/s@outgoing)
; note Directory() fields are vm-context,dial-context,firstname or not
exten = 8,1,Directory(default,outgoing,ef)
exten = 9,1,Directory(default,outgoing,e)
;
; read your Voicemail
exten = 5000,1,VoiceMailMain( )
exten = 5000,2,Hangup()
; limit the conference room to 10 participants
exten = 6000,1,MeetMeCount(600,CONFCOUNT)
exten = 6000,2,GotoIf($[${CONFCOUNT} <= 10]?3:100)
exten = 6000,3,MeetMe(600,ivMx)
exten = 6000,100,Playback(conf-full)
exten = 9000,1,MeetMeCount(900,CONFCOUNT)
exten = 9000,2,GotoIf($[${CONFCOUNT} <= 10]?3:100)
exten = 9000,3,MeetMe(900,ivMx)
exten = 9000,100,Playback(conf-full)
;
exten = i,1,Set(LANGUAGE()=fr)
exten = i,n,Playback(pbx-invalid)
exten = i,n,Goto(incoming,s,1)
exten = t,1,Set(LANGUAGE()=fr)
exten = t,n,Playback(vm-goodbye)
exten = t,n,Hangup( )[/code]

So it’s still a mystery but now it works.
Thanks again.