1

I record some calls on my PBX and save them as .wav files in /tmp/ on the PBX server. I would then like to transcode them to mp3 and email them to various recipients as attachments.

My concern is that transcoding from wav to mp3 can be resource intensive as the number of users grow so I would like to send the wav file along with its metadata (CallerID, email adresses of recipients, time and date recorded) to another server that will be dedicated to transcoding to mp3 and emailing the resulting files. This offloads the PBX server to only handling calls and it also doesn't hog the call while waiting for the conversion to finish.

I am not sure how to proceed to transmit the metadata and the files to the transcoding server.

I thought of feeding the wav file and the metadata to a PHP script running on the transcoding server with cURL but would that be the most efficient way? I also though about transferring the wave file over a shared NFS mount with unique directory names and have the metadata saved in a text file along a cron to process whatever jobs are waiting there every 5 minutes. The process of extracting the metadata from the text file seems a bit convoluted and not very elegant either.

I am quite interested to read how more seasoned coders would approach and solve this problem.

Cheers!

springloaded
  • 1,079
  • 2
  • 13
  • 23

1 Answers1

0

instead of pushing the file from the asterisk server, i would rather try pulling it from the transcoding machine. at the end of each transcoding operation i would check to see if there are any more files in the source directory, and pull the oldest one that i found, or sleep for a few seconds if there is nothing to do and try again. a shell script should be good enough. you can throttle the load of your encoding processor, have one or more encoding processes running simultaneously, etc. NFS, ftp or scp would be just about as good.

drivefast
  • 64
  • 1