Built motion from commit 753c950e.|2.5.42
[motion2.git] / server / services / ami / ami.js
index 653a3b4..840a364 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed23=['exports','asterisk-manager','bluebird','moment','util','lodash','../../config/logger','../../config/environment','asterisk','port','username','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','Action','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','catch','log'];(function(_0x3a6b78,_0x2d62be){var _0x4943d4=function(_0x33ab64){while(--_0x33ab64){_0x3a6b78['push'](_0x3a6b78['shift']());}};_0x4943d4(++_0x2d62be);}(_0xed23,0xd9));var _0x3ed2=function(_0x46aed1,_0x489082){_0x46aed1=_0x46aed1-0x0;var _0x51a924=_0xed23[_0x46aed1];return _0x51a924;};'use strict';var Manager=require(_0x3ed2('0x0'));var BPromise=require(_0x3ed2('0x1'));var moment=require(_0x3ed2('0x2'));var util=require(_0x3ed2('0x3'));var _=require(_0x3ed2('0x4'));var logger=require(_0x3ed2('0x5'))('ami');var config=require(_0x3ed2('0x6'));var ami=new Manager(config[_0x3ed2('0x7')][_0x3ed2('0x8')],config[_0x3ed2('0x7')]['ip'],config[_0x3ed2('0x7')][_0x3ed2('0x9')],config[_0x3ed2('0x7')]['password'],!![]);ami['keepConnected']();ami['Action']=BPromise['promisify'](ami[_0x3ed2('0xa')]);function error(_0x4fd9f){logger[_0x3ed2('0xb')](util[_0x3ed2('0xc')](_0x3ed2('0xd'),config[_0x3ed2('0x7')]['username'],config['asterisk']['ip'],config[_0x3ed2('0x7')][_0x3ed2('0x8')],util[_0x3ed2('0xe')](_0x4fd9f,![],null)));}function close(){logger[_0x3ed2('0xb')](util[_0x3ed2('0xc')](_0x3ed2('0xf'),config[_0x3ed2('0x7')]['username'],config[_0x3ed2('0x7')]['ip'],config['asterisk'][_0x3ed2('0x8')]));}ami[_0x3ed2('0x10')]=function(){return function(){return ami[_0x3ed2('0x11')]({'action':_0x3ed2('0x12')});};};ami[_0x3ed2('0x13')]=function(){return function(){return ami[_0x3ed2('0x11')]({'action':_0x3ed2('0x14')});};};ami[_0x3ed2('0x15')]=function(){return function(){return ami[_0x3ed2('0x11')]({'action':'sippeerstatus'});};};ami[_0x3ed2('0x16')]=function(){return function(){return ami[_0x3ed2('0x11')]({'action':_0x3ed2('0x17')});};};ami[_0x3ed2('0x18')]=function(){return function(){return ami[_0x3ed2('0x11')]({'action':_0x3ed2('0x19')});};};function connect(_0x51bc52){logger[_0x3ed2('0x1a')](util['format'](_0x3ed2('0x1b'),config['asterisk'][_0x3ed2('0x9')],config['asterisk']['ip'],config[_0x3ed2('0x7')]['port']));ami[_0x3ed2('0x1c')](_0x3ed2('0xb'),error);ami['once'](_0x3ed2('0x1d'),close);}ami['on']('connect',connect);ami['on']('shutdown',function(_0x3dd448){logger[_0x3ed2('0x1a')](util[_0x3ed2('0xc')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0x3ed2('0x7')][_0x3ed2('0x9')],config[_0x3ed2('0x7')]['ip'],config[_0x3ed2('0x7')]['port'],util[_0x3ed2('0xe')](_0x3dd448,![],null)));});ami['on']('fullybooted',function(_0x5e7c51){logger[_0x3ed2('0x1a')](util['format'](_0x3ed2('0x1e'),config[_0x3ed2('0x7')][_0x3ed2('0x9')],config[_0x3ed2('0x7')]['ip'],config[_0x3ed2('0x7')][_0x3ed2('0x8')]));return BPromise[_0x3ed2('0x1f')]()[_0x3ed2('0x20')](ami[_0x3ed2('0x10')]())[_0x3ed2('0x20')](ami[_0x3ed2('0x13')]())[_0x3ed2('0x20')](ami[_0x3ed2('0x15')]())[_0x3ed2('0x20')](ami[_0x3ed2('0x16')]())[_0x3ed2('0x20')](ami[_0x3ed2('0x18')]())[_0x3ed2('0x21')](function(_0x338b52){console[_0x3ed2('0x22')](_0x338b52);});});ami[_0x3ed2('0x1c')](_0x3ed2('0xb'),error);ami['once']('close',close);module[_0x3ed2('0x23')]=ami;
\ No newline at end of file
+var _0xbaf0=['once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','then','actionSipShowRegistry','catch','[ami.js][fullybooted]','exports','bluebird','moment','util','lodash','../../config/logger','ami','asterisk','port','username','password','keepConnected','Action','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s'];(function(_0x57ab2b,_0x1e3226){var _0x10c32d=function(_0x345df2){while(--_0x345df2){_0x57ab2b['push'](_0x57ab2b['shift']());}};_0x10c32d(++_0x1e3226);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var util=require(_0x0baf('0x2'));var _=require(_0x0baf('0x3'));var logger=require(_0x0baf('0x4'))(_0x0baf('0x5'));var config=require('../../config/environment');var ami=new Manager(config[_0x0baf('0x6')][_0x0baf('0x7')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')][_0x0baf('0x9')],!![]);ami[_0x0baf('0xa')]();ami[_0x0baf('0xb')]=BPromise['promisify'](ami[_0x0baf('0xc')]);function error(_0x5f20aa){logger[_0x0baf('0xd')](util[_0x0baf('0xe')](_0x0baf('0xf'),config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')],util[_0x0baf('0x10')](_0x5f20aa,![],null)));}function close(){logger[_0x0baf('0xd')](util[_0x0baf('0xe')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config['asterisk'][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x0baf('0xb')]({'action':'sipshowregistry'});};};ami[_0x0baf('0x11')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x12')});};};ami[_0x0baf('0x13')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x14')});};};ami['actionQueueSummary']=function(){return function(){return ami['Action']({'action':_0x0baf('0x15')});};};ami[_0x0baf('0x16')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x17')});};};function connect(_0x2cf7da){logger[_0x0baf('0x18')](util['format'](_0x0baf('0x19'),config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));ami['once']('error',error);ami[_0x0baf('0x1a')](_0x0baf('0x1b'),close);}ami['on'](_0x0baf('0x1c'),connect);ami['on'](_0x0baf('0x1d'),function(_0x1fa92b){logger[_0x0baf('0x18')](util[_0x0baf('0xe')](_0x0baf('0x1e'),config[_0x0baf('0x6')][_0x0baf('0x8')],config['asterisk']['ip'],config[_0x0baf('0x6')]['port'],util[_0x0baf('0x10')](_0x1fa92b,![],null)));});ami['on']('fullybooted',function(_0x4de74c){logger[_0x0baf('0x18')](util['format']('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));return BPromise['resolve']()[_0x0baf('0x1f')](ami[_0x0baf('0x20')]())[_0x0baf('0x1f')](ami[_0x0baf('0x11')]())[_0x0baf('0x1f')](ami[_0x0baf('0x13')]())[_0x0baf('0x1f')](ami['actionQueueSummary']())[_0x0baf('0x1f')](ami[_0x0baf('0x16')]())[_0x0baf('0x21')](function(_0x265915){logger['error'](_0x0baf('0x22'),util[_0x0baf('0x10')](_0x265915,{'showHidden':![],'depth':null}));});});ami['once'](_0x0baf('0xd'),error);ami[_0x0baf('0x1a')](_0x0baf('0x1b'),close);module[_0x0baf('0x23')]=ami;
\ No newline at end of file