Virginia is a Reel interface to Adhearsion, named after a dance originating in the 17th century, the Virginia Reel.
It allows you to bundle a simple, Sinatra-style web interface with your Adhearsion application, enabling use of all the available APIs.
The plugin defines three configuration keys.
- host: Which IP to bind on (defaults to 0.0.0.0)
- port: Which port to listen on (defaults to 8080)
- handler: the Reel::Server class to use (see below)
Virginia bundles a simple logging handler class that will answer to GET on "/" with OK and prints a log message in the Adhearsion console.
An example handler, implementing click-to-call, would be built as follows:
require 'reel'
class RequestHandler
def initialize(host, port)
Reel::Server.supervise(host, port) do |connection|
connection.each_request do |request|
Adhearsion::OutboundCall.originate "SIP/100" do
invoke ConnectingController
end
request.respond :ok, "200 OK"
end
end
end
Original author: Luca Pradovera
- Fork the project.
- Make your feature addition or bug fix.
- Add tests for it. This is important so I don't break it in a future version unintentionally.
- Commit, do not mess with rakefile, version, or history.
- If you want to have your own version, that is fine but bump version in a commit by itself so I can ignore when I pull
- Send me a pull request. Bonus points for topic branches.
Copyright (c) 2012 Adhearsion Foundation Inc. MIT license (see LICENSE for details).