开发者

Which technologies i should use to develop voice related applications

I would like to develop one application which record voice messages and stores in cloud.

it works like this

1) user calls mobile phone and record message.

2) The recorded voice message/voice mail should be accessible/avialable to all other users along with user phone number through web/online.

for web i can use PHP/python.

but i dont know how to save voicemail/voice message over web/cloud.

Please help 开发者_C百科me


Why not use Twilio, Tropo or one of the other providers in this space to accomplish what you need without having to secure actual voice lines, hardware, etc.?

Twilio has an example voicemail application that might be a good start for your project.

If you need to access the voicemail from a phone provider there is going to be provider-specific details so you should update your post to include information on what provider you want to target (and perhaps include geographical information if that provider is in multiple markets).


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