Closed ikerib closed 7 years ago
Hi, I have this code:
const AmiIo = require("ami-io"), SilentLogger = new AmiIo.SilentLogger(), //use SilentLogger if you just want remove logs amiio = AmiIo.createClient({port:PORT, host:SERVER, login:USER, password:PASSWD,logger: SilentLogger}); const action = new amiio.Action.Originate(); action.Channel = 'sip/123'; action.Context = 'default'; action.Exten = '456'; action.Priority = 1; action.Async = true; action.WaitEvent = true; amiio.send(action, function(err, data){ if (err){ //err will be event like OriginateResponse if (#response !== 'Success') } else { //data is event like OriginateResponse if (#response === 'Success') } });
On phpStorm I'm getting "unresolved type Originate". If I look into amiio.Action symbols it founds 2 declarations:
On node console I see this :
TypeError: Cannot read property 'Originate' of undefined
any help?
Hi. You just should use
const AmiIo = require("ami-io"); const action = new AmiIo.Action.Originate(); //AmiIo here is the variable's name there you store required ami-io
yep! thanks! My bad
Hi, I have this code:
On phpStorm I'm getting "unresolved type Originate". If I look into amiio.Action symbols it founds 2 declarations:
On node console I see this :
TypeError: Cannot read property 'Originate' of undefined
any help?