Oh ok, took me a while to find it, I believe you mean option “g”. Not the auto-followthrough global option then.
So I’ve tested that on a small 4 line macro, and that seems ok. But if I tried to implement it into one of my more complex macros, such as below, then I’ll need to know the call state after the Dial.
The macro below dials SIP phones, then after a timeout dials a passed parameter (usually a mobile), and failing that calls into Voicemail.
So, if I answer at the first dial (priority 3) at the moment, then the call exits there and doesn’t proceed.
But if I do add the “g”, then after the CALLED party hungup, the logic would continue to 4.
So I think I need an IF statement at 4 to check if the call was answered at priority 3 or not.
Am I right ??
[macro-04-sim_hunt_pstn_vm]
; Rings all extensions at the same time and then PSTN option, fallback to voicemail
; ${ARG1} - Channels to sim call
; ${ARG2} - PSTN number to call (e.g. 079032xxxxx)
exten => s,1,ExecIF($["${RECORDSIP}"="TRUE"],Monitor,wav|${TIMESTAMP}-${CALLERID(num)}-${MACRO_EXTEN}-${UNIQUEID}.WAV)
exten => s,2,GotoIf($["${CALLERID(num)}" = "${ARG2}"]?20)
exten => s,3,Dial(${ARG1},${OFFICE_TIMEOUT},rw)
exten => s,4,Macro(DialOut,${ARG2},'')
exten => s,5,Voicemail(u${MACRO_EXTEN})
exten => s,6,Hangup
exten => s,20,Macro(vm-pstn,${MACRO_EXTEN})
exten => s,21,Hangup
exten => s,105,Voicemail(b${MACRO_EXTEN})
exten => s,106,Hangup