ts-agi
Version:
Write AGI-server quickly! (AGI - Asterisk Gateway Interface)
44 lines (29 loc) • 780 B
Markdown
node.js lib writed on typescript for Fast AGI (Asterisk Gateway Interface) server
[Fork of ding-dong](https://github.com/antirek/ding-dong)
## Install
```
npm install ts-agi
```
`````javascript
const { Agi } = require('ts-agi');
const agi = new Agi();
agi.use(async (ctx, next) => {
await ctx.streamFile('beep');
await next();
const { value: myVariable } = await ctx.getFullVariable('myVar');
await ctx.sayAlpha(myVariable);
await ctx.hangup();
});
agi.use(async ctx => {
await ctx.setVariable('myVar', 'Hello World!!!');
});
agi.listen(3456);
`````
`````
[]
exten = > 1000,1,AGI(agi://localhost:3456)
`````
[](https://wiki.asterisk.org/wiki/display/AST/Asterisk+17+AGI+Commands)