ipoddubny / ya-node-asterisk Goto Github PK
View Code? Open in Web Editor NEWnode.js client library for Asterisk Manager Interface
License: MIT License
node.js client library for Asterisk Manager Interface
License: MIT License
hi guys. i have a Interesting problem or bug. pls help me :(
i have server.js with nodejs and have vuejs in laravel project. vuejs connect to port 3000 in nodejs and its fine work.
when i refresh browser and socket disconnect and reconnect to nodejs, each event with repetition datas repeat per refresh !!!
below image show 4 Dial Event for 4 times refresh browser
Currently yana is bad at handling socket errors, there should be an option to set the socket to reconnect automatically upon connection loss.
Is it possible to await ami.connect() to ensure it is connected before I issue any other command?
await ami.connect()
seems to make my adonisjs controller to hang forever.
Since Asterisk does reply to some requests (ex. SipShowPeers) with a series of Events, the AMI client does not destroy the request object upon receipt of the first answer and waits for a while if there will come any other events related to the same ActionId.
The per-connection setInterval object monitors all active requests and kills those who live longer than 5 seconds. It is created immediately upon creation and lasts forever, even after the tcp connection has been shut down.
However, for most requests there is no reason to wait any longer after receiving the first answer, and requests returning a series of events can be dealt using EventList header.
when send to asterisk ExtensionState action, if status = -1 (Extension not found) your code output show status = 1
send action and output is below :
ami.send({Action: 'ExtensionState', Exten : '400'}, print_res);
16 Apr 18:43:00 - response to action: { Response: 'Success',
ActionID: '27376915',
Message: 'Extension Status',
Exten: '400',
Context: 'default',
Hint: '',
Status: '1' }
same command in asterisk manager ;
action: ExtensionState
exten: 400
Response: Success
Message: Extension Status
Exten: 400
Context: default
Hint:
Status: -1
One AMI request can lead to a series of replies from Asterisk, each calling the callback set by user.
It would be very nice to have a higher level API that calls the user callback only once, after having collected all the replies from Asterisk.
hi, nice work! package is running stable but I wanted to ask you , why do you not transfer all responses? Like originate response has more field but you only send 3 of then
{
response: 'Error',
actionid: '26952138',
message: 'Originate failed'
}
where there could be
Event: OriginateResponse
[ActionID:] <value>
Response: <value>
Channel: <value>
Context: <value>
Exten: <value>
Application: <value>
Data: <value>
Reason: <value>
Uniqueid: <value>
CallerIDNum: <value>
CallerIDName: <value>
or is there a special way of accessing those?
Hi ,
how can I get action response detail? Like , when I send origination "Action" , I only see 3 lines of response.
response to action: {
response: 'Error',
actionid: '72849233',
message: 'Originate failed'
}
is it possible to see more of the action response?
ActionID
Response
Failure
Success
Channel
Context
Exten
Application
Data
Reason
Uniqueid
CallerIDNum
CallerIDName
I get a TS error when compiling:
node_modules/yana/index.d.ts:15:5 - error TS2411: Property 'eventlist' of type 'string | ActionResult[] | undefined' is not assignable to 'string' index type 'string | string[]'.
15 eventlist?: string | ActionResult[];
~~~~~~~~~
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.