Giter Club home page Giter Club logo

ya-node-asterisk's People

Contributors

avesus avatar ipoddubny avatar lukekarrys avatar xorus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

ya-node-asterisk's Issues

Action responses

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

a minor bug

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

repeat each events when refresh client side (vuejs)

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
Uploading image.png…

Event Response limitation

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?

ami.connect() as a Promise

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.

Handling socket errors

Currently yana is bad at handling socket errors, there should be an option to set the socket to reconnect automatically upon connection loss.

Higher-level API with node-style callbacks or promises

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.

Get rid of setInterval in the connection object

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.