0.0.2 • Published 13 years ago

nodast v0.0.2

Weekly downloads
8
License
-
Repository
github
Last release
13 years ago

h1. nodast

@nodast@ is (for now) an Asterisk FastAGI reverse proxy on "node":http://nodejs.org .

h2. How It Works

nodast receives "FastAGI":http://www.voip-info.org/wiki/view/Asterisk+FastAGI requests from "Asterisk":http://www.asterisk.org/ (or other nodast as a matter of fact), inspect incoming stream for AGI request details. Looking more specifically at the @agi_request@ parameter, the AGI URL is then matched against the config route definitions, where route definitions values are either static or dynamic. Dynamic values are simply JavaScript closure blocks, with /this/ pointing to a variable context containing all request parameters along with regexp match group items. The dynamic function is simply rewriting the AGI URL, changing the destination hostname and port as necessary. The resulting route is NOT re-injected back into route matching engine for further resolution.

Once route has been resolved, nodast then look for upstream definitions and replace logical name with upstream equivalent.

h2. Context Variables

The following list all available context variables for dynamic route definition.

h2. Sample Configuration

h2. Features

  • Basic config definition with location and upstream
  • Basic command line test mode (@nodast -t 'agi://foobar.com:8080/querystring'@)
  • Syslog
  • Daemon init mode

h2. Installation

h3. Git Clone

@$ git clone git://github.com/pdeschen/nodast.git@

h3. Install from npm

@$ sudo npm install nodast -g@

h3. Install the /etc/nodast config and /etc/init.d/nodast daemon script

@$ sudo nodast --install@

h2. Todo

  • Publish to npm repository
  • Add location reinjection?
  • Add request logging details along with logging level in config.
  • Add load balancing support between upstreams
  • Add failover/backup upstream
  • Add SSL/TLS support between node (asterisk -> node -> ssl -> node -> fastagi server
  • Add support for AMI
  • Scriptable?

h2. Contributors

  • Pascal Deschenes

h2. License

(The MIT License)

Copyright (c) 2011 Pascal Deschenes

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

h6. Palette

F68B3A, 3AE1F6, 0697A9