Add this line to your application's Gemfile:
gem 'ozonetel'
And then execute:
$ bundle
Or install it yourself as:
$ gem install ozonetel
Configure authentication key and version
Add following lines into your rails application.rb file
Ozonetel.configure do |c|
c.outbound_version = 2
c.api_key = 'xxxxxxxxxxxxxxx'
end
To send outbound call
response = Ozonetel::Outbound::Call.connect({:phone_no => 'The phone number to place the call to', :extra_data => 'Your KooKoo Tunes', :caller_id => 'Your ozonetel caller id', :url => 'Your application url', :callback_url => 'URL which will be called after the call is finished.'})
Example - 1
response = Ozonetel::Outbound::Call.connect({:phone_no => "xxxxxxxxxx", :extra_data =>"<response><playtext>ILove KooKoo</playtext><hangup/></response>"})
puts response.status
"queued"
puts response.message
"136989181721681"
Example 2 -
response = Ozonetel::Outbound::Call.connect({:phone_no => "xxxxxxxxxx", :extra_data =>"<response><playtext>ILove KooKoo</playtext><hangup/></response>"})
puts response.status
"error"
puts response.message
"Authentication error"
For KooKoo Tunes and more detailed API goto http://www.kookoo.in/index.php/kookoo-docs
gem httparty 0.14.0
Bug reports and pull requests are welcome on GitHub at https://github.com/ashugodia/ozonetel.
The gem is available as open source under the terms of the MIT License.