Built motion from commit (unavailable).|2.5.4
[motion2.git] / server / services / ami / server / index.js
index 5dff439..449f332 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ec9=['Hangup','voicequeuechannelredirect','exten','context','telephones','trunks','campaigns','run','event','emit','custom:','send','server','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','util','jayson/promise','validate','bluebird','moment','../ami','listen','format','%s/%s','SIP','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','username','join','pick','keys','action','catch','message','ami\x20disconnected','Command','then','content','voiceQueues','hasOwnProperty','name','strategy','answered','available','loggedIn','sumDuration','sumHoldTime','talking','type','unmanaged','abandoned','waiting','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startPredictive','startProgressive','Trunk','active','Interval','length','values','channels','voicechannel','map','uniqueid','channel','%s.%s','filename','wav','Action','MixMonitor','ai(mixmonitorid)','/var/spool/asterisk/monitor/','isNil','monitors','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','toLowerCase','Channel\x20doesn\x27t\x20exist','find','StopMixMonitor','stop','StopMixMonitor\x20Success','queueChannels','voicequeuechannelhangup'];(function(_0x2b85d5,_0x3115b7){var _0xe8c96f=function(_0x4bc25b){while(--_0x4bc25b){_0x2b85d5['push'](_0x2b85d5['shift']());}};_0xe8c96f(++_0x3115b7);}(_0x4ec9,0x113));var _0x94ec=function(_0x335d63,_0x5d8378){_0x335d63=_0x335d63-0x0;var _0x49bcda=_0x4ec9[_0x335d63];return _0x49bcda;};'use strict';var _=require('lodash');var util=require(_0x94ec('0x0'));var jayson=require(_0x94ec('0x1'));var schema=require(_0x94ec('0x2'));var BPromise=require(_0x94ec('0x3'));var moment=require(_0x94ec('0x4'));var config=require('../../../config/environment');var properties=require('../properties');var ami=require(_0x94ec('0x5'));exports[_0x94ec('0x6')]=function(_0x96b572,_0x5f3e21,_0x3e2d96){return new BPromise(function(_0x3c9465,_0x463d9f){var _0x396fe1={'QueuePause':function(_0x2c34f4){return new Promise(function(_0xd24560,_0x52ee74){var _0xe9009f=util[_0x94ec('0x7')](_0x94ec('0x8'),_0x94ec('0x9'),_0x2c34f4['name']);if(_0x96b572['timers']&&_0x96b572[_0x94ec('0xa')][_0xe9009f]&&_0x96b572[_0x94ec('0xa')][_0xe9009f][_0x94ec('0xb')]){_0x96b572[_0x94ec('0xa')][_0xe9009f][_0x94ec('0xc')]();}if(_0x96b572[_0x94ec('0xd')][_0xe9009f]){_0x96b572['agents'][_0xe9009f][_0x94ec('0xe')]({'statePause':_0x2c34f4[_0x94ec('0xf')]?!![]:![]});}_0xd24560({'code':0xc8,'message':_0x94ec('0x10')});});},'Reload':function(_0x1601ce){var _0x29fce4=this;return new Promise(function(_0x5e453b,_0x4bce05){if(ami[_0x94ec('0x11')]()==![]){return _0x4bce05(_0x29fce4[_0x94ec('0x12')](0x1f4,[config[_0x94ec('0x13')]['ip'],config[_0x94ec('0x13')][_0x94ec('0x14')],'ami\x20disconnected'][_0x94ec('0x15')]('\x20')));}_0x1601ce=_[_0x94ec('0x16')](_0x1601ce,_[_0x94ec('0x17')](properties['module']));_0x1601ce[_0x94ec('0x18')]='Reload';return ami['Action'](_0x1601ce)['then'](function(_0x4e12a8){_0x5e453b({'code':0xc8,'message':_0x4e12a8['message']});})[_0x94ec('0x19')](function(_0x57b6cc){_0x4bce05(_0x29fce4[_0x94ec('0x12')](0x1f5,_0x57b6cc[_0x94ec('0x1a')]));});});},'Command':function(_0x412a50){var _0x251601=this;return new Promise(function(_0x53f44e,_0x182c71){if(ami['isConnected']()==![]){return _0x182c71(_0x251601[_0x94ec('0x12')](0x1f4,[config[_0x94ec('0x13')]['ip'],config[_0x94ec('0x13')][_0x94ec('0x14')],_0x94ec('0x1b')][_0x94ec('0x15')]('\x20')));}_0x412a50=_[_0x94ec('0x16')](_0x412a50,'command');_0x412a50[_0x94ec('0x18')]=_0x94ec('0x1c');return ami['Action'](_0x412a50)[_0x94ec('0x1d')](function(_0xc38ad5){_0x53f44e({'code':0xc8,'message':_0xc38ad5[_0x94ec('0x1e')]});})[_0x94ec('0x19')](function(_0x166c4c){_0x182c71(_0x251601['error'](0x1f5,_0x166c4c['message']));});});},'VoiceQueues':function(_0x54ad41){return new Promise(function(_0x298547,_0x2de64e){var _0x1fd88f=[];for(var _0x5c81ac in _0x96b572[_0x94ec('0x1f')]){if(_0x96b572[_0x94ec('0x1f')][_0x94ec('0x20')](_0x5c81ac)){var _0x103f81=_0x96b572[_0x94ec('0x1f')][_0x5c81ac];var _0x34d689={'id':_0x103f81['id'],'name':_0x103f81[_0x94ec('0x21')],'strategy':_0x103f81[_0x94ec('0x22')],'answered':_0x103f81[_0x94ec('0x23')],'available':_0x103f81[_0x94ec('0x24')],'loggedIn':_0x103f81[_0x94ec('0x25')],'pTalking':_0x103f81['pTalking'],'sumBillable':_0x103f81['sumBillable'],'sumDuration':_0x103f81[_0x94ec('0x26')],'sumHoldTime':_0x103f81[_0x94ec('0x27')]||0x0,'talking':_0x103f81[_0x94ec('0x28')],'total':_0x103f81['total'],'type':_0x103f81[_0x94ec('0x29')],'unmanaged':_0x103f81[_0x94ec('0x2a')],'abandoned':_0x103f81[_0x94ec('0x2b')],'waiting':_0x103f81[_0x94ec('0x2c')],'loggedInDb':_0x103f81['loggedInDb']};if(_0x103f81[_0x94ec('0x29')]==='outbound'){_0x34d689['dialActive']=_0x103f81[_0x94ec('0x2d')];_0x34d689[_0x94ec('0x2e')]=_0x103f81[_0x94ec('0x2e')];_0x34d689[_0x94ec('0x2f')]=_0x103f81[_0x94ec('0x2f')];_0x34d689[_0x94ec('0x30')]=_0x103f81[_0x94ec('0x30')];_0x34d689[_0x94ec('0x31')]=_0x103f81[_0x94ec('0x31')];_0x34d689[_0x94ec('0x32')]=_0x103f81[_0x94ec('0x32')];_0x34d689[_0x94ec('0x33')]=_0x103f81[_0x94ec('0x33')];_0x34d689[_0x94ec('0x34')]=_0x103f81[_0x94ec('0x34')];_0x34d689[_0x94ec('0x35')]=_0x103f81[_0x94ec('0x35')];_0x34d689[_0x94ec('0x36')]=_0x103f81[_0x94ec('0x36')];_0x34d689[_0x94ec('0x37')]=_0x103f81['outboundCongestionCallsDay'];_0x34d689[_0x94ec('0x38')]=_0x103f81[_0x94ec('0x38')];_0x34d689[_0x94ec('0x39')]=_0x103f81[_0x94ec('0x39')];_0x34d689[_0x94ec('0x3a')]=_0x103f81[_0x94ec('0x3a')];_0x34d689[_0x94ec('0x3b')]=_0x103f81[_0x94ec('0x3b')];_0x34d689[_0x94ec('0x3c')]=_0x103f81[_0x94ec('0x3c')];_0x34d689['outboundOriginateFailureCallsDay']=_0x103f81['outboundOriginateFailureCallsDay'];_0x34d689[_0x94ec('0x3d')]=_0x103f81['outboundReCallsDay'];_0x34d689[_0x94ec('0x3e')]=_0x103f81[_0x94ec('0x3e')];_0x34d689[_0x94ec('0x3f')]=_0x103f81[_0x94ec('0x3f')];_0x34d689[_0x94ec('0x40')]=_0x103f81[_0x94ec('0x40')];_0x34d689['predictiveIntervalAvgHoldtime']=_0x103f81[_0x94ec('0x41')];_0x34d689[_0x94ec('0x42')]=_0x103f81[_0x94ec('0x42')];_0x34d689[_0x94ec('0x43')]=_0x103f81[_0x94ec('0x43')];_0x34d689[_0x94ec('0x44')]=_0x103f81[_0x94ec('0x44')];_0x34d689['predictiveIntervalErlangCalls']=_0x103f81[_0x94ec('0x45')];_0x34d689[_0x94ec('0x46')]=_0x103f81[_0x94ec('0x46')];_0x34d689['predictiveIntervalHitRate']=_0x103f81['predictiveIntervalHitRate'];_0x34d689['predictiveIntervalMultiplicativeFactor']=_0x103f81[_0x94ec('0x47')];_0x34d689[_0x94ec('0x48')]=_0x103f81[_0x94ec('0x48')];_0x34d689[_0x94ec('0x49')]=_0x103f81['predictiveIntervalAvailable'];_0x34d689[_0x94ec('0x4a')]=_0x103f81['predictiveIntervalTotalCalls'];_0x34d689['message']=_0x103f81[_0x94ec('0x1a')];_0x34d689[_0x94ec('0x4b')]=_0x103f81[_0x94ec('0x4b')];_0x34d689['erlangCalls']=_0x103f81[_0x94ec('0x4c')];_0x34d689[_0x94ec('0x4d')]=_0x103f81[_0x94ec('0x4d')];_0x34d689[_0x94ec('0x4e')]=_0x103f81['erlangAbandonmentRate'];_0x34d689['erlangBusyFactor']=_0x103f81['erlangBusyFactor'];_0x34d689['startPredictive']=_0x103f81[_0x94ec('0x4f')];_0x34d689[_0x94ec('0x50')]=_0x103f81[_0x94ec('0x50')];}if(_0x103f81[_0x94ec('0x51')]){_0x34d689[_0x94ec('0x51')]={'id':_0x103f81['Trunk']['id'],'name':_0x103f81[_0x94ec('0x51')][_0x94ec('0x21')],'active':_0x103f81[_0x94ec('0x51')][_0x94ec('0x52')],'callerid':_0x103f81['Trunk']['callerid']};}if(_0x103f81['Interval']){_0x34d689['Interval']={'id':_0x103f81[_0x94ec('0x53')]['id'],'name':_0x103f81[_0x94ec('0x53')]['name']};}_0x1fd88f['push'](_0x34d689);}}_0x298547({'count':_0x1fd88f[_0x94ec('0x54')],'rows':_0x1fd88f});});},'VoiceChannels':function(_0xeff0d2){return new Promise(function(_0x27a112,_0x2ebf34){var _0x1cc348=_[_0x94ec('0x55')](_0x96b572[_0x94ec('0x56')]);_0x27a112({'count':_0x1cc348['length'],'rows':_0x1cc348});});},'VoiceChannelMixMonitor':function(_0xec6aea){var _0x8cdd3e=this;return new Promise(function(_0x44b179,_0x38180b){if(ami[_0x94ec('0x11')]()==![]){return _0x38180b(_0x8cdd3e[_0x94ec('0x12')](0x1f4,[config[_0x94ec('0x13')]['ip'],config[_0x94ec('0x13')][_0x94ec('0x14')],_0x94ec('0x1b')]['join']('\x20')));}var _0x4a9a68=schema(properties[_0x94ec('0x57')])[_0x94ec('0x2')](_0xec6aea);if(_0x4a9a68[_0x94ec('0x54')]>0x0){return _0x38180b(_0x8cdd3e[_0x94ec('0x12')](0x1f4,_[_0x94ec('0x58')](_0x4a9a68,'message')['join'](',\x20')));}var _0x32c34a=_['find'](_0x96b572[_0x94ec('0x56')],{'uniqueid':_0xec6aea[_0x94ec('0x59')]});if(_0x32c34a&&_0x32c34a[_0x94ec('0x5a')]){var _0x38be86=util[_0x94ec('0x7')](_0x94ec('0x5b'),_0xec6aea[_0x94ec('0x5c')]||_0xec6aea['uniqueid'],_0xec6aea[_0x94ec('0x7')]||_0x94ec('0x5d'));return ami[_0x94ec('0x5e')]({'action':_0x94ec('0x5f'),'channel':_0x32c34a['channel'],'file':_0x38be86,'options':_0x94ec('0x60')})[_0x94ec('0x1d')](function(_0x4766c6){var _0xd39c88=_['find'](_0x32c34a['monitors'],{'filename':_0x94ec('0x61')+_0x38be86['toLowerCase']()});if(_[_0x94ec('0x62')](_0xd39c88)){_0x32c34a[_0x94ec('0x63')]['push']({'filename':_0x94ec('0x61')+_0x38be86['toLowerCase'](),'createdAt':moment()[_0x94ec('0x7')](_0x94ec('0x64')),'mixmonitorid':_0x4766c6[_0x94ec('0x65')],'status':_0x94ec('0x66')});}else{_0xd39c88[_0x94ec('0x65')]=_0x4766c6['mixmonitorid'];_0xd39c88[_0x94ec('0x67')]='rec';}_0x44b179({'code':0xc8,'message':[_0xec6aea[_0x94ec('0x59')],'MixMonitor\x20Success',_0x4766c6['mixmonitorid']][_0x94ec('0x15')]('\x20'),'mixmonitorid':_0x4766c6[_0x94ec('0x65')]});})[_0x94ec('0x19')](function(_0x27b948){_0x38180b(_0x8cdd3e[_0x94ec('0x12')](0x1f5,[_0xec6aea[_0x94ec('0x59')],_0x27b948[_0x94ec('0x1a')][_0x94ec('0x68')]()][_0x94ec('0x15')]('\x20')));});}else{return _0x38180b(_0x8cdd3e[_0x94ec('0x12')](0x1f5,_0x94ec('0x69')));}});},'VoiceChannelStopMixMonitor':function(_0x4cabb9){var _0x229bad=this;return new Promise(function(_0x430393,_0x5786a8){if(ami[_0x94ec('0x11')]()==![]){return _0x5786a8(_0x229bad[_0x94ec('0x12')](0x1f4,[config[_0x94ec('0x13')]['ip'],config[_0x94ec('0x13')][_0x94ec('0x14')],_0x94ec('0x1b')][_0x94ec('0x15')]('\x20')));}var _0x18a8e8=schema(properties[_0x94ec('0x57')])['validate'](_0x4cabb9);if(_0x18a8e8[_0x94ec('0x54')]>0x0){return _0x5786a8(_0x229bad[_0x94ec('0x12')](0x1f4,_[_0x94ec('0x58')](_0x18a8e8,_0x94ec('0x1a'))['join'](',\x20')));}var _0x47dd9e=_[_0x94ec('0x6a')](_0x96b572[_0x94ec('0x56')],{'uniqueid':_0x4cabb9['uniqueid']});if(_0x47dd9e){return BPromise['resolve']()[_0x94ec('0x1d')](function(){if(_0x47dd9e['channel']){return ami[_0x94ec('0x5e')]({'action':'StopMixMonitor','channel':_0x47dd9e['channel'],'mixmonitorid':_0x4cabb9['mixmonitorid']})[_0x94ec('0x19')](function(_0xbf3b41){});}})['then'](function(){if(_0x47dd9e['destinationchannel']){return ami['Action']({'action':_0x94ec('0x6b'),'channel':_0x47dd9e['destinationchannel'],'mixmonitorid':_0x4cabb9[_0x94ec('0x65')]})[_0x94ec('0x19')](function(_0x3b324){});}})[_0x94ec('0x1d')](function(_0x3deda5){var _0x29bdcf=_[_0x94ec('0x6a')](_0x47dd9e['monitors'],{'mixmonitorid':_0x4cabb9[_0x94ec('0x65')]});if(_0x29bdcf){_0x29bdcf[_0x94ec('0x67')]=_0x94ec('0x6c');}})[_0x94ec('0x1d')](function(){var _0x311efe=util[_0x94ec('0x7')](_0x94ec('0x5b'),_0x4cabb9[_0x94ec('0x5c')]||_0x4cabb9[_0x94ec('0x59')],_0x4cabb9[_0x94ec('0x7')]||'wav');var _0x345f1c=_[_0x94ec('0x6a')](_0x47dd9e['monitors'],{'filename':_0x94ec('0x61')+_0x311efe['toLowerCase']()});if(_0x345f1c){_0x345f1c['status']=_0x94ec('0x6c');}})['then'](function(){_0x430393({'code':0xc8,'message':[_0x4cabb9['uniqueid'],_0x94ec('0x6d')][_0x94ec('0x15')]('\x20')});})[_0x94ec('0x19')](function(_0x533d9a){_0x5786a8(_0x229bad[_0x94ec('0x12')](0x1f5,[_0x4cabb9[_0x94ec('0x59')],_0x533d9a[_0x94ec('0x1a')][_0x94ec('0x68')]()][_0x94ec('0x15')]('\x20')));});}else{return _0x5786a8(_0x229bad[_0x94ec('0x12')](0x1f5,_0x94ec('0x69')));}});},'VoiceQueuesChannels':function(_0x15b04e){return new Promise(function(_0x42b0bd,_0x2674ee){var _0x3d146a=_['values'](_0x96b572[_0x94ec('0x6e')]);_0x42b0bd({'count':_0x3d146a[_0x94ec('0x54')],'rows':_0x3d146a});});},'VoiceQueuesChannel':function(_0x34dac2){var _0x1facf9=this;return new Promise(function(_0x5ada7e,_0x20f2ad){var _0x5c19e7=schema(properties['voicequeuechannel'])[_0x94ec('0x2')](_0x34dac2);if(_0x5c19e7[_0x94ec('0x54')]>0x0){return _0x20f2ad(_0x1facf9['error'](0x1f4,_[_0x94ec('0x58')](_0x5c19e7,_0x94ec('0x1a'))[_0x94ec('0x15')](',\x20')));}var _0x3976f3=_[_0x94ec('0x6a')](_0x96b572[_0x94ec('0x6e')],{'uniqueid':_0x34dac2[_0x94ec('0x59')]});if(_0x3976f3){_0x5ada7e(_0x3976f3);}else{return _0x20f2ad(_0x1facf9[_0x94ec('0x12')](0x1f5,_0x94ec('0x69')));}});},'VoiceQueuesChannelHangup':function(_0x9005e4){var _0x16abb8=this;return new Promise(function(_0x2102d9,_0x518b79){if(ami[_0x94ec('0x11')]()==![]){return _0x518b79(_0x16abb8[_0x94ec('0x12')](0x1f4,[config[_0x94ec('0x13')]['ip'],config[_0x94ec('0x13')][_0x94ec('0x14')],_0x94ec('0x1b')][_0x94ec('0x15')]('\x20')));}var _0x5640a4=schema(properties[_0x94ec('0x6f')])[_0x94ec('0x2')](_0x9005e4);if(_0x5640a4[_0x94ec('0x54')]>0x0){return _0x518b79(_0x16abb8['error'](0x1f4,_[_0x94ec('0x58')](_0x5640a4,_0x94ec('0x1a'))[_0x94ec('0x15')](',\x20')));}var _0x44a91e=_[_0x94ec('0x6a')](_0x96b572['queueChannels'],{'uniqueid':_0x9005e4[_0x94ec('0x59')]});if(_0x44a91e&&_0x44a91e[_0x94ec('0x5a')]){return ami['Action']({'action':_0x94ec('0x70'),'channel':_0x44a91e['channel']})[_0x94ec('0x1d')](function(_0x5dd39e){_0x2102d9({'code':0xc8,'message':[_0x9005e4[_0x94ec('0x59')],_0x5dd39e[_0x94ec('0x1a')][_0x94ec('0x68')]()][_0x94ec('0x15')]('\x20')});})[_0x94ec('0x19')](function(_0x15d2d7){_0x518b79(_0x16abb8[_0x94ec('0x12')](0x1f5,[_0x9005e4['uniqueid'],_0x15d2d7[_0x94ec('0x1a')][_0x94ec('0x68')]()]['join']('\x20')));});}else{return _0x518b79(_0x16abb8[_0x94ec('0x12')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x458d6e){var _0x1f562c=this;return new Promise(function(_0x38b3b8,_0x36fea3){if(ami[_0x94ec('0x11')]()==![]){return _0x36fea3(_0x1f562c[_0x94ec('0x12')](0x1f4,[config[_0x94ec('0x13')]['ip'],config[_0x94ec('0x13')]['username'],_0x94ec('0x1b')][_0x94ec('0x15')]('\x20')));}var _0x3bf996=schema(properties[_0x94ec('0x71')])[_0x94ec('0x2')](_0x458d6e);if(_0x3bf996['length']>0x0){return _0x36fea3(_0x1f562c[_0x94ec('0x12')](0x1f4,_[_0x94ec('0x58')](_0x3bf996,'message')[_0x94ec('0x15')](',\x20')));}var _0x49fba1=_[_0x94ec('0x6a')](_0x96b572[_0x94ec('0x6e')],{'uniqueid':_0x458d6e[_0x94ec('0x59')]});if(_0x49fba1&&_0x49fba1['channel']){return ami[_0x94ec('0x5e')]({'action':'Redirect','channel':_0x49fba1['channel'],'exten':_0x458d6e[_0x94ec('0x72')],'context':_0x458d6e[_0x94ec('0x73')]||_0x49fba1['context'],'priority':0x1})[_0x94ec('0x1d')](function(_0x462638){_0x38b3b8({'code':0xc8,'message':[_0x458d6e[_0x94ec('0x59')],_0x462638['message'][_0x94ec('0x68')]()][_0x94ec('0x15')]('\x20')});})[_0x94ec('0x19')](function(_0xc57940){_0x36fea3(_0x1f562c[_0x94ec('0x12')](0x1f5,[_0x458d6e[_0x94ec('0x59')],_0xc57940[_0x94ec('0x1a')][_0x94ec('0x68')]()][_0x94ec('0x15')]('\x20')));});}else{return _0x36fea3(_0x1f562c[_0x94ec('0x12')](0x1f5,_0x94ec('0x69')));}});},'Agents':function(_0xa65219){return new Promise(function(_0x5b31c4,_0x394c56){var _0xe8c2b1=_[_0x94ec('0x55')](_0x96b572[_0x94ec('0xd')]);_0x5b31c4({'count':_0xe8c2b1[_0x94ec('0x54')],'rows':_0xe8c2b1});});},'Telephones':function(_0x41bfa2){return new Promise(function(_0x3912e9,_0x4e6d51){var _0x4b5a2a=_[_0x94ec('0x55')](_0x96b572[_0x94ec('0x74')]);_0x3912e9({'count':_0x4b5a2a[_0x94ec('0x54')],'rows':_0x4b5a2a});});},'Trunks':function(_0xf78186){return new Promise(function(_0xc0f3f2,_0x4aee2f){var _0x59e093=_[_0x94ec('0x55')](_0x96b572[_0x94ec('0x75')]);_0xc0f3f2({'count':_0x59e093[_0x94ec('0x54')],'rows':_0x59e093});});},'OutboundChannels':function(_0x1c5888){return new Promise(function(_0x333aff,_0xfa0938){var _0x5521fa=_[_0x94ec('0x55')](_0x96b572['outboundChannels']);_0x333aff({'count':_0x5521fa[_0x94ec('0x54')],'rows':_0x5521fa});});},'Outbound':function(_0x58bba5){return new Promise(function(_0x153371,_0x5f5ca0){_0x153371(_0x96b572['outbound']);});},'Campaigns':function(_0x458edc){return new Promise(function(_0x349267,_0x4bfc04){var _0x3f819f=_[_0x94ec('0x55')](_0x96b572[_0x94ec('0x76')]);_0x349267({'count':_0x3f819f[_0x94ec('0x54')],'rows':_0x3f819f});});},'VoiceQueuesPreview':function(_0x304851){var _0xf5f87c=this;return new Promise(function(_0x581e4b,_0x4d5e25){_0x5f3e21[_0x94ec('0x77')](_0x304851['id'])[_0x94ec('0x1d')](function(_0x135acb){_0x581e4b({'code':0xc8,'message':_0x135acb[_0x94ec('0x1a')]});})[_0x94ec('0x19')](function(_0x5201fe){_0x4d5e25(_0xf5f87c[_0x94ec('0x12')](0x1f4,_0x5201fe['message']));});});},'EventManager':function(_0x27a46d){var _0x3fd288=this;return new Promise(function(_0x4bb354,_0x548ef3){if(!_0x27a46d[_0x94ec('0x78')]){return _0x548ef3(_0x3fd288[_0x94ec('0x12')](0x1f4,'Event\x20name\x20mandatory'));}ami[_0x94ec('0x79')](_0x94ec('0x7a')+_0x27a46d['event'],_0x27a46d['message']);_0x4bb354({'code':0xc8,'message':_0x27a46d});});},'FaxAccounts':function(_0x84971a){return new Promise(function(_0x291610,_0x4e499d){var _0x4f3b0f=_[_0x94ec('0x55')](_0x96b572['faxAccounts']);_0x291610({'count':_0x4f3b0f[_0x94ec('0x54')],'rows':_0x4f3b0f});});},'SendFax':function(_0x5d1361){var _0x1e1023=this;return new Promise(function(_0x2549a6,_0x240106){_0x3e2d96[_0x94ec('0x7b')](_0x5d1361)['then'](function(_0x14d628){_0x2549a6({'code':0xc8,'message':_0x14d628[_0x94ec('0x1a')]});})[_0x94ec('0x19')](function(_0x446c2e){_0x240106(_0x1e1023[_0x94ec('0x12')](0x1f4,_0x446c2e['message']));});});},'CheckAfterSend':function(_0x42edac){var _0x2846d4=this;return new Promise(function(_0x5c4228,_0x5da124){_0x3e2d96['checkAfterSend'](_0x42edac)[_0x94ec('0x1d')](function(_0x10971d){_0x5c4228({'code':0xc8,'message':_0x10971d[_0x94ec('0x1a')]});})[_0x94ec('0x19')](function(_0x29bb7d){_0x5da124(_0x2846d4[_0x94ec('0x12')](0x1f4,_0x29bb7d[_0x94ec('0x1a')]));});});}};var _0x26cfdb=jayson[_0x94ec('0x7c')](_0x396fe1)[_0x94ec('0x7d')]();_0x26cfdb['on']('error',function(_0x851022){return _0x463d9f(_0x851022);});_0x26cfdb[_0x94ec('0x6')](0x232a,_0x94ec('0x7e'),function(){console[_0x94ec('0x7f')](_0x94ec('0x80'),0x232a);return _0x3c9465('RPC\x20listening\x20on\x20port:'+0x232a);});});};
\ No newline at end of file
+var _0x5a1e=['Trunk','active','callerid','Interval','push','length','values','channels','map','find','uniqueid','format','%s.%s','filename','wav','MixMonitor','channel','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','voicechannel','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','context','outboundChannels','campaigns','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','send','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','bluebird','../../../config/environment','../ami','listen','%s/%s','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','pick','keys','module','Reload','Action','then','message','catch','join','command','action','content','voiceQueues','hasOwnProperty','strategy','answered','available','loggedIn','sumBillable','sumDuration','sumHoldTime','total','type','unmanaged','abandoned','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','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'];(function(_0x268352,_0x3bfe67){var _0x80a285=function(_0x5a780d){while(--_0x5a780d){_0x268352['push'](_0x268352['shift']());}};_0x80a285(++_0x3bfe67);}(_0x5a1e,0xc7));var _0xe5a1=function(_0x4f75a3,_0x2c4ec4){_0x4f75a3=_0x4f75a3-0x0;var _0x45ca11=_0x5a1e[_0x4f75a3];return _0x45ca11;};'use strict';var _=require(_0xe5a1('0x0'));var util=require(_0xe5a1('0x1'));var jayson=require(_0xe5a1('0x2'));var schema=require(_0xe5a1('0x3'));var BPromise=require(_0xe5a1('0x4'));var moment=require('moment');var config=require(_0xe5a1('0x5'));var properties=require('../properties');var ami=require(_0xe5a1('0x6'));exports[_0xe5a1('0x7')]=function(_0x13f6d9,_0x3d3541,_0x3cb774){return new BPromise(function(_0x5531b3,_0x2669c0){var _0x8d5f9d={'QueuePause':function(_0x34f893){return new Promise(function(_0x11ccd1,_0x50b244){var _0x9c7d4d=util['format'](_0xe5a1('0x8'),_0xe5a1('0x9'),_0x34f893[_0xe5a1('0xa')]);if(_0x13f6d9[_0xe5a1('0xb')]&&_0x13f6d9['timers'][_0x9c7d4d]&&_0x13f6d9[_0xe5a1('0xb')][_0x9c7d4d][_0xe5a1('0xc')]){_0x13f6d9['timers'][_0x9c7d4d][_0xe5a1('0xd')]();}if(_0x13f6d9[_0xe5a1('0xe')][_0x9c7d4d]){_0x13f6d9[_0xe5a1('0xe')][_0x9c7d4d][_0xe5a1('0xf')]({'statePause':_0x34f893[_0xe5a1('0x10')]?!![]:![]});}_0x11ccd1({'code':0xc8,'message':_0xe5a1('0x11')});});},'Reload':function(_0x1fbdf4){var _0x2d4194=this;return new Promise(function(_0x4decaa,_0x35e588){if(ami[_0xe5a1('0x12')]()==![]){return _0x35e588(_0x2d4194[_0xe5a1('0x13')](0x1f4,[config['asterisk']['ip'],config[_0xe5a1('0x14')][_0xe5a1('0x15')],_0xe5a1('0x16')]['join']('\x20')));}_0x1fbdf4=_[_0xe5a1('0x17')](_0x1fbdf4,_[_0xe5a1('0x18')](properties[_0xe5a1('0x19')]));_0x1fbdf4['action']=_0xe5a1('0x1a');return ami[_0xe5a1('0x1b')](_0x1fbdf4)[_0xe5a1('0x1c')](function(_0x57a0f8){_0x4decaa({'code':0xc8,'message':_0x57a0f8[_0xe5a1('0x1d')]});})[_0xe5a1('0x1e')](function(_0x4c4824){_0x35e588(_0x2d4194[_0xe5a1('0x13')](0x1f5,_0x4c4824[_0xe5a1('0x1d')]));});});},'Command':function(_0x49a8b9){var _0x603586=this;return new Promise(function(_0x7b7e5d,_0x2afedc){if(ami[_0xe5a1('0x12')]()==![]){return _0x2afedc(_0x603586['error'](0x1f4,[config[_0xe5a1('0x14')]['ip'],config[_0xe5a1('0x14')]['username'],'ami\x20disconnected'][_0xe5a1('0x1f')]('\x20')));}_0x49a8b9=_[_0xe5a1('0x17')](_0x49a8b9,_0xe5a1('0x20'));_0x49a8b9[_0xe5a1('0x21')]='Command';return ami[_0xe5a1('0x1b')](_0x49a8b9)['then'](function(_0x29e712){_0x7b7e5d({'code':0xc8,'message':_0x29e712[_0xe5a1('0x22')]});})[_0xe5a1('0x1e')](function(_0x4ee69d){_0x2afedc(_0x603586['error'](0x1f5,_0x4ee69d[_0xe5a1('0x1d')]));});});},'VoiceQueues':function(_0x24ee23){return new Promise(function(_0x2a1619,_0x27a378){var _0x531145=[];for(var _0x463733 in _0x13f6d9[_0xe5a1('0x23')]){if(_0x13f6d9['voiceQueues'][_0xe5a1('0x24')](_0x463733)){var _0x3d2fe4=_0x13f6d9[_0xe5a1('0x23')][_0x463733];var _0x205f32={'id':_0x3d2fe4['id'],'name':_0x3d2fe4[_0xe5a1('0xa')],'strategy':_0x3d2fe4[_0xe5a1('0x25')],'answered':_0x3d2fe4[_0xe5a1('0x26')],'available':_0x3d2fe4[_0xe5a1('0x27')],'loggedIn':_0x3d2fe4[_0xe5a1('0x28')],'pTalking':_0x3d2fe4['pTalking'],'sumBillable':_0x3d2fe4[_0xe5a1('0x29')],'sumDuration':_0x3d2fe4[_0xe5a1('0x2a')],'sumHoldTime':_0x3d2fe4[_0xe5a1('0x2b')]||0x0,'talking':_0x3d2fe4['talking'],'total':_0x3d2fe4[_0xe5a1('0x2c')],'type':_0x3d2fe4[_0xe5a1('0x2d')],'unmanaged':_0x3d2fe4[_0xe5a1('0x2e')],'abandoned':_0x3d2fe4[_0xe5a1('0x2f')],'waiting':_0x3d2fe4[_0xe5a1('0x30')],'loggedInDb':_0x3d2fe4[_0xe5a1('0x31')]};if(_0x3d2fe4[_0xe5a1('0x2d')]===_0xe5a1('0x32')){_0x205f32['dialActive']=_0x3d2fe4[_0xe5a1('0x33')];_0x205f32['dialMethod']=_0x3d2fe4[_0xe5a1('0x34')];_0x205f32[_0xe5a1('0x35')]=_0x3d2fe4[_0xe5a1('0x35')];_0x205f32['dialOriginateCallerIdNumber']=_0x3d2fe4[_0xe5a1('0x36')];_0x205f32['dialOriginateTimeout']=_0x3d2fe4['dialOriginateTimeout'];_0x205f32[_0xe5a1('0x37')]=_0x3d2fe4[_0xe5a1('0x37')];_0x205f32[_0xe5a1('0x38')]=_0x3d2fe4['outboundAnswerAgiCallsDay'];_0x205f32[_0xe5a1('0x39')]=_0x3d2fe4[_0xe5a1('0x39')];_0x205f32[_0xe5a1('0x3a')]=_0x3d2fe4[_0xe5a1('0x3a')];_0x205f32[_0xe5a1('0x3b')]=_0x3d2fe4[_0xe5a1('0x3b')];_0x205f32['outboundCongestionCallsDay']=_0x3d2fe4[_0xe5a1('0x3c')];_0x205f32[_0xe5a1('0x3d')]=_0x3d2fe4['outboundDropCallsDayACS'];_0x205f32[_0xe5a1('0x3e')]=_0x3d2fe4[_0xe5a1('0x3e')];_0x205f32[_0xe5a1('0x3f')]=_0x3d2fe4[_0xe5a1('0x3f')];_0x205f32[_0xe5a1('0x40')]=_0x3d2fe4['outboundNoAnswerCallsDay'];_0x205f32[_0xe5a1('0x41')]=_0x3d2fe4['outboundNoSuchCallsDay'];_0x205f32[_0xe5a1('0x42')]=_0x3d2fe4[_0xe5a1('0x42')];_0x205f32[_0xe5a1('0x43')]=_0x3d2fe4[_0xe5a1('0x43')];_0x205f32[_0xe5a1('0x44')]=_0x3d2fe4[_0xe5a1('0x44')];_0x205f32[_0xe5a1('0x45')]=_0x3d2fe4[_0xe5a1('0x45')];_0x205f32[_0xe5a1('0x46')]=_0x3d2fe4[_0xe5a1('0x46')];_0x205f32[_0xe5a1('0x47')]=_0x3d2fe4[_0xe5a1('0x47')];_0x205f32[_0xe5a1('0x48')]=_0x3d2fe4[_0xe5a1('0x48')];_0x205f32[_0xe5a1('0x49')]=_0x3d2fe4[_0xe5a1('0x49')];_0x205f32[_0xe5a1('0x4a')]=_0x3d2fe4[_0xe5a1('0x4a')];_0x205f32['predictiveIntervalErlangCalls']=_0x3d2fe4[_0xe5a1('0x4b')];_0x205f32[_0xe5a1('0x4c')]=_0x3d2fe4[_0xe5a1('0x4c')];_0x205f32[_0xe5a1('0x4d')]=_0x3d2fe4[_0xe5a1('0x4d')];_0x205f32[_0xe5a1('0x4e')]=_0x3d2fe4[_0xe5a1('0x4e')];_0x205f32[_0xe5a1('0x4f')]=_0x3d2fe4[_0xe5a1('0x4f')];_0x205f32['predictiveIntervalAvailable']=_0x3d2fe4[_0xe5a1('0x50')];_0x205f32['predictiveIntervalTotalCalls']=_0x3d2fe4[_0xe5a1('0x51')];_0x205f32[_0xe5a1('0x1d')]=_0x3d2fe4[_0xe5a1('0x1d')];_0x205f32[_0xe5a1('0x52')]=_0x3d2fe4[_0xe5a1('0x52')];_0x205f32[_0xe5a1('0x53')]=_0x3d2fe4['erlangCalls'];_0x205f32[_0xe5a1('0x54')]=_0x3d2fe4[_0xe5a1('0x54')];_0x205f32[_0xe5a1('0x55')]=_0x3d2fe4[_0xe5a1('0x55')];_0x205f32[_0xe5a1('0x56')]=_0x3d2fe4[_0xe5a1('0x56')];_0x205f32[_0xe5a1('0x57')]=_0x3d2fe4['startPredictive'];_0x205f32[_0xe5a1('0x58')]=_0x3d2fe4['startProgressive'];}if(_0x3d2fe4[_0xe5a1('0x59')]){_0x205f32['Trunk']={'id':_0x3d2fe4[_0xe5a1('0x59')]['id'],'name':_0x3d2fe4[_0xe5a1('0x59')][_0xe5a1('0xa')],'active':_0x3d2fe4[_0xe5a1('0x59')][_0xe5a1('0x5a')],'callerid':_0x3d2fe4[_0xe5a1('0x59')][_0xe5a1('0x5b')]};}if(_0x3d2fe4[_0xe5a1('0x5c')]){_0x205f32[_0xe5a1('0x5c')]={'id':_0x3d2fe4[_0xe5a1('0x5c')]['id'],'name':_0x3d2fe4[_0xe5a1('0x5c')][_0xe5a1('0xa')]};}_0x531145[_0xe5a1('0x5d')](_0x205f32);}}_0x2a1619({'count':_0x531145[_0xe5a1('0x5e')],'rows':_0x531145});});},'VoiceChannels':function(_0x3f9410){return new Promise(function(_0xd3292,_0x21b141){var _0x233ead=_[_0xe5a1('0x5f')](_0x13f6d9[_0xe5a1('0x60')]);_0xd3292({'count':_0x233ead[_0xe5a1('0x5e')],'rows':_0x233ead});});},'VoiceChannelMixMonitor':function(_0x38c1c8){var _0x20e803=this;return new Promise(function(_0x295695,_0x234b19){if(ami[_0xe5a1('0x12')]()==![]){return _0x234b19(_0x20e803[_0xe5a1('0x13')](0x1f4,[config['asterisk']['ip'],config[_0xe5a1('0x14')]['username'],_0xe5a1('0x16')][_0xe5a1('0x1f')]('\x20')));}var _0x5c32e=schema(properties['voicechannel'])[_0xe5a1('0x3')](_0x38c1c8);if(_0x5c32e[_0xe5a1('0x5e')]>0x0){return _0x234b19(_0x20e803[_0xe5a1('0x13')](0x1f4,_[_0xe5a1('0x61')](_0x5c32e,'message')[_0xe5a1('0x1f')](',\x20')));}var _0xf10512=_[_0xe5a1('0x62')](_0x13f6d9['channels'],{'uniqueid':_0x38c1c8[_0xe5a1('0x63')]});if(_0xf10512&&_0xf10512['channel']){var _0x47e0df=util[_0xe5a1('0x64')](_0xe5a1('0x65'),_0x38c1c8[_0xe5a1('0x66')]||_0x38c1c8[_0xe5a1('0x63')],_0x38c1c8[_0xe5a1('0x64')]||_0xe5a1('0x67'));return ami[_0xe5a1('0x1b')]({'action':_0xe5a1('0x68'),'channel':_0xf10512[_0xe5a1('0x69')],'file':_0x47e0df,'options':_0xe5a1('0x6a')})[_0xe5a1('0x1c')](function(_0x363f78){var _0x59cefa=_[_0xe5a1('0x62')](_0xf10512[_0xe5a1('0x6b')],{'filename':_0xe5a1('0x6c')+_0x47e0df[_0xe5a1('0x6d')]()});if(_['isNil'](_0x59cefa)){_0xf10512[_0xe5a1('0x6b')][_0xe5a1('0x5d')]({'filename':_0xe5a1('0x6c')+_0x47e0df[_0xe5a1('0x6d')](),'createdAt':moment()['format'](_0xe5a1('0x6e')),'mixmonitorid':_0x363f78[_0xe5a1('0x6f')],'status':_0xe5a1('0x70')});}else{_0x59cefa[_0xe5a1('0x6f')]=_0x363f78['mixmonitorid'];_0x59cefa[_0xe5a1('0x71')]=_0xe5a1('0x70');}_0x295695({'code':0xc8,'message':[_0x38c1c8[_0xe5a1('0x63')],_0xe5a1('0x72'),_0x363f78[_0xe5a1('0x6f')]]['join']('\x20'),'mixmonitorid':_0x363f78[_0xe5a1('0x6f')]});})[_0xe5a1('0x1e')](function(_0x3da584){_0x234b19(_0x20e803[_0xe5a1('0x13')](0x1f5,[_0x38c1c8['uniqueid'],_0x3da584[_0xe5a1('0x1d')]['toLowerCase']()][_0xe5a1('0x1f')]('\x20')));});}else{return _0x234b19(_0x20e803[_0xe5a1('0x13')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x44a2e6){var _0x2a12f7=this;return new Promise(function(_0x45e259,_0x4a31fc){if(ami[_0xe5a1('0x12')]()==![]){return _0x4a31fc(_0x2a12f7[_0xe5a1('0x13')](0x1f4,[config[_0xe5a1('0x14')]['ip'],config[_0xe5a1('0x14')]['username'],'ami\x20disconnected'][_0xe5a1('0x1f')]('\x20')));}var _0x2d1b22=schema(properties[_0xe5a1('0x73')])['validate'](_0x44a2e6);if(_0x2d1b22[_0xe5a1('0x5e')]>0x0){return _0x4a31fc(_0x2a12f7[_0xe5a1('0x13')](0x1f4,_['map'](_0x2d1b22,_0xe5a1('0x1d'))[_0xe5a1('0x1f')](',\x20')));}var _0x398ad7=_[_0xe5a1('0x62')](_0x13f6d9[_0xe5a1('0x60')],{'uniqueid':_0x44a2e6[_0xe5a1('0x63')]});if(_0x398ad7){return BPromise['resolve']()[_0xe5a1('0x1c')](function(){if(_0x398ad7['channel']){return ami[_0xe5a1('0x1b')]({'action':'StopMixMonitor','channel':_0x398ad7[_0xe5a1('0x69')],'mixmonitorid':_0x44a2e6[_0xe5a1('0x6f')]})['catch'](function(_0x1c6332){});}})[_0xe5a1('0x1c')](function(){if(_0x398ad7['destinationchannel']){return ami[_0xe5a1('0x1b')]({'action':_0xe5a1('0x74'),'channel':_0x398ad7[_0xe5a1('0x75')],'mixmonitorid':_0x44a2e6[_0xe5a1('0x6f')]})[_0xe5a1('0x1e')](function(_0x1d9155){});}})[_0xe5a1('0x1c')](function(_0x2ac575){var _0x3503cf=_[_0xe5a1('0x62')](_0x398ad7['monitors'],{'mixmonitorid':_0x44a2e6[_0xe5a1('0x6f')]});if(_0x3503cf){_0x3503cf[_0xe5a1('0x71')]=_0xe5a1('0x76');}})['then'](function(){var _0x57b373=util[_0xe5a1('0x64')](_0xe5a1('0x65'),_0x44a2e6[_0xe5a1('0x66')]||_0x44a2e6[_0xe5a1('0x63')],_0x44a2e6[_0xe5a1('0x64')]||'wav');var _0x1612ed=_[_0xe5a1('0x62')](_0x398ad7[_0xe5a1('0x6b')],{'filename':_0xe5a1('0x6c')+_0x57b373['toLowerCase']()});if(_0x1612ed){_0x1612ed['status']=_0xe5a1('0x76');}})[_0xe5a1('0x1c')](function(){_0x45e259({'code':0xc8,'message':[_0x44a2e6[_0xe5a1('0x63')],_0xe5a1('0x77')][_0xe5a1('0x1f')]('\x20')});})[_0xe5a1('0x1e')](function(_0x1b38d1){_0x4a31fc(_0x2a12f7['error'](0x1f5,[_0x44a2e6[_0xe5a1('0x63')],_0x1b38d1[_0xe5a1('0x1d')][_0xe5a1('0x6d')]()][_0xe5a1('0x1f')]('\x20')));});}else{return _0x4a31fc(_0x2a12f7[_0xe5a1('0x13')](0x1f5,_0xe5a1('0x78')));}});},'VoiceQueuesChannels':function(_0x1e85df){return new Promise(function(_0x2e56b2,_0x4e530e){var _0x4ae474=_[_0xe5a1('0x5f')](_0x13f6d9[_0xe5a1('0x79')]);_0x2e56b2({'count':_0x4ae474[_0xe5a1('0x5e')],'rows':_0x4ae474});});},'VoiceQueuesChannel':function(_0x583c31){var _0x4c550d=this;return new Promise(function(_0x40c574,_0x2d3e2e){var _0x3835c4=schema(properties[_0xe5a1('0x7a')])[_0xe5a1('0x3')](_0x583c31);if(_0x3835c4['length']>0x0){return _0x2d3e2e(_0x4c550d[_0xe5a1('0x13')](0x1f4,_[_0xe5a1('0x61')](_0x3835c4,'message')[_0xe5a1('0x1f')](',\x20')));}var _0x140bdc=_[_0xe5a1('0x62')](_0x13f6d9[_0xe5a1('0x79')],{'uniqueid':_0x583c31['uniqueid']});if(_0x140bdc){_0x40c574(_0x140bdc);}else{return _0x2d3e2e(_0x4c550d['error'](0x1f5,_0xe5a1('0x78')));}});},'VoiceQueuesChannelHangup':function(_0x310fe0){var _0x1a0a43=this;return new Promise(function(_0x42ab42,_0x1e79ce){if(ami[_0xe5a1('0x12')]()==![]){return _0x1e79ce(_0x1a0a43[_0xe5a1('0x13')](0x1f4,[config[_0xe5a1('0x14')]['ip'],config[_0xe5a1('0x14')]['username'],_0xe5a1('0x16')][_0xe5a1('0x1f')]('\x20')));}var _0x1e362e=schema(properties[_0xe5a1('0x7b')])[_0xe5a1('0x3')](_0x310fe0);if(_0x1e362e[_0xe5a1('0x5e')]>0x0){return _0x1e79ce(_0x1a0a43[_0xe5a1('0x13')](0x1f4,_[_0xe5a1('0x61')](_0x1e362e,_0xe5a1('0x1d'))['join'](',\x20')));}var _0x9a54d2=_[_0xe5a1('0x62')](_0x13f6d9[_0xe5a1('0x79')],{'uniqueid':_0x310fe0['uniqueid']});if(_0x9a54d2&&_0x9a54d2[_0xe5a1('0x69')]){return ami[_0xe5a1('0x1b')]({'action':_0xe5a1('0x7c'),'channel':_0x9a54d2[_0xe5a1('0x69')]})[_0xe5a1('0x1c')](function(_0x2b5a63){_0x42ab42({'code':0xc8,'message':[_0x310fe0['uniqueid'],_0x2b5a63[_0xe5a1('0x1d')][_0xe5a1('0x6d')]()][_0xe5a1('0x1f')]('\x20')});})[_0xe5a1('0x1e')](function(_0x531f9d){_0x1e79ce(_0x1a0a43[_0xe5a1('0x13')](0x1f5,[_0x310fe0['uniqueid'],_0x531f9d[_0xe5a1('0x1d')][_0xe5a1('0x6d')]()][_0xe5a1('0x1f')]('\x20')));});}else{return _0x1e79ce(_0x1a0a43[_0xe5a1('0x13')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x2d9b02){var _0x2954af=this;return new Promise(function(_0x14dffd,_0x3a8f70){if(ami[_0xe5a1('0x12')]()==![]){return _0x3a8f70(_0x2954af['error'](0x1f4,[config[_0xe5a1('0x14')]['ip'],config[_0xe5a1('0x14')][_0xe5a1('0x15')],_0xe5a1('0x16')][_0xe5a1('0x1f')]('\x20')));}var _0x34b7cd=schema(properties[_0xe5a1('0x7d')])[_0xe5a1('0x3')](_0x2d9b02);if(_0x34b7cd[_0xe5a1('0x5e')]>0x0){return _0x3a8f70(_0x2954af[_0xe5a1('0x13')](0x1f4,_[_0xe5a1('0x61')](_0x34b7cd,_0xe5a1('0x1d'))[_0xe5a1('0x1f')](',\x20')));}var _0x794354=_[_0xe5a1('0x62')](_0x13f6d9[_0xe5a1('0x79')],{'uniqueid':_0x2d9b02[_0xe5a1('0x63')]});if(_0x794354&&_0x794354['channel']){return ami[_0xe5a1('0x1b')]({'action':_0xe5a1('0x7e'),'channel':_0x794354[_0xe5a1('0x69')],'exten':_0x2d9b02[_0xe5a1('0x7f')],'context':_0x2d9b02[_0xe5a1('0x80')]||_0x794354[_0xe5a1('0x80')],'priority':0x1})[_0xe5a1('0x1c')](function(_0x2aeaec){_0x14dffd({'code':0xc8,'message':[_0x2d9b02[_0xe5a1('0x63')],_0x2aeaec[_0xe5a1('0x1d')][_0xe5a1('0x6d')]()][_0xe5a1('0x1f')]('\x20')});})[_0xe5a1('0x1e')](function(_0x24320a){_0x3a8f70(_0x2954af[_0xe5a1('0x13')](0x1f5,[_0x2d9b02[_0xe5a1('0x63')],_0x24320a[_0xe5a1('0x1d')][_0xe5a1('0x6d')]()]['join']('\x20')));});}else{return _0x3a8f70(_0x2954af[_0xe5a1('0x13')](0x1f5,_0xe5a1('0x78')));}});},'Agents':function(_0x278944){return new Promise(function(_0x171f8a,_0xf8c4cd){var _0x25c631=_[_0xe5a1('0x5f')](_0x13f6d9['agents']);_0x171f8a({'count':_0x25c631[_0xe5a1('0x5e')],'rows':_0x25c631});});},'Telephones':function(_0x1902d4){return new Promise(function(_0x489f51,_0x4d9ae8){var _0x23f906=_[_0xe5a1('0x5f')](_0x13f6d9['telephones']);_0x489f51({'count':_0x23f906['length'],'rows':_0x23f906});});},'Trunks':function(_0x1bba48){return new Promise(function(_0x1e6a1f,_0xe3ac2e){var _0x4fdd82=_[_0xe5a1('0x5f')](_0x13f6d9['trunks']);_0x1e6a1f({'count':_0x4fdd82[_0xe5a1('0x5e')],'rows':_0x4fdd82});});},'OutboundChannels':function(_0x473fd6){return new Promise(function(_0x52df77,_0x59115c){var _0x270079=_['values'](_0x13f6d9[_0xe5a1('0x81')]);_0x52df77({'count':_0x270079[_0xe5a1('0x5e')],'rows':_0x270079});});},'Outbound':function(_0x537cc4){return new Promise(function(_0x1fa211,_0x111069){_0x1fa211(_0x13f6d9[_0xe5a1('0x32')]);});},'Campaigns':function(_0x5147e2){return new Promise(function(_0x392448,_0x13a827){var _0x2672f9=_[_0xe5a1('0x5f')](_0x13f6d9[_0xe5a1('0x82')]);_0x392448({'count':_0x2672f9[_0xe5a1('0x5e')],'rows':_0x2672f9});});},'VoiceQueuesPreview':function(_0x2b6621){var _0x456db6=this;return new Promise(function(_0x531106,_0x4575de){_0x3d3541['run'](_0x2b6621['id'])[_0xe5a1('0x1c')](function(_0x3834c0){_0x531106({'code':0xc8,'message':_0x3834c0[_0xe5a1('0x1d')]});})[_0xe5a1('0x1e')](function(_0xcae5e7){_0x4575de(_0x456db6[_0xe5a1('0x13')](0x1f4,_0xcae5e7[_0xe5a1('0x1d')]));});});},'EventManager':function(_0x5de09d){var _0x574bb6=this;return new Promise(function(_0x4a68d0,_0x58b5a4){if(!_0x5de09d[_0xe5a1('0x83')]){return _0x58b5a4(_0x574bb6['error'](0x1f4,_0xe5a1('0x84')));}ami[_0xe5a1('0x85')](_0xe5a1('0x86')+_0x5de09d[_0xe5a1('0x83')],_0x5de09d[_0xe5a1('0x1d')]);_0x4a68d0({'code':0xc8,'message':_0x5de09d});});},'FaxAccounts':function(_0x48fbf2){return new Promise(function(_0x5d5f9a,_0x303d87){var _0x3b3fbd=_[_0xe5a1('0x5f')](_0x13f6d9[_0xe5a1('0x87')]);_0x5d5f9a({'count':_0x3b3fbd[_0xe5a1('0x5e')],'rows':_0x3b3fbd});});},'SendFax':function(_0x18fa5a){var _0x323f98=this;return new Promise(function(_0x48ba1e,_0xf978b2){_0x3cb774[_0xe5a1('0x88')](_0x18fa5a)[_0xe5a1('0x1c')](function(_0x4d5624){_0x48ba1e({'code':0xc8,'message':_0x4d5624['message']});})[_0xe5a1('0x1e')](function(_0x825b13){_0xf978b2(_0x323f98[_0xe5a1('0x13')](0x1f4,_0x825b13[_0xe5a1('0x1d')]));});});},'CheckAfterSend':function(_0x1cd3eb){var _0x340dab=this;return new Promise(function(_0x2b8405,_0x7428ce){_0x3cb774[_0xe5a1('0x89')](_0x1cd3eb)['then'](function(_0x123ec0){_0x2b8405({'code':0xc8,'message':_0x123ec0[_0xe5a1('0x1d')]});})[_0xe5a1('0x1e')](function(_0x214f8d){_0x7428ce(_0x340dab[_0xe5a1('0x13')](0x1f4,_0x214f8d['message']));});});}};var _0xc3ecaa=jayson[_0xe5a1('0x8a')](_0x8d5f9d)[_0xe5a1('0x8b')]();_0xc3ecaa['on']('error',function(_0x5400ba){return _0x2669c0(_0x5400ba);});_0xc3ecaa[_0xe5a1('0x7')](0x232a,_0xe5a1('0x8c'),function(){console[_0xe5a1('0x8d')](_0xe5a1('0x8e'),0x232a);return _0x5531b3(_0xe5a1('0x8f')+0x232a);});});};
\ No newline at end of file