Built motion from commit (unavailable).|2.4.4
[motion2.git] / server / services / ami / server / index.js
index 4f07368..b124f34 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4685=['mixmonitorid','status','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','map','resolve','StopMixMonitor','wav','stop','StopMixMonitor\x20Success','voicequeuechannel','queueChannels','voicequeuechannelhangup','Hangup','Redirect','exten','context','values','agents','telephones','outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','emit','faxAccounts','send','server','http','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','validate','bluebird','moment','../properties','../ami','listen','format','%s/%s','name','timers','timer','updateAcw','pause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','then','message','command','Command','content','catch','voiceQueues','strategy','answered','available','loggedIn','pTalking','sumDuration','sumHoldTime','talking','total','type','unmanaged','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startPredictive','startProgressive','Trunk','callerid','Interval','push','length','channels','voicechannel','find','uniqueid','%s.%s','filename','channel','ai(mixmonitorid)','toLowerCase','isNil','monitors','/var/spool/asterisk/monitor/','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x595013,_0x65a215){var _0x2a29e3=function(_0x307bf8){while(--_0x307bf8){_0x595013['push'](_0x595013['shift']());}};_0x2a29e3(++_0x65a215);}(_0x4685,0x130));var _0x5468=function(_0x1c42c5,_0x2dba7a){_0x1c42c5=_0x1c42c5-0x0;var _0x1ddc16=_0x4685[_0x1c42c5];return _0x1ddc16;};'use strict';var _=require(_0x5468('0x0'));var util=require('util');var jayson=require('jayson/promise');var schema=require(_0x5468('0x1'));var BPromise=require(_0x5468('0x2'));var moment=require(_0x5468('0x3'));var config=require('../../../config/environment');var properties=require(_0x5468('0x4'));var ami=require(_0x5468('0x5'));exports[_0x5468('0x6')]=function(_0x2eccc2,_0x1bb445,_0x2528e4){return new BPromise(function(_0xed0bbe,_0x14bea0){var _0x39c460={'QueuePause':function(_0x5a886a){return new Promise(function(_0x462633,_0xd78f25){var _0x97d38a=util[_0x5468('0x7')](_0x5468('0x8'),'SIP',_0x5a886a[_0x5468('0x9')]);if(_0x2eccc2['timers']&&_0x2eccc2['timers'][_0x97d38a]&&_0x2eccc2[_0x5468('0xa')][_0x97d38a][_0x5468('0xb')]){_0x2eccc2[_0x5468('0xa')][_0x97d38a][_0x5468('0xc')]();}if(_0x2eccc2['agents'][_0x97d38a]){_0x2eccc2['agents'][_0x97d38a]['updateStatusRealtime']({'statePause':_0x5a886a[_0x5468('0xd')]?!![]:![]});}_0x462633({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x25ad2f){var _0x130b2f=this;return new Promise(function(_0x29715a,_0x10e446){if(ami[_0x5468('0xe')]()==![]){return _0x10e446(_0x130b2f[_0x5468('0xf')](0x1f4,[config[_0x5468('0x10')]['ip'],config[_0x5468('0x10')][_0x5468('0x11')],_0x5468('0x12')][_0x5468('0x13')]('\x20')));}_0x25ad2f=_[_0x5468('0x14')](_0x25ad2f,_[_0x5468('0x15')](properties[_0x5468('0x16')]));_0x25ad2f[_0x5468('0x17')]=_0x5468('0x18');return ami[_0x5468('0x19')](_0x25ad2f)[_0x5468('0x1a')](function(_0x1fed3f){_0x29715a({'code':0xc8,'message':_0x1fed3f[_0x5468('0x1b')]});})['catch'](function(_0x5df3c0){_0x10e446(_0x130b2f[_0x5468('0xf')](0x1f5,_0x5df3c0[_0x5468('0x1b')]));});});},'Command':function(_0x2596b3){var _0x44670d=this;return new Promise(function(_0x10ee69,_0x5df517){if(ami['isConnected']()==![]){return _0x5df517(_0x44670d['error'](0x1f4,[config[_0x5468('0x10')]['ip'],config[_0x5468('0x10')][_0x5468('0x11')],'ami\x20disconnected']['join']('\x20')));}_0x2596b3=_['pick'](_0x2596b3,_0x5468('0x1c'));_0x2596b3[_0x5468('0x17')]=_0x5468('0x1d');return ami['Action'](_0x2596b3)['then'](function(_0x1bcb3f){_0x10ee69({'code':0xc8,'message':_0x1bcb3f[_0x5468('0x1e')]});})[_0x5468('0x1f')](function(_0x298226){_0x5df517(_0x44670d[_0x5468('0xf')](0x1f5,_0x298226[_0x5468('0x1b')]));});});},'VoiceQueues':function(_0x136be5){return new Promise(function(_0xb169e4,_0x4285b1){var _0x2748a6=[];for(var _0x5d544a in _0x2eccc2[_0x5468('0x20')]){if(_0x2eccc2[_0x5468('0x20')]['hasOwnProperty'](_0x5d544a)){var _0x59f2f7=_0x2eccc2[_0x5468('0x20')][_0x5d544a];var _0x227af4={'id':_0x59f2f7['id'],'name':_0x59f2f7[_0x5468('0x9')],'strategy':_0x59f2f7[_0x5468('0x21')],'answered':_0x59f2f7[_0x5468('0x22')],'available':_0x59f2f7[_0x5468('0x23')],'loggedIn':_0x59f2f7[_0x5468('0x24')],'pTalking':_0x59f2f7[_0x5468('0x25')],'sumBillable':_0x59f2f7['sumBillable'],'sumDuration':_0x59f2f7[_0x5468('0x26')],'sumHoldTime':_0x59f2f7[_0x5468('0x27')]||0x0,'talking':_0x59f2f7[_0x5468('0x28')],'total':_0x59f2f7[_0x5468('0x29')],'type':_0x59f2f7[_0x5468('0x2a')],'unmanaged':_0x59f2f7[_0x5468('0x2b')],'abandoned':_0x59f2f7['abandoned'],'waiting':_0x59f2f7[_0x5468('0x2c')],'loggedInDb':_0x59f2f7[_0x5468('0x2d')]};if(_0x59f2f7[_0x5468('0x2a')]===_0x5468('0x2e')){_0x227af4['dialActive']=_0x59f2f7[_0x5468('0x2f')];_0x227af4[_0x5468('0x30')]=_0x59f2f7[_0x5468('0x30')];_0x227af4['dialOriginateCallerIdName']=_0x59f2f7[_0x5468('0x31')];_0x227af4['dialOriginateCallerIdNumber']=_0x59f2f7['dialOriginateCallerIdNumber'];_0x227af4['dialOriginateTimeout']=_0x59f2f7[_0x5468('0x32')];_0x227af4['dialPrefix']=_0x59f2f7[_0x5468('0x33')];_0x227af4[_0x5468('0x34')]=_0x59f2f7['outboundAnswerAgiCallsDay'];_0x227af4[_0x5468('0x35')]=_0x59f2f7[_0x5468('0x35')];_0x227af4['outboundBlacklistCallsDay']=_0x59f2f7[_0x5468('0x36')];_0x227af4['outboundBusyCallsDay']=_0x59f2f7['outboundBusyCallsDay'];_0x227af4[_0x5468('0x37')]=_0x59f2f7['outboundCongestionCallsDay'];_0x227af4[_0x5468('0x38')]=_0x59f2f7[_0x5468('0x38')];_0x227af4['outboundDropCallsDayCallersExit']=_0x59f2f7[_0x5468('0x39')];_0x227af4['outboundDropCallsDayTimeout']=_0x59f2f7[_0x5468('0x3a')];_0x227af4[_0x5468('0x3b')]=_0x59f2f7[_0x5468('0x3b')];_0x227af4[_0x5468('0x3c')]=_0x59f2f7['outboundNoSuchCallsDay'];_0x227af4[_0x5468('0x3d')]=_0x59f2f7[_0x5468('0x3d')];_0x227af4['outboundReCallsDay']=_0x59f2f7[_0x5468('0x3e')];_0x227af4[_0x5468('0x3f')]=_0x59f2f7['outboundRejectCallsDay'];_0x227af4[_0x5468('0x40')]=_0x59f2f7[_0x5468('0x40')];_0x227af4[_0x5468('0x41')]=_0x59f2f7['predictiveIntervalAnsweredCalls'];_0x227af4[_0x5468('0x42')]=_0x59f2f7['predictiveIntervalAvgHoldtime'];_0x227af4['predictiveIntervalAvgTalktime']=_0x59f2f7[_0x5468('0x43')];_0x227af4[_0x5468('0x44')]=_0x59f2f7[_0x5468('0x44')];_0x227af4[_0x5468('0x45')]=_0x59f2f7[_0x5468('0x45')];_0x227af4[_0x5468('0x46')]=_0x59f2f7['predictiveIntervalErlangCalls'];_0x227af4['predictiveIntervalErlangCallsDroppedCalls']=_0x59f2f7[_0x5468('0x47')];_0x227af4['predictiveIntervalHitRate']=_0x59f2f7[_0x5468('0x48')];_0x227af4[_0x5468('0x49')]=_0x59f2f7[_0x5468('0x49')];_0x227af4[_0x5468('0x4a')]=_0x59f2f7[_0x5468('0x4a')];_0x227af4[_0x5468('0x4b')]=_0x59f2f7[_0x5468('0x4b')];_0x227af4[_0x5468('0x4c')]=_0x59f2f7['predictiveIntervalTotalCalls'];_0x227af4[_0x5468('0x1b')]=_0x59f2f7[_0x5468('0x1b')];_0x227af4[_0x5468('0x4d')]=_0x59f2f7[_0x5468('0x4d')];_0x227af4[_0x5468('0x4e')]=_0x59f2f7[_0x5468('0x4e')];_0x227af4[_0x5468('0x4f')]=_0x59f2f7[_0x5468('0x4f')];_0x227af4[_0x5468('0x50')]=_0x59f2f7[_0x5468('0x50')];_0x227af4['erlangBusyFactor']=_0x59f2f7['erlangBusyFactor'];_0x227af4[_0x5468('0x51')]=_0x59f2f7[_0x5468('0x51')];_0x227af4[_0x5468('0x52')]=_0x59f2f7['startProgressive'];}if(_0x59f2f7[_0x5468('0x53')]){_0x227af4[_0x5468('0x53')]={'id':_0x59f2f7['Trunk']['id'],'name':_0x59f2f7[_0x5468('0x53')]['name'],'active':_0x59f2f7[_0x5468('0x53')]['active'],'callerid':_0x59f2f7[_0x5468('0x53')][_0x5468('0x54')]};}if(_0x59f2f7[_0x5468('0x55')]){_0x227af4[_0x5468('0x55')]={'id':_0x59f2f7[_0x5468('0x55')]['id'],'name':_0x59f2f7[_0x5468('0x55')][_0x5468('0x9')]};}_0x2748a6[_0x5468('0x56')](_0x227af4);}}_0xb169e4({'count':_0x2748a6[_0x5468('0x57')],'rows':_0x2748a6});});},'VoiceChannels':function(_0x3437ae){return new Promise(function(_0x4e73c0,_0x3e07c8){var _0xca9009=_['values'](_0x2eccc2[_0x5468('0x58')]);_0x4e73c0({'count':_0xca9009[_0x5468('0x57')],'rows':_0xca9009});});},'VoiceChannelMixMonitor':function(_0x3b8cc3){var _0x236c74=this;return new Promise(function(_0x5e3f90,_0x43c6f1){if(ami[_0x5468('0xe')]()==![]){return _0x43c6f1(_0x236c74[_0x5468('0xf')](0x1f4,[config[_0x5468('0x10')]['ip'],config[_0x5468('0x10')][_0x5468('0x11')],_0x5468('0x12')][_0x5468('0x13')]('\x20')));}var _0x1a389b=schema(properties[_0x5468('0x59')])[_0x5468('0x1')](_0x3b8cc3);if(_0x1a389b[_0x5468('0x57')]>0x0){return _0x43c6f1(_0x236c74[_0x5468('0xf')](0x1f4,_['map'](_0x1a389b,_0x5468('0x1b'))[_0x5468('0x13')](',\x20')));}var _0x3e80e8=_[_0x5468('0x5a')](_0x2eccc2[_0x5468('0x58')],{'uniqueid':_0x3b8cc3[_0x5468('0x5b')]});if(_0x3e80e8&&_0x3e80e8['channel']){var _0x4b29ec=util[_0x5468('0x7')](_0x5468('0x5c'),_0x3b8cc3[_0x5468('0x5d')]||_0x3b8cc3[_0x5468('0x5b')],_0x3b8cc3['format']||'wav');return ami[_0x5468('0x19')]({'action':'MixMonitor','channel':_0x3e80e8[_0x5468('0x5e')],'file':_0x4b29ec,'options':_0x5468('0x5f')})['then'](function(_0x3cb3d9){var _0x2bc74a=_['find'](_0x3e80e8['monitors'],{'filename':'/var/spool/asterisk/monitor/'+_0x4b29ec[_0x5468('0x60')]()});if(_[_0x5468('0x61')](_0x2bc74a)){_0x3e80e8[_0x5468('0x62')][_0x5468('0x56')]({'filename':_0x5468('0x63')+_0x4b29ec[_0x5468('0x60')](),'createdAt':moment()[_0x5468('0x7')](_0x5468('0x64')),'mixmonitorid':_0x3cb3d9[_0x5468('0x65')],'status':'rec'});}else{_0x2bc74a[_0x5468('0x65')]=_0x3cb3d9['mixmonitorid'];_0x2bc74a[_0x5468('0x66')]=_0x5468('0x67');}_0x5e3f90({'code':0xc8,'message':[_0x3b8cc3[_0x5468('0x5b')],_0x5468('0x68'),_0x3cb3d9[_0x5468('0x65')]][_0x5468('0x13')]('\x20'),'mixmonitorid':_0x3cb3d9['mixmonitorid']});})['catch'](function(_0x5d6891){_0x43c6f1(_0x236c74[_0x5468('0xf')](0x1f5,[_0x3b8cc3[_0x5468('0x5b')],_0x5d6891[_0x5468('0x1b')][_0x5468('0x60')]()][_0x5468('0x13')]('\x20')));});}else{return _0x43c6f1(_0x236c74[_0x5468('0xf')](0x1f5,_0x5468('0x69')));}});},'VoiceChannelStopMixMonitor':function(_0x69f53d){var _0x31e865=this;return new Promise(function(_0x33b11d,_0x498cfb){if(ami[_0x5468('0xe')]()==![]){return _0x498cfb(_0x31e865['error'](0x1f4,[config[_0x5468('0x10')]['ip'],config[_0x5468('0x10')][_0x5468('0x11')],_0x5468('0x12')][_0x5468('0x13')]('\x20')));}var _0x4a6b70=schema(properties[_0x5468('0x59')])[_0x5468('0x1')](_0x69f53d);if(_0x4a6b70[_0x5468('0x57')]>0x0){return _0x498cfb(_0x31e865['error'](0x1f4,_[_0x5468('0x6a')](_0x4a6b70,_0x5468('0x1b'))[_0x5468('0x13')](',\x20')));}var _0x82cd71=_['find'](_0x2eccc2['channels'],{'uniqueid':_0x69f53d['uniqueid']});if(_0x82cd71){return BPromise[_0x5468('0x6b')]()[_0x5468('0x1a')](function(){if(_0x82cd71[_0x5468('0x5e')]){return ami[_0x5468('0x19')]({'action':_0x5468('0x6c'),'channel':_0x82cd71['channel'],'mixmonitorid':_0x69f53d[_0x5468('0x65')]})[_0x5468('0x1f')](function(_0x46ab4d){});}})[_0x5468('0x1a')](function(){if(_0x82cd71['destinationchannel']){return ami[_0x5468('0x19')]({'action':_0x5468('0x6c'),'channel':_0x82cd71['destinationchannel'],'mixmonitorid':_0x69f53d['mixmonitorid']})['catch'](function(_0x4beca6){});}})['then'](function(_0x64d955){var _0xbd92b=_[_0x5468('0x5a')](_0x82cd71[_0x5468('0x62')],{'mixmonitorid':_0x69f53d['mixmonitorid']});if(_0xbd92b){_0xbd92b[_0x5468('0x66')]='stop';}})[_0x5468('0x1a')](function(){var _0xa0a1a1=util['format'](_0x5468('0x5c'),_0x69f53d[_0x5468('0x5d')]||_0x69f53d[_0x5468('0x5b')],_0x69f53d[_0x5468('0x7')]||_0x5468('0x6d'));var _0x348582=_['find'](_0x82cd71[_0x5468('0x62')],{'filename':_0x5468('0x63')+_0xa0a1a1[_0x5468('0x60')]()});if(_0x348582){_0x348582['status']=_0x5468('0x6e');}})[_0x5468('0x1a')](function(){_0x33b11d({'code':0xc8,'message':[_0x69f53d[_0x5468('0x5b')],_0x5468('0x6f')][_0x5468('0x13')]('\x20')});})[_0x5468('0x1f')](function(_0x582d1e){_0x498cfb(_0x31e865['error'](0x1f5,[_0x69f53d[_0x5468('0x5b')],_0x582d1e[_0x5468('0x1b')][_0x5468('0x60')]()]['join']('\x20')));});}else{return _0x498cfb(_0x31e865['error'](0x1f5,_0x5468('0x69')));}});},'VoiceQueuesChannels':function(_0x27c575){return new Promise(function(_0x491ae1,_0x54e211){var _0x592ac9=_['values'](_0x2eccc2['queueChannels']);_0x491ae1({'count':_0x592ac9['length'],'rows':_0x592ac9});});},'VoiceQueuesChannel':function(_0x45433d){var _0x4a928f=this;return new Promise(function(_0x112781,_0xf845c4){var _0x1736f6=schema(properties[_0x5468('0x70')])[_0x5468('0x1')](_0x45433d);if(_0x1736f6[_0x5468('0x57')]>0x0){return _0xf845c4(_0x4a928f[_0x5468('0xf')](0x1f4,_[_0x5468('0x6a')](_0x1736f6,_0x5468('0x1b'))[_0x5468('0x13')](',\x20')));}var _0x544757=_[_0x5468('0x5a')](_0x2eccc2[_0x5468('0x71')],{'uniqueid':_0x45433d[_0x5468('0x5b')]});if(_0x544757){_0x112781(_0x544757);}else{return _0xf845c4(_0x4a928f[_0x5468('0xf')](0x1f5,_0x5468('0x69')));}});},'VoiceQueuesChannelHangup':function(_0x8eba43){var _0x15809a=this;return new Promise(function(_0x1ef787,_0x4087a5){if(ami[_0x5468('0xe')]()==![]){return _0x4087a5(_0x15809a[_0x5468('0xf')](0x1f4,[config[_0x5468('0x10')]['ip'],config[_0x5468('0x10')][_0x5468('0x11')],'ami\x20disconnected'][_0x5468('0x13')]('\x20')));}var _0x575067=schema(properties[_0x5468('0x72')])[_0x5468('0x1')](_0x8eba43);if(_0x575067[_0x5468('0x57')]>0x0){return _0x4087a5(_0x15809a[_0x5468('0xf')](0x1f4,_[_0x5468('0x6a')](_0x575067,_0x5468('0x1b'))[_0x5468('0x13')](',\x20')));}var _0x4787e2=_['find'](_0x2eccc2[_0x5468('0x71')],{'uniqueid':_0x8eba43['uniqueid']});if(_0x4787e2&&_0x4787e2['channel']){return ami[_0x5468('0x19')]({'action':_0x5468('0x73'),'channel':_0x4787e2[_0x5468('0x5e')]})[_0x5468('0x1a')](function(_0x32aa3c){_0x1ef787({'code':0xc8,'message':[_0x8eba43[_0x5468('0x5b')],_0x32aa3c[_0x5468('0x1b')][_0x5468('0x60')]()][_0x5468('0x13')]('\x20')});})[_0x5468('0x1f')](function(_0x1564a8){_0x4087a5(_0x15809a[_0x5468('0xf')](0x1f5,[_0x8eba43[_0x5468('0x5b')],_0x1564a8[_0x5468('0x1b')][_0x5468('0x60')]()][_0x5468('0x13')]('\x20')));});}else{return _0x4087a5(_0x15809a[_0x5468('0xf')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x29c078){var _0x5ef25d=this;return new Promise(function(_0x51c536,_0x5c1f76){if(ami[_0x5468('0xe')]()==![]){return _0x5c1f76(_0x5ef25d[_0x5468('0xf')](0x1f4,[config['asterisk']['ip'],config[_0x5468('0x10')][_0x5468('0x11')],'ami\x20disconnected'][_0x5468('0x13')]('\x20')));}var _0x2819d5=schema(properties['voicequeuechannelredirect'])[_0x5468('0x1')](_0x29c078);if(_0x2819d5['length']>0x0){return _0x5c1f76(_0x5ef25d[_0x5468('0xf')](0x1f4,_[_0x5468('0x6a')](_0x2819d5,'message')[_0x5468('0x13')](',\x20')));}var _0x4b898f=_[_0x5468('0x5a')](_0x2eccc2['queueChannels'],{'uniqueid':_0x29c078[_0x5468('0x5b')]});if(_0x4b898f&&_0x4b898f[_0x5468('0x5e')]){return ami[_0x5468('0x19')]({'action':_0x5468('0x74'),'channel':_0x4b898f[_0x5468('0x5e')],'exten':_0x29c078[_0x5468('0x75')],'context':_0x29c078[_0x5468('0x76')]||_0x4b898f[_0x5468('0x76')],'priority':0x1})['then'](function(_0x17b80b){_0x51c536({'code':0xc8,'message':[_0x29c078[_0x5468('0x5b')],_0x17b80b['message']['toLowerCase']()][_0x5468('0x13')]('\x20')});})['catch'](function(_0xed9b68){_0x5c1f76(_0x5ef25d['error'](0x1f5,[_0x29c078['uniqueid'],_0xed9b68[_0x5468('0x1b')]['toLowerCase']()]['join']('\x20')));});}else{return _0x5c1f76(_0x5ef25d[_0x5468('0xf')](0x1f5,_0x5468('0x69')));}});},'Agents':function(_0x350b4e){return new Promise(function(_0x185005,_0x105663){var _0x238666=_[_0x5468('0x77')](_0x2eccc2[_0x5468('0x78')]);_0x185005({'count':_0x238666[_0x5468('0x57')],'rows':_0x238666});});},'Telephones':function(_0x4a32e4){return new Promise(function(_0x6e3bfb,_0x1b6f02){var _0x586f9f=_[_0x5468('0x77')](_0x2eccc2[_0x5468('0x79')]);_0x6e3bfb({'count':_0x586f9f['length'],'rows':_0x586f9f});});},'Trunks':function(_0x19d0a4){return new Promise(function(_0x20d895,_0x4325c7){var _0x3a33ec=_['values'](_0x2eccc2['trunks']);_0x20d895({'count':_0x3a33ec['length'],'rows':_0x3a33ec});});},'OutboundChannels':function(_0x4631b3){return new Promise(function(_0x494bb6,_0x249b27){var _0xcc0e0c=_[_0x5468('0x77')](_0x2eccc2[_0x5468('0x7a')]);_0x494bb6({'count':_0xcc0e0c[_0x5468('0x57')],'rows':_0xcc0e0c});});},'Outbound':function(_0x5b779a){return new Promise(function(_0x215c93,_0x22c029){_0x215c93(_0x2eccc2[_0x5468('0x2e')]);});},'Campaigns':function(_0x5c0ecd){return new Promise(function(_0x1252bf,_0x12f154){var _0x34da25=_[_0x5468('0x77')](_0x2eccc2[_0x5468('0x7b')]);_0x1252bf({'count':_0x34da25[_0x5468('0x57')],'rows':_0x34da25});});},'VoiceQueuesPreview':function(_0xa3e734){var _0x915a26=this;return new Promise(function(_0x32624c,_0x69f1e4){_0x1bb445[_0x5468('0x7c')](_0xa3e734['id'])[_0x5468('0x1a')](function(_0x36f25c){_0x32624c({'code':0xc8,'message':_0x36f25c['message']});})['catch'](function(_0x41394b){_0x69f1e4(_0x915a26[_0x5468('0xf')](0x1f4,_0x41394b[_0x5468('0x1b')]));});});},'EventManager':function(_0x4bf389){var _0x23de60=this;return new Promise(function(_0x5f3280,_0x2ee5fd){if(!_0x4bf389[_0x5468('0x7d')]){return _0x2ee5fd(_0x23de60['error'](0x1f4,_0x5468('0x7e')));}ami[_0x5468('0x7f')]('custom:'+_0x4bf389[_0x5468('0x7d')],_0x4bf389['message']);_0x5f3280({'code':0xc8,'message':_0x4bf389});});},'FaxAccounts':function(_0x241df9){return new Promise(function(_0x194dfc,_0x1643ac){var _0x26421d=_[_0x5468('0x77')](_0x2eccc2[_0x5468('0x80')]);_0x194dfc({'count':_0x26421d[_0x5468('0x57')],'rows':_0x26421d});});},'SendFax':function(_0x4dd752){var _0x39221f=this;return new Promise(function(_0x39f09a,_0x2b7144){_0x2528e4[_0x5468('0x81')](_0x4dd752)['then'](function(_0x2d7451){_0x39f09a({'code':0xc8,'message':_0x2d7451[_0x5468('0x1b')]});})['catch'](function(_0x50e352){_0x2b7144(_0x39221f[_0x5468('0xf')](0x1f4,_0x50e352['message']));});});},'CheckAfterSend':function(_0x50cf3d){var _0x56c17b=this;return new Promise(function(_0x142a7e,_0x3ba7c3){_0x2528e4['checkAfterSend'](_0x50cf3d)[_0x5468('0x1a')](function(_0x3df2ec){_0x142a7e({'code':0xc8,'message':_0x3df2ec[_0x5468('0x1b')]});})[_0x5468('0x1f')](function(_0x595dd5){_0x3ba7c3(_0x56c17b[_0x5468('0xf')](0x1f4,_0x595dd5[_0x5468('0x1b')]));});});}};var _0x4c9c5b=jayson[_0x5468('0x82')](_0x39c460)[_0x5468('0x83')]();_0x4c9c5b['on'](_0x5468('0xf'),function(_0x521525){return _0x14bea0(_0x521525);});_0x4c9c5b[_0x5468('0x6')](0x232a,'127.0.0.1',function(){console[_0x5468('0x84')](_0x5468('0x85'),0x232a);return _0xed0bbe(_0x5468('0x86')+0x232a);});});};
\ No newline at end of file
+var _0x23ea=['127.0.0.1','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','validate','../../../config/environment','../ami','listen','format','%s/%s','SIP','name','timers','updateAcw','agents','updateStatusRealtime','QueuePause','asterisk','ami\x20disconnected','join','pick','module','action','Reload','Action','then','catch','isConnected','error','username','command','Command','content','message','voiceQueues','hasOwnProperty','strategy','available','pTalking','sumHoldTime','talking','total','type','unmanaged','abandoned','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','values','channels','find','%s.%s','filename','uniqueid','wav','MixMonitor','channel','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','isNil','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','Channel\x20doesn\x27t\x20exist','voicechannel','map','resolve','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','exten','context','telephones','outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','emit','faxAccounts','send'];(function(_0x376b76,_0x517233){var _0x3d5559=function(_0x52535e){while(--_0x52535e){_0x376b76['push'](_0x376b76['shift']());}};_0x3d5559(++_0x517233);}(_0x23ea,0x8a));var _0xa23e=function(_0x11435c,_0x436ccf){_0x11435c=_0x11435c-0x0;var _0x556167=_0x23ea[_0x11435c];return _0x556167;};'use strict';var _=require(_0xa23e('0x0'));var util=require(_0xa23e('0x1'));var jayson=require('jayson/promise');var schema=require(_0xa23e('0x2'));var BPromise=require('bluebird');var moment=require('moment');var config=require(_0xa23e('0x3'));var properties=require('../properties');var ami=require(_0xa23e('0x4'));exports[_0xa23e('0x5')]=function(_0x3e8ecb,_0x1fb49c,_0x46800e){return new BPromise(function(_0x526a1c,_0x58694c){var _0x57a16f={'QueuePause':function(_0x825db4){return new Promise(function(_0x166ae9,_0x272ab6){var _0x515447=util[_0xa23e('0x6')](_0xa23e('0x7'),_0xa23e('0x8'),_0x825db4[_0xa23e('0x9')]);if(_0x3e8ecb[_0xa23e('0xa')]&&_0x3e8ecb['timers'][_0x515447]&&_0x3e8ecb['timers'][_0x515447]['timer']){_0x3e8ecb[_0xa23e('0xa')][_0x515447][_0xa23e('0xb')]();}if(_0x3e8ecb[_0xa23e('0xc')][_0x515447]){_0x3e8ecb[_0xa23e('0xc')][_0x515447][_0xa23e('0xd')]({'statePause':_0x825db4['pause']?!![]:![]});}_0x166ae9({'code':0xc8,'message':_0xa23e('0xe')});});},'Reload':function(_0x4f9263){var _0x1dba0f=this;return new Promise(function(_0x2a2600,_0x29acd0){if(ami['isConnected']()==![]){return _0x29acd0(_0x1dba0f['error'](0x1f4,[config[_0xa23e('0xf')]['ip'],config[_0xa23e('0xf')]['username'],_0xa23e('0x10')][_0xa23e('0x11')]('\x20')));}_0x4f9263=_[_0xa23e('0x12')](_0x4f9263,_['keys'](properties[_0xa23e('0x13')]));_0x4f9263[_0xa23e('0x14')]=_0xa23e('0x15');return ami[_0xa23e('0x16')](_0x4f9263)[_0xa23e('0x17')](function(_0x3aec03){_0x2a2600({'code':0xc8,'message':_0x3aec03['message']});})[_0xa23e('0x18')](function(_0x4c44fa){_0x29acd0(_0x1dba0f['error'](0x1f5,_0x4c44fa['message']));});});},'Command':function(_0x407a46){var _0x3564f2=this;return new Promise(function(_0x3c328f,_0x184024){if(ami[_0xa23e('0x19')]()==![]){return _0x184024(_0x3564f2[_0xa23e('0x1a')](0x1f4,[config[_0xa23e('0xf')]['ip'],config[_0xa23e('0xf')][_0xa23e('0x1b')],_0xa23e('0x10')]['join']('\x20')));}_0x407a46=_['pick'](_0x407a46,_0xa23e('0x1c'));_0x407a46[_0xa23e('0x14')]=_0xa23e('0x1d');return ami[_0xa23e('0x16')](_0x407a46)[_0xa23e('0x17')](function(_0x206cdc){_0x3c328f({'code':0xc8,'message':_0x206cdc[_0xa23e('0x1e')]});})[_0xa23e('0x18')](function(_0x4a6920){_0x184024(_0x3564f2[_0xa23e('0x1a')](0x1f5,_0x4a6920[_0xa23e('0x1f')]));});});},'VoiceQueues':function(_0x215f4c){return new Promise(function(_0xe4bd82,_0x1e4bfd){var _0x477745=[];for(var _0x5d1d92 in _0x3e8ecb[_0xa23e('0x20')]){if(_0x3e8ecb[_0xa23e('0x20')][_0xa23e('0x21')](_0x5d1d92)){var _0x40f330=_0x3e8ecb[_0xa23e('0x20')][_0x5d1d92];var _0xefd69={'id':_0x40f330['id'],'name':_0x40f330[_0xa23e('0x9')],'strategy':_0x40f330[_0xa23e('0x22')],'answered':_0x40f330['answered'],'available':_0x40f330[_0xa23e('0x23')],'loggedIn':_0x40f330['loggedIn'],'pTalking':_0x40f330[_0xa23e('0x24')],'sumBillable':_0x40f330['sumBillable'],'sumDuration':_0x40f330['sumDuration'],'sumHoldTime':_0x40f330[_0xa23e('0x25')]||0x0,'talking':_0x40f330[_0xa23e('0x26')],'total':_0x40f330[_0xa23e('0x27')],'type':_0x40f330[_0xa23e('0x28')],'unmanaged':_0x40f330[_0xa23e('0x29')],'abandoned':_0x40f330[_0xa23e('0x2a')],'waiting':_0x40f330['waiting'],'loggedInDb':_0x40f330[_0xa23e('0x2b')]};if(_0x40f330['type']===_0xa23e('0x2c')){_0xefd69[_0xa23e('0x2d')]=_0x40f330[_0xa23e('0x2d')];_0xefd69[_0xa23e('0x2e')]=_0x40f330[_0xa23e('0x2e')];_0xefd69[_0xa23e('0x2f')]=_0x40f330['dialOriginateCallerIdName'];_0xefd69['dialOriginateCallerIdNumber']=_0x40f330[_0xa23e('0x30')];_0xefd69[_0xa23e('0x31')]=_0x40f330['dialOriginateTimeout'];_0xefd69[_0xa23e('0x32')]=_0x40f330[_0xa23e('0x32')];_0xefd69[_0xa23e('0x33')]=_0x40f330['outboundAnswerAgiCallsDay'];_0xefd69[_0xa23e('0x34')]=_0x40f330[_0xa23e('0x34')];_0xefd69['outboundBlacklistCallsDay']=_0x40f330[_0xa23e('0x35')];_0xefd69[_0xa23e('0x36')]=_0x40f330[_0xa23e('0x36')];_0xefd69[_0xa23e('0x37')]=_0x40f330[_0xa23e('0x37')];_0xefd69[_0xa23e('0x38')]=_0x40f330[_0xa23e('0x38')];_0xefd69[_0xa23e('0x39')]=_0x40f330[_0xa23e('0x39')];_0xefd69[_0xa23e('0x3a')]=_0x40f330[_0xa23e('0x3a')];_0xefd69[_0xa23e('0x3b')]=_0x40f330[_0xa23e('0x3b')];_0xefd69[_0xa23e('0x3c')]=_0x40f330[_0xa23e('0x3c')];_0xefd69[_0xa23e('0x3d')]=_0x40f330[_0xa23e('0x3d')];_0xefd69[_0xa23e('0x3e')]=_0x40f330[_0xa23e('0x3e')];_0xefd69[_0xa23e('0x3f')]=_0x40f330['outboundRejectCallsDay'];_0xefd69[_0xa23e('0x40')]=_0x40f330[_0xa23e('0x40')];_0xefd69['predictiveIntervalAnsweredCalls']=_0x40f330[_0xa23e('0x41')];_0xefd69['predictiveIntervalAvgHoldtime']=_0x40f330[_0xa23e('0x42')];_0xefd69[_0xa23e('0x43')]=_0x40f330[_0xa23e('0x43')];_0xefd69[_0xa23e('0x44')]=_0x40f330['predictiveIntervalDroppedCallsCallersExit'];_0xefd69['predictiveIntervalDroppedCallsTimeout']=_0x40f330[_0xa23e('0x45')];_0xefd69[_0xa23e('0x46')]=_0x40f330['predictiveIntervalErlangCalls'];_0xefd69[_0xa23e('0x47')]=_0x40f330[_0xa23e('0x47')];_0xefd69[_0xa23e('0x48')]=_0x40f330[_0xa23e('0x48')];_0xefd69[_0xa23e('0x49')]=_0x40f330['predictiveIntervalMultiplicativeFactor'];_0xefd69[_0xa23e('0x4a')]=_0x40f330['predictiveIntervalPauses'];_0xefd69[_0xa23e('0x4b')]=_0x40f330[_0xa23e('0x4b')];_0xefd69[_0xa23e('0x4c')]=_0x40f330['predictiveIntervalTotalCalls'];_0xefd69['message']=_0x40f330['message'];_0xefd69['originated']=_0x40f330[_0xa23e('0x4d')];_0xefd69['erlangCalls']=_0x40f330[_0xa23e('0x4e')];_0xefd69[_0xa23e('0x4f')]=_0x40f330[_0xa23e('0x4f')];_0xefd69[_0xa23e('0x50')]=_0x40f330[_0xa23e('0x50')];_0xefd69[_0xa23e('0x51')]=_0x40f330[_0xa23e('0x51')];_0xefd69[_0xa23e('0x52')]=_0x40f330[_0xa23e('0x52')];_0xefd69[_0xa23e('0x53')]=_0x40f330[_0xa23e('0x53')];}if(_0x40f330[_0xa23e('0x54')]){_0xefd69['Trunk']={'id':_0x40f330[_0xa23e('0x54')]['id'],'name':_0x40f330[_0xa23e('0x54')][_0xa23e('0x9')],'active':_0x40f330['Trunk'][_0xa23e('0x55')],'callerid':_0x40f330[_0xa23e('0x54')][_0xa23e('0x56')]};}if(_0x40f330[_0xa23e('0x57')]){_0xefd69['Interval']={'id':_0x40f330[_0xa23e('0x57')]['id'],'name':_0x40f330[_0xa23e('0x57')]['name']};}_0x477745[_0xa23e('0x58')](_0xefd69);}}_0xe4bd82({'count':_0x477745[_0xa23e('0x59')],'rows':_0x477745});});},'VoiceChannels':function(_0x475da9){return new Promise(function(_0x22a146,_0x588cde){var _0x32f034=_[_0xa23e('0x5a')](_0x3e8ecb[_0xa23e('0x5b')]);_0x22a146({'count':_0x32f034[_0xa23e('0x59')],'rows':_0x32f034});});},'VoiceChannelMixMonitor':function(_0x523127){var _0x5c31a8=this;return new Promise(function(_0x37d7b7,_0x3f909f){if(ami[_0xa23e('0x19')]()==![]){return _0x3f909f(_0x5c31a8[_0xa23e('0x1a')](0x1f4,[config[_0xa23e('0xf')]['ip'],config['asterisk'][_0xa23e('0x1b')],'ami\x20disconnected']['join']('\x20')));}var _0x2bc6f6=schema(properties['voicechannel'])[_0xa23e('0x2')](_0x523127);if(_0x2bc6f6[_0xa23e('0x59')]>0x0){return _0x3f909f(_0x5c31a8[_0xa23e('0x1a')](0x1f4,_['map'](_0x2bc6f6,_0xa23e('0x1f'))[_0xa23e('0x11')](',\x20')));}var _0x4b7b52=_[_0xa23e('0x5c')](_0x3e8ecb[_0xa23e('0x5b')],{'uniqueid':_0x523127['uniqueid']});if(_0x4b7b52&&_0x4b7b52['channel']){var _0x4f45ed=util[_0xa23e('0x6')](_0xa23e('0x5d'),_0x523127[_0xa23e('0x5e')]||_0x523127[_0xa23e('0x5f')],_0x523127[_0xa23e('0x6')]||_0xa23e('0x60'));return ami['Action']({'action':_0xa23e('0x61'),'channel':_0x4b7b52[_0xa23e('0x62')],'file':_0x4f45ed,'options':_0xa23e('0x63')})[_0xa23e('0x17')](function(_0x31c0cc){var _0x44cdf8=_[_0xa23e('0x5c')](_0x4b7b52[_0xa23e('0x64')],{'filename':_0xa23e('0x65')+_0x4f45ed['toLowerCase']()});if(_[_0xa23e('0x66')](_0x44cdf8)){_0x4b7b52['monitors'][_0xa23e('0x58')]({'filename':_0xa23e('0x65')+_0x4f45ed[_0xa23e('0x67')](),'createdAt':moment()[_0xa23e('0x6')](_0xa23e('0x68')),'mixmonitorid':_0x31c0cc[_0xa23e('0x69')],'status':_0xa23e('0x6a')});}else{_0x44cdf8[_0xa23e('0x69')]=_0x31c0cc[_0xa23e('0x69')];_0x44cdf8[_0xa23e('0x6b')]=_0xa23e('0x6a');}_0x37d7b7({'code':0xc8,'message':[_0x523127[_0xa23e('0x5f')],'MixMonitor\x20Success',_0x31c0cc['mixmonitorid']][_0xa23e('0x11')]('\x20'),'mixmonitorid':_0x31c0cc[_0xa23e('0x69')]});})[_0xa23e('0x18')](function(_0x159ed2){_0x3f909f(_0x5c31a8[_0xa23e('0x1a')](0x1f5,[_0x523127[_0xa23e('0x5f')],_0x159ed2[_0xa23e('0x1f')][_0xa23e('0x67')]()][_0xa23e('0x11')]('\x20')));});}else{return _0x3f909f(_0x5c31a8[_0xa23e('0x1a')](0x1f5,_0xa23e('0x6c')));}});},'VoiceChannelStopMixMonitor':function(_0xa7a21f){var _0x43eae1=this;return new Promise(function(_0x691318,_0x2c3cf1){if(ami[_0xa23e('0x19')]()==![]){return _0x2c3cf1(_0x43eae1['error'](0x1f4,[config[_0xa23e('0xf')]['ip'],config[_0xa23e('0xf')][_0xa23e('0x1b')],_0xa23e('0x10')][_0xa23e('0x11')]('\x20')));}var _0x374dd3=schema(properties[_0xa23e('0x6d')])['validate'](_0xa7a21f);if(_0x374dd3[_0xa23e('0x59')]>0x0){return _0x2c3cf1(_0x43eae1[_0xa23e('0x1a')](0x1f4,_[_0xa23e('0x6e')](_0x374dd3,'message')[_0xa23e('0x11')](',\x20')));}var _0x38e542=_['find'](_0x3e8ecb['channels'],{'uniqueid':_0xa7a21f[_0xa23e('0x5f')]});if(_0x38e542){return BPromise[_0xa23e('0x6f')]()[_0xa23e('0x17')](function(){if(_0x38e542['channel']){return ami[_0xa23e('0x16')]({'action':_0xa23e('0x70'),'channel':_0x38e542[_0xa23e('0x62')],'mixmonitorid':_0xa7a21f[_0xa23e('0x69')]})[_0xa23e('0x18')](function(_0x416d96){});}})[_0xa23e('0x17')](function(){if(_0x38e542[_0xa23e('0x71')]){return ami[_0xa23e('0x16')]({'action':_0xa23e('0x70'),'channel':_0x38e542[_0xa23e('0x71')],'mixmonitorid':_0xa7a21f[_0xa23e('0x69')]})[_0xa23e('0x18')](function(_0xc0ebf7){});}})[_0xa23e('0x17')](function(_0x3c15a4){var _0x38e6e4=_[_0xa23e('0x5c')](_0x38e542[_0xa23e('0x64')],{'mixmonitorid':_0xa7a21f[_0xa23e('0x69')]});if(_0x38e6e4){_0x38e6e4['status']='stop';}})[_0xa23e('0x17')](function(){var _0x3d073c=util[_0xa23e('0x6')](_0xa23e('0x5d'),_0xa7a21f[_0xa23e('0x5e')]||_0xa7a21f[_0xa23e('0x5f')],_0xa7a21f[_0xa23e('0x6')]||_0xa23e('0x60'));var _0x236de1=_[_0xa23e('0x5c')](_0x38e542[_0xa23e('0x64')],{'filename':'/var/spool/asterisk/monitor/'+_0x3d073c[_0xa23e('0x67')]()});if(_0x236de1){_0x236de1[_0xa23e('0x6b')]=_0xa23e('0x72');}})[_0xa23e('0x17')](function(){_0x691318({'code':0xc8,'message':[_0xa7a21f[_0xa23e('0x5f')],_0xa23e('0x73')][_0xa23e('0x11')]('\x20')});})['catch'](function(_0x57b144){_0x2c3cf1(_0x43eae1[_0xa23e('0x1a')](0x1f5,[_0xa7a21f[_0xa23e('0x5f')],_0x57b144[_0xa23e('0x1f')]['toLowerCase']()][_0xa23e('0x11')]('\x20')));});}else{return _0x2c3cf1(_0x43eae1['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x309f1e){return new Promise(function(_0x46fbc3,_0x3f97e6){var _0x5a0c4b=_[_0xa23e('0x5a')](_0x3e8ecb[_0xa23e('0x74')]);_0x46fbc3({'count':_0x5a0c4b[_0xa23e('0x59')],'rows':_0x5a0c4b});});},'VoiceQueuesChannel':function(_0xe3ca5f){var _0x53d2b5=this;return new Promise(function(_0x1b9349,_0x136131){var _0x471199=schema(properties[_0xa23e('0x75')])[_0xa23e('0x2')](_0xe3ca5f);if(_0x471199[_0xa23e('0x59')]>0x0){return _0x136131(_0x53d2b5[_0xa23e('0x1a')](0x1f4,_[_0xa23e('0x6e')](_0x471199,_0xa23e('0x1f'))[_0xa23e('0x11')](',\x20')));}var _0x545d5a=_[_0xa23e('0x5c')](_0x3e8ecb['queueChannels'],{'uniqueid':_0xe3ca5f[_0xa23e('0x5f')]});if(_0x545d5a){_0x1b9349(_0x545d5a);}else{return _0x136131(_0x53d2b5[_0xa23e('0x1a')](0x1f5,_0xa23e('0x6c')));}});},'VoiceQueuesChannelHangup':function(_0x1f832a){var _0x5bf8c9=this;return new Promise(function(_0x468cf7,_0x322727){if(ami['isConnected']()==![]){return _0x322727(_0x5bf8c9['error'](0x1f4,[config[_0xa23e('0xf')]['ip'],config['asterisk'][_0xa23e('0x1b')],'ami\x20disconnected']['join']('\x20')));}var _0xb21a66=schema(properties[_0xa23e('0x76')])['validate'](_0x1f832a);if(_0xb21a66[_0xa23e('0x59')]>0x0){return _0x322727(_0x5bf8c9[_0xa23e('0x1a')](0x1f4,_[_0xa23e('0x6e')](_0xb21a66,_0xa23e('0x1f'))['join'](',\x20')));}var _0x43c8c1=_[_0xa23e('0x5c')](_0x3e8ecb[_0xa23e('0x74')],{'uniqueid':_0x1f832a[_0xa23e('0x5f')]});if(_0x43c8c1&&_0x43c8c1[_0xa23e('0x62')]){return ami[_0xa23e('0x16')]({'action':'Hangup','channel':_0x43c8c1[_0xa23e('0x62')]})[_0xa23e('0x17')](function(_0x3c06c){_0x468cf7({'code':0xc8,'message':[_0x1f832a[_0xa23e('0x5f')],_0x3c06c[_0xa23e('0x1f')][_0xa23e('0x67')]()][_0xa23e('0x11')]('\x20')});})[_0xa23e('0x18')](function(_0x384cb8){_0x322727(_0x5bf8c9[_0xa23e('0x1a')](0x1f5,[_0x1f832a[_0xa23e('0x5f')],_0x384cb8[_0xa23e('0x1f')]['toLowerCase']()][_0xa23e('0x11')]('\x20')));});}else{return _0x322727(_0x5bf8c9['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x144306){var _0x284122=this;return new Promise(function(_0x502855,_0x246239){if(ami[_0xa23e('0x19')]()==![]){return _0x246239(_0x284122[_0xa23e('0x1a')](0x1f4,[config['asterisk']['ip'],config[_0xa23e('0xf')][_0xa23e('0x1b')],'ami\x20disconnected']['join']('\x20')));}var _0x18c61f=schema(properties[_0xa23e('0x77')])['validate'](_0x144306);if(_0x18c61f[_0xa23e('0x59')]>0x0){return _0x246239(_0x284122[_0xa23e('0x1a')](0x1f4,_['map'](_0x18c61f,'message')[_0xa23e('0x11')](',\x20')));}var _0x444575=_[_0xa23e('0x5c')](_0x3e8ecb[_0xa23e('0x74')],{'uniqueid':_0x144306[_0xa23e('0x5f')]});if(_0x444575&&_0x444575[_0xa23e('0x62')]){return ami[_0xa23e('0x16')]({'action':_0xa23e('0x78'),'channel':_0x444575['channel'],'exten':_0x144306[_0xa23e('0x79')],'context':_0x144306[_0xa23e('0x7a')]||_0x444575[_0xa23e('0x7a')],'priority':0x1})[_0xa23e('0x17')](function(_0x5bd481){_0x502855({'code':0xc8,'message':[_0x144306['uniqueid'],_0x5bd481['message']['toLowerCase']()][_0xa23e('0x11')]('\x20')});})[_0xa23e('0x18')](function(_0x12f11a){_0x246239(_0x284122['error'](0x1f5,[_0x144306['uniqueid'],_0x12f11a[_0xa23e('0x1f')][_0xa23e('0x67')]()][_0xa23e('0x11')]('\x20')));});}else{return _0x246239(_0x284122['error'](0x1f5,_0xa23e('0x6c')));}});},'Agents':function(_0x151ed4){return new Promise(function(_0xaf4c1,_0x1a4fe2){var _0x5da785=_[_0xa23e('0x5a')](_0x3e8ecb[_0xa23e('0xc')]);_0xaf4c1({'count':_0x5da785[_0xa23e('0x59')],'rows':_0x5da785});});},'Telephones':function(_0x44d8a6){return new Promise(function(_0x2adb23,_0x11bebb){var _0x5903a6=_[_0xa23e('0x5a')](_0x3e8ecb[_0xa23e('0x7b')]);_0x2adb23({'count':_0x5903a6[_0xa23e('0x59')],'rows':_0x5903a6});});},'Trunks':function(_0x48a53f){return new Promise(function(_0x56bdf5,_0x1e07b1){var _0x4c01fb=_[_0xa23e('0x5a')](_0x3e8ecb['trunks']);_0x56bdf5({'count':_0x4c01fb['length'],'rows':_0x4c01fb});});},'OutboundChannels':function(_0x2dde4e){return new Promise(function(_0x3d1881,_0x188b77){var _0x4f3895=_[_0xa23e('0x5a')](_0x3e8ecb[_0xa23e('0x7c')]);_0x3d1881({'count':_0x4f3895[_0xa23e('0x59')],'rows':_0x4f3895});});},'Outbound':function(_0x3266a8){return new Promise(function(_0x2c6f19,_0x5cbde9){_0x2c6f19(_0x3e8ecb[_0xa23e('0x2c')]);});},'Campaigns':function(_0x13c1bc){return new Promise(function(_0x3a85fc,_0x1718a9){var _0x364ccb=_[_0xa23e('0x5a')](_0x3e8ecb[_0xa23e('0x7d')]);_0x3a85fc({'count':_0x364ccb['length'],'rows':_0x364ccb});});},'VoiceQueuesPreview':function(_0x808723){var _0x474d37=this;return new Promise(function(_0x58cbe6,_0x52f38f){_0x1fb49c[_0xa23e('0x7e')](_0x808723['id'])['then'](function(_0x1c8046){_0x58cbe6({'code':0xc8,'message':_0x1c8046[_0xa23e('0x1f')]});})[_0xa23e('0x18')](function(_0x42db1b){_0x52f38f(_0x474d37[_0xa23e('0x1a')](0x1f4,_0x42db1b['message']));});});},'EventManager':function(_0x24ced5){var _0x2f1bb1=this;return new Promise(function(_0x2ad66b,_0x23ec92){if(!_0x24ced5[_0xa23e('0x7f')]){return _0x23ec92(_0x2f1bb1['error'](0x1f4,_0xa23e('0x80')));}ami[_0xa23e('0x81')]('custom:'+_0x24ced5[_0xa23e('0x7f')],_0x24ced5[_0xa23e('0x1f')]);_0x2ad66b({'code':0xc8,'message':_0x24ced5});});},'FaxAccounts':function(_0x52ea74){return new Promise(function(_0x3786c6,_0x5e2301){var _0x375530=_[_0xa23e('0x5a')](_0x3e8ecb[_0xa23e('0x82')]);_0x3786c6({'count':_0x375530[_0xa23e('0x59')],'rows':_0x375530});});},'SendFax':function(_0x2f8b7c){var _0x42355c=this;return new Promise(function(_0xc011e3,_0x2d1907){_0x46800e[_0xa23e('0x83')](_0x2f8b7c)[_0xa23e('0x17')](function(_0x234f65){_0xc011e3({'code':0xc8,'message':_0x234f65[_0xa23e('0x1f')]});})[_0xa23e('0x18')](function(_0x39caaf){_0x2d1907(_0x42355c[_0xa23e('0x1a')](0x1f4,_0x39caaf['message']));});});},'CheckAfterSend':function(_0x3b6cc6){var _0x1af214=this;return new Promise(function(_0x29aeeb,_0x96f4b0){_0x46800e['checkAfterSend'](_0x3b6cc6)['then'](function(_0x444103){_0x29aeeb({'code':0xc8,'message':_0x444103[_0xa23e('0x1f')]});})[_0xa23e('0x18')](function(_0x5f2b6e){_0x96f4b0(_0x1af214['error'](0x1f4,_0x5f2b6e['message']));});});}};var _0xcb6998=jayson['server'](_0x57a16f)['http']();_0xcb6998['on']('error',function(_0x57ef75){return _0x58694c(_0x57ef75);});_0xcb6998[_0xa23e('0x5')](0x232a,_0xa23e('0x84'),function(){console['log'](_0xa23e('0x85'),0x232a);return _0x526a1c(_0xa23e('0x86')+0x232a);});});};
\ No newline at end of file