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?
Michiel van Baak
2006-Apr-04 13:42 UTC
[Asterisk-Users] queueue recording and what to do next
On 14:36, Tue 04 Apr 06, 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?You can use the exten => h,1,deadagi() to process it. At least that's how we do it with faxes. exten => h,1,deadagi(processfax.php) ;put the fax in db and generate pdf on filesys Good luck -- Michiel van Baak michiel@vanbaak.info http://michiel.vanbaak.info GnuPG key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x7E0B9A2D "Why is it drug addicts and computer afficionados are both called users?"
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@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