Post Call Recording Script to upload call recordings to minio

I’m looking for a way to upload the call recordings directly to minio from asterisk.

Is such a thing possible?

Any help would be appreciated.

They’re WAV files, so it should be reasonably simple, unless there’s more to your request than this short little description exposes.

If as they say its uses the same API as AWS S3 then this may work, we use it to upload to S3
command is

/usr/local/sbin/postrecord.sh ^{TIMESTR} ^{FROMEXTEN} ^{CALLFILENAME} ^{UNIQUEID} ^{ARG3}

#!/bin/bash
#This script emails the recorded call right after the call is hung up. Below are the variables passed through asterisk

$1 - Time String

$2 - Source

$3 - File

$4 - unique id

$5 - Destination

$dt - Date and Time

export AWS_CONFIG_FILE=“/root/aws/config”
export AWS_ACCESS_KEY_ID=
export AWS_SECRET_ACCESS_KEY=

dy=$(date ‘+%Y’)
dm=$(date ‘+%m’)
dd=$(date ‘+%d’)
file_age=3
s3prefix=https://s3-eu-west-1.amazonaws.com/
s3path=bucket/
dtpath=/var/spool/asterisk/monitor/$dy/$dm/$dd/

/bin/nice /usr/local/bin/lame -b 16 -m m -q 9-resample $dtpath$3.wav $dtpath$3.mp3
/bin/nice /bin/chown asterisk:asterisk $dtpath$3.mp3

file=$3
ffile=$dtpath$3

echo “—==—” >> /tmp/cti.txt
aws s3 cp ${ffile}.mp3 s3://${s3path}${file}.mp3 >> /tmp/cti.txt

#/bin/nice /usr/bin/find /var/spool/asterisk/monitor/ -type f -mtime +“$file_age” |grep wav | \

#while read I; do

/bin/rm “$I”

#done

after doing this, will the recording still accessible via UCP and CDR?

Just make sure teh last 4 lines arnt there as they are to delete the original.

Ian