sergey12313 / ts-agi Goto Github PK
View Code? Open in Web Editor NEWCreate AGI server on #Node.js for #Asterisk quickly! https://github.com/sergey12313/ts-agi
Create AGI server on #Node.js for #Asterisk quickly! https://github.com/sergey12313/ts-agi
Thank you SO much for this excellent package!
But the demo wasn't working as I expected, and when turning on agi debug, I could see the problem...
This works as expected
<Local/1000@default-00000020;2>AGI Rx << SET VARIABLE myVar "Hello World!!!"
<Local/1000@default-00000020;2>AGI Tx >> 200 result=1
<Local/1000@default-00000020;2>AGI Rx << GET VARIABLE myVar
<Local/1000@default-00000020;2>AGI Tx >> 200 result=1 (Hello World!!!)
But GET FULL VARIABLE just returns the NAME of the variable
<Local/1000@default-0000001f;2>AGI Rx << SET VARIABLE myVar "Hello World!!!"
<Local/1000@default-0000001f;2>AGI Tx >> 200 result=1
<Local/1000@default-0000001f;2>AGI Rx << GET FULL VARIABLE myVar
<Local/1000@default-0000001f;2>AGI Tx >> 200 result=1 (myVar)
The documentation looked right:
https://wiki.asterisk.org/wiki/display/AST/Asterisk+17+AGICommand_get+full+variable
GET FULL VARIABLE VARIABLENAME CHANNEL NAME
Example return code: 200 result=1 (testvariable)
https://wiki.asterisk.org/wiki/display/AST/Asterisk+17+AGICommand_get+variable
GET VARIABLE VARIABLENAME
Example return code: 200 result=1 (testvariable)
So I asked on the forum, and it turns out that when using GET FULL VARIABLE, you need to send it as ${myVar}, so your example needs to change from
const { value: myVariable } = await ctx.getFullVariable('myVar');
to
const { value: myVariable } = await ctx.getFullVariable('${myVar}');
otherwise, it just sends back "myVar"!
Hope that helps someone, and thanks again!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.