rec.sh has asterisk:asterisk. I tried to run the script being asterisk, that worked as expected.
Call recording is turned on, but I cannot getting any output to my test.txt file when a recrording is being completed. Just manual run is giving result.
In the log file should be a line reflecting how your script was called after the call which was monitored is terminated. It should show the translated values of the parameters you choose to send the script.
app_mixmonitor.c: MixMonitor close filestream (mixed)
app_mixmonitor.c: Executing [/var/lib/asterisk/agi-bin/rec.sh /var/spool/asterisk/monitor/2021/07/12/out-XXXXXXXXX-XXX-20210712-142407-1626099847.2.wav]
app_mixmonitor.c: End MixMonitor Recording PJSIP/XXX-00000001
No error message was there. I manually run /var/lib/asterisk/agi-bin/rec.sh /var/spool/asterisk/monitor/2021/07/12/out-XXXXXXXXX-XXX-20210712-142407-1626099847.2.wav and that wrote the text file as I wanted.
when you run that script from a ‘shell’ it is not run in the same ‘environment’ as when run from the dial-plan. thusly I point out that your test.txt file is “un-rooted”, you would best fix that first.
Yes, my goal is to update the record file to a different database. I’m listening AMI Cdr event to get the Cdr record, but that was not giving Recording file. So I’ll collect Record file and unique id and then update that in db using a python script.
Anyway, thanks for helping me to sort out the issue.
You can indirectly locate the file, if it exists, via the CDR table’s UNIQUEID record in this case 1626099847 which python’s datetime lib fully understands, the number after the decimal point is an enumeration of the number of calls since asterisk started