I did a very simple script on the latest V16.0.4.461 in /DEV/test.sh
root@3cx:/DEV> ls -la
total 16
drwxr-xr-x 2 root root 4096 Nov 18 21:09 .
drwxr-xr-x 24 root root 4096 Nov 18 20:50 ..
-rw-r--r-- 1 root root 735 Nov 18 20:51 _parameters.txt
-rw-r--r-- 1 phonesystem phonesystem 0 Nov 18 21:09 test.log
-rwxr-xr-x 1 phonesystem phonesystem 108 Nov 18 21:09 test.sh
with the script content:
root@3cx:/DEV> more test.sh
#!/bin/bash
function log() {
echo
date "+%Y.%m.%d %H:%M:%S" "- $1" >> /DEV/test.log
}
log "Received $*"
My digital receptionist options are:
Type: Launch script
Prompt: test.wav
- Collect user input and pass it to the script
- Expect digit length: 1
- Playback user input and request confirmation
Full path to the script: /DEV/test.sh
- Exit code: 0 End call
- Exit code: 1 Call by Name
When I call this IVR, I hear the prompt test.wav , and if I enter 0 or 1 I hear "File not found" repeated twice, then the DTMF entered, then it hangs up on me.
From the log file, I believe the Playback user input and request confirmation wav files are not installed by default:
18/11/2019 21:24:23.281 [000019cd] 15 DTMF buffer: + 1
18/11/2019 21:24:23.281 [000019cd] Unknown prompt id: YOU_HAVE_ENTERED
18/11/2019 21:24:23.281 [000019cd] 15 PLAY id = 2 : #YOU_HAVE_ENTERED = /var/lib/3cxpbx/Instance1/Data/Ivr/Prompts/Sets/8210986B-9412-497f-AD77-3A554F4A9BDB/file_not_found.wav
18/11/2019 21:24:23.281 [000019cd] 15 PLAY id = 3 : #NUM_1 = /var/lib/3cxpbx/Instance1/Data/Ivr/Prompts/Sets/8210986B-9412-497f-AD77-3A554F4A9BDB/numbers/1.wav
18/11/2019 21:24:23.281 [000019cd] Unknown prompt id: PRESS_POUND_TO_CONFIRM
18/11/2019 21:24:23.281 [000019cd] 15 PLAY id = 4 : #PRESS_POUND_TO_CONFIRM = /var/lib/3cxpbx/Instance1/Data/Ivr/Prompts/Sets/8210986B-9412-497f-AD77-3A554F4A9BDB/file_not_found.wav
18/11/2019 21:24:28.090 [000019cd] DR Added session from timer, total 1
18/11/2019 21:24:33.426 [000019c7] Child process has exited with code 0
18/11/2019 21:24:33.426 [000019c7] 15 Process exit code 0
18/11/2019 21:24:33.426 [000019cd] 15 Processing script exit code 0
18/11/2019 21:24:33.426 [000019cd] 15 PLAY id = 5 : #BYE = /var/lib/3cxpbx/Instance1/Data/Ivr/Prompts/Sets/8210986B-9412-497f-AD77-3A554F4A9BDB/thankyou_goodbye.wav
18/11/2019 21:24:35.748 [000019c7] DR Session 15 has been ended by PBX, total 0
18/11/2019 21:24:35.748 [000019c7] 15 DELETE
If I remove the confirmation option, I have no luck in the IVR following the script (it says "Thank you, good bye" then hangs up)
18/11/2019 21:27:42.861 [000019c7] 18 NEW IVR : 100 -> 801 (801)
18/11/2019 21:27:42.861 [000019c7] DR Added new session 18, total 1
18/11/2019 21:27:42.861 [000019cd] 18 PLAY id = 1 : test.wav = /var/lib/3cxpbx/Instance1/Data/Ivr/Prompts/test.wav
18/11/2019 21:27:47.468 [000019c6] /home/repomaster/workspace/TrunkBuild/Sources/Projects/Common/VoIPFileEngine/RawFile.cpp(23) IRawFileBuffer:

refetch : error = 0, Success
18/11/2019 21:27:47.688 [000019cd] DR Added session from timer, total 1
18/11/2019 21:27:49.539 [000019cd] 18 Locked DTMF type to RFC2833
18/11/2019 21:27:49.539 [000019cd] 18 DTMF buffer: + 1
18/11/2019 21:27:49.777 [000019c7] Child process has exited with code 0
18/11/2019 21:27:49.777 [000019c7] 18 Process exit code 0
18/11/2019 21:27:49.777 [000019cd] 18 Processing script exit code 0
18/11/2019 21:27:49.777 [000019cd] 18 PLAY id = 2 : #BYE = /var/lib/3cxpbx/Instance1/Data/Ivr/Prompts/Sets/8210986B-9412-497f-AD77-3A554F4A9BDB/thankyou_goodbye.wav
18/11/2019 21:27:52.108 [000019c7] DR Session 18 has been ended by PBX, total 0
18/11/2019 21:27:52.108 [000019c7] 18 DELETE