Client for asterisk AGI protocol. Parses incomming messages into events. Dispatches AGI commands and their responses from asterisk. Most commonly used as a low level client for a fAGI server.
## note: still a work in progress
Create AGI server with ding-dong. Use with Asterisk for fast telephony apps. (Fork of node-agi)[http://github.com/brianc/node-agi]
## install
```
npm install agi
npm install ding-dong [--save]
```
## API
### agi.createServer([listener])
### ding.createServer([listener])
Returns a new net.Server instance. The _listener_ will be called on a new agi connection with a single __Context__ object as described below.
```js
require('agi').createServer(function(context){
varding=require('ding-dong');
ding.createServer(function(context){
//context is a new instance of agi.Context for each new agi session
//immedately after asterisk connects to the node process
Constructor to create a new instance of a context. Supply a readable and writable stream to the constructor. Commonly _stream_ will be a `net.Socket` instance.
...
...
@@ -34,8 +40,8 @@ Constructor to create a new instance of a context. Supply a readable and writab
Dispatches the `EXEC` AGI command to asterisk with supplied command name and arguments. _callback_ is called with the result of the dispatch.