Iax 2 trunk problem

I am preety new to asterisk and need help doing something I already did :smile:

ok, I already have to servers in different locations that connect to a main asterisk server using iax. All three have static IP addreses. One of them let’s say server 1 is the one that routes all calls out to pstn. That’s not the problem…, the problem is that I am trying to configure ( let’s call them ) server 2 and 3 with there own iax trunk so that calls from extentions to extensions can be made with out passing through server 1.

First question…, I know that basicly iax can be configured completly via web…, but for some reason When I do a iax2 show peers it will say ok and see it…, but when I do iax2 show registry it shows as sending the request but never registering…

Is there anything to be done in the extentions.conf, iax.conf files or extentions_additional.conf

I really do not include anything of what I have tried cuz it has lead me knowhere. I rather have the points on what to look for…

Remember…, I am not a guru…, so be gentle…

Thanks in advance

PS I’ve read like a nerd but have come to nothing that might help me.

If you want to see some of my config…, ask and I’ll post…, just so I dont keep on adding unnesesary junk I haven’t

:smile:

LET ME ADD SOME INFO, APPARENTLY NOBODY GETS MY PROBLEM

This is in iax_additional.conf

Server 1 -------------------------->

register=muelle:muelle@

[muelle]
allow=ulaw
disallow=all
qualify=yes
secret=muelle
trunk=yes
type=friend
username=muelle

[muelle-user]
allow=ulaw
context=from-internal
disallow=all
host=
qualify=yes
secret=muelle
trunk=yes
type=friend
username=muelle-user

web asterisk cli ------------------>

Name/Username Host Mask Port Status

muelle-user/mue (S) 255.255.255.255 4569 OK (16 ms)
1 iax2 peers [1 online, 0 offline, 0 unmonitored]
Verbosity is at least 3

Host Username Perceived Refresh State

:4569 muelle :4569 60 Registered
Verbosity is at least 3

This is in iax_additional.conf

Server 2 -------------------------->

[muelle]
allow=ulaw
context=from-internal
disallow=all
host=dynamic
qualify=yes
secret=muelle
trunk=yes
type=friend
username=muelle

[muelle-user]
allow=ulaw
disallow=all
qualify=yes
secret=muelle
trunk=yes
type=friend
username=muelle-user

web asterisk cli ------------------>

Name/Username Host Mask Port Status

muelle/muelle (D) 255.255.255.255 4569 OK (11 ms)
1 iax2 peers [1 online, 1 offline, 0 unmonitored]
Verbosity is at least 3

output of server 1 when calling from extention 2743, extention 2730 in server 2 ----------->

