I'd recommend Tropo scripting for that. In particular, take a look at their example that shows a voicemail system that does recording and transcription.
A while back I put together a simple Sinatra app to take Tropo recordings and put them in an Amazon S3 bucket. From there, you can use them anyway you want.
%w(rubygems sinatra yaml logger aws/s3).each do |lib|
require lib
end
# Open configuration file and connect to Amazon
AWS_CONFIG = YAML.load(File.open('config/amazon_s3.yml'))
AWS::S3::Base.establish_connection!(
:access_key_id => AWS_CONFIG['access_key_id'],
:secret_access_key => AWS_CONFIG['secret_access_key']
)
# Exception class with HTTP error codes
class HTTPError < StandardError
attr_reader :code
def initialize(message, code = 500)
super(message)
@code = code
end
end
# Put an uploaded file on S3
def handle_post(params)
params['bucket'] ||= AWS_CONFIG['default_bucket']
raise HTTPError.new("invalid token", 403) if params['token'] != AWS_CONFIG['api_token']
raise HTTPError.new("missing filename", 400) unless params['name']
raise HTTPError.new("bucket #{params['bucket']} is not allowed", 403) unless AWS_CONFIG['allowed_buckets'].include? params['bucket']
AWS::S3::S3Object.store(params['name'],
File.open(params['filename'][:tempfile].path),
params['bucket'])
rescue HTTPError => ex
error(ex.code)
rescue => ex
puts ex
error(500)
end
# Method that receives the file and sends to S3
# /save-to-s3?token=<token>[&bucket=<one-of-allowed-buckets>]&name=filename
post '/save-to-s3' do
handle_post(params)
end
I run the app on Heroku, so I added a simple config.ru file so that it can be recognized as a Rack app.
require 'tropo-audiofiles-to-s3'
run Sinatra::Application
You don't have to use Ruby. Tropo scripting handles many languages (they all run on a JVM because Tropo is built on Voxeo's app server) and you can handle the file uploads in any language as well.
Good luck.