Built motion from commit 639a1a7f.|2.6.19
[motion2.git] / server / services / ami / ami.js
index 7361e8e..ff85c1c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x802c=['connect','shutdown','fullybooted','resolve','then','catch','[ami.js][fullybooted]','asterisk-manager','util','ami','../../config/environment','asterisk','port','password','keepConnected','Action','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','username','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','actionQueueSummary','queuesummary','actionCoreShowChannels','once','close'];(function(_0x38de33,_0x4361bb){var _0x40f16d=function(_0x25975c){while(--_0x25975c){_0x38de33['push'](_0x38de33['shift']());}};_0x40f16d(++_0x4361bb);}(_0x802c,0xd3));var _0xc802=function(_0x357fd2,_0x302156){_0x357fd2=_0x357fd2-0x0;var _0x4b4a0e=_0x802c[_0x357fd2];return _0x4b4a0e;};'use strict';var Manager=require(_0xc802('0x0'));var BPromise=require('bluebird');var util=require(_0xc802('0x1'));var logger=require('../../config/logger')(_0xc802('0x2'));var config=require(_0xc802('0x3'));var ami=new Manager(config[_0xc802('0x4')][_0xc802('0x5')],config['asterisk']['ip'],config['asterisk']['username'],config['asterisk'][_0xc802('0x6')],!![]);ami[_0xc802('0x7')]();ami[_0xc802('0x8')]=BPromise[_0xc802('0x9')](ami[_0xc802('0xa')]);function error(_0x1967a5){logger[_0xc802('0xb')](util[_0xc802('0xc')](_0xc802('0xd'),config[_0xc802('0x4')][_0xc802('0xe')],config[_0xc802('0x4')]['ip'],config[_0xc802('0x4')][_0xc802('0x5')],util[_0xc802('0xf')](_0x1967a5,![],null)));}function close(){logger[_0xc802('0xb')](util['format'](_0xc802('0x10'),config[_0xc802('0x4')][_0xc802('0xe')],config['asterisk']['ip'],config['asterisk'][_0xc802('0x5')]));}ami[_0xc802('0x11')]=function(){return function(){return ami[_0xc802('0x8')]({'action':_0xc802('0x12')});};};ami[_0xc802('0x13')]=function(){return function(){return ami[_0xc802('0x8')]({'action':_0xc802('0x14')});};};ami[_0xc802('0x15')]=function(){return function(){return ami['Action']({'action':'sippeerstatus'});};};ami[_0xc802('0x16')]=function(){return function(){return ami[_0xc802('0x8')]({'action':_0xc802('0x17')});};};ami[_0xc802('0x18')]=function(){return function(){return ami[_0xc802('0x8')]({'action':'coreshowchannels'});};};function connect(){logger['info'](util[_0xc802('0xc')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0xc802('0x4')][_0xc802('0xe')],config['asterisk']['ip'],config['asterisk'][_0xc802('0x5')]));ami['once'](_0xc802('0xb'),error);ami[_0xc802('0x19')](_0xc802('0x1a'),close);}ami['on'](_0xc802('0x1b'),connect);ami['on'](_0xc802('0x1c'),function(_0x330cba){logger['info'](util[_0xc802('0xc')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config['asterisk'][_0xc802('0xe')],config['asterisk']['ip'],config[_0xc802('0x4')]['port'],util[_0xc802('0xf')](_0x330cba,![],null)));});ami['on'](_0xc802('0x1d'),function(){logger['info'](util[_0xc802('0xc')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0xc802('0x4')][_0xc802('0xe')],config[_0xc802('0x4')]['ip'],config[_0xc802('0x4')][_0xc802('0x5')]));return Promise[_0xc802('0x1e')]()[_0xc802('0x1f')](ami['actionSipShowRegistry']())[_0xc802('0x1f')](ami['actionDeviceStateList']())[_0xc802('0x1f')](ami[_0xc802('0x15')]())[_0xc802('0x1f')](ami[_0xc802('0x16')]())[_0xc802('0x1f')](ami[_0xc802('0x18')]())[_0xc802('0x20')](function(_0x1d4f59){logger[_0xc802('0xb')](_0xc802('0x21'),util[_0xc802('0xf')](_0x1d4f59,{'showHidden':![],'depth':null}));});});ami[_0xc802('0x19')]('error',error);ami[_0xc802('0x19')](_0xc802('0x1a'),close);module['exports']=ami;
\ No newline at end of file
+var _0x34ea=['close','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','then','actionQueueSummary','once','exports','asterisk-manager','bluebird','util','../../config/logger','ami','../../config/environment','port','asterisk','username','Action','promisify','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','error','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','queuesummary','actionCoreShowChannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x34ea,0x18a));var _0xa34e=function(_0x52c6e8,_0x5e5692){_0x52c6e8=_0x52c6e8-0x0;var _0x335328=_0x34ea[_0x52c6e8];return _0x335328;};'use strict';var Manager=require(_0xa34e('0x0'));var BPromise=require(_0xa34e('0x1'));var util=require(_0xa34e('0x2'));var logger=require(_0xa34e('0x3'))(_0xa34e('0x4'));var config=require(_0xa34e('0x5'));var ami=new Manager(config['asterisk'][_0xa34e('0x6')],config[_0xa34e('0x7')]['ip'],config[_0xa34e('0x7')][_0xa34e('0x8')],config[_0xa34e('0x7')]['password'],!![]);ami['keepConnected']();ami[_0xa34e('0x9')]=BPromise[_0xa34e('0xa')](ami['action']);function error(_0xf4be19){logger['error'](util[_0xa34e('0xb')](_0xa34e('0xc'),config[_0xa34e('0x7')][_0xa34e('0x8')],config[_0xa34e('0x7')]['ip'],config[_0xa34e('0x7')][_0xa34e('0x6')],util[_0xa34e('0xd')](_0xf4be19,![],null)));}function close(){logger[_0xa34e('0xe')](util[_0xa34e('0xb')](_0xa34e('0xf'),config[_0xa34e('0x7')][_0xa34e('0x8')],config[_0xa34e('0x7')]['ip'],config[_0xa34e('0x7')][_0xa34e('0x6')]));}ami[_0xa34e('0x10')]=function(){return function(){return ami[_0xa34e('0x9')]({'action':_0xa34e('0x11')});};};ami[_0xa34e('0x12')]=function(){return function(){return ami[_0xa34e('0x9')]({'action':_0xa34e('0x13')});};};ami[_0xa34e('0x14')]=function(){return function(){return ami[_0xa34e('0x9')]({'action':_0xa34e('0x15')});};};ami['actionQueueSummary']=function(){return function(){return ami[_0xa34e('0x9')]({'action':_0xa34e('0x16')});};};ami[_0xa34e('0x17')]=function(){return function(){return ami[_0xa34e('0x9')]({'action':'coreshowchannels'});};};function connect(){logger[_0xa34e('0x18')](util[_0xa34e('0xb')](_0xa34e('0x19'),config[_0xa34e('0x7')][_0xa34e('0x8')],config[_0xa34e('0x7')]['ip'],config['asterisk'][_0xa34e('0x6')]));ami['once'](_0xa34e('0xe'),error);ami['once'](_0xa34e('0x1a'),close);}ami['on']('connect',connect);ami['on'](_0xa34e('0x1b'),function(_0x18b0eb){logger[_0xa34e('0x18')](util[_0xa34e('0xb')](_0xa34e('0x1c'),config[_0xa34e('0x7')][_0xa34e('0x8')],config[_0xa34e('0x7')]['ip'],config[_0xa34e('0x7')]['port'],util[_0xa34e('0xd')](_0x18b0eb,![],null)));});ami['on'](_0xa34e('0x1d'),function(){logger[_0xa34e('0x18')](util['format'](_0xa34e('0x1e'),config[_0xa34e('0x7')]['username'],config['asterisk']['ip'],config['asterisk'][_0xa34e('0x6')]));return Promise['resolve']()[_0xa34e('0x1f')](ami['actionSipShowRegistry']())[_0xa34e('0x1f')](ami[_0xa34e('0x12')]())[_0xa34e('0x1f')](ami[_0xa34e('0x14')]())['then'](ami[_0xa34e('0x20')]())['then'](ami[_0xa34e('0x17')]())['catch'](function(_0x32634e){logger[_0xa34e('0xe')]('[ami.js][fullybooted]',util[_0xa34e('0xd')](_0x32634e,{'showHidden':![],'depth':null}));});});ami[_0xa34e('0x21')](_0xa34e('0xe'),error);ami['once'](_0xa34e('0x1a'),close);module[_0xa34e('0x22')]=ami;
\ No newline at end of file