It looks like this is the change that stopped it from working:
Without that change, it still works correctly (according to the request in FREEPBX-13726) by ringing the first available extension.
I’m not sure why those lines were commented out. The previous logic makes sense to me:
Previous logic:
If the first extension rings and there is no answer:
if(RingGroupMethod == firstavailable || RingGroupMethod == firstnotonphone) && DialStatus != BUSY)
{
HuntMembers = 0;
}
HuntMembers = HuntMembers - 1;
...
New logic:
If the first extension rings and there is no answer:
HuntMembers = HuntMembers - 1;
...
Logs before change:
== Spawn extension (from-internal, 100, 1) exited non-zero on 'SIP/101-0000005b'
-- SIP/101-0000005b Internal Gosub(func-apply-sipheaders,s,1) complete GOSUB_RETVAL=
-- Called SIP/101
-- SIP/101-0000005b is ringing
-- Nobody picked up in 15000 ms
-- Executing [s@macro-dial:49] GotoIf("SIP/851-0000005a", "0?ANSWER,1") in new stack
-- Executing [s@macro-dial:50] Set("SIP/851-0000005a", "HuntLoop=1") in new stack
-- Executing [s@macro-dial:51] GotoIf("SIP/851-0000005a", "0?a46") in new stack
-- Executing [s@macro-dial:52] Set("SIP/851-0000005a", "HuntMembers=0") in new stack
-- Executing [s@macro-dial:53] Set("SIP/851-0000005a", "HuntMembers=-1") in new stack
-- Executing [s@macro-dial:54] Goto("SIP/851-0000005a", "s,a22") in new stack
-- Goto (macro-dial,s,27)
-- Executing [s@macro-dial:27] GotoIf("SIP/851-0000005a", "0?a30") in new stack
-- Executing [s@macro-dial:28] NoOp("SIP/851-0000005a", "Returning as there are no members left in the hunt group to ring") in new stack
Logs after change:
== Spawn extension (from-internal, 100, 1) exited non-zero on 'SIP/101-00000363'
-- SIP/101-00000363 Internal Gosub(func-apply-sipheaders,s,1) complete GOSUB_RETVAL=
-- Called SIP/101
-- SIP/101-00000363 is ringing
-- Nobody picked up in 15000 ms
-- Executing [s@macro-dial:49] GotoIf("SIP/Flowroute-00000362", "0?ANSWER,1") in new stack
-- Executing [s@macro-dial:50] Set("SIP/Flowroute-00000362", "HuntLoop=1") in new stack
-- Executing [s@macro-dial:51] Set("SIP/Flowroute-00000362", "HuntMembers=3") in new stack
-- Executing [s@macro-dial:52] Goto("SIP/Flowroute-00000362", "s,a22") in new stack
-- Goto (macro-dial,s,27)
-- Executing [s@macro-dial:27] GotoIf("SIP/Flowroute-00000362", "1?a30") in new stack
-- Goto (macro-dial,s,30)
-- Executing [s@macro-dial:30] Set("SIP/Flowroute-00000362", "HuntMember=HuntMember1") in new stack
-- Executing [s@macro-dial:31] GotoIf("SIP/Flowroute-00000362", "1?a32:a35") in new stack
-- Goto (macro-dial,s,32)
-- Executing [s@macro-dial:32] Set("SIP/Flowroute-00000362", "CT_EXTEN=102") in new stack
-- Executing [s@macro-dial:33] Set("SIP/Flowroute-00000362", "EXTTOCALL=102") in new stack
-- Executing [s@macro-dial:34] Set("SIP/Flowroute-00000362", "DB(CALLTRACE/102)=+13154404665") in new stack
-- Executing [s@macro-dial:35] Goto("SIP/Flowroute-00000362", "s,huntstart") in new stack
-- Goto (macro-dial,s,44)
-- Executing [s@macro-dial:44] NoOp("SIP/Flowroute-00000362", "Hunt Dial Start") in new stack