Multiple outgoing calls dahdi

FreePBX Version 2.8.1.4
Asterisk 1.8.3.2
DAHDI Version: 2.4.0 Echo Canceller: MG2

Having trouble with making multiple outgoing calls through Dahdi trunks. First outbound call succeeds. Second gets a busy signal without actually even picking up the trunk.

Have created OutBound Route:

[outrt-1] ; CallOut
include => outrt-1-custom
exten => _1NXXXXXXXXX,1,Macro(user-callerid,SKIPTTL,)
exten => _1NXXXXXXXXX,n,Noop(Calling Out Route: CallOut)
exten => _1NXXXXXXXXX,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => _1NXXXXXXXXX,n,ExecIf($["${KEEPCID}"!=“TRUE” & ${LEN(${DB(AMPUSER/${AMPUSER}/outboundcid)})}=0 & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=13126441650))
exten => _1NXXXXXXXXX,n,Set(_NODEST=)
exten => _1NXXXXXXXXX,n,Macro(record-enable,${AMPUSER},OUT,)
exten => _1NXXXXXXXXX,n,Macro(dialout-trunk,3,${EXTEN},)
exten => _1NXXXXXXXXX,n,Macro(dialout-trunk,2,${EXTEN},)
exten => _1NXXXXXXXXX,n,Macro(dialout-trunk,1,${EXTEN},)
exten => _1NXXXXXXXXX,n,Macro(dialout-trunk,5,${EXTEN},)
exten => _1NXXXXXXXXX,n,Macro(dialout-trunk,4,${EXTEN},)
exten => _1NXXXXXXXXX,n,Macro(outisbusy,)

; end of [outrt-1]

It indicates a list of trunks to try in order. When second call is made, only the first trunk is tried. It never falls through to any other trunk.

Log of second call:

