I enabled archivedir in rpt.conf. It’s reliably recording any transmitted audio and any audio coming in from the internet to .wav files.
However any audio coming in from RF is trash… and I get a screen full of this in asterisk cli:
[2024-12-21 10:53:34.219] WARNING[1427]: translate.c:408 framein: no samples for lintogsm
using the a parrot server, the audio recorded when I send from my HT is trash, but the audio coming back from the server is recorded well and my voice is clear in the wav file.
that is because your audio file is not being recorded to the correct format to playback properly. on allstar you must have it recorded to 8,000hz or 8Khz mono signal. you can use methods out there to record it such as
those used for broadcastify that saves the audio then sends it. if you are on Hamvoip then you can use the drivers packages from here to have better audio.
If app_rpt’s built-in archiveaudio isn’t generating files that play, there’s something wrong.
This is not about importing files to play on the system. It’s about archiving audio from the system.
This problem has been brought up here before in a couple of other threads, but I don’t think there was a resolution.
I don’t use wav archiving, because I prefer to not store audio in GSM format, so I have used PCM (which is really ulaw) and converted to wav PCM when needed. On ASL3, I get empty files on local audio, and perfectly good ones from remote as well. This is on a simplex node with a radio attached.
Yes I also have a simplex node with radio attached. The local RF recordings, if sped up by a factor of 8 have a very rough version of the original audio. recordings of transmitted audio, and audio coming from the internet are fine.
I really turned on archiving to get the txt log files, but then thought the audio files could be useful.
I implemented a work around for this problem using the mixmonitor app module. Enable (load) mixmonitor in modules.conf.
load => app_mixmonitor.so
I enabled an event in rpt.conf to run a script when the node goes from no connected nodes to connected nodes, and vice-versa. See the events documentation in the Allstar wiki. The script starts recording with mixmontor when a node connects, and stops recording when connections go to zero.
The script includes commands to start/stop the recording. It also converts the audio file to MP3 using LAME, with a new name to allow multiple recordings by date/time stamp.
I’ll append the script below. Some edits will be required to make this work in another node environment, such as file paths, etc.
David McAnally
WD5M
#!/bin/bash
# This idlenode.sh script does tasks when the number of connections (RPT_NUMLINKS)
# transitions above zero (0) or back to zero.
# run from [events] section in rpt.conf
#
# /var/www/html/rb/idlenode.sh 0 = s|f|RPT_NUMLINKS
# /var/www/html/rb/idlenode.sh 1 = s|t|RPT_NUMLINKS
#
# ASL3 broke rpt archive so we use mixmonitor.
# app_mixmonitor must be loaded in modules.conf
#
# 20241122 - D McAnally WD5M
export TERM=dumb
ASLVER=`/usr/bin/sudo /usr/sbin/asterisk -V`
if [[ "${ASLVER:9:3}" == "GIT" ]] ; then
NODE=$(/usr/sbin/asterisk -rx "core show globals"|/usr/bin/grep "^\s*NODE="|/usr/bin/cut -d'=' -f2)
else
NODE=$(/usr/sbin/asterisk -rx "dialplan show globals NODE"|/usr/bin/grep "^\s*NODE="|/usr/bin/cut -d'=' -f2)
fi
[[ -z "${NODE}" ]] && exit 100
ASLRECORD="/var/www/html/archive/${NODE}/.aslrecord.wav"
aslrecordstop() {
# The aslrecordstop function stops mixmonitor and converts the audio to mp3.
[[ -z ${1} ]] && return 100
[[ ! -f ${1} ]] && return 100
FLEN=`/usr/bin/soxi -D ${1}`
FLENI=$(echo "${FLEN}/1" | /usr/bin/bc)
[[ ${FLENI} -le 5 ]] && return 0
DIR="${1%/*}"
NEWFN=`/usr/bin/stat -c %w "${1}" | \
/usr/bin/awk -F '.' '{print $1}' | \
/usr/bin/tr -d '-' | \
/usr/bin/tr -d ':' | \
/usr/bin/tr -d ' '`
/usr/bin/mv -f ${1} ${DIR}/${NEWFN}.wav
/usr/bin/lame --quiet -b 16 --resample 8 -a "${DIR}/${NEWFN}.wav" "${DIR}/${NEWFN}.mp3"
if [[ "${?}" == "0" ]] ; then
/usr/bin/touch --reference=${DIR}/${NEWFN}.wav ${DIR}/${NEWFN}.mp3
/usr/bin/rm -f ${DIR}/${NEWFN}.wav
fi
}
if [ "${1}" == "0" ]; then
# No more connections on the node. Turn off audio archiving/monitoring.
/usr/sbin/asterisk -rx "mixmonitor stop IAX2"
aslrecordstop ${ASLRECORD}
elif [ "${1}" == "1" ] ; then
# Someone connected to the node. Turn on audio archiving/monitoring.
/usr/sbin/asterisk -rx "mixmonitor start IAX2 ${ASLRECORD}"
fi
exit 0