chadxz / awry

An Asterisk REST Interface (ARI) websocket and API client library
MIT License
21 stars 9 forks source link

Stasis event #133

Closed albinomn closed 4 years ago

albinomn commented 4 years ago

How do i get a Stasis event??? I have setup like this.

const events = Awry.Events.connect({
  app: "bridge-hold",
  url: "http://IP_ADDRESS:8080/ari/events",
  username: "asterisk",                                                                        
  password: "asterisk",
});
events.on("stasisStart", (message) => {
  console.log("started...");
});

I'm trying to make an application to connect with another service.

chadxz commented 4 years ago

try

events.on('message', (message) => {
  console.log(message);
});

to get a better feel for what messages are being sent. In your case, you probably want a 'message' event that has message.type === 'StasisStart'