VOIP API is a Ruby gem for communicating with the VOIP Innovations API.
gem 'voip_api', git: 'https://github.com/PhoenixfireDevelopment/voip_api.git'
VOIP API comes with a handy generator for creating the configuration initializer. Simply invoke:
rails g voip_api:config
This will copy the default initialization file for VOIP API into your applications config/initializers
directory
where you can customize the settings.
gem uninstall voip_api; rm voip_api-0.0.1.gem; gem build voip_api.gemspec; gem install voip_api;
then:
irb
require 'voip_api'
VoipApi.configure do |c|
c.login = "my_login_name"
c.secret = "my_secret_password"
end
# Use the interface class for convenient proxy methods
query = VoipApi.audit_dids
query.request.dids # Returns the DID's array
# Find out what the payload is
query.request.payload.keys
# Find out the VOIP response code
query.request.voip_response_code
# Find out the VOIP response message
query.request.voip_response_message
All the available API methods should be appropriately wrapped in a proxy class called Interface
.
See the yard documentation for more details, or generate it using the following command:
bundle exec yard
The HTML documentation will then be generated under doc/
for your convenience.