Skip to content

Commit

Permalink
added more info within readme
Browse files Browse the repository at this point in the history
  • Loading branch information
pdeschen committed May 23, 2011
1 parent 732a1c4 commit 209d1b7
Showing 1 changed file with 64 additions and 2 deletions.
66 changes: 64 additions & 2 deletions readme.md
Expand Up @@ -2,6 +2,67 @@


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


## How It Works

nodast receives FastAGI requests from asterisk (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 into

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

## Context Variables

The follow list all available context variable for dynamic route definition.

$network_script
$request
$channel
$language
$type
$uniqueid
$version
$callerid
$calleridname
$callingpres
$callingani2
$callington
$callingtns
$dnid
$rdnis
$context
$extension
$priority
$enhanced
$accountcode
$threadid

## Sample Configuration

var config = {
listen : 9090,
upstreams : {
test : 'localhost:4573',
foobar : 'foobar.com:4573'
},
routes : {
'agi://(.*):([0-9]*)/(.*)' : function() {
if (this.$callerid === 'unknown') {
return ('agi://foobar/script/' + this.$3);
} else {
return ('agi://foobar/script/' + this.$3 + '?callerid' + this.$callerid);
}
},
'.*' : function() {
return ('agi://test/');
},
'agi://192.168.129.170:9090/' : 'agi://test/'
}
};

exports.config = config;

## Features ## Features


* Basic config definition with location and upstream * Basic config definition with location and upstream
Expand All @@ -16,8 +77,9 @@ Install from npm:


## Todo ## Todo


* Add load balancing support between upstream * Add to npm repository
* Add failover * Add load balancing support between upstreams
* Add failover/backup upstream
* Add SSL/TLS support between node (asterisk -> node -> ssl -> node -> fastagi server * Add SSL/TLS support between node (asterisk -> node -> ssl -> node -> fastagi server
* Add support for AMI * Add support for AMI
* Scriptable? * Scriptable?
Expand Down

0 comments on commit 209d1b7

Please sign in to comment.