IVR random play announcement

**Hello, i want to record about 10 different IVR recordings and have each play in a random for every incoming call.

Any idea? Easy way


This will 100% require you to write custom dialplan for this to happen. Nothing in FreePBX supports this.

Can you tell us what you are trying to accomplish?
Would each recording play the same menu options?

i have 10 different audio welcome, and want play randomly every inbound calls, i think need (random announcement) but no idea how to do this?


How often do calls come in?

The easiest way would be to create 10 IVR’s with different recordings, note the IVR ID’s (you can see it in the URL address bar) and put the following in extensions_custom.conf

exten => s,1,Noop(entering ${CONTEXT} in extensions_custom.conf)
exten => s,n,Goto(ivr-list,s,${RAND(1-10)})

exten => s,1,Goto(ivr-1,s,1)
exten => s,2,Goto(ivr-2,s,1)
exten => s,3,Goto(ivr-3,s,1)
exten => s,4,Goto(ivr-4,s,1)
exten => s,5,Goto(ivr-5,s,1)
exten => s,6,Goto(ivr-6,s,1)
exten => s,7,Goto(ivr-7,s,1)
exten => s,8,Goto(ivr-8,s,1)
exten => s,9,Goto(ivr-9,s,1)
exten => s,10,Goto(ivr-10,s,1)

Replace the IVR ID’s in the IVR List with your ID’s
(The number after the “ivr-” is the IVR ID)

Once created, point your Inbound route to the custom destination.

Note: I’m on mobile, formatting might have messed up something…


Another solution might be to set an incron entry that triggers on ‘IN_OPEN’ the played recording to
“symlink” to a set of recordings for simplicity named 1 through 10 you made to the one that was opened, use bash’s $(($RANDOM % 10 +1 )) to provide the randomness. But @PitzKey has a workable one that is possible to do from the GUI.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.