(sorry English is my native language, I hope this translates properly)
Step 1>
Find your IVR
Open up /etc/asterisk/extensions_additional.conf
Each IVR has a heading like
[ivr-XX] ; IVRNAME(x)
include => ivr-XX-custom
include => from-ivr-directory-Disabled
exten => fax,1,Goto(${CUT(FAX_DEST,^,1)},${CUT(FAX_DEST,^,2)},${CUT(FAX_DEST,^,3)})
.....
.....
exten => hang,1,Playback(vm-goodbye)
exten => hang,n,Hangup
;--== end of [ivr-XX] ==--;
Step 2>
Copy this entire ivr portion
Step 3>
PASTE it into the bottom of
/etc/asterisk/extensions_override_freepbx.conf
Step 4>
Modify the code for each IVR selection
In my example below I have 3 selections
Your IVR will be different, but will have simlar "Goto(XXXXX)"
exten => 1,1(ivrsel-1),Goto(app-pbdirectory,pbdirectory,1)
exten => 2,1(ivrsel-2),Goto(app-blackhole,hangup,1)
exten => 3,1(ivrsel-3),Goto(macro-pincollection,s,1)
Make the changes similar to this:
Step 5: "Move the destination to next line"
exten => 1,1
(ivrsel-1),Goto(app-pbdirectory,pbdirectory,1)
Step 6: "Add the exten designation to the front: exten => X,2 "
exten => 1,1
exten => 1,2(ivrsel-1),Goto(app-pbdirectory,pbdirectory,1)
Step 7: "Paste in the data you want collected on the end of the first line like: ,system(echo...."
exten => 1,1,system(echo "${STRFTIME(${EPOCH},,%d%m%Y- %H:%M:%S)},${CALLERID(all)},${UNIQUEID},${IVR_CONTEXT},${IVR_MSG},${EXTEN}" >> /tmp/reportivr.txt)
exten => 1,2(ivrsel-1),Goto(app-pbdirectory,pbdirectory,1)
Step 8>
Repeat this for each IVR entry.
It will look something like this when you are done. Here i've made changes to my IVR that had 3 entries.
Critical changes are the "exten => X,2" values that you need to put in.
exten => 1,1,system(echo "${STRFTIME(${EPOCH},,%d%m%Y-%H:%M:%S)},${CALLERID(all)},${UNIQUEID},${IVR_CONTEXT},${IVR_MSG},${EXTEN}" >> /tmp/reportivr.txt)
exten => 1,2(ivrsel-1),Goto(app-pbdirectory,pbdirectory,1)
exten => 2,1,system(echo "${STRFTIME(${EPOCH},,%d%m%Y-%H:%M:%S)},${CALLERID(all)},${UNIQUEID},${IVR_CONTEXT},${IVR_MSG},${EXTEN}" >> /tmp/reportivr.txt)
exten => 2,2(ivrsel-2),Goto(app-blackhole,hangup,1)
exten => 3,1,system(echo "${STRFTIME(${EPOCH},,%d%m%Y-%H:%M:%S)},${CALLERID(all)},${UNIQUEID},${IVR_CONTEXT},${IVR_MSG},${EXTEN}" >> /tmp/reportivr.txt)
exten => 3,2(ivrsel-3),Goto(macro-pincollection,s,1)
Step 9>
Save your changes
Step 10>
run this command from CLI:
asterisk -rx 'core reload'
Test
After you make a call to your IVR, you should see a file in /tmp/reportivr.txt that contains the data.
Please remember. The code in "override.conf" will always be the priority code run. If you change the IVR using the PBX GUI, you will have to repeat the above steps, but first erasing out the modified code in _override.conf and making the changes again.