Built motion from commit c738b9ac.|2.6.25
[motion2.git] / server / services / ami / ami.js
index 4f71237..43d3c96 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9d5c=['log','close','asterisk-manager','bluebird','moment','util','lodash','ami','asterisk','port','username','keepConnected','Action','promisify','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','inspect','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','then','catch'];(function(_0xb5179e,_0x67e31d){var _0x423511=function(_0x408d13){while(--_0x408d13){_0xb5179e['push'](_0xb5179e['shift']());}};_0x423511(++_0x67e31d);}(_0x9d5c,0x17e));var _0xc9d5=function(_0x156b3e,_0x4e6e62){_0x156b3e=_0x156b3e-0x0;var _0x2dad1b=_0x9d5c[_0x156b3e];return _0x2dad1b;};'use strict';var Manager=require(_0xc9d5('0x0'));var BPromise=require(_0xc9d5('0x1'));var moment=require(_0xc9d5('0x2'));var util=require(_0xc9d5('0x3'));var _=require(_0xc9d5('0x4'));var logger=require('../../config/logger')(_0xc9d5('0x5'));var config=require('../../config/environment');var ami=new Manager(config[_0xc9d5('0x6')][_0xc9d5('0x7')],config['asterisk']['ip'],config[_0xc9d5('0x6')][_0xc9d5('0x8')],config[_0xc9d5('0x6')]['password'],!![]);ami[_0xc9d5('0x9')]();ami[_0xc9d5('0xa')]=BPromise[_0xc9d5('0xb')](ami['action']);function error(_0x4a69d1){logger[_0xc9d5('0xc')](util[_0xc9d5('0xd')](_0xc9d5('0xe'),config[_0xc9d5('0x6')][_0xc9d5('0x8')],config[_0xc9d5('0x6')]['ip'],config[_0xc9d5('0x6')][_0xc9d5('0x7')],util['inspect'](_0x4a69d1,![],null)));}function close(){logger[_0xc9d5('0xc')](util[_0xc9d5('0xd')](_0xc9d5('0xf'),config[_0xc9d5('0x6')][_0xc9d5('0x8')],config[_0xc9d5('0x6')]['ip'],config[_0xc9d5('0x6')][_0xc9d5('0x7')]));}ami[_0xc9d5('0x10')]=function(){return function(){return ami[_0xc9d5('0xa')]({'action':_0xc9d5('0x11')});};};ami[_0xc9d5('0x12')]=function(){return function(){return ami['Action']({'action':_0xc9d5('0x13')});};};ami[_0xc9d5('0x14')]=function(){return function(){return ami[_0xc9d5('0xa')]({'action':_0xc9d5('0x15')});};};ami[_0xc9d5('0x16')]=function(){return function(){return ami[_0xc9d5('0xa')]({'action':'queuesummary'});};};ami[_0xc9d5('0x17')]=function(){return function(){return ami[_0xc9d5('0xa')]({'action':_0xc9d5('0x18')});};};function connect(_0x441e70){logger[_0xc9d5('0x19')](util[_0xc9d5('0xd')](_0xc9d5('0x1a'),config['asterisk']['username'],config[_0xc9d5('0x6')]['ip'],config[_0xc9d5('0x6')][_0xc9d5('0x7')]));ami[_0xc9d5('0x1b')]('error',error);ami[_0xc9d5('0x1b')]('close',close);}ami['on'](_0xc9d5('0x1c'),connect);ami['on'](_0xc9d5('0x1d'),function(_0x131d0b){logger[_0xc9d5('0x19')](util[_0xc9d5('0xd')](_0xc9d5('0x1e'),config[_0xc9d5('0x6')][_0xc9d5('0x8')],config[_0xc9d5('0x6')]['ip'],config[_0xc9d5('0x6')][_0xc9d5('0x7')],util[_0xc9d5('0x1f')](_0x131d0b,![],null)));});ami['on'](_0xc9d5('0x20'),function(_0x40b560){logger['info'](util['format'](_0xc9d5('0x21'),config[_0xc9d5('0x6')][_0xc9d5('0x8')],config[_0xc9d5('0x6')]['ip'],config[_0xc9d5('0x6')][_0xc9d5('0x7')]));return BPromise['resolve']()[_0xc9d5('0x22')](ami[_0xc9d5('0x10')]())['then'](ami[_0xc9d5('0x12')]())[_0xc9d5('0x22')](ami[_0xc9d5('0x14')]())[_0xc9d5('0x22')](ami[_0xc9d5('0x16')]())[_0xc9d5('0x22')](ami[_0xc9d5('0x17')]())[_0xc9d5('0x23')](function(_0x35e750){console[_0xc9d5('0x24')](_0x35e750);});});ami[_0xc9d5('0x1b')](_0xc9d5('0xc'),error);ami[_0xc9d5('0x1b')](_0xc9d5('0x25'),close);module['exports']=ami;
\ No newline at end of file
+var _0xf7f9=['resolve','then','catch','[ami.js][fullybooted]','exports','bluebird','util','ami','../../config/environment','asterisk','port','username','password','Action','promisify','action','error','inspect','format','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s'];(function(_0x3522c8,_0x1e7c82){var _0x22f498=function(_0x5bf143){while(--_0x5bf143){_0x3522c8['push'](_0x3522c8['shift']());}};_0x22f498(++_0x1e7c82);}(_0xf7f9,0x10f));var _0x9f7f=function(_0x43f54c,_0xbce2c0){_0x43f54c=_0x43f54c-0x0;var _0x432bb4=_0xf7f9[_0x43f54c];return _0x432bb4;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x9f7f('0x0'));var util=require(_0x9f7f('0x1'));var logger=require('../../config/logger')(_0x9f7f('0x2'));var config=require(_0x9f7f('0x3'));var ami=new Manager(config[_0x9f7f('0x4')][_0x9f7f('0x5')],config[_0x9f7f('0x4')]['ip'],config['asterisk'][_0x9f7f('0x6')],config['asterisk'][_0x9f7f('0x7')],!![]);ami['keepConnected']();ami[_0x9f7f('0x8')]=BPromise[_0x9f7f('0x9')](ami[_0x9f7f('0xa')]);function error(_0x24e044){logger[_0x9f7f('0xb')](util['format']('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config['asterisk']['username'],config[_0x9f7f('0x4')]['ip'],config[_0x9f7f('0x4')][_0x9f7f('0x5')],util[_0x9f7f('0xc')](_0x24e044,![],null)));}function close(){logger[_0x9f7f('0xb')](util[_0x9f7f('0xd')](_0x9f7f('0xe'),config[_0x9f7f('0x4')]['username'],config[_0x9f7f('0x4')]['ip'],config[_0x9f7f('0x4')][_0x9f7f('0x5')]));}ami[_0x9f7f('0xf')]=function(){return function(){return ami[_0x9f7f('0x8')]({'action':_0x9f7f('0x10')});};};ami[_0x9f7f('0x11')]=function(){return function(){return ami[_0x9f7f('0x8')]({'action':_0x9f7f('0x12')});};};ami[_0x9f7f('0x13')]=function(){return function(){return ami[_0x9f7f('0x8')]({'action':_0x9f7f('0x14')});};};ami[_0x9f7f('0x15')]=function(){return function(){return ami[_0x9f7f('0x8')]({'action':_0x9f7f('0x16')});};};ami[_0x9f7f('0x17')]=function(){return function(){return ami[_0x9f7f('0x8')]({'action':_0x9f7f('0x18')});};};function connect(){logger[_0x9f7f('0x19')](util[_0x9f7f('0xd')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0x9f7f('0x4')]['username'],config[_0x9f7f('0x4')]['ip'],config[_0x9f7f('0x4')][_0x9f7f('0x5')]));ami[_0x9f7f('0x1a')](_0x9f7f('0xb'),error);ami[_0x9f7f('0x1a')](_0x9f7f('0x1b'),close);}ami['on'](_0x9f7f('0x1c'),connect);ami['on'](_0x9f7f('0x1d'),function(_0x5c29c2){logger[_0x9f7f('0x19')](util[_0x9f7f('0xd')](_0x9f7f('0x1e'),config['asterisk'][_0x9f7f('0x6')],config[_0x9f7f('0x4')]['ip'],config['asterisk'][_0x9f7f('0x5')],util[_0x9f7f('0xc')](_0x5c29c2,![],null)));});ami['on'](_0x9f7f('0x1f'),function(){logger[_0x9f7f('0x19')](util['format'](_0x9f7f('0x20'),config[_0x9f7f('0x4')][_0x9f7f('0x6')],config[_0x9f7f('0x4')]['ip'],config[_0x9f7f('0x4')][_0x9f7f('0x5')]));return Promise[_0x9f7f('0x21')]()[_0x9f7f('0x22')](ami[_0x9f7f('0xf')]())[_0x9f7f('0x22')](ami['actionDeviceStateList']())[_0x9f7f('0x22')](ami[_0x9f7f('0x13')]())['then'](ami[_0x9f7f('0x15')]())['then'](ami['actionCoreShowChannels']())[_0x9f7f('0x23')](function(_0x57df3d){logger['error'](_0x9f7f('0x24'),util[_0x9f7f('0xc')](_0x57df3d,{'showHidden':![],'depth':null}));});});ami[_0x9f7f('0x1a')](_0x9f7f('0xb'),error);ami[_0x9f7f('0x1a')]('close',close);module[_0x9f7f('0x25')]=ami;
\ No newline at end of file