Skip to content

Commit

Permalink
Initial code checkin to SVN on rubyforge. Before this, we were just a…
Browse files Browse the repository at this point in the history
… mere gem.

git-svn-id: http://ragi.rubyforge.org/svn@1 0da99f73-ab07-0410-beac-ae4a49bb6ddc
  • Loading branch information
jheitzeb committed Jan 19, 2006
0 parents commit a23e2f6
Show file tree
Hide file tree
Showing 43 changed files with 2,176 additions and 0 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
== 1.0.2 - 19-Jan-2005
- Created SVN repository for the code, docs and examples
- Added "RAGI Overview.html" a critical file that was missing from the gem

== 1.0.0 - 17-Dec-2005
- Moved RAGI from SourceForge to RubyForge
- Updated method names to be more consistent with Ruby and RoR naming conventions
- Packaged RAGI as a GEM
- Added instructions for launching RAGI inside of a Rails application
- Improved ability to map URI to call handlers
- Updated samples and docs as per above changes
- Added a README file for getting started quickly
- If you were using RAGI 0.0.1 from sourceforge, you will need to update your app since the API for this release is not backwards-compatible

== 0.0.1 - 12-Sep-2005
- Initial release
502 changes: 502 additions & 0 deletions RAGI Overview.html

Large diffs are not rendered by default.

Binary file added RAGI Overview_files/Thumbs.db
Binary file not shown.
5 changes: 5 additions & 0 deletions RAGI Overview_files/filelist.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<xml xmlns:o="urn:schemas-microsoft-com:office:office">
<o:MainFile HRef="../RAGI%20Overview.html"/>
<o:File HRef="image001.gif"/>
<o:File HRef="filelist.xml"/>
</xml>
Binary file added RAGI Overview_files/image001.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
114 changes: 114 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
************************************************
** RAGI - Ruby Asterisk Gateway Interface **
************************************************

Ruby Asterisk Gateway Interface (RAGI) is a useful open-source framework
for bridging the Ruby on Rails web application server environment and
Asterisk, the open-source PBX.

RAGI eases the development of interactive automated telephony applications
such as IVR, call routing, automated call center, and extended IP-PBX
functionality by leveraging the productivity of the Ruby on Rails framework.
RAGI simplifies the process of creating rich telephony and web apps with a
single common web application framework, object model and database backend.

*************************
** RAGI License **
*************************

RAGI is available under the BSD license.

RAGI is sponsored by SnapVine (www.snapvine.com).
Please email support@snapvine.com if you have
questions about RAGI.

**********************************
** Quick Start Instructions **
**********************************

Installing RAGI for Ruby users
------------------------------

1. Copy RAGI into the library path for ruby $(lib)/ragi/call*.rb

2. Edit your Asterisk extensions.conf to send call control to your RAGI process.
For example, the following would send all calls routed to extension "102" to your
Simon Game, presuming your RAGI server is running on a machine with
IP address 192.168.2.202

exten => 102,1,Answer()
exten => 102,2,deadagi(agi://192.168.2.202)
exten => 102,3,Hangup

3. To support the Simon Game sample, copy the sound files into your Asterisk
server's default sound directory.

4. The file "start_ragi.rb" is an example of running RAGI with the Simon Game
call handler. To run, type the following from the command prompt:

ruby ragi\start_ragi.rb

If you wanted to send calls to a different call handler, you can pass it as a parameter
to the CallServer.new. For example:

RAGI::CallServer.new( :DefaultHandler => MyNewHandler::CallHandler )

NOTE: Currently unless you are using Rails, there is no way to specify multiple
handlers and switch based on URI (see below for how RAGI does this with Rails).


Installing RAGI for Ruby on Rails
---------------------------------
1. Create a directory "ragi" inside the "lib" directory of your Rails application

2. Copy all of RAGI's rb files into the ragi folder.

3. Create a new directory in your rails directory called "handlers" under your "app" directory.
Put your call handlers in this directory. To run the Simon Game example app, place "simon_handler.rb"
in this directory.

As you may already know, a "controller" is a Rails concept and is used to provide the logic for your web app.
Controllers use "views" to render web pages. In RAGI, a phone call interaction is programmed using a handler.

4. Configure your Rails application to boot up a RAGI server on launch as a separate thread. Add the
following to the end of your Rails environment.rb file:

Dependencies.mechanism = :require

# Simple server that spawns a new thread for the server
class SimpleThreadServer < WEBrick::SimpleServer
def SimpleThreadServer.start(&block)
Thread.new do block.call
end
end
end

require 'ragi/call_server'

RAGI::CallServer.new(:ServerType => SimpleThreadServer )


5. Edit your Asterisk extensions.conf to send call control to your RAGI process.
For example, the following would send all calls routed to extension "102" to your
Simon Game, presuming your RAGI server is running on a machine with
IP address 192.168.2.202

exten => 102,1,Answer()
exten => 102,2,deadagi(agi://192.168.2.202/simon/dialup)
exten => 102,3,Hangup

NOTE: With RAGI, you can have multiple call handlers implemented in your application,
and you route these based on a URI. In this example, any call sent to extension 102
will be routed to the a handler called "simon_handler" in the handlers directory, and
the method "dialup" will be called when the call goes through.

If you wanted additional call handlers, you would put them in the handlers directory
and config your extensions.conf to route them as needed.

6. To support the Simon Game sample, copy the sound files into your Asterisk
server's default sound directory.

7. Start up your Rails app and your Asterisk server.

8. Call extension 102 and to play the Simon Game.

Expand Down
Binary file added example-call-audio.mp3
Binary file not shown.
Loading

0 comments on commit a23e2f6

Please sign in to comment.