Built motion from commit d1eab355.|2.6.28
[motion2.git] / server / services / ami / ami.js
index 38539b4..dd2a9b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ccb=['../../config/environment','port','asterisk','password','keepConnected','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','username','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','Action','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','coreshowchannels','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','close','connect','shutdown','info','fullybooted','resolve','then','actionCoreShowChannels','log','once','exports','asterisk-manager','bluebird','moment','util','lodash','../../config/logger','ami'];(function(_0x10f249,_0x5b8ad6){var _0x2b7423=function(_0x143f0c){while(--_0x143f0c){_0x10f249['push'](_0x10f249['shift']());}};_0x2b7423(++_0x5b8ad6);}(_0x1ccb,0x6e));var _0xb1cc=function(_0x246b7d,_0x5a22f4){_0x246b7d=_0x246b7d-0x0;var _0x22f86c=_0x1ccb[_0x246b7d];return _0x22f86c;};'use strict';var Manager=require(_0xb1cc('0x0'));var BPromise=require(_0xb1cc('0x1'));var moment=require(_0xb1cc('0x2'));var util=require(_0xb1cc('0x3'));var _=require(_0xb1cc('0x4'));var logger=require(_0xb1cc('0x5'))(_0xb1cc('0x6'));var config=require(_0xb1cc('0x7'));var ami=new Manager(config['asterisk'][_0xb1cc('0x8')],config[_0xb1cc('0x9')]['ip'],config['asterisk']['username'],config['asterisk'][_0xb1cc('0xa')],!![]);ami[_0xb1cc('0xb')]();ami['Action']=BPromise['promisify'](ami[_0xb1cc('0xc')]);function error(_0x229637){logger[_0xb1cc('0xd')](util[_0xb1cc('0xe')](_0xb1cc('0xf'),config['asterisk'][_0xb1cc('0x10')],config['asterisk']['ip'],config[_0xb1cc('0x9')][_0xb1cc('0x8')],util['inspect'](_0x229637,![],null)));}function close(){logger[_0xb1cc('0xd')](util[_0xb1cc('0xe')](_0xb1cc('0x11'),config[_0xb1cc('0x9')][_0xb1cc('0x10')],config['asterisk']['ip'],config[_0xb1cc('0x9')][_0xb1cc('0x8')]));}ami[_0xb1cc('0x12')]=function(){return function(){return ami['Action']({'action':_0xb1cc('0x13')});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0xb1cc('0x14')]({'action':_0xb1cc('0x15')});};};ami[_0xb1cc('0x16')]=function(){return function(){return ami['Action']({'action':_0xb1cc('0x17')});};};ami[_0xb1cc('0x18')]=function(){return function(){return ami['Action']({'action':_0xb1cc('0x19')});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0xb1cc('0x14')]({'action':_0xb1cc('0x1a')});};};function connect(_0x3b3e55){logger['info'](util['format'](_0xb1cc('0x1b'),config['asterisk'][_0xb1cc('0x10')],config[_0xb1cc('0x9')]['ip'],config[_0xb1cc('0x9')][_0xb1cc('0x8')]));ami['once'](_0xb1cc('0xd'),error);ami['once'](_0xb1cc('0x1c'),close);}ami['on'](_0xb1cc('0x1d'),connect);ami['on'](_0xb1cc('0x1e'),function(_0x1dacf0){logger[_0xb1cc('0x1f')](util['format']('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config['asterisk']['username'],config[_0xb1cc('0x9')]['ip'],config[_0xb1cc('0x9')][_0xb1cc('0x8')],util['inspect'](_0x1dacf0,![],null)));});ami['on'](_0xb1cc('0x20'),function(_0x26d311){logger[_0xb1cc('0x1f')](util[_0xb1cc('0xe')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0xb1cc('0x9')][_0xb1cc('0x10')],config['asterisk']['ip'],config[_0xb1cc('0x9')][_0xb1cc('0x8')]));return BPromise[_0xb1cc('0x21')]()['then'](ami[_0xb1cc('0x12')]())['then'](ami['actionDeviceStateList']())[_0xb1cc('0x22')](ami[_0xb1cc('0x16')]())[_0xb1cc('0x22')](ami[_0xb1cc('0x18')]())['then'](ami[_0xb1cc('0x23')]())['catch'](function(_0x15d4aa){console[_0xb1cc('0x24')](_0x15d4aa);});});ami[_0xb1cc('0x25')]('error',error);ami[_0xb1cc('0x25')](_0xb1cc('0x1c'),close);module[_0xb1cc('0x26')]=ami;
\ No newline at end of file
+var _0xa3b1=['../../config/logger','ami','../../config/environment','asterisk','port','username','keepConnected','Action','promisify','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','format','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','actionSipPeerStatus','sippeerstatus','actionQueueSummary','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','inspect','fullybooted','then','actionCoreShowChannels','catch','[ami.js][fullybooted]','exports','asterisk-manager','bluebird'];(function(_0x50311e,_0x518f57){var _0x5b4d80=function(_0x52c9ed){while(--_0x52c9ed){_0x50311e['push'](_0x50311e['shift']());}};_0x5b4d80(++_0x518f57);}(_0xa3b1,0x1da));var _0x1a3b=function(_0x587693,_0x27fe90){_0x587693=_0x587693-0x0;var _0x510a1a=_0xa3b1[_0x587693];return _0x510a1a;};'use strict';var Manager=require(_0x1a3b('0x0'));var BPromise=require(_0x1a3b('0x1'));var util=require('util');var logger=require(_0x1a3b('0x2'))(_0x1a3b('0x3'));var config=require(_0x1a3b('0x4'));var ami=new Manager(config[_0x1a3b('0x5')][_0x1a3b('0x6')],config[_0x1a3b('0x5')]['ip'],config[_0x1a3b('0x5')][_0x1a3b('0x7')],config[_0x1a3b('0x5')]['password'],!![]);ami[_0x1a3b('0x8')]();ami[_0x1a3b('0x9')]=BPromise[_0x1a3b('0xa')](ami['action']);function error(_0x2e4f7c){logger[_0x1a3b('0xb')](util['format'](_0x1a3b('0xc'),config['asterisk'][_0x1a3b('0x7')],config[_0x1a3b('0x5')]['ip'],config['asterisk'][_0x1a3b('0x6')],util['inspect'](_0x2e4f7c,![],null)));}function close(){logger['error'](util[_0x1a3b('0xd')](_0x1a3b('0xe'),config['asterisk'][_0x1a3b('0x7')],config['asterisk']['ip'],config['asterisk'][_0x1a3b('0x6')]));}ami[_0x1a3b('0xf')]=function(){return function(){return ami[_0x1a3b('0x9')]({'action':_0x1a3b('0x10')});};};ami[_0x1a3b('0x11')]=function(){return function(){return ami[_0x1a3b('0x9')]({'action':'devicestatelist'});};};ami[_0x1a3b('0x12')]=function(){return function(){return ami[_0x1a3b('0x9')]({'action':_0x1a3b('0x13')});};};ami[_0x1a3b('0x14')]=function(){return function(){return ami['Action']({'action':'queuesummary'});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0x1a3b('0x9')]({'action':_0x1a3b('0x15')});};};function connect(){logger[_0x1a3b('0x16')](util[_0x1a3b('0xd')](_0x1a3b('0x17'),config['asterisk']['username'],config['asterisk']['ip'],config['asterisk'][_0x1a3b('0x6')]));ami['once']('error',error);ami[_0x1a3b('0x18')](_0x1a3b('0x19'),close);}ami['on'](_0x1a3b('0x1a'),connect);ami['on']('shutdown',function(_0x56f601){logger['info'](util[_0x1a3b('0xd')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0x1a3b('0x5')]['username'],config[_0x1a3b('0x5')]['ip'],config[_0x1a3b('0x5')][_0x1a3b('0x6')],util[_0x1a3b('0x1b')](_0x56f601,![],null)));});ami['on'](_0x1a3b('0x1c'),function(){logger['info'](util[_0x1a3b('0xd')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x1a3b('0x5')][_0x1a3b('0x7')],config[_0x1a3b('0x5')]['ip'],config[_0x1a3b('0x5')][_0x1a3b('0x6')]));return Promise['resolve']()[_0x1a3b('0x1d')](ami[_0x1a3b('0xf')]())[_0x1a3b('0x1d')](ami['actionDeviceStateList']())[_0x1a3b('0x1d')](ami[_0x1a3b('0x12')]())[_0x1a3b('0x1d')](ami[_0x1a3b('0x14')]())['then'](ami[_0x1a3b('0x1e')]())[_0x1a3b('0x1f')](function(_0x5dd35c){logger['error'](_0x1a3b('0x20'),util[_0x1a3b('0x1b')](_0x5dd35c,{'showHidden':![],'depth':null}));});});ami['once'](_0x1a3b('0xb'),error);ami[_0x1a3b('0x18')](_0x1a3b('0x19'),close);module[_0x1a3b('0x21')]=ami;
\ No newline at end of file