– Executing Macro(“SIP/2743-081e7a78”, “dialout-trunk|2|2730||”) in new stack
– Executing Set(“SIP/2743-081e7a78”, “DIAL_TRUNK=2”) in new stack
– Executing Set(“SIP/2743-081e7a78”, “DIAL_NUMBER=2730”) in new stack
– Executing Set(“SIP/2743-081e7a78”, “ROUTE_PASSWD=”) in new stack
– Executing GotoIf(“SIP/2743-081e7a78”, “1?noauth”) in new stack
– Goto (macro-dialout-trunk,s,6)
– Executing Set(“SIP/2743-081e7a78”, “GROUP()=OUT_2”) in new stack
– Executing Macro(“SIP/2743-081e7a78”, “user-callerid”) in new stack
– Executing GotoIf(“SIP/2743-081e7a78”, “0?report”) in new stack
– Executing GotoIf(“SIP/2743-081e7a78”, “0?start”) in new stack
– Executing Set(“SIP/2743-081e7a78”, “REALCALLERIDNUM=2743”) in new stack
– Executing NoOp(“SIP/2743-081e7a78”, “REALCALLERIDNUM is 2743”) in new stack
– Executing Set(“SIP/2743-081e7a78”, “AMPUSER=2743”) in new stack
– Executing Set(“SIP/2743-081e7a78”, “AMPUSERCIDNAME=2743”) in new stack
– Executing GotoIf(“SIP/2743-081e7a78”, “0?report”) in new stack
– Executing Set(“SIP/2743-081e7a78”, “CALLERID(all)=2743 <2743>”) in new stack
– Executing NoOp(“SIP/2743-081e7a78”, “Using CallerID “2743” <2743>”) in new stack
– Executing Macro(“SIP/2743-081e7a78”, “record-enable|2743|OUT”) in new stack
– Executing GotoIf(“SIP/2743-081e7a78”, “0 > 0?2:4”) in new stack
– Goto (macro-record-enable,s,4)
– Executing AGI(“SIP/2743-081e7a78”, “recordingcheck|20080307-102822|1204903702.283”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/recordingcheck
recordingcheck|20080307-102822|1204903702.283: Outbound recording not enabled
– AGI Script recordingcheck completed, returning 0
– Executing NoOp(“SIP/2743-081e7a78”, “No recording needed”) in new stack
– Executing Macro(“SIP/2743-081e7a78”, “outbound-callerid|2”) in new stack
– Executing GotoIf(“SIP/2743-081e7a78”, “1?start”) in new stack
– Goto (macro-outbound-callerid,s,3)
– Executing NoOp(“SIP/2743-081e7a78”, “REALCALLERIDNUM is 2743”) in new stack
– Executing Set(“SIP/2743-081e7a78”, “USEROUTCID=”) in new stack
– Executing Set(“SIP/2743-081e7a78”, “EMERGENCYCID=”) in new stack
– Executing Set(“SIP/2743-081e7a78”, “TRUNKOUTCID=”) in new stack
– Executing GotoIf(“SIP/2743-081e7a78”, “1?trunkcid”) in new stack
– Goto (macro-outbound-callerid,s,11)
– Executing GotoIf(“SIP/2743-081e7a78”, “1?usercid”) in new stack
– Goto (macro-outbound-callerid,s,13)
– Executing GotoIf(“SIP/2743-081e7a78”, “1?report”) in new stack
– Goto (macro-outbound-callerid,s,17)
– Executing NoOp(“SIP/2743-081e7a78”, “CallerID set to “2743” <2743>”) in new stack
– Executing GotoIf(“SIP/2743-081e7a78”, “1?nomax”) in new stack
– Goto (macro-dialout-trunk,s,12)
– Executing AGI(“SIP/2743-081e7a78”, “fixlocalprefix”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/fixlocalprefix
fixlocalprefix: Could not parse /etc/asterisk/localprefixes.conf
– AGI Script fixlocalprefix completed, returning 0
– Executing Set(“SIP/2743-081e7a78”, “OUTNUM=2730”) in new stack
– Executing Set(“SIP/2743-081e7a78”, “custom=IAX2/muelle-user”) in new stack
– Executing GotoIf(“SIP/2743-081e7a78”, “0?customtrunk”) in new stack
– Executing Dial(“SIP/2743-081e7a78”, “IAX2/muelle-user/2730|120|r”) in newstack
– Called muelle-user/2730
– Hungup ‘IAX2/muelle-user-2’
== Everyone is busy/congested at this time (1:0/0/1)
– Executing Goto(“SIP/2743-081e7a78”, “s-CHANUNAVAIL|1”) in new stack
– Goto (macro-dialout-trunk,s-CHANUNAVAIL,1)
– Executing NoOp(“SIP/2743-081e7a78”, “Dial failed due to CHANUNAVAIL”) innew stack
– Executing Macro(“SIP/2743-081e7a78”, “outisbusy|”) in new stack
– Executing Playback(“SIP/2743-081e7a78”, “all-circuits-busy-now|noanswer”)in new stack
– Executing Playback(“SIP/2743-081e7a78”, “pls-try-call-later|noanswer”) innew stack
– Executing Macro(“SIP/2743-081e7a78”, “hangupcall”) in new stack
– Executing ResetCDR(“SIP/2743-081e7a78”, “w”) in new stack
– Executing NoCDR(“SIP/2743-081e7a78”, “”) in new stack
– Executing Wait(“SIP/2743-081e7a78”, “5”) in new stack
– Executing Hangup(“SIP/2743-081e7a78”, “”) in new stack
== Spawn extension (macro-hangupcall, s, 4) exited non-zero on ‘SIP/2743-081e7 a78’ in macro ‘hangupcall’
== Spawn extension (macro-hangupcall, s, 4) exited non-zero on ‘SIP/2743-081e7 a78’ in macro ‘outisbusy’
== Spawn extension (macro-hangupcall, s, 4) exited non-zero on 'SIP/2743-081e7 a78’
debian-cpe*CLI>

Hi,

I have many Asterisk boxes connected via IAX; here is one way to do it.

extensions.conf

;IAX2 for Inter-Office Calls
;I am using pattern matching _[1-3]XX and stripping off the last two
;digits :-2 and appending or concatinating it to -IAX-TRUNK. so if I dial 122
;Asterisk will call via 1-IAX-TRUNK
;
exten => _[1-3]XX,1,Set(IAXTRUNK=${EXTEN:0:-2}"-IAX-TRUNK")
exten => _[1-3]XX,2,Dial(IAX2/${IAXTRUNK}/${EXTEN},45,Tt)
exten => _[1-3]XX,3,Hangup()

iax.conf

;Inter-Office IAX
[1-IAX-TRUNK] ;Extensions starting with 1
type=peer
context=internal
host=192.168.0.10
disallow=all
allow=g729
qualify=no

[2-IAX-TRUNK] ;Extensions starting with 2
type=peer
context=internal
host=192.168.1.10
disallow=all
allow=g729
qualify=no

[3-IAX-TRUNK] ;Extensions starting with 3
type=peer
context=internal
host=192.168.5.10
disallow=all
allow=g729
qualify=no