Followed the instructions mentioned here: IVR random play announcement
Just small changes, we only have 2 different IVR’s that need to be randomized. We have an IVR that starts in Dutch and then French and an IVR that starts in French and then Dutch. We want to randomize which language will be heard first. This is a dual language country (Belgium).
We also created these different IVR for opening hours and closing hours. So in total 4 different IVR, 2 for closed hours message and 2 for opening hours. These need to be randomized.
The code in extensions_custom.conf:
[set-random-open]
exten => s,1,Answer
exten => s,n,Goto(ivr-list-op,s,${RAND(1-2)},1)
[ivr-list-op]
exten => s,1,Goto(ivr-5,s,1)
exten => s,2,Goto(ivr-6,s,1)
[set-random-closed]
exten => s,1,Answer
exten => s,n,Goto(ivr-list-cl,s,${RAND(1,2)},1)
[ivr-list-cl]
exten => s,1,Goto(ivr-7,s,1)
exten => s,2,Goto(ivr-8,s,1)
When a call is made and put to this this custom destination, the number gets a busy tone and in the log it says this:
19335[2021-02-14 18:29:30] VERBOSE[160913][C-00000050] pbx_builtins.c: Goto (set-random-closed,s,1)
19336[2021-02-14 18:29:30] VERBOSE[160913][C-00000050] pbx.c: Executing [[email protected]:1] Answer("PJSIP/CM.com_Federation-00000092", "") in new stack
19337[2021-02-14 18:29:30] VERBOSE[160913][C-00000050] pbx.c: Executing [[email protected]:2] Goto("PJSIP/CM.com_Federation-00000092", "ivr-list-closed,s,1932202941,1") in new stack
19338[2021-02-14 18:29:30] VERBOSE[160913][C-00000050] pbx_builtins.c: Goto (ivr-list-closed,s,1932202941)
19339[2021-02-14 18:29:30] VERBOSE[160913][C-00000050] pbx.c: Auto fallthrough, channel 'PJSIP/CM.com_Federation-00000092' status is 'UNKNOWN'
It seems that ${RAND(1,2)} generates a random number of 1932202941 instead of 1 or 2.
No clue how to solve this.