Good day.
I’m trying to start voice acting.
[hello]
exten = s,1,Answer()
same = n,Wait(1)
same = n,Set(RHV_FILE=${CALLERID(num)}_${EPOCH})
same = n,Set(RHV_TEXT=The company welcomes you, ${CALLERID(Name)})
same = n,AGI(/var/lib/asterisk/agi-bin/Robovoice.py ${RHV_FILE} ${RHV_TEXT})
same = n,Playback(/var/lib/asterisk/sounds/rhv_playback/${RHV_FILE}&silence/1)
same = n,System(rm -f /var/lib/asterisk/sounds/rhv_playback/${RHV_FILE}.wav)
same = n,System(rm -f /var/lib/asterisk/sounds/rhv_playback/${RHV_FILE}_t.wav)
exten = s,n,Return
I’m trying to select AGI or EAGI - I get an error:
Executing [dest-2@customdests:1] NoOp("SIP/9999-00000012", "Entering Custom Destination Greetings by Name") in new stack
-- Executing [dest-2@customdests:2] Gosub("SIP/9999-00000012", "hello,s,1()") in new stack
-- Executing [s@civility-hi:1] Answer("SIP/9999-00000012", "") in new stack
-- Executing [s@civility-hi:2] Wait("SIP/9999-00000012", "1") in new stack
-- Executing [s@civility-hi:3] Set("SIP/9999-00000012", "RHV_FILE=9999_1691415275") in new stack
-- Executing [s@civility-hi:4] Set("SIP/1514-00000014", "RHV_TEXT="The company welcomes you, John"") in new stack
-- Executing [s@civility-hi:5] AGI("SIP/1514-00000014", "/var/lib/asterisk/agi-bin/Robovoice.py 9999_1691415533 "The company welcomes you, John"") in new stack
[2023-08-07 16:38:53] WARNING[23382][C-00000015]: res_agi.c:2218 launch_script: Failed to execute ' /var/lib/asterisk/agi-bin/Robovoice.py 9999_1691415533 The company welcomes you, John': File does not exist.
-- Executing [s@civility-hi:6] Playback("SIP/1514-00000014", "/var/lib/asterisk/sounds/rhv_playback/1514_1691415533&silence/1") in new stack
[2023-08-07 16:34:35] WARNING[22369][C-00000013]: file.c:824 ast_openstream_full: File /var/lib/asterisk/sounds/rhv_playback/9999_1691415275 does not exist in any format
[2023-08-07 16:34:35] WARNING[22369][C-00000013]: file.c:1303 ast_streamfile: Unable to open /var/lib/asterisk/sounds/rhv_playback/9999_1691415275 (format (ulaw)): No such file or directory
[2023-08-07 16:34:35] WARNING[22369][C-00000013]: app_playback.c:512 playback_exec: Playback failed on SIP/1514-00000012 for /var/lib/asterisk/sounds/rhv_playback/9999_1691415275&silence/1
That is, the script cannot create a file and, accordingly, play it.
If I just execute /var/lib/asterisk/agi-bin/Robovoice.py on the command line 9999_1691415533 The company welcomes you, John - the script works, but takes only the word company
That is, to record the entire phrase, the request should look like this: /var/lib/asterisk/agi-bin/Robovoice.py 9999_1691415533 “The company welcomes you, John”
The script itself is in the directory:
[root@freepbx agi-bin]# ls -la
total 1722656
-rwxrwxr-x 1 asterisk asterisk 915 Aug 7 22:44 Robovoice.py
If I run it manually, everything works.
If I run, as it is written in the log (‘/var/lib/asterisk/agi-bin/Robovoice.py 1514_1691416909 The company welcomes you, John’ :), with apostrophes, I expectedly get No such file or directory
I have other scripts in this directory, they are run from under system but do not work through AGI.
Specifically, this script does not work from under the system( It seems to me that it simply does not have time to execute when I launch it from system.
Please tell me how to solve this issue?