Built motion from commit (unavailable).|2.4.12
[motion2.git] / server / services / ami / server / index.js
index c04d6bc..68f8f2e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7421=['predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startPredictive','startProgressive','Trunk','active','Interval','push','channels','length','map','find','uniqueid','channel','%s.%s','filename','wav','then','monitors','toLowerCase','/var/spool/asterisk/monitor/','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','voicechannel','resolve','destinationchannel','StopMixMonitor','status','stop','StopMixMonitor\x20Success','values','voicequeuechannel','queueChannels','Hangup','Redirect','exten','context','telephones','outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','emit','checkAfterSend','server','http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','validate','bluebird','moment','../../../config/environment','../properties','../ami','listen','format','SIP','name','timers','updateAcw','agents','pause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','Reload','catch','message','action','Command','Action','content','voiceQueues','hasOwnProperty','strategy','answered','available','sumBillable','sumDuration','sumHoldTime','total','type','unmanaged','abandoned','loggedInDb','dialMethod','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable'];(function(_0x17a9dd,_0x1b8137){var _0x8860b=function(_0x461caf){while(--_0x461caf){_0x17a9dd['push'](_0x17a9dd['shift']());}};_0x8860b(++_0x1b8137);}(_0x7421,0xb8));var _0x1742=function(_0x7a07e3,_0x7fa793){_0x7a07e3=_0x7a07e3-0x0;var _0x10502a=_0x7421[_0x7a07e3];return _0x10502a;};'use strict';var _=require(_0x1742('0x0'));var util=require(_0x1742('0x1'));var jayson=require('jayson/promise');var schema=require(_0x1742('0x2'));var BPromise=require(_0x1742('0x3'));var moment=require(_0x1742('0x4'));var config=require(_0x1742('0x5'));var properties=require(_0x1742('0x6'));var ami=require(_0x1742('0x7'));exports[_0x1742('0x8')]=function(_0x2d0d3a,_0x110289,_0x1e98cf){return new BPromise(function(_0x1542bb,_0x2dce9b){var _0x1ef7aa={'QueuePause':function(_0x75e29a){return new Promise(function(_0x36b4fa,_0x1ad232){var _0x3ffba5=util[_0x1742('0x9')]('%s/%s',_0x1742('0xa'),_0x75e29a[_0x1742('0xb')]);if(_0x2d0d3a['timers']&&_0x2d0d3a[_0x1742('0xc')][_0x3ffba5]&&_0x2d0d3a['timers'][_0x3ffba5]['timer']){_0x2d0d3a[_0x1742('0xc')][_0x3ffba5][_0x1742('0xd')]();}if(_0x2d0d3a['agents'][_0x3ffba5]){_0x2d0d3a[_0x1742('0xe')][_0x3ffba5]['updateStatusRealtime']({'statePause':_0x75e29a[_0x1742('0xf')]?!![]:![]});}_0x36b4fa({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x6e389){var _0x314f61=this;return new Promise(function(_0x4bc54f,_0x443eba){if(ami[_0x1742('0x10')]()==![]){return _0x443eba(_0x314f61[_0x1742('0x11')](0x1f4,[config[_0x1742('0x12')]['ip'],config[_0x1742('0x12')][_0x1742('0x13')],_0x1742('0x14')][_0x1742('0x15')]('\x20')));}_0x6e389=_[_0x1742('0x16')](_0x6e389,_[_0x1742('0x17')](properties[_0x1742('0x18')]));_0x6e389['action']=_0x1742('0x19');return ami['Action'](_0x6e389)['then'](function(_0x38e944){_0x4bc54f({'code':0xc8,'message':_0x38e944['message']});})[_0x1742('0x1a')](function(_0x2c25fe){_0x443eba(_0x314f61['error'](0x1f5,_0x2c25fe[_0x1742('0x1b')]));});});},'Command':function(_0xfbc469){var _0x1270d5=this;return new Promise(function(_0x3dbdc0,_0x4bb7d9){if(ami[_0x1742('0x10')]()==![]){return _0x4bb7d9(_0x1270d5['error'](0x1f4,[config[_0x1742('0x12')]['ip'],config[_0x1742('0x12')][_0x1742('0x13')],_0x1742('0x14')]['join']('\x20')));}_0xfbc469=_['pick'](_0xfbc469,'command');_0xfbc469[_0x1742('0x1c')]=_0x1742('0x1d');return ami[_0x1742('0x1e')](_0xfbc469)['then'](function(_0x1220b9){_0x3dbdc0({'code':0xc8,'message':_0x1220b9[_0x1742('0x1f')]});})[_0x1742('0x1a')](function(_0xa0e0db){_0x4bb7d9(_0x1270d5['error'](0x1f5,_0xa0e0db[_0x1742('0x1b')]));});});},'VoiceQueues':function(_0x4d0828){return new Promise(function(_0x20e9f9,_0x2622a6){var _0x396cfb=[];for(var _0x44efb3 in _0x2d0d3a[_0x1742('0x20')]){if(_0x2d0d3a[_0x1742('0x20')][_0x1742('0x21')](_0x44efb3)){var _0x4e3d44=_0x2d0d3a[_0x1742('0x20')][_0x44efb3];var _0x3fdfad={'id':_0x4e3d44['id'],'name':_0x4e3d44[_0x1742('0xb')],'strategy':_0x4e3d44[_0x1742('0x22')],'answered':_0x4e3d44[_0x1742('0x23')],'available':_0x4e3d44[_0x1742('0x24')],'loggedIn':_0x4e3d44['loggedIn'],'pTalking':_0x4e3d44['pTalking'],'sumBillable':_0x4e3d44[_0x1742('0x25')],'sumDuration':_0x4e3d44[_0x1742('0x26')],'sumHoldTime':_0x4e3d44[_0x1742('0x27')]||0x0,'talking':_0x4e3d44['talking'],'total':_0x4e3d44[_0x1742('0x28')],'type':_0x4e3d44[_0x1742('0x29')],'unmanaged':_0x4e3d44[_0x1742('0x2a')],'abandoned':_0x4e3d44[_0x1742('0x2b')],'waiting':_0x4e3d44['waiting'],'loggedInDb':_0x4e3d44[_0x1742('0x2c')]};if(_0x4e3d44[_0x1742('0x29')]==='outbound'){_0x3fdfad['dialActive']=_0x4e3d44['dialActive'];_0x3fdfad[_0x1742('0x2d')]=_0x4e3d44['dialMethod'];_0x3fdfad['dialOriginateCallerIdName']=_0x4e3d44['dialOriginateCallerIdName'];_0x3fdfad['dialOriginateCallerIdNumber']=_0x4e3d44['dialOriginateCallerIdNumber'];_0x3fdfad[_0x1742('0x2e')]=_0x4e3d44['dialOriginateTimeout'];_0x3fdfad[_0x1742('0x2f')]=_0x4e3d44[_0x1742('0x2f')];_0x3fdfad['outboundAnswerAgiCallsDay']=_0x4e3d44[_0x1742('0x30')];_0x3fdfad[_0x1742('0x31')]=_0x4e3d44[_0x1742('0x31')];_0x3fdfad[_0x1742('0x32')]=_0x4e3d44['outboundBlacklistCallsDay'];_0x3fdfad['outboundBusyCallsDay']=_0x4e3d44[_0x1742('0x33')];_0x3fdfad[_0x1742('0x34')]=_0x4e3d44[_0x1742('0x34')];_0x3fdfad[_0x1742('0x35')]=_0x4e3d44['outboundDropCallsDayACS'];_0x3fdfad[_0x1742('0x36')]=_0x4e3d44[_0x1742('0x36')];_0x3fdfad[_0x1742('0x37')]=_0x4e3d44[_0x1742('0x37')];_0x3fdfad[_0x1742('0x38')]=_0x4e3d44[_0x1742('0x38')];_0x3fdfad[_0x1742('0x39')]=_0x4e3d44[_0x1742('0x39')];_0x3fdfad[_0x1742('0x3a')]=_0x4e3d44[_0x1742('0x3a')];_0x3fdfad[_0x1742('0x3b')]=_0x4e3d44['outboundReCallsDay'];_0x3fdfad[_0x1742('0x3c')]=_0x4e3d44[_0x1742('0x3c')];_0x3fdfad[_0x1742('0x3d')]=_0x4e3d44[_0x1742('0x3d')];_0x3fdfad['predictiveIntervalAnsweredCalls']=_0x4e3d44['predictiveIntervalAnsweredCalls'];_0x3fdfad[_0x1742('0x3e')]=_0x4e3d44[_0x1742('0x3e')];_0x3fdfad[_0x1742('0x3f')]=_0x4e3d44[_0x1742('0x3f')];_0x3fdfad['predictiveIntervalDroppedCallsCallersExit']=_0x4e3d44[_0x1742('0x40')];_0x3fdfad[_0x1742('0x41')]=_0x4e3d44['predictiveIntervalDroppedCallsTimeout'];_0x3fdfad[_0x1742('0x42')]=_0x4e3d44[_0x1742('0x42')];_0x3fdfad[_0x1742('0x43')]=_0x4e3d44[_0x1742('0x43')];_0x3fdfad[_0x1742('0x44')]=_0x4e3d44[_0x1742('0x44')];_0x3fdfad[_0x1742('0x45')]=_0x4e3d44[_0x1742('0x45')];_0x3fdfad[_0x1742('0x46')]=_0x4e3d44[_0x1742('0x46')];_0x3fdfad[_0x1742('0x47')]=_0x4e3d44['predictiveIntervalAvailable'];_0x3fdfad[_0x1742('0x48')]=_0x4e3d44[_0x1742('0x48')];_0x3fdfad[_0x1742('0x1b')]=_0x4e3d44['message'];_0x3fdfad[_0x1742('0x49')]=_0x4e3d44['originated'];_0x3fdfad[_0x1742('0x4a')]=_0x4e3d44['erlangCalls'];_0x3fdfad[_0x1742('0x4b')]=_0x4e3d44[_0x1742('0x4b')];_0x3fdfad[_0x1742('0x4c')]=_0x4e3d44[_0x1742('0x4c')];_0x3fdfad['erlangBusyFactor']=_0x4e3d44['erlangBusyFactor'];_0x3fdfad[_0x1742('0x4d')]=_0x4e3d44[_0x1742('0x4d')];_0x3fdfad[_0x1742('0x4e')]=_0x4e3d44['startProgressive'];}if(_0x4e3d44[_0x1742('0x4f')]){_0x3fdfad[_0x1742('0x4f')]={'id':_0x4e3d44[_0x1742('0x4f')]['id'],'name':_0x4e3d44['Trunk'][_0x1742('0xb')],'active':_0x4e3d44['Trunk'][_0x1742('0x50')],'callerid':_0x4e3d44[_0x1742('0x4f')]['callerid']};}if(_0x4e3d44[_0x1742('0x51')]){_0x3fdfad[_0x1742('0x51')]={'id':_0x4e3d44[_0x1742('0x51')]['id'],'name':_0x4e3d44[_0x1742('0x51')]['name']};}_0x396cfb[_0x1742('0x52')](_0x3fdfad);}}_0x20e9f9({'count':_0x396cfb['length'],'rows':_0x396cfb});});},'VoiceChannels':function(_0x49fa9a){return new Promise(function(_0x16d384,_0x43249f){var _0x4d65e3=_['values'](_0x2d0d3a[_0x1742('0x53')]);_0x16d384({'count':_0x4d65e3['length'],'rows':_0x4d65e3});});},'VoiceChannelMixMonitor':function(_0x413202){var _0x53616a=this;return new Promise(function(_0x5350d4,_0x138de2){if(ami[_0x1742('0x10')]()==![]){return _0x138de2(_0x53616a[_0x1742('0x11')](0x1f4,[config[_0x1742('0x12')]['ip'],config['asterisk']['username'],_0x1742('0x14')]['join']('\x20')));}var _0x1687b4=schema(properties['voicechannel'])[_0x1742('0x2')](_0x413202);if(_0x1687b4[_0x1742('0x54')]>0x0){return _0x138de2(_0x53616a[_0x1742('0x11')](0x1f4,_[_0x1742('0x55')](_0x1687b4,'message')[_0x1742('0x15')](',\x20')));}var _0x1b9798=_[_0x1742('0x56')](_0x2d0d3a[_0x1742('0x53')],{'uniqueid':_0x413202[_0x1742('0x57')]});if(_0x1b9798&&_0x1b9798[_0x1742('0x58')]){var _0x1dbaec=util[_0x1742('0x9')](_0x1742('0x59'),_0x413202[_0x1742('0x5a')]||_0x413202[_0x1742('0x57')],_0x413202[_0x1742('0x9')]||_0x1742('0x5b'));return ami[_0x1742('0x1e')]({'action':'MixMonitor','channel':_0x1b9798[_0x1742('0x58')],'file':_0x1dbaec,'options':'ai(mixmonitorid)'})[_0x1742('0x5c')](function(_0x186e29){var _0x428ff9=_[_0x1742('0x56')](_0x1b9798[_0x1742('0x5d')],{'filename':'/var/spool/asterisk/monitor/'+_0x1dbaec[_0x1742('0x5e')]()});if(_['isNil'](_0x428ff9)){_0x1b9798[_0x1742('0x5d')][_0x1742('0x52')]({'filename':_0x1742('0x5f')+_0x1dbaec['toLowerCase'](),'createdAt':moment()[_0x1742('0x9')](_0x1742('0x60')),'mixmonitorid':_0x186e29[_0x1742('0x61')],'status':_0x1742('0x62')});}else{_0x428ff9['mixmonitorid']=_0x186e29[_0x1742('0x61')];_0x428ff9['status']=_0x1742('0x62');}_0x5350d4({'code':0xc8,'message':[_0x413202[_0x1742('0x57')],_0x1742('0x63'),_0x186e29[_0x1742('0x61')]][_0x1742('0x15')]('\x20'),'mixmonitorid':_0x186e29[_0x1742('0x61')]});})[_0x1742('0x1a')](function(_0x438443){_0x138de2(_0x53616a['error'](0x1f5,[_0x413202[_0x1742('0x57')],_0x438443['message'][_0x1742('0x5e')]()][_0x1742('0x15')]('\x20')));});}else{return _0x138de2(_0x53616a[_0x1742('0x11')](0x1f5,_0x1742('0x64')));}});},'VoiceChannelStopMixMonitor':function(_0x4cec84){var _0x3c37b4=this;return new Promise(function(_0x2e2efc,_0x5ac31a){if(ami[_0x1742('0x10')]()==![]){return _0x5ac31a(_0x3c37b4['error'](0x1f4,[config[_0x1742('0x12')]['ip'],config[_0x1742('0x12')][_0x1742('0x13')],_0x1742('0x14')][_0x1742('0x15')]('\x20')));}var _0x3de576=schema(properties[_0x1742('0x65')])[_0x1742('0x2')](_0x4cec84);if(_0x3de576['length']>0x0){return _0x5ac31a(_0x3c37b4[_0x1742('0x11')](0x1f4,_['map'](_0x3de576,'message')[_0x1742('0x15')](',\x20')));}var _0x315974=_[_0x1742('0x56')](_0x2d0d3a[_0x1742('0x53')],{'uniqueid':_0x4cec84['uniqueid']});if(_0x315974){return BPromise[_0x1742('0x66')]()[_0x1742('0x5c')](function(){if(_0x315974[_0x1742('0x58')]){return ami[_0x1742('0x1e')]({'action':'StopMixMonitor','channel':_0x315974[_0x1742('0x58')],'mixmonitorid':_0x4cec84[_0x1742('0x61')]})[_0x1742('0x1a')](function(_0x12199f){});}})[_0x1742('0x5c')](function(){if(_0x315974[_0x1742('0x67')]){return ami[_0x1742('0x1e')]({'action':_0x1742('0x68'),'channel':_0x315974[_0x1742('0x67')],'mixmonitorid':_0x4cec84[_0x1742('0x61')]})[_0x1742('0x1a')](function(_0x560c3e){});}})[_0x1742('0x5c')](function(_0x3a2810){var _0x12de63=_['find'](_0x315974[_0x1742('0x5d')],{'mixmonitorid':_0x4cec84['mixmonitorid']});if(_0x12de63){_0x12de63[_0x1742('0x69')]=_0x1742('0x6a');}})[_0x1742('0x5c')](function(){var _0x39ac75=util[_0x1742('0x9')](_0x1742('0x59'),_0x4cec84['filename']||_0x4cec84['uniqueid'],_0x4cec84[_0x1742('0x9')]||'wav');var _0x29de0=_[_0x1742('0x56')](_0x315974[_0x1742('0x5d')],{'filename':'/var/spool/asterisk/monitor/'+_0x39ac75[_0x1742('0x5e')]()});if(_0x29de0){_0x29de0['status']=_0x1742('0x6a');}})['then'](function(){_0x2e2efc({'code':0xc8,'message':[_0x4cec84[_0x1742('0x57')],_0x1742('0x6b')][_0x1742('0x15')]('\x20')});})[_0x1742('0x1a')](function(_0x3db8c4){_0x5ac31a(_0x3c37b4[_0x1742('0x11')](0x1f5,[_0x4cec84['uniqueid'],_0x3db8c4[_0x1742('0x1b')][_0x1742('0x5e')]()][_0x1742('0x15')]('\x20')));});}else{return _0x5ac31a(_0x3c37b4['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x4b5794){return new Promise(function(_0x1b2834,_0xeaa201){var _0x2833e8=_[_0x1742('0x6c')](_0x2d0d3a['queueChannels']);_0x1b2834({'count':_0x2833e8[_0x1742('0x54')],'rows':_0x2833e8});});},'VoiceQueuesChannel':function(_0x1bf78e){var _0x26293a=this;return new Promise(function(_0x45791d,_0x26ecf5){var _0x4d4767=schema(properties[_0x1742('0x6d')])['validate'](_0x1bf78e);if(_0x4d4767[_0x1742('0x54')]>0x0){return _0x26ecf5(_0x26293a[_0x1742('0x11')](0x1f4,_[_0x1742('0x55')](_0x4d4767,_0x1742('0x1b'))['join'](',\x20')));}var _0x3e9225=_[_0x1742('0x56')](_0x2d0d3a['queueChannels'],{'uniqueid':_0x1bf78e[_0x1742('0x57')]});if(_0x3e9225){_0x45791d(_0x3e9225);}else{return _0x26ecf5(_0x26293a['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x689d39){var _0x99c8=this;return new Promise(function(_0x5722e0,_0x149e0d){if(ami['isConnected']()==![]){return _0x149e0d(_0x99c8['error'](0x1f4,[config[_0x1742('0x12')]['ip'],config[_0x1742('0x12')][_0x1742('0x13')],_0x1742('0x14')][_0x1742('0x15')]('\x20')));}var _0x549c59=schema(properties['voicequeuechannelhangup'])[_0x1742('0x2')](_0x689d39);if(_0x549c59[_0x1742('0x54')]>0x0){return _0x149e0d(_0x99c8[_0x1742('0x11')](0x1f4,_['map'](_0x549c59,'message')[_0x1742('0x15')](',\x20')));}var _0x1133e6=_[_0x1742('0x56')](_0x2d0d3a[_0x1742('0x6e')],{'uniqueid':_0x689d39[_0x1742('0x57')]});if(_0x1133e6&&_0x1133e6[_0x1742('0x58')]){return ami['Action']({'action':_0x1742('0x6f'),'channel':_0x1133e6[_0x1742('0x58')]})[_0x1742('0x5c')](function(_0x35e808){_0x5722e0({'code':0xc8,'message':[_0x689d39[_0x1742('0x57')],_0x35e808[_0x1742('0x1b')][_0x1742('0x5e')]()]['join']('\x20')});})[_0x1742('0x1a')](function(_0x43b5d2){_0x149e0d(_0x99c8[_0x1742('0x11')](0x1f5,[_0x689d39['uniqueid'],_0x43b5d2[_0x1742('0x1b')][_0x1742('0x5e')]()]['join']('\x20')));});}else{return _0x149e0d(_0x99c8[_0x1742('0x11')](0x1f5,_0x1742('0x64')));}});},'VoiceQueuesChannelRedirect':function(_0x20378b){var _0x12538f=this;return new Promise(function(_0x2300cb,_0x304ad2){if(ami[_0x1742('0x10')]()==![]){return _0x304ad2(_0x12538f[_0x1742('0x11')](0x1f4,[config[_0x1742('0x12')]['ip'],config['asterisk'][_0x1742('0x13')],'ami\x20disconnected'][_0x1742('0x15')]('\x20')));}var _0x17d4f7=schema(properties['voicequeuechannelredirect'])['validate'](_0x20378b);if(_0x17d4f7['length']>0x0){return _0x304ad2(_0x12538f['error'](0x1f4,_['map'](_0x17d4f7,_0x1742('0x1b'))['join'](',\x20')));}var _0x5d804d=_[_0x1742('0x56')](_0x2d0d3a[_0x1742('0x6e')],{'uniqueid':_0x20378b[_0x1742('0x57')]});if(_0x5d804d&&_0x5d804d[_0x1742('0x58')]){return ami[_0x1742('0x1e')]({'action':_0x1742('0x70'),'channel':_0x5d804d[_0x1742('0x58')],'exten':_0x20378b[_0x1742('0x71')],'context':_0x20378b[_0x1742('0x72')]||_0x5d804d[_0x1742('0x72')],'priority':0x1})['then'](function(_0x3cb8e0){_0x2300cb({'code':0xc8,'message':[_0x20378b[_0x1742('0x57')],_0x3cb8e0[_0x1742('0x1b')][_0x1742('0x5e')]()][_0x1742('0x15')]('\x20')});})[_0x1742('0x1a')](function(_0x4d4593){_0x304ad2(_0x12538f[_0x1742('0x11')](0x1f5,[_0x20378b['uniqueid'],_0x4d4593[_0x1742('0x1b')][_0x1742('0x5e')]()][_0x1742('0x15')]('\x20')));});}else{return _0x304ad2(_0x12538f[_0x1742('0x11')](0x1f5,_0x1742('0x64')));}});},'Agents':function(_0x1cd6da){return new Promise(function(_0x47b87c,_0xcad681){var _0x341b0d=_[_0x1742('0x6c')](_0x2d0d3a[_0x1742('0xe')]);_0x47b87c({'count':_0x341b0d[_0x1742('0x54')],'rows':_0x341b0d});});},'Telephones':function(_0x57c180){return new Promise(function(_0x576608,_0x1e2f2b){var _0x42390b=_['values'](_0x2d0d3a[_0x1742('0x73')]);_0x576608({'count':_0x42390b[_0x1742('0x54')],'rows':_0x42390b});});},'Trunks':function(_0x11ea5f){return new Promise(function(_0x3f587b,_0x2fae9f){var _0x3dc166=_['values'](_0x2d0d3a['trunks']);_0x3f587b({'count':_0x3dc166['length'],'rows':_0x3dc166});});},'OutboundChannels':function(_0x45a629){return new Promise(function(_0x214288,_0x1e1379){var _0x319d1e=_[_0x1742('0x6c')](_0x2d0d3a[_0x1742('0x74')]);_0x214288({'count':_0x319d1e[_0x1742('0x54')],'rows':_0x319d1e});});},'Outbound':function(_0x4caeb7){return new Promise(function(_0x1f0acd,_0x5d4415){_0x1f0acd(_0x2d0d3a['outbound']);});},'Campaigns':function(_0x2b6d4c){return new Promise(function(_0x150c81,_0x545c79){var _0x5f48bc=_[_0x1742('0x6c')](_0x2d0d3a[_0x1742('0x75')]);_0x150c81({'count':_0x5f48bc[_0x1742('0x54')],'rows':_0x5f48bc});});},'VoiceQueuesPreview':function(_0x5248b3){var _0x13a260=this;return new Promise(function(_0x49bc24,_0x439419){_0x110289[_0x1742('0x76')](_0x5248b3['id'])[_0x1742('0x5c')](function(_0x20cfdd){_0x49bc24({'code':0xc8,'message':_0x20cfdd[_0x1742('0x1b')]});})['catch'](function(_0x326552){_0x439419(_0x13a260[_0x1742('0x11')](0x1f4,_0x326552[_0x1742('0x1b')]));});});},'EventManager':function(_0x240299){var _0x3f5561=this;return new Promise(function(_0x5f2a9e,_0x510daa){if(!_0x240299[_0x1742('0x77')]){return _0x510daa(_0x3f5561['error'](0x1f4,_0x1742('0x78')));}ami[_0x1742('0x79')]('custom:'+_0x240299[_0x1742('0x77')],_0x240299[_0x1742('0x1b')]);_0x5f2a9e({'code':0xc8,'message':_0x240299});});},'FaxAccounts':function(_0x536c9c){return new Promise(function(_0x4536dd,_0x3ddad8){var _0x507e20=_[_0x1742('0x6c')](_0x2d0d3a['faxAccounts']);_0x4536dd({'count':_0x507e20['length'],'rows':_0x507e20});});},'SendFax':function(_0x1cb9e8){var _0x12f231=this;return new Promise(function(_0x4d5577,_0x405892){_0x1e98cf['send'](_0x1cb9e8)[_0x1742('0x5c')](function(_0x4db98b){_0x4d5577({'code':0xc8,'message':_0x4db98b[_0x1742('0x1b')]});})[_0x1742('0x1a')](function(_0x5509d1){_0x405892(_0x12f231[_0x1742('0x11')](0x1f4,_0x5509d1[_0x1742('0x1b')]));});});},'CheckAfterSend':function(_0x4277fc){var _0x7d618e=this;return new Promise(function(_0x1716bc,_0x3b96fa){_0x1e98cf[_0x1742('0x7a')](_0x4277fc)[_0x1742('0x5c')](function(_0x33f701){_0x1716bc({'code':0xc8,'message':_0x33f701[_0x1742('0x1b')]});})['catch'](function(_0x4ae66f){_0x3b96fa(_0x7d618e['error'](0x1f4,_0x4ae66f[_0x1742('0x1b')]));});});}};var _0x122ec7=jayson[_0x1742('0x7b')](_0x1ef7aa)[_0x1742('0x7c')]();_0x122ec7['on']('error',function(_0x5f0a80){return _0x2dce9b(_0x5f0a80);});_0x122ec7[_0x1742('0x8')](0x232a,_0x1742('0x7d'),function(){console[_0x1742('0x7e')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x1542bb(_0x1742('0x7f')+0x232a);});});};
\ No newline at end of file
+var _0xc325=['event','checkAfterSend','server','http','127.0.0.1','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','moment','../../../config/environment','../properties','../ami','listen','format','%s/%s','SIP','name','timers','timer','agents','updateStatusRealtime','pause','QueuePause','isConnected','asterisk','username','ami\x20disconnected','pick','action','Reload','then','catch','error','message','join','command','Command','Action','voiceQueues','hasOwnProperty','strategy','answered','available','loggedIn','pTalking','sumHoldTime','talking','total','type','unmanaged','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','callerid','Interval','push','length','channels','voicechannel','map','find','uniqueid','channel','%s.%s','filename','wav','ai(mixmonitorid)','monitors','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','rec','mixmonitorid','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','stop','/var/spool/asterisk/monitor/','StopMixMonitor\x20Success','values','queueChannels','Hangup','voicequeuechannelredirect','Redirect','context','telephones','trunks','outboundChannels','campaigns','run','Event\x20name\x20mandatory','emit','custom:'];(function(_0x22743d,_0x1cee11){var _0x3d51f0=function(_0x2a3d63){while(--_0x2a3d63){_0x22743d['push'](_0x22743d['shift']());}};_0x3d51f0(++_0x1cee11);}(_0xc325,0x8d));var _0x5c32=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xc325[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x5c32('0x0'));var util=require(_0x5c32('0x1'));var jayson=require(_0x5c32('0x2'));var schema=require(_0x5c32('0x3'));var BPromise=require('bluebird');var moment=require(_0x5c32('0x4'));var config=require(_0x5c32('0x5'));var properties=require(_0x5c32('0x6'));var ami=require(_0x5c32('0x7'));exports[_0x5c32('0x8')]=function(_0xb4c19f,_0x5c26ff,_0x3cfb4f){return new BPromise(function(_0x2ecdee,_0x4c021f){var _0x389b39={'QueuePause':function(_0x5095c2){return new Promise(function(_0x98a32c,_0x5a2111){var _0x3f6018=util[_0x5c32('0x9')](_0x5c32('0xa'),_0x5c32('0xb'),_0x5095c2[_0x5c32('0xc')]);if(_0xb4c19f['timers']&&_0xb4c19f[_0x5c32('0xd')][_0x3f6018]&&_0xb4c19f[_0x5c32('0xd')][_0x3f6018][_0x5c32('0xe')]){_0xb4c19f[_0x5c32('0xd')][_0x3f6018]['updateAcw']();}if(_0xb4c19f['agents'][_0x3f6018]){_0xb4c19f[_0x5c32('0xf')][_0x3f6018][_0x5c32('0x10')]({'statePause':_0x5095c2[_0x5c32('0x11')]?!![]:![]});}_0x98a32c({'code':0xc8,'message':_0x5c32('0x12')});});},'Reload':function(_0x38fad6){var _0x54cda7=this;return new Promise(function(_0x414d07,_0x430f6f){if(ami[_0x5c32('0x13')]()==![]){return _0x430f6f(_0x54cda7['error'](0x1f4,[config[_0x5c32('0x14')]['ip'],config['asterisk'][_0x5c32('0x15')],_0x5c32('0x16')]['join']('\x20')));}_0x38fad6=_[_0x5c32('0x17')](_0x38fad6,_['keys'](properties['module']));_0x38fad6[_0x5c32('0x18')]=_0x5c32('0x19');return ami['Action'](_0x38fad6)[_0x5c32('0x1a')](function(_0x449816){_0x414d07({'code':0xc8,'message':_0x449816['message']});})[_0x5c32('0x1b')](function(_0x2d46df){_0x430f6f(_0x54cda7[_0x5c32('0x1c')](0x1f5,_0x2d46df[_0x5c32('0x1d')]));});});},'Command':function(_0x49c257){var _0x2ed9ef=this;return new Promise(function(_0x2037bb,_0x54da7c){if(ami[_0x5c32('0x13')]()==![]){return _0x54da7c(_0x2ed9ef[_0x5c32('0x1c')](0x1f4,[config[_0x5c32('0x14')]['ip'],config[_0x5c32('0x14')]['username'],'ami\x20disconnected'][_0x5c32('0x1e')]('\x20')));}_0x49c257=_[_0x5c32('0x17')](_0x49c257,_0x5c32('0x1f'));_0x49c257[_0x5c32('0x18')]=_0x5c32('0x20');return ami[_0x5c32('0x21')](_0x49c257)['then'](function(_0x4a38b1){_0x2037bb({'code':0xc8,'message':_0x4a38b1['content']});})['catch'](function(_0x6cc3a1){_0x54da7c(_0x2ed9ef[_0x5c32('0x1c')](0x1f5,_0x6cc3a1[_0x5c32('0x1d')]));});});},'VoiceQueues':function(_0x3b6ff8){return new Promise(function(_0x5c82b,_0x16e46c){var _0x264174=[];for(var _0x12d385 in _0xb4c19f[_0x5c32('0x22')]){if(_0xb4c19f['voiceQueues'][_0x5c32('0x23')](_0x12d385)){var _0x22d029=_0xb4c19f[_0x5c32('0x22')][_0x12d385];var _0xad1902={'id':_0x22d029['id'],'name':_0x22d029[_0x5c32('0xc')],'strategy':_0x22d029[_0x5c32('0x24')],'answered':_0x22d029[_0x5c32('0x25')],'available':_0x22d029[_0x5c32('0x26')],'loggedIn':_0x22d029[_0x5c32('0x27')],'pTalking':_0x22d029[_0x5c32('0x28')],'sumBillable':_0x22d029['sumBillable'],'sumDuration':_0x22d029['sumDuration'],'sumHoldTime':_0x22d029[_0x5c32('0x29')]||0x0,'talking':_0x22d029[_0x5c32('0x2a')],'total':_0x22d029[_0x5c32('0x2b')],'type':_0x22d029[_0x5c32('0x2c')],'unmanaged':_0x22d029[_0x5c32('0x2d')],'abandoned':_0x22d029['abandoned'],'waiting':_0x22d029['waiting'],'loggedInDb':_0x22d029[_0x5c32('0x2e')]};if(_0x22d029['type']===_0x5c32('0x2f')){_0xad1902[_0x5c32('0x30')]=_0x22d029[_0x5c32('0x30')];_0xad1902[_0x5c32('0x31')]=_0x22d029[_0x5c32('0x31')];_0xad1902[_0x5c32('0x32')]=_0x22d029['dialOriginateCallerIdName'];_0xad1902[_0x5c32('0x33')]=_0x22d029[_0x5c32('0x33')];_0xad1902[_0x5c32('0x34')]=_0x22d029[_0x5c32('0x34')];_0xad1902[_0x5c32('0x35')]=_0x22d029[_0x5c32('0x35')];_0xad1902[_0x5c32('0x36')]=_0x22d029[_0x5c32('0x36')];_0xad1902[_0x5c32('0x37')]=_0x22d029[_0x5c32('0x37')];_0xad1902[_0x5c32('0x38')]=_0x22d029[_0x5c32('0x38')];_0xad1902['outboundBusyCallsDay']=_0x22d029['outboundBusyCallsDay'];_0xad1902['outboundCongestionCallsDay']=_0x22d029[_0x5c32('0x39')];_0xad1902['outboundDropCallsDayACS']=_0x22d029[_0x5c32('0x3a')];_0xad1902[_0x5c32('0x3b')]=_0x22d029[_0x5c32('0x3b')];_0xad1902[_0x5c32('0x3c')]=_0x22d029[_0x5c32('0x3c')];_0xad1902[_0x5c32('0x3d')]=_0x22d029['outboundNoAnswerCallsDay'];_0xad1902[_0x5c32('0x3e')]=_0x22d029[_0x5c32('0x3e')];_0xad1902['outboundOriginateFailureCallsDay']=_0x22d029[_0x5c32('0x3f')];_0xad1902[_0x5c32('0x40')]=_0x22d029[_0x5c32('0x40')];_0xad1902['outboundRejectCallsDay']=_0x22d029[_0x5c32('0x41')];_0xad1902[_0x5c32('0x42')]=_0x22d029[_0x5c32('0x42')];_0xad1902['predictiveIntervalAnsweredCalls']=_0x22d029['predictiveIntervalAnsweredCalls'];_0xad1902[_0x5c32('0x43')]=_0x22d029[_0x5c32('0x43')];_0xad1902[_0x5c32('0x44')]=_0x22d029[_0x5c32('0x44')];_0xad1902['predictiveIntervalDroppedCallsCallersExit']=_0x22d029[_0x5c32('0x45')];_0xad1902[_0x5c32('0x46')]=_0x22d029['predictiveIntervalDroppedCallsTimeout'];_0xad1902['predictiveIntervalErlangCalls']=_0x22d029[_0x5c32('0x47')];_0xad1902[_0x5c32('0x48')]=_0x22d029[_0x5c32('0x48')];_0xad1902['predictiveIntervalHitRate']=_0x22d029['predictiveIntervalHitRate'];_0xad1902['predictiveIntervalMultiplicativeFactor']=_0x22d029['predictiveIntervalMultiplicativeFactor'];_0xad1902[_0x5c32('0x49')]=_0x22d029[_0x5c32('0x49')];_0xad1902[_0x5c32('0x4a')]=_0x22d029[_0x5c32('0x4a')];_0xad1902[_0x5c32('0x4b')]=_0x22d029[_0x5c32('0x4b')];_0xad1902[_0x5c32('0x1d')]=_0x22d029[_0x5c32('0x1d')];_0xad1902[_0x5c32('0x4c')]=_0x22d029[_0x5c32('0x4c')];_0xad1902['erlangCalls']=_0x22d029[_0x5c32('0x4d')];_0xad1902['erlangCallToSecond']=_0x22d029[_0x5c32('0x4e')];_0xad1902[_0x5c32('0x4f')]=_0x22d029[_0x5c32('0x4f')];_0xad1902[_0x5c32('0x50')]=_0x22d029[_0x5c32('0x50')];_0xad1902[_0x5c32('0x51')]=_0x22d029['startPredictive'];_0xad1902[_0x5c32('0x52')]=_0x22d029['startProgressive'];}if(_0x22d029[_0x5c32('0x53')]){_0xad1902[_0x5c32('0x53')]={'id':_0x22d029['Trunk']['id'],'name':_0x22d029['Trunk'][_0x5c32('0xc')],'active':_0x22d029[_0x5c32('0x53')]['active'],'callerid':_0x22d029[_0x5c32('0x53')][_0x5c32('0x54')]};}if(_0x22d029[_0x5c32('0x55')]){_0xad1902[_0x5c32('0x55')]={'id':_0x22d029['Interval']['id'],'name':_0x22d029[_0x5c32('0x55')][_0x5c32('0xc')]};}_0x264174[_0x5c32('0x56')](_0xad1902);}}_0x5c82b({'count':_0x264174[_0x5c32('0x57')],'rows':_0x264174});});},'VoiceChannels':function(_0x202033){return new Promise(function(_0x41071a,_0x6c174d){var _0x5cd3f2=_['values'](_0xb4c19f[_0x5c32('0x58')]);_0x41071a({'count':_0x5cd3f2[_0x5c32('0x57')],'rows':_0x5cd3f2});});},'VoiceChannelMixMonitor':function(_0x29a1e6){var _0x2365f9=this;return new Promise(function(_0xd6908,_0xc65e8b){if(ami[_0x5c32('0x13')]()==![]){return _0xc65e8b(_0x2365f9['error'](0x1f4,[config[_0x5c32('0x14')]['ip'],config[_0x5c32('0x14')][_0x5c32('0x15')],_0x5c32('0x16')][_0x5c32('0x1e')]('\x20')));}var _0x3ec9cf=schema(properties[_0x5c32('0x59')])[_0x5c32('0x3')](_0x29a1e6);if(_0x3ec9cf[_0x5c32('0x57')]>0x0){return _0xc65e8b(_0x2365f9[_0x5c32('0x1c')](0x1f4,_[_0x5c32('0x5a')](_0x3ec9cf,_0x5c32('0x1d'))[_0x5c32('0x1e')](',\x20')));}var _0x51a58e=_[_0x5c32('0x5b')](_0xb4c19f['channels'],{'uniqueid':_0x29a1e6[_0x5c32('0x5c')]});if(_0x51a58e&&_0x51a58e[_0x5c32('0x5d')]){var _0x9510c=util[_0x5c32('0x9')](_0x5c32('0x5e'),_0x29a1e6[_0x5c32('0x5f')]||_0x29a1e6[_0x5c32('0x5c')],_0x29a1e6[_0x5c32('0x9')]||_0x5c32('0x60'));return ami[_0x5c32('0x21')]({'action':'MixMonitor','channel':_0x51a58e[_0x5c32('0x5d')],'file':_0x9510c,'options':_0x5c32('0x61')})['then'](function(_0x3ce76e){var _0x5020e8=_[_0x5c32('0x5b')](_0x51a58e[_0x5c32('0x62')],{'filename':'/var/spool/asterisk/monitor/'+_0x9510c[_0x5c32('0x63')]()});if(_[_0x5c32('0x64')](_0x5020e8)){_0x51a58e[_0x5c32('0x62')][_0x5c32('0x56')]({'filename':'/var/spool/asterisk/monitor/'+_0x9510c[_0x5c32('0x63')](),'createdAt':moment()[_0x5c32('0x9')](_0x5c32('0x65')),'mixmonitorid':_0x3ce76e['mixmonitorid'],'status':_0x5c32('0x66')});}else{_0x5020e8[_0x5c32('0x67')]=_0x3ce76e[_0x5c32('0x67')];_0x5020e8[_0x5c32('0x68')]='rec';}_0xd6908({'code':0xc8,'message':[_0x29a1e6[_0x5c32('0x5c')],_0x5c32('0x69'),_0x3ce76e[_0x5c32('0x67')]][_0x5c32('0x1e')]('\x20'),'mixmonitorid':_0x3ce76e['mixmonitorid']});})['catch'](function(_0x2f563a){_0xc65e8b(_0x2365f9[_0x5c32('0x1c')](0x1f5,[_0x29a1e6[_0x5c32('0x5c')],_0x2f563a[_0x5c32('0x1d')][_0x5c32('0x63')]()]['join']('\x20')));});}else{return _0xc65e8b(_0x2365f9['error'](0x1f5,_0x5c32('0x6a')));}});},'VoiceChannelStopMixMonitor':function(_0x3ad03d){var _0x365c6a=this;return new Promise(function(_0x448c29,_0x2d0101){if(ami[_0x5c32('0x13')]()==![]){return _0x2d0101(_0x365c6a[_0x5c32('0x1c')](0x1f4,[config[_0x5c32('0x14')]['ip'],config[_0x5c32('0x14')]['username'],_0x5c32('0x16')][_0x5c32('0x1e')]('\x20')));}var _0x17bb32=schema(properties[_0x5c32('0x59')])[_0x5c32('0x3')](_0x3ad03d);if(_0x17bb32['length']>0x0){return _0x2d0101(_0x365c6a[_0x5c32('0x1c')](0x1f4,_[_0x5c32('0x5a')](_0x17bb32,_0x5c32('0x1d'))[_0x5c32('0x1e')](',\x20')));}var _0x1befdf=_[_0x5c32('0x5b')](_0xb4c19f[_0x5c32('0x58')],{'uniqueid':_0x3ad03d[_0x5c32('0x5c')]});if(_0x1befdf){return BPromise[_0x5c32('0x6b')]()[_0x5c32('0x1a')](function(){if(_0x1befdf[_0x5c32('0x5d')]){return ami[_0x5c32('0x21')]({'action':_0x5c32('0x6c'),'channel':_0x1befdf['channel'],'mixmonitorid':_0x3ad03d[_0x5c32('0x67')]})[_0x5c32('0x1b')](function(_0x2d7def){});}})[_0x5c32('0x1a')](function(){if(_0x1befdf['destinationchannel']){return ami[_0x5c32('0x21')]({'action':_0x5c32('0x6c'),'channel':_0x1befdf[_0x5c32('0x6d')],'mixmonitorid':_0x3ad03d[_0x5c32('0x67')]})[_0x5c32('0x1b')](function(_0x4e5e29){});}})[_0x5c32('0x1a')](function(_0x16d354){var _0x2761b0=_[_0x5c32('0x5b')](_0x1befdf[_0x5c32('0x62')],{'mixmonitorid':_0x3ad03d['mixmonitorid']});if(_0x2761b0){_0x2761b0[_0x5c32('0x68')]=_0x5c32('0x6e');}})['then'](function(){var _0x304326=util[_0x5c32('0x9')](_0x5c32('0x5e'),_0x3ad03d['filename']||_0x3ad03d[_0x5c32('0x5c')],_0x3ad03d[_0x5c32('0x9')]||'wav');var _0x58537a=_['find'](_0x1befdf['monitors'],{'filename':_0x5c32('0x6f')+_0x304326[_0x5c32('0x63')]()});if(_0x58537a){_0x58537a[_0x5c32('0x68')]=_0x5c32('0x6e');}})[_0x5c32('0x1a')](function(){_0x448c29({'code':0xc8,'message':[_0x3ad03d['uniqueid'],_0x5c32('0x70')][_0x5c32('0x1e')]('\x20')});})['catch'](function(_0x327d6e){_0x2d0101(_0x365c6a[_0x5c32('0x1c')](0x1f5,[_0x3ad03d[_0x5c32('0x5c')],_0x327d6e[_0x5c32('0x1d')]['toLowerCase']()]['join']('\x20')));});}else{return _0x2d0101(_0x365c6a['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x51406a){return new Promise(function(_0x41934f,_0xb1bc19){var _0xe13e57=_[_0x5c32('0x71')](_0xb4c19f['queueChannels']);_0x41934f({'count':_0xe13e57[_0x5c32('0x57')],'rows':_0xe13e57});});},'VoiceQueuesChannel':function(_0x181a46){var _0x518e2f=this;return new Promise(function(_0x234bff,_0x1d2ac8){var _0x4db62f=schema(properties['voicequeuechannel'])[_0x5c32('0x3')](_0x181a46);if(_0x4db62f[_0x5c32('0x57')]>0x0){return _0x1d2ac8(_0x518e2f[_0x5c32('0x1c')](0x1f4,_[_0x5c32('0x5a')](_0x4db62f,_0x5c32('0x1d'))[_0x5c32('0x1e')](',\x20')));}var _0x3759eb=_[_0x5c32('0x5b')](_0xb4c19f[_0x5c32('0x72')],{'uniqueid':_0x181a46[_0x5c32('0x5c')]});if(_0x3759eb){_0x234bff(_0x3759eb);}else{return _0x1d2ac8(_0x518e2f[_0x5c32('0x1c')](0x1f5,_0x5c32('0x6a')));}});},'VoiceQueuesChannelHangup':function(_0xc628a9){var _0x25478b=this;return new Promise(function(_0x429c51,_0x34d415){if(ami[_0x5c32('0x13')]()==![]){return _0x34d415(_0x25478b[_0x5c32('0x1c')](0x1f4,[config[_0x5c32('0x14')]['ip'],config[_0x5c32('0x14')][_0x5c32('0x15')],_0x5c32('0x16')][_0x5c32('0x1e')]('\x20')));}var _0x4df462=schema(properties['voicequeuechannelhangup'])[_0x5c32('0x3')](_0xc628a9);if(_0x4df462['length']>0x0){return _0x34d415(_0x25478b['error'](0x1f4,_['map'](_0x4df462,'message')[_0x5c32('0x1e')](',\x20')));}var _0x4c56f4=_['find'](_0xb4c19f['queueChannels'],{'uniqueid':_0xc628a9[_0x5c32('0x5c')]});if(_0x4c56f4&&_0x4c56f4[_0x5c32('0x5d')]){return ami[_0x5c32('0x21')]({'action':_0x5c32('0x73'),'channel':_0x4c56f4[_0x5c32('0x5d')]})[_0x5c32('0x1a')](function(_0x1a707a){_0x429c51({'code':0xc8,'message':[_0xc628a9[_0x5c32('0x5c')],_0x1a707a['message']['toLowerCase']()][_0x5c32('0x1e')]('\x20')});})['catch'](function(_0x4bcf07){_0x34d415(_0x25478b[_0x5c32('0x1c')](0x1f5,[_0xc628a9[_0x5c32('0x5c')],_0x4bcf07[_0x5c32('0x1d')]['toLowerCase']()][_0x5c32('0x1e')]('\x20')));});}else{return _0x34d415(_0x25478b[_0x5c32('0x1c')](0x1f5,_0x5c32('0x6a')));}});},'VoiceQueuesChannelRedirect':function(_0x38990d){var _0x4a24c8=this;return new Promise(function(_0x4f772f,_0x513630){if(ami[_0x5c32('0x13')]()==![]){return _0x513630(_0x4a24c8[_0x5c32('0x1c')](0x1f4,[config[_0x5c32('0x14')]['ip'],config['asterisk'][_0x5c32('0x15')],_0x5c32('0x16')]['join']('\x20')));}var _0x142c52=schema(properties[_0x5c32('0x74')])[_0x5c32('0x3')](_0x38990d);if(_0x142c52[_0x5c32('0x57')]>0x0){return _0x513630(_0x4a24c8[_0x5c32('0x1c')](0x1f4,_[_0x5c32('0x5a')](_0x142c52,_0x5c32('0x1d'))[_0x5c32('0x1e')](',\x20')));}var _0x4cea36=_[_0x5c32('0x5b')](_0xb4c19f['queueChannels'],{'uniqueid':_0x38990d[_0x5c32('0x5c')]});if(_0x4cea36&&_0x4cea36[_0x5c32('0x5d')]){return ami[_0x5c32('0x21')]({'action':_0x5c32('0x75'),'channel':_0x4cea36[_0x5c32('0x5d')],'exten':_0x38990d['exten'],'context':_0x38990d[_0x5c32('0x76')]||_0x4cea36['context'],'priority':0x1})[_0x5c32('0x1a')](function(_0x3bfeba){_0x4f772f({'code':0xc8,'message':[_0x38990d[_0x5c32('0x5c')],_0x3bfeba[_0x5c32('0x1d')][_0x5c32('0x63')]()][_0x5c32('0x1e')]('\x20')});})[_0x5c32('0x1b')](function(_0x3292ff){_0x513630(_0x4a24c8[_0x5c32('0x1c')](0x1f5,[_0x38990d['uniqueid'],_0x3292ff[_0x5c32('0x1d')][_0x5c32('0x63')]()]['join']('\x20')));});}else{return _0x513630(_0x4a24c8['error'](0x1f5,_0x5c32('0x6a')));}});},'Agents':function(_0x29818f){return new Promise(function(_0x200660,_0x1bd14){var _0x856ad4=_['values'](_0xb4c19f[_0x5c32('0xf')]);_0x200660({'count':_0x856ad4[_0x5c32('0x57')],'rows':_0x856ad4});});},'Telephones':function(_0x50ff8b){return new Promise(function(_0x13cd53,_0x5c86a0){var _0x48f06b=_[_0x5c32('0x71')](_0xb4c19f[_0x5c32('0x77')]);_0x13cd53({'count':_0x48f06b[_0x5c32('0x57')],'rows':_0x48f06b});});},'Trunks':function(_0x221e78){return new Promise(function(_0x3b61a3,_0x10ae74){var _0x44ba42=_[_0x5c32('0x71')](_0xb4c19f[_0x5c32('0x78')]);_0x3b61a3({'count':_0x44ba42[_0x5c32('0x57')],'rows':_0x44ba42});});},'OutboundChannels':function(_0x7eca83){return new Promise(function(_0x3e9b5b,_0x309d7e){var _0x1bb848=_[_0x5c32('0x71')](_0xb4c19f[_0x5c32('0x79')]);_0x3e9b5b({'count':_0x1bb848[_0x5c32('0x57')],'rows':_0x1bb848});});},'Outbound':function(_0x2067ba){return new Promise(function(_0x339164,_0x202e3c){_0x339164(_0xb4c19f[_0x5c32('0x2f')]);});},'Campaigns':function(_0x570ccf){return new Promise(function(_0x3ed355,_0x428b00){var _0x65f06=_['values'](_0xb4c19f[_0x5c32('0x7a')]);_0x3ed355({'count':_0x65f06[_0x5c32('0x57')],'rows':_0x65f06});});},'VoiceQueuesPreview':function(_0x81ed8f){var _0x1dc184=this;return new Promise(function(_0x2b819b,_0x35b3d4){_0x5c26ff[_0x5c32('0x7b')](_0x81ed8f['id'])['then'](function(_0x5abe67){_0x2b819b({'code':0xc8,'message':_0x5abe67['message']});})['catch'](function(_0xaa7bab){_0x35b3d4(_0x1dc184[_0x5c32('0x1c')](0x1f4,_0xaa7bab[_0x5c32('0x1d')]));});});},'EventManager':function(_0x1f817a){var _0x172aaa=this;return new Promise(function(_0x318c84,_0x314b38){if(!_0x1f817a['event']){return _0x314b38(_0x172aaa[_0x5c32('0x1c')](0x1f4,_0x5c32('0x7c')));}ami[_0x5c32('0x7d')](_0x5c32('0x7e')+_0x1f817a[_0x5c32('0x7f')],_0x1f817a[_0x5c32('0x1d')]);_0x318c84({'code':0xc8,'message':_0x1f817a});});},'FaxAccounts':function(_0x37eba8){return new Promise(function(_0x46162e,_0x401605){var _0xe21ce1=_[_0x5c32('0x71')](_0xb4c19f['faxAccounts']);_0x46162e({'count':_0xe21ce1[_0x5c32('0x57')],'rows':_0xe21ce1});});},'SendFax':function(_0x47d0f6){var _0x12f69c=this;return new Promise(function(_0x25892b,_0x337f3c){_0x3cfb4f['send'](_0x47d0f6)[_0x5c32('0x1a')](function(_0x140419){_0x25892b({'code':0xc8,'message':_0x140419['message']});})[_0x5c32('0x1b')](function(_0x50c043){_0x337f3c(_0x12f69c[_0x5c32('0x1c')](0x1f4,_0x50c043[_0x5c32('0x1d')]));});});},'CheckAfterSend':function(_0x465dca){var _0x1f2af3=this;return new Promise(function(_0x320c78,_0xfb6ca6){_0x3cfb4f[_0x5c32('0x80')](_0x465dca)[_0x5c32('0x1a')](function(_0x59068d){_0x320c78({'code':0xc8,'message':_0x59068d[_0x5c32('0x1d')]});})['catch'](function(_0x1c2bd2){_0xfb6ca6(_0x1f2af3[_0x5c32('0x1c')](0x1f4,_0x1c2bd2['message']));});});}};var _0x152ba8=jayson[_0x5c32('0x81')](_0x389b39)[_0x5c32('0x82')]();_0x152ba8['on']('error',function(_0x164404){return _0x4c021f(_0x164404);});_0x152ba8[_0x5c32('0x8')](0x232a,_0x5c32('0x83'),function(){console['log'](_0x5c32('0x84'),0x232a);return _0x2ecdee(_0x5c32('0x85')+0x232a);});});};
\ No newline at end of file