Есть кастомный скрипт для проверки голосовой и копирования в другую директорию
Код: Выделить всё
#!/bin/sh
rename="$1"
last_file="/etc/asterisk/scripts/result/lastvoice"
inbox="/var/spool/asterisk/voicemail/private/199/INBOX"
homedir="/var/www/asterisk-records_voice"
check_voice="$(ls -t "${inbox}"/ |grep "^msg0[0-9]\{3\}.WAV" |head -n1)"
check_last="$(cat "${last_file}")"
if [[ "${check_voice}" == "${check_last}" ]]; then
echo '5'; else
cp "${inbox}"/${check_voice} "${homedir}"/${rename}.wav
echo "${check_voice}"
fi
echo "${check_voice}" > "${last_file}"
Код: Выделить всё
exten => h,1,Noop(Checked exist ${Voicename} ?)
same => n,Set(Voice=${SHELL(/bin/bash /etc/asterisk/scripts/voicemail.sh ${Voicename})})
same => n,GotoIf($[ "${Voice}" = "5" ]?end)
same => n,NoOp( is - ${Voice})
same => n,Set(CDR(recordingpath)=/var/www/asterisk-records_voice/${Voicename}.wav)
same => n(end),Hangup()
Код: Выделить всё
Executing [h@call-in:1] NoOp("SIP/gsm_gateway-000036b3", "Checked exist 2019.11.09_18-29_From.+9922222222 ?") in new stack
Executing [h@call-in:2] Set("SIP/gsm_gateway-000036b3", "Voice=5
") in new stack
Executing [h@call-in:3] GotoIf("SIP/gsm_gateway-000036b3", "0?end") in new stack
Executing [h@call-in:4] NoOp("SIP/gsm_gateway-000036b3", " is - 5
") in new stack
Executing [h@call-in:5] Set("SIP/gsm_gateway-000036b3", "CDR(recordingpath)=/var/www/asterisk-records_voice/2019.11.09_18-29_From.+9922222222.wav") in new stack
Executing [h@call-in:6] Hangup("SIP/gsm_gateway-000036b3", "") in new stack
Spawn extension (call-in, h, 6) exited non-zero on 'SIP/gsm_gateway-000036b3'
MixMonitor close filestream (mixed)
End MixMonitor Recording SIP/gsm_gateway-000036b3