0.1.7 • Published 9 years ago
dialplan v0.1.7
dialplan
generate asterisk dialplan on javascript / for use with node.js
https://wiki.asterisk.org/wiki/display/AST/The+Asterisk+Dialplan
Install
$ npm install dialplan --save
Use
var D = require('dialplan'),
App = D.Application,
Func = D.Function,
H = D.Helper;
var array = [
App.Verbose(0, H.$(Func.CDR('billsec'))),
App.AGI('agi://127.0.0.1/agi', 'test', 12),
App.AddQueueMember("Queue", "Member")
];
var exten = new D.Extension('_2XX');
exten.append(array);
var context = new D.Context('outgoing');
context.append(exten);
var dialplan = new D.Dialplan();
dialplan.append(context);
dialplan.save("/etc/asterisk/extensions_generated.conf", callback);
== Output extensions_generated.conf content ==
[outgoing]
exten=>_2XX,1,Verbose(0,${CDR(billsec)})
exten=>_2XX,2,AGI(agi://127.0.0.1/agi,test,12)
exten=>_2XX,3,AddQueueMember(Queue,Member)
Why use? Not raw dialplan
- Syntax highlight in editor
- Validate params
- Reusable code
- Always actual dialplan
Tests
$ npm test
Coverage
$ grunt coverage
0.1.7
9 years ago
0.1.6
9 years ago
0.1.5
9 years ago
0.1.4
9 years ago
0.1.3
9 years ago
0.1.2
9 years ago
0.1.1
9 years ago
0.0.11
9 years ago
0.0.10
10 years ago
0.0.9
10 years ago
0.0.8
10 years ago
0.0.7
10 years ago
0.0.6
10 years ago
0.0.5
10 years ago
0.0.4
10 years ago
0.0.3
10 years ago
0.0.2
10 years ago
0.0.1
10 years ago