Code Monkey home page Code Monkey logo

batphone's Introduction

= Batphone

link:../theme/batphone.png

Batphone is an Asterisk Gateway Interface (AGI) library for Ruby. It is
well-suited to simple bat-tasks, with a small learning curve. (I promise you'll
spend more time figuring out AGI than batphone). It is also perfectly capable
of making all your wildest AGI dreams come true. It won't get in your way.

1. http://www.voip-info.org/wiki-Asterisk+AGI

== Synopsis

In extensions.conf:

    exten => batphone,1,AGI(batphone.agi)

batphone.agi:

    #!/usr/bin/ruby
    require 'agi'

    agi = AGI.new
    agi.answer
    agi.stream_file('batman_help_the_monkeys_are_everywhere', nil)
    begin
      # press pound to make them stop!
      r = agi.stream_file('tt-monkeys', '#')
    end while r.result != ?#
    agi.stream_file('POW', nil)
    agi.hangup

== Requirements
Gee, Batman, all you need is Ruby. You might want Asterisk[http://asterisk.org]
too.

== Installation
Get it from GitHub[http://github.com/fugalh/batphone] and put it somewhere
batty.

    sudo rake install
or
    sudo ruby setup.rb

== Details
An AGI object serves as your proxy to Asterisk. Each time you send a command to
Asterisk using AGI#send or using the metaprogrammed interface, you get an
AGI::Response back. 

== TODO
- 5xx errors span multiple lines and should be handled by the lib (probably an
  exception raised too)
- It might be nice to have convenience methods that match up with regular
  Asterisk Applications (commands), e.g. Playback, Background, etc. 
- I'm inclined to make an OpenStruct-like interface to the Asterisk
  environment, but I need to make sure there won't be any metaprogramming
  conflitcs

== License
Copyright:: Copyright (C) 2007 Hans Fugal <mailto:[email protected]>.
License:: Distributed under the same terms as Ruby.

== Colophon
Holy red phones, Batman! Asterisk is about phones. Rubies are red. Batphones
are really swell red phones. 

No relation to batsman[http://eigenclass.org/], though I think he's swell too.

The image is from an
article[http://www.millionaireplayboy.com/toys/batphone.php] on building your
own physical batphone at Millionaire Playboy.

batphone's People

Contributors

fugalh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.