[May 13 13:13:56] VERBOSE[5506] netsock2.c: == Using SIP RTP TOS bits 184
[May 13 13:13:56] VERBOSE[5506] netsock2.c: == Using SIP RTP CoS mark 5
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [13122019260@from-internal:1] Macro(“SIP/202-00000035”, “user-callerid,SKIPTTL,”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [s@macro-user-callerid:1] Set(“SIP/202-00000035”, “AMPUSER=202”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [s@macro-user-callerid:2] GotoIf(“SIP/202-00000035”, “0?report”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [s@macro-user-callerid:3] ExecIf(“SIP/202-00000035”, “1?Set(REALCALLERIDNUM=202)”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [s@macro-user-callerid:4] Set(“SIP/202-00000035”, “AMPUSER=202”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [s@macro-user-callerid:5] Set(“SIP/202-00000035”, “AMPUSERCIDNAME=Steve”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [s@macro-user-callerid:6] GotoIf(“SIP/202-00000035”, “0?report”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [s@macro-user-callerid:7] Set(“SIP/202-00000035”, “AMPUSERCID=202”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [s@macro-user-callerid:8] Set(“SIP/202-00000035”, “CALLERID(all)=“Steve” <202>”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [s@macro-user-callerid:9] GotoIf(“SIP/202-00000035”, “1?continue”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Goto (macro-user-callerid,s,18)
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [s@macro-user-callerid:18] Set(“SIP/202-00000035”, “CALLERID(number)=202”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [s@macro-user-callerid:19] Set(“SIP/202-00000035”, “CALLERID(name)=Steve”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [s@macro-user-callerid:20] NoOp(“SIP/202-00000035”, “Using CallerID “Steve” <202>”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [13122019260@from-internal:2] NoOp(“SIP/202-00000035”, “Calling Out Route: CallOut”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [13122019260@from-internal:3] Set(“SIP/202-00000035”, “MOHCLASS=default”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [13122019260@from-internal:4] ExecIf(“SIP/202-00000035”, “1?Set(TRUNKCIDOVERRIDE=13126441650)”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [13122019260@from-internal:5] Set(“SIP/202-00000035”, “_NODEST=”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [13122019260@from-internal:6] Macro(“SIP/202-00000035”, “record-enable,202,OUT,”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [s@macro-record-enable:1] GotoIf(“SIP/202-00000035”, “1?check”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Goto (macro-record-enable,s,4)
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [s@macro-record-enable:4] ExecIf(“SIP/202-00000035”, “0?MacroExit()”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [s@macro-record-enable:5] GotoIf(“SIP/202-00000035”, “0?Group:OUT”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Goto (macro-record-enable,s,15)
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [s@macro-record-enable:15] GotoIf(“SIP/202-00000035”, “0?IN”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [s@macro-record-enable:16] ExecIf(“SIP/202-00000035”, “1?MacroExit()”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [13122019260@from-internal:7] Macro(“SIP/202-00000035”, “dialout-trunk,4,13122019260,”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [s@macro-dialout-trunk:1] Set(“SIP/202-00000035”, “DIAL_TRUNK=4”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [s@macro-dialout-trunk:2] GosubIf(“SIP/202-00000035”, “0?sub-pincheck,s,1”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [s@macro-dialout-trunk:3] GotoIf(“SIP/202-00000035”, “0?disabletrunk,1”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [s@macro-dialout-trunk:4] Set(“SIP/202-00000035”, “DIAL_NUMBER=13122019260”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [s@macro-dialout-trunk:5] Set(“SIP/202-00000035”, “DIAL_TRUNK_OPTIONS=tr”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [s@macro-dialout-trunk:6] Set(“SIP/202-00000035”, “OUTBOUND_GROUP=OUT_4”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [s@macro-dialout-trunk:7] GotoIf(“SIP/202-00000035”, “1?nomax”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Goto (macro-dialout-trunk,s,9)
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [s@macro-dialout-trunk:9] GotoIf(“SIP/202-00000035”, “0?skipoutcid”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [s@macro-dialout-trunk:10] Set(“SIP/202-00000035”, “DIAL_TRUNK_OPTIONS=”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [s@macro-dialout-trunk:11] Macro(“SIP/202-00000035”, “outbound-callerid,4”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [s@macro-outbound-callerid:1] ExecIf(“SIP/202-00000035”, “0?Set(CALLERPRES()=)”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [s@macro-outbound-callerid:2] ExecIf(“SIP/202-00000035”, “0?Set(REALCALLERIDNUM=202)”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [s@macro-outbound-callerid:3] GotoIf(“SIP/202-00000035”, “1?normcid”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Goto (macro-outbound-callerid,s,6)
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [s@macro-outbound-callerid:6] Set(“SIP/202-00000035”, “USEROUTCID=”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [s@macro-outbound-callerid:7] Set(“SIP/202-00000035”, “EMERGENCYCID=”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [s@macro-outbound-callerid:8] Set(“SIP/202-00000035”, “TRUNKOUTCID=3126441651”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [s@macro-outbound-callerid:9] GotoIf(“SIP/202-00000035”, “1?trunkcid”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Goto (macro-outbound-callerid,s,12)
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [s@macro-outbound-callerid:12] ExecIf(“SIP/202-00000035”, “1?Set(CALLERID(all)=3126441651)”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [s@macro-outbound-callerid:13] ExecIf(“SIP/202-00000035”, “0?Set(CALLERID(all)=)”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [s@macro-outbound-callerid:14] ExecIf(“SIP/202-00000035”, “1?Set(CALLERID(all)=13126441650)”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [s@macro-outbound-callerid:15] ExecIf(“SIP/202-00000035”, “0?Set(CALLERPRES()=prohib_passed_screen)”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [s@macro-dialout-trunk:12] GosubIf(“SIP/202-00000035”, “0?sub-flp-4,s,1”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [s@macro-dialout-trunk:13] Set(“SIP/202-00000035”, “OUTNUM=13122019260”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [s@macro-dialout-trunk:14] Set(“SIP/202-00000035”, “custom=DAHDI/3”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [s@macro-dialout-trunk:15] ExecIf(“SIP/202-00000035”, “0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^default))”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [s@macro-dialout-trunk:16] Macro(“SIP/202-00000035”, “dialout-trunk-predial-hook,”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [s@macro-dialout-trunk-predial-hook:1] MacroExit(“SIP/202-00000035”, “”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [s@macro-dialout-trunk:17] GotoIf(“SIP/202-00000035”, “0?bypass,1”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [s@macro-dialout-trunk:18] GotoIf(“SIP/202-00000035”, “0?customtrunk”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [s@macro-dialout-trunk:19] Dial(“SIP/202-00000035”, “DAHDI/3/13122019260,300,”) in new stack
[May 13 13:13:56] WARNING[22698] app_dial.c: Unable to create channel of type ‘DAHDI’ (cause 17 - User busy)
[May 13 13:13:56] VERBOSE[22698] app_dial.c: == Everyone is busy/congested at this time (1:1/0/0)
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [s@macro-dialout-trunk:20] NoOp(“SIP/202-00000035”, “Dial failed for some reason with DIALSTATUS = BUSY and HANGUPCAUSE = 17”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [s@macro-dialout-trunk:21] Goto(“SIP/202-00000035”, “s-BUSY,1”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Goto (macro-dialout-trunk,s-BUSY,1)
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [s-BUSY@macro-dialout-trunk:1] NoOp(“SIP/202-00000035”, “Dial failed due to trunk reporting BUSY - giving up”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [s-BUSY@macro-dialout-trunk:2] PlayTones(“SIP/202-00000035”, “busy”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [s-BUSY@macro-dialout-trunk:3] Busy(“SIP/202-00000035”, “20”) in new stack
[May 13 13:13:56] VERBOSE[22698] app_macro.c: == Spawn extension (macro-dialout-trunk, s-BUSY, 3) exited non-zero on ‘SIP/202-00000035’ in macro ‘dialout-trunk’
[May 13 13:13:56] VERBOSE[22698] pbx.c: == Spawn extension (from-internal, 13122019260, 7) exited non-zero on ‘SIP/202-00000035’
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [h@from-internal:1] Macro(“SIP/202-00000035”, “hangupcall”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [s@macro-hangupcall:1] GotoIf(“SIP/202-00000035”, “1?skiprg”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Goto (macro-hangupcall,s,4)
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [s@macro-hangupcall:4] GotoIf(“SIP/202-00000035”, “1?skipblkvm”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Goto (macro-hangupcall,s,7)
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [s@macro-hangupcall:7] GotoIf(“SIP/202-00000035”, “1?theend”) in new stack
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Goto (macro-hangupcall,s,9)
[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [s@macro-hangupcall:9] Hangup(“SIP/202-00000035”, “”) in new stack
[May 13 13:13:56] VERBOSE[22698] app_macro.c: == Spawn extension (macro-hangupcall, s, 9) exited non-zero on ‘SIP/202-00000035’ in macro ‘hangupcall’
[May 13 13:13:56] VERBOSE[22698] pbx.c: == Spawn extension (from-internal, h, 1) exited non-zero on ‘SIP/202-00000035’

macro-dialout-trunk does not seem to report the trunk status correctly. It seems that somehow fallthrough the the next trunk is not working. Not sure exactly how it is supposed to work, as I have no working logs to compare to.

Anyone have any ideas? This is important as this is now in production.

Steve

If it is busy, there is no need to go to the other trunks as they would also report busy.

Your log is confusing, I don’t even see it trying to grab a DAHDI channel.

Do you have your channels configured in a group? The trunk DAHDI identifier should be gX where x = the group number.

The line is:

[May 13 13:13:56] VERBOSE[22698] pbx.c: – Executing [s@macro-dialout-trunk:19] Dial(“SIP/202-00000035”, “DAHDI/3/13122019260,300,”) in new stack

Doesn’t the outbound route determine the trunks used by channel? Do the trunks need to be identified as a group to work? Is there a way to set the order of outbound trunks?

The outbound route page seems to indicate that I can select each trunk in the order that I want them. In this case, I had created 5 separate trunks bu channel and listed them in the order of use.

Steve

Hello. I happen to have the same problem. I tried to configure 2 Zap (dahdi compatible) trunks, entering 1 and 2 as the zap trunk. I tried also to put each port in the DAHDI section to a different group, and then create 2 Dahdi trunks, specifying channel1 and channel 2, or even group 1 ascending or group 2 ascenting.

All these configuration give the same result, the first call is made, but the second sound busy. If I create an outgoing plan that specifies directly the trunk to use, that I can make two calls with my two pstn lines at the same time.

It just doesn’t go to the second trunk when the first one is in use. As said, I want to be able to make a plan based on some rules, that choose the right pstn line.

Oh, it’s so easy and stupid the answer, I’m a little ashamed. When you create a trick, may it be Dahdi or Zap dahdi compatible, just don’t forget:

Maximum Channels: 1!!! It was empty so of course it was trying to make a second call on the same channel. since it’s an analog phone line, you can’t be on the same line so it was rigning as busy.

hope it will help some newbies like me!!!