Trunk Sequence Question

I’m working on setting up Trixbox for the first time (I’ve previously set up a [email protected] box successfully). I have a Digium TDM400 card with 4 FXO’s.

I have an outbound route defined and the trunk sequence is (ZAP/g0, ZAP/g1, ZAP/g2, ZAP/g3). I’m only using one phone line while setting up this box but will have 4 POTS lines once it’s installed. While testing this box, I had the phone line plugged into ZAP/g3. I then made an outgoing call from one of my extensions. My assumption was that if it couldn’t find a signal on ZAP/g0, it would then try ZAP/g1 and so on until it finally got a signal on ZAP/g3. However, this is not the behavior I’m seeing. Instead, it acts as if it connected successfully to ZAP/g0 and it just hangs. Is this normal? Is my assumption about finding a trunk with a dial tone incorrect?

This won’t be a problem once the box is installed unless someone disconnects one of the phone lines from the Digium card. I just want to make sure I’m not missing something.

Output from the Asterisk CLI is below.

Thanks

-- Executing Macro("SIP/800-09210068", "dialout-trunk|1|876XXXX||") in new s                                     tack
-- Executing Set("SIP/800-09210068", "DIAL_TRUNK=1") in new stack
-- Executing Set("SIP/800-09210068", "DIAL_NUMBER=876XXXX") in new stack
-- Executing Set("SIP/800-09210068", "ROUTE_PASSWD=") in new stack
-- Executing GotoIf("SIP/800-09210068", "1?noauth") in new stack
-- Goto (macro-dialout-trunk,s,6)
-- Executing GotoIf("SIP/800-09210068", "0?disabletrunk|1") in new stack
-- Executing Set("SIP/800-09210068", "_NODEST=") in new stack
-- Executing Set("SIP/800-09210068", "DIAL_TRUNK_OPTIONS=tr") in new stack
-- Executing Set("SIP/800-09210068", "GROUP()=OUT_1") in new stack
-- Executing Macro("SIP/800-09210068", "user-callerid|SKIPTTL") in new stack
-- Executing NoOp("SIP/800-09210068", "user-callerid: device 800") in new st                                     ack
-- Executing Set("SIP/800-09210068", "AMPUSER=800") in new stack
-- Executing GotoIf("SIP/800-09210068", "0?report") in new stack
-- Executing GotoIf("SIP/800-09210068", "0?start") in new stack
-- Executing Set("SIP/800-09210068", "REALCALLERIDNUM=800") in new stack
-- Executing NoOp("SIP/800-09210068", "REALCALLERIDNUM is 800") in new stack
-- Executing Set("SIP/800-09210068", "AMPUSER=800") in new stack
-- Executing Set("SIP/800-09210068", "AMPUSERCIDNAME=Jennifer") in new stack
-- Executing GotoIf("SIP/800-09210068", "0?report") in new stack
-- Executing Set("SIP/800-09210068", "AMPUSERCID=800") in new stack
-- Executing Set("SIP/800-09210068", "CALLERID(all)="Jennifer" <800>") in ne                                     w stack
-- Executing Set("SIP/800-09210068", "REALCALLERIDNUM=800") in new stack
-- Executing NoOp("SIP/800-09210068", "TTL:  ARG1: SKIPTTL") in new stack
-- Executing GotoIf("SIP/800-09210068", "1?continue") in new stack
-- Goto (macro-user-callerid,s,23)
-- Executing NoOp("SIP/800-09210068", "Using CallerID "Jennifer" <800>") in                                      new stack
-- Executing Macro("SIP/800-09210068", "record-enable|800|OUT") in new stack
-- Executing GotoIf("SIP/800-09210068", "0?2:4") in new stack
-- Goto (macro-record-enable,s,4)
-- Executing AGI("SIP/800-09210068", "recordingcheck|20070912-175928|1189634                                     368.16") in new stack
-- Launched AGI Script /var/lib/asterisk/agi-bin/recordingcheck

