[Asterisk-Users] queueue recording and what to do next

Matt Roth mroth at imminc.com
Thu Apr 6 10:30:30 MST 2006


Anton Krall wrote:

>Guys, if you define recording on queues.conf and also define a
>monitor_filename var on your dialplna, you can record a queue call but,
>isthere a way to do something with the file after the call ends? I need to
>move the file to some other place but I cant find where to define a command
>to run after a queue call finishes.
>
>Any hints?
>
Anton,

In "queues.conf" set:

monitor-join=yes

for all queues that you are recording.  This will cause soxmix to be 
executed at the end of the call in order to join the leg files into a 
single recording. 

Then backup the soxmix binary and replace it with a script that does 
whatever you want with the leg files.  Your script will be passed 3 
arguments (see "show application monitor" at the CLI for more details):

1) The "-in" leg filename.
2) The "-out" leg filename.
3) A target mixed filename.

Odds are that you'll only care about the first two arguments.  Here is 
the script that I use to move the leg files from a RAM disk over an NFS 
mount to a remote machine which handles mixing and archiving the recordings:

[root at immlx15 ~]# cat /usr/bin/soxmix
#!/bin/bash

/bin/nice -n 19 mv --target-directory=/digrec-nfs/ $1 $2
if [ $? -ne 0 ]; then
        echo "Failed to mv '$3'" >> /var/log/asterisk/mvdr_log
        exit 1
fi

exit 0

As you can see, I'm using the third argument to log any failed moves.  
So far there haven't been any.

There is another option besides replacing soxmix with a custom program.  
You can use the dialplan variables "MONITOR_EXEC" and 
"MONITOR_EXEC_ARGS" to tell Monitor() to use another program to mix the 
leg files.  I have found this method to be unreliable.  Roughly 1% of 
the time, Monitor() was not calling the program defined by 
"MONITOR_EXEC".  Replacing soxmix has worked for me 100% of the time (we 
handle 10,000 - 13,000 recordings a day), so I recommend it as the 
preferred solution.

Matthew Roth
InterMedia Marketing Solutions
Software Engineer and Systems Developer



More information about the asterisk-users mailing list