Handling of HANGUPCAUSE=1 when DIALSTATUS=CONGESTION

Hi everyone,
I’m new in the forum and new in freePBX, so thankyou in advance for any tip or help.
I’m getting some trouble with phone-calls to “not-existing” numbers, the operators are getting “all-circuit are busy” message, and that message cause some confusion because it’s played in too many situations, in particular when our sip providers are down… And unfortunately this happens often (yes, I know, we need to change provider… :)…

I’ve seen another discussion on this issue:

http://www.freepbx.org/forum/freepbx/users/potential-incorrect-handling-of-sip-404#comment_form

After reading the other thread it seems to me, that the problem is solved with 2.7 version of freepbx, but I’m still getting the same issue in 2.8 too.

I’ve tried to use “Route Congestion Messages” module to change the behavior, but I get nothing different.

I attach the log of a relevant call.

Best Regards,
francesco

Oct 13 17:01:53] VERBOSE[7155] pbx.c: -- Executing [0xxxxxxxxxx@from-internal:1] Macro("SIP/278-00000000", "user-callerid,SKIPTTL,") in new stack
[Oct 13 17:01:53] VERBOSE[7155] pbx.c: -- Executing [s@macro-user-callerid:1] Set("SIP/278-00000000", "AMPUSER=278") in new stack
[Oct 13 17:01:53] VERBOSE[7155] pbx.c: -- Executing [s@macro-user-callerid:2] GotoIf("SIP/278-00000000", "0?report") in new stack
[Oct 13 17:01:53] VERBOSE[7155] pbx.c: -- Executing [s@macro-user-callerid:3] ExecIf("SIP/278-00000000", "1?Set(REALCALLERIDNUM=278)") in new stack
[Oct 13 17:01:53] VERBOSE[7155] pbx.c: -- Executing [s@macro-user-callerid:4] Set("SIP/278-00000000", "AMPUSER=278") in new stack
[Oct 13 17:01:53] VERBOSE[7155] pbx.c: -- Executing [s@macro-user-callerid:5] Set("SIP/278-00000000", "AMPUSERCIDNAME=Francesco") in new stack
[Oct 13 17:01:53] VERBOSE[7155] pbx.c: -- Executing [s@macro-user-callerid:6] GotoIf("SIP/278-00000000", "0?report") in new stack
[Oct 13 17:01:53] VERBOSE[7155] pbx.c: -- Executing [s@macro-user-callerid:7] Set("SIP/278-00000000", "AMPUSERCID=278") in new stack
[Oct 13 17:01:53] VERBOSE[7155] pbx.c: -- Executing [s@macro-user-callerid:8] Set("SIP/278-00000000", "CALLERID(all)="Francesco" <278>") in new stack
[Oct 13 17:01:53] VERBOSE[7155] pbx.c: -- Executing [s@macro-user-callerid:9] ExecIf("SIP/278-00000000", "0?Set(CHANNEL(language)=)") in new stack
[Oct 13 17:01:53] VERBOSE[7155] pbx.c: -- Executing [s@macro-user-callerid:10] GotoIf("SIP/278-00000000", "1?continue") in new stack
[Oct 13 17:01:53] VERBOSE[7155] pbx.c: -- Goto (macro-user-callerid,s,19)
[Oct 13 17:01:53] VERBOSE[7155] pbx.c: -- Executing [s@macro-user-callerid:19] NoOp("SIP/278-00000000", "Using CallerID "Francesco" <278>") in new stack
[Oct 13 17:01:53] VERBOSE[7155] pbx.c: -- Executing [0xxxxxxxxxx@from-internal:2] NoOp("SIP/278-00000000", "Calling Out Route: 0-outside-oscurato") in new stack
[Oct 13 17:01:53] VERBOSE[7155] pbx.c: -- Executing [0xxxxxxxxxx@from-internal:3] Set("SIP/278-00000000", "MOHCLASS=default") in new stack
[Oct 13 17:01:53] VERBOSE[7155] pbx.c: -- Executing [0xxxxxxxxxx@from-internal:4] Set("SIP/278-00000000", "_NODEST=") in new stack
[Oct 13 17:01:53] VERBOSE[7155] pbx.c: -- Executing [0xxxxxxxxxx@from-internal:5] Macro("SIP/278-00000000", "record-enable,278,OUT,") in new stack
[Oct 13 17:01:53] VERBOSE[7155] pbx.c: -- Executing [s@macro-record-enable:1] GotoIf("SIP/278-00000000", "1?check") in new stack
[Oct 13 17:01:53] VERBOSE[7155] pbx.c: -- Goto (macro-record-enable,s,4)
[Oct 13 17:01:53] VERBOSE[7155] pbx.c: -- Executing [s@macro-record-enable:4] ExecIf("SIP/278-00000000", "0?MacroExit()") in new stack
[Oct 13 17:01:53] VERBOSE[7155] pbx.c: -- Executing [s@macro-record-enable:5] GotoIf("SIP/278-00000000", "0?Group:OUT") in new stack
[Oct 13 17:01:53] VERBOSE[7155] pbx.c: -- Goto (macro-record-enable,s,15)
[Oct 13 17:01:53] VERBOSE[7155] pbx.c: -- Executing [s@macro-record-enable:15] GotoIf("SIP/278-00000000", "0?IN") in new stack
[Oct 13 17:01:53] VERBOSE[7155] pbx.c: -- Executing [s@macro-record-enable:16] ExecIf("SIP/278-00000000", "1?MacroExit()") in new stack
[Oct 13 17:01:53] VERBOSE[7155] pbx.c: -- Executing [0xxxxxxxxxx@from-internal:6] Macro("SIP/278-00000000", "dialout-trunk,2,xxxxxxxxxx,") in new stack
[Oct 13 17:01:53] VERBOSE[7155] pbx.c: -- Executing [s@macro-dialout-trunk:1] Set("SIP/278-00000000", "DIAL_TRUNK=2") in new stack
[Oct 13 17:01:53] VERBOSE[7155] pbx.c: -- Executing [s@macro-dialout-trunk:2] GosubIf("SIP/278-00000000", "0?sub-pincheck,s,1") in new stack
[Oct 13 17:01:53] VERBOSE[7155] pbx.c: -- Executing [s@macro-dialout-trunk:3] GotoIf("SIP/278-00000000", "0?disabletrunk,1") in new stack
[Oct 13 17:01:53] VERBOSE[7155] pbx.c: -- Executing [s@macro-dialout-trunk:4] Set("SIP/278-00000000", "DIAL_NUMBER=xxxxxxxxxx") in new stack
[Oct 13 17:01:53] VERBOSE[7155] pbx.c: -- Executing [s@macro-dialout-trunk:5] Set("SIP/278-00000000", "DIAL_TRUNK_OPTIONS=trTwW") in new stack
[Oct 13 17:01:53] VERBOSE[7155] pbx.c: -- Executing [s@macro-dialout-trunk:6] Set("SIP/278-00000000", "OUTBOUND_GROUP=OUT_2") in new stack
[Oct 13 17:01:53] VERBOSE[7155] pbx.c: -- Executing [s@macro-dialout-trunk:7] GotoIf("SIP/278-00000000", "1?nomax") in new stack
[Oct 13 17:01:53] VERBOSE[7155] pbx.c: -- Goto (macro-dialout-trunk,s,9)
[Oct 13 17:01:53] VERBOSE[7155] pbx.c: -- Executing [s@macro-dialout-trunk:9] GotoIf("SIP/278-00000000", "0?skipoutcid") in new stack
[Oct 13 17:01:53] VERBOSE[7155] pbx.c: -- Executing [s@macro-dialout-trunk:10] Set("SIP/278-00000000", "DIAL_TRUNK_OPTIONS=tTwW") in new stack
[Oct 13 17:01:53] VERBOSE[7155] pbx.c: -- Executing [s@macro-dialout-trunk:11] Macro("SIP/278-00000000", "outbound-callerid,2") in new stack
[Oct 13 17:01:53] VERBOSE[7155] pbx.c: -- Executing [s@macro-outbound-callerid:1] ExecIf("SIP/278-00000000", "0?Set(CALLERPRES()=)") in new stack
[Oct 13 17:01:53] VERBOSE[7155] pbx.c: -- Executing [s@macro-outbound-callerid:2] ExecIf("SIP/278-00000000", "0?Set(REALCALLERIDNUM=278)") in new stack
[Oct 13 17:01:53] VERBOSE[7155] pbx.c: -- Executing [s@macro-outbound-callerid:3] GotoIf("SIP/278-00000000", "1?normcid") in new stack
[Oct 13 17:01:53] VERBOSE[7155] pbx.c: -- Goto (macro-outbound-callerid,s,6)
[Oct 13 17:01:53] VERBOSE[7155] pbx.c: -- Executing [s@macro-outbound-callerid:6] Set("SIP/278-00000000", "USEROUTCID=") in new stack
[Oct 13 17:01:53] VERBOSE[7155] pbx.c: -- Executing [s@macro-outbound-callerid:7] Set("SIP/278-00000000", "EMERGENCYCID=") in new stack
[Oct 13 17:01:53] VERBOSE[7155] pbx.c: -- Executing [s@macro-outbound-callerid:8] Set("SIP/278-00000000", "TRUNKOUTCID=HIDDEN") in new stack
[Oct 13 17:01:53] VERBOSE[7155] pbx.c: -- Executing [s@macro-outbound-callerid:9] GotoIf("SIP/278-00000000", "1?trunkcid") in new stack
[Oct 13 17:01:53] VERBOSE[7155] pbx.c: -- Goto (macro-outbound-callerid,s,12)
[Oct 13 17:01:53] VERBOSE[7155] pbx.c: -- Executing [s@macro-outbound-callerid:12] ExecIf("SIP/278-00000000", "1?Set(CALLERID(all)=HIDDEN)") in new stack
[Oct 13 17:01:53] VERBOSE[7155] pbx.c: -- Executing [s@macro-outbound-callerid:13] ExecIf("SIP/278-00000000", "0?Set(CALLERID(all)=)") in new stack
[Oct 13 17:01:53] VERBOSE[7155] pbx.c: -- Executing [s@macro-outbound-callerid:14] ExecIf("SIP/278-00000000", "0?Set(CALLERID(all)=)") in new stack
[Oct 13 17:01:53] VERBOSE[7155] pbx.c: -- Executing [s@macro-outbound-callerid:15] ExecIf("SIP/278-00000000", "0?Set(CALLERPRES()=prohib_passed_screen)") in new stack
[Oct 13 17:01:53] VERBOSE[7155] pbx.c: -- Executing [s@macro-dialout-trunk:12] GosubIf("SIP/278-00000000", "0?sub-flp-2,s,1") in new stack
[Oct 13 17:01:53] VERBOSE[7155] pbx.c: -- Executing [s@macro-dialout-trunk:13] Set("SIP/278-00000000", "OUTNUM=xxxxxxxxxx") in new stack
[Oct 13 17:01:53] VERBOSE[7155] pbx.c: -- Executing [s@macro-dialout-trunk:14] Set("SIP/278-00000000", "custom=SIP/xxxxxxxxxx") in new stack
[Oct 13 17:01:53] VERBOSE[7155] pbx.c: -- Executing [s@macro-dialout-trunk:15] ExecIf("SIP/278-00000000", "0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^default)tTwW)") in new stack
[Oct 13 17:01:53] VERBOSE[7155] pbx.c: -- Executing [s@macro-dialout-trunk:16] Macro("SIP/278-00000000", "dialout-trunk-predial-hook,") in new stack
[Oct 13 17:01:53] VERBOSE[7155] pbx.c: -- Executing [s@macro-dialout-trunk-predial-hook:1] MacroExit("SIP/278-00000000", "") in new stack
[Oct 13 17:01:53] VERBOSE[7155] pbx.c: -- Executing [s@macro-dialout-trunk:17] GotoIf("SIP/278-00000000", "0?bypass,1") in new stack
[Oct 13 17:01:53] VERBOSE[7155] pbx.c: -- Executing [s@macro-dialout-trunk:18] GotoIf("SIP/278-00000000", "0?customtrunk") in new stack
[Oct 13 17:01:53] VERBOSE[7155] pbx.c: -- Executing [s@macro-dialout-trunk:19] Dial("SIP/278-00000000", "SIP/xxxxxxxxxx/xxxxxxxxxx,300,tTwW") in new stack
[Oct 13 17:01:53] VERBOSE[7155] netsock.c: == Using SIP RTP TOS bits 184
[Oct 13 17:01:53] VERBOSE[7155] netsock.c: == Using SIP RTP CoS mark 5
[Oct 13 17:01:53] VERBOSE[7155] netsock.c: == Using SIP VRTP TOS bits 136
[Oct 13 17:01:53] VERBOSE[7155] netsock.c: == Using SIP VRTP CoS mark 6
[Oct 13 17:01:53] VERBOSE[7155] app_dial.c: -- Called xxxxxxxxxx/xxxxxxxxxx
[Oct 13 17:01:54] VERBOSE[7155] app_dial.c: -- SIP/xxxxxxxxxx-00000001 is circuit-busy
[Oct 13 17:01:54] VERBOSE[7155] app_dial.c: == Everyone is busy/congested at this time (1:0/1/0)
[Oct 13 17:01:54] VERBOSE[7155] pbx.c: -- Executing [s@macro-dialout-trunk:20] NoOp("SIP/278-00000000", "Dial failed for some reason with DIALSTATUS = CONGESTION and HANGUPCAUSE = 1") in new stack
[Oct 13 17:01:54] VERBOSE[7155] pbx.c: -- Executing [s@macro-dialout-trunk:21] Goto("SIP/278-00000000", "s-CONGESTION,1") in new stack
[Oct 13 17:01:54] VERBOSE[7155] pbx.c: -- Goto (macro-dialout-trunk,s-CONGESTION,1)
[Oct 13 17:01:54] VERBOSE[7155] pbx.c: -- Executing [s-CONGESTION@macro-dialout-trunk:1] Set("SIP/278-00000000", "RC=1") in new stack
[Oct 13 17:01:54] VERBOSE[7155] pbx.c: -- Executing [s-CONGESTION@macro-dialout-trunk:2] Goto("SIP/278-00000000", "1,1") in new stack
[Oct 13 17:01:54] VERBOSE[7155] pbx.c: -- Goto (macro-dialout-trunk,1,1)
[Oct 13 17:01:54] VERBOSE[7155] pbx.c: -- Executing [1@macro-dialout-trunk:1] Goto("SIP/278-00000000", "continue,1") in new stack
[Oct 13 17:01:54] VERBOSE[7155] pbx.c: -- Goto (macro-dialout-trunk,continue,1)
[Oct 13 17:01:54] VERBOSE[7155] pbx.c: -- Executing [continue@macro-dialout-trunk:1] GotoIf("SIP/278-00000000", "1?noreport") in new stack
[Oct 13 17:01:54] VERBOSE[7155] pbx.c: -- Goto (macro-dialout-trunk,continue,3)
[Oct 13 17:01:54] VERBOSE[7155] pbx.c: -- Executing [continue@macro-dialout-trunk:3] NoOp("SIP/278-00000000", "TRUNK Dial failed due to CONGESTION HANGUPCAUSE: 1 - failing through to other trunks") in new stack
[Oct 13 17:01:54] VERBOSE[7155] pbx.c: -- Executing [continue@macro-dialout-trunk:4] Set("SIP/278-00000000", "CALLERID(number)=278") in new stack
[Oct 13 17:01:54] VERBOSE[7155] pbx.c: -- Executing [0xxxxxxxxxx@from-internal:7] Macro("SIP/278-00000000", "outisbusy,") in new stack
[Oct 13 17:01:54] VERBOSE[7155] pbx.c: -- Executing [s@macro-outisbusy:1] Progress("SIP/278-00000000", "") in new stack
[Oct 13 17:01:54] VERBOSE[7155] pbx.c: -- Executing [s@macro-outisbusy:2] GotoIf("SIP/278-00000000", "0?emergency,1") in new stack
[Oct 13 17:01:54] VERBOSE[7155] pbx.c: -- Executing [s@macro-outisbusy:3] GotoIf("SIP/278-00000000", "0?intracompany,1") in new stack
[Oct 13 17:01:54] VERBOSE[7155] pbx.c: -- Executing [s@macro-outisbusy:4] Playback("SIP/278-00000000", "custom/test, noanswer") in new stack
[Oct 13 17:01:54] VERBOSE[7155] file.c: -- <SIP/278-00000000> Playing 'custom/test.slin' (language 'it')
[Oct 13 17:01:58] VERBOSE[7155] pbx.c: -- Executing [s@macro-outisbusy:5] Congestion("SIP/278-00000000", "20") in new stack
[Oct 13 17:01:58] VERBOSE[7155] app_macro.c: == Spawn extension (macro-outisbusy, s, 5) exited non-zero on 'SIP/278-00000000' in macro 'outisbusy'
[Oct 13 17:01:58] VERBOSE[7155] pbx.c: == Spawn extension (from-internal, 0xxxxxxxxxx, 7) exited non-zero on 'SIP/278-00000000'
[Oct 13 17:01:58] VERBOSE[7155] pbx.c: -- Executing [h@from-internal:1] Macro("SIP/278-00000000", "hangupcall") in new stack
[Oct 13 17:01:58] VERBOSE[7155] pbx.c: -- Executing [s@macro-hangupcall:1] GotoIf("SIP/278-00000000", "1?skiprg") in new stack
[Oct 13 17:01:58] VERBOSE[7155] pbx.c: -- Goto (macro-hangupcall,s,4)
[Oct 13 17:01:58] VERBOSE[7155] pbx.c: -- Executing [s@macro-hangupcall:4] GotoIf("SIP/278-00000000", "1?skipblkvm") in new stack
[Oct 13 17:01:58] VERBOSE[7155] pbx.c: -- Goto (macro-hangupcall,s,7)
[Oct 13 17:01:58] VERBOSE[7155] pbx.c: -- Executing [s@macro-hangupcall:7] GotoIf("SIP/278-00000000", "1?theend") in new stack
[Oct 13 17:01:58] VERBOSE[7155] pbx.c: -- Goto (macro-hangupcall,s,9)
[Oct 13 17:01:58] VERBOSE[7155] pbx.c: -- Executing [s@macro-hangupcall:9] Hangup("SIP/278-00000000", "") in new stack
[Oct 13 17:01:58] VERBOSE[7155] app_macro.c: == Spawn extension (macro-hangupcall, s, 9) exited non-zero on 'SIP/278-00000000' in macro 'hangupcall'
[Oct 13 17:01:58] VERBOSE[7155] pbx.c: == Spawn extension (from-internal, h, 1) exited non-zero on 'SIP/278-00000000'
[Oct 13 17:06:07] VERBOSE[7122] dnsmgr.c: -- Refreshing DNS lookups.

Hi,
I’ve made some test, and I’ve solved creating extensions_override_freepbx.conf and doing an override of the outisbusy macro something like:

[macro-outisbusy]
include => macro-outisbusy-custom
exten => s,1,Progress
exten => s,n,GotoIf($["${EMERGENCYROUTE}" = "YES"]?emergency,1)
exten => s,n,GotoIf($["${INTRACOMPANYROUTE}" = "YES"]?intracompany,1)
exten => s,n,GotoIf($["${HANGUPCAUSE}" = "1"]?numeroInesistente,1)
exten => s,n,Playback(all-circuits-busy-now&pls-try-call-later, noanswer)
exten => s,n,Congestion(20)
exten => s,n,Hangup
exten => numeroInesistente,1,Playback(custom/test, noanswer)
exten => numeroInesistente,n,Congestion(20)
exten => numeroInesistente,n,Hangup
exten => intracompany,1,Playback(all-circuits-busy-now&pls-try-call-later, noanswer)
exten => intracompany,n,Congestion(20)
exten => intracompany,n,Hangup
exten => emergency,1,Playback(all-circuits-busy-now&pls-try-call-later)
exten => emergency,n,Congestion(20)
exten => emergency,n,Hangup

Is it a good solution?

Thanks again in advance.

francesco