recordingcheck|20070912-175928|1189634368.16: Outbound recording not enabled
– AGI Script recordingcheck completed, returning 0
– Executing NoOp(“SIP/800-09210068”, “No recording needed”) in new stack
– Executing GotoIf(“SIP/800-09210068”, “0?skipoutcid”) in new stack
– Executing Set(“SIP/800-09210068”, “DIAL_TRUNK_OPTIONS=”) in new stack
– Executing Macro(“SIP/800-09210068”, “outbound-callerid|1”) in new stack
– Executing GotoIf(“SIP/800-09210068”, “1?start”) in new stack
– Goto (macro-outbound-callerid,s,3)
– Executing NoOp(“SIP/800-09210068”, “REALCALLERIDNUM is 800”) in new stack
– Executing GotoIf(“SIP/800-09210068”, “1?normcid”) in new stack
– Goto (macro-outbound-callerid,s,9)
– Executing Set(“SIP/800-09210068”, “USEROUTCID=”) in new stack
– Executing Set(“SIP/800-09210068”, “EMERGENCYCID=”) in new stack
– Executing Set(“SIP/800-09210068”, “TRUNKOUTCID=Christian Caine”) in new s tack
– Executing GotoIf(“SIP/800-09210068”, “1?trunkcid”) in new stack
– Goto (macro-outbound-callerid,s,16)
– Executing GotoIf(“SIP/800-09210068”, “0?usercid”) in new stack
– Executing Set(“SIP/800-09210068”, “CALLERID(all)=Christian Caine”) in new stack
– Executing GotoIf(“SIP/800-09210068”, “1?report”) in new stack
– Goto (macro-outbound-callerid,s,22)
– Executing NoOp(“SIP/800-09210068”, “CallerID set to “Christian Caine” <>” ) in new stack
– Executing GotoIf(“SIP/800-09210068”, “1?nomax”) in new stack
– Goto (macro-dialout-trunk,s,17)
– Executing AGI(“SIP/800-09210068”, “fixlocalprefix”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/fixlocalprefix
– AGI Script fixlocalprefix completed, returning 0
– Executing Set(“SIP/800-09210068”, “OUTNUM=876XXXX”) in new stack
– Executing Set(“SIP/800-09210068”, “custom=ZAP/g0”) in new stack
– Executing GotoIf(“SIP/800-09210068”, “1?gocall”) in new stack
– Goto (macro-dialout-trunk,s,22)
– Executing GotoIf(“SIP/800-09210068”, “0?customtrunk”) in new stack
– Executing Dial(“SIP/800-09210068”, “ZAP/g0/876XXXX|300|”) in new stack
– Called g0/876XXXX
– Zap/1-1 answered SIP/800-09210068

Hi,
the ZAP/g1 syntax is for groups of trunks.
I never had much success with that, I just use channels directly as in ZAP/1 ZAP/2 etc., I find it easier to keep track of and it works OK.

Zap/g0 and Zap/G0 refer to the group 0, which can include one or more lines. These are determined by the group= setting in zapata.conf. (see http://www.voip-info.org/wiki-Asterisk+config+zapata.conf)

If you have, eg:

group=0,1
channel => 1
group=0
channel => 2
group=1
channel => 3

Then having a single trunk Zap/g0 in freepbx will try to call out channel 2, and then channel 1. It’s the equivalent of having two trunks Zap/2, Zap/1 in your trunk sequence. Zap/G0 will just go the other way, trying channel 1 and then channel 2.

Having multiple groups can be handy, eg. You might want a group that includes just some of your lines, for normal outbound calling (and then you can call out on voip lines after that, leaving the rest of your POTS for incoming calls). Then another group that includes all lines, that can be used by emergency routes for dialing 911.

If you want to address individual channels and control all the sequence and memberships from within freepbx, it is best to use Zap/1 syntax.


Greg MacLellan - Core freePBX Developer
http//freepbx.org - irc.freenode.net #freepbx