Hi,
I can get the correct code generated, however I am querying adding the new code into the dialplan as I cannot edit the FreePBX files directly as these will be overwritten. The elastix distribution does not run FreePBX 2.11 so the module cannot be used to manage this functionality.
Currently, my code looks like
/etc/asterisk/extensions_additional.conf
[ivr-12]
include => ivr-12-custom
exten => fax,1,Goto(${CUT(FAX_DEST,^,1)},${CUT(FAX_DEST,^,2)},${CUT(FAX_DEST,^,3)})
exten => h,1,Hangup
exten => s,1,Set(MSG=custom/G-DCS1)
exten => s,n,Set(LOOPCOUNT=0)
exten => s,n,Set(__DIR-CONTEXT=)
exten => s,n,Set(_IVR_CONTEXT_${CONTEXT}=${IVR_CONTEXT})
exten => s,n,Set(_IVR_CONTEXT=${CONTEXT})
exten => s,n,GotoIf($["${CDR(disposition)}" = "ANSWERED"]?begin)
exten => s,n,Answer
exten => s,n,Wait(1)
exten => s,n(begin),Set(TIMEOUT(digit)=3)
exten => s,n,Set(TIMEOUT(response)=10)
exten => s,n,Set(__IVR_RETVM=)
exten => s,n,ExecIf($["${MSG}" != ""]?Background(${MSG}))
exten => s,n,WaitExten(,)
exten => hang,1,Playback(vm-goodbye)
exten => hang,n,Hangup
exten => 1,1,Noop(Deleting: ${BLKVM_OVERRIDE} ${DB_DELETE(${BLKVM_OVERRIDE})})
exten => 1,n,Set(__NODEST=)
exten => 1,n,Goto(app-announcement-9,s,1)
exten => 2,1,Noop(Deleting: ${BLKVM_OVERRIDE} ${DB_DELETE(${BLKVM_OVERRIDE})})
exten => 2,n,Set(__NODEST=)
exten => 2,n,Goto(app-announcement-10,s,1)
exten => 3,1,Noop(Deleting: ${BLKVM_OVERRIDE} ${DB_DELETE(${BLKVM_OVERRIDE})})
exten => 3,n,Set(__NODEST=)
exten => 3,n,Goto(app-announcement-11,s,1)
exten => 4,1,Noop(Deleting: ${BLKVM_OVERRIDE} ${DB_DELETE(${BLKVM_OVERRIDE})})
exten => 4,n,Set(__NODEST=)
exten => 4,n,Goto(app-daynight,2,1)
exten => t,1,Set(LOOPCOUNT=$[${LOOPCOUNT} + 1])
exten => t,n,GotoIf($[${LOOPCOUNT} <= 2]?s,begin)
exten => t,n,Noop(Deleting: ${BLKVM_OVERRIDE} ${DB_DELETE(${BLKVM_OVERRIDE})})
exten => t,n,Set(__NODEST=)
exten => t,n,Goto(ivr-12,s,begin)
exten => i,1,Playback(invalid)
exten => i,n,Goto(loop,1)
exten => loop,1,Set(LOOPCOUNT=$[${LOOPCOUNT} + 1])
exten => loop,n,GotoIf($[${LOOPCOUNT} > 2]?hang,1)
exten => loop,n,Goto(ivr-12,s,begin)
exten => return,1,Set(MSG=custom/G-DCS1)
exten => return,n,Set(_IVR_CONTEXT=${CONTEXT})
exten => return,n,Set(_IVR_CONTEXT_${CONTEXT}=${IVR_CONTEXT_${CONTEXT}})
exten => return,n,Goto(ivr-12,s,begin)
; end of [ivr-12]
extensions_custom.conf
[ivr-12-custom]
exten => _X.,n,Set(IVRSELECTION=${EXTEN}|${IVR_CONTEXT})
exten => _X.,n,QueueLog(NONE,${UNIQUEID},NONE,INFO,IVRAPPEND|${IVRSELECTION})