For reference, here is the same IVR dialplan as output by FreePBX
asterisk -x "dialplan show ivr-4"
[ Context 'ivr-4' created by 'pbx_config' ]
'*' => 1. Set(__ivrreturn=0) [extensions_additional.conf:4167]
[ivrsel-*] 2. Goto(app-blackhole,hangup,1) [extensions_additional.conf:4168]
'0' => 1. Set(__ivrreturn=0) [extensions_additional.conf:4164]
[ivrsel-0] 2. Goto(ivr-4,s,1) [extensions_additional.conf:4165]
'9' => 1. Set(__ivrreturn=0) [extensions_additional.conf:4170]
[ivrsel-9] 2. Goto(um-vm,s,1) [extensions_additional.conf:4171]
'fax' => 1. Goto(${CUT(FAX_DEST,^,1)},${CUT(FAX_DEST,^,2)},${CUT(FAX_DEST,^,3)}) [extensions_additional.conf:4149]
'h' => 1. Hangup() [extensions_additional.conf:4192]
'hang' => 1. Playback(vm-goodbye) [extensions_additional.conf:4194]
2. Hangup() [extensions_additional.conf:4195]
'i' => 1. Set(INVALID_LOOPCOUNT=$[${INVALID_LOOPCOUNT}+1]) [extensions_additional.conf:4173]
2. GotoIf($[${INVALID_LOOPCOUNT} > 3]?final) [extensions_additional.conf:4174]
3. Set(IVR_MSG=no-valid-responce-pls-try-again&custom/client_main) [extensions_additional.conf:4175]
4. Goto(s,start) [extensions_additional.conf:4176]
[final] 5. Playback(no-valid-responce-transfering) [extensions_additional.conf:4177]
6. Goto(app-blackhole,hangup,1) [extensions_additional.conf:4178]
'return' => 1. Set(_IVR_CONTEXT=${CONTEXT}) [extensions_additional.conf:4187]
2. Set(_IVR_CONTEXT_${CONTEXT}=${IVR_CONTEXT_${CONTEXT}}) [extensions_additional.conf:4188]
3. Set(IVR_MSG=custom/client_main) [extensions_additional.conf:4189]
4. Goto(s,start) [extensions_additional.conf:4190]
's' => 1. Set(TIMEOUT_LOOPCOUNT=0) [extensions_additional.conf:4151]
2. Set(INVALID_LOOPCOUNT=0) [extensions_additional.conf:4152]
3. Set(_IVR_CONTEXT_${CONTEXT}=${IVR_CONTEXT}) [extensions_additional.conf:4153]
4. Set(_IVR_CONTEXT=${CONTEXT}) [extensions_additional.conf:4154]
5. Set(__IVR_RETVM=) [extensions_additional.conf:4155]
6. GotoIf($["${CHANNEL(state)}" = "Up"]?skip) [extensions_additional.conf:4156]
7. Answer() [extensions_additional.conf:4157]
8. Wait(1) [extensions_additional.conf:4158]
[skip] 9. Set(IVR_MSG=custom/client_main) [extensions_additional.conf:4159]
[start] 10. Set(TIMEOUT(digit)=3) [extensions_additional.conf:4160]
11. ExecIf($["${IVR_MSG}" != ""]?Background(${IVR_MSG})) [extensions_additional.conf:4161]
12. WaitExten(10,) [extensions_additional.conf:4162]
't' => 1. Set(TIMEOUT_LOOPCOUNT=$[${TIMEOUT_LOOPCOUNT}+1]) [extensions_additional.conf:4180]
2. GotoIf($[${TIMEOUT_LOOPCOUNT} > 3]?final) [extensions_additional.conf:4181]
3. Set(IVR_MSG=no-valid-responce-pls-try-again&custom/client_main) [extensions_additional.conf:4182]
4. Goto(s,start) [extensions_additional.conf:4183]
[final] 5. Playback(no-valid-responce-transfering) [extensions_additional.conf:4184]
6. Goto(app-blackhole,hangup,1) [extensions_additional.conf:4185]
Include => 'ivr-4-custom' [pbx_config]
Include => 'from-did-direct-ivr' [pbx_config]