Built motion from commit (unavailable).|2.5.21
[motion2.git] / server / services / ami / ami.js
index bafcbb5..c401b4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b6a=['actionQueueSummary','queuesummary','info','once','error','close','shutdown','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipShowRegistry','actionCoreShowChannels','catch','log','exports','asterisk-manager','bluebird','util','lodash','ami','../../config/environment','asterisk','port','username','password','keepConnected','Action','promisify','action','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','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus'];(function(_0x3e6b3b,_0x1926ee){var _0x2d6af5=function(_0x5f5213){while(--_0x5f5213){_0x3e6b3b['push'](_0x3e6b3b['shift']());}};_0x2d6af5(++_0x1926ee);}(_0x2b6a,0xce));var _0xa2b6=function(_0x4e8250,_0x479dab){_0x4e8250=_0x4e8250-0x0;var _0x389a21=_0x2b6a[_0x4e8250];return _0x389a21;};'use strict';var Manager=require(_0xa2b6('0x0'));var BPromise=require(_0xa2b6('0x1'));var moment=require('moment');var util=require(_0xa2b6('0x2'));var _=require(_0xa2b6('0x3'));var logger=require('../../config/logger')(_0xa2b6('0x4'));var config=require(_0xa2b6('0x5'));var ami=new Manager(config[_0xa2b6('0x6')][_0xa2b6('0x7')],config[_0xa2b6('0x6')]['ip'],config[_0xa2b6('0x6')][_0xa2b6('0x8')],config[_0xa2b6('0x6')][_0xa2b6('0x9')],!![]);ami[_0xa2b6('0xa')]();ami[_0xa2b6('0xb')]=BPromise[_0xa2b6('0xc')](ami[_0xa2b6('0xd')]);function error(_0x4383d2){logger['error'](util[_0xa2b6('0xe')](_0xa2b6('0xf'),config[_0xa2b6('0x6')][_0xa2b6('0x8')],config[_0xa2b6('0x6')]['ip'],config[_0xa2b6('0x6')][_0xa2b6('0x7')],util[_0xa2b6('0x10')](_0x4383d2,![],null)));}function close(){logger['error'](util[_0xa2b6('0xe')](_0xa2b6('0x11'),config[_0xa2b6('0x6')]['username'],config[_0xa2b6('0x6')]['ip'],config['asterisk'][_0xa2b6('0x7')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0xa2b6('0xb')]({'action':_0xa2b6('0x12')});};};ami[_0xa2b6('0x13')]=function(){return function(){return ami[_0xa2b6('0xb')]({'action':_0xa2b6('0x14')});};};ami[_0xa2b6('0x15')]=function(){return function(){return ami[_0xa2b6('0xb')]({'action':'sippeerstatus'});};};ami[_0xa2b6('0x16')]=function(){return function(){return ami['Action']({'action':_0xa2b6('0x17')});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0xa2b6('0xb')]({'action':'coreshowchannels'});};};function connect(_0x4b2538){logger[_0xa2b6('0x18')](util[_0xa2b6('0xe')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config['asterisk'][_0xa2b6('0x8')],config[_0xa2b6('0x6')]['ip'],config['asterisk'][_0xa2b6('0x7')]));ami[_0xa2b6('0x19')](_0xa2b6('0x1a'),error);ami[_0xa2b6('0x19')](_0xa2b6('0x1b'),close);}ami['on']('connect',connect);ami['on'](_0xa2b6('0x1c'),function(_0x1039eb){logger[_0xa2b6('0x18')](util[_0xa2b6('0xe')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config['asterisk']['username'],config[_0xa2b6('0x6')]['ip'],config[_0xa2b6('0x6')][_0xa2b6('0x7')],util[_0xa2b6('0x10')](_0x1039eb,![],null)));});ami['on'](_0xa2b6('0x1d'),function(_0x4cc39c){logger[_0xa2b6('0x18')](util['format'](_0xa2b6('0x1e'),config[_0xa2b6('0x6')][_0xa2b6('0x8')],config[_0xa2b6('0x6')]['ip'],config['asterisk'][_0xa2b6('0x7')]));return BPromise[_0xa2b6('0x1f')]()[_0xa2b6('0x20')](ami[_0xa2b6('0x21')]())[_0xa2b6('0x20')](ami[_0xa2b6('0x13')]())['then'](ami['actionSipPeerStatus']())['then'](ami[_0xa2b6('0x16')]())['then'](ami[_0xa2b6('0x22')]())[_0xa2b6('0x23')](function(_0x3fa58a){console[_0xa2b6('0x24')](_0x3fa58a);});});ami[_0xa2b6('0x19')]('error',error);ami[_0xa2b6('0x19')]('close',close);module[_0xa2b6('0x25')]=ami;
\ No newline at end of file
+var _0xed50=['bluebird','moment','util','lodash','../../config/logger','ami','../../config/environment','asterisk','port','password','keepConnected','Action','promisify','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','username','inspect','format','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','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','resolve','then','actionSipPeerStatus','catch','asterisk-manager'];(function(_0x51cd26,_0xf2e5f3){var _0x9cfab7=function(_0x40e76e){while(--_0x40e76e){_0x51cd26['push'](_0x51cd26['shift']());}};_0x9cfab7(++_0xf2e5f3);}(_0xed50,0x74));var _0x0ed5=function(_0x32c48c,_0x5d669e){_0x32c48c=_0x32c48c-0x0;var _0x133729=_0xed50[_0x32c48c];return _0x133729;};'use strict';var Manager=require(_0x0ed5('0x0'));var BPromise=require(_0x0ed5('0x1'));var moment=require(_0x0ed5('0x2'));var util=require(_0x0ed5('0x3'));var _=require(_0x0ed5('0x4'));var logger=require(_0x0ed5('0x5'))(_0x0ed5('0x6'));var config=require(_0x0ed5('0x7'));var ami=new Manager(config[_0x0ed5('0x8')][_0x0ed5('0x9')],config['asterisk']['ip'],config['asterisk']['username'],config[_0x0ed5('0x8')][_0x0ed5('0xa')],!![]);ami[_0x0ed5('0xb')]();ami[_0x0ed5('0xc')]=BPromise[_0x0ed5('0xd')](ami[_0x0ed5('0xe')]);function error(_0xe0ddb){logger[_0x0ed5('0xf')](util['format'](_0x0ed5('0x10'),config[_0x0ed5('0x8')][_0x0ed5('0x11')],config[_0x0ed5('0x8')]['ip'],config[_0x0ed5('0x8')]['port'],util[_0x0ed5('0x12')](_0xe0ddb,![],null)));}function close(){logger[_0x0ed5('0xf')](util[_0x0ed5('0x13')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config['asterisk'][_0x0ed5('0x11')],config[_0x0ed5('0x8')]['ip'],config[_0x0ed5('0x8')]['port']));}ami[_0x0ed5('0x14')]=function(){return function(){return ami[_0x0ed5('0xc')]({'action':_0x0ed5('0x15')});};};ami[_0x0ed5('0x16')]=function(){return function(){return ami[_0x0ed5('0xc')]({'action':_0x0ed5('0x17')});};};ami['actionSipPeerStatus']=function(){return function(){return ami['Action']({'action':_0x0ed5('0x18')});};};ami[_0x0ed5('0x19')]=function(){return function(){return ami['Action']({'action':_0x0ed5('0x1a')});};};ami[_0x0ed5('0x1b')]=function(){return function(){return ami['Action']({'action':'coreshowchannels'});};};function connect(_0x4241b6){logger[_0x0ed5('0x1c')](util[_0x0ed5('0x13')](_0x0ed5('0x1d'),config['asterisk'][_0x0ed5('0x11')],config[_0x0ed5('0x8')]['ip'],config[_0x0ed5('0x8')][_0x0ed5('0x9')]));ami[_0x0ed5('0x1e')](_0x0ed5('0xf'),error);ami['once'](_0x0ed5('0x1f'),close);}ami['on'](_0x0ed5('0x20'),connect);ami['on'](_0x0ed5('0x21'),function(_0x578310){logger[_0x0ed5('0x1c')](util[_0x0ed5('0x13')](_0x0ed5('0x22'),config[_0x0ed5('0x8')][_0x0ed5('0x11')],config['asterisk']['ip'],config[_0x0ed5('0x8')][_0x0ed5('0x9')],util[_0x0ed5('0x12')](_0x578310,![],null)));});ami['on']('fullybooted',function(_0x538675){logger[_0x0ed5('0x1c')](util['format']('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x0ed5('0x8')]['username'],config[_0x0ed5('0x8')]['ip'],config[_0x0ed5('0x8')][_0x0ed5('0x9')]));return BPromise[_0x0ed5('0x23')]()[_0x0ed5('0x24')](ami[_0x0ed5('0x14')]())[_0x0ed5('0x24')](ami[_0x0ed5('0x16')]())[_0x0ed5('0x24')](ami[_0x0ed5('0x25')]())[_0x0ed5('0x24')](ami[_0x0ed5('0x19')]())[_0x0ed5('0x24')](ami[_0x0ed5('0x1b')]())[_0x0ed5('0x26')](function(_0x313970){console['log'](_0x313970);});});ami[_0x0ed5('0x1e')](_0x0ed5('0xf'),error);ami[_0x0ed5('0x1e')]('close',close);module['exports']=ami;
\ No newline at end of file