Built motion from commit (unavailable).|2.5.14
[motion2.git] / server / services / ami / server / index.js
index b437372..a24790d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3384=['../ami','listen','format','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','module','action','Reload','Action','then','message','command','Command','content','catch','hasOwnProperty','voiceQueues','strategy','answered','available','loggedIn','pTalking','sumDuration','sumHoldTime','talking','total','type','unmanaged','waiting','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','callerid','Interval','push','length','values','channels','voicechannel','find','uniqueid','channel','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','status','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','map','resolve','StopMixMonitor','destinationchannel','stop','%s.%s','filename','StopMixMonitor\x20Success','queueChannels','Hangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','campaigns','event','Event\x20name\x20mandatory','custom:','checkAfterSend','server','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate'];(function(_0x501a04,_0xacaf19){var _0x69bf75=function(_0x11f5df){while(--_0x11f5df){_0x501a04['push'](_0x501a04['shift']());}};_0x69bf75(++_0xacaf19);}(_0x3384,0x10c));var _0x4338=function(_0x10cd68,_0x5e7125){_0x10cd68=_0x10cd68-0x0;var _0x5894e9=_0x3384[_0x10cd68];return _0x5894e9;};'use strict';var _=require(_0x4338('0x0'));var util=require(_0x4338('0x1'));var jayson=require(_0x4338('0x2'));var schema=require(_0x4338('0x3'));var BPromise=require('bluebird');var moment=require('moment');var config=require('../../../config/environment');var properties=require('../properties');var ami=require(_0x4338('0x4'));exports[_0x4338('0x5')]=function(_0x780825,_0x17774f,_0x78533c){return new BPromise(function(_0x1c41cd,_0x55d571){var _0x238484={'QueuePause':function(_0x38f38a){return new Promise(function(_0x33ecd3,_0x58986c){var _0xc566cc=util[_0x4338('0x6')]('%s/%s',_0x4338('0x7'),_0x38f38a[_0x4338('0x8')]);if(_0x780825['timers']&&_0x780825[_0x4338('0x9')][_0xc566cc]&&_0x780825['timers'][_0xc566cc][_0x4338('0xa')]){_0x780825[_0x4338('0x9')][_0xc566cc][_0x4338('0xb')]();}if(_0x780825['agents'][_0xc566cc]){_0x780825[_0x4338('0xc')][_0xc566cc][_0x4338('0xd')]({'statePause':_0x38f38a[_0x4338('0xe')]?!![]:![]});}_0x33ecd3({'code':0xc8,'message':_0x4338('0xf')});});},'Reload':function(_0x402f01){var _0x2ba177=this;return new Promise(function(_0x239475,_0x4d83b7){if(ami[_0x4338('0x10')]()==![]){return _0x4d83b7(_0x2ba177[_0x4338('0x11')](0x1f4,[config[_0x4338('0x12')]['ip'],config[_0x4338('0x12')][_0x4338('0x13')],_0x4338('0x14')][_0x4338('0x15')]('\x20')));}_0x402f01=_[_0x4338('0x16')](_0x402f01,_['keys'](properties[_0x4338('0x17')]));_0x402f01[_0x4338('0x18')]=_0x4338('0x19');return ami[_0x4338('0x1a')](_0x402f01)[_0x4338('0x1b')](function(_0x50894b){_0x239475({'code':0xc8,'message':_0x50894b['message']});})['catch'](function(_0x3f57f9){_0x4d83b7(_0x2ba177[_0x4338('0x11')](0x1f5,_0x3f57f9[_0x4338('0x1c')]));});});},'Command':function(_0x598c18){var _0x468d39=this;return new Promise(function(_0x3b3b28,_0x404826){if(ami[_0x4338('0x10')]()==![]){return _0x404826(_0x468d39['error'](0x1f4,[config[_0x4338('0x12')]['ip'],config[_0x4338('0x12')][_0x4338('0x13')],_0x4338('0x14')][_0x4338('0x15')]('\x20')));}_0x598c18=_[_0x4338('0x16')](_0x598c18,_0x4338('0x1d'));_0x598c18[_0x4338('0x18')]=_0x4338('0x1e');return ami[_0x4338('0x1a')](_0x598c18)['then'](function(_0x3c0bc6){_0x3b3b28({'code':0xc8,'message':_0x3c0bc6[_0x4338('0x1f')]});})[_0x4338('0x20')](function(_0xf7b008){_0x404826(_0x468d39['error'](0x1f5,_0xf7b008[_0x4338('0x1c')]));});});},'VoiceQueues':function(_0x1ace9c){return new Promise(function(_0x51f36e,_0x2dfe1c){var _0x2b57c4=[];for(var _0x327349 in _0x780825['voiceQueues']){if(_0x780825['voiceQueues'][_0x4338('0x21')](_0x327349)){var _0x4a77b2=_0x780825[_0x4338('0x22')][_0x327349];var _0x2f131f={'id':_0x4a77b2['id'],'name':_0x4a77b2[_0x4338('0x8')],'strategy':_0x4a77b2[_0x4338('0x23')],'answered':_0x4a77b2[_0x4338('0x24')],'available':_0x4a77b2[_0x4338('0x25')],'loggedIn':_0x4a77b2[_0x4338('0x26')],'pTalking':_0x4a77b2[_0x4338('0x27')],'sumBillable':_0x4a77b2['sumBillable'],'sumDuration':_0x4a77b2[_0x4338('0x28')],'sumHoldTime':_0x4a77b2[_0x4338('0x29')]||0x0,'talking':_0x4a77b2[_0x4338('0x2a')],'total':_0x4a77b2[_0x4338('0x2b')],'type':_0x4a77b2[_0x4338('0x2c')],'unmanaged':_0x4a77b2[_0x4338('0x2d')],'abandoned':_0x4a77b2['abandoned'],'waiting':_0x4a77b2[_0x4338('0x2e')],'loggedInDb':_0x4a77b2['loggedInDb']};if(_0x4a77b2[_0x4338('0x2c')]===_0x4338('0x2f')){_0x2f131f[_0x4338('0x30')]=_0x4a77b2[_0x4338('0x30')];_0x2f131f[_0x4338('0x31')]=_0x4a77b2[_0x4338('0x31')];_0x2f131f[_0x4338('0x32')]=_0x4a77b2[_0x4338('0x32')];_0x2f131f[_0x4338('0x33')]=_0x4a77b2[_0x4338('0x33')];_0x2f131f[_0x4338('0x34')]=_0x4a77b2['dialOriginateTimeout'];_0x2f131f[_0x4338('0x35')]=_0x4a77b2[_0x4338('0x35')];_0x2f131f['outboundAnswerAgiCallsDay']=_0x4a77b2[_0x4338('0x36')];_0x2f131f[_0x4338('0x37')]=_0x4a77b2['outboundAnswerCallsDay'];_0x2f131f['outboundBlacklistCallsDay']=_0x4a77b2['outboundBlacklistCallsDay'];_0x2f131f[_0x4338('0x38')]=_0x4a77b2[_0x4338('0x38')];_0x2f131f[_0x4338('0x39')]=_0x4a77b2[_0x4338('0x39')];_0x2f131f[_0x4338('0x3a')]=_0x4a77b2['outboundDropCallsDayACS'];_0x2f131f[_0x4338('0x3b')]=_0x4a77b2[_0x4338('0x3b')];_0x2f131f[_0x4338('0x3c')]=_0x4a77b2[_0x4338('0x3c')];_0x2f131f[_0x4338('0x3d')]=_0x4a77b2[_0x4338('0x3d')];_0x2f131f[_0x4338('0x3e')]=_0x4a77b2[_0x4338('0x3e')];_0x2f131f[_0x4338('0x3f')]=_0x4a77b2[_0x4338('0x3f')];_0x2f131f[_0x4338('0x40')]=_0x4a77b2[_0x4338('0x40')];_0x2f131f[_0x4338('0x41')]=_0x4a77b2[_0x4338('0x41')];_0x2f131f[_0x4338('0x42')]=_0x4a77b2[_0x4338('0x42')];_0x2f131f['predictiveIntervalAnsweredCalls']=_0x4a77b2[_0x4338('0x43')];_0x2f131f['predictiveIntervalAvgHoldtime']=_0x4a77b2[_0x4338('0x44')];_0x2f131f[_0x4338('0x45')]=_0x4a77b2[_0x4338('0x45')];_0x2f131f[_0x4338('0x46')]=_0x4a77b2[_0x4338('0x46')];_0x2f131f['predictiveIntervalDroppedCallsTimeout']=_0x4a77b2['predictiveIntervalDroppedCallsTimeout'];_0x2f131f[_0x4338('0x47')]=_0x4a77b2[_0x4338('0x47')];_0x2f131f[_0x4338('0x48')]=_0x4a77b2[_0x4338('0x48')];_0x2f131f[_0x4338('0x49')]=_0x4a77b2[_0x4338('0x49')];_0x2f131f[_0x4338('0x4a')]=_0x4a77b2[_0x4338('0x4a')];_0x2f131f[_0x4338('0x4b')]=_0x4a77b2[_0x4338('0x4b')];_0x2f131f[_0x4338('0x4c')]=_0x4a77b2[_0x4338('0x4c')];_0x2f131f['predictiveIntervalTotalCalls']=_0x4a77b2['predictiveIntervalTotalCalls'];_0x2f131f['message']=_0x4a77b2[_0x4338('0x1c')];_0x2f131f['originated']=_0x4a77b2[_0x4338('0x4d')];_0x2f131f[_0x4338('0x4e')]=_0x4a77b2[_0x4338('0x4e')];_0x2f131f[_0x4338('0x4f')]=_0x4a77b2[_0x4338('0x4f')];_0x2f131f[_0x4338('0x50')]=_0x4a77b2[_0x4338('0x50')];_0x2f131f['erlangBusyFactor']=_0x4a77b2[_0x4338('0x51')];_0x2f131f[_0x4338('0x52')]=_0x4a77b2['startPredictive'];_0x2f131f[_0x4338('0x53')]=_0x4a77b2['startProgressive'];}if(_0x4a77b2['Trunk']){_0x2f131f[_0x4338('0x54')]={'id':_0x4a77b2[_0x4338('0x54')]['id'],'name':_0x4a77b2[_0x4338('0x54')][_0x4338('0x8')],'active':_0x4a77b2[_0x4338('0x54')]['active'],'callerid':_0x4a77b2['Trunk'][_0x4338('0x55')]};}if(_0x4a77b2[_0x4338('0x56')]){_0x2f131f[_0x4338('0x56')]={'id':_0x4a77b2[_0x4338('0x56')]['id'],'name':_0x4a77b2[_0x4338('0x56')]['name']};}_0x2b57c4[_0x4338('0x57')](_0x2f131f);}}_0x51f36e({'count':_0x2b57c4[_0x4338('0x58')],'rows':_0x2b57c4});});},'VoiceChannels':function(_0x135fd9){return new Promise(function(_0x8d31f1,_0x292ba3){var _0x42bbc1=_[_0x4338('0x59')](_0x780825[_0x4338('0x5a')]);_0x8d31f1({'count':_0x42bbc1['length'],'rows':_0x42bbc1});});},'VoiceChannelMixMonitor':function(_0x375fac){var _0xdb8296=this;return new Promise(function(_0x54fd35,_0x1ce63e){if(ami[_0x4338('0x10')]()==![]){return _0x1ce63e(_0xdb8296[_0x4338('0x11')](0x1f4,[config[_0x4338('0x12')]['ip'],config['asterisk'][_0x4338('0x13')],_0x4338('0x14')][_0x4338('0x15')]('\x20')));}var _0x17fd01=schema(properties[_0x4338('0x5b')])[_0x4338('0x3')](_0x375fac);if(_0x17fd01[_0x4338('0x58')]>0x0){return _0x1ce63e(_0xdb8296[_0x4338('0x11')](0x1f4,_['map'](_0x17fd01,_0x4338('0x1c'))[_0x4338('0x15')](',\x20')));}var _0xf973f0=_[_0x4338('0x5c')](_0x780825[_0x4338('0x5a')],{'uniqueid':_0x375fac[_0x4338('0x5d')]});if(_0xf973f0&&_0xf973f0[_0x4338('0x5e')]){var _0x1fa46a=util[_0x4338('0x6')]('%s.%s',_0x375fac['filename']||_0x375fac['uniqueid'],_0x375fac[_0x4338('0x6')]||_0x4338('0x5f'));return ami[_0x4338('0x1a')]({'action':_0x4338('0x60'),'channel':_0xf973f0[_0x4338('0x5e')],'file':_0x1fa46a,'options':_0x4338('0x61')})[_0x4338('0x1b')](function(_0x3222cc){var _0x38d0ac=_[_0x4338('0x5c')](_0xf973f0[_0x4338('0x62')],{'filename':_0x4338('0x63')+_0x1fa46a[_0x4338('0x64')]()});if(_[_0x4338('0x65')](_0x38d0ac)){_0xf973f0['monitors'][_0x4338('0x57')]({'filename':'/var/spool/asterisk/monitor/'+_0x1fa46a[_0x4338('0x64')](),'createdAt':moment()[_0x4338('0x6')](_0x4338('0x66')),'mixmonitorid':_0x3222cc[_0x4338('0x67')],'status':'rec'});}else{_0x38d0ac[_0x4338('0x67')]=_0x3222cc[_0x4338('0x67')];_0x38d0ac[_0x4338('0x68')]=_0x4338('0x69');}_0x54fd35({'code':0xc8,'message':[_0x375fac['uniqueid'],_0x4338('0x6a'),_0x3222cc[_0x4338('0x67')]][_0x4338('0x15')]('\x20'),'mixmonitorid':_0x3222cc['mixmonitorid']});})[_0x4338('0x20')](function(_0x195ac4){_0x1ce63e(_0xdb8296[_0x4338('0x11')](0x1f5,[_0x375fac[_0x4338('0x5d')],_0x195ac4[_0x4338('0x1c')][_0x4338('0x64')]()][_0x4338('0x15')]('\x20')));});}else{return _0x1ce63e(_0xdb8296['error'](0x1f5,_0x4338('0x6b')));}});},'VoiceChannelStopMixMonitor':function(_0x382d23){var _0x5b406f=this;return new Promise(function(_0x46c18d,_0x56b3a0){if(ami[_0x4338('0x10')]()==![]){return _0x56b3a0(_0x5b406f[_0x4338('0x11')](0x1f4,[config[_0x4338('0x12')]['ip'],config[_0x4338('0x12')][_0x4338('0x13')],_0x4338('0x14')][_0x4338('0x15')]('\x20')));}var _0xc2b8a0=schema(properties['voicechannel'])[_0x4338('0x3')](_0x382d23);if(_0xc2b8a0['length']>0x0){return _0x56b3a0(_0x5b406f[_0x4338('0x11')](0x1f4,_[_0x4338('0x6c')](_0xc2b8a0,_0x4338('0x1c'))['join'](',\x20')));}var _0x24af69=_['find'](_0x780825['channels'],{'uniqueid':_0x382d23[_0x4338('0x5d')]});if(_0x24af69){return BPromise[_0x4338('0x6d')]()[_0x4338('0x1b')](function(){if(_0x24af69[_0x4338('0x5e')]){return ami[_0x4338('0x1a')]({'action':_0x4338('0x6e'),'channel':_0x24af69['channel'],'mixmonitorid':_0x382d23[_0x4338('0x67')]})[_0x4338('0x20')](function(_0x4f610a){});}})[_0x4338('0x1b')](function(){if(_0x24af69[_0x4338('0x6f')]){return ami[_0x4338('0x1a')]({'action':_0x4338('0x6e'),'channel':_0x24af69[_0x4338('0x6f')],'mixmonitorid':_0x382d23[_0x4338('0x67')]})[_0x4338('0x20')](function(_0x543bca){});}})[_0x4338('0x1b')](function(_0x1449ad){var _0x29f081=_[_0x4338('0x5c')](_0x24af69[_0x4338('0x62')],{'mixmonitorid':_0x382d23[_0x4338('0x67')]});if(_0x29f081){_0x29f081[_0x4338('0x68')]=_0x4338('0x70');}})[_0x4338('0x1b')](function(){var _0x279a02=util[_0x4338('0x6')](_0x4338('0x71'),_0x382d23[_0x4338('0x72')]||_0x382d23[_0x4338('0x5d')],_0x382d23[_0x4338('0x6')]||_0x4338('0x5f'));var _0x3d09c4=_[_0x4338('0x5c')](_0x24af69[_0x4338('0x62')],{'filename':_0x4338('0x63')+_0x279a02[_0x4338('0x64')]()});if(_0x3d09c4){_0x3d09c4[_0x4338('0x68')]=_0x4338('0x70');}})['then'](function(){_0x46c18d({'code':0xc8,'message':[_0x382d23[_0x4338('0x5d')],_0x4338('0x73')][_0x4338('0x15')]('\x20')});})[_0x4338('0x20')](function(_0x3a3a88){_0x56b3a0(_0x5b406f['error'](0x1f5,[_0x382d23[_0x4338('0x5d')],_0x3a3a88[_0x4338('0x1c')][_0x4338('0x64')]()]['join']('\x20')));});}else{return _0x56b3a0(_0x5b406f[_0x4338('0x11')](0x1f5,_0x4338('0x6b')));}});},'VoiceQueuesChannels':function(_0x237e8e){return new Promise(function(_0x50c573,_0x295a76){var _0x34bc87=_[_0x4338('0x59')](_0x780825['queueChannels']);_0x50c573({'count':_0x34bc87[_0x4338('0x58')],'rows':_0x34bc87});});},'VoiceQueuesChannel':function(_0x1c0a44){var _0x1214d9=this;return new Promise(function(_0x6ba716,_0x54b95e){var _0x2a144f=schema(properties['voicequeuechannel'])['validate'](_0x1c0a44);if(_0x2a144f[_0x4338('0x58')]>0x0){return _0x54b95e(_0x1214d9[_0x4338('0x11')](0x1f4,_['map'](_0x2a144f,_0x4338('0x1c'))[_0x4338('0x15')](',\x20')));}var _0x56d1d5=_['find'](_0x780825['queueChannels'],{'uniqueid':_0x1c0a44[_0x4338('0x5d')]});if(_0x56d1d5){_0x6ba716(_0x56d1d5);}else{return _0x54b95e(_0x1214d9[_0x4338('0x11')](0x1f5,_0x4338('0x6b')));}});},'VoiceQueuesChannelHangup':function(_0x3458f1){var _0x5eaf1f=this;return new Promise(function(_0x631fc4,_0x3fb37d){if(ami[_0x4338('0x10')]()==![]){return _0x3fb37d(_0x5eaf1f[_0x4338('0x11')](0x1f4,[config['asterisk']['ip'],config[_0x4338('0x12')][_0x4338('0x13')],_0x4338('0x14')][_0x4338('0x15')]('\x20')));}var _0x2d154e=schema(properties['voicequeuechannelhangup'])[_0x4338('0x3')](_0x3458f1);if(_0x2d154e[_0x4338('0x58')]>0x0){return _0x3fb37d(_0x5eaf1f[_0x4338('0x11')](0x1f4,_[_0x4338('0x6c')](_0x2d154e,_0x4338('0x1c'))['join'](',\x20')));}var _0x10512c=_['find'](_0x780825[_0x4338('0x74')],{'uniqueid':_0x3458f1[_0x4338('0x5d')]});if(_0x10512c&&_0x10512c['channel']){return ami[_0x4338('0x1a')]({'action':_0x4338('0x75'),'channel':_0x10512c['channel']})['then'](function(_0x31437a){_0x631fc4({'code':0xc8,'message':[_0x3458f1[_0x4338('0x5d')],_0x31437a['message'][_0x4338('0x64')]()]['join']('\x20')});})[_0x4338('0x20')](function(_0x2c6502){_0x3fb37d(_0x5eaf1f['error'](0x1f5,[_0x3458f1['uniqueid'],_0x2c6502[_0x4338('0x1c')][_0x4338('0x64')]()][_0x4338('0x15')]('\x20')));});}else{return _0x3fb37d(_0x5eaf1f[_0x4338('0x11')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x1dd7cf){var _0x135a03=this;return new Promise(function(_0x4ae1af,_0x3e3fdb){if(ami[_0x4338('0x10')]()==![]){return _0x3e3fdb(_0x135a03[_0x4338('0x11')](0x1f4,[config[_0x4338('0x12')]['ip'],config[_0x4338('0x12')][_0x4338('0x13')],_0x4338('0x14')][_0x4338('0x15')]('\x20')));}var _0x1a81ed=schema(properties[_0x4338('0x76')])[_0x4338('0x3')](_0x1dd7cf);if(_0x1a81ed[_0x4338('0x58')]>0x0){return _0x3e3fdb(_0x135a03[_0x4338('0x11')](0x1f4,_[_0x4338('0x6c')](_0x1a81ed,'message')[_0x4338('0x15')](',\x20')));}var _0x142944=_[_0x4338('0x5c')](_0x780825[_0x4338('0x74')],{'uniqueid':_0x1dd7cf['uniqueid']});if(_0x142944&&_0x142944[_0x4338('0x5e')]){return ami[_0x4338('0x1a')]({'action':_0x4338('0x77'),'channel':_0x142944[_0x4338('0x5e')],'exten':_0x1dd7cf[_0x4338('0x78')],'context':_0x1dd7cf[_0x4338('0x79')]||_0x142944['context'],'priority':0x1})[_0x4338('0x1b')](function(_0x161aef){_0x4ae1af({'code':0xc8,'message':[_0x1dd7cf[_0x4338('0x5d')],_0x161aef[_0x4338('0x1c')][_0x4338('0x64')]()]['join']('\x20')});})[_0x4338('0x20')](function(_0x25040d){_0x3e3fdb(_0x135a03[_0x4338('0x11')](0x1f5,[_0x1dd7cf[_0x4338('0x5d')],_0x25040d[_0x4338('0x1c')][_0x4338('0x64')]()][_0x4338('0x15')]('\x20')));});}else{return _0x3e3fdb(_0x135a03['error'](0x1f5,_0x4338('0x6b')));}});},'Agents':function(_0x5f144d){return new Promise(function(_0x4d1ae2,_0x3b2245){var _0x1cd30e=_[_0x4338('0x59')](_0x780825[_0x4338('0xc')]);_0x4d1ae2({'count':_0x1cd30e[_0x4338('0x58')],'rows':_0x1cd30e});});},'Telephones':function(_0x4666cb){return new Promise(function(_0x416902,_0x29d7b2){var _0x2d3d7e=_[_0x4338('0x59')](_0x780825[_0x4338('0x7a')]);_0x416902({'count':_0x2d3d7e['length'],'rows':_0x2d3d7e});});},'Trunks':function(_0x5f3bc8){return new Promise(function(_0x5a17fb,_0x32c034){var _0x492372=_[_0x4338('0x59')](_0x780825[_0x4338('0x7b')]);_0x5a17fb({'count':_0x492372[_0x4338('0x58')],'rows':_0x492372});});},'OutboundChannels':function(_0x46813c){return new Promise(function(_0x4d6eed,_0x1d93ba){var _0x4973c0=_[_0x4338('0x59')](_0x780825[_0x4338('0x7c')]);_0x4d6eed({'count':_0x4973c0[_0x4338('0x58')],'rows':_0x4973c0});});},'Outbound':function(_0x7b8ec){return new Promise(function(_0x3aae04,_0x3a3bf1){_0x3aae04(_0x780825[_0x4338('0x2f')]);});},'Campaigns':function(_0x3e5209){return new Promise(function(_0x1a3ea6,_0x4f715a){var _0x1fc5c4=_['values'](_0x780825[_0x4338('0x7d')]);_0x1a3ea6({'count':_0x1fc5c4[_0x4338('0x58')],'rows':_0x1fc5c4});});},'VoiceQueuesPreview':function(_0x42f8b8){var _0x5dbe65=this;return new Promise(function(_0x2f72c2,_0x3782bd){_0x17774f['run'](_0x42f8b8['id'])['then'](function(_0x100293){_0x2f72c2({'code':0xc8,'message':_0x100293[_0x4338('0x1c')]});})['catch'](function(_0x3e649e){_0x3782bd(_0x5dbe65[_0x4338('0x11')](0x1f4,_0x3e649e['message']));});});},'EventManager':function(_0xb776f6){var _0x3245c7=this;return new Promise(function(_0x5a77a1,_0x1e719c){if(!_0xb776f6[_0x4338('0x7e')]){return _0x1e719c(_0x3245c7[_0x4338('0x11')](0x1f4,_0x4338('0x7f')));}ami['emit'](_0x4338('0x80')+_0xb776f6[_0x4338('0x7e')],_0xb776f6['message']);_0x5a77a1({'code':0xc8,'message':_0xb776f6});});},'FaxAccounts':function(_0x1bd6a9){return new Promise(function(_0x365bf9,_0x928dd2){var _0x25a7a3=_[_0x4338('0x59')](_0x780825['faxAccounts']);_0x365bf9({'count':_0x25a7a3[_0x4338('0x58')],'rows':_0x25a7a3});});},'SendFax':function(_0x2cdef5){var _0x133024=this;return new Promise(function(_0x335bf6,_0x5bf201){_0x78533c['send'](_0x2cdef5)[_0x4338('0x1b')](function(_0x1928f6){_0x335bf6({'code':0xc8,'message':_0x1928f6['message']});})[_0x4338('0x20')](function(_0x2f228c){_0x5bf201(_0x133024[_0x4338('0x11')](0x1f4,_0x2f228c[_0x4338('0x1c')]));});});},'CheckAfterSend':function(_0x1cb3d9){var _0x42f5f3=this;return new Promise(function(_0x2993b0,_0x16dd8f){_0x78533c[_0x4338('0x81')](_0x1cb3d9)[_0x4338('0x1b')](function(_0x53f696){_0x2993b0({'code':0xc8,'message':_0x53f696[_0x4338('0x1c')]});})[_0x4338('0x20')](function(_0x2f0294){_0x16dd8f(_0x42f5f3[_0x4338('0x11')](0x1f4,_0x2f0294[_0x4338('0x1c')]));});});}};var _0x48b19f=jayson[_0x4338('0x82')](_0x238484)[_0x4338('0x83')]();_0x48b19f['on'](_0x4338('0x11'),function(_0x1345cb){return _0x55d571(_0x1345cb);});_0x48b19f[_0x4338('0x5')](0x232a,_0x4338('0x84'),function(){console[_0x4338('0x85')](_0x4338('0x86'),0x232a);return _0x1c41cd(_0x4338('0x87')+0x232a);});});};
\ No newline at end of file
+var _0x6f31=['total','type','unmanaged','abandoned','waiting','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','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','length','values','channels','voicechannel','map','find','uniqueid','channel','%s.%s','filename','wav','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','push','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','status','rec','MixMonitor\x20Success','resolve','StopMixMonitor','destinationchannel','stop','Channel\x20doesn\x27t\x20exist','voicequeuechannel','voicequeuechannelhangup','queueChannels','Hangup','voicequeuechannelredirect','Redirect','exten','context','trunks','outboundChannels','campaigns','run','emit','custom:','event','checkAfterSend','server','http','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','validate','../../../config/environment','../properties','listen','format','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','module','action','Reload','Action','then','catch','command','Command','content','message','voiceQueues','hasOwnProperty','answered','available','pTalking','sumBillable','sumDuration','sumHoldTime','talking'];(function(_0x18090f,_0x18ca7f){var _0x416d5b=function(_0x2a817c){while(--_0x2a817c){_0x18090f['push'](_0x18090f['shift']());}};_0x416d5b(++_0x18ca7f);}(_0x6f31,0x168));var _0x16f3=function(_0x1f2034,_0x55e729){_0x1f2034=_0x1f2034-0x0;var _0xb7fa5d=_0x6f31[_0x1f2034];return _0xb7fa5d;};'use strict';var _=require('lodash');var util=require(_0x16f3('0x0'));var jayson=require('jayson/promise');var schema=require(_0x16f3('0x1'));var BPromise=require('bluebird');var moment=require('moment');var config=require(_0x16f3('0x2'));var properties=require(_0x16f3('0x3'));var ami=require('../ami');exports[_0x16f3('0x4')]=function(_0x488ad1,_0x471f7c,_0x4d9973){return new BPromise(function(_0x3bd206,_0x168d3b){var _0x568ce0={'QueuePause':function(_0x489157){return new Promise(function(_0x340101,_0x468498){var _0x44f7c5=util[_0x16f3('0x5')]('%s/%s',_0x16f3('0x6'),_0x489157[_0x16f3('0x7')]);if(_0x488ad1['timers']&&_0x488ad1[_0x16f3('0x8')][_0x44f7c5]&&_0x488ad1['timers'][_0x44f7c5][_0x16f3('0x9')]){_0x488ad1[_0x16f3('0x8')][_0x44f7c5][_0x16f3('0xa')]();}if(_0x488ad1['agents'][_0x44f7c5]){_0x488ad1[_0x16f3('0xb')][_0x44f7c5][_0x16f3('0xc')]({'statePause':_0x489157['pause']?!![]:![]});}_0x340101({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x286067){var _0x542b0d=this;return new Promise(function(_0x551ffd,_0x40a2cd){if(ami[_0x16f3('0xd')]()==![]){return _0x40a2cd(_0x542b0d[_0x16f3('0xe')](0x1f4,[config[_0x16f3('0xf')]['ip'],config[_0x16f3('0xf')][_0x16f3('0x10')],_0x16f3('0x11')][_0x16f3('0x12')]('\x20')));}_0x286067=_[_0x16f3('0x13')](_0x286067,_['keys'](properties[_0x16f3('0x14')]));_0x286067[_0x16f3('0x15')]=_0x16f3('0x16');return ami[_0x16f3('0x17')](_0x286067)[_0x16f3('0x18')](function(_0x390500){_0x551ffd({'code':0xc8,'message':_0x390500['message']});})[_0x16f3('0x19')](function(_0x3a1cff){_0x40a2cd(_0x542b0d[_0x16f3('0xe')](0x1f5,_0x3a1cff['message']));});});},'Command':function(_0x99f659){var _0x1c0bdc=this;return new Promise(function(_0x318cf1,_0x2799df){if(ami[_0x16f3('0xd')]()==![]){return _0x2799df(_0x1c0bdc[_0x16f3('0xe')](0x1f4,[config['asterisk']['ip'],config[_0x16f3('0xf')][_0x16f3('0x10')],_0x16f3('0x11')][_0x16f3('0x12')]('\x20')));}_0x99f659=_[_0x16f3('0x13')](_0x99f659,_0x16f3('0x1a'));_0x99f659[_0x16f3('0x15')]=_0x16f3('0x1b');return ami[_0x16f3('0x17')](_0x99f659)[_0x16f3('0x18')](function(_0x3ae325){_0x318cf1({'code':0xc8,'message':_0x3ae325[_0x16f3('0x1c')]});})['catch'](function(_0x3b81b5){_0x2799df(_0x1c0bdc[_0x16f3('0xe')](0x1f5,_0x3b81b5[_0x16f3('0x1d')]));});});},'VoiceQueues':function(_0x5ada4d){return new Promise(function(_0x301f68,_0x1627cf){var _0x1b0720=[];for(var _0x3166ec in _0x488ad1['voiceQueues']){if(_0x488ad1[_0x16f3('0x1e')][_0x16f3('0x1f')](_0x3166ec)){var _0x2f2c27=_0x488ad1['voiceQueues'][_0x3166ec];var _0x20f762={'id':_0x2f2c27['id'],'name':_0x2f2c27[_0x16f3('0x7')],'strategy':_0x2f2c27['strategy'],'answered':_0x2f2c27[_0x16f3('0x20')],'available':_0x2f2c27[_0x16f3('0x21')],'loggedIn':_0x2f2c27['loggedIn'],'pTalking':_0x2f2c27[_0x16f3('0x22')],'sumBillable':_0x2f2c27[_0x16f3('0x23')],'sumDuration':_0x2f2c27[_0x16f3('0x24')],'sumHoldTime':_0x2f2c27[_0x16f3('0x25')]||0x0,'talking':_0x2f2c27[_0x16f3('0x26')],'total':_0x2f2c27[_0x16f3('0x27')],'type':_0x2f2c27[_0x16f3('0x28')],'unmanaged':_0x2f2c27[_0x16f3('0x29')],'abandoned':_0x2f2c27[_0x16f3('0x2a')],'waiting':_0x2f2c27[_0x16f3('0x2b')],'loggedInDb':_0x2f2c27['loggedInDb']};if(_0x2f2c27['type']===_0x16f3('0x2c')){_0x20f762[_0x16f3('0x2d')]=_0x2f2c27[_0x16f3('0x2d')];_0x20f762['dialMethod']=_0x2f2c27[_0x16f3('0x2e')];_0x20f762['dialOriginateCallerIdName']=_0x2f2c27[_0x16f3('0x2f')];_0x20f762[_0x16f3('0x30')]=_0x2f2c27['dialOriginateCallerIdNumber'];_0x20f762[_0x16f3('0x31')]=_0x2f2c27['dialOriginateTimeout'];_0x20f762[_0x16f3('0x32')]=_0x2f2c27[_0x16f3('0x32')];_0x20f762['outboundAnswerAgiCallsDay']=_0x2f2c27[_0x16f3('0x33')];_0x20f762[_0x16f3('0x34')]=_0x2f2c27[_0x16f3('0x34')];_0x20f762[_0x16f3('0x35')]=_0x2f2c27['outboundBlacklistCallsDay'];_0x20f762[_0x16f3('0x36')]=_0x2f2c27[_0x16f3('0x36')];_0x20f762[_0x16f3('0x37')]=_0x2f2c27[_0x16f3('0x37')];_0x20f762['outboundDropCallsDayACS']=_0x2f2c27[_0x16f3('0x38')];_0x20f762[_0x16f3('0x39')]=_0x2f2c27['outboundDropCallsDayCallersExit'];_0x20f762[_0x16f3('0x3a')]=_0x2f2c27[_0x16f3('0x3a')];_0x20f762[_0x16f3('0x3b')]=_0x2f2c27['outboundNoAnswerCallsDay'];_0x20f762[_0x16f3('0x3c')]=_0x2f2c27[_0x16f3('0x3c')];_0x20f762[_0x16f3('0x3d')]=_0x2f2c27['outboundOriginateFailureCallsDay'];_0x20f762[_0x16f3('0x3e')]=_0x2f2c27['outboundReCallsDay'];_0x20f762[_0x16f3('0x3f')]=_0x2f2c27[_0x16f3('0x3f')];_0x20f762[_0x16f3('0x40')]=_0x2f2c27['outboundUnknownCallsDay'];_0x20f762[_0x16f3('0x41')]=_0x2f2c27[_0x16f3('0x41')];_0x20f762[_0x16f3('0x42')]=_0x2f2c27[_0x16f3('0x42')];_0x20f762[_0x16f3('0x43')]=_0x2f2c27['predictiveIntervalAvgTalktime'];_0x20f762[_0x16f3('0x44')]=_0x2f2c27[_0x16f3('0x44')];_0x20f762[_0x16f3('0x45')]=_0x2f2c27[_0x16f3('0x45')];_0x20f762['predictiveIntervalErlangCalls']=_0x2f2c27[_0x16f3('0x46')];_0x20f762['predictiveIntervalErlangCallsDroppedCalls']=_0x2f2c27[_0x16f3('0x47')];_0x20f762[_0x16f3('0x48')]=_0x2f2c27[_0x16f3('0x48')];_0x20f762[_0x16f3('0x49')]=_0x2f2c27[_0x16f3('0x49')];_0x20f762[_0x16f3('0x4a')]=_0x2f2c27[_0x16f3('0x4a')];_0x20f762['predictiveIntervalAvailable']=_0x2f2c27['predictiveIntervalAvailable'];_0x20f762[_0x16f3('0x4b')]=_0x2f2c27[_0x16f3('0x4b')];_0x20f762[_0x16f3('0x1d')]=_0x2f2c27[_0x16f3('0x1d')];_0x20f762[_0x16f3('0x4c')]=_0x2f2c27[_0x16f3('0x4c')];_0x20f762[_0x16f3('0x4d')]=_0x2f2c27[_0x16f3('0x4d')];_0x20f762['erlangCallToSecond']=_0x2f2c27[_0x16f3('0x4e')];_0x20f762[_0x16f3('0x4f')]=_0x2f2c27[_0x16f3('0x4f')];_0x20f762[_0x16f3('0x50')]=_0x2f2c27['erlangBusyFactor'];_0x20f762[_0x16f3('0x51')]=_0x2f2c27[_0x16f3('0x51')];_0x20f762[_0x16f3('0x52')]=_0x2f2c27[_0x16f3('0x52')];}if(_0x2f2c27['Trunk']){_0x20f762['Trunk']={'id':_0x2f2c27[_0x16f3('0x53')]['id'],'name':_0x2f2c27[_0x16f3('0x53')][_0x16f3('0x7')],'active':_0x2f2c27[_0x16f3('0x53')][_0x16f3('0x54')],'callerid':_0x2f2c27[_0x16f3('0x53')]['callerid']};}if(_0x2f2c27[_0x16f3('0x55')]){_0x20f762[_0x16f3('0x55')]={'id':_0x2f2c27[_0x16f3('0x55')]['id'],'name':_0x2f2c27['Interval'][_0x16f3('0x7')]};}_0x1b0720['push'](_0x20f762);}}_0x301f68({'count':_0x1b0720[_0x16f3('0x56')],'rows':_0x1b0720});});},'VoiceChannels':function(_0x1e62a9){return new Promise(function(_0xeb56d1,_0x2e5ffd){var _0x34f326=_[_0x16f3('0x57')](_0x488ad1[_0x16f3('0x58')]);_0xeb56d1({'count':_0x34f326['length'],'rows':_0x34f326});});},'VoiceChannelMixMonitor':function(_0x3dd458){var _0xdd31b9=this;return new Promise(function(_0x1a17a6,_0x220789){if(ami[_0x16f3('0xd')]()==![]){return _0x220789(_0xdd31b9[_0x16f3('0xe')](0x1f4,[config[_0x16f3('0xf')]['ip'],config[_0x16f3('0xf')][_0x16f3('0x10')],'ami\x20disconnected']['join']('\x20')));}var _0x29d46b=schema(properties[_0x16f3('0x59')])[_0x16f3('0x1')](_0x3dd458);if(_0x29d46b['length']>0x0){return _0x220789(_0xdd31b9[_0x16f3('0xe')](0x1f4,_[_0x16f3('0x5a')](_0x29d46b,'message')['join'](',\x20')));}var _0x1160f5=_[_0x16f3('0x5b')](_0x488ad1[_0x16f3('0x58')],{'uniqueid':_0x3dd458[_0x16f3('0x5c')]});if(_0x1160f5&&_0x1160f5[_0x16f3('0x5d')]){var _0x20be91=util[_0x16f3('0x5')](_0x16f3('0x5e'),_0x3dd458[_0x16f3('0x5f')]||_0x3dd458[_0x16f3('0x5c')],_0x3dd458[_0x16f3('0x5')]||_0x16f3('0x60'));return ami[_0x16f3('0x17')]({'action':'MixMonitor','channel':_0x1160f5[_0x16f3('0x5d')],'file':_0x20be91,'options':_0x16f3('0x61')})[_0x16f3('0x18')](function(_0xb09988){var _0x119eb3=_['find'](_0x1160f5[_0x16f3('0x62')],{'filename':_0x16f3('0x63')+_0x20be91[_0x16f3('0x64')]()});if(_[_0x16f3('0x65')](_0x119eb3)){_0x1160f5['monitors'][_0x16f3('0x66')]({'filename':_0x16f3('0x63')+_0x20be91[_0x16f3('0x64')](),'createdAt':moment()[_0x16f3('0x5')](_0x16f3('0x67')),'mixmonitorid':_0xb09988[_0x16f3('0x68')],'status':'rec'});}else{_0x119eb3[_0x16f3('0x68')]=_0xb09988[_0x16f3('0x68')];_0x119eb3[_0x16f3('0x69')]=_0x16f3('0x6a');}_0x1a17a6({'code':0xc8,'message':[_0x3dd458['uniqueid'],_0x16f3('0x6b'),_0xb09988[_0x16f3('0x68')]][_0x16f3('0x12')]('\x20'),'mixmonitorid':_0xb09988[_0x16f3('0x68')]});})[_0x16f3('0x19')](function(_0x401315){_0x220789(_0xdd31b9[_0x16f3('0xe')](0x1f5,[_0x3dd458['uniqueid'],_0x401315['message']['toLowerCase']()][_0x16f3('0x12')]('\x20')));});}else{return _0x220789(_0xdd31b9[_0x16f3('0xe')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x4aad9a){var _0x22c4e8=this;return new Promise(function(_0x694d94,_0x302895){if(ami['isConnected']()==![]){return _0x302895(_0x22c4e8['error'](0x1f4,[config[_0x16f3('0xf')]['ip'],config[_0x16f3('0xf')][_0x16f3('0x10')],_0x16f3('0x11')]['join']('\x20')));}var _0x5ae5d7=schema(properties[_0x16f3('0x59')])[_0x16f3('0x1')](_0x4aad9a);if(_0x5ae5d7[_0x16f3('0x56')]>0x0){return _0x302895(_0x22c4e8[_0x16f3('0xe')](0x1f4,_[_0x16f3('0x5a')](_0x5ae5d7,_0x16f3('0x1d'))['join'](',\x20')));}var _0x5dd380=_['find'](_0x488ad1[_0x16f3('0x58')],{'uniqueid':_0x4aad9a[_0x16f3('0x5c')]});if(_0x5dd380){return BPromise[_0x16f3('0x6c')]()[_0x16f3('0x18')](function(){if(_0x5dd380[_0x16f3('0x5d')]){return ami[_0x16f3('0x17')]({'action':_0x16f3('0x6d'),'channel':_0x5dd380[_0x16f3('0x5d')],'mixmonitorid':_0x4aad9a[_0x16f3('0x68')]})['catch'](function(_0x1529af){});}})[_0x16f3('0x18')](function(){if(_0x5dd380[_0x16f3('0x6e')]){return ami[_0x16f3('0x17')]({'action':_0x16f3('0x6d'),'channel':_0x5dd380[_0x16f3('0x6e')],'mixmonitorid':_0x4aad9a['mixmonitorid']})['catch'](function(_0x4029d6){});}})[_0x16f3('0x18')](function(_0x5d7be1){var _0x43924a=_[_0x16f3('0x5b')](_0x5dd380['monitors'],{'mixmonitorid':_0x4aad9a[_0x16f3('0x68')]});if(_0x43924a){_0x43924a['status']=_0x16f3('0x6f');}})[_0x16f3('0x18')](function(){var _0xb4d8c1=util[_0x16f3('0x5')]('%s.%s',_0x4aad9a[_0x16f3('0x5f')]||_0x4aad9a['uniqueid'],_0x4aad9a[_0x16f3('0x5')]||'wav');var _0x18575e=_[_0x16f3('0x5b')](_0x5dd380[_0x16f3('0x62')],{'filename':'/var/spool/asterisk/monitor/'+_0xb4d8c1[_0x16f3('0x64')]()});if(_0x18575e){_0x18575e[_0x16f3('0x69')]=_0x16f3('0x6f');}})[_0x16f3('0x18')](function(){_0x694d94({'code':0xc8,'message':[_0x4aad9a[_0x16f3('0x5c')],'StopMixMonitor\x20Success'][_0x16f3('0x12')]('\x20')});})[_0x16f3('0x19')](function(_0x4a2914){_0x302895(_0x22c4e8['error'](0x1f5,[_0x4aad9a[_0x16f3('0x5c')],_0x4a2914[_0x16f3('0x1d')][_0x16f3('0x64')]()]['join']('\x20')));});}else{return _0x302895(_0x22c4e8[_0x16f3('0xe')](0x1f5,_0x16f3('0x70')));}});},'VoiceQueuesChannels':function(_0x3a1623){return new Promise(function(_0x279e53,_0x55c99a){var _0x240ba9=_[_0x16f3('0x57')](_0x488ad1['queueChannels']);_0x279e53({'count':_0x240ba9[_0x16f3('0x56')],'rows':_0x240ba9});});},'VoiceQueuesChannel':function(_0x236cf7){var _0x3d1d8f=this;return new Promise(function(_0x3853a2,_0x15c390){var _0x2bfe56=schema(properties[_0x16f3('0x71')])[_0x16f3('0x1')](_0x236cf7);if(_0x2bfe56[_0x16f3('0x56')]>0x0){return _0x15c390(_0x3d1d8f['error'](0x1f4,_[_0x16f3('0x5a')](_0x2bfe56,_0x16f3('0x1d'))[_0x16f3('0x12')](',\x20')));}var _0x4519d0=_[_0x16f3('0x5b')](_0x488ad1['queueChannels'],{'uniqueid':_0x236cf7[_0x16f3('0x5c')]});if(_0x4519d0){_0x3853a2(_0x4519d0);}else{return _0x15c390(_0x3d1d8f['error'](0x1f5,_0x16f3('0x70')));}});},'VoiceQueuesChannelHangup':function(_0x5aae4e){var _0x3e96ff=this;return new Promise(function(_0x3c7967,_0xc1a1fc){if(ami[_0x16f3('0xd')]()==![]){return _0xc1a1fc(_0x3e96ff[_0x16f3('0xe')](0x1f4,[config[_0x16f3('0xf')]['ip'],config[_0x16f3('0xf')][_0x16f3('0x10')],_0x16f3('0x11')][_0x16f3('0x12')]('\x20')));}var _0x12dd98=schema(properties[_0x16f3('0x72')])[_0x16f3('0x1')](_0x5aae4e);if(_0x12dd98[_0x16f3('0x56')]>0x0){return _0xc1a1fc(_0x3e96ff[_0x16f3('0xe')](0x1f4,_['map'](_0x12dd98,_0x16f3('0x1d'))[_0x16f3('0x12')](',\x20')));}var _0x2da0ec=_[_0x16f3('0x5b')](_0x488ad1[_0x16f3('0x73')],{'uniqueid':_0x5aae4e[_0x16f3('0x5c')]});if(_0x2da0ec&&_0x2da0ec[_0x16f3('0x5d')]){return ami[_0x16f3('0x17')]({'action':_0x16f3('0x74'),'channel':_0x2da0ec[_0x16f3('0x5d')]})[_0x16f3('0x18')](function(_0x475495){_0x3c7967({'code':0xc8,'message':[_0x5aae4e[_0x16f3('0x5c')],_0x475495[_0x16f3('0x1d')][_0x16f3('0x64')]()][_0x16f3('0x12')]('\x20')});})['catch'](function(_0x385bbc){_0xc1a1fc(_0x3e96ff[_0x16f3('0xe')](0x1f5,[_0x5aae4e[_0x16f3('0x5c')],_0x385bbc['message'][_0x16f3('0x64')]()][_0x16f3('0x12')]('\x20')));});}else{return _0xc1a1fc(_0x3e96ff[_0x16f3('0xe')](0x1f5,_0x16f3('0x70')));}});},'VoiceQueuesChannelRedirect':function(_0x3eaee5){var _0x27f74b=this;return new Promise(function(_0x5d75cd,_0x171bdb){if(ami[_0x16f3('0xd')]()==![]){return _0x171bdb(_0x27f74b[_0x16f3('0xe')](0x1f4,[config[_0x16f3('0xf')]['ip'],config[_0x16f3('0xf')][_0x16f3('0x10')],_0x16f3('0x11')][_0x16f3('0x12')]('\x20')));}var _0x5c7997=schema(properties[_0x16f3('0x75')])[_0x16f3('0x1')](_0x3eaee5);if(_0x5c7997[_0x16f3('0x56')]>0x0){return _0x171bdb(_0x27f74b[_0x16f3('0xe')](0x1f4,_[_0x16f3('0x5a')](_0x5c7997,_0x16f3('0x1d'))[_0x16f3('0x12')](',\x20')));}var _0x25e0f2=_[_0x16f3('0x5b')](_0x488ad1['queueChannels'],{'uniqueid':_0x3eaee5['uniqueid']});if(_0x25e0f2&&_0x25e0f2[_0x16f3('0x5d')]){return ami[_0x16f3('0x17')]({'action':_0x16f3('0x76'),'channel':_0x25e0f2['channel'],'exten':_0x3eaee5[_0x16f3('0x77')],'context':_0x3eaee5[_0x16f3('0x78')]||_0x25e0f2['context'],'priority':0x1})['then'](function(_0x4d3b94){_0x5d75cd({'code':0xc8,'message':[_0x3eaee5['uniqueid'],_0x4d3b94[_0x16f3('0x1d')][_0x16f3('0x64')]()][_0x16f3('0x12')]('\x20')});})[_0x16f3('0x19')](function(_0x37e763){_0x171bdb(_0x27f74b[_0x16f3('0xe')](0x1f5,[_0x3eaee5[_0x16f3('0x5c')],_0x37e763[_0x16f3('0x1d')][_0x16f3('0x64')]()]['join']('\x20')));});}else{return _0x171bdb(_0x27f74b[_0x16f3('0xe')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x560af5){return new Promise(function(_0x18f817,_0x106971){var _0xf3b861=_[_0x16f3('0x57')](_0x488ad1['agents']);_0x18f817({'count':_0xf3b861[_0x16f3('0x56')],'rows':_0xf3b861});});},'Telephones':function(_0x336867){return new Promise(function(_0x121235,_0xd6d48f){var _0x520d09=_['values'](_0x488ad1['telephones']);_0x121235({'count':_0x520d09[_0x16f3('0x56')],'rows':_0x520d09});});},'Trunks':function(_0x593518){return new Promise(function(_0x5f0d29,_0x52b2f2){var _0x3b0d21=_[_0x16f3('0x57')](_0x488ad1[_0x16f3('0x79')]);_0x5f0d29({'count':_0x3b0d21[_0x16f3('0x56')],'rows':_0x3b0d21});});},'OutboundChannels':function(_0x98b821){return new Promise(function(_0x4b514f,_0x2c30ff){var _0x32a9c8=_[_0x16f3('0x57')](_0x488ad1[_0x16f3('0x7a')]);_0x4b514f({'count':_0x32a9c8[_0x16f3('0x56')],'rows':_0x32a9c8});});},'Outbound':function(_0x4097df){return new Promise(function(_0x5953df,_0x44e40e){_0x5953df(_0x488ad1['outbound']);});},'Campaigns':function(_0x48b626){return new Promise(function(_0x18ba28,_0x12ff6f){var _0x54e035=_[_0x16f3('0x57')](_0x488ad1[_0x16f3('0x7b')]);_0x18ba28({'count':_0x54e035['length'],'rows':_0x54e035});});},'VoiceQueuesPreview':function(_0x1d45e7){var _0x592839=this;return new Promise(function(_0x3878f0,_0xd2434a){_0x471f7c[_0x16f3('0x7c')](_0x1d45e7['id'])['then'](function(_0x12813b){_0x3878f0({'code':0xc8,'message':_0x12813b[_0x16f3('0x1d')]});})[_0x16f3('0x19')](function(_0x4ba17c){_0xd2434a(_0x592839['error'](0x1f4,_0x4ba17c[_0x16f3('0x1d')]));});});},'EventManager':function(_0x17f521){var _0x10e5f8=this;return new Promise(function(_0x547d47,_0x482608){if(!_0x17f521['event']){return _0x482608(_0x10e5f8['error'](0x1f4,'Event\x20name\x20mandatory'));}ami[_0x16f3('0x7d')](_0x16f3('0x7e')+_0x17f521[_0x16f3('0x7f')],_0x17f521[_0x16f3('0x1d')]);_0x547d47({'code':0xc8,'message':_0x17f521});});},'FaxAccounts':function(_0x2ec057){return new Promise(function(_0x3de667,_0x272a70){var _0x47969c=_[_0x16f3('0x57')](_0x488ad1['faxAccounts']);_0x3de667({'count':_0x47969c[_0x16f3('0x56')],'rows':_0x47969c});});},'SendFax':function(_0x53ba52){var _0x38bb88=this;return new Promise(function(_0x3d972a,_0x31da73){_0x4d9973['send'](_0x53ba52)[_0x16f3('0x18')](function(_0x31fa5){_0x3d972a({'code':0xc8,'message':_0x31fa5['message']});})[_0x16f3('0x19')](function(_0xfc7ecc){_0x31da73(_0x38bb88[_0x16f3('0xe')](0x1f4,_0xfc7ecc[_0x16f3('0x1d')]));});});},'CheckAfterSend':function(_0x36c533){var _0x42a18e=this;return new Promise(function(_0x12e99f,_0x18c745){_0x4d9973[_0x16f3('0x80')](_0x36c533)[_0x16f3('0x18')](function(_0x2bcfa1){_0x12e99f({'code':0xc8,'message':_0x2bcfa1[_0x16f3('0x1d')]});})[_0x16f3('0x19')](function(_0x12ee75){_0x18c745(_0x42a18e[_0x16f3('0xe')](0x1f4,_0x12ee75[_0x16f3('0x1d')]));});});}};var _0x29e80a=jayson[_0x16f3('0x81')](_0x568ce0)[_0x16f3('0x82')]();_0x29e80a['on'](_0x16f3('0xe'),function(_0x5669c1){return _0x168d3b(_0x5669c1);});_0x29e80a['listen'](0x232a,'127.0.0.1',function(){console['log'](_0x16f3('0x83'),0x232a);return _0x3bd206(_0x16f3('0x84')+0x232a);});});};
\ No newline at end of file