Skip to content

fugalh/radp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

= radp - Ruby Asterisk Dial Plan
This program/library creates Asterisk dialplans from ruby code.

== Requirements
- ruby
- rake (optional)

== Installation
  rake install ||
  ruby setup.rb --help | less

== Usage
  radp extensions.radp > extensions.conf
  asterisk -rx "extensions reload"

== Example
  :include:examples/simple.radp

== Things you should be aware of
- Asterisk dialplans are static, not dynamic. In other words, radp generates
  a static dialplan. 

- You can use any capitalization for Asterisk applications that Asterisk
  would accept, but if you begin an application with a capital letter and the
  application has no arguments, you must include the parentheses. e.g.
  Answer()

- This is not syntactically correct:

    ext 's' { Answer(); Playback(tt-monkeys); Hangup() }

  You must either use do...end or parenthesize the arguments, as in:

    ext('s') { Answer(); Playback(tt-monkeys); Hangup() }
    ext 's' do Answer(); Playback(tt-monkeys); Hangup(); end

- Also accepts input on stdin

- No special processing of arguments is done. In particular, The following
  produce the same output:

    Dial('ZAP/1,30')
    Dial('ZAP/1', 30)

- +context+, +ext+, etc. do not return objects (+app+ returns the priority,
  though), so it's not possible to keep a reference to a context and add
  extensions to it after creating a new context.

== Advanced Usage
You can also use radp as a library, in which case it behaves a little
differently (because it is not wrapped in an instance_eval). Simply treat it as
a library and it will work as expected.

== GitHub
http://github.com/fugalh/radp

== License
Copyright (C) 2005  Hans Fugal

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA

Releases

No releases published

Packages

No packages published

Languages