asterisk / node-ari-client

Node.js client for ARI. This library is best effort with limited support.
Other
249 stars 98 forks source link

client reference says channels.move is undefined #135

Closed uchepercynnoch closed 4 years ago

uchepercynnoch commented 4 years ago

Hi, I am trying to move from current application to another, but both client.channels.move() and ari.channels.move() calls, throws a error saying TypeError: Cannot read property 'move' of undefined. I have tested on both asterisk 14 and 16 same result.

Here is a simple example:

const client = require("ari-client"); const url = "http://xxx.xxx.xxx:8088"; const username = "user"; const password = "password"; client .connect(url, username, password) .then(ari => { const stasisStart = event => { const { channel } = event; console.log(client.channels.move({}),ari.channels.move({})); };

const stasisEnd = event => {
  const { channel } = event;
  console.log(channel);
};

ari.once("StasisStart", stasisStart);
ari.once("StasisEnd", stasisEnd);
jcolp commented 4 years ago

Please use the community resources available for help with this (such as the asterisk-app-dev mailing list). Note, though, that 'move' only exists in recent versions of Asterisk. It won't work in 14, and it won't work in old versions of 16.