Built motion from commit 9e1399f3.|2.5.37
[motion2.git] / server / services / ami / ami.js
index a93c07b..a700497 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe15b=['exports','asterisk-manager','bluebird','moment','lodash','ami','../../config/environment','asterisk','port','username','Action','promisify','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','resolve','then','catch','log'];(function(_0x2bdd2c,_0x47aba4){var _0x377cb4=function(_0x365bfb){while(--_0x365bfb){_0x2bdd2c['push'](_0x2bdd2c['shift']());}};_0x377cb4(++_0x47aba4);}(_0xe15b,0x14e));var _0xbe15=function(_0x229d7e,_0x5bc489){_0x229d7e=_0x229d7e-0x0;var _0xa78280=_0xe15b[_0x229d7e];return _0xa78280;};'use strict';var Manager=require(_0xbe15('0x0'));var BPromise=require(_0xbe15('0x1'));var moment=require(_0xbe15('0x2'));var util=require('util');var _=require(_0xbe15('0x3'));var logger=require('../../config/logger')(_0xbe15('0x4'));var config=require(_0xbe15('0x5'));var ami=new Manager(config[_0xbe15('0x6')][_0xbe15('0x7')],config[_0xbe15('0x6')]['ip'],config[_0xbe15('0x6')][_0xbe15('0x8')],config[_0xbe15('0x6')]['password'],!![]);ami['keepConnected']();ami[_0xbe15('0x9')]=BPromise[_0xbe15('0xa')](ami['action']);function error(_0x11f9fd){logger[_0xbe15('0xb')](util[_0xbe15('0xc')](_0xbe15('0xd'),config[_0xbe15('0x6')][_0xbe15('0x8')],config[_0xbe15('0x6')]['ip'],config['asterisk'][_0xbe15('0x7')],util[_0xbe15('0xe')](_0x11f9fd,![],null)));}function close(){logger[_0xbe15('0xb')](util['format']('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0xbe15('0x6')][_0xbe15('0x8')],config[_0xbe15('0x6')]['ip'],config[_0xbe15('0x6')]['port']));}ami[_0xbe15('0xf')]=function(){return function(){return ami[_0xbe15('0x9')]({'action':_0xbe15('0x10')});};};ami[_0xbe15('0x11')]=function(){return function(){return ami[_0xbe15('0x9')]({'action':_0xbe15('0x12')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0xbe15('0x9')]({'action':_0xbe15('0x13')});};};ami[_0xbe15('0x14')]=function(){return function(){return ami[_0xbe15('0x9')]({'action':_0xbe15('0x15')});};};ami[_0xbe15('0x16')]=function(){return function(){return ami[_0xbe15('0x9')]({'action':_0xbe15('0x17')});};};function connect(_0x3f3b8e){logger[_0xbe15('0x18')](util['format'](_0xbe15('0x19'),config[_0xbe15('0x6')][_0xbe15('0x8')],config['asterisk']['ip'],config['asterisk'][_0xbe15('0x7')]));ami['once'](_0xbe15('0xb'),error);ami[_0xbe15('0x1a')](_0xbe15('0x1b'),close);}ami['on'](_0xbe15('0x1c'),connect);ami['on'](_0xbe15('0x1d'),function(_0x36699a){logger[_0xbe15('0x18')](util[_0xbe15('0xc')](_0xbe15('0x1e'),config[_0xbe15('0x6')]['username'],config['asterisk']['ip'],config['asterisk']['port'],util[_0xbe15('0xe')](_0x36699a,![],null)));});ami['on'](_0xbe15('0x1f'),function(_0x1e7090){logger[_0xbe15('0x18')](util[_0xbe15('0xc')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0xbe15('0x6')][_0xbe15('0x8')],config[_0xbe15('0x6')]['ip'],config['asterisk'][_0xbe15('0x7')]));return BPromise[_0xbe15('0x20')]()[_0xbe15('0x21')](ami[_0xbe15('0xf')]())[_0xbe15('0x21')](ami['actionDeviceStateList']())[_0xbe15('0x21')](ami['actionSipPeerStatus']())[_0xbe15('0x21')](ami['actionQueueSummary']())[_0xbe15('0x21')](ami[_0xbe15('0x16')]())[_0xbe15('0x22')](function(_0xbae046){console[_0xbe15('0x23')](_0xbae046);});});ami[_0xbe15('0x1a')](_0xbe15('0xb'),error);ami[_0xbe15('0x1a')]('close',close);module[_0xbe15('0x24')]=ami;
\ No newline at end of file
+var _0x0b0e=['../../config/environment','asterisk','port','username','password','promisify','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','format','Action','sipshowregistry','actionDeviceStateList','devicestatelist','actionQueueSummary','actionCoreShowChannels','coreshowchannels','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','close','shutdown','info','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','then','actionSipPeerStatus','catch','[ami.js][fullybooted]','once','asterisk-manager','moment','lodash','../../config/logger','ami'];(function(_0x265d3e,_0x3f2181){var _0x42bb03=function(_0x41aad9){while(--_0x41aad9){_0x265d3e['push'](_0x265d3e['shift']());}};_0x42bb03(++_0x3f2181);}(_0x0b0e,0x187));var _0xe0b0=function(_0x3fd531,_0x538738){_0x3fd531=_0x3fd531-0x0;var _0x5bd9db=_0x0b0e[_0x3fd531];return _0x5bd9db;};'use strict';var Manager=require(_0xe0b0('0x0'));var BPromise=require('bluebird');var moment=require(_0xe0b0('0x1'));var util=require('util');var _=require(_0xe0b0('0x2'));var logger=require(_0xe0b0('0x3'))(_0xe0b0('0x4'));var config=require(_0xe0b0('0x5'));var ami=new Manager(config[_0xe0b0('0x6')][_0xe0b0('0x7')],config[_0xe0b0('0x6')]['ip'],config[_0xe0b0('0x6')][_0xe0b0('0x8')],config[_0xe0b0('0x6')][_0xe0b0('0x9')],!![]);ami['keepConnected']();ami['Action']=BPromise[_0xe0b0('0xa')](ami[_0xe0b0('0xb')]);function error(_0xc4a085){logger[_0xe0b0('0xc')](util['format'](_0xe0b0('0xd'),config[_0xe0b0('0x6')]['username'],config[_0xe0b0('0x6')]['ip'],config[_0xe0b0('0x6')]['port'],util[_0xe0b0('0xe')](_0xc4a085,![],null)));}function close(){logger[_0xe0b0('0xc')](util[_0xe0b0('0xf')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0xe0b0('0x6')][_0xe0b0('0x8')],config[_0xe0b0('0x6')]['ip'],config[_0xe0b0('0x6')][_0xe0b0('0x7')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0xe0b0('0x10')]({'action':_0xe0b0('0x11')});};};ami[_0xe0b0('0x12')]=function(){return function(){return ami[_0xe0b0('0x10')]({'action':_0xe0b0('0x13')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0xe0b0('0x10')]({'action':'sippeerstatus'});};};ami[_0xe0b0('0x14')]=function(){return function(){return ami[_0xe0b0('0x10')]({'action':'queuesummary'});};};ami[_0xe0b0('0x15')]=function(){return function(){return ami['Action']({'action':_0xe0b0('0x16')});};};function connect(_0x100204){logger['info'](util['format'](_0xe0b0('0x17'),config['asterisk']['username'],config['asterisk']['ip'],config[_0xe0b0('0x6')]['port']));ami['once'](_0xe0b0('0xc'),error);ami['once'](_0xe0b0('0x18'),close);}ami['on']('connect',connect);ami['on'](_0xe0b0('0x19'),function(_0x1cd7c4){logger[_0xe0b0('0x1a')](util[_0xe0b0('0xf')](_0xe0b0('0x1b'),config['asterisk']['username'],config[_0xe0b0('0x6')]['ip'],config['asterisk'][_0xe0b0('0x7')],util[_0xe0b0('0xe')](_0x1cd7c4,![],null)));});ami['on']('fullybooted',function(_0x170ad8){logger['info'](util[_0xe0b0('0xf')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0xe0b0('0x6')]['username'],config[_0xe0b0('0x6')]['ip'],config['asterisk'][_0xe0b0('0x7')]));return BPromise['resolve']()[_0xe0b0('0x1c')](ami['actionSipShowRegistry']())[_0xe0b0('0x1c')](ami[_0xe0b0('0x12')]())[_0xe0b0('0x1c')](ami[_0xe0b0('0x1d')]())[_0xe0b0('0x1c')](ami[_0xe0b0('0x14')]())['then'](ami[_0xe0b0('0x15')]())[_0xe0b0('0x1e')](function(_0x5b7a64){logger[_0xe0b0('0xc')](_0xe0b0('0x1f'),util[_0xe0b0('0xe')](_0x5b7a64,{'showHidden':![],'depth':null}));});});ami[_0xe0b0('0x20')](_0xe0b0('0xc'),error);ami[_0xe0b0('0x20')](_0xe0b0('0x18'),close);module['exports']=ami;
\ No newline at end of file