Built motion from commit 06eb8eb0.|2.6.31
[motion2.git] / server / services / ami / dialer / index.js
index 15b3727..8b3c553 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1603=['starttime','[unlockQueueStatus][undefined]','queueStatusComplete','[booked][unlockQueueStatus]','Interval','\x20INTERVAL_IS_NULL','NULL_INTERVAL','isIVRCampaignActive','INACTIVE','\x20NOT\x20Active','campaign:ivr:%s','campaign:save','sendMessageOneNotActive','originated','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','DISACTIVED','is\x20deactivated','Error','isTrunkReachable','active','SIP/%s','status','reachable','unmonitored','TrunkBackup','TRUNK_NOT_REACHABLE','checkIfTime','ifTimeIvr','checkIfTimeIntervals','Intervals','ifTime','Failure','\x20Intervals\x20is\x20null\x20','timezones','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','isArray','push','Action','command','iftime\x20%s,%s','interval','then','content','indexOf','true','catch','some','OVERTIME_GLOBAL_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','stringify','resetActiveCalls','syncCampaigns','undefined','isIVRCampaign','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','launchHandleIvr','[syncCampaigns]','dialMethod','progressive','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','silly','Dialer::ifTime()','OVERTIME_INTERVAL','isGlobal','AMI\x20IfTime','[ifTime][Action]','queue','uniqueid','ivr','decrementOriginate','[syncAgentConnect]','answertime','YYYY-MM-DD\x20HH:mm:ss','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','droptime','getSeconds','dialQueueTimeout','predictiveIntervalDroppedCallsTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','statedesc','dropreason','countdropretry','countglobal','callAdditionalPhoneAfterMin','verifyAdditionalPhones','voiceQueue','dialDropMaxRetry','queueCallerAbandonCreateState','add','dialDropRetryFrequency','minutes','ListId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','Drop','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','CALLEREXIT','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','additional','countabandonedretry','[rescheduleContact][Abandoned]','syncNewExten','channel','actionid','strategy','rrmemory','isNil','locked','paused','stateinterface','roundrobin','run','idHopper','finally','[syncQueueStatusComplete]','ContactId','[unlock][syncQueueStatusComplete]','_rr','length','unlockRR','Agent:\x20','[Catch][Preview][syncQueueStatusComplete]','pick','contactAgent-idHopper:\x20','[booked][unlock]','rescheduleContact','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','responsetime','getQueue','response','[syncOriginateResponse]','callProgressDetecting','[callProgressDetecting]\x20','variable','amdstatus','exten','dialAMDActive','value','HANGUP','[syncVarSet]','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','membername','AMD','emit','buildObj','amd','saveInDb','[syncHangupInAMD]','MACHINE','Machine','countmachineretry','custom:amd','[syncAgentComplete][createHistory][0]','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countagentrejectretry','stateGlobal','reason19\x20machine....','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','[rescheduleContact][Machine]','HangupInAMD','dialGlobalMaxRetry','dialMachineMaxRetry','ivrAnswerCallsDay','cause-txt','Normal\x20Clearing','[syncAgentCompleteIvr][createHistory]','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','[syncHangup]','AnswerAGI','[syncHangup2]','[syncAgentComplete]','outboundUnknownCallsDay','Unknown','running','isPreviewCampaign','resolve','statusMessage','inUse','talking','pTalking','ACTIVE','checkDialMethod','[syncQueueSummary]','updateReportFromOutboundQueue','throttle','filter','map','Agent','user:dialPreviewRecallReminder','checkPreviewRecallReminder','clearZombieChannels','No\x20such\x20channel','[clearZombieChannels]','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','[getVoiceQueueRtPauses]\x20','emptyContact','[emptyContact]','[emptyContact][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','handleIvr','actionOriginate','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','getCaller','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','isOutboundQueue','XMD-CAMPAIGNID','setXMDContactVariables','Contact','assign','getCallerId','Trunk','callerid','dialOriginateCallerIdName','getCallerIdRandom','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','variables','dialPrefix','dialCutDigit','substring','SIP/%s/%s%s','trim','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','[originate][error]','originate\x20action\x20Error','checkRetriveMax','countbusyretry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','object','[callProgressDetecting]','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','outboundNoAnswerCallsDay','NoAnswer','custom:agentnoanswer','dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','Busy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','outboundAbandonedCallsDay','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','available','floor','erlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','started\x20in\x20predictive\x20at','dialPredictiveInterval','getDataPredictive','startMethodPredictive','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','getDataPredictiveOld','loggedIn','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','getVoiceQueueRtPauses','check\x20failure','one\x20call\x20every:','milliseconds','[handlePredictive]','checkContactBlack','UserId','recallme','[booked][checkContactBlack]','queuestatus','[checkContactBlack]','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','Queue:\x20','scheduledat','dialRecallMeTimeout','unlockContact','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','Blacklist','[Originate][historyBlacklist]','inBlackList','limitCalls','temp','checkContactEmpty','[getContactCampaign2][Empty]','RUNNING','[actionOriginate]\x20','checkIsBlackListIvr','[handleIvr]','[getContactCampaign2]','dialLimitQueue','not_inuse','countReScheduled','[countReScheduled]\x20','[actionOriginate]','tryOriginatePredictive','[handlePredictive][limitChannel]','getContactDialer','checkIsBlackList','[actionOriginatePredictive]','--------\x20Drop\x20Rate\x20--------','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','erlangb','----\x20Agent\x20Busy\x20Factor\x20----','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','lodash','uuid','ioredis','./utils','./utils/hopper','../../../config/environment/','dialer','../../../config/logger','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/voiceQueueRt','../rpc/setting','../rpc/interval','./models/action','./models/agentComplete','./models/queueCallerAbandon','./models/hangup','XCALLY_IP_AGI','prototype','enqueue','tail','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','queuesSummary','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','syncQueueSummaryComplete','syncHangup','newexten','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','previewRecallmeReminderInterval','isUndefined','type','outbound','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','format','voice:queue:%s','name','voice_queue:save','isEmpty','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','message','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contacts','NO_AVAILABLE_CONTACTS','state','endtime'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1603,0x1b4));var _0x3160=function(_0x4002a2,_0x49a870){_0x4002a2=_0x4002a2-0x0;var _0x1e993b=_0x1603[_0x4002a2];return _0x1e993b;};'use strict';var util=require('util');var _=require(_0x3160('0x0'));var uuid=require(_0x3160('0x1'));var moment=require('moment');var rr=require('rr');var Redis=require(_0x3160('0x2'));var utils=require(_0x3160('0x3'));var hopperUtils=require(_0x3160('0x4'));var ut=require('../preview/util/util');var config=require(_0x3160('0x5'));var logger=require('../../../config/logger')(_0x3160('0x6'));var loggerBooked=require(_0x3160('0x7'))(_0x3160('0x8'));var loggerPredictive=require(_0x3160('0x7'))(_0x3160('0x9'));var loggerPredictiveCalls=require(_0x3160('0x7'))(_0x3160('0xa'));var loggerSyncQueueSummary=require(_0x3160('0x7'))(_0x3160('0xb'));var ami=require(_0x3160('0xc'));config[_0x3160('0xd')]=_[_0x3160('0xe')](config[_0x3160('0xd')],{'host':_0x3160('0xf'),'port':0x18eb});var io=require(_0x3160('0x10'))(new Redis(config[_0x3160('0xd')]));var cmHopper=require('../rpc/cmHopper');var voiceQueueRt=require(_0x3160('0x11'));var RpcSetting=require(_0x3160('0x12'));var Interval=require(_0x3160('0x13'));var Action=require(_0x3160('0x14'));var History=require('./models/history');var Final=require('./models/final');var AgentComplete=require(_0x3160('0x15'));var QueueCallerAbandon=require(_0x3160('0x16'));var Hangup=require(_0x3160('0x17'));var ipAgi=process['env'][_0x3160('0x18')]||'127.0.0.1';var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x3160('0x19')][_0x3160('0x1a')]=function(_0x41ef02){this[_0x3160('0x1b')]=this['tail']?this[_0x3160('0x1b')]['finally'](_0x41ef02):_0x41ef02();};function Dialer(_0x155f26,_0x175f3c){this[_0x3160('0x1c')]=new Sequence();this[_0x3160('0x1d')]=_0x175f3c;this[_0x3160('0x1e')]=_0x155f26[_0x3160('0x1e')];this[_0x3160('0x1f')]=_0x155f26['campaigns'];this[_0x3160('0x20')]=_0x155f26[_0x3160('0x20')];this[_0x3160('0x21')]=_0x155f26[_0x3160('0x21')];this[_0x3160('0x22')]=config[_0x3160('0x22')]||0x2;this[_0x3160('0x23')]={};this[_0x3160('0x24')]={};this[_0x3160('0x25')]={};this[_0x3160('0x26')]={};this[_0x3160('0x27')]={};this[_0x3160('0x28')]={};this[_0x3160('0x29')]={};this[_0x3160('0x2a')]={};this[_0x3160('0x2b')]={};this[_0x3160('0x2c')]={};this[_0x3160('0x2d')]={};ami['on']('agentconnect',this[_0x3160('0x2e')][_0x3160('0x2f')](this));ami['on'](_0x3160('0x30'),this[_0x3160('0x31')][_0x3160('0x2f')](this));ami['on'](_0x3160('0x32'),this[_0x3160('0x33')][_0x3160('0x2f')](this));ami['on']('agentcomplete',this[_0x3160('0x34')][_0x3160('0x2f')](this));ami['on'](_0x3160('0x35'),this[_0x3160('0xb')][_0x3160('0x2f')](this));ami['on'](_0x3160('0x36'),this[_0x3160('0x37')][_0x3160('0x2f')](this));ami['on']('hangup',this[_0x3160('0x38')][_0x3160('0x2f')](this));ami['on'](_0x3160('0x39'),this['syncNewExten'][_0x3160('0x2f')](this));ami['on']('varset',this[_0x3160('0x3a')][_0x3160('0x2f')](this));ami['on'](_0x3160('0x3b'),this[_0x3160('0x3c')]['bind'](this));ami['on'](_0x3160('0x3d'),this[_0x3160('0x3e')][_0x3160('0x2f')](this));this[_0x3160('0x3f')]();this[_0x3160('0x40')]();RpcSetting[_0x3160('0x41')]()['then'](function(_0x556a3c){previewRecallmeReminderInterval=_0x556a3c[_0x3160('0x42')];});}function isNotNull(_0x284838){return _0x284838!==null&&!_[_0x3160('0x43')](_0x284838);}function msgResponse(_0x3d8e2d,_0x3f4984,_0x2c864c){return{'action':_0x3d8e2d,'response':_0x3f4984,'message':_0x2c864c,'stack':_0x2c864c};}function emit(_0x73ba78,_0x42e04b,_0x1b288e){io['to'](_0x73ba78)['emit'](_0x42e04b,_0x1b288e);}function emitOutboundVoiceQueueSummary(_0x4f89d5){if(_0x4f89d5[_0x3160('0x44')]===_0x3160('0x45')){logger[_0x3160('0x46')](_0x3160('0x47'),util[_0x3160('0x48')](_0x4f89d5,{'showHidden':![],'depth':null}));emit(util[_0x3160('0x49')](_0x3160('0x4a'),_0x4f89d5[_0x3160('0x4b')]),_0x3160('0x4c'),_0x4f89d5);}}function checkGetDataPredictive(_0x197d15){if(isNotNull(_0x197d15)&&!_[_0x3160('0x4d')](_0x197d15)){loggerPredictive[_0x3160('0x4e')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0x3160('0x4e')](_0x3160('0x4f'),_0x197d15[_0x3160('0x50')]);loggerPredictive[_0x3160('0x4e')](_0x3160('0x51'),_0x197d15[_0x3160('0x52')]);loggerPredictive['info'](_0x3160('0x53'),_0x197d15['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0x3160('0x4e')](_0x3160('0x54'),_0x197d15[_0x3160('0x55')]);loggerPredictive['info'](_0x3160('0x56'),_0x197d15[_0x3160('0x57')]);loggerPredictive[_0x3160('0x4e')](_0x3160('0x58'),_0x197d15[_0x3160('0x59')]);loggerPredictive[_0x3160('0x4e')](_0x3160('0x5a'));if(_0x197d15[_0x3160('0x50')]>0x0){if(!_[_0x3160('0x43')](_0x197d15[_0x3160('0x59')])&&_0x197d15['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0x3160('0x4e')](_0x3160('0x5b'));if(!_[_0x3160('0x43')](_0x197d15[_0x3160('0x57')])&&_0x197d15[_0x3160('0x57')]>0x0){return!![];}loggerPredictive[_0x3160('0x4e')](_0x3160('0x5c'));}else{loggerPredictive['info'](_0x3160('0x5d'));}}else{loggerPredictive[_0x3160('0x4e')](_0x3160('0x5e'));}return![];}function mergeDataErlangB(_0x1dba2f){return function(_0x2cb176){loggerPredictive[_0x3160('0x4e')]('---------\x20ErlangB\x20---------');loggerPredictive[_0x3160('0x4e')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2cb176['erlangCalls']);loggerPredictive[_0x3160('0x4e')](_0x3160('0x5f'),_0x2cb176[_0x3160('0x60')]);loggerPredictive['info'](_0x3160('0x61'),_0x2cb176[_0x3160('0x62')]);loggerPredictive[_0x3160('0x4e')](_0x3160('0x63'),_0x2cb176['erlangBusyFactor']);loggerPredictive[_0x3160('0x4e')](_0x3160('0x61'),_0x2cb176[_0x3160('0x62')]);loggerPredictive[_0x3160('0x4e')](_0x3160('0x5a'));_[_0x3160('0x64')](_0x1dba2f,_0x2cb176);};}function ifInterval(_0x1dfe41,_0x369a0e){if(_[_0x3160('0x43')](_0x369a0e)){return![];}return utils['getSeconds'](undefined,_0x369a0e)<_0x1dfe41*0x3c;}function clearPredictiveAttributes(_0x4304eb){if(_0x4304eb[_0x3160('0x29')]){_0x4304eb['startProgressive']=undefined;loggerPredictive[_0x3160('0x46')](_0x4304eb[_0x3160('0x4b')],'startProgressive\x20value\x20cleared');}if(_0x4304eb[_0x3160('0x28')]){_0x4304eb[_0x3160('0x28')]=undefined;loggerPredictive['debug'](_0x4304eb['name'],_0x3160('0x65'));}if(_0x4304eb['handlePredictive']){clearInterval(_0x4304eb[_0x3160('0x66')]);_0x4304eb[_0x3160('0x66')]=undefined;loggerPredictive[_0x3160('0x46')](_0x4304eb[_0x3160('0x4b')],_0x3160('0x67'));}}function loggerCatchPredictive(_0xd060de,_0x3a6a60){return function(_0xdd131){loggerPredictive[_0x3160('0x68')](_0x3a6a60[_0x3160('0x4b')],_0xd060de);loggerPredictive[_0x3160('0x68')](_0xdd131[_0x3160('0x69')]);clearPredictiveAttributes(_0x3a6a60);};}function loggerCatch(_0x14c0b1){return function(_0x2d1641){logger[_0x3160('0x68')](_0x14c0b1,util[_0x3160('0x48')](_0x2d1641,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x316720){return function(_0x3e4b42){if(isNotNull(_0x3e4b42)&&isNotNull(_0x3e4b42[0x0])){if(_0x3e4b42[0x0]['contactsRescheduled']>0x0){_0x316720[_0x3160('0x6a')]=utils[_0x3160('0x6b')][_0x3160('0x6c')];logger[_0x3160('0x4e')](_0x3160('0x6d')+_0x316720[_0x3160('0x4b')],_0x3e4b42[0x0]['contactsRescheduled'],_0x3160('0x6e'));}else{_0x316720[_0x3160('0x6a')]=utils['CAMPAIGN_STATUS'][_0x3160('0x6f')];logger[_0x3160('0x4e')]('[getContactDialer2][Empty]'+_0x316720[_0x3160('0x4b')]);}}};}function createObjHistory(_0x2876a3,_0x59b44e,_0x37b77d,_0x42d792,_0x24c29e){_0x2876a3['message']=_0x37b77d;var _0x33ac9a=new Action(_0x2876a3,_0x59b44e);var _0x3cb6f1=new History(_0x33ac9a);_0x3cb6f1[_0x3160('0x70')]=_0x42d792;_0x3cb6f1['statedesc']=_0x24c29e;_0x3cb6f1[_0x3160('0x71')]=_0x33ac9a[_0x3160('0x72')];return _0x3cb6f1;}function unlockQueueStatus(_0x4ee15f,_0x3e7fbd){setTimeout(function(){if(_['isUndefined'](_0x4ee15f['queueStatusComplete'])){loggerBooked['error'](_0x3160('0x73'),_0x3e7fbd);}_0x4ee15f[_0x3160('0x74')]=!![];loggerBooked[_0x3160('0x4e')](_0x3160('0x75'),_0x3e7fbd,JSON['stringify'](_['pick'](_0x4ee15f,[_0x3160('0x4b'),'queueStatusComplete'])));},0x1f3);}function checkInterval(_0x1d3c84){return function(){if(!isNotNull(_0x1d3c84[_0x3160('0x76')])){_0x1d3c84[_0x3160('0x6a')]=utils[_0x3160('0x6b')]['NULL_INTERVAL'];throw _0x1d3c84[_0x3160('0x4b')]+_0x3160('0x77');}if(!isNotNull(_0x1d3c84[_0x3160('0x76')]['Intervals'])){_0x1d3c84[_0x3160('0x6a')]=utils[_0x3160('0x6b')][_0x3160('0x78')];throw _0x1d3c84[_0x3160('0x4b')]+_0x3160('0x77');}if(!isNotNull(_[_0x3160('0x4d')](_0x1d3c84[_0x3160('0x76')]['Intervals']))){_0x1d3c84[_0x3160('0x6a')]=utils[_0x3160('0x6b')][_0x3160('0x78')];throw _0x1d3c84[_0x3160('0x4b')]+'\x20INTERVAL_IS_NULL';}};}function checkIsIVRCampaignActive(_0x43a799){return function(){if(!utils[_0x3160('0x79')](_0x43a799)){_0x43a799[_0x3160('0x6a')]=utils[_0x3160('0x6b')][_0x3160('0x7a')];throw _0x43a799[_0x3160('0x4b')]+_0x3160('0x7b');}};}function emitCampaignSummary(_0x1020e6){if(utils['isIVRCampaign'](_0x1020e6)){emit(util[_0x3160('0x49')](_0x3160('0x7c'),_0x1020e6['name']),_0x3160('0x7d'),_0x1020e6);}}function loggerCatchQueueSummary(_0x31e03c,_0x236b34){return function(_0x536a6c){clearPredictiveAttributes(_0x236b34);emitCampaignSummary(_0x236b34);loggerSyncQueueSummary[_0x3160('0x46')](_0x31e03c,util[_0x3160('0x48')](_0x536a6c,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x3603e4){if(_0x3603e4[_0x3160('0x7e')]){if(_0x3603e4[_0x3160('0x7f')]===0x0){_0x3603e4['sendMessageOneNotActive']=![];_0x3603e4[_0x3160('0x6a')]=utils[_0x3160('0x6b')]['INACTIVE'];loggerSyncQueueSummary[_0x3160('0x46')](_0x3160('0x80'),_0x3603e4[_0x3160('0x4b')],_0x3160('0x81'));}else{_0x3603e4['message']=utils['CAMPAIGN_STATUS'][_0x3160('0x82')];loggerSyncQueueSummary['debug'](_0x3160('0x80'),_0x3603e4[_0x3160('0x4b')],_0x3160('0x83'));}emitCampaignSummary(_0x3603e4);}}function myreject(_0x4a2771){return function(_0x5e7146){return _0x4a2771(msgResponse('[ifTime][Action]',_0x3160('0x84'),JSON['stringify'](_0x5e7146)));};}Dialer[_0x3160('0x19')][_0x3160('0x85')]=function(_0x39623f){return!_['isUndefined'](_0x39623f)&&_0x39623f&&!_[_0x3160('0x43')](_0x39623f[_0x3160('0x4b')])&&!_['isUndefined'](_0x39623f[_0x3160('0x86')])&&_0x39623f[_0x3160('0x86')]&&(this[_0x3160('0x21')][util[_0x3160('0x49')](_0x3160('0x87'),_0x39623f[_0x3160('0x4b')])][_0x3160('0x88')]===_0x3160('0x89')||this[_0x3160('0x21')][util[_0x3160('0x49')](_0x3160('0x87'),_0x39623f['name'])][_0x3160('0x88')]===_0x3160('0x8a'));};Dialer[_0x3160('0x19')]['checkIsTrunkReachable']=function(_0x491ca1){var _0x47eb26=this;return function(){if(!_0x47eb26[_0x3160('0x85')](_0x491ca1['Trunk'])){if(!_0x47eb26[_0x3160('0x85')](_0x491ca1[_0x3160('0x8b')])){_0x491ca1['message']=utils[_0x3160('0x6b')][_0x3160('0x8c')];throw _0x491ca1[_0x3160('0x4b')]+'\x20trunk\x20is\x20not\x20reachable';}}};};Dialer[_0x3160('0x19')][_0x3160('0x8d')]=function(_0x1f7cdf,_0x4e416e,_0x226f53,_0x5dffbc){var _0x45865d=this;return function(){var _0x3c8c5e=!![];return _0x45865d[_0x3160('0x8e')](_0x1f7cdf,_0x4e416e,_0x226f53,_0x5dffbc,_0x3c8c5e);};};Dialer[_0x3160('0x19')][_0x3160('0x8f')]=function(_0x33a32a,_0x50a3cc,_0x1dfdc9,_0x2eca91){var _0x345a10=this;return function(){var _0x5c4414=![];return _0x345a10['ifTimeIvr'](_0x33a32a[_0x3160('0x90')],_0x50a3cc,_0x1dfdc9,_0x2eca91,_0x5c4414);};};Dialer['prototype'][_0x3160('0x8e')]=function(_0x2b3bcd,_0x291c9d,_0x56ed26,_0x11a258,_0x4bca25){var _0x27d264=[];return new Promise(function(_0x407cbb,_0x4f85fa){if(!isNotNull(_0x2b3bcd)){_0x11a258[_0x3160('0x6a')]=utils[_0x3160('0x6b')][_0x3160('0x78')];return _0x4f85fa(msgResponse(_0x3160('0x91'),_0x3160('0x92'),_0x56ed26+_0x3160('0x93')));}if(_[_0x3160('0x4d')](_0x2b3bcd)){_0x11a258[_0x3160('0x6a')]=utils[_0x3160('0x6b')]['EMPTY_INTERVAL'];return _0x4f85fa(msgResponse(_0x3160('0x91'),_0x3160('0x92'),_0x56ed26+'\x20Intervals\x20is\x20empty\x20'));}if(_0x291c9d&&_[_0x3160('0x43')](config[_0x3160('0x94')][_0x291c9d])){_0x11a258['message']=utils[_0x3160('0x6b')][_0x3160('0x95')];return _0x4f85fa(msgResponse('ifTime',_0x3160('0x92'),_0x56ed26+_0x3160('0x96')+_0x291c9d));}if(_[_0x3160('0x97')](_0x2b3bcd)){for(var _0x3d195f=0x0;_0x3d195f<_0x2b3bcd['length'];_0x3d195f+=0x1){_0x27d264[_0x3160('0x98')](ami[_0x3160('0x99')]({'action':_0x3160('0x9a'),'command':util[_0x3160('0x49')](_0x3160('0x9b'),_0x2b3bcd[_0x3d195f][_0x3160('0x9c')],!_[_0x3160('0x43')](config[_0x3160('0x94')][_0x291c9d])?_0x291c9d:'')})[_0x3160('0x9d')](function(_0x2f94cf){return _0x2f94cf[_0x3160('0x9e')][_0x3160('0x9f')](_0x3160('0xa0'))>=0x0;})[_0x3160('0xa1')](myreject(_0x4f85fa)));}}else{_0x27d264[_0x3160('0x98')](ami['Action']({'action':'command','command':util[_0x3160('0x49')]('iftime\x20%s,%s',_0x2b3bcd,!_[_0x3160('0x43')](config[_0x3160('0x94')][_0x291c9d])?_0x291c9d:'')})[_0x3160('0x9d')](function(_0x4f7883){return _0x4f7883['content'][_0x3160('0x9f')](_0x3160('0xa0'))>=0x0;})[_0x3160('0xa1')](myreject(_0x4f85fa)));}Promise['all'](_0x27d264)[_0x3160('0x9d')](function(_0x3d436e){var _0x32989d=_[_0x3160('0xa2')](_0x3d436e);if(_0x32989d){return _0x407cbb(_0x32989d);}else{_0x11a258[_0x3160('0x6a')]=_0x4bca25?utils[_0x3160('0x6b')][_0x3160('0xa3')]:utils[_0x3160('0x6b')]['OVERTIME_INTERVAL'];return _0x4f85fa(msgResponse(_0x3160('0xa4'),_0x3160('0x92'),_0x3160('0xa5')+_0x4bca25+'\x20'+_0x56ed26+_0x3160('0xa6')+util['inspect'](_0x2b3bcd,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x291c9d));}})[_0x3160('0xa1')](function(_0x118a68){return _0x4f85fa(msgResponse(_0x3160('0x91'),'Failure',JSON[_0x3160('0xa7')](_0x118a68)));});});};Dialer[_0x3160('0x19')][_0x3160('0x3f')]=function(){var _0x2231c6=this;return cmHopper[_0x3160('0xa8')]({'active':![]},{'where':{'active':!![]}})[_0x3160('0x9d')](function(){setInterval(function(){_0x2231c6[_0x3160('0xa9')]();},0x3e8);});};Dialer['prototype'][_0x3160('0xa9')]=function(){var _0x110f94=this;var _0x284666;for(var _0x552312 in this[_0x3160('0x1f')]){if(typeof this[_0x3160('0x1f')][_0x552312]!==_0x3160('0xaa')){_0x284666=this[_0x3160('0x1f')][_0x552312];if(utils[_0x3160('0xab')](_0x284666)&&utils[_0x3160('0x79')](_0x284666)){_0x284666[_0x3160('0x7e')]=!![];Promise['resolve']()[_0x3160('0x9d')](checkIsIVRCampaignActive(_0x284666))[_0x3160('0x9d')](checkInterval(_0x284666))['then'](_0x110f94[_0x3160('0xac')](_0x284666))['then'](_0x110f94[_0x3160('0x8d')](_0x284666[_0x3160('0xad')],_0x284666[_0x3160('0xae')],_0x284666[_0x3160('0x4b')],_0x284666))[_0x3160('0x9d')](_0x110f94[_0x3160('0x8f')](_0x284666[_0x3160('0x76')],_0x284666[_0x3160('0xae')],_0x284666[_0x3160('0x4b')],_0x284666))['then'](_0x110f94[_0x3160('0xaf')](_0x284666))[_0x3160('0xa1')](loggerCatchQueueSummary(_0x3160('0xb0'),_0x284666));}else{notSendMessagesCampaign(_0x284666);}}}};Dialer[_0x3160('0x19')]['checkDialMethod']=function(_0x4281bf){if(_0x4281bf[_0x3160('0xb1')]!==_0x3160('0x9')){clearPredictiveAttributes(_0x4281bf);}switch(_0x4281bf[_0x3160('0xb1')]){case _0x3160('0xb2'):this[_0x3160('0xb3')](_0x4281bf,0x1);break;case _0x3160('0xb4'):this[_0x3160('0xb3')](_0x4281bf,_0x4281bf[_0x3160('0xb5')]);break;case'predictive':this[_0x3160('0x9')](_0x4281bf);break;case _0x3160('0x8'):this[_0x3160('0xb3')](_0x4281bf,0x1);break;default:logger[_0x3160('0x68')](_0x3160('0xb6'),_0x4281bf[_0x3160('0x4b')],_0x3160('0xb7'));}};Dialer[_0x3160('0x19')][_0x3160('0x91')]=function(_0x54d74a,_0x225ba5){var _0x1644e6=_0x54d74a[_0x3160('0xae')];var _0x4b3145=_0x225ba5?_0x54d74a['dialGlobalInterval']:_0x54d74a[_0x3160('0x76')]['Intervals'];logger[_0x3160('0xb8')](_0x3160('0xb9'),_0x4b3145,_0x1644e6,_0x54d74a[_0x3160('0x4b')],util[_0x3160('0x49')]('Voice\x20Queue\x20%s\x20$s',_0x54d74a[_0x3160('0x4b')],_0x54d74a['id']));var _0x4dee21=null;return Interval['intervalIftime'](_0x4b3145,_0x1644e6)[_0x3160('0x9d')](function(_0x59477d){if(_0x59477d===!![]){return _0x59477d;}else{_0x54d74a[_0x3160('0x6a')]=_0x225ba5?utils['CAMPAIGN_STATUS'][_0x3160('0xa3')]:utils[_0x3160('0x6b')][_0x3160('0xba')];_0x4dee21=msgResponse(_0x3160('0xa4'),_0x3160('0x92'),_0x3160('0xa5')+_0x225ba5+'\x20'+_0x54d74a[_0x3160('0x4b')]+'\x20Interval\x20is\x20overtime:\x20'+util['inspect'](_0x4b3145,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x1644e6);}if(_0x4dee21!==null){logger[_0x3160('0xb8')]('Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:',_0x4dee21);_0x4dee21[_0x3160('0xbb')]=_0x225ba5;throw _0x4dee21;}})[_0x3160('0xa1')](function(_0x3311d1){logger[_0x3160('0x68')](_0x3160('0xbc'),_0x3311d1);throw msgResponse(_0x3160('0xbd'),_0x3160('0x84'),util[_0x3160('0x48')](_0x3311d1,{'showHidden':![],'depth':null}));});};Dialer['prototype'][_0x3160('0x2e')]=function(_0x489d5d){if(this[_0x3160('0x1e')][_0x489d5d[_0x3160('0xbe')]]){if(this[_0x3160('0x26')][_0x489d5d[_0x3160('0xbf')]]&&this[_0x3160('0x26')][_0x489d5d[_0x3160('0xbf')]][_0x3160('0x44')]!==_0x3160('0xc0')){utils[_0x3160('0xc1')](this[_0x3160('0x1e')][_0x489d5d[_0x3160('0xbe')]],_0x3160('0xc2'));this[_0x3160('0x26')][_0x489d5d[_0x3160('0xbf')]][_0x3160('0xc3')]=moment()['format'](_0x3160('0xc4'));}}};Dialer[_0x3160('0x19')]['syncAgentComplete']=function(_0x52e2be){var _0x29e322=this[_0x3160('0x26')][_0x52e2be[_0x3160('0xbf')]];if(this[_0x3160('0x1e')][_0x52e2be[_0x3160('0xbe')]]){if(_0x29e322&&_0x29e322[_0x3160('0x44')]!=='ivr'){delete this[_0x3160('0x26')][_0x52e2be[_0x3160('0xbf')]];this[_0x3160('0x1e')][_0x52e2be[_0x3160('0xbe')]]['outboundAnswerCallsDay']+=0x1;var _0x1d6cb2=new AgentComplete(_0x29e322,_0x52e2be);if(_0x52e2be[_0x3160('0xc5')]===_0x3160('0xc6')){_0x1d6cb2[_0x3160('0xc7')]=this[_0x3160('0x1e')][_0x52e2be[_0x3160('0xbe')]][_0x3160('0xc8')]&&this[_0x3160('0x1e')][_0x52e2be[_0x3160('0xbe')]][_0x3160('0xc9')]?moment()[_0x3160('0x49')](_0x3160('0xc4')):undefined;}hopperUtils[_0x3160('0xca')](_0x1d6cb2)['catch'](loggerCatch(_0x3160('0xcb')));hopperUtils[_0x3160('0xcc')](_0x1d6cb2)[_0x3160('0xa1')](loggerCatch('[syncAgentComplete]'));}}};Dialer['prototype'][_0x3160('0x31')]=function(_0x269432){var _0x3c17f2=this[_0x3160('0x26')][_0x269432['uniqueid']];var _0x2c7f0c=this;var _0x418de9=![];var _0x2d7c40;var _0x5cccf7;if(this['voiceQueues'][_0x269432[_0x3160('0xbe')]]){if(_0x3c17f2&&_0x3c17f2[_0x3160('0x44')]!==_0x3160('0xc0')){delete this['uniqueId'][_0x269432[_0x3160('0xbf')]];utils[_0x3160('0xc1')](this[_0x3160('0x1e')][_0x269432['queue']],'[syncQueueCallerAbandon]');_0x3c17f2[_0x3160('0xcd')]=moment()[_0x3160('0x49')](_0x3160('0xc4'));var _0x3a9cde=new QueueCallerAbandon(_0x3c17f2,_0x269432);if(utils[_0x3160('0xce')](_0x3c17f2[_0x3160('0xcd')],_0x3c17f2['responsetime'])>=_0x3c17f2[_0x3160('0xcf')]){this[_0x3160('0x1e')][_0x269432[_0x3160('0xbe')]][_0x3160('0xd0')]+=0x1;this['voiceQueues'][_0x269432[_0x3160('0xbe')]][_0x3160('0xd1')]+=0x1;this[_0x3160('0x1e')][_0x269432[_0x3160('0xbe')]][_0x3160('0xd2')]+=0x1;_0x3a9cde[_0x3160('0x70')]=0xa;_0x3a9cde[_0x3160('0xd3')]='Drop';_0x3a9cde[_0x3160('0xd4')]='TIMEOUT';_0x3a9cde[_0x3160('0xc7')]=this[_0x3160('0x1e')][_0x269432['queue']][_0x3160('0xc8')]?moment()['format'](_0x3160('0xc4')):undefined;_0x3a9cde[_0x3160('0xd5')]+=0x1;_0x3a9cde[_0x3160('0xd6')]+=0x1;_0x2d7c40=this['voiceQueues'][_0x269432[_0x3160('0xbe')]]['dialDropRetryFrequency'];_0x5cccf7=this[_0x3160('0x1e')][_0x269432[_0x3160('0xbe')]][_0x3160('0xd7')];hopperUtils[_0x3160('0xd8')](_0x3a9cde,_0x3a9cde[_0x3160('0x70')],_0x3c17f2[_0x3160('0xd9')])[_0x3160('0x9d')](function(_0x1bf2cc){_0x418de9=_0x1bf2cc['additional']==0x1;if(_0x3a9cde[_0x3160('0xd5')]>=_0x2c7f0c['voiceQueues'][_0x269432[_0x3160('0xbe')]][_0x3160('0xda')]){_0x2c7f0c[_0x3160('0xdb')](_0x3a9cde,_0x1bf2cc['additional']);}else{hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x3a9cde[_0x3160('0xd5')],'scheduledat':moment()[_0x3160('0xdc')](_0x2c7f0c['voiceQueues'][_0x269432[_0x3160('0xbe')]][_0x3160('0xdd')],_0x3160('0xde'))[_0x3160('0x49')](_0x3160('0xc4')),'ContactId':_0x3c17f2['ContactId'],'ListId':_0x3c17f2[_0x3160('0xdf')],'VoiceQueueId':_0x3c17f2[_0x3160('0xe0')]||undefined,'CampaignId':_0x3c17f2[_0x3160('0xe1')]||undefined})['catch'](loggerCatch(_0x3160('0xe2')));var _0x39f60e=new History(_0x3a9cde);_0x39f60e['state']=0xa;_0x39f60e[_0x3160('0xd3')]=_0x3160('0xe3');_0x39f60e[_0x3160('0x72')]=moment()[_0x3160('0x49')](_0x3160('0xc4'));_0x39f60e['endtime']=_0x39f60e[_0x3160('0x72')];_0x39f60e[_0x3160('0xe4')]=_0x3a9cde[_0x3160('0xe4')];_0x39f60e['calleridnum']=_0x3a9cde[_0x3160('0xe5')];hopperUtils[_0x3160('0xca')](_0x39f60e)[_0x3160('0xa1')](loggerCatch(_0x3160('0xe6')));}})[_0x3160('0x9d')](function(){if(_0x418de9)hopperUtils[_0x3160('0xe7')](_0x3a9cde,_0x2d7c40,_0x5cccf7)[_0x3160('0x9d')](function(){return 0x1;});});}else{this['voiceQueues'][_0x269432[_0x3160('0xbe')]][_0x3160('0x55')]+=0x1;this[_0x3160('0x1e')][_0x269432[_0x3160('0xbe')]]['outboundDropCallsDayCallersExit']+=0x1;_0x3a9cde[_0x3160('0x70')]=0xb;_0x3a9cde[_0x3160('0xd3')]='Abandoned';_0x3a9cde[_0x3160('0xd4')]=_0x3160('0xe8');_0x3a9cde['countabandonedretry']+=0x1;_0x3a9cde[_0x3160('0xd6')]+=0x1;_0x2d7c40=this['voiceQueues'][_0x269432[_0x3160('0xbe')]][_0x3160('0xe9')];_0x5cccf7=this[_0x3160('0x1e')][_0x269432[_0x3160('0xbe')]][_0x3160('0xd7')];hopperUtils[_0x3160('0xd8')](_0x3a9cde,_0x3a9cde[_0x3160('0x70')],_0x3c17f2['voiceQueue'])[_0x3160('0x9d')](function(_0x31c80c){if(_0x3a9cde['countabandonedretry']>=_0x2c7f0c[_0x3160('0x1e')][_0x269432[_0x3160('0xbe')]][_0x3160('0xea')]){_0x2c7f0c[_0x3160('0xdb')](_0x3a9cde,_0x31c80c[_0x3160('0xeb')]);}else{hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x3a9cde[_0x3160('0xec')],'scheduledat':moment()['add'](_0x2c7f0c[_0x3160('0x1e')][_0x269432[_0x3160('0xbe')]]['dialAbandonedRetryFrequency'],_0x3160('0xde'))[_0x3160('0x49')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3c17f2['ContactId'],'ListId':_0x3c17f2[_0x3160('0xdf')],'VoiceQueueId':_0x3c17f2['VoiceQueueId']||undefined,'CampaignId':_0x3c17f2['CampaignId']||undefined})[_0x3160('0xa1')](loggerCatch(_0x3160('0xed')));var _0x14a804=new History(_0x3a9cde);_0x14a804[_0x3160('0x70')]=0xb;_0x14a804[_0x3160('0xd3')]='Abandoned';_0x14a804[_0x3160('0x72')]=moment()[_0x3160('0x49')](_0x3160('0xc4'));_0x14a804['endtime']=_0x14a804[_0x3160('0x72')];_0x14a804['calleridname']=_0x3a9cde['calleridname'];_0x14a804[_0x3160('0xe5')]=_0x3a9cde[_0x3160('0xe5')];hopperUtils[_0x3160('0xca')](_0x14a804)[_0x3160('0xa1')](loggerCatch('[syncAgentComplete][createHistory][11]'));}})['then'](function(){if(_0x418de9)hopperUtils['swapAdditionalPhones'](_0x3a9cde,_0x2d7c40,_0x5cccf7)[_0x3160('0x9d')](function(){return 0x1;});});}}}};Dialer[_0x3160('0x19')][_0x3160('0xee')]=function(_0x5dd0ef){if(this[_0x3160('0x24')][_0x5dd0ef[_0x3160('0xbf')]]){this[_0x3160('0x24')][_0x5dd0ef[_0x3160('0xbf')]]['channel']=_0x5dd0ef[_0x3160('0xef')];}if(this[_0x3160('0x26')][_0x5dd0ef[_0x3160('0xbf')]]){this[_0x3160('0x26')][_0x5dd0ef[_0x3160('0xbf')]][_0x3160('0xef')]=_0x5dd0ef[_0x3160('0xef')];}};Dialer[_0x3160('0x19')][_0x3160('0x3c')]=function(_0x5a64db){if(!this['actions'][_0x5a64db['actionid']]){return;}var _0x4cc1eb=this[_0x3160('0x1e')][this[_0x3160('0x24')][_0x5a64db[_0x3160('0xf0')]][_0x3160('0xbe')]][_0x3160('0xf1')]||_0x3160('0xf2');if(_0x4cc1eb==='roundrobin'){if(this[_0x3160('0x24')][_0x5a64db['actionid']]&&_[_0x3160('0xf3')](this[_0x3160('0x24')][_0x5a64db['actionid']][_0x3160('0xf4')])&&_0x5a64db['status']==='1'&&_0x5a64db[_0x3160('0xf5')]==='0'){if(this[_0x3160('0x20')][_0x5a64db['stateinterface']]){if(!this[_0x3160('0x20')][_0x5a64db[_0x3160('0xf6')]][_0x3160('0xf4')]){this[_0x3160('0x20')][_0x5a64db[_0x3160('0xf6')]][_0x3160('0xf4')]=!![];this['actions'][_0x5a64db['actionid']]['locked']=!![];this[_0x3160('0x24')][_0x5a64db[_0x3160('0xf0')]][_0x3160('0xf6')]=_0x5a64db[_0x3160('0xf6')];}}}}else if(_0x4cc1eb===_0x3160('0xf2')){if(this[_0x3160('0x24')][_0x5a64db[_0x3160('0xf0')]]){if(this[_0x3160('0x20')][_0x5a64db['stateinterface']]){this[_0x3160('0x24')][_0x5a64db[_0x3160('0xf0')]][_0x3160('0xf6')]=_0x5a64db[_0x3160('0xf6')];if(_['isNil'](this[_0x3160('0x2b')][this[_0x3160('0x24')][_0x5a64db[_0x3160('0xf0')]]['queue']])){this[_0x3160('0x2b')][this[_0x3160('0x24')][_0x5a64db['actionid']][_0x3160('0xbe')]]=[];}this[_0x3160('0x2b')][this[_0x3160('0x24')][_0x5a64db['actionid']]['queue']][_0x3160('0x98')](_[_0x3160('0x64')](_['pick'](this[_0x3160('0x24')][_0x5a64db[_0x3160('0xf0')]],['idHopper',_0x3160('0xf6')]),{'status':_0x5a64db['status'],'paused':_0x5a64db[_0x3160('0xf5')]}));}}}};Dialer[_0x3160('0x19')][_0x3160('0x3e')]=function(_0x58f313){if(!this[_0x3160('0x24')][_0x58f313[_0x3160('0xf0')]]){return;}var _0x3a813e=this;var _0x440eb2=this[_0x3160('0x1e')][this[_0x3160('0x24')][_0x58f313[_0x3160('0xf0')]][_0x3160('0xbe')]];var _0x369d82=_0x440eb2[_0x3160('0xf1')]||_0x3160('0xf2');if(_0x369d82===_0x3160('0xf7')){if(this['actions'][_0x58f313['actionid']]&&this[_0x3160('0x24')][_0x58f313[_0x3160('0xf0')]][_0x3160('0xf6')]){this[_0x3160('0x1d')][_0x3160('0xf8')](this['actions'][_0x58f313[_0x3160('0xf0')]][_0x3160('0xf9')],this[_0x3160('0x24')][_0x58f313[_0x3160('0xf0')]][_0x3160('0xf6')])[_0x3160('0xa1')](function(_0x37bd20){logger[_0x3160('0x68')]('[Catch][Preview][syncQueueStatusComplete]',util['inspect'](_0x37bd20,{'showHidden':![],'depth':null}));})[_0x3160('0xfa')](function(){utils[_0x3160('0xc1')](_0x3a813e[_0x3160('0x1e')][_0x3a813e[_0x3160('0x24')][_0x58f313[_0x3160('0xf0')]][_0x3160('0xbe')]],_0x3160('0xfb'));_0x3a813e[_0x3160('0x20')][_0x3a813e[_0x3160('0x24')][_0x58f313[_0x3160('0xf0')]][_0x3160('0xf6')]]['locked']=![];delete _0x3a813e['actions'][_0x58f313['actionid']];unlockQueueStatus(_0x440eb2);});}else{utils[_0x3160('0xc1')](this[_0x3160('0x1e')][this[_0x3160('0x24')][_0x58f313[_0x3160('0xf0')]]['queue']],_0x3160('0xfb'));hopperUtils['rescheduleContact']({'active':![],'ContactId':this[_0x3160('0x24')][_0x58f313['actionid']][_0x3160('0xfc')],'ListId':this[_0x3160('0x24')][_0x58f313[_0x3160('0xf0')]][_0x3160('0xdf')],'VoiceQueueId':this[_0x3160('0x24')][_0x58f313[_0x3160('0xf0')]][_0x3160('0xe0')]||undefined,'CampaignId':this[_0x3160('0x24')][_0x58f313['actionid']]['CampaignId']||undefined})['catch'](loggerCatch(_0x3160('0xfd')));delete this[_0x3160('0x24')][_0x58f313[_0x3160('0xf0')]];unlockQueueStatus(_0x440eb2);}}else if(_0x369d82===_0x3160('0xf2')){var _0x4c5f9e;if(this['actions'][_0x58f313[_0x3160('0xf0')]]&&!_[_0x3160('0x4d')](this['queueBooked'][this[_0x3160('0x24')][_0x58f313[_0x3160('0xf0')]][_0x3160('0xbe')]])){if(this[_0x3160('0x2c')][_0x3a813e[_0x3160('0x24')][_0x58f313[_0x3160('0xf0')]]['queue']]){this[_0x3160('0x2c')][_0x3a813e[_0x3160('0x24')][_0x58f313[_0x3160('0xf0')]][_0x3160('0xbe')]]=this[_0x3160('0x2c')][this['actions'][_0x58f313[_0x3160('0xf0')]][_0x3160('0xbe')]]?this[_0x3160('0x2c')][this[_0x3160('0x24')][_0x58f313[_0x3160('0xf0')]][_0x3160('0xbe')]]:this['queueBooked'][this[_0x3160('0x24')][_0x58f313[_0x3160('0xf0')]][_0x3160('0xbe')]]?this[_0x3160('0x2b')][this[_0x3160('0x24')][_0x58f313[_0x3160('0xf0')]][_0x3160('0xbe')]][_0x3160('0xfe')]||0x0:0x0;}this[_0x3160('0x2b')][this[_0x3160('0x24')][_0x58f313[_0x3160('0xf0')]]['queue']][_0x3160('0xfe')]=this[_0x3160('0x2c')][this[_0x3160('0x24')][_0x58f313['actionid']]['queue']];for(var _0x115fdc=0x0;_0x115fdc<this[_0x3160('0x2b')][this['actions'][_0x58f313[_0x3160('0xf0')]]['queue']][_0x3160('0xff')];_0x115fdc+=0x1){_0x4c5f9e=rr(this['queueBooked'][this['actions'][_0x58f313[_0x3160('0xf0')]]['queue']]);this['queueBookedRR'][_0x3a813e['actions'][_0x58f313[_0x3160('0xf0')]]['queue']]=this['queueBooked'][this[_0x3160('0x24')][_0x58f313['actionid']][_0x3160('0xbe')]]['_rr'];if(_0x4c5f9e['status']==='1'&&_0x4c5f9e[_0x3160('0xf5')]==='0'){break;}}if(!_[_0x3160('0xf3')](_0x4c5f9e)){this[_0x3160('0x20')][_0x4c5f9e[_0x3160('0xf6')]]['unlockRR']=_['isUndefined'](this[_0x3160('0x20')][_0x4c5f9e[_0x3160('0xf6')]]['unlockRR'])?!![]:this[_0x3160('0x20')][_0x4c5f9e[_0x3160('0xf6')]][_0x3160('0x100')];}loggerBooked[_0x3160('0x4e')]('[booked][RR]',_0x58f313[_0x3160('0xf0')],_0x3160('0x101'),JSON['stringify'](_['pick'](this[_0x3160('0x20')][_0x4c5f9e[_0x3160('0xf6')]],['name','unlockRR'])),'contactAgent-idHopper:\x20',JSON[_0x3160('0xa7')](_0x4c5f9e[_0x3160('0xf9')]));if(!_[_0x3160('0xf3')](_0x4c5f9e)&&_0x4c5f9e[_0x3160('0x88')]==='1'&&_0x4c5f9e[_0x3160('0xf5')]==='0'&&this[_0x3160('0x20')][_0x4c5f9e[_0x3160('0xf6')]][_0x3160('0x100')]){this[_0x3160('0x20')][_0x4c5f9e[_0x3160('0xf6')]]['unlockRR']=![];this['queueBooked'][_0x3a813e['actions'][_0x58f313[_0x3160('0xf0')]][_0x3160('0xbe')]]=[];this['preview'][_0x3160('0xf8')](_0x4c5f9e[_0x3160('0xf9')],_0x4c5f9e['stateinterface'])['catch'](function(_0x2746d0){logger[_0x3160('0x68')](_0x3160('0x102'),util[_0x3160('0x48')](_0x2746d0,{'showHidden':![],'depth':null}));})['finally'](function(){utils['decrementOriginate'](_0x3a813e[_0x3160('0x1e')][_0x3a813e['actions'][_0x58f313[_0x3160('0xf0')]]['queue']],_0x3160('0xfb'));setTimeout(function(){_0x3a813e[_0x3160('0x20')][_0x4c5f9e[_0x3160('0xf6')]]['unlockRR']=!![];loggerBooked[_0x3160('0x4e')]('[booked][RR][finaly]',_0x58f313[_0x3160('0xf0')],'Agent:\x20',JSON[_0x3160('0xa7')](_[_0x3160('0x103')](_0x3a813e[_0x3160('0x20')][_0x4c5f9e['stateinterface']],[_0x3160('0x4b'),_0x3160('0x100')])),_0x3160('0x104'),JSON[_0x3160('0xa7')](_0x4c5f9e[_0x3160('0xf9')]));},0xc7);delete _0x3a813e[_0x3160('0x24')][_0x58f313[_0x3160('0xf0')]];unlockQueueStatus(_0x440eb2,_0x58f313['actionid']);});}else{loggerBooked['info'](_0x3160('0x105'));utils['decrementOriginate'](this[_0x3160('0x1e')][this['actions'][_0x58f313['actionid']]['queue']],_0x3160('0xfb'));hopperUtils[_0x3160('0x106')]({'active':![],'ContactId':this['actions'][_0x58f313['actionid']][_0x3160('0xfc')],'ListId':this['actions'][_0x58f313[_0x3160('0xf0')]][_0x3160('0xdf')],'VoiceQueueId':this[_0x3160('0x24')][_0x58f313[_0x3160('0xf0')]][_0x3160('0xe0')]||undefined,'CampaignId':this[_0x3160('0x24')][_0x58f313[_0x3160('0xf0')]]['CampaignId']||undefined})[_0x3160('0xa1')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0x3160('0x24')][_0x58f313[_0x3160('0xf0')]];unlockQueueStatus(_0x440eb2);}}else{loggerBooked['info'](_0x3160('0x107'));utils[_0x3160('0xc1')](this[_0x3160('0x1e')][this[_0x3160('0x24')][_0x58f313['actionid']][_0x3160('0xbe')]],_0x3160('0xfb'));hopperUtils[_0x3160('0x106')]({'active':![],'ContactId':this[_0x3160('0x24')][_0x58f313['actionid']][_0x3160('0xfc')],'ListId':this['actions'][_0x58f313[_0x3160('0xf0')]]['ListId'],'VoiceQueueId':this[_0x3160('0x24')][_0x58f313[_0x3160('0xf0')]][_0x3160('0xe0')]||undefined,'CampaignId':this['actions'][_0x58f313[_0x3160('0xf0')]]['CampaignId']||undefined})[_0x3160('0xa1')](loggerCatch(_0x3160('0x108')));delete this[_0x3160('0x24')][_0x58f313[_0x3160('0xf0')]];unlockQueueStatus(_0x440eb2);}}else{loggerBooked['info'](_0x3160('0x109'));utils[_0x3160('0xc1')](this[_0x3160('0x1e')][this[_0x3160('0x24')][_0x58f313[_0x3160('0xf0')]]['queue']],_0x3160('0xfb'));hopperUtils['rescheduleContact']({'active':![],'ContactId':this[_0x3160('0x24')][_0x58f313[_0x3160('0xf0')]][_0x3160('0xfc')],'ListId':this[_0x3160('0x24')][_0x58f313['actionid']][_0x3160('0xdf')],'VoiceQueueId':this[_0x3160('0x24')][_0x58f313['actionid']][_0x3160('0xe0')]||undefined,'CampaignId':this[_0x3160('0x24')][_0x58f313[_0x3160('0xf0')]][_0x3160('0xe1')]||undefined})['catch'](loggerCatch('[unlock3][syncQueueStatusComplete]'));delete this[_0x3160('0x24')][_0x58f313['actionid']];unlockQueueStatus(_0x440eb2);}};Dialer[_0x3160('0x19')]['syncOriginateResponse']=function(_0xe17910){var _0x2e15c1=this[_0x3160('0x24')][_0xe17910[_0x3160('0xf0')]];if(_0x2e15c1){delete this['actions'][_0xe17910[_0x3160('0xf0')]];_0x2e15c1[_0x3160('0x10a')]=moment()['format'](_0x3160('0xc4'));var _0xcd00cb=_0x2e15c1['type']==='ivr'?this[_0x3160('0x1f')][_0x2e15c1[_0x3160('0xbe')]]:this[_0x3160('0x1e')][_0x2e15c1[_0x3160('0x10b')]()];if(_0xe17910[_0x3160('0x10c')]!=='Success'){utils[_0x3160('0xc1')](_0xcd00cb,_0x3160('0x10d'));return this[_0x3160('0x10e')](_0x2e15c1,_0xcd00cb,_0xe17910)[_0x3160('0xa1')](loggerCatch(_0x3160('0x10f')));}this['uniqueId'][_0xe17910[_0x3160('0xbf')]]=_0x2e15c1;}};Dialer[_0x3160('0x19')][_0x3160('0x3a')]=function(_0x410e55){var _0x559e6d=this;var _0x5365a9=this[_0x3160('0x26')][_0x410e55[_0x3160('0xbf')]];var _0x4be23f;if(!_[_0x3160('0xf3')](_0x410e55)&&!_[_0x3160('0xf3')](_0x410e55[_0x3160('0x110')])&&!_[_0x3160('0xf3')](_0x410e55['variable'][_0x3160('0x111')])&&_0x410e55[_0x3160('0x112')]==='xcally-motion-dialer'&&_0x5365a9){if(_0x5365a9[_0x3160('0x44')]!==_0x3160('0xc0')&&this['voiceQueues'][_0x5365a9[_0x3160('0xbe')]][_0x3160('0x113')]&&_0x410e55[_0x3160('0x114')]===_0x3160('0x115')){delete this[_0x3160('0x26')][_0x410e55[_0x3160('0xbf')]];utils[_0x3160('0xc1')](this[_0x3160('0x1e')][_0x5365a9[_0x3160('0xbe')]],_0x3160('0x116'));this[_0x3160('0x1e')][_0x5365a9['queue']][_0x3160('0x117')]+=0x1;this['voiceQueues'][_0x5365a9[_0x3160('0xbe')]][_0x3160('0x118')]+=0x1;_0x4be23f=new Hangup(_0x5365a9,_0x410e55);_0x4be23f[_0x3160('0x70')]=0x12;_0x4be23f[_0x3160('0xd3')]='HangupInAMD';_0x4be23f[_0x3160('0x119')]=_0x3160('0x11a');ami[_0x3160('0x11b')]('custom:amd',ut[_0x3160('0x11c')](_0x4be23f,_0x3160('0x11d')));this[_0x3160('0x11e')](_0x4be23f,'[syncHangupInAMD][createHistory]',_0x3160('0x11f'));}if(_0x5365a9[_0x3160('0x44')]!==_0x3160('0xc0')&&this[_0x3160('0x1e')][_0x5365a9[_0x3160('0xbe')]]['dialAMDActive']&&_0x410e55[_0x3160('0x114')]===_0x3160('0x120')){return new Promise(function(_0x511e19,_0x19eff7){delete _0x559e6d[_0x3160('0x26')][_0x410e55['uniqueid']];utils[_0x3160('0xc1')](_0x559e6d['voiceQueues'][_0x5365a9[_0x3160('0xbe')]],_0x3160('0x116'));_0x559e6d[_0x3160('0x1e')][_0x5365a9[_0x3160('0xbe')]][_0x3160('0x117')]+=0x1;_0x559e6d[_0x3160('0x1e')][_0x5365a9[_0x3160('0xbe')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x55c19e=_0x559e6d[_0x3160('0x1e')][_0x5365a9[_0x3160('0xbe')]];var _0x19f720=new Hangup(_0x5365a9,_0x410e55);_0x19f720[_0x3160('0x70')]=0x13;_0x19f720[_0x3160('0xd3')]=_0x3160('0x121');_0x19f720[_0x3160('0x119')]='AMD';_0x19f720[_0x3160('0x122')]+=0x1;_0x19f720['countglobal']+=0x1;_0x19f720['amd']=!![];ami[_0x3160('0x11b')](_0x3160('0x123'),ut[_0x3160('0x11c')](_0x19f720,_0x3160('0x11d')));hopperUtils[_0x3160('0xca')](_0x19f720)['catch'](loggerCatch(_0x3160('0x124')));if(_0x19f720['countbusyretry']+_0x19f720[_0x3160('0x125')]+_0x19f720[_0x3160('0x126')]+_0x19f720[_0x3160('0x127')]+_0x19f720[_0x3160('0xd5')]+_0x19f720[_0x3160('0xec')]+_0x19f720['countmachineretry']+_0x19f720[_0x3160('0x128')]>=_0x55c19e['dialGlobalMaxRetry']){_0x559e6d[_0x3160('0x129')](_0x19f720,_0x511e19,_0x19eff7,_0x3160('0x12a'));}else{if(_0x19f720['countmachineretry']>=_0x55c19e['dialMachineMaxRetry']){_0x559e6d[_0x3160('0x12b')](_0x19f720,_0x511e19,_0x19eff7,_0x3160('0x12c'));}else{hopperUtils[_0x3160('0x106')]({'active':![],'countmachineretry':_0x19f720['countmachineretry'],'scheduledat':moment()[_0x3160('0xdc')](_0x55c19e[_0x3160('0x12d')],_0x3160('0xde'))[_0x3160('0x49')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x19f720[_0x3160('0xfc')],'ListId':_0x19f720['ListId'],'VoiceQueueId':_0x19f720[_0x3160('0xe0')]||undefined,'CampaignId':_0x19f720[_0x3160('0xe1')]||undefined})[_0x3160('0xa1')](loggerCatch(_0x3160('0x12e')));_0x511e19({'reschedule':0x1});}}});}if(_0x5365a9[_0x3160('0x44')]===_0x3160('0xc0')&&this[_0x3160('0x1f')][_0x5365a9[_0x3160('0xbe')]][_0x3160('0x113')]&&_0x410e55[_0x3160('0x114')]===_0x3160('0x115')){delete this[_0x3160('0x26')][_0x410e55[_0x3160('0xbf')]];utils['decrementOriginate'](this[_0x3160('0x1f')][_0x5365a9['queue']],_0x3160('0x116'));_0x4be23f=new Hangup(_0x5365a9,_0x410e55);_0x4be23f[_0x3160('0x70')]=0x12;_0x4be23f[_0x3160('0xd3')]=_0x3160('0x12f');_0x4be23f['membername']=_0x3160('0x11a');ami['emit'](_0x3160('0x123'),ut['buildObj'](_0x4be23f,'amd'));this[_0x3160('0x11e')](_0x4be23f,'[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]');}if(_0x5365a9[_0x3160('0x44')]===_0x3160('0xc0')&&this['campaigns'][_0x5365a9['queue']][_0x3160('0x113')]&&_0x410e55[_0x3160('0x114')]===_0x3160('0x120')){return new Promise(function(_0x28a326,_0x4123cd){delete _0x559e6d[_0x3160('0x26')][_0x410e55['uniqueid']];utils[_0x3160('0xc1')](_0x559e6d['campaigns'][_0x5365a9[_0x3160('0xbe')]],_0x3160('0x116'));_0x559e6d['campaigns'][_0x5365a9[_0x3160('0xbe')]][_0x3160('0x117')]+=0x1;_0x559e6d[_0x3160('0x1f')][_0x5365a9[_0x3160('0xbe')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x3b79b3=_0x559e6d['campaigns'][_0x5365a9['queue']];var _0x41aa50=new Hangup(_0x5365a9,_0x410e55);_0x41aa50[_0x3160('0x70')]=0x13;_0x41aa50[_0x3160('0xd3')]=_0x3160('0x121');_0x41aa50[_0x3160('0x119')]=_0x3160('0x11a');_0x41aa50['countmachineretry']+=0x1;_0x41aa50[_0x3160('0xd6')]+=0x1;_0x41aa50['amd']=!![];ami['emit'](_0x3160('0x123'),ut['buildObj'](_0x41aa50,_0x3160('0x11d')));hopperUtils[_0x3160('0xca')](_0x41aa50)[_0x3160('0xa1')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x41aa50['countbusyretry']+_0x41aa50[_0x3160('0x125')]+_0x41aa50[_0x3160('0x126')]+_0x41aa50[_0x3160('0x127')]+_0x41aa50[_0x3160('0xd5')]+_0x41aa50[_0x3160('0xec')]+_0x41aa50['countmachineretry']+_0x41aa50[_0x3160('0x128')]>=_0x3b79b3[_0x3160('0x130')]){_0x559e6d[_0x3160('0x129')](_0x41aa50,_0x28a326,_0x4123cd,_0x3160('0x12a'));}else{if(_0x41aa50[_0x3160('0x122')]>=_0x3b79b3[_0x3160('0x131')]){_0x559e6d['createStateFinal'](_0x41aa50,_0x28a326,_0x4123cd,'reason\x2019\x20machine....');}else{hopperUtils[_0x3160('0x106')]({'active':![],'countmachineretry':_0x41aa50[_0x3160('0x122')],'scheduledat':moment()[_0x3160('0xdc')](_0x3b79b3['dialMachineRetryFrequency'],_0x3160('0xde'))['format'](_0x3160('0xc4')),'ContactId':_0x41aa50[_0x3160('0xfc')],'ListId':_0x41aa50[_0x3160('0xdf')],'VoiceQueueId':_0x41aa50[_0x3160('0xe0')]||undefined,'CampaignId':_0x41aa50[_0x3160('0xe1')]||undefined})[_0x3160('0xa1')](loggerCatch(_0x3160('0x12e')));_0x28a326({'reschedule':0x1});}}});}}};Dialer[_0x3160('0x19')][_0x3160('0x38')]=function(_0x4924ef){var _0x33618c=this[_0x3160('0x26')][_0x4924ef[_0x3160('0xbf')]];var _0x4ef816;if(!_0x33618c){return;}if(_0x33618c[_0x3160('0x44')]===_0x3160('0xc0')){delete this[_0x3160('0x26')][_0x4924ef['uniqueid']];utils[_0x3160('0xc1')](this[_0x3160('0x1f')][_0x33618c[_0x3160('0xbe')]],'[syncHangup]');this['campaigns'][_0x33618c[_0x3160('0xbe')]][_0x3160('0x132')]+=0x1;if(_0x4924ef[_0x3160('0x133')]===_0x3160('0x134')){const _0x77d4a7=new AgentComplete(_0x33618c,_0x4924ef);_0x77d4a7['CampaignId']=this[_0x3160('0x1f')][_0x33618c[_0x3160('0xbe')]]['id'];hopperUtils['createHistory'](_0x77d4a7)['catch'](loggerCatch(_0x3160('0x135')));hopperUtils[_0x3160('0xcc')](_0x77d4a7)['catch'](loggerCatch('[syncAgentCompleteIvr]'));}else{_0x4ef816=new Hangup(_0x33618c,_0x4924ef);hopperUtils[_0x3160('0xca')](_0x4ef816)[_0x3160('0xa1')](loggerCatch(_0x3160('0x136')));hopperUtils['moveContactManagedDialer'](_0x4ef816)[_0x3160('0xa1')](loggerCatch(_0x3160('0x137')));}}else{if(isNotNull(this[_0x3160('0x1e')][_0x33618c[_0x3160('0xbe')]][_0x3160('0x138')])){delete this['uniqueId'][_0x4924ef[_0x3160('0xbf')]];utils[_0x3160('0xc1')](this[_0x3160('0x1e')][_0x33618c[_0x3160('0xbe')]],_0x3160('0x139'));this[_0x3160('0x1e')][_0x33618c[_0x3160('0xbe')]][_0x3160('0x117')]+=0x1;this['voiceQueues'][_0x33618c['queue']][_0x3160('0x118')]+=0x1;_0x4ef816=new Hangup(_0x33618c,_0x4924ef);_0x4ef816[_0x3160('0x70')]=0x10;_0x4ef816[_0x3160('0xd3')]=_0x3160('0x13a');_0x4ef816['membername']='AGI';hopperUtils['createHistory'](_0x4ef816)[_0x3160('0xa1')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0x3160('0xcc')](_0x4ef816)[_0x3160('0xa1')](loggerCatch('[syncHangupIvr]'));}else{delete this['uniqueId'][_0x4924ef[_0x3160('0xbf')]];utils[_0x3160('0xc1')](this[_0x3160('0x1e')][_0x33618c['queue']],_0x3160('0x13b'));if(_0x4924ef[_0x3160('0x133')]===_0x3160('0x134')){this['voiceQueues'][_0x33618c[_0x3160('0xbe')]][_0x3160('0x117')]+=0x1;const _0x50bbf3=new AgentComplete(_0x33618c,_0x4924ef);_0x50bbf3[_0x3160('0xe0')]=this[_0x3160('0x1e')][_0x33618c[_0x3160('0xbe')]]['id'];hopperUtils[_0x3160('0xca')](_0x50bbf3)[_0x3160('0xa1')](loggerCatch(_0x3160('0xcb')));hopperUtils[_0x3160('0xcc')](_0x50bbf3)[_0x3160('0xa1')](loggerCatch(_0x3160('0x13c')));}else{this['voiceQueues'][_0x33618c[_0x3160('0xbe')]][_0x3160('0x13d')]+=0x1;_0x4ef816=new Hangup(_0x33618c,_0x4924ef);_0x4ef816[_0x3160('0x70')]=0xc;_0x4ef816['statedesc']=_0x4924ef[_0x3160('0x133')];_0x4ef816['membername']=_0x3160('0x13e');hopperUtils[_0x3160('0xca')](_0x4ef816)[_0x3160('0xa1')](loggerCatch('[syncHangup][createHistory]'));hopperUtils[_0x3160('0xcc')](_0x4ef816)[_0x3160('0xa1')](loggerCatch('[syncHangup]'));}}}};Dialer[_0x3160('0x19')][_0x3160('0xb')]=function(_0x56578b){var _0xd3ed56=this;if(!_0xd3ed56[_0x3160('0x2d')][_0x56578b['name']]){_0xd3ed56['queuesSummary'][_0x56578b['name']]={'running':![]};}else if(_0xd3ed56[_0x3160('0x2d')][_0x56578b[_0x3160('0x4b')]][_0x3160('0x13f')]===!![]){return;}else if(_0xd3ed56[_0x3160('0x2d')][_0x56578b[_0x3160('0x4b')]][_0x3160('0x13f')]===![]){_0xd3ed56['queuesSummary'][_0x56578b[_0x3160('0x4b')]][_0x3160('0x13f')]=!![];}var _0xee335d=_0xd3ed56['voiceQueues'][_0x56578b[_0x3160('0x4b')]];var _0x3b9936=_0xee335d[_0x3160('0x6a')]!==utils[_0x3160('0x6b')]['INACTIVE'];var _0x48b311=utils[_0x3160('0x140')](_0xee335d);_0xee335d['statusMessage']=utils['getQueueCampaignStatusMessage'](_0xee335d,_0xd3ed56[_0x3160('0x21')]);Promise[_0x3160('0x141')]()[_0x3160('0x9d')](function(){if(_0xee335d[_0x3160('0x142')]===utils['CAMPAIGN_STATUS'][_0x3160('0x7a')]){if(_0x3b9936){clearPredictiveAttributes(_0xee335d);_0x56578b[_0x3160('0x28')]=undefined;_0x56578b[_0x3160('0x29')]=undefined;}if(_0xee335d[_0x3160('0x142')]===utils[_0x3160('0x6b')]['INACTIVE']){_0x56578b['available']=0x0;_0x56578b[_0x3160('0xf5')]=0x0;_0x56578b[_0x3160('0x143')]=0x0;_0x56578b[_0x3160('0x144')]=0x0;_0x56578b[_0x3160('0x145')]=0x0;}}else if(_0xee335d['statusMessage']===utils[_0x3160('0x6b')][_0x3160('0x146')]&&!_0x48b311){return _0xd3ed56[_0x3160('0x91')](_0xee335d,!![])[_0x3160('0x9d')](function(){return _0xd3ed56['ifTime'](_0xee335d,![]);})[_0x3160('0x9d')](function(){return _0xd3ed56[_0x3160('0x147')](_0xee335d);})[_0x3160('0xa1')](function(_0x49c6dd){loggerSyncQueueSummary[_0x3160('0x46')](_0x3160('0x148'),util[_0x3160('0x48')](_0x49c6dd,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0xee335d);});}else{clearPredictiveAttributes(_0xee335d);}})[_0x3160('0x9d')](function(){var _0x592488=_0x56578b['compareToOutboundQueue'](_0xee335d);if(_0x592488||_0xee335d['queueSummaryCountersUpdated']){_0xee335d['queueSummaryCountersUpdated']=![];_0x56578b[_0x3160('0x149')](_0xee335d);Object['assign'](_0xee335d,_0x56578b);emitOutboundVoiceQueueSummary(_0x56578b);}_0xd3ed56[_0x3160('0x2d')][_0xee335d[_0x3160('0x4b')]][_0x3160('0x13f')]=![];})[_0x3160('0xa1')](function(_0x34e581){logger[_0x3160('0x68')](_0x3160('0x148'),util[_0x3160('0x48')](_0x34e581,{'showHidden':![],'depth':null}));_0xd3ed56['queuesSummary'][_0xee335d[_0x3160('0x4b')]][_0x3160('0x13f')]=![];});};Dialer['prototype'][_0x3160('0x37')]=_[_0x3160('0x14a')](function(){var _0x1ace42=_[_0x3160('0x14b')](this[_0x3160('0x1e')],function(_0x37daa2){return _0x37daa2['dialPreviewRecallmeReminder'];});var _0x22b323=_['filter'](this['agents'],function(_0xe8975e){return _0xe8975e['online']&&_0xe8975e[_0x3160('0x88')]===_0x3160('0x89');});if(_0x1ace42[_0x3160('0xff')]>0x0&&_0x22b323['length']>0x0){return Promise[_0x3160('0x141')]()['then'](cmHopper['handlePreviewRecallNotifications'](_[_0x3160('0x14c')](_0x1ace42,'id'),previewRecallmeReminderInterval,_[_0x3160('0x14c')](_0x22b323,'id')))[_0x3160('0x9d')](function(_0xaf4267){for(var _0x4c782e=0x0;_0x4c782e<_0xaf4267['length'];_0x4c782e++){var _0x28bbea=_0xaf4267[_0x4c782e][_0x3160('0x14d')][_0x3160('0x4b')];if(_0x28bbea)io['to'](util['format']('user:%s',_0x28bbea))[_0x3160('0x11b')](_0x3160('0x14e'),{'hopper':_0xaf4267[_0x4c782e]});}})[_0x3160('0xa1')](function(_0xa714d){logger[_0x3160('0x68')](_0x3160('0x14f'),_0xa714d);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x3160('0x19')][_0x3160('0x40')]=function(){var _0x4f6a02=this;setInterval(function(){_0x4f6a02[_0x3160('0x150')](_0x4f6a02[_0x3160('0x26')],'[uniqueid]');_0x4f6a02['clearZombieChannels'](_0x4f6a02[_0x3160('0x24')],'[actions]');},0x32c8);};Dialer[_0x3160('0x19')][_0x3160('0x150')]=function(_0x1103f1,_0x5c6123){var _0x4b0481=this;for(var _0x3a8fd7 in _0x1103f1){if(typeof _0x1103f1[_0x3a8fd7]!==_0x3160('0xaa')){this['sequence']['enqueue'](function(){if(!_[_0x3160('0xf3')](_0x1103f1[_0x3a8fd7])){return ami[_0x3160('0x99')]({'action':_0x3160('0x88'),'channel':_0x1103f1[_0x3a8fd7][_0x3160('0xef')]})[_0x3160('0xa1')](function(_0xa585e3){if(_0xa585e3['message']===_0x3160('0x151')){setTimeout(function(){if(_0x1103f1[_0x3a8fd7]&&_0x1103f1[_0x3a8fd7][_0x3160('0x44')]!==_0x3160('0xc0')){utils[_0x3160('0xc1')](_0x4b0481['voiceQueues'][_0x1103f1[_0x3a8fd7]['queue']],_0x3160('0x152'));logger[_0x3160('0x68')](_0x3160('0x153'),_0x5c6123,_0x3a8fd7,_0x1103f1[_0x3a8fd7][_0x3160('0xbe')]);delete _0x1103f1[_0x3a8fd7];}if(_0x1103f1[_0x3a8fd7]&&_0x1103f1[_0x3a8fd7][_0x3160('0x44')]===_0x3160('0xc0')){utils[_0x3160('0xc1')](_0x4b0481[_0x3160('0x1f')][_0x1103f1[_0x3a8fd7]['queue']],_0x3160('0x152'));logger[_0x3160('0x68')](_0x3160('0x154'),_0x5c6123,_0x3a8fd7,_0x1103f1[_0x3a8fd7][_0x3160('0xbe')]);delete _0x1103f1[_0x3a8fd7];}},0x2328);}});}});}}};Dialer[_0x3160('0x19')]['getVoiceQueueRtPauses']=function(_0x513b64){return Promise[_0x3160('0x141')]()[_0x3160('0x9d')](voiceQueueRt['getVoiceQueueRtPauses'](_0x513b64))[_0x3160('0xa1')](loggerCatch(_0x3160('0x155')));};Dialer[_0x3160('0x19')][_0x3160('0x156')]=function(_0x284ea1,_0x1ea89c,_0x5a42d2){var _0x5dc752={'state':0x19,'statedesc':'notFound'};utils[_0x3160('0xc1')](_0x1ea89c,_0x3160('0x157')+_0x284ea1);this['saveInDb'](_[_0x3160('0x64')](_0x5dc752,_['pick'](_0x5a42d2,[_0x3160('0xfc'),_0x3160('0xdf'),'UserId',_0x3160('0xe0'),_0x3160('0xe1')])),_0x3160('0x158'),_0x3160('0x157'));logger[_0x3160('0x68')](_0x284ea1);};Dialer[_0x3160('0x19')][_0x3160('0x11e')]=function(_0x131082,_0x1beb7a,_0x14b40b){hopperUtils['createHistory'](_0x131082)[_0x3160('0xa1')](loggerCatch(_0x1beb7a));hopperUtils[_0x3160('0xcc')](_0x131082)[_0x3160('0xa1')](loggerCatch(_0x14b40b));};Dialer['prototype'][_0x3160('0xdb')]=function(_0x4ef41b,_0x275e23){hopperUtils[_0x3160('0xca')](_0x4ef41b)[_0x3160('0xa1')](loggerCatch('[syncAgentComplete][createHistory]'));if(_0x275e23==0x0){hopperUtils[_0x3160('0xcc')](_0x4ef41b)[_0x3160('0xa1')](loggerCatch(_0x3160('0x159')));}};Dialer['prototype'][_0x3160('0x14f')]=function(_0x5a4ef5){return Promise[_0x3160('0x141')]()['then'](cmHopper['handlePreviewRecallNotifications'](_0x5a4ef5['id'],previewRecallmeReminderInterval))[_0x3160('0x9d')](function(_0x1589e4){for(var _0x1743e3=0x0;_0x1743e3<_0x1589e4[_0x3160('0xff')];_0x1743e3++){var _0x2f6ae1=_0x1589e4[_0x1743e3]['Agent'][_0x3160('0x4b')];if(_0x2f6ae1)io['to'](util[_0x3160('0x49')]('user:%s',_0x2f6ae1))[_0x3160('0x11b')](_0x3160('0x14e'),{'hopper':_0x1589e4[_0x1743e3]});}})[_0x3160('0xa1')](function(){});};Dialer[_0x3160('0x19')][_0x3160('0xaf')]=function(_0x26f3a3){var _0x12043e=this;return function(){_0x12043e[_0x3160('0x15a')](_0x26f3a3);};};Dialer[_0x3160('0x19')][_0x3160('0x15b')]=function(_0x2504db,_0x2625a3){var _0x5beee9=this;var _0x5b9882=uuid['v4']();this[_0x3160('0x24')][_0x5b9882]=new Action(_0x2504db,_0x2625a3,_0x5b9882);return new Promise(function(_0x391690,_0x267336){if(_[_0x3160('0x43')](_0x2504db)&&typeof _0x2504db!=='object'){return _0x267336(msgResponse(_0x3160('0x15c'),_0x3160('0x92'),_0x3160('0x15d')));}if(_[_0x3160('0x43')](_0x2625a3[_0x3160('0x15e')])||_0x2625a3[_0x3160('0x15e')]===null){return _0x267336(msgResponse(_0x3160('0x15c'),'Failure',_0x3160('0x15f')));}var _0x5cebb3={'XMD-CALLERID':_0x5beee9[_0x3160('0x24')][_0x5b9882]['getCaller'](),'XMD-AGI':_0x2504db[_0x3160('0x138')]?util['format'](_0x3160('0x160'),ipAgi,_0x2504db[_0x3160('0x138')]):_0x3160('0x161'),'XMD-AGIAFTER':_0x2504db[_0x3160('0xc8')]?util[_0x3160('0x49')]('\x22agi://%s/square,%s\x22',ipAgi,_0x2504db[_0x3160('0xc8')]):'NONE','XMD-QUEUE':utils['isOutboundQueue'](_0x2504db)?util[_0x3160('0x49')](_0x3160('0x162'),_0x2504db[_0x3160('0x4b')],_0x2504db[_0x3160('0x163')]||'',_0x2504db[_0x3160('0xc9')]?'c':'',_0x2504db[_0x3160('0xcf')]||0x3):_0x3160('0x161'),'XMD-CONTACTID':_0x2625a3[_0x3160('0xfc')],'XMD-CDRTYPE':_0x3160('0x6'),'CALLERID(all)':_0x5beee9[_0x3160('0x24')][_0x5b9882][_0x3160('0x164')](),'XMD-AMD':_0x2504db[_0x3160('0x113')]?_0x3160('0x146'):_0x3160('0x161'),'XMD-DESTINATION':_0x3160('0x165')};if(_0x2504db['dialAMDActive']){_0x5cebb3[_0x3160('0x166')]=_0x2504db[_0x3160('0x167')]||0x9c4;_0x5cebb3[_0x3160('0x168')]=_0x2504db[_0x3160('0x169')]||0x5dc;_0x5cebb3['XMD-AMDAFTERGREETINGSILENCE']=_0x2504db['dialAMDAfterGreetingSilence']||0x320;_0x5cebb3[_0x3160('0x16a')]=_0x2504db[_0x3160('0x16b')]||0x1388;_0x5cebb3[_0x3160('0x16c')]=_0x2504db[_0x3160('0x16d')]||0x64;_0x5cebb3[_0x3160('0x16e')]=_0x2504db[_0x3160('0x16f')]||0x32;_0x5cebb3[_0x3160('0x170')]=_0x2504db[_0x3160('0x171')]||0x3;_0x5cebb3['XMD-AMDSILENCETHRESHOLD']=_0x2504db[_0x3160('0x172')]||0x100;_0x5cebb3['XMD-AMDMAXIMUMWORDLENGTH']=_0x2504db[_0x3160('0x173')]||0x1388;}if(utils[_0x3160('0x174')](_0x2504db)){_0x5cebb3['XMD-VOICEQUEUEID']=_0x2625a3[_0x3160('0xe0')];}else{_0x5cebb3[_0x3160('0x175')]=_0x2625a3[_0x3160('0xe1')];}var _0x1d6834=utils[_0x3160('0x176')](_0x2625a3[_0x3160('0x177')]);Object[_0x3160('0x178')](_0x5cebb3,_0x1d6834);var _0x23d877=_0x5beee9[_0x3160('0x85')](_0x2504db['Trunk'])?utils[_0x3160('0x179')](_0x2504db[_0x3160('0x17a')][_0x3160('0x17b')],_0x2504db[_0x3160('0x17c')],_0x2504db['dialRandomLastDigitCallerIdNumber']>0x0?utils[_0x3160('0x17d')](_0x2504db[_0x3160('0x17e')],_0x2504db[_0x3160('0x17f')]):_0x2504db[_0x3160('0x17e')]):utils['getCallerId'](_[_0x3160('0xf3')](_0x2504db[_0x3160('0x8b')])?_0x2504db['Trunk'][_0x3160('0x17b')]:_0x2504db[_0x3160('0x8b')]['callerid'],_0x2504db[_0x3160('0x17c')],_0x2504db[_0x3160('0x17f')]>0x0?utils[_0x3160('0x17d')](_0x2504db[_0x3160('0x17e')],_0x2504db[_0x3160('0x17f')]):_0x2504db[_0x3160('0x17e')]);if(_0x23d877){_0x5cebb3[_0x3160('0x180')]=_0x5beee9['actions'][_0x5b9882][_0x3160('0x181')]=utils['extractCalleridName'](_0x23d877);_0x5cebb3['XMD-ORIGINATECALLERIDNUM']=_0x2625a3[_0x3160('0x15e')];}_0x2504db[_0x3160('0x182')]=_0x5cebb3;return ami['Action']({'actionid':_0x5b9882,'action':'originate','channel':_0x5beee9[_0x3160('0x85')](_0x2504db[_0x3160('0x17a')])?util[_0x3160('0x49')]('SIP/%s/%s%s',_0x2504db[_0x3160('0x17a')][_0x3160('0x4b')],isNotNull(_0x2504db[_0x3160('0x183')])?_0x2504db[_0x3160('0x183')]['trim']()||'':'',_0x2504db[_0x3160('0x184')]>0x0?_0x2625a3['phone'][_0x3160('0x185')](_0x2504db['dialCutDigit']):_0x2625a3[_0x3160('0x15e')]):util[_0x3160('0x49')](_0x3160('0x186'),_[_0x3160('0xf3')](_0x2504db[_0x3160('0x8b')])?_0x2504db[_0x3160('0x17a')][_0x3160('0x4b')]:_0x2504db[_0x3160('0x8b')][_0x3160('0x4b')],isNotNull(_0x2504db[_0x3160('0x183')])?_0x2504db[_0x3160('0x183')][_0x3160('0x187')]()||'':'',_0x2504db[_0x3160('0x184')]>0x0?_0x2625a3[_0x3160('0x15e')][_0x3160('0x185')](_0x2504db[_0x3160('0x184')]):_0x2625a3[_0x3160('0x15e')]),'callerid':_0x23d877,'Exten':_0x3160('0x165'),'Context':'from-sip','Priority':'1','variable':_0x5cebb3,'timeout':(_0x2504db[_0x3160('0x188')]||0x1e)*0x3e8,'async':!![],'channelid':_0x5b9882})[_0x3160('0x9d')](function(_0x4098b6){return _0x391690(_0x4098b6);})[_0x3160('0xa1')](function(_0x3a78f0){_0x2504db[_0x3160('0x189')]+=0x1;var _0x4db7ec=new History(_0x5beee9[_0x3160('0x24')][_0x5b9882]);logger[_0x3160('0x68')](util[_0x3160('0x49')](_0x3160('0x18a'),JSON['stringify'](_0x3a78f0)));_0x4db7ec[_0x3160('0x70')]=0xe;_0x4db7ec['statedesc']='OriginateError';_0x4db7ec[_0x3160('0x72')]=moment()[_0x3160('0x49')](_0x3160('0xc4'));_0x4db7ec[_0x3160('0x71')]=_0x4db7ec[_0x3160('0x72')];hopperUtils[_0x3160('0xca')](_0x4db7ec)[_0x3160('0xa1')](loggerCatch(_0x3160('0x18b')));_0x5beee9['moveContactManagedDialer'](_0x4db7ec)['catch'](loggerCatch(_0x3160('0x18b')))[_0x3160('0xfa')](function(){delete _0x5beee9[_0x3160('0x24')][_0x5b9882];return _0x267336(msgResponse('originate',_0x3160('0x84'),_0x3160('0x18c')));});});});};Dialer[_0x3160('0x19')][_0x3160('0x18d')]=function(_0xa07018,_0x59854c,_0x2ec843){var _0x862613=new History(_0x59854c);if(_0x862613[_0x3160('0x18e')]+_0x862613['countcongestionretry']+_0x862613[_0x3160('0x126')]+_0x862613[_0x3160('0x127')]+_0x862613['countdropretry']+_0x862613['countabandonedretry']+_0x862613[_0x3160('0x122')]+_0x862613[_0x3160('0x128')]>=_0x2ec843[_0x3160('0x130')]-0x1){return!![];}switch(_0xa07018){case 0x3:if(_0x862613[_0x3160('0x126')]>=_0x2ec843['dialNoAnswerMaxRetry']-0x1){return!![];}hopperUtils[_0x3160('0x106')]({'active':![],'countnoanswerretry':_0x862613[_0x3160('0x126')]+=0x1,'scheduledat':moment()[_0x3160('0xdc')](_0x2ec843[_0x3160('0x18f')],_0x3160('0xde'))['format'](_0x3160('0xc4')),'ContactId':_0x862613[_0x3160('0xfc')],'ListId':_0x862613[_0x3160('0xdf')],'VoiceQueueId':_0x862613[_0x3160('0xe0')]||undefined,'CampaignId':_0x862613[_0x3160('0xe1')]||undefined})[_0x3160('0xa1')](loggerCatch(_0x3160('0x190')));break;case 0x5:if(_0x862613[_0x3160('0x18e')]>=_0x2ec843[_0x3160('0x191')]-0x1){return!![];}hopperUtils[_0x3160('0x106')]({'active':![],'countbusyretry':_0x862613[_0x3160('0x18e')]+=0x1,'scheduledat':moment()[_0x3160('0xdc')](_0x2ec843[_0x3160('0x192')],_0x3160('0xde'))[_0x3160('0x49')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x862613['ContactId'],'ListId':_0x862613[_0x3160('0xdf')],'VoiceQueueId':_0x862613[_0x3160('0xe0')]||undefined,'CampaignId':_0x862613[_0x3160('0xe1')]||undefined})[_0x3160('0xa1')](loggerCatch(_0x3160('0x193')));break;case 0x8:if(_0x862613[_0x3160('0x125')]>=_0x2ec843['dialCongestionMaxRetry']-0x1){return!![];}hopperUtils[_0x3160('0x106')]({'active':![],'countcongestionretry':_0x862613[_0x3160('0x125')]+=0x1,'scheduledat':moment()[_0x3160('0xdc')](_0x2ec843[_0x3160('0x194')],_0x3160('0xde'))[_0x3160('0x49')](_0x3160('0xc4')),'ContactId':_0x862613[_0x3160('0xfc')],'ListId':_0x862613[_0x3160('0xdf')],'VoiceQueueId':_0x862613[_0x3160('0xe0')]||undefined,'CampaignId':_0x862613[_0x3160('0xe1')]||undefined})['catch'](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x862613[_0x3160('0x127')]>=_0x2ec843[_0x3160('0x195')]-0x1){return!![];}else{hopperUtils['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x862613[_0x3160('0x127')]+=0x1,'scheduledat':moment()[_0x3160('0xdc')](_0x2ec843[_0x3160('0x196')],_0x3160('0xde'))['format'](_0x3160('0xc4')),'ContactId':_0x862613[_0x3160('0xfc')],'ListId':_0x862613[_0x3160('0xdf')],'VoiceQueueId':_0x862613[_0x3160('0xe0')]||undefined,'CampaignId':_0x862613['CampaignId']||undefined})[_0x3160('0xa1')](loggerCatch(_0x3160('0x197')));}break;case 0xa:if(_0x862613[_0x3160('0xd5')]>=_0x2ec843[_0x3160('0xda')]-0x1){return!![];}hopperUtils[_0x3160('0x106')]({'active':![],'countdropretry':_0x862613[_0x3160('0xd5')]+=0x1,'scheduledat':moment()[_0x3160('0xdc')](_0x2ec843[_0x3160('0xdd')],_0x3160('0xde'))[_0x3160('0x49')](_0x3160('0xc4')),'ContactId':_0x862613[_0x3160('0xfc')],'ListId':_0x862613[_0x3160('0xdf')],'VoiceQueueId':_0x862613[_0x3160('0xe0')]||undefined,'CampaignId':_0x862613['CampaignId']||undefined})[_0x3160('0xa1')](loggerCatch(_0x3160('0xe2')));break;case 0xb:if(_0x862613[_0x3160('0xec')]>=_0x2ec843[_0x3160('0xea')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x862613[_0x3160('0xec')]+=0x1,'scheduledat':moment()[_0x3160('0xdc')](_0x2ec843[_0x3160('0xe9')],_0x3160('0xde'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x862613[_0x3160('0xfc')],'ListId':_0x862613[_0x3160('0xdf')],'VoiceQueueId':_0x862613['VoiceQueueId']||undefined,'CampaignId':_0x862613['CampaignId']||undefined})[_0x3160('0xa1')](loggerCatch(_0x3160('0xed')));break;case 0x13:if(_0x862613[_0x3160('0x122')]>=_0x2ec843[_0x3160('0x131')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x862613[_0x3160('0x122')]+=0x1,'scheduledat':moment()[_0x3160('0xdc')](_0x2ec843[_0x3160('0x12d')],_0x3160('0xde'))[_0x3160('0x49')](_0x3160('0xc4')),'ContactId':_0x862613[_0x3160('0xfc')],'ListId':_0x862613[_0x3160('0xdf')],'VoiceQueueId':_0x862613[_0x3160('0xe0')]||undefined,'CampaignId':_0x862613[_0x3160('0xe1')]||undefined})[_0x3160('0xa1')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x862613[_0x3160('0x128')]>=_0x2ec843[_0x3160('0x198')]-0x1){return!![];}hopperUtils[_0x3160('0x106')]({'active':![],'countagentrejectretry':_0x862613[_0x3160('0x128')]+=0x1,'scheduledat':moment()[_0x3160('0xdc')](_0x2ec843[_0x3160('0x199')],_0x3160('0xde'))[_0x3160('0x49')](_0x3160('0xc4')),'ContactId':_0x862613[_0x3160('0xfc')],'ListId':_0x862613[_0x3160('0xdf')],'VoiceQueueId':_0x862613[_0x3160('0xe0')]||undefined,'CampaignId':_0x862613['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0x3160('0x19')][_0x3160('0x10e')]=function(_0x4af5f4,_0x3c1706,_0x4370d9){var _0x122d60=this;var _0x4b0505=new History(_0x4af5f4);var _0x49f569=![];var _0x1956ee;var _0x3c479e;return new Promise(function(_0x3c2143,_0x24442c){if(_[_0x3160('0x43')](_0x3c1706)&&typeof _0x3c1706!==_0x3160('0x19a')){return _0x24442c(msgResponse(_0x3160('0x19b'),'Failure','entity\x20is\x20undefine'));}if(_[_0x3160('0x43')](_0x4370d9)&&typeof _0x4370d9!=='object'){return _0x24442c(msgResponse(_0x3160('0x19b'),_0x3160('0x92'),_0x3160('0x19c')));}hopperUtils[_0x3160('0xd8')](_0x4b0505,_0x4370d9['reason'],_0x3c1706)['then'](function(_0xd92e2e){if(_0xd92e2e[_0x3160('0xeb')]==0x1)_0x49f569=!![];switch(_0x4370d9[_0x3160('0xc5')]){case'0':_0x3c1706[_0x3160('0x19d')]+=0x1;_0x4b0505[_0x3160('0x70')]=0x0;_0x4b0505[_0x3160('0xd3')]=_0x3160('0x19e');_0x4b0505[_0x3160('0x127')]+=0x1;_0x4b0505['countglobal']+=0x1;ami[_0x3160('0x11b')](_0x3160('0x19f'),ut[_0x3160('0x11c')](_0x4af5f4,_0x3160('0x1a0')));_0x1956ee=_0x3c1706['dialNoSuchNumberRetryFrequency'];_0x3c479e=_0x3c1706[_0x3160('0xd7')];hopperUtils[_0x3160('0xca')](_0x4b0505)[_0x3160('0xa1')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x122d60[_0x3160('0x18d')](0x0,_0x4af5f4,_0x3c1706)&&!_0x49f569){if(_0x4b0505[_0x3160('0x127')]>=_0x3c1706[_0x3160('0x195')]){_0x122d60[_0x3160('0x12b')](_0x4b0505,_0x3c2143,_0x24442c,'reason\x200\x20no\x20such\x20number....');}else{_0x122d60['stateGlobal'](_0x4b0505,_0x3c2143,_0x24442c,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x3c1706[_0x3160('0x1a1')]+=0x1;_0x4b0505[_0x3160('0x70')]=0x3;_0x4b0505[_0x3160('0xd3')]=_0x3160('0x1a2');_0x4b0505[_0x3160('0x126')]+=0x1;_0x4b0505[_0x3160('0xd6')]+=0x1;var _0x132a58=ut['buildNoAnswerEventPayload'](_0x4af5f4,_0x3c1706);ami['emit'](_0x3160('0x1a3'),_0x132a58);_0x1956ee=_0x3c1706[_0x3160('0x18f')];_0x3c479e=_0x3c1706[_0x3160('0xd7')];hopperUtils[_0x3160('0xca')](_0x4b0505)['catch'](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x122d60[_0x3160('0x18d')](0x3,_0x4af5f4,_0x3c1706)&&!_0x49f569){if(_0x4b0505[_0x3160('0x126')]>=_0x3c1706[_0x3160('0x1a4')]){_0x122d60[_0x3160('0x12b')](_0x4b0505,_0x3c2143,_0x24442c,_0x3160('0x1a5'));}else{_0x122d60[_0x3160('0x129')](_0x4b0505,_0x3c2143,_0x24442c,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x3c1706['outboundBusyCallsDay']+=0x1;_0x4b0505[_0x3160('0x70')]=0x5;_0x4b0505[_0x3160('0xd3')]=_0x3160('0x1a6');_0x4b0505['countbusyretry']+=0x1;_0x4b0505['countglobal']+=0x1;ami['emit']('custom:agentbusy',ut['buildObj'](_0x4af5f4,_0x3160('0x1a7')));_0x1956ee=_0x3c1706['dialBusyRetryFrequency'];_0x3c479e=_0x3c1706[_0x3160('0xd7')];hopperUtils['createHistory'](_0x4b0505)[_0x3160('0xa1')](loggerCatch(_0x3160('0x1a8')));if(_0x122d60[_0x3160('0x18d')](0x5,_0x4af5f4,_0x3c1706)&&!_0x49f569){if(_0x4b0505[_0x3160('0x18e')]>=_0x3c1706['dialBusyMaxRetry']){_0x122d60[_0x3160('0x12b')](_0x4b0505,_0x3c2143,_0x24442c,_0x3160('0x1a9'));}else{_0x122d60[_0x3160('0x129')](_0x4b0505,_0x3c2143,_0x24442c,_0x3160('0x1a9'));}}break;case'8':_0x3c1706[_0x3160('0x1aa')]+=0x1;_0x4b0505[_0x3160('0x70')]=0x8;_0x4b0505['statedesc']='Congestion';_0x4b0505[_0x3160('0x125')]+=0x1;_0x4b0505[_0x3160('0xd6')]+=0x1;_0x1956ee=_0x3c1706[_0x3160('0x194')];_0x3c479e=_0x3c1706[_0x3160('0xd7')];ami['emit'](_0x3160('0x1ab'),ut['buildObj'](_0x4af5f4,_0x3160('0x1ac')));hopperUtils[_0x3160('0xca')](_0x4b0505)[_0x3160('0xa1')](loggerCatch(_0x3160('0x1ad')));if(_0x122d60[_0x3160('0x18d')](0x8,_0x4af5f4,_0x3c1706)&&!_0x49f569){if(_0x4b0505[_0x3160('0x125')]>=_0x3c1706[_0x3160('0x1ae')]){_0x122d60[_0x3160('0x12b')](_0x4b0505,_0x3c2143,_0x24442c,'reason\x208\x20congestion');}else{_0x122d60[_0x3160('0x129')](_0x4b0505,_0x3c2143,_0x24442c,_0x3160('0x1af'));}}break;case'11':_0x3c1706[_0x3160('0x1b0')]+=0x1;_0x4b0505[_0x3160('0x70')]=0xb;_0x4b0505['statedesc']='Abandoned';_0x4b0505['countabandonedretry']+=0x1;_0x4b0505[_0x3160('0xd6')]+=0x1;_0x1956ee=_0x3c1706[_0x3160('0xe9')];_0x3c479e=_0x3c1706[_0x3160('0xd7')];hopperUtils['createHistory'](_0x4b0505)[_0x3160('0xa1')](loggerCatch(_0x3160('0x1b1')));if(_0x122d60[_0x3160('0x18d')](0xb,_0x4af5f4,_0x3c1706)&&!_0x49f569){if(_0x4b0505[_0x3160('0xec')]>=_0x3c1706[_0x3160('0xea')]){_0x122d60[_0x3160('0x12b')](_0x4b0505,_0x3c2143,_0x24442c,_0x3160('0x1b2'));}else{_0x122d60[_0x3160('0x129')](_0x4b0505,_0x3c2143,_0x24442c,_0x3160('0x1b2'));}}break;case'20':_0x3c1706['outboundRejectCallsDay']+=0x1;_0x4b0505[_0x3160('0x70')]=0x14;_0x4b0505[_0x3160('0xd3')]=_0x3160('0x1b3');_0x4b0505[_0x3160('0x128')]+=0x1;_0x4b0505[_0x3160('0xd6')]+=0x1;_0x1956ee=_0x3c1706[_0x3160('0x199')];_0x3c479e=_0x3c1706[_0x3160('0xd7')];ami[_0x3160('0x11b')](_0x3160('0x1b4'),ut['buildObj'](_0x4af5f4,_0x3160('0x1b5')));hopperUtils['createHistory'](_0x4b0505)[_0x3160('0xa1')](loggerCatch(_0x3160('0x1b6')));if(_0x122d60[_0x3160('0x18d')](0x14,_0x4af5f4,_0x3c1706)&&!_0x49f569){if(_0x4b0505[_0x3160('0x128')]>=_0x3c1706[_0x3160('0x198')]){_0x122d60[_0x3160('0x12b')](_0x4b0505,_0x3c2143,_0x24442c,'reason\x2020\x20agentreject');}else{_0x122d60[_0x3160('0x129')](_0x4b0505,_0x3c2143,_0x24442c,_0x3160('0x1b7'));}}break;default:_0x3c1706['outboundUnknownCallsDay']+=0x1;_0x4b0505[_0x3160('0x70')]=0xc;_0x4b0505[_0x3160('0xd3')]=_0x4370d9[_0x3160('0xc5')];_0x1956ee=_0x3c1706[_0x3160('0x199')];_0x3c479e=_0x3c1706[_0x3160('0xd7')];hopperUtils[_0x3160('0xca')](_0x4b0505)['catch'](loggerCatch(_0x3160('0x1b8')));if(_0x122d60[_0x3160('0x18d')](_0x4370d9['reason'],_0x4af5f4,_0x3c1706)&&!_0x49f569){if(_0x4b0505[_0x3160('0x18e')]+_0x4b0505[_0x3160('0x125')]+_0x4b0505[_0x3160('0x126')]+_0x4b0505[_0x3160('0x127')]+_0x4b0505[_0x3160('0xd5')]+_0x4b0505[_0x3160('0xec')]+_0x4b0505['countmachineretry']+_0x4b0505[_0x3160('0x128')]>=_0x3c1706['dialGlobalMaxRetry']){_0x122d60[_0x3160('0x129')](_0x4b0505,_0x3c2143,_0x24442c,_0x4370d9[_0x3160('0xc5')]);}else{_0x122d60[_0x3160('0x12b')](_0x4b0505,_0x3c2143,_0x24442c,_0x4370d9[_0x3160('0xc5')]);}}}})[_0x3160('0x9d')](function(){if(_0x49f569){hopperUtils[_0x3160('0xe7')](_0x4b0505,_0x1956ee,_0x3c479e)[_0x3160('0x9d')](function(){return _0x3c2143(0x1);});}});});};Dialer[_0x3160('0x19')][_0x3160('0x129')]=function(_0x4663e9,_0x1fadcb,_0x208c44,_0x573515){var _0x5411c9=new Final(_0x4663e9);_0x5411c9['state']=0xf;_0x5411c9[_0x3160('0xd3')]=_0x3160('0x1b9');this[_0x3160('0x12b')](_0x5411c9,_0x1fadcb,_0x208c44,_0x573515);};Dialer[_0x3160('0x19')]['createStateFinal']=function(_0x320c0a,_0x4c3d18,_0x4f2284,_0x3fec86){hopperUtils[_0x3160('0xcc')](_0x320c0a)[_0x3160('0x9d')](function(){return _0x4c3d18(msgResponse('[callProgressDetecting]','Success',_0x3fec86));})['catch'](function(){return _0x4f2284(msgResponse(_0x3160('0x1ba'),_0x3160('0x92'),'contact\x20not\x20moved'));});};Dialer[_0x3160('0x19')]['predictive']=function(_0x5a32fa){var _0xb2087d=_0x5a32fa[_0x3160('0x1bb')]/0x64;var _0x20779a=_0x5a32fa[_0x3160('0xd1')]/(_0x5a32fa[_0x3160('0xd1')]+_0x5a32fa[_0x3160('0x117')]);var _0x455bc9=Math[_0x3160('0x1bc')](_0x5a32fa[_0x3160('0x1bd')]*(_0x5a32fa[_0x3160('0x1be')]/0x64));var _0x27ed50=Math[_0x3160('0x1bc')](_0x5a32fa[_0x3160('0x1bd')]*(_0x5a32fa[_0x3160('0x1bf')]/0x64));var _0x300b17=_0x5a32fa[_0x3160('0x1c0')]+_0x5a32fa[_0x3160('0x144')];var _0x439a77=Math[_0x3160('0x1c1')](_0x5a32fa[_0x3160('0x1c2')]*_0x5a32fa[_0x3160('0x62')]*_0x5a32fa[_0x3160('0x1c3')]*_0x5a32fa[_0x3160('0x1c4')]);if(_[_0x3160('0x43')](_0x5a32fa[_0x3160('0x29')])){if(!_['isUndefined'](_0x5a32fa[_0x3160('0x28')])){_0x5a32fa['startPredictive']=undefined;loggerPredictive[_0x3160('0x68')](_0x3160('0x1c5'),_0x3160('0x1c6'));}if(!_[_0x3160('0x43')](_0x5a32fa[_0x3160('0x66')])){loggerPredictive[_0x3160('0x68')](_0x3160('0x1c5'),_0x3160('0x1c7'));clearInterval(_0x5a32fa[_0x3160('0x66')]);_0x5a32fa['handlePredictive']=undefined;}_0x5a32fa[_0x3160('0x29')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x3160('0x4e')](_0x5a32fa[_0x3160('0x4b')],_0x3160('0x1c8'),_0x5a32fa['startProgressive']);this[_0x3160('0xb3')](_0x5a32fa,0x1);}else if(ifInterval(_0x5a32fa['dialPredictiveInterval'],_0x5a32fa[_0x3160('0x29')])){this['handlePower'](_0x5a32fa,0x1);loggerPredictiveCalls[_0x3160('0x4e')](_0x3160('0x1c9'),_0x5a32fa[_0x3160('0x29')],_0x5a32fa['name']);_0x5a32fa[_0x3160('0x1c2')]=0x0;_0x5a32fa[_0x3160('0xd2')]=0x0;}else if(_0xb2087d<_0x20779a&&_0x5a32fa[_0x3160('0x1ca')]==='dropRate'){clearPredictiveAttributes(_0x5a32fa);loggerPredictive[_0x3160('0x4e')](_0x3160('0x1cb'),_0x3160('0x1cc'),_0x20779a,'startProgressive',_0x5a32fa[_0x3160('0x4b')]);}else if(_0x439a77<_0x5a32fa[_0x3160('0xd2')]&&_0x5a32fa[_0x3160('0x1ca')]===_0x3160('0x1cd')){clearPredictiveAttributes(_0x5a32fa);loggerPredictive['info'](_0x3160('0x1ce'),_0x3160('0x1cf'),_0x439a77,'Drop\x20in\x20this\x20interval',_0x5a32fa[_0x3160('0xd2')],'startProgressive',_0x5a32fa[_0x3160('0x4b')]);}else if(!ifInterval(_0x5a32fa['dialPredictiveInterval'],_0x5a32fa[_0x3160('0x29')])&&_[_0x3160('0x43')](_0x5a32fa[_0x3160('0x28')])&&!_[_0x3160('0x43')](_0x5a32fa['startProgressive'])){_0x5a32fa[_0x3160('0x28')]=moment()[_0x3160('0x49')](_0x3160('0xc4'));loggerPredictive[_0x3160('0x4e')](_0x5a32fa[_0x3160('0x4b')],_0x3160('0x1d0'),_0x5a32fa[_0x3160('0x28')]);hopperUtils['avgHandleTime'](_0x5a32fa[_0x3160('0x1d1')])[_0x3160('0x9d')](this[_0x3160('0x1d2')](_0x5a32fa))['then'](mergeDataErlangB(_0x5a32fa))[_0x3160('0x9d')](this[_0x3160('0x1d3')](_0x5a32fa))[_0x3160('0xa1')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x5a32fa));}else if(!ifInterval(_0x5a32fa['dialPredictiveInterval'],_0x5a32fa[_0x3160('0x28')])){_0x5a32fa[_0x3160('0xd2')]=0x0;_0x5a32fa[_0x3160('0x28')]=moment()[_0x3160('0x49')](_0x3160('0xc4'));loggerPredictive[_0x3160('0x4e')](_0x5a32fa[_0x3160('0x4b')],_0x3160('0x1d4'),_0x5a32fa[_0x3160('0x28')]);clearInterval(_0x5a32fa[_0x3160('0x66')]);_0x5a32fa[_0x3160('0x66')]=undefined;hopperUtils['avgHandleTime'](_0x5a32fa[_0x3160('0x1d1')])[_0x3160('0x9d')](this['getDataPredictive'](_0x5a32fa))['then'](mergeDataErlangB(_0x5a32fa))['then'](this[_0x3160('0x1d3')](_0x5a32fa))['catch'](loggerCatchPredictive(_0x3160('0x1d5'),_0x5a32fa));}else if(_0x5a32fa[_0x3160('0x1bd')]&&_0x300b17<_0x5a32fa['predictiveIntervalAvailable']-_0x27ed50){clearPredictiveAttributes(_0x5a32fa);loggerPredictive[_0x3160('0x4e')](_0x5a32fa[_0x3160('0x4b')],_0x3160('0x1d6'),_0x300b17,_0x3160('0x1d7'),_0x5a32fa['predictiveIntervalAvailable'],'-',_0x27ed50,'=',_0x5a32fa[_0x3160('0x1bd')]-_0x27ed50,')');}else if(_0x5a32fa[_0x3160('0x1bd')]&&_0x300b17>_0x5a32fa[_0x3160('0x1bd')]+_0x455bc9){clearPredictiveAttributes(_0x5a32fa);loggerPredictive[_0x3160('0x4e')](_0x5a32fa[_0x3160('0x4b')],_0x3160('0x1d6'),_0x300b17,_0x3160('0x1d8'),_0x5a32fa['predictiveIntervalAvailable'],'+',_0x455bc9,'=',_0x5a32fa['predictiveIntervalAvailable']+_0x455bc9,')');}};Dialer[_0x3160('0x19')][_0x3160('0x1d2')]=function(_0x389208){var _0x504854=this;return function(_0x5a86f7){return new Promise(function(_0xee8a4b,_0x505b63){_[_0x3160('0x64')](_0x389208,_0x5a86f7[0x0]);if(checkGetDataPredictive(_0x5a86f7[0x0])){var _0x45d854=_0x389208[_0x3160('0x1bd')]=_0x389208['talking']+_0x389208[_0x3160('0x1c0')];var _0x3618cf=_0x389208[_0x3160('0x1d1')]*0x3c;var _0x34f75c=_0x5a86f7[0x0][_0x3160('0x59')]+_0x5a86f7[0x0][_0x3160('0x57')];var _0x193433=(_0x5a86f7[0x0][_0x3160('0x52')]+_0x5a86f7[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x5a86f7[0x0][_0x3160('0x55')])/_0x5a86f7[0x0][_0x3160('0x50')];_0x389208[_0x3160('0x1c3')]=_0x193433>0x0?_0x193433:0x1;switch(_0x389208['dialPredictiveOptimization']){case _0x3160('0x1cd'):var _0x2d06cf=_0x389208[_0x3160('0x1bb')]/0x64;return _0x504854[_0x3160('0x1d9')](_0x45d854,_0x3618cf,_0x34f75c,_0x193433,_0x2d06cf)[_0x3160('0x9d')](function(_0x156736){return _0xee8a4b(_0x156736);});case _0x3160('0x1da'):var _0x2f63a8=_0x389208[_0x3160('0x1bb')]/0x64;return _0x504854[_0x3160('0x1db')](_0x45d854,_0x3618cf,_0x34f75c,_0x193433,_0x2f63a8)['then'](function(_0x5d6f4d){return _0xee8a4b(_0x5d6f4d);});default:return _0x505b63(msgResponse(_0x3160('0x1dc'),_0x3160('0x92'),_0x3160('0x1dd')));}}else{return _0x505b63(msgResponse(_0x3160('0x1dc'),'Failure','check\x20failure'));}});};};Dialer['prototype'][_0x3160('0x1de')]=function(_0x4df399){var _0x23d217=this;return function(_0x51773a){return new Promise(function(_0x19cca0,_0x2bebd4){_[_0x3160('0x64')](_0x4df399,_0x51773a[0x0]);if(checkGetDataPredictive(_0x51773a[0x0])){loggerPredictive[_0x3160('0x4e')](JSON[_0x3160('0xa7')](_0x51773a[0x0]));if(_0x4df399[_0x3160('0x1ca')]==='dropRate'){return _0x23d217['getVoiceQueueRtPauses'](_0x4df399['id'])['then'](function(_0x31d231){var _0xe28259=_0x4df399[_0x3160('0x1df')]-_0x31d231[0x0][_0x3160('0x1e0')];var _0x47f90c=_0x4df399[_0x3160('0x1d1')]*0x3c;var _0x3c9878=_0x51773a[0x0][_0x3160('0x59')]+_0x51773a[0x0][_0x3160('0x57')];var _0x5b3e1e=(_0x51773a[0x0]['predictiveIntervalAnsweredCalls']+_0x51773a[0x0][_0x3160('0xd0')]+_0x51773a[0x0][_0x3160('0x55')])/_0x51773a[0x0][_0x3160('0x50')];var _0x4cb9fd=_0x4df399[_0x3160('0x1bb')]/0x64;_0x4df399[_0x3160('0x1e1')]=_0x31d231[0x0][_0x3160('0x1e0')]||0x0;_0x4df399[_0x3160('0x1c3')]=_0x5b3e1e>0x0?_0x5b3e1e:0x1;return _0x23d217[_0x3160('0x1d9')](_0xe28259,_0x47f90c,_0x3c9878,_0x5b3e1e,_0x4cb9fd);})[_0x3160('0x9d')](function(_0x4ce3c0){return _0x19cca0(_0x4ce3c0);})['catch'](function(_0x52cc7f){return _0x2bebd4(msgResponse(_0x3160('0x1e2'),_0x3160('0x92'),JSON[_0x3160('0xa7')](_0x52cc7f)));});}if(_0x4df399[_0x3160('0x1ca')]===_0x3160('0x1da')){return _0x23d217[_0x3160('0x1e3')](_0x4df399['id'])['then'](function(_0x489363){var _0x41f1d0=_0x4df399[_0x3160('0x1df')]-_0x489363[0x0][_0x3160('0x1e0')];var _0x402279=_0x4df399[_0x3160('0x1d1')]*0x3c;var _0x5a3a81=_0x51773a[0x0]['predictiveIntervalAvgTalktime']+_0x51773a[0x0][_0x3160('0x57')];var _0x47c472=(_0x51773a[0x0]['predictiveIntervalAnsweredCalls']+_0x51773a[0x0][_0x3160('0xd0')]+_0x51773a[0x0][_0x3160('0x55')])/_0x51773a[0x0][_0x3160('0x50')];var _0x4719af=_0x4df399[_0x3160('0x1bb')]/0x64;_0x4df399[_0x3160('0x1e1')]=_0x489363[0x0]['outboundQueuePauses']||0x0;_0x4df399['predictiveIntervalHitRate']=_0x47c472>0x0?_0x47c472:0x1;return _0x23d217[_0x3160('0x1db')](_0x41f1d0,_0x402279,_0x5a3a81,_0x47c472,_0x4719af);})[_0x3160('0x9d')](function(_0x5ee03f){return _0x19cca0(_0x5ee03f);})[_0x3160('0xa1')](function(_0x2efbc8){return _0x2bebd4(msgResponse(_0x3160('0x1e2'),_0x3160('0x92'),JSON[_0x3160('0xa7')](_0x2efbc8)));});}}else{return _0x2bebd4(msgResponse(_0x3160('0x1dc'),_0x3160('0x92'),_0x3160('0x1e4')));}});};};Dialer[_0x3160('0x19')][_0x3160('0x1d3')]=function(_0x1093e3){var _0x45f06c=this;return function(){var _0x59e725=0x0;var _0xd2ab5a=Math['floor'](_0x1093e3['erlangCallToSecond']*0x3e8);if(_0xd2ab5a>0x0){_0xd2ab5a=_0xd2ab5a<0x64?0x64:_0xd2ab5a;loggerPredictive['info'](_0x1093e3[_0x3160('0x4b')],_0x3160('0x1e5'),_0xd2ab5a,_0x3160('0x1e6'));_0x1093e3[_0x3160('0x66')]=setInterval(function(){_0x45f06c[_0x3160('0x66')](_0x1093e3);loggerPredictiveCalls[_0x3160('0x4e')](_0x3160('0x1e7'),_0x59e725+=0x1);},_0xd2ab5a);}else{loggerPredictive[_0x3160('0x4e')](_0x1093e3['name'],'fail\x20to\x20scheduled\x20calls');}};};Dialer['prototype'][_0x3160('0x1e8')]=function(_0x48c1a8,_0x6d1d02){var _0x301d7a=this;return function(_0x515764){if(_[_0x3160('0x4d')](_0x515764)){if(_[_0x3160('0xf3')](_0x6d1d02[_0x3160('0x1e9')])||!_0x6d1d02[_0x3160('0x1ea')]){if(_0x48c1a8[_0x3160('0xb1')]===_0x3160('0x8')){_0x48c1a8[_0x3160('0x74')]=_['isUndefined'](_0x48c1a8['queueStatusComplete'])?!![]:_0x48c1a8['queueStatusComplete'];var _0x4b9a51=uuid['v4']();_0x301d7a['actions'][_0x4b9a51]=new Action(_0x48c1a8,_0x6d1d02,_0x4b9a51);loggerBooked[_0x3160('0x4e')](_0x3160('0x1eb'),_0x4b9a51,'queueStatusComplete:\x20',JSON[_0x3160('0xa7')](_0x48c1a8[_0x3160('0x74')]),'Queue:\x20',_0x48c1a8[_0x3160('0x4b')]);if(_0x48c1a8['queueStatusComplete']){_0x48c1a8['queueStatusComplete']=![];_0x301d7a['queueBooked'][_0x301d7a[_0x3160('0x24')][_0x4b9a51]['queue']]=[];ami['Action']({'actionid':_0x4b9a51,'action':_0x3160('0x1ec'),'queue':_0x48c1a8['name']})[_0x3160('0xa1')](function(){utils[_0x3160('0xc1')](_0x48c1a8,_0x3160('0x1ed'));hopperUtils[_0x3160('0x106')]({'active':![],'ContactId':_0x301d7a[_0x3160('0x24')][_0x4b9a51][_0x3160('0xfc')],'ListId':_0x301d7a['actions'][_0x4b9a51][_0x3160('0xdf')],'VoiceQueueId':_0x301d7a['actions'][_0x4b9a51][_0x3160('0xe0')]||undefined,'CampaignId':_0x301d7a[_0x3160('0x24')][_0x4b9a51][_0x3160('0xe1')]||undefined})[_0x3160('0xa1')](loggerCatch(_0x3160('0x1ee')));delete _0x301d7a[_0x3160('0x24')][_0x4b9a51];});}else{loggerBooked[_0x3160('0x4e')](_0x3160('0x1ef'),JSON[_0x3160('0xa7')](_0x48c1a8[_0x3160('0x74')]),_0x3160('0x1f0'),_0x48c1a8[_0x3160('0x4b')]);utils['decrementOriginate'](_0x48c1a8,_0x3160('0x1ed'));hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x301d7a[_0x3160('0x24')][_0x4b9a51][_0x3160('0xfc')],'ListId':_0x301d7a[_0x3160('0x24')][_0x4b9a51][_0x3160('0xdf')],'VoiceQueueId':_0x301d7a['actions'][_0x4b9a51]['VoiceQueueId']||undefined,'CampaignId':_0x301d7a['actions'][_0x4b9a51][_0x3160('0xe1')]||undefined})[_0x3160('0xa1')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x301d7a[_0x3160('0x24')][_0x4b9a51];}}else{return _0x301d7a[_0x3160('0x15b')](_0x48c1a8,_0x6d1d02);}}else{if(utils['getSeconds'](undefined,_0x6d1d02[_0x3160('0x1f1')])<_0x48c1a8[_0x3160('0x1f2')]*0x3c){if(_0x6d1d02[_0x3160('0x14d')]&&!_0x6d1d02[_0x3160('0x14d')]['voicePause']){_0x301d7a[_0x3160('0x1d')]['run'](_0x6d1d02['id'])[_0x3160('0xfa')](function(){utils[_0x3160('0xc1')](_0x48c1a8,'[checkContactBlack]');});}else{hopperUtils[_0x3160('0x1f3')]({'active':![]},_0x6d1d02['id'],0x1)['finally'](function(){utils[_0x3160('0xc1')](_0x48c1a8,_0x3160('0x1ed'));});}}else{_0x48c1a8[_0x3160('0x1f4')]+=0x1;utils['decrementOriginate'](_0x48c1a8,'[checkContactBlack]');if(_0x48c1a8[_0x3160('0x1f5')]){hopperUtils[_0x3160('0x106')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x6d1d02[_0x3160('0xfc')],'ListId':_0x6d1d02[_0x3160('0xdf')],'VoiceQueueId':_0x6d1d02[_0x3160('0xe0')]||undefined,'CampaignId':_0x6d1d02[_0x3160('0xe1')]||undefined})[_0x3160('0xa1')](loggerCatch(_0x3160('0x1f6')));hopperUtils[_0x3160('0xca')](createObjHistory(_0x48c1a8,_0x6d1d02,utils[_0x3160('0x6b')][_0x3160('0x1f7')],0x17,_0x3160('0x1f8')))[_0x3160('0xa1')](loggerCatch(_0x3160('0x1f9')));}else{_0x301d7a[_0x3160('0x11e')](createObjHistory(_0x48c1a8,_0x6d1d02,utils['CAMPAIGN_STATUS'][_0x3160('0x1fa')],0x16,_0x3160('0x1fb')),_0x3160('0x1fc'),_0x3160('0x1fd'));}}}}else{_0x48c1a8[_0x3160('0x1fe')]+=0x1;_0x301d7a[_0x3160('0x11e')](createObjHistory(_0x48c1a8,_0x6d1d02,utils[_0x3160('0x6b')]['BLACKLIST'],0xd,_0x3160('0x1ff')),_0x3160('0x200'),'[Originate][MoveBlacklist]');throw _0x3160('0x201');}};};Dialer[_0x3160('0x19')]['handleIvr']=function(_0x1b4af8){var _0x488609=this;var _0x2d6510=_0x1b4af8[_0x3160('0x202')]-_0x1b4af8[_0x3160('0x7f')];emitCampaignSummary(_0x1b4af8);if(_0x2d6510>0x0&&_0x1b4af8[_0x3160('0x203')]==0x0){if(_0x2d6510>this[_0x3160('0x22')]){_0x2d6510=this['maxNumberOriginate'];}_0x1b4af8[_0x3160('0x203')]=0x1;hopperUtils['getContactDialerIvr'](_0x1b4af8,_0x2d6510)['then'](function(_0x5cc03a){_0x1b4af8['temp']=0x0;if(_0x5cc03a){if(!utils[_0x3160('0x204')](_0x5cc03a)){_0x1b4af8[_0x3160('0x6a')]=utils[_0x3160('0x6b')][_0x3160('0x6f')];logger[_0x3160('0x4e')](_0x3160('0x205')+_0x1b4af8[_0x3160('0x4b')]);}else{_0x1b4af8['originated']+=_0x5cc03a[_0x3160('0xff')];_0x1b4af8[_0x3160('0x6a')]=utils['CAMPAIGN_STATUS'][_0x3160('0x206')];for(var _0x355449=0x0;_0x355449<_0x5cc03a['length'];_0x355449+=0x1){_0x1b4af8['ivrTotalCallsDays']+=0x1;if(_['isNil'](_0x5cc03a[_0x355449])||_[_0x3160('0xf3')](_0x5cc03a[_0x355449]['Contact'])||_[_0x3160('0xf3')](_0x5cc03a[_0x355449][_0x3160('0x15e')])){_0x488609[_0x3160('0x156')](_0x3160('0x207'),_0x1b4af8,_0x5cc03a[_0x355449]);}else{hopperUtils[_0x3160('0x208')](_[_0x3160('0x103')](_0x5cc03a[_0x355449],[_0x3160('0xe1'),'phone']))[_0x3160('0x9d')](_0x488609[_0x3160('0x1e8')](_0x1b4af8,_0x5cc03a[_0x355449]))[_0x3160('0xa1')](function(_0x32e579){logger[_0x3160('0x68')]('[actionOriginateIvr]',_0x32e579);utils[_0x3160('0xc1')](_0x1b4af8,_0x3160('0x209'));});}}}}})[_0x3160('0xa1')](function(_0xa31297){_0x1b4af8[_0x3160('0x203')]=0x0;logger['error'](_0x3160('0x20a'),_0xa31297);});}};Dialer['prototype'][_0x3160('0xb3')]=function(_0x22b578,_0x2f6a7f){var _0x5c0970=this;var _0x4027b3=[];if(_0x2f6a7f<0x1||_0x22b578[_0x3160('0xb1')]===_0x3160('0x8')){_0x2f6a7f=0x1;}var _0x2a48c3=Math[_0x3160('0x1c1')](_0x22b578[_0x3160('0x1c0')]*_0x2f6a7f)-_0x22b578[_0x3160('0x7f')];if(_0x22b578[_0x3160('0x20b')]>0x0){var _0xb3f301=_0x22b578[_0x3160('0x20b')]-_0x22b578[_0x3160('0x7f')]-_0x22b578[_0x3160('0x144')]-_0x22b578['pTalking'];if(_0x2a48c3>_0xb3f301){_0x2a48c3=_0xb3f301;}}if(_0x2a48c3>0x0&&_0x22b578['temp']==0x0){if(_0x22b578[_0x3160('0xb1')]===_0x3160('0x8')){_0x2a48c3=0x1;}if(_0x2a48c3>this[_0x3160('0x22')]){_0x2a48c3=this['maxNumberOriginate'];}for(var _0x3839b7 in this[_0x3160('0x20')]){if(typeof this[_0x3160('0x20')][_0x3839b7]!=='undefined'){if(this[_0x3160('0x20')][_0x3839b7][_0x3160('0x70')]===_0x3160('0x20c')&&this[_0x3160('0x20')][_0x3839b7][_0x3160('0x88')]==='reachable'){_0x4027b3[_0x3160('0x98')](this[_0x3160('0x20')][_0x3839b7]['id']);}}}_0x22b578[_0x3160('0x203')]=0x1;hopperUtils['getContactDialer'](_0x22b578,_0x4027b3,_0x2a48c3)[_0x3160('0x9d')](function(_0x7a68f4){_0x22b578[_0x3160('0x203')]=0x0;if(_0x7a68f4){if(!utils['checkContactEmpty'](_0x7a68f4)){hopperUtils[_0x3160('0x20d')](_0x22b578)[_0x3160('0x9d')](sendMessageReschedule(_0x22b578))['catch'](loggerCatch(_0x3160('0x20e')));}else{_0x22b578[_0x3160('0x7f')]+=_0x7a68f4[_0x3160('0xff')];_0x22b578[_0x3160('0x6a')]=_0x22b578['dialMethod']===_0x3160('0x8')?utils[_0x3160('0x6b')][_0x3160('0x146')]:utils[_0x3160('0x6b')]['RUNNING'];for(var _0x6abab3=0x0;_0x6abab3<_0x7a68f4[_0x3160('0xff')];_0x6abab3+=0x1){if(_[_0x3160('0xf3')](_0x7a68f4[_0x6abab3])||_['isNil'](_0x7a68f4[_0x6abab3][_0x3160('0x177')])||_[_0x3160('0xf3')](_0x7a68f4[_0x6abab3]['phone'])){_0x5c0970['emptyContact']('[actionOriginate]\x20',_0x22b578,_0x7a68f4[_0x6abab3]);}else{hopperUtils['checkIsBlackList'](_['pick'](_0x7a68f4[_0x6abab3],[_0x3160('0xe0'),_0x3160('0x15e')]))[_0x3160('0x9d')](_0x5c0970[_0x3160('0x1e8')](_0x22b578,_0x7a68f4[_0x6abab3]))[_0x3160('0xa1')](function(_0xde4948){logger[_0x3160('0x68')](_0x3160('0x20f'),_0xde4948);utils[_0x3160('0xc1')](_0x22b578,'[handlePower]');});}}}}})[_0x3160('0xa1')](function(_0x3d4f87){_0x22b578['temp']=0x0;logger[_0x3160('0x68')](_0x3160('0x20a'),_0x3d4f87);});}};Dialer['prototype'][_0x3160('0x66')]=function(_0x75d8d9){if(_0x75d8d9['dialLimitQueue']>0x0){var _0x3b2e7c=_0x75d8d9[_0x3160('0x20b')]-_0x75d8d9[_0x3160('0x7f')]-_0x75d8d9[_0x3160('0x144')];if(_0x3b2e7c>0x0&&_0x75d8d9[_0x3160('0x203')]==0x0){this[_0x3160('0x210')](_0x75d8d9);}else{loggerPredictiveCalls[_0x3160('0x4e')](_0x3160('0x211'));}}else{this[_0x3160('0x210')](_0x75d8d9);}};Dialer[_0x3160('0x19')]['tryOriginatePredictive']=function(_0xa89057){var _0x5c2c8e=this;var _0x330c69=[];_0xa89057[_0x3160('0x7f')]+=0x1;for(var _0x1a6a7a in this[_0x3160('0x20')]){if(typeof this['agents'][_0x1a6a7a]!==_0x3160('0xaa')){if(this[_0x3160('0x20')][_0x1a6a7a][_0x3160('0x70')]===_0x3160('0x20c')&&this[_0x3160('0x20')][_0x1a6a7a][_0x3160('0x88')]==='reachable'){_0x330c69['push'](this[_0x3160('0x20')][_0x1a6a7a]['id']);}}}_0xa89057[_0x3160('0x203')]=0x1;return this[_0x3160('0x212')](_0xa89057['id'],_0x330c69,0x1,_0xa89057['dialOrderByScheduledAt'],_0xa89057)[_0x3160('0x9d')](function(_0x1722b8){_0xa89057[_0x3160('0x203')]=0x1;if(_0x1722b8){if(!utils[_0x3160('0x204')](_0x1722b8)){utils['checkContactLowerLimitOriginate'](_0xa89057,0x1,0x0);return hopperUtils[_0x3160('0x20d')](_0xa89057)[_0x3160('0x9d')](sendMessageReschedule(_0xa89057))[_0x3160('0xa1')](loggerCatch(_0x3160('0x20e')));}else{_0xa89057[_0x3160('0x6a')]=utils[_0x3160('0x6b')][_0x3160('0x206')];if(_['isNil'](_0x1722b8[0x0])||_[_0x3160('0xf3')](_0x1722b8[0x0][_0x3160('0x177')])||_[_0x3160('0xf3')](_0x1722b8[0x0][_0x3160('0x15e')])){_0x5c2c8e[_0x3160('0x156')](_0x3160('0x207'),_0xa89057,_0x1722b8[0x0]);}else{return hopperUtils[_0x3160('0x213')](_[_0x3160('0x103')](_0x1722b8[0x0],['VoiceQueueId',_0x3160('0x15e')]))[_0x3160('0x9d')](_0x5c2c8e['checkContactBlack'](_0xa89057,_0x1722b8[0x0]))[_0x3160('0xa1')](function(_0x532759){logger[_0x3160('0x68')](_0x3160('0x214'),_0x532759);utils['decrementOriginate'](_0xa89057,'[actionOriginatePredictive]');});}}}})[_0x3160('0xa1')](function(_0x43eab3){_0xa89057[_0x3160('0x203')]=0x0;logger[_0x3160('0x68')](_0x3160('0x20a'),_0x43eab3);});};Dialer[_0x3160('0x19')][_0x3160('0x1d9')]=function(_0x33845f,_0x4f27d8,_0x3a879d,_0x1c2fc5,_0x512211,_0x2eab39){loggerPredictive['info'](_0x3160('0x215'));loggerPredictive[_0x3160('0x4e')]('M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x33845f);loggerPredictive[_0x3160('0x4e')](_0x3160('0x216'),_0x4f27d8);loggerPredictive['info'](_0x3160('0x217'),_0x3a879d);loggerPredictive[_0x3160('0x4e')](_0x3160('0x218'),_0x1c2fc5);loggerPredictive[_0x3160('0x4e')](_0x3160('0x219'),_0x512211);loggerPredictive['info'](_0x3160('0x5a'));return new Promise(function(_0x53e1b6,_0x4b67ce){if(_0x33845f<=0x0||isNaN(_0x33845f)){return _0x4b67ce(msgResponse(_0x3160('0x21a'),_0x3160('0x84'),_0x3160('0x21b')+_0x33845f));}if(_0x3a879d<=0x0||isNaN(_0x3a879d)){return _0x4b67ce(msgResponse(_0x3160('0x21a'),_0x3160('0x84'),_0x3160('0x21c')+_0x3a879d));}if(_0x1c2fc5<=0x0||isNaN(_0x1c2fc5)){return _0x4b67ce(msgResponse(_0x3160('0x21a'),_0x3160('0x84'),_0x3160('0x21d')+_0x1c2fc5));}if(_0x4f27d8<=0x0||isNaN(_0x4f27d8)){return _0x4b67ce(msgResponse(_0x3160('0x21a'),_0x3160('0x84'),_0x3160('0x21e')+_0x4f27d8));}if(_0x512211<=0x0||isNaN(_0x512211)){return _0x4b67ce(msgResponse(_0x3160('0x21a'),_0x3160('0x84'),_0x3160('0x21f')+_0x512211));}_0x2eab39=_0x2eab39||0x0;var _0x4ce5e9=0x1/_0x3a879d;var _0x6f3c97=0x0;var _0x1e0461=0x0;var _0x3c2a49=0x0;var _0x355557=0x0;for(var _0x9bffdc=0x0;_0x3c2a49<_0x512211;_0x9bffdc+=0x1){_0x1e0461=_0x9bffdc/_0x4f27d8;_0x6f3c97=(_0x1c2fc5*_0x1e0461+_0x2eab39)/_0x4ce5e9;_0x3c2a49=utils['erlangb'](_0x6f3c97,_0x33845f);_0x355557=_0x6f3c97/_0x33845f*(0x1-utils[_0x3160('0x220')](_0x6f3c97,_0x33845f));}return _0x53e1b6({'erlangCalls':_0x9bffdc,'erlangCallToSecond':_0x4f27d8/_0x9bffdc,'erlangAbandonmentRate':_0x3c2a49,'erlangBusyFactor':_0x355557});});};Dialer[_0x3160('0x19')][_0x3160('0x1db')]=function(_0x3496fa,_0x17285e,_0x51fb29,_0x187467,_0x2e6050,_0x5e4843){loggerPredictive[_0x3160('0x4e')](_0x3160('0x221'));loggerPredictive[_0x3160('0x4e')](_0x3160('0x222'),_0x3496fa);loggerPredictive[_0x3160('0x4e')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x17285e);loggerPredictive['info'](_0x3160('0x217'),_0x51fb29);loggerPredictive[_0x3160('0x4e')]('P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x187467);loggerPredictive[_0x3160('0x4e')](_0x3160('0x223'),_0x2e6050);loggerPredictive[_0x3160('0x4e')](_0x3160('0x5a'));return new Promise(function(_0x20a146,_0x2649a7){if(_0x3496fa<=0x0||isNaN(_0x3496fa)){return _0x2649a7(msgResponse(_0x3160('0x224'),'Error',_0x3160('0x21b')+_0x3496fa));}if(_0x51fb29<=0x0||isNaN(_0x51fb29)){return _0x2649a7(msgResponse(_0x3160('0x224'),_0x3160('0x84'),'Ts\x20=\x20'+_0x51fb29));}if(_0x187467<=0x0||isNaN(_0x187467)){return _0x2649a7(msgResponse('[busyFactor]','Error','p\x20=\x20'+_0x187467));}if(_0x17285e<=0x0||isNaN(_0x17285e)){return _0x2649a7(msgResponse(_0x3160('0x224'),_0x3160('0x84'),_0x3160('0x21e')+_0x17285e));}if(_0x2e6050<=0x0||isNaN(_0x2e6050)){return _0x2649a7(msgResponse(_0x3160('0x224'),'Error',_0x3160('0x225')+_0x2e6050));}_0x5e4843=_0x5e4843||0x0;var _0x18b6b7=0x1/_0x51fb29;var _0x407642=0x0;var _0x207a57=0x0;var _0x3a399d=0x0;var _0x4f7ffd=0x0;for(var _0x4a0bb6=0x0;_0x4f7ffd<_0x2e6050;_0x4a0bb6+=0x1){_0x207a57=_0x4a0bb6/_0x17285e;_0x407642=(_0x187467*_0x207a57+_0x5e4843)/_0x18b6b7;_0x3a399d=utils[_0x3160('0x220')](_0x407642,_0x3496fa);_0x4f7ffd=_0x407642/_0x3496fa*(0x1-utils['erlangb'](_0x407642,_0x3496fa));}return _0x20a146({'erlangCalls':_0x4a0bb6,'erlangCallToSecond':_0x17285e/_0x4a0bb6,'erlangAbandonmentRate':_0x3a399d,'erlangBusyFactor':_0x4f7ffd});});};module['exports']=Dialer;
\ No newline at end of file
+var _0x752a=['HANGUP','[syncHangupInAMDIvr]','createStateFinal','[syncHangup]','ivrAnswerCallsDay','[syncAgentCompleteIvr][createHistory]','moveContactManagedDialer','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AGI','[syncHangup2]','cause-txt','Normal\x20Clearing','outboundUnknownCallsDay','running','statusMessage','available','paused','inUse','talking','pTalking','ACTIVE','checkDialMethod','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','syncQueueSummaryComplete','throttle','filter','dialPreviewRecallmeReminder','online','reachable','resolve','map','Agent','user:%s','user:dialPreviewRecallReminder','loopClearZombieChannels','clearZombieChannels','[actions]','undefined','enqueue','No\x20such\x20channel','[Dialer][checkChannel]','[clearZombieChannels]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','emptyContact','notFound','[emptyContact]','UserId','[emptyContact][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','checkPreviewRecallReminder','handlePreviewRecallNotifications','launchHandleIvr','handleIvr','actionOriginate','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','dialQueueOptions','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','getCallerId','getCallerIdRandom','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','xcally-motion-dialer','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','Error','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','object','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','reason','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','checkRetriveMax','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','dialNoAnswerMaxRetry','outboundBusyCallsDay','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','outboundAbandonedCallsDay','dialAbandonedMaxRetry','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','agentreject','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Success','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','outboundDropCallsDayTimeout','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','avgHandleTime','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','getDataPredictive','predictiveIntervalAnsweredCalls','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','loggedIn','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','milliseconds','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','Queue:\x20','queuestatus','[checkContactBlack]','[unlockOriginate][syncQueueStatusComplete]','scheduledat','voicePause','run','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','temp','checkContactEmpty','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','[handleIvr]','dialLimitQueue','not_inuse','getContactDialer','countReScheduled','checkIsBlackList','[handlePower]','[getContactCampaign2]','[handlePredictive][limitChannel]','tryOriginatePredictive','dialOrderByScheduledAt','checkContactLowerLimitOriginate','[countReScheduled]\x20','[actionOriginatePredictive]','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','erlangb','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Ts\x20=\x20','exports','util','lodash','uuid','moment','ioredis','./utils/hopper','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','syncQueueSummary','../ami','redis','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/setting','./models/history','./models/final','./models/agentComplete','./models/queueCallerAbandon','./models/hangup','prototype','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','queuesSummary','agentconnect','bind','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','custom:queuesummarycomplete','hangup','syncHangup','syncNewExten','varset','syncVarSet','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','previewRecallmeReminderInterval','isUndefined','emit','type','outbound','debug','inspect','format','voice:queue:%s','name','voice_queue:save','isEmpty','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','predictiveIntervalAvgHoldtime','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','erlangAbandonmentRate','merge','startProgressive\x20value\x20cleared','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','contactsRescheduled','message','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contacts','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','statedesc','endtime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','pick','Interval','CAMPAIGN_STATUS','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Intervals','campaign:ivr:%s','campaign:save','sendMessageOneNotActive','originated','INACTIVE','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','DISACTIVED','is\x20deactivated','[ifTime][Action]','stringify','isTrunkReachable','active','SIP/%s','status','unmonitored','checkIsTrunkReachable','Trunk','TrunkBackup','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTimeIvr','checkIfTimeIntervals','ifTime','Failure','\x20Intervals\x20is\x20null\x20','\x20Intervals\x20is\x20empty\x20','timezones','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','push','iftime\x20%s,%s','interval','then','content','indexOf','true','catch','Action','all','some','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','resetActiveCalls','syncCampaigns','isIVRCampaign','isIVRCampaignActive','dialGlobalInterval','dialTimezone','[syncCampaigns]','dialMethod','handlePower','power','dialPowerLevel','Queue','silly','Dialer::ifTime()','intervalIftime','isGlobal','AMI\x20IfTime','syncAgentConnect','queue','uniqueId','uniqueid','ivr','decrementOriginate','[syncAgentConnect]','answertime','YYYY-MM-DD\x20HH:mm:ss','outboundAnswerCallsDay','agent','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','[syncQueueCallerAbandon]','droptime','getSeconds','dialQueueTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','agiafterat','countdropretry','dialDropRetryFrequency','verifyAdditionalPhones','voiceQueue','additional','queueCallerAbandonCreateState','rescheduleContact','add','minutes','ContactId','ListId','CampaignId','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','countabandonedretry','countglobal','callAdditionalPhoneAfterMin','dialAbandonedRetryFrequency','VoiceQueueId','[rescheduleContact][Abandoned]','starttime','createHistory','[syncAgentComplete][createHistory][11]','swapAdditionalPhones','channel','actionid','strategy','roundrobin','isNil','locked','stateinterface','rrmemory','idHopper','[syncQueueStatusComplete]','_rr','length','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[Catch][Preview][syncQueueStatusComplete]','[booked][RR][finaly]','[booked][unlock]','[unlock][syncQueueStatusComplete]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncOriginateResponse','getQueue','response','[syncOriginateResponse]','callProgressDetecting','variable','amdstatus','exten','dialAMDActive','value','[syncVarSet]','HangupInAMD','membername','AMD','custom:amd','buildObj','amd','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','outboundAnswerAgiCallsDay','Machine','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','reason\x2019\x20machine....','dialMachineRetryFrequency','[rescheduleContact][Machine]'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x752a,0x103));var _0xa752=function(_0x3c4a7c,_0x2f4e3c){_0x3c4a7c=_0x3c4a7c-0x0;var _0xf13d1e=_0x752a[_0x3c4a7c];return _0xf13d1e;};'use strict';var util=require(_0xa752('0x0'));var _=require(_0xa752('0x1'));var uuid=require(_0xa752('0x2'));var moment=require(_0xa752('0x3'));var rr=require('rr');var Redis=require(_0xa752('0x4'));var utils=require('./utils');var hopperUtils=require(_0xa752('0x5'));var ut=require(_0xa752('0x6'));var config=require(_0xa752('0x7'));var logger=require(_0xa752('0x8'))(_0xa752('0x9'));var loggerBooked=require('../../../config/logger')(_0xa752('0xa'));var loggerPredictive=require(_0xa752('0x8'))(_0xa752('0xb'));var loggerPredictiveCalls=require(_0xa752('0x8'))('predictiveCalls');var loggerSyncQueueSummary=require(_0xa752('0x8'))(_0xa752('0xc'));var ami=require(_0xa752('0xd'));config[_0xa752('0xe')]=_['defaults'](config[_0xa752('0xe')],{'host':_0xa752('0xf'),'port':0x18eb});var io=require(_0xa752('0x10'))(new Redis(config[_0xa752('0xe')]));var cmHopper=require(_0xa752('0x11'));var voiceQueueRt=require(_0xa752('0x12'));var RpcSetting=require(_0xa752('0x13'));var Interval=require('../rpc/interval');var Action=require('./models/action');var History=require(_0xa752('0x14'));var Final=require(_0xa752('0x15'));var AgentComplete=require(_0xa752('0x16'));var QueueCallerAbandon=require(_0xa752('0x17'));var Hangup=require(_0xa752('0x18'));var ipAgi=process['env']['XCALLY_IP_AGI']||'127.0.0.1';var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0xa752('0x19')]['enqueue']=function(_0x17501d){this[_0xa752('0x1a')]=this[_0xa752('0x1a')]?this[_0xa752('0x1a')][_0xa752('0x1b')](_0x17501d):_0x17501d();};function Dialer(_0x458c6d,_0x4a74b6){this[_0xa752('0x1c')]=new Sequence();this[_0xa752('0x1d')]=_0x4a74b6;this['voiceQueues']=_0x458c6d[_0xa752('0x1e')];this[_0xa752('0x1f')]=_0x458c6d[_0xa752('0x1f')];this[_0xa752('0x20')]=_0x458c6d[_0xa752('0x20')];this[_0xa752('0x21')]=_0x458c6d['trunks'];this[_0xa752('0x22')]=config[_0xa752('0x22')]||0x2;this[_0xa752('0x23')]={};this[_0xa752('0x24')]={};this[_0xa752('0x25')]={};this['uniqueId']={};this[_0xa752('0x26')]={};this[_0xa752('0x27')]={};this[_0xa752('0x28')]={};this[_0xa752('0x29')]={};this[_0xa752('0x2a')]={};this[_0xa752('0x2b')]={};this[_0xa752('0x2c')]={};ami['on'](_0xa752('0x2d'),this['syncAgentConnect'][_0xa752('0x2e')](this));ami['on'](_0xa752('0x2f'),this[_0xa752('0x30')]['bind'](this));ami['on']('originateresponse',this['syncOriginateResponse'][_0xa752('0x2e')](this));ami['on'](_0xa752('0x31'),this[_0xa752('0x32')][_0xa752('0x2e')](this));ami['on']('custom:queuesummary',this[_0xa752('0xc')][_0xa752('0x2e')](this));ami['on'](_0xa752('0x33'),this['syncQueueSummaryComplete'][_0xa752('0x2e')](this));ami['on'](_0xa752('0x34'),this[_0xa752('0x35')][_0xa752('0x2e')](this));ami['on']('newexten',this[_0xa752('0x36')][_0xa752('0x2e')](this));ami['on'](_0xa752('0x37'),this[_0xa752('0x38')]['bind'](this));ami['on']('queuemember',this[_0xa752('0x39')]['bind'](this));ami['on'](_0xa752('0x3a'),this[_0xa752('0x3b')][_0xa752('0x2e')](this));this[_0xa752('0x3c')]();this['loopClearZombieChannels']();RpcSetting['getSettings']()['then'](function(_0x575347){previewRecallmeReminderInterval=_0x575347[_0xa752('0x3d')];});}function isNotNull(_0x57d950){return _0x57d950!==null&&!_[_0xa752('0x3e')](_0x57d950);}function msgResponse(_0x912318,_0x1785ed,_0x1275c2){return{'action':_0x912318,'response':_0x1785ed,'message':_0x1275c2,'stack':_0x1275c2};}function emit(_0x1782d6,_0x5361b6,_0x13d275){io['to'](_0x1782d6)[_0xa752('0x3f')](_0x5361b6,_0x13d275);}function emitOutboundVoiceQueueSummary(_0x201449){if(_0x201449[_0xa752('0x40')]===_0xa752('0x41')){logger[_0xa752('0x42')]('[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:',util[_0xa752('0x43')](_0x201449,{'showHidden':![],'depth':null}));emit(util[_0xa752('0x44')](_0xa752('0x45'),_0x201449[_0xa752('0x46')]),_0xa752('0x47'),_0x201449);}}function checkGetDataPredictive(_0x403264){if(isNotNull(_0x403264)&&!_[_0xa752('0x48')](_0x403264)){loggerPredictive[_0xa752('0x49')](_0xa752('0x4a'));loggerPredictive[_0xa752('0x49')](_0xa752('0x4b'),_0x403264[_0xa752('0x4c')]);loggerPredictive[_0xa752('0x49')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x403264['predictiveIntervalAnsweredCalls']);loggerPredictive[_0xa752('0x49')](_0xa752('0x4d'),_0x403264[_0xa752('0x4e')]);loggerPredictive[_0xa752('0x49')](_0xa752('0x4f'),_0x403264[_0xa752('0x50')]);loggerPredictive['info'](_0xa752('0x51'),_0x403264['predictiveIntervalAvgHoldtime']);loggerPredictive['info']('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x403264[_0xa752('0x52')]);loggerPredictive[_0xa752('0x49')](_0xa752('0x53'));if(_0x403264[_0xa752('0x4c')]>0x0){if(!_[_0xa752('0x3e')](_0x403264[_0xa752('0x52')])&&_0x403264['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0xa752('0x49')](_0xa752('0x54'));if(!_['isUndefined'](_0x403264[_0xa752('0x55')])&&_0x403264[_0xa752('0x55')]>0x0){return!![];}loggerPredictive[_0xa752('0x49')](_0xa752('0x56'));}else{loggerPredictive[_0xa752('0x49')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0xa752('0x49')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x44e380){return function(_0xe3baf6){loggerPredictive[_0xa752('0x49')]('---------\x20ErlangB\x20---------');loggerPredictive[_0xa752('0x49')](_0xa752('0x57'),_0xe3baf6[_0xa752('0x58')]);loggerPredictive[_0xa752('0x49')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xe3baf6['erlangCallToSecond']);loggerPredictive[_0xa752('0x49')](_0xa752('0x59'),_0xe3baf6['erlangAbandonmentRate']);loggerPredictive[_0xa752('0x49')](_0xa752('0x5a'),_0xe3baf6[_0xa752('0x5b')]);loggerPredictive[_0xa752('0x49')](_0xa752('0x59'),_0xe3baf6[_0xa752('0x5c')]);loggerPredictive['info']('---------------------------');_[_0xa752('0x5d')](_0x44e380,_0xe3baf6);};}function ifInterval(_0x1e4ed4,_0xfb3799){if(_['isUndefined'](_0xfb3799)){return![];}return utils['getSeconds'](undefined,_0xfb3799)<_0x1e4ed4*0x3c;}function clearPredictiveAttributes(_0x3c4653){if(_0x3c4653[_0xa752('0x28')]){_0x3c4653[_0xa752('0x28')]=undefined;loggerPredictive[_0xa752('0x42')](_0x3c4653[_0xa752('0x46')],_0xa752('0x5e'));}if(_0x3c4653[_0xa752('0x27')]){_0x3c4653[_0xa752('0x27')]=undefined;loggerPredictive['debug'](_0x3c4653['name'],_0xa752('0x5f'));}if(_0x3c4653[_0xa752('0x60')]){clearInterval(_0x3c4653[_0xa752('0x60')]);_0x3c4653[_0xa752('0x60')]=undefined;loggerPredictive[_0xa752('0x42')](_0x3c4653[_0xa752('0x46')],_0xa752('0x61'));}}function loggerCatchPredictive(_0x9309bd,_0x4bbaa6){return function(_0x3c3905){loggerPredictive[_0xa752('0x62')](_0x4bbaa6[_0xa752('0x46')],_0x9309bd);loggerPredictive[_0xa752('0x62')](_0x3c3905[_0xa752('0x63')]);clearPredictiveAttributes(_0x4bbaa6);};}function loggerCatch(_0x44d4f3){return function(_0x3ea42f){logger[_0xa752('0x62')](_0x44d4f3,util[_0xa752('0x43')](_0x3ea42f,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x39fa51){return function(_0x1f5f32){if(isNotNull(_0x1f5f32)&&isNotNull(_0x1f5f32[0x0])){if(_0x1f5f32[0x0][_0xa752('0x64')]>0x0){_0x39fa51[_0xa752('0x65')]=utils['CAMPAIGN_STATUS'][_0xa752('0x66')];logger[_0xa752('0x49')](_0xa752('0x67')+_0x39fa51[_0xa752('0x46')],_0x1f5f32[0x0][_0xa752('0x64')],_0xa752('0x68'));}else{_0x39fa51['message']=utils['CAMPAIGN_STATUS'][_0xa752('0x69')];logger[_0xa752('0x49')](_0xa752('0x6a')+_0x39fa51['name']);}}};}function createObjHistory(_0x71a097,_0x1d9aba,_0x4de8b6,_0x240c57,_0x463f10){_0x71a097[_0xa752('0x65')]=_0x4de8b6;var _0x440391=new Action(_0x71a097,_0x1d9aba);var _0xb244f6=new History(_0x440391);_0xb244f6[_0xa752('0x6b')]=_0x240c57;_0xb244f6[_0xa752('0x6c')]=_0x463f10;_0xb244f6[_0xa752('0x6d')]=_0x440391['starttime'];return _0xb244f6;}function unlockQueueStatus(_0x372f9c,_0x59b9e3){setTimeout(function(){if(_[_0xa752('0x3e')](_0x372f9c[_0xa752('0x6e')])){loggerBooked[_0xa752('0x62')](_0xa752('0x6f'),_0x59b9e3);}_0x372f9c[_0xa752('0x6e')]=!![];loggerBooked[_0xa752('0x49')](_0xa752('0x70'),_0x59b9e3,JSON['stringify'](_[_0xa752('0x71')](_0x372f9c,[_0xa752('0x46'),_0xa752('0x6e')])));},0x1f3);}function checkInterval(_0x32820b){return function(){if(!isNotNull(_0x32820b[_0xa752('0x72')])){_0x32820b['message']=utils[_0xa752('0x73')][_0xa752('0x74')];throw _0x32820b[_0xa752('0x46')]+_0xa752('0x75');}if(!isNotNull(_0x32820b['Interval']['Intervals'])){_0x32820b[_0xa752('0x65')]=utils[_0xa752('0x73')][_0xa752('0x74')];throw _0x32820b['name']+_0xa752('0x75');}if(!isNotNull(_['isEmpty'](_0x32820b[_0xa752('0x72')][_0xa752('0x76')]))){_0x32820b[_0xa752('0x65')]=utils['CAMPAIGN_STATUS']['NULL_INTERVAL'];throw _0x32820b[_0xa752('0x46')]+_0xa752('0x75');}};}function checkIsIVRCampaignActive(_0x254215){return function(){if(!utils['isIVRCampaignActive'](_0x254215)){_0x254215[_0xa752('0x65')]=utils[_0xa752('0x73')]['INACTIVE'];throw _0x254215[_0xa752('0x46')]+'\x20NOT\x20Active';}};}function emitCampaignSummary(_0x37aedf){if(utils['isIVRCampaign'](_0x37aedf)){emit(util['format'](_0xa752('0x77'),_0x37aedf[_0xa752('0x46')]),_0xa752('0x78'),_0x37aedf);}}function loggerCatchQueueSummary(_0x27a6fb,_0x50bbf2){return function(_0x3a6779){clearPredictiveAttributes(_0x50bbf2);emitCampaignSummary(_0x50bbf2);loggerSyncQueueSummary[_0xa752('0x42')](_0x27a6fb,util[_0xa752('0x43')](_0x3a6779,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x3c9071){if(_0x3c9071[_0xa752('0x79')]){if(_0x3c9071[_0xa752('0x7a')]===0x0){_0x3c9071['sendMessageOneNotActive']=![];_0x3c9071[_0xa752('0x65')]=utils['CAMPAIGN_STATUS'][_0xa752('0x7b')];loggerSyncQueueSummary[_0xa752('0x42')](_0xa752('0x7c'),_0x3c9071[_0xa752('0x46')],_0xa752('0x7d'));}else{_0x3c9071[_0xa752('0x65')]=utils[_0xa752('0x73')][_0xa752('0x7e')];loggerSyncQueueSummary[_0xa752('0x42')](_0xa752('0x7c'),_0x3c9071[_0xa752('0x46')],_0xa752('0x7f'));}emitCampaignSummary(_0x3c9071);}}function myreject(_0x566846){return function(_0x1ed648){return _0x566846(msgResponse(_0xa752('0x80'),'Error',JSON[_0xa752('0x81')](_0x1ed648)));};}Dialer['prototype'][_0xa752('0x82')]=function(_0x1f46be){return!_[_0xa752('0x3e')](_0x1f46be)&&_0x1f46be&&!_[_0xa752('0x3e')](_0x1f46be[_0xa752('0x46')])&&!_[_0xa752('0x3e')](_0x1f46be[_0xa752('0x83')])&&_0x1f46be[_0xa752('0x83')]&&(this['trunks'][util[_0xa752('0x44')](_0xa752('0x84'),_0x1f46be['name'])][_0xa752('0x85')]==='reachable'||this['trunks'][util[_0xa752('0x44')](_0xa752('0x84'),_0x1f46be[_0xa752('0x46')])][_0xa752('0x85')]===_0xa752('0x86'));};Dialer[_0xa752('0x19')][_0xa752('0x87')]=function(_0x2bfccd){var _0x5ba4e1=this;return function(){if(!_0x5ba4e1[_0xa752('0x82')](_0x2bfccd[_0xa752('0x88')])){if(!_0x5ba4e1[_0xa752('0x82')](_0x2bfccd[_0xa752('0x89')])){_0x2bfccd['message']=utils[_0xa752('0x73')][_0xa752('0x8a')];throw _0x2bfccd[_0xa752('0x46')]+_0xa752('0x8b');}}};};Dialer['prototype'][_0xa752('0x8c')]=function(_0x4d2819,_0x2b6c22,_0x12f7f9,_0x994fa3){var _0x212359=this;return function(){var _0x522372=!![];return _0x212359[_0xa752('0x8d')](_0x4d2819,_0x2b6c22,_0x12f7f9,_0x994fa3,_0x522372);};};Dialer[_0xa752('0x19')][_0xa752('0x8e')]=function(_0x3d9f23,_0x38eb74,_0xbb5c41,_0x470839){var _0xc60525=this;return function(){var _0x43ca86=![];return _0xc60525[_0xa752('0x8d')](_0x3d9f23[_0xa752('0x76')],_0x38eb74,_0xbb5c41,_0x470839,_0x43ca86);};};Dialer['prototype'][_0xa752('0x8d')]=function(_0x4674e5,_0x3be7c0,_0x365c5d,_0xbee7e1,_0x1681b6){var _0x57e4fe=[];return new Promise(function(_0x53efc6,_0x1da945){if(!isNotNull(_0x4674e5)){_0xbee7e1[_0xa752('0x65')]=utils[_0xa752('0x73')][_0xa752('0x74')];return _0x1da945(msgResponse(_0xa752('0x8f'),_0xa752('0x90'),_0x365c5d+_0xa752('0x91')));}if(_[_0xa752('0x48')](_0x4674e5)){_0xbee7e1['message']=utils[_0xa752('0x73')]['EMPTY_INTERVAL'];return _0x1da945(msgResponse(_0xa752('0x8f'),_0xa752('0x90'),_0x365c5d+_0xa752('0x92')));}if(_0x3be7c0&&_[_0xa752('0x3e')](config[_0xa752('0x93')][_0x3be7c0])){_0xbee7e1[_0xa752('0x65')]=utils[_0xa752('0x73')][_0xa752('0x94')];return _0x1da945(msgResponse(_0xa752('0x8f'),_0xa752('0x90'),_0x365c5d+_0xa752('0x95')+_0x3be7c0));}if(_['isArray'](_0x4674e5)){for(var _0x31c6bd=0x0;_0x31c6bd<_0x4674e5['length'];_0x31c6bd+=0x1){_0x57e4fe[_0xa752('0x96')](ami['Action']({'action':'command','command':util[_0xa752('0x44')](_0xa752('0x97'),_0x4674e5[_0x31c6bd][_0xa752('0x98')],!_[_0xa752('0x3e')](config[_0xa752('0x93')][_0x3be7c0])?_0x3be7c0:'')})[_0xa752('0x99')](function(_0x346ba6){return _0x346ba6[_0xa752('0x9a')][_0xa752('0x9b')](_0xa752('0x9c'))>=0x0;})[_0xa752('0x9d')](myreject(_0x1da945)));}}else{_0x57e4fe[_0xa752('0x96')](ami[_0xa752('0x9e')]({'action':'command','command':util[_0xa752('0x44')](_0xa752('0x97'),_0x4674e5,!_[_0xa752('0x3e')](config['timezones'][_0x3be7c0])?_0x3be7c0:'')})[_0xa752('0x99')](function(_0x246f04){return _0x246f04[_0xa752('0x9a')][_0xa752('0x9b')](_0xa752('0x9c'))>=0x0;})[_0xa752('0x9d')](myreject(_0x1da945)));}Promise[_0xa752('0x9f')](_0x57e4fe)[_0xa752('0x99')](function(_0x44b4c4){var _0x1c9103=_[_0xa752('0xa0')](_0x44b4c4);if(_0x1c9103){return _0x53efc6(_0x1c9103);}else{_0xbee7e1['message']=_0x1681b6?utils[_0xa752('0x73')][_0xa752('0xa1')]:utils['CAMPAIGN_STATUS'][_0xa752('0xa2')];return _0x1da945(msgResponse(_0xa752('0xa3'),'Failure',_0xa752('0xa4')+_0x1681b6+'\x20'+_0x365c5d+_0xa752('0xa5')+util[_0xa752('0x43')](_0x4674e5,{'showHidden':![],'depth':null})+_0xa752('0xa6')+_0x3be7c0));}})[_0xa752('0x9d')](function(_0x363248){return _0x1da945(msgResponse(_0xa752('0x8f'),_0xa752('0x90'),JSON[_0xa752('0x81')](_0x363248)));});});};Dialer['prototype']['loopCampaigns']=function(){var _0x3e12a2=this;return cmHopper[_0xa752('0xa7')]({'active':![]},{'where':{'active':!![]}})[_0xa752('0x99')](function(){setInterval(function(){_0x3e12a2[_0xa752('0xa8')]();},0x3e8);});};Dialer[_0xa752('0x19')][_0xa752('0xa8')]=function(){var _0x513c56=this;var _0x330acd;for(var _0x3eb63a in this['campaigns']){if(typeof this['campaigns'][_0x3eb63a]!=='undefined'){_0x330acd=this['campaigns'][_0x3eb63a];if(utils[_0xa752('0xa9')](_0x330acd)&&utils[_0xa752('0xaa')](_0x330acd)){_0x330acd['sendMessageOneNotActive']=!![];Promise['resolve']()[_0xa752('0x99')](checkIsIVRCampaignActive(_0x330acd))['then'](checkInterval(_0x330acd))[_0xa752('0x99')](_0x513c56[_0xa752('0x87')](_0x330acd))['then'](_0x513c56[_0xa752('0x8c')](_0x330acd[_0xa752('0xab')],_0x330acd[_0xa752('0xac')],_0x330acd[_0xa752('0x46')],_0x330acd))['then'](_0x513c56[_0xa752('0x8e')](_0x330acd[_0xa752('0x72')],_0x330acd[_0xa752('0xac')],_0x330acd['name'],_0x330acd))[_0xa752('0x99')](_0x513c56['launchHandleIvr'](_0x330acd))['catch'](loggerCatchQueueSummary(_0xa752('0xad'),_0x330acd));}else{notSendMessagesCampaign(_0x330acd);}}}};Dialer['prototype']['checkDialMethod']=function(_0x4a10cc){if(_0x4a10cc[_0xa752('0xae')]!==_0xa752('0xb')){clearPredictiveAttributes(_0x4a10cc);}switch(_0x4a10cc[_0xa752('0xae')]){case'progressive':this[_0xa752('0xaf')](_0x4a10cc,0x1);break;case _0xa752('0xb0'):this[_0xa752('0xaf')](_0x4a10cc,_0x4a10cc[_0xa752('0xb1')]);break;case'predictive':this[_0xa752('0xb')](_0x4a10cc);break;case _0xa752('0xa'):this['handlePower'](_0x4a10cc,0x1);break;default:logger[_0xa752('0x62')](_0xa752('0xb2'),_0x4a10cc[_0xa752('0x46')],'method\x20not\x20recognized');}};Dialer[_0xa752('0x19')][_0xa752('0x8f')]=function(_0x1b8534,_0x5ac707){var _0x1edc21=_0x1b8534[_0xa752('0xac')];var _0x332c35=_0x5ac707?_0x1b8534[_0xa752('0xab')]:_0x1b8534[_0xa752('0x72')][_0xa752('0x76')];logger[_0xa752('0xb3')](_0xa752('0xb4'),_0x332c35,_0x1edc21,_0x1b8534['name'],util[_0xa752('0x44')]('Voice\x20Queue\x20%s\x20$s',_0x1b8534[_0xa752('0x46')],_0x1b8534['id']));var _0x4d8256=null;return Interval[_0xa752('0xb5')](_0x332c35,_0x1edc21)[_0xa752('0x99')](function(_0x3f7427){if(_0x3f7427===!![]){return _0x3f7427;}else{_0x1b8534[_0xa752('0x65')]=_0x5ac707?utils[_0xa752('0x73')][_0xa752('0xa1')]:utils[_0xa752('0x73')][_0xa752('0xa2')];_0x4d8256=msgResponse(_0xa752('0xa3'),_0xa752('0x90'),'Global:\x20'+_0x5ac707+'\x20'+_0x1b8534[_0xa752('0x46')]+_0xa752('0xa5')+util[_0xa752('0x43')](_0x332c35,{'showHidden':![],'depth':null})+_0xa752('0xa6')+_0x1edc21);}if(_0x4d8256!==null){logger[_0xa752('0xb3')]('Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:',_0x4d8256);_0x4d8256[_0xa752('0xb6')]=_0x5ac707;throw _0x4d8256;}})[_0xa752('0x9d')](function(_0x21a7ea){logger[_0xa752('0x62')](_0xa752('0xb7'),_0x21a7ea);throw msgResponse(_0xa752('0x80'),'Error',util[_0xa752('0x43')](_0x21a7ea,{'showHidden':![],'depth':null}));});};Dialer[_0xa752('0x19')][_0xa752('0xb8')]=function(_0x5ebecd){if(this['voiceQueues'][_0x5ebecd[_0xa752('0xb9')]]){if(this[_0xa752('0xba')][_0x5ebecd[_0xa752('0xbb')]]&&this[_0xa752('0xba')][_0x5ebecd[_0xa752('0xbb')]][_0xa752('0x40')]!==_0xa752('0xbc')){utils[_0xa752('0xbd')](this[_0xa752('0x1e')][_0x5ebecd[_0xa752('0xb9')]],_0xa752('0xbe'));this['uniqueId'][_0x5ebecd[_0xa752('0xbb')]][_0xa752('0xbf')]=moment()[_0xa752('0x44')](_0xa752('0xc0'));}}};Dialer[_0xa752('0x19')][_0xa752('0x32')]=function(_0x5b4c79){var _0x3a271c=this['uniqueId'][_0x5b4c79[_0xa752('0xbb')]];if(this[_0xa752('0x1e')][_0x5b4c79[_0xa752('0xb9')]]){if(_0x3a271c&&_0x3a271c[_0xa752('0x40')]!==_0xa752('0xbc')){delete this[_0xa752('0xba')][_0x5b4c79[_0xa752('0xbb')]];this[_0xa752('0x1e')][_0x5b4c79[_0xa752('0xb9')]][_0xa752('0xc1')]+=0x1;var _0xaa71a=new AgentComplete(_0x3a271c,_0x5b4c79);if(_0x5b4c79['reason']===_0xa752('0xc2')){_0xaa71a['agiafterat']=this[_0xa752('0x1e')][_0x5b4c79[_0xa752('0xb9')]][_0xa752('0xc3')]&&this['voiceQueues'][_0x5b4c79[_0xa752('0xb9')]][_0xa752('0xc4')]?moment()[_0xa752('0x44')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}hopperUtils['createHistory'](_0xaa71a)[_0xa752('0x9d')](loggerCatch(_0xa752('0xc5')));hopperUtils['moveContactManagedDialer'](_0xaa71a)['catch'](loggerCatch(_0xa752('0xc6')));}}};Dialer[_0xa752('0x19')][_0xa752('0x30')]=function(_0x3fa6b5){var _0x5eda7e=this[_0xa752('0xba')][_0x3fa6b5[_0xa752('0xbb')]];var _0x1356ec=this;var _0x119ebd=![];var _0x2d5a70;var _0x109f12;if(this[_0xa752('0x1e')][_0x3fa6b5[_0xa752('0xb9')]]){if(_0x5eda7e&&_0x5eda7e['type']!==_0xa752('0xbc')){delete this[_0xa752('0xba')][_0x3fa6b5[_0xa752('0xbb')]];utils[_0xa752('0xbd')](this[_0xa752('0x1e')][_0x3fa6b5[_0xa752('0xb9')]],_0xa752('0xc7'));_0x5eda7e[_0xa752('0xc8')]=moment()[_0xa752('0x44')](_0xa752('0xc0'));var _0x1a444c=new QueueCallerAbandon(_0x5eda7e,_0x3fa6b5);if(utils[_0xa752('0xc9')](_0x5eda7e[_0xa752('0xc8')],_0x5eda7e['responsetime'])>=_0x5eda7e[_0xa752('0xca')]){this[_0xa752('0x1e')][_0x3fa6b5[_0xa752('0xb9')]][_0xa752('0x4e')]+=0x1;this[_0xa752('0x1e')][_0x3fa6b5[_0xa752('0xb9')]]['outboundDropCallsDayTimeout']+=0x1;this[_0xa752('0x1e')][_0x3fa6b5['queue']][_0xa752('0xcb')]+=0x1;_0x1a444c['state']=0xa;_0x1a444c['statedesc']=_0xa752('0xcc');_0x1a444c[_0xa752('0xcd')]='TIMEOUT';_0x1a444c[_0xa752('0xce')]=this[_0xa752('0x1e')][_0x3fa6b5[_0xa752('0xb9')]][_0xa752('0xc3')]?moment()[_0xa752('0x44')](_0xa752('0xc0')):undefined;_0x1a444c[_0xa752('0xcf')]+=0x1;_0x1a444c['countglobal']+=0x1;_0x2d5a70=this[_0xa752('0x1e')][_0x3fa6b5[_0xa752('0xb9')]][_0xa752('0xd0')];_0x109f12=this[_0xa752('0x1e')][_0x3fa6b5['queue']]['callAdditionalPhoneAfterMin'];hopperUtils[_0xa752('0xd1')](_0x1a444c,_0x1a444c[_0xa752('0x6b')],_0x5eda7e[_0xa752('0xd2')])[_0xa752('0x99')](function(_0x3504cd){_0x119ebd=_0x3504cd[_0xa752('0xd3')]==0x1;if(_0x1a444c[_0xa752('0xcf')]>=_0x1356ec['voiceQueues'][_0x3fa6b5[_0xa752('0xb9')]]['dialDropMaxRetry']){_0x1356ec[_0xa752('0xd4')](_0x1a444c,_0x3504cd['additional']);}else{hopperUtils[_0xa752('0xd5')]({'active':![],'countdropretry':_0x1a444c[_0xa752('0xcf')],'scheduledat':moment()[_0xa752('0xd6')](_0x1356ec[_0xa752('0x1e')][_0x3fa6b5['queue']]['dialDropRetryFrequency'],_0xa752('0xd7'))['format'](_0xa752('0xc0')),'ContactId':_0x5eda7e[_0xa752('0xd8')],'ListId':_0x5eda7e[_0xa752('0xd9')],'VoiceQueueId':_0x5eda7e['VoiceQueueId']||undefined,'CampaignId':_0x5eda7e[_0xa752('0xda')]||undefined})['catch'](loggerCatch(_0xa752('0xdb')));var _0x410fad=new History(_0x1a444c);_0x410fad[_0xa752('0x6b')]=0xa;_0x410fad['statedesc']='Drop';_0x410fad['starttime']=moment()[_0xa752('0x44')](_0xa752('0xc0'));_0x410fad[_0xa752('0x6d')]=_0x410fad['starttime'];_0x410fad[_0xa752('0xdc')]=_0x1a444c['calleridname'];_0x410fad[_0xa752('0xdd')]=_0x1a444c[_0xa752('0xdd')];hopperUtils['createHistory'](_0x410fad)['catch'](loggerCatch(_0xa752('0xde')));}})['then'](function(){if(_0x119ebd)hopperUtils['swapAdditionalPhones'](_0x1a444c,_0x2d5a70,_0x109f12)['then'](function(){return 0x1;});});}else{this[_0xa752('0x1e')][_0x3fa6b5[_0xa752('0xb9')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0xa752('0x1e')][_0x3fa6b5[_0xa752('0xb9')]][_0xa752('0xdf')]+=0x1;_0x1a444c['state']=0xb;_0x1a444c[_0xa752('0x6c')]=_0xa752('0xe0');_0x1a444c[_0xa752('0xcd')]=_0xa752('0xe1');_0x1a444c[_0xa752('0xe2')]+=0x1;_0x1a444c[_0xa752('0xe3')]+=0x1;_0x2d5a70=this[_0xa752('0x1e')][_0x3fa6b5['queue']]['dialAbandonedRetryFrequency'];_0x109f12=this[_0xa752('0x1e')][_0x3fa6b5[_0xa752('0xb9')]][_0xa752('0xe4')];hopperUtils['verifyAdditionalPhones'](_0x1a444c,_0x1a444c['state'],_0x5eda7e[_0xa752('0xd2')])['then'](function(_0xa4e9ee){if(_0x1a444c['countabandonedretry']>=_0x1356ec[_0xa752('0x1e')][_0x3fa6b5[_0xa752('0xb9')]]['dialAbandonedMaxRetry']){_0x1356ec[_0xa752('0xd4')](_0x1a444c,_0xa4e9ee[_0xa752('0xd3')]);}else{hopperUtils[_0xa752('0xd5')]({'active':![],'countabandonedretry':_0x1a444c[_0xa752('0xe2')],'scheduledat':moment()[_0xa752('0xd6')](_0x1356ec['voiceQueues'][_0x3fa6b5[_0xa752('0xb9')]][_0xa752('0xe5')],_0xa752('0xd7'))[_0xa752('0x44')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5eda7e['ContactId'],'ListId':_0x5eda7e[_0xa752('0xd9')],'VoiceQueueId':_0x5eda7e[_0xa752('0xe6')]||undefined,'CampaignId':_0x5eda7e[_0xa752('0xda')]||undefined})['catch'](loggerCatch(_0xa752('0xe7')));var _0x250d58=new History(_0x1a444c);_0x250d58['state']=0xb;_0x250d58[_0xa752('0x6c')]='Abandoned';_0x250d58[_0xa752('0xe8')]=moment()[_0xa752('0x44')](_0xa752('0xc0'));_0x250d58[_0xa752('0x6d')]=_0x250d58[_0xa752('0xe8')];_0x250d58[_0xa752('0xdc')]=_0x1a444c[_0xa752('0xdc')];_0x250d58[_0xa752('0xdd')]=_0x1a444c[_0xa752('0xdd')];hopperUtils[_0xa752('0xe9')](_0x250d58)[_0xa752('0x9d')](loggerCatch(_0xa752('0xea')));}})[_0xa752('0x99')](function(){if(_0x119ebd)hopperUtils[_0xa752('0xeb')](_0x1a444c,_0x2d5a70,_0x109f12)[_0xa752('0x99')](function(){return 0x1;});});}}}};Dialer[_0xa752('0x19')][_0xa752('0x36')]=function(_0x1ef40c){if(this[_0xa752('0x24')][_0x1ef40c[_0xa752('0xbb')]]){this[_0xa752('0x24')][_0x1ef40c[_0xa752('0xbb')]]['channel']=_0x1ef40c[_0xa752('0xec')];}if(this[_0xa752('0xba')][_0x1ef40c[_0xa752('0xbb')]]){this[_0xa752('0xba')][_0x1ef40c['uniqueid']][_0xa752('0xec')]=_0x1ef40c[_0xa752('0xec')];}};Dialer[_0xa752('0x19')][_0xa752('0x39')]=function(_0x29dcae){if(!this[_0xa752('0x24')][_0x29dcae['actionid']]){return;}var _0x40427e=this['voiceQueues'][this['actions'][_0x29dcae[_0xa752('0xed')]][_0xa752('0xb9')]][_0xa752('0xee')]||'rrmemory';if(_0x40427e===_0xa752('0xef')){if(this[_0xa752('0x24')][_0x29dcae[_0xa752('0xed')]]&&_[_0xa752('0xf0')](this[_0xa752('0x24')][_0x29dcae[_0xa752('0xed')]][_0xa752('0xf1')])&&_0x29dcae[_0xa752('0x85')]==='1'&&_0x29dcae['paused']==='0'){if(this[_0xa752('0x20')][_0x29dcae[_0xa752('0xf2')]]){if(!this[_0xa752('0x20')][_0x29dcae[_0xa752('0xf2')]][_0xa752('0xf1')]){this[_0xa752('0x20')][_0x29dcae['stateinterface']][_0xa752('0xf1')]=!![];this['actions'][_0x29dcae[_0xa752('0xed')]][_0xa752('0xf1')]=!![];this[_0xa752('0x24')][_0x29dcae[_0xa752('0xed')]][_0xa752('0xf2')]=_0x29dcae[_0xa752('0xf2')];}}}}else if(_0x40427e===_0xa752('0xf3')){if(this[_0xa752('0x24')][_0x29dcae[_0xa752('0xed')]]){if(this[_0xa752('0x20')][_0x29dcae[_0xa752('0xf2')]]){this['actions'][_0x29dcae[_0xa752('0xed')]]['stateinterface']=_0x29dcae[_0xa752('0xf2')];if(_[_0xa752('0xf0')](this[_0xa752('0x2a')][this[_0xa752('0x24')][_0x29dcae[_0xa752('0xed')]][_0xa752('0xb9')]])){this[_0xa752('0x2a')][this[_0xa752('0x24')][_0x29dcae[_0xa752('0xed')]]['queue']]=[];}this[_0xa752('0x2a')][this[_0xa752('0x24')][_0x29dcae[_0xa752('0xed')]][_0xa752('0xb9')]][_0xa752('0x96')](_[_0xa752('0x5d')](_['pick'](this[_0xa752('0x24')][_0x29dcae[_0xa752('0xed')]],[_0xa752('0xf4'),_0xa752('0xf2')]),{'status':_0x29dcae[_0xa752('0x85')],'paused':_0x29dcae['paused']}));}}}};Dialer[_0xa752('0x19')]['syncQueueStatusComplete']=function(_0x2b2653){if(!this[_0xa752('0x24')][_0x2b2653['actionid']]){return;}var _0x598c23=this;var _0x4f2762=this['voiceQueues'][this[_0xa752('0x24')][_0x2b2653['actionid']][_0xa752('0xb9')]];var _0x251167=_0x4f2762[_0xa752('0xee')]||_0xa752('0xf3');if(_0x251167===_0xa752('0xef')){if(this[_0xa752('0x24')][_0x2b2653[_0xa752('0xed')]]&&this[_0xa752('0x24')][_0x2b2653['actionid']][_0xa752('0xf2')]){this['preview']['run'](this['actions'][_0x2b2653[_0xa752('0xed')]][_0xa752('0xf4')],this['actions'][_0x2b2653[_0xa752('0xed')]][_0xa752('0xf2')])[_0xa752('0x9d')](function(_0x48f8dd){logger[_0xa752('0x62')]('[Catch][Preview][syncQueueStatusComplete]',util['inspect'](_0x48f8dd,{'showHidden':![],'depth':null}));})['finally'](function(){utils['decrementOriginate'](_0x598c23[_0xa752('0x1e')][_0x598c23[_0xa752('0x24')][_0x2b2653[_0xa752('0xed')]][_0xa752('0xb9')]],'[syncQueueStatusComplete]');_0x598c23[_0xa752('0x20')][_0x598c23[_0xa752('0x24')][_0x2b2653[_0xa752('0xed')]]['stateinterface']]['locked']=![];delete _0x598c23['actions'][_0x2b2653[_0xa752('0xed')]];unlockQueueStatus(_0x4f2762);});}else{utils[_0xa752('0xbd')](this[_0xa752('0x1e')][this[_0xa752('0x24')][_0x2b2653[_0xa752('0xed')]][_0xa752('0xb9')]],_0xa752('0xf5'));hopperUtils[_0xa752('0xd5')]({'active':![],'ContactId':this[_0xa752('0x24')][_0x2b2653[_0xa752('0xed')]][_0xa752('0xd8')],'ListId':this[_0xa752('0x24')][_0x2b2653[_0xa752('0xed')]][_0xa752('0xd9')],'VoiceQueueId':this[_0xa752('0x24')][_0x2b2653[_0xa752('0xed')]]['VoiceQueueId']||undefined,'CampaignId':this[_0xa752('0x24')][_0x2b2653[_0xa752('0xed')]][_0xa752('0xda')]||undefined})[_0xa752('0x9d')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this['actions'][_0x2b2653[_0xa752('0xed')]];unlockQueueStatus(_0x4f2762);}}else if(_0x251167===_0xa752('0xf3')){var _0x4b0dd5;if(this[_0xa752('0x24')][_0x2b2653[_0xa752('0xed')]]&&!_[_0xa752('0x48')](this['queueBooked'][this[_0xa752('0x24')][_0x2b2653['actionid']][_0xa752('0xb9')]])){if(this[_0xa752('0x2b')][_0x598c23[_0xa752('0x24')][_0x2b2653['actionid']]['queue']]){this[_0xa752('0x2b')][_0x598c23[_0xa752('0x24')][_0x2b2653[_0xa752('0xed')]]['queue']]=this[_0xa752('0x2b')][this[_0xa752('0x24')][_0x2b2653[_0xa752('0xed')]][_0xa752('0xb9')]]?this[_0xa752('0x2b')][this[_0xa752('0x24')][_0x2b2653['actionid']][_0xa752('0xb9')]]:this[_0xa752('0x2a')][this[_0xa752('0x24')][_0x2b2653[_0xa752('0xed')]][_0xa752('0xb9')]]?this[_0xa752('0x2a')][this[_0xa752('0x24')][_0x2b2653[_0xa752('0xed')]]['queue']][_0xa752('0xf6')]||0x0:0x0;}this['queueBooked'][this[_0xa752('0x24')][_0x2b2653[_0xa752('0xed')]][_0xa752('0xb9')]][_0xa752('0xf6')]=this[_0xa752('0x2b')][this[_0xa752('0x24')][_0x2b2653['actionid']]['queue']];for(var _0x27ec4b=0x0;_0x27ec4b<this[_0xa752('0x2a')][this[_0xa752('0x24')][_0x2b2653[_0xa752('0xed')]][_0xa752('0xb9')]][_0xa752('0xf7')];_0x27ec4b+=0x1){_0x4b0dd5=rr(this[_0xa752('0x2a')][this[_0xa752('0x24')][_0x2b2653[_0xa752('0xed')]][_0xa752('0xb9')]]);this[_0xa752('0x2b')][_0x598c23[_0xa752('0x24')][_0x2b2653[_0xa752('0xed')]]['queue']]=this[_0xa752('0x2a')][this['actions'][_0x2b2653[_0xa752('0xed')]][_0xa752('0xb9')]]['_rr'];if(_0x4b0dd5[_0xa752('0x85')]==='1'&&_0x4b0dd5['paused']==='0'){break;}}if(!_[_0xa752('0xf0')](_0x4b0dd5)){this[_0xa752('0x20')][_0x4b0dd5[_0xa752('0xf2')]][_0xa752('0xf8')]=_['isUndefined'](this[_0xa752('0x20')][_0x4b0dd5[_0xa752('0xf2')]]['unlockRR'])?!![]:this[_0xa752('0x20')][_0x4b0dd5[_0xa752('0xf2')]]['unlockRR'];}loggerBooked['info'](_0xa752('0xf9'),_0x2b2653[_0xa752('0xed')],_0xa752('0xfa'),JSON['stringify'](_['pick'](this[_0xa752('0x20')][_0x4b0dd5[_0xa752('0xf2')]],[_0xa752('0x46'),_0xa752('0xf8')])),_0xa752('0xfb'),JSON['stringify'](_0x4b0dd5[_0xa752('0xf4')]));if(!_['isNil'](_0x4b0dd5)&&_0x4b0dd5[_0xa752('0x85')]==='1'&&_0x4b0dd5['paused']==='0'&&this[_0xa752('0x20')][_0x4b0dd5[_0xa752('0xf2')]]['unlockRR']){this['agents'][_0x4b0dd5[_0xa752('0xf2')]][_0xa752('0xf8')]=![];this['queueBooked'][_0x598c23[_0xa752('0x24')][_0x2b2653[_0xa752('0xed')]][_0xa752('0xb9')]]=[];this[_0xa752('0x1d')]['run'](_0x4b0dd5['idHopper'],_0x4b0dd5[_0xa752('0xf2')])[_0xa752('0x9d')](function(_0x4d982c){logger[_0xa752('0x62')](_0xa752('0xfc'),util['inspect'](_0x4d982c,{'showHidden':![],'depth':null}));})[_0xa752('0x1b')](function(){utils[_0xa752('0xbd')](_0x598c23[_0xa752('0x1e')][_0x598c23[_0xa752('0x24')][_0x2b2653[_0xa752('0xed')]][_0xa752('0xb9')]],'[syncQueueStatusComplete]');setTimeout(function(){_0x598c23[_0xa752('0x20')][_0x4b0dd5[_0xa752('0xf2')]]['unlockRR']=!![];loggerBooked[_0xa752('0x49')](_0xa752('0xfd'),_0x2b2653[_0xa752('0xed')],_0xa752('0xfa'),JSON[_0xa752('0x81')](_[_0xa752('0x71')](_0x598c23['agents'][_0x4b0dd5[_0xa752('0xf2')]],[_0xa752('0x46'),_0xa752('0xf8')])),_0xa752('0xfb'),JSON[_0xa752('0x81')](_0x4b0dd5[_0xa752('0xf4')]));},0xc7);delete _0x598c23[_0xa752('0x24')][_0x2b2653['actionid']];unlockQueueStatus(_0x4f2762,_0x2b2653[_0xa752('0xed')]);});}else{loggerBooked[_0xa752('0x49')](_0xa752('0xfe'));utils[_0xa752('0xbd')](this[_0xa752('0x1e')][this[_0xa752('0x24')][_0x2b2653['actionid']][_0xa752('0xb9')]],_0xa752('0xf5'));hopperUtils[_0xa752('0xd5')]({'active':![],'ContactId':this[_0xa752('0x24')][_0x2b2653[_0xa752('0xed')]][_0xa752('0xd8')],'ListId':this['actions'][_0x2b2653[_0xa752('0xed')]][_0xa752('0xd9')],'VoiceQueueId':this['actions'][_0x2b2653['actionid']][_0xa752('0xe6')]||undefined,'CampaignId':this['actions'][_0x2b2653[_0xa752('0xed')]][_0xa752('0xda')]||undefined})['catch'](loggerCatch(_0xa752('0xff')));delete this[_0xa752('0x24')][_0x2b2653['actionid']];unlockQueueStatus(_0x4f2762);}}else{loggerBooked[_0xa752('0x49')](_0xa752('0x100'));utils[_0xa752('0xbd')](this[_0xa752('0x1e')][this[_0xa752('0x24')][_0x2b2653['actionid']]['queue']],_0xa752('0xf5'));hopperUtils[_0xa752('0xd5')]({'active':![],'ContactId':this[_0xa752('0x24')][_0x2b2653[_0xa752('0xed')]]['ContactId'],'ListId':this['actions'][_0x2b2653[_0xa752('0xed')]][_0xa752('0xd9')],'VoiceQueueId':this[_0xa752('0x24')][_0x2b2653[_0xa752('0xed')]][_0xa752('0xe6')]||undefined,'CampaignId':this['actions'][_0x2b2653[_0xa752('0xed')]][_0xa752('0xda')]||undefined})[_0xa752('0x9d')](loggerCatch(_0xa752('0x101')));delete this[_0xa752('0x24')][_0x2b2653[_0xa752('0xed')]];unlockQueueStatus(_0x4f2762);}}else{loggerBooked['info'](_0xa752('0x102'));utils[_0xa752('0xbd')](this[_0xa752('0x1e')][this['actions'][_0x2b2653['actionid']]['queue']],'[syncQueueStatusComplete]');hopperUtils[_0xa752('0xd5')]({'active':![],'ContactId':this['actions'][_0x2b2653[_0xa752('0xed')]][_0xa752('0xd8')],'ListId':this['actions'][_0x2b2653['actionid']][_0xa752('0xd9')],'VoiceQueueId':this[_0xa752('0x24')][_0x2b2653[_0xa752('0xed')]]['VoiceQueueId']||undefined,'CampaignId':this[_0xa752('0x24')][_0x2b2653[_0xa752('0xed')]][_0xa752('0xda')]||undefined})[_0xa752('0x9d')](loggerCatch(_0xa752('0x103')));delete this[_0xa752('0x24')][_0x2b2653[_0xa752('0xed')]];unlockQueueStatus(_0x4f2762);}};Dialer[_0xa752('0x19')][_0xa752('0x104')]=function(_0x37966c){var _0xe9c80b=this[_0xa752('0x24')][_0x37966c[_0xa752('0xed')]];if(_0xe9c80b){delete this['actions'][_0x37966c[_0xa752('0xed')]];_0xe9c80b['responsetime']=moment()[_0xa752('0x44')](_0xa752('0xc0'));var _0x19323f=_0xe9c80b[_0xa752('0x40')]===_0xa752('0xbc')?this[_0xa752('0x1f')][_0xe9c80b[_0xa752('0xb9')]]:this[_0xa752('0x1e')][_0xe9c80b[_0xa752('0x105')]()];if(_0x37966c[_0xa752('0x106')]!=='Success'){utils[_0xa752('0xbd')](_0x19323f,_0xa752('0x107'));return this[_0xa752('0x108')](_0xe9c80b,_0x19323f,_0x37966c)[_0xa752('0x9d')](loggerCatch('[callProgressDetecting]\x20'));}this[_0xa752('0xba')][_0x37966c['uniqueid']]=_0xe9c80b;}};Dialer[_0xa752('0x19')][_0xa752('0x38')]=function(_0x310db9){var _0x36a2c3=this;var _0x446515=this['uniqueId'][_0x310db9[_0xa752('0xbb')]];var _0x4a7ddb;if(!_[_0xa752('0xf0')](_0x310db9)&&!_[_0xa752('0xf0')](_0x310db9[_0xa752('0x109')])&&!_[_0xa752('0xf0')](_0x310db9['variable'][_0xa752('0x10a')])&&_0x310db9[_0xa752('0x10b')]==='xcally-motion-dialer'&&_0x446515){if(_0x446515[_0xa752('0x40')]!==_0xa752('0xbc')&&this[_0xa752('0x1e')][_0x446515['queue']][_0xa752('0x10c')]&&_0x310db9[_0xa752('0x10d')]==='HANGUP'){delete this[_0xa752('0xba')][_0x310db9['uniqueid']];utils[_0xa752('0xbd')](this['voiceQueues'][_0x446515['queue']],_0xa752('0x10e'));this[_0xa752('0x1e')][_0x446515[_0xa752('0xb9')]][_0xa752('0xc1')]+=0x1;this['voiceQueues'][_0x446515['queue']]['outboundAnswerAgiCallsDay']+=0x1;_0x4a7ddb=new Hangup(_0x446515,_0x310db9);_0x4a7ddb[_0xa752('0x6b')]=0x12;_0x4a7ddb[_0xa752('0x6c')]=_0xa752('0x10f');_0x4a7ddb[_0xa752('0x110')]=_0xa752('0x111');ami[_0xa752('0x3f')](_0xa752('0x112'),ut[_0xa752('0x113')](_0x4a7ddb,_0xa752('0x114')));this[_0xa752('0x115')](_0x4a7ddb,_0xa752('0x116'),_0xa752('0x117'));}if(_0x446515[_0xa752('0x40')]!==_0xa752('0xbc')&&this[_0xa752('0x1e')][_0x446515[_0xa752('0xb9')]]['dialAMDActive']&&_0x310db9[_0xa752('0x10d')]===_0xa752('0x118')){return new Promise(function(_0x5c88f5,_0x22b2e1){delete _0x36a2c3['uniqueId'][_0x310db9[_0xa752('0xbb')]];utils[_0xa752('0xbd')](_0x36a2c3[_0xa752('0x1e')][_0x446515[_0xa752('0xb9')]],_0xa752('0x10e'));_0x36a2c3[_0xa752('0x1e')][_0x446515['queue']][_0xa752('0xc1')]+=0x1;_0x36a2c3['voiceQueues'][_0x446515['queue']][_0xa752('0x119')]+=0x1;var _0x3823ee=_0x36a2c3[_0xa752('0x1e')][_0x446515[_0xa752('0xb9')]];var _0x108b5b=new Hangup(_0x446515,_0x310db9);_0x108b5b['state']=0x13;_0x108b5b[_0xa752('0x6c')]=_0xa752('0x11a');_0x108b5b[_0xa752('0x110')]=_0xa752('0x111');_0x108b5b['countmachineretry']+=0x1;_0x108b5b['countglobal']+=0x1;_0x108b5b[_0xa752('0x114')]=!![];ami[_0xa752('0x3f')]('custom:amd',ut[_0xa752('0x113')](_0x108b5b,'amd'));hopperUtils['createHistory'](_0x108b5b)[_0xa752('0x9d')](loggerCatch(_0xa752('0x11b')));if(_0x108b5b[_0xa752('0x11c')]+_0x108b5b[_0xa752('0x11d')]+_0x108b5b[_0xa752('0x11e')]+_0x108b5b[_0xa752('0x11f')]+_0x108b5b[_0xa752('0xcf')]+_0x108b5b[_0xa752('0xe2')]+_0x108b5b[_0xa752('0x120')]+_0x108b5b[_0xa752('0x121')]>=_0x3823ee[_0xa752('0x122')]){_0x36a2c3[_0xa752('0x123')](_0x108b5b,_0x5c88f5,_0x22b2e1,_0xa752('0x124'));}else{if(_0x108b5b[_0xa752('0x120')]>=_0x3823ee[_0xa752('0x125')]){_0x36a2c3['createStateFinal'](_0x108b5b,_0x5c88f5,_0x22b2e1,_0xa752('0x126'));}else{hopperUtils[_0xa752('0xd5')]({'active':![],'countmachineretry':_0x108b5b['countmachineretry'],'scheduledat':moment()[_0xa752('0xd6')](_0x3823ee[_0xa752('0x127')],_0xa752('0xd7'))[_0xa752('0x44')](_0xa752('0xc0')),'ContactId':_0x108b5b[_0xa752('0xd8')],'ListId':_0x108b5b['ListId'],'VoiceQueueId':_0x108b5b[_0xa752('0xe6')]||undefined,'CampaignId':_0x108b5b[_0xa752('0xda')]||undefined})[_0xa752('0x9d')](loggerCatch(_0xa752('0x128')));_0x5c88f5({'reschedule':0x1});}}});}if(_0x446515['type']==='ivr'&&this[_0xa752('0x1f')][_0x446515[_0xa752('0xb9')]]['dialAMDActive']&&_0x310db9[_0xa752('0x10d')]===_0xa752('0x129')){delete this[_0xa752('0xba')][_0x310db9[_0xa752('0xbb')]];utils['decrementOriginate'](this['campaigns'][_0x446515[_0xa752('0xb9')]],_0xa752('0x10e'));_0x4a7ddb=new Hangup(_0x446515,_0x310db9);_0x4a7ddb[_0xa752('0x6b')]=0x12;_0x4a7ddb[_0xa752('0x6c')]=_0xa752('0x10f');_0x4a7ddb['membername']=_0xa752('0x111');ami[_0xa752('0x3f')](_0xa752('0x112'),ut[_0xa752('0x113')](_0x4a7ddb,_0xa752('0x114')));this[_0xa752('0x115')](_0x4a7ddb,'[syncHangupInAMDIvr][createHistory]',_0xa752('0x12a'));}if(_0x446515[_0xa752('0x40')]==='ivr'&&this[_0xa752('0x1f')][_0x446515['queue']][_0xa752('0x10c')]&&_0x310db9[_0xa752('0x10d')]===_0xa752('0x118')){return new Promise(function(_0x481fd8,_0x4f6e9a){delete _0x36a2c3['uniqueId'][_0x310db9[_0xa752('0xbb')]];utils['decrementOriginate'](_0x36a2c3['campaigns'][_0x446515[_0xa752('0xb9')]],'[syncVarSet]');_0x36a2c3[_0xa752('0x1f')][_0x446515[_0xa752('0xb9')]][_0xa752('0xc1')]+=0x1;_0x36a2c3[_0xa752('0x1f')][_0x446515['queue']][_0xa752('0x119')]+=0x1;var _0x4c497e=_0x36a2c3[_0xa752('0x1f')][_0x446515['queue']];var _0x3989f0=new Hangup(_0x446515,_0x310db9);_0x3989f0[_0xa752('0x6b')]=0x13;_0x3989f0['statedesc']=_0xa752('0x11a');_0x3989f0[_0xa752('0x110')]='AMD';_0x3989f0[_0xa752('0x120')]+=0x1;_0x3989f0[_0xa752('0xe3')]+=0x1;_0x3989f0[_0xa752('0x114')]=!![];ami[_0xa752('0x3f')](_0xa752('0x112'),ut[_0xa752('0x113')](_0x3989f0,'amd'));hopperUtils[_0xa752('0xe9')](_0x3989f0)[_0xa752('0x9d')](loggerCatch(_0xa752('0x11b')));if(_0x3989f0['countbusyretry']+_0x3989f0[_0xa752('0x11d')]+_0x3989f0[_0xa752('0x11e')]+_0x3989f0[_0xa752('0x11f')]+_0x3989f0['countdropretry']+_0x3989f0[_0xa752('0xe2')]+_0x3989f0[_0xa752('0x120')]+_0x3989f0[_0xa752('0x121')]>=_0x4c497e['dialGlobalMaxRetry']){_0x36a2c3[_0xa752('0x123')](_0x3989f0,_0x481fd8,_0x4f6e9a,'reason19\x20machine....');}else{if(_0x3989f0[_0xa752('0x120')]>=_0x4c497e[_0xa752('0x125')]){_0x36a2c3[_0xa752('0x12b')](_0x3989f0,_0x481fd8,_0x4f6e9a,'reason\x2019\x20machine....');}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x3989f0[_0xa752('0x120')],'scheduledat':moment()['add'](_0x4c497e[_0xa752('0x127')],'minutes')[_0xa752('0x44')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3989f0[_0xa752('0xd8')],'ListId':_0x3989f0['ListId'],'VoiceQueueId':_0x3989f0[_0xa752('0xe6')]||undefined,'CampaignId':_0x3989f0[_0xa752('0xda')]||undefined})[_0xa752('0x9d')](loggerCatch(_0xa752('0x128')));_0x481fd8({'reschedule':0x1});}}});}}};Dialer['prototype']['syncHangup']=function(_0x5a69d2){var _0x1a0347=this[_0xa752('0xba')][_0x5a69d2[_0xa752('0xbb')]];var _0x283cdd;if(!_0x1a0347){return;}if(_0x1a0347[_0xa752('0x40')]===_0xa752('0xbc')){delete this[_0xa752('0xba')][_0x5a69d2['uniqueid']];utils[_0xa752('0xbd')](this[_0xa752('0x1f')][_0x1a0347[_0xa752('0xb9')]],_0xa752('0x12c'));this['campaigns'][_0x1a0347[_0xa752('0xb9')]][_0xa752('0x12d')]+=0x1;if(_0x5a69d2['cause-txt']==='Normal\x20Clearing'){const _0x524790=new AgentComplete(_0x1a0347,_0x5a69d2);_0x524790[_0xa752('0xda')]=this[_0xa752('0x1f')][_0x1a0347[_0xa752('0xb9')]]['id'];hopperUtils[_0xa752('0xe9')](_0x524790)[_0xa752('0x9d')](loggerCatch(_0xa752('0x12e')));hopperUtils[_0xa752('0x12f')](_0x524790)[_0xa752('0x9d')](loggerCatch('[syncAgentCompleteIvr]'));}else{_0x283cdd=new Hangup(_0x1a0347,_0x5a69d2);hopperUtils['createHistory'](_0x283cdd)[_0xa752('0x9d')](loggerCatch(_0xa752('0x130')));hopperUtils[_0xa752('0x12f')](_0x283cdd)[_0xa752('0x9d')](loggerCatch(_0xa752('0x131')));}}else{if(isNotNull(this[_0xa752('0x1e')][_0x1a0347[_0xa752('0xb9')]][_0xa752('0x132')])){delete this[_0xa752('0xba')][_0x5a69d2[_0xa752('0xbb')]];utils[_0xa752('0xbd')](this[_0xa752('0x1e')][_0x1a0347[_0xa752('0xb9')]],_0xa752('0x12c'));this[_0xa752('0x1e')][_0x1a0347['queue']][_0xa752('0xc1')]+=0x1;this[_0xa752('0x1e')][_0x1a0347[_0xa752('0xb9')]][_0xa752('0x119')]+=0x1;_0x283cdd=new Hangup(_0x1a0347,_0x5a69d2);_0x283cdd[_0xa752('0x6b')]=0x10;_0x283cdd['statedesc']='AnswerAGI';_0x283cdd[_0xa752('0x110')]=_0xa752('0x133');hopperUtils[_0xa752('0xe9')](_0x283cdd)['catch'](loggerCatch(_0xa752('0x130')));hopperUtils[_0xa752('0x12f')](_0x283cdd)[_0xa752('0x9d')](loggerCatch(_0xa752('0x131')));}else{delete this[_0xa752('0xba')][_0x5a69d2[_0xa752('0xbb')]];utils['decrementOriginate'](this[_0xa752('0x1e')][_0x1a0347['queue']],_0xa752('0x134'));if(_0x5a69d2[_0xa752('0x135')]===_0xa752('0x136')){this['voiceQueues'][_0x1a0347[_0xa752('0xb9')]][_0xa752('0xc1')]+=0x1;const _0x53d1ba=new AgentComplete(_0x1a0347,_0x5a69d2);_0x53d1ba[_0xa752('0xe6')]=this[_0xa752('0x1e')][_0x1a0347[_0xa752('0xb9')]]['id'];hopperUtils[_0xa752('0xe9')](_0x53d1ba)[_0xa752('0x9d')](loggerCatch(_0xa752('0xc5')));hopperUtils[_0xa752('0x12f')](_0x53d1ba)[_0xa752('0x9d')](loggerCatch(_0xa752('0xc6')));}else{this['voiceQueues'][_0x1a0347['queue']][_0xa752('0x137')]+=0x1;_0x283cdd=new Hangup(_0x1a0347,_0x5a69d2);_0x283cdd['state']=0xc;_0x283cdd[_0xa752('0x6c')]=_0x5a69d2[_0xa752('0x135')];_0x283cdd[_0xa752('0x110')]='Unknown';hopperUtils[_0xa752('0xe9')](_0x283cdd)[_0xa752('0x9d')](loggerCatch('[syncHangup][createHistory]'));hopperUtils[_0xa752('0x12f')](_0x283cdd)[_0xa752('0x9d')](loggerCatch(_0xa752('0x12c')));}}}};Dialer[_0xa752('0x19')][_0xa752('0xc')]=function(_0x4baccf){var _0x5e4079=this;if(!_0x5e4079[_0xa752('0x2c')][_0x4baccf[_0xa752('0x46')]]){_0x5e4079[_0xa752('0x2c')][_0x4baccf[_0xa752('0x46')]]={'running':![]};}else if(_0x5e4079['queuesSummary'][_0x4baccf['name']][_0xa752('0x138')]===!![]){return;}else if(_0x5e4079[_0xa752('0x2c')][_0x4baccf[_0xa752('0x46')]][_0xa752('0x138')]===![]){_0x5e4079['queuesSummary'][_0x4baccf[_0xa752('0x46')]][_0xa752('0x138')]=!![];}var _0x1135f8=_0x5e4079[_0xa752('0x1e')][_0x4baccf[_0xa752('0x46')]];var _0x85a69a=_0x1135f8[_0xa752('0x65')]!==utils[_0xa752('0x73')][_0xa752('0x7b')];var _0x59de74=utils['isPreviewCampaign'](_0x1135f8);_0x1135f8[_0xa752('0x139')]=utils['getQueueCampaignStatusMessage'](_0x1135f8,_0x5e4079['trunks']);Promise['resolve']()['then'](function(){if(_0x1135f8[_0xa752('0x139')]===utils[_0xa752('0x73')][_0xa752('0x7b')]){if(_0x85a69a){clearPredictiveAttributes(_0x1135f8);_0x4baccf[_0xa752('0x27')]=undefined;_0x4baccf[_0xa752('0x28')]=undefined;}if(_0x1135f8['statusMessage']===utils[_0xa752('0x73')][_0xa752('0x7b')]){_0x4baccf[_0xa752('0x13a')]=0x0;_0x4baccf[_0xa752('0x13b')]=0x0;_0x4baccf[_0xa752('0x13c')]=0x0;_0x4baccf[_0xa752('0x13d')]=0x0;_0x4baccf[_0xa752('0x13e')]=0x0;}}else if(_0x1135f8['statusMessage']===utils[_0xa752('0x73')][_0xa752('0x13f')]&&!_0x59de74){return _0x5e4079[_0xa752('0x8f')](_0x1135f8,!![])[_0xa752('0x99')](function(){return _0x5e4079[_0xa752('0x8f')](_0x1135f8,![]);})[_0xa752('0x99')](function(){return _0x5e4079[_0xa752('0x140')](_0x1135f8);})[_0xa752('0x9d')](function(_0x5de342){loggerSyncQueueSummary[_0xa752('0x42')](_0xa752('0x141'),util[_0xa752('0x43')](_0x5de342,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x1135f8);});}else{clearPredictiveAttributes(_0x1135f8);}})[_0xa752('0x99')](function(){var _0x2d9bc3=_0x4baccf[_0xa752('0x142')](_0x1135f8);if(_0x2d9bc3||_0x1135f8[_0xa752('0x143')]){_0x1135f8[_0xa752('0x143')]=![];_0x4baccf[_0xa752('0x144')](_0x1135f8);Object[_0xa752('0x145')](_0x1135f8,_0x4baccf);emitOutboundVoiceQueueSummary(_0x4baccf);}_0x5e4079[_0xa752('0x2c')][_0x1135f8[_0xa752('0x46')]]['running']=![];})[_0xa752('0x9d')](function(_0x2041e1){logger['error']('[syncQueueSummary]',util[_0xa752('0x43')](_0x2041e1,{'showHidden':![],'depth':null}));_0x5e4079[_0xa752('0x2c')][_0x1135f8[_0xa752('0x46')]]['running']=![];});};Dialer[_0xa752('0x19')][_0xa752('0x146')]=_[_0xa752('0x147')](function(){var _0x148cd8=_[_0xa752('0x148')](this[_0xa752('0x1e')],function(_0x119c02){return _0x119c02[_0xa752('0x149')];});var _0x168a20=_[_0xa752('0x148')](this[_0xa752('0x20')],function(_0x172367){return _0x172367[_0xa752('0x14a')]&&_0x172367['status']===_0xa752('0x14b');});if(_0x148cd8[_0xa752('0xf7')]>0x0&&_0x168a20[_0xa752('0xf7')]>0x0){return Promise[_0xa752('0x14c')]()[_0xa752('0x99')](cmHopper['handlePreviewRecallNotifications'](_['map'](_0x148cd8,'id'),previewRecallmeReminderInterval,_[_0xa752('0x14d')](_0x168a20,'id')))[_0xa752('0x99')](function(_0x334ce2){for(var _0x3ef904=0x0;_0x3ef904<_0x334ce2[_0xa752('0xf7')];_0x3ef904++){var _0x246b72=_0x334ce2[_0x3ef904][_0xa752('0x14e')][_0xa752('0x46')];if(_0x246b72)io['to'](util[_0xa752('0x44')](_0xa752('0x14f'),_0x246b72))['emit'](_0xa752('0x150'),{'hopper':_0x334ce2[_0x3ef904]});}})[_0xa752('0x9d')](function(_0x627cce){logger[_0xa752('0x62')]('checkPreviewRecallReminder',_0x627cce);});}},0x3c*0x3e8,{'leading':!![]});Dialer['prototype'][_0xa752('0x151')]=function(){var _0x2ec4c6=this;setInterval(function(){_0x2ec4c6[_0xa752('0x152')](_0x2ec4c6[_0xa752('0xba')],'[uniqueid]');_0x2ec4c6[_0xa752('0x152')](_0x2ec4c6[_0xa752('0x24')],_0xa752('0x153'));},0x32c8);};Dialer[_0xa752('0x19')]['clearZombieChannels']=function(_0x1d462d,_0x3467a3){var _0x482529=this;for(var _0x533ca9 in _0x1d462d){if(typeof _0x1d462d[_0x533ca9]!==_0xa752('0x154')){this['sequence'][_0xa752('0x155')](function(){if(!_['isNil'](_0x1d462d[_0x533ca9])){return ami[_0xa752('0x9e')]({'action':_0xa752('0x85'),'channel':_0x1d462d[_0x533ca9][_0xa752('0xec')]})[_0xa752('0x9d')](function(_0xe02a6e){if(_0xe02a6e[_0xa752('0x65')]===_0xa752('0x156')){setTimeout(function(){if(_0x1d462d[_0x533ca9]&&_0x1d462d[_0x533ca9][_0xa752('0x40')]!==_0xa752('0xbc')){utils[_0xa752('0xbd')](_0x482529[_0xa752('0x1e')][_0x1d462d[_0x533ca9]['queue']],'[clearZombieChannels]');logger[_0xa752('0x62')](_0xa752('0x157'),_0x3467a3,_0x533ca9,_0x1d462d[_0x533ca9]['queue']);delete _0x1d462d[_0x533ca9];}if(_0x1d462d[_0x533ca9]&&_0x1d462d[_0x533ca9]['type']==='ivr'){utils[_0xa752('0xbd')](_0x482529[_0xa752('0x1f')][_0x1d462d[_0x533ca9][_0xa752('0xb9')]],_0xa752('0x158'));logger[_0xa752('0x62')](_0xa752('0x159'),_0x3467a3,_0x533ca9,_0x1d462d[_0x533ca9][_0xa752('0xb9')]);delete _0x1d462d[_0x533ca9];}},0x2328);}});}});}}};Dialer[_0xa752('0x19')][_0xa752('0x15a')]=function(_0x188d3d){return Promise[_0xa752('0x14c')]()[_0xa752('0x99')](voiceQueueRt['getVoiceQueueRtPauses'](_0x188d3d))[_0xa752('0x9d')](loggerCatch(_0xa752('0x15b')));};Dialer['prototype'][_0xa752('0x15c')]=function(_0x2f7558,_0x4ff81c,_0x2f7c80){var _0x4ab125={'state':0x19,'statedesc':_0xa752('0x15d')};utils[_0xa752('0xbd')](_0x4ff81c,_0xa752('0x15e')+_0x2f7558);this[_0xa752('0x115')](_[_0xa752('0x5d')](_0x4ab125,_[_0xa752('0x71')](_0x2f7c80,[_0xa752('0xd8'),'ListId',_0xa752('0x15f'),_0xa752('0xe6'),_0xa752('0xda')])),_0xa752('0x160'),_0xa752('0x15e'));logger[_0xa752('0x62')](_0x2f7558);};Dialer[_0xa752('0x19')][_0xa752('0x115')]=function(_0xf8f284,_0x425ed,_0x2797af){hopperUtils['createHistory'](_0xf8f284)[_0xa752('0x9d')](loggerCatch(_0x425ed));hopperUtils[_0xa752('0x12f')](_0xf8f284)[_0xa752('0x9d')](loggerCatch(_0x2797af));};Dialer[_0xa752('0x19')][_0xa752('0xd4')]=function(_0x246688,_0x44d623){hopperUtils[_0xa752('0xe9')](_0x246688)['catch'](loggerCatch(_0xa752('0xc5')));if(_0x44d623==0x0){hopperUtils[_0xa752('0x12f')](_0x246688)[_0xa752('0x9d')](loggerCatch(_0xa752('0x161')));}};Dialer[_0xa752('0x19')][_0xa752('0x162')]=function(_0x144ca1){return Promise[_0xa752('0x14c')]()[_0xa752('0x99')](cmHopper[_0xa752('0x163')](_0x144ca1['id'],previewRecallmeReminderInterval))[_0xa752('0x99')](function(_0x3d1cfb){for(var _0x255394=0x0;_0x255394<_0x3d1cfb['length'];_0x255394++){var _0x4b906c=_0x3d1cfb[_0x255394][_0xa752('0x14e')][_0xa752('0x46')];if(_0x4b906c)io['to'](util[_0xa752('0x44')]('user:%s',_0x4b906c))[_0xa752('0x3f')](_0xa752('0x150'),{'hopper':_0x3d1cfb[_0x255394]});}})[_0xa752('0x9d')](function(){});};Dialer[_0xa752('0x19')][_0xa752('0x164')]=function(_0x39063f){var _0x1e69b5=this;return function(){_0x1e69b5[_0xa752('0x165')](_0x39063f);};};Dialer['prototype'][_0xa752('0x166')]=function(_0x31905a,_0x2aa5bf){var _0x5d3576=this;var _0x52cc38=uuid['v4']();this[_0xa752('0x24')][_0x52cc38]=new Action(_0x31905a,_0x2aa5bf,_0x52cc38);return new Promise(function(_0xa70795,_0x5e98f8){if(_['isUndefined'](_0x31905a)&&typeof _0x31905a!=='object'){return _0x5e98f8(msgResponse(_0xa752('0x167'),'Failure',_0xa752('0x168')));}if(_[_0xa752('0x3e')](_0x2aa5bf['phone'])||_0x2aa5bf[_0xa752('0x169')]===null){return _0x5e98f8(msgResponse('originate',_0xa752('0x90'),_0xa752('0x16a')));}var _0x3c55a0={'XMD-CALLERID':_0x5d3576[_0xa752('0x24')][_0x52cc38][_0xa752('0x16b')](),'XMD-AGI':_0x31905a[_0xa752('0x132')]?util[_0xa752('0x44')](_0xa752('0x16c'),ipAgi,_0x31905a['dialQueueProject']):_0xa752('0x16d'),'XMD-AGIAFTER':_0x31905a[_0xa752('0xc3')]?util[_0xa752('0x44')](_0xa752('0x16c'),ipAgi,_0x31905a[_0xa752('0xc3')]):_0xa752('0x16d'),'XMD-QUEUE':utils['isOutboundQueue'](_0x31905a)?util[_0xa752('0x44')]('\x22%s,%s%s,,,%s\x22',_0x31905a[_0xa752('0x46')],_0x31905a[_0xa752('0x16e')]||'',_0x31905a[_0xa752('0xc4')]?'c':'',_0x31905a[_0xa752('0xca')]||0x3):_0xa752('0x16d'),'XMD-CONTACTID':_0x2aa5bf[_0xa752('0xd8')],'XMD-CDRTYPE':_0xa752('0x9'),'CALLERID(all)':_0x5d3576[_0xa752('0x24')][_0x52cc38]['getCaller'](),'XMD-AMD':_0x31905a[_0xa752('0x10c')]?_0xa752('0x13f'):_0xa752('0x16d'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x31905a[_0xa752('0x10c')]){_0x3c55a0['XMD-AMDINITIALSILENCE']=_0x31905a[_0xa752('0x16f')]||0x9c4;_0x3c55a0[_0xa752('0x170')]=_0x31905a[_0xa752('0x171')]||0x5dc;_0x3c55a0[_0xa752('0x172')]=_0x31905a[_0xa752('0x173')]||0x320;_0x3c55a0[_0xa752('0x174')]=_0x31905a[_0xa752('0x175')]||0x1388;_0x3c55a0[_0xa752('0x176')]=_0x31905a[_0xa752('0x177')]||0x64;_0x3c55a0['XMD-AMDBETWEENWORDSSILENCE']=_0x31905a[_0xa752('0x178')]||0x32;_0x3c55a0[_0xa752('0x179')]=_0x31905a[_0xa752('0x17a')]||0x3;_0x3c55a0[_0xa752('0x17b')]=_0x31905a[_0xa752('0x17c')]||0x100;_0x3c55a0[_0xa752('0x17d')]=_0x31905a['dialAMDMaximumWordLength']||0x1388;}if(utils['isOutboundQueue'](_0x31905a)){_0x3c55a0[_0xa752('0x17e')]=_0x2aa5bf[_0xa752('0xe6')];}else{_0x3c55a0[_0xa752('0x17f')]=_0x2aa5bf[_0xa752('0xda')];}var _0x3d7209=utils['setXMDContactVariables'](_0x2aa5bf[_0xa752('0x180')]);Object[_0xa752('0x145')](_0x3c55a0,_0x3d7209);var _0x20fba5=_0x5d3576[_0xa752('0x82')](_0x31905a[_0xa752('0x88')])?utils['getCallerId'](_0x31905a[_0xa752('0x88')][_0xa752('0x181')],_0x31905a[_0xa752('0x182')],_0x31905a[_0xa752('0x183')]>0x0?utils['getCallerIdRandom'](_0x31905a[_0xa752('0x184')],_0x31905a[_0xa752('0x183')]):_0x31905a[_0xa752('0x184')]):utils[_0xa752('0x185')](_[_0xa752('0xf0')](_0x31905a[_0xa752('0x89')])?_0x31905a['Trunk'][_0xa752('0x181')]:_0x31905a['TrunkBackup'][_0xa752('0x181')],_0x31905a[_0xa752('0x182')],_0x31905a[_0xa752('0x183')]>0x0?utils[_0xa752('0x186')](_0x31905a[_0xa752('0x184')],_0x31905a[_0xa752('0x183')]):_0x31905a['dialOriginateCallerIdNumber']);if(_0x20fba5){_0x3c55a0[_0xa752('0x187')]=_0x5d3576[_0xa752('0x24')][_0x52cc38][_0xa752('0x188')]=utils[_0xa752('0x189')](_0x20fba5);_0x3c55a0['XMD-ORIGINATECALLERIDNUM']=_0x2aa5bf[_0xa752('0x169')];}_0x31905a['variables']=_0x3c55a0;return ami[_0xa752('0x9e')]({'actionid':_0x52cc38,'action':_0xa752('0x167'),'channel':_0x5d3576['isTrunkReachable'](_0x31905a[_0xa752('0x88')])?util['format'](_0xa752('0x18a'),_0x31905a['Trunk'][_0xa752('0x46')],isNotNull(_0x31905a[_0xa752('0x18b')])?_0x31905a[_0xa752('0x18b')][_0xa752('0x18c')]()||'':'',_0x31905a[_0xa752('0x18d')]>0x0?_0x2aa5bf[_0xa752('0x169')][_0xa752('0x18e')](_0x31905a[_0xa752('0x18d')]):_0x2aa5bf[_0xa752('0x169')]):util[_0xa752('0x44')](_0xa752('0x18a'),_[_0xa752('0xf0')](_0x31905a[_0xa752('0x89')])?_0x31905a[_0xa752('0x88')]['name']:_0x31905a[_0xa752('0x89')][_0xa752('0x46')],isNotNull(_0x31905a[_0xa752('0x18b')])?_0x31905a[_0xa752('0x18b')]['trim']()||'':'',_0x31905a[_0xa752('0x18d')]>0x0?_0x2aa5bf['phone'][_0xa752('0x18e')](_0x31905a[_0xa752('0x18d')]):_0x2aa5bf['phone']),'callerid':_0x20fba5,'Exten':_0xa752('0x18f'),'Context':'from-sip','Priority':'1','variable':_0x3c55a0,'timeout':(_0x31905a[_0xa752('0x190')]||0x1e)*0x3e8,'async':!![],'channelid':_0x52cc38})[_0xa752('0x99')](function(_0x33ca88){return _0xa70795(_0x33ca88);})[_0xa752('0x9d')](function(_0x4c81ff){_0x31905a[_0xa752('0x191')]+=0x1;var _0x3d360e=new History(_0x5d3576['actions'][_0x52cc38]);logger['error'](util['format'](_0xa752('0x192'),JSON[_0xa752('0x81')](_0x4c81ff)));_0x3d360e[_0xa752('0x6b')]=0xe;_0x3d360e[_0xa752('0x6c')]=_0xa752('0x193');_0x3d360e[_0xa752('0xe8')]=moment()[_0xa752('0x44')](_0xa752('0xc0'));_0x3d360e[_0xa752('0x6d')]=_0x3d360e[_0xa752('0xe8')];hopperUtils[_0xa752('0xe9')](_0x3d360e)['catch'](loggerCatch(_0xa752('0x194')));_0x5d3576[_0xa752('0x12f')](_0x3d360e)[_0xa752('0x9d')](loggerCatch('[originate][error]'))[_0xa752('0x1b')](function(){delete _0x5d3576['actions'][_0x52cc38];return _0x5e98f8(msgResponse(_0xa752('0x167'),_0xa752('0x195'),'originate\x20action\x20Error'));});});});};Dialer[_0xa752('0x19')]['checkRetriveMax']=function(_0x41ab53,_0x4b28ab,_0x1e8fa7){var _0xfee2f3=new History(_0x4b28ab);if(_0xfee2f3[_0xa752('0x11c')]+_0xfee2f3[_0xa752('0x11d')]+_0xfee2f3[_0xa752('0x11e')]+_0xfee2f3[_0xa752('0x11f')]+_0xfee2f3['countdropretry']+_0xfee2f3[_0xa752('0xe2')]+_0xfee2f3[_0xa752('0x120')]+_0xfee2f3['countagentrejectretry']>=_0x1e8fa7[_0xa752('0x122')]-0x1){return!![];}switch(_0x41ab53){case 0x3:if(_0xfee2f3[_0xa752('0x11e')]>=_0x1e8fa7['dialNoAnswerMaxRetry']-0x1){return!![];}hopperUtils[_0xa752('0xd5')]({'active':![],'countnoanswerretry':_0xfee2f3[_0xa752('0x11e')]+=0x1,'scheduledat':moment()[_0xa752('0xd6')](_0x1e8fa7['dialNoAnswerRetryFrequency'],'minutes')[_0xa752('0x44')](_0xa752('0xc0')),'ContactId':_0xfee2f3[_0xa752('0xd8')],'ListId':_0xfee2f3[_0xa752('0xd9')],'VoiceQueueId':_0xfee2f3['VoiceQueueId']||undefined,'CampaignId':_0xfee2f3[_0xa752('0xda')]||undefined})[_0xa752('0x9d')](loggerCatch(_0xa752('0x196')));break;case 0x5:if(_0xfee2f3[_0xa752('0x11c')]>=_0x1e8fa7[_0xa752('0x197')]-0x1){return!![];}hopperUtils[_0xa752('0xd5')]({'active':![],'countbusyretry':_0xfee2f3['countbusyretry']+=0x1,'scheduledat':moment()[_0xa752('0xd6')](_0x1e8fa7[_0xa752('0x198')],_0xa752('0xd7'))['format'](_0xa752('0xc0')),'ContactId':_0xfee2f3[_0xa752('0xd8')],'ListId':_0xfee2f3[_0xa752('0xd9')],'VoiceQueueId':_0xfee2f3['VoiceQueueId']||undefined,'CampaignId':_0xfee2f3['CampaignId']||undefined})[_0xa752('0x9d')](loggerCatch(_0xa752('0x199')));break;case 0x8:if(_0xfee2f3[_0xa752('0x11d')]>=_0x1e8fa7['dialCongestionMaxRetry']-0x1){return!![];}hopperUtils[_0xa752('0xd5')]({'active':![],'countcongestionretry':_0xfee2f3[_0xa752('0x11d')]+=0x1,'scheduledat':moment()[_0xa752('0xd6')](_0x1e8fa7[_0xa752('0x19a')],_0xa752('0xd7'))[_0xa752('0x44')](_0xa752('0xc0')),'ContactId':_0xfee2f3[_0xa752('0xd8')],'ListId':_0xfee2f3[_0xa752('0xd9')],'VoiceQueueId':_0xfee2f3[_0xa752('0xe6')]||undefined,'CampaignId':_0xfee2f3[_0xa752('0xda')]||undefined})[_0xa752('0x9d')](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0xfee2f3[_0xa752('0x11f')]>=_0x1e8fa7[_0xa752('0x19b')]-0x1){return!![];}else{hopperUtils[_0xa752('0xd5')]({'active':![],'countnosuchnumberretry':_0xfee2f3[_0xa752('0x11f')]+=0x1,'scheduledat':moment()[_0xa752('0xd6')](_0x1e8fa7[_0xa752('0x19c')],'minutes')[_0xa752('0x44')](_0xa752('0xc0')),'ContactId':_0xfee2f3[_0xa752('0xd8')],'ListId':_0xfee2f3['ListId'],'VoiceQueueId':_0xfee2f3[_0xa752('0xe6')]||undefined,'CampaignId':_0xfee2f3[_0xa752('0xda')]||undefined})[_0xa752('0x9d')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0xfee2f3[_0xa752('0xcf')]>=_0x1e8fa7[_0xa752('0x19d')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0xfee2f3[_0xa752('0xcf')]+=0x1,'scheduledat':moment()[_0xa752('0xd6')](_0x1e8fa7[_0xa752('0xd0')],_0xa752('0xd7'))[_0xa752('0x44')](_0xa752('0xc0')),'ContactId':_0xfee2f3[_0xa752('0xd8')],'ListId':_0xfee2f3[_0xa752('0xd9')],'VoiceQueueId':_0xfee2f3['VoiceQueueId']||undefined,'CampaignId':_0xfee2f3['CampaignId']||undefined})['catch'](loggerCatch(_0xa752('0xdb')));break;case 0xb:if(_0xfee2f3['countabandonedretry']>=_0x1e8fa7['dialAbandonedMaxRetry']-0x1){return!![];}hopperUtils[_0xa752('0xd5')]({'active':![],'countabandonedretry':_0xfee2f3[_0xa752('0xe2')]+=0x1,'scheduledat':moment()[_0xa752('0xd6')](_0x1e8fa7['dialAbandonedRetryFrequency'],_0xa752('0xd7'))[_0xa752('0x44')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xfee2f3[_0xa752('0xd8')],'ListId':_0xfee2f3['ListId'],'VoiceQueueId':_0xfee2f3[_0xa752('0xe6')]||undefined,'CampaignId':_0xfee2f3[_0xa752('0xda')]||undefined})[_0xa752('0x9d')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0xfee2f3[_0xa752('0x120')]>=_0x1e8fa7['dialMachineMaxRetry']-0x1){return!![];}hopperUtils[_0xa752('0xd5')]({'active':![],'countmachineretry':_0xfee2f3[_0xa752('0x120')]+=0x1,'scheduledat':moment()[_0xa752('0xd6')](_0x1e8fa7[_0xa752('0x127')],_0xa752('0xd7'))['format'](_0xa752('0xc0')),'ContactId':_0xfee2f3['ContactId'],'ListId':_0xfee2f3[_0xa752('0xd9')],'VoiceQueueId':_0xfee2f3[_0xa752('0xe6')]||undefined,'CampaignId':_0xfee2f3[_0xa752('0xda')]||undefined})[_0xa752('0x9d')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0xfee2f3[_0xa752('0x121')]>=_0x1e8fa7[_0xa752('0x19e')]-0x1){return!![];}hopperUtils[_0xa752('0xd5')]({'active':![],'countagentrejectretry':_0xfee2f3[_0xa752('0x121')]+=0x1,'scheduledat':moment()['add'](_0x1e8fa7[_0xa752('0x19f')],_0xa752('0xd7'))[_0xa752('0x44')](_0xa752('0xc0')),'ContactId':_0xfee2f3[_0xa752('0xd8')],'ListId':_0xfee2f3[_0xa752('0xd9')],'VoiceQueueId':_0xfee2f3['VoiceQueueId']||undefined,'CampaignId':_0xfee2f3['CampaignId']||undefined})['catch'](loggerCatch(_0xa752('0x1a0')));break;default:return!![];}};Dialer[_0xa752('0x19')][_0xa752('0x108')]=function(_0xec8478,_0x4f4f42,_0x5f5586){var _0xf421bc=this;var _0x44c417=new History(_0xec8478);var _0x251775=![];var _0x53c6d2;var _0x5f3225;return new Promise(function(_0x357bef,_0x27d6cc){if(_[_0xa752('0x3e')](_0x4f4f42)&&typeof _0x4f4f42!==_0xa752('0x1a1')){return _0x27d6cc(msgResponse(_0xa752('0x1a2'),_0xa752('0x90'),_0xa752('0x1a3')));}if(_['isUndefined'](_0x5f5586)&&typeof _0x5f5586!==_0xa752('0x1a1')){return _0x27d6cc(msgResponse('[callProgressDetecting]','Failure',_0xa752('0x1a4')));}hopperUtils[_0xa752('0xd1')](_0x44c417,_0x5f5586[_0xa752('0x1a5')],_0x4f4f42)[_0xa752('0x99')](function(_0x26b9f8){if(_0x26b9f8['additional']==0x1)_0x251775=!![];switch(_0x5f5586[_0xa752('0x1a5')]){case'0':_0x4f4f42['outboundNoSuchCallsDay']+=0x1;_0x44c417[_0xa752('0x6b')]=0x0;_0x44c417[_0xa752('0x6c')]=_0xa752('0x1a6');_0x44c417[_0xa752('0x11f')]+=0x1;_0x44c417['countglobal']+=0x1;ami['emit'](_0xa752('0x1a7'),ut['buildObj'](_0xec8478,_0xa752('0x1a8')));_0x53c6d2=_0x4f4f42[_0xa752('0x19c')];_0x5f3225=_0x4f4f42[_0xa752('0xe4')];hopperUtils[_0xa752('0xe9')](_0x44c417)[_0xa752('0x9d')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0xf421bc[_0xa752('0x1a9')](0x0,_0xec8478,_0x4f4f42)&&!_0x251775){if(_0x44c417['countnosuchnumberretry']>=_0x4f4f42[_0xa752('0x19b')]){_0xf421bc[_0xa752('0x12b')](_0x44c417,_0x357bef,_0x27d6cc,_0xa752('0x1aa'));}else{_0xf421bc[_0xa752('0x123')](_0x44c417,_0x357bef,_0x27d6cc,_0xa752('0x1aa'));}}break;case'3':_0x4f4f42[_0xa752('0x1ab')]+=0x1;_0x44c417[_0xa752('0x6b')]=0x3;_0x44c417[_0xa752('0x6c')]=_0xa752('0x1ac');_0x44c417[_0xa752('0x11e')]+=0x1;_0x44c417['countglobal']+=0x1;var _0x5dec8e=ut[_0xa752('0x1ad')](_0xec8478,_0x4f4f42);ami[_0xa752('0x3f')](_0xa752('0x1ae'),_0x5dec8e);_0x53c6d2=_0x4f4f42['dialNoAnswerRetryFrequency'];_0x5f3225=_0x4f4f42['callAdditionalPhoneAfterMin'];hopperUtils[_0xa752('0xe9')](_0x44c417)['catch'](loggerCatch(_0xa752('0x1af')));if(_0xf421bc[_0xa752('0x1a9')](0x3,_0xec8478,_0x4f4f42)&&!_0x251775){if(_0x44c417['countnoanswerretry']>=_0x4f4f42[_0xa752('0x1b0')]){_0xf421bc[_0xa752('0x12b')](_0x44c417,_0x357bef,_0x27d6cc,'reason\x203\x20ringing\x20no\x20answer');}else{_0xf421bc[_0xa752('0x123')](_0x44c417,_0x357bef,_0x27d6cc,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x4f4f42[_0xa752('0x1b1')]+=0x1;_0x44c417['state']=0x5;_0x44c417[_0xa752('0x6c')]=_0xa752('0x1b2');_0x44c417[_0xa752('0x11c')]+=0x1;_0x44c417[_0xa752('0xe3')]+=0x1;ami[_0xa752('0x3f')](_0xa752('0x1b3'),ut['buildObj'](_0xec8478,_0xa752('0x1b4')));_0x53c6d2=_0x4f4f42[_0xa752('0x198')];_0x5f3225=_0x4f4f42[_0xa752('0xe4')];hopperUtils[_0xa752('0xe9')](_0x44c417)[_0xa752('0x9d')](loggerCatch(_0xa752('0x1b5')));if(_0xf421bc[_0xa752('0x1a9')](0x5,_0xec8478,_0x4f4f42)&&!_0x251775){if(_0x44c417[_0xa752('0x11c')]>=_0x4f4f42['dialBusyMaxRetry']){_0xf421bc['createStateFinal'](_0x44c417,_0x357bef,_0x27d6cc,_0xa752('0x1b6'));}else{_0xf421bc[_0xa752('0x123')](_0x44c417,_0x357bef,_0x27d6cc,_0xa752('0x1b6'));}}break;case'8':_0x4f4f42['outboundCongestionCallsDay']+=0x1;_0x44c417['state']=0x8;_0x44c417['statedesc']=_0xa752('0x1b7');_0x44c417[_0xa752('0x11d')]+=0x1;_0x44c417['countglobal']+=0x1;_0x53c6d2=_0x4f4f42[_0xa752('0x19a')];_0x5f3225=_0x4f4f42['callAdditionalPhoneAfterMin'];ami[_0xa752('0x3f')](_0xa752('0x1b8'),ut['buildObj'](_0xec8478,_0xa752('0x1b9')));hopperUtils[_0xa752('0xe9')](_0x44c417)[_0xa752('0x9d')](loggerCatch(_0xa752('0x1ba')));if(_0xf421bc['checkRetriveMax'](0x8,_0xec8478,_0x4f4f42)&&!_0x251775){if(_0x44c417['countcongestionretry']>=_0x4f4f42[_0xa752('0x1bb')]){_0xf421bc[_0xa752('0x12b')](_0x44c417,_0x357bef,_0x27d6cc,_0xa752('0x1bc'));}else{_0xf421bc['stateGlobal'](_0x44c417,_0x357bef,_0x27d6cc,_0xa752('0x1bc'));}}break;case'11':_0x4f4f42[_0xa752('0x1bd')]+=0x1;_0x44c417[_0xa752('0x6b')]=0xb;_0x44c417[_0xa752('0x6c')]=_0xa752('0xe0');_0x44c417[_0xa752('0xe2')]+=0x1;_0x44c417['countglobal']+=0x1;_0x53c6d2=_0x4f4f42[_0xa752('0xe5')];_0x5f3225=_0x4f4f42['callAdditionalPhoneAfterMin'];hopperUtils[_0xa752('0xe9')](_0x44c417)[_0xa752('0x9d')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0xf421bc[_0xa752('0x1a9')](0xb,_0xec8478,_0x4f4f42)&&!_0x251775){if(_0x44c417[_0xa752('0xe2')]>=_0x4f4f42[_0xa752('0x1be')]){_0xf421bc[_0xa752('0x12b')](_0x44c417,_0x357bef,_0x27d6cc,_0xa752('0x1bf'));}else{_0xf421bc[_0xa752('0x123')](_0x44c417,_0x357bef,_0x27d6cc,_0xa752('0x1bf'));}}break;case'20':_0x4f4f42[_0xa752('0x1c0')]+=0x1;_0x44c417['state']=0x14;_0x44c417[_0xa752('0x6c')]=_0xa752('0x1c1');_0x44c417['countagentrejectretry']+=0x1;_0x44c417['countglobal']+=0x1;_0x53c6d2=_0x4f4f42[_0xa752('0x19f')];_0x5f3225=_0x4f4f42[_0xa752('0xe4')];ami[_0xa752('0x3f')]('custom:agentreject',ut[_0xa752('0x113')](_0xec8478,_0xa752('0x1c2')));hopperUtils[_0xa752('0xe9')](_0x44c417)[_0xa752('0x9d')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0xf421bc[_0xa752('0x1a9')](0x14,_0xec8478,_0x4f4f42)&&!_0x251775){if(_0x44c417[_0xa752('0x121')]>=_0x4f4f42[_0xa752('0x19e')]){_0xf421bc[_0xa752('0x12b')](_0x44c417,_0x357bef,_0x27d6cc,_0xa752('0x1c3'));}else{_0xf421bc[_0xa752('0x123')](_0x44c417,_0x357bef,_0x27d6cc,_0xa752('0x1c3'));}}break;default:_0x4f4f42[_0xa752('0x137')]+=0x1;_0x44c417[_0xa752('0x6b')]=0xc;_0x44c417[_0xa752('0x6c')]=_0x5f5586[_0xa752('0x1a5')];_0x53c6d2=_0x4f4f42[_0xa752('0x19f')];_0x5f3225=_0x4f4f42[_0xa752('0xe4')];hopperUtils[_0xa752('0xe9')](_0x44c417)[_0xa752('0x9d')](loggerCatch(_0xa752('0x1c4')));if(_0xf421bc[_0xa752('0x1a9')](_0x5f5586[_0xa752('0x1a5')],_0xec8478,_0x4f4f42)&&!_0x251775){if(_0x44c417['countbusyretry']+_0x44c417[_0xa752('0x11d')]+_0x44c417[_0xa752('0x11e')]+_0x44c417[_0xa752('0x11f')]+_0x44c417[_0xa752('0xcf')]+_0x44c417[_0xa752('0xe2')]+_0x44c417[_0xa752('0x120')]+_0x44c417[_0xa752('0x121')]>=_0x4f4f42['dialGlobalMaxRetry']){_0xf421bc['stateGlobal'](_0x44c417,_0x357bef,_0x27d6cc,_0x5f5586[_0xa752('0x1a5')]);}else{_0xf421bc[_0xa752('0x12b')](_0x44c417,_0x357bef,_0x27d6cc,_0x5f5586[_0xa752('0x1a5')]);}}}})[_0xa752('0x99')](function(){if(_0x251775){hopperUtils[_0xa752('0xeb')](_0x44c417,_0x53c6d2,_0x5f3225)[_0xa752('0x99')](function(){return _0x357bef(0x1);});}});});};Dialer['prototype'][_0xa752('0x123')]=function(_0x129d3e,_0x370c98,_0x277871,_0x2dbb7f){var _0x45fffc=new Final(_0x129d3e);_0x45fffc[_0xa752('0x6b')]=0xf;_0x45fffc[_0xa752('0x6c')]='Global';this[_0xa752('0x12b')](_0x45fffc,_0x370c98,_0x277871,_0x2dbb7f);};Dialer[_0xa752('0x19')][_0xa752('0x12b')]=function(_0x12bc15,_0x3d6cb5,_0x5351fc,_0x2904e8){hopperUtils[_0xa752('0x12f')](_0x12bc15)[_0xa752('0x99')](function(){return _0x3d6cb5(msgResponse(_0xa752('0x1a2'),_0xa752('0x1c5'),_0x2904e8));})[_0xa752('0x9d')](function(){return _0x5351fc(msgResponse(_0xa752('0x1c6'),_0xa752('0x90'),'contact\x20not\x20moved'));});};Dialer[_0xa752('0x19')]['predictive']=function(_0x4db8a0){var _0xd81e3=_0x4db8a0[_0xa752('0x1c7')]/0x64;var _0x152d25=_0x4db8a0[_0xa752('0x1c8')]/(_0x4db8a0['outboundDropCallsDayTimeout']+_0x4db8a0[_0xa752('0xc1')]);var _0x149ed5=Math[_0xa752('0x1c9')](_0x4db8a0[_0xa752('0x1ca')]*(_0x4db8a0[_0xa752('0x1cb')]/0x64));var _0x5ac050=Math[_0xa752('0x1c9')](_0x4db8a0['predictiveIntervalAvailable']*(_0x4db8a0[_0xa752('0x1cc')]/0x64));var _0x5e4bff=_0x4db8a0[_0xa752('0x13a')]+_0x4db8a0['talking'];var _0x4f5789=Math[_0xa752('0x1cd')](_0x4db8a0['erlangCalls']*_0x4db8a0[_0xa752('0x5c')]*_0x4db8a0[_0xa752('0x1ce')]*_0x4db8a0[_0xa752('0x1cf')]);if(_[_0xa752('0x3e')](_0x4db8a0[_0xa752('0x28')])){if(!_[_0xa752('0x3e')](_0x4db8a0[_0xa752('0x27')])){_0x4db8a0[_0xa752('0x27')]=undefined;loggerPredictive['error'](_0xa752('0x1d0'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_['isUndefined'](_0x4db8a0[_0xa752('0x60')])){loggerPredictive[_0xa752('0x62')](_0xa752('0x1d0'),_0xa752('0x1d1'));clearInterval(_0x4db8a0[_0xa752('0x60')]);_0x4db8a0[_0xa752('0x60')]=undefined;}_0x4db8a0[_0xa752('0x28')]=moment()[_0xa752('0x44')](_0xa752('0xc0'));loggerPredictive['info'](_0x4db8a0[_0xa752('0x46')],_0xa752('0x1d2'),_0x4db8a0[_0xa752('0x28')]);this[_0xa752('0xaf')](_0x4db8a0,0x1);}else if(ifInterval(_0x4db8a0[_0xa752('0x1d3')],_0x4db8a0['startProgressive'])){this[_0xa752('0xaf')](_0x4db8a0,0x1);loggerPredictiveCalls[_0xa752('0x49')](_0xa752('0x1d4'),_0x4db8a0[_0xa752('0x28')],_0x4db8a0[_0xa752('0x46')]);_0x4db8a0['erlangCalls']=0x0;_0x4db8a0['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0xd81e3<_0x152d25&&_0x4db8a0[_0xa752('0x1d5')]==='dropRate'){clearPredictiveAttributes(_0x4db8a0);loggerPredictive[_0xa752('0x49')](_0xa752('0x1d6'),_0xa752('0x1d7'),_0x152d25,_0xa752('0x28'),_0x4db8a0[_0xa752('0x46')]);}else if(_0x4f5789<_0x4db8a0['predictiveIntervalErlangCallsDroppedCalls']&&_0x4db8a0[_0xa752('0x1d5')]===_0xa752('0x1d8')){clearPredictiveAttributes(_0x4db8a0);loggerPredictive['info'](_0xa752('0x1d9'),_0xa752('0x1da'),_0x4f5789,_0xa752('0x1db'),_0x4db8a0[_0xa752('0xcb')],_0xa752('0x28'),_0x4db8a0['name']);}else if(!ifInterval(_0x4db8a0[_0xa752('0x1d3')],_0x4db8a0[_0xa752('0x28')])&&_[_0xa752('0x3e')](_0x4db8a0[_0xa752('0x27')])&&!_[_0xa752('0x3e')](_0x4db8a0[_0xa752('0x28')])){_0x4db8a0[_0xa752('0x27')]=moment()[_0xa752('0x44')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xa752('0x49')](_0x4db8a0[_0xa752('0x46')],_0xa752('0x1dc'),_0x4db8a0[_0xa752('0x27')]);hopperUtils['avgHandleTime'](_0x4db8a0['dialPredictiveInterval'])[_0xa752('0x99')](this['getDataPredictive'](_0x4db8a0))['then'](mergeDataErlangB(_0x4db8a0))[_0xa752('0x99')](this[_0xa752('0x1dd')](_0x4db8a0))[_0xa752('0x9d')](loggerCatchPredictive(_0xa752('0x1de'),_0x4db8a0));}else if(!ifInterval(_0x4db8a0[_0xa752('0x1d3')],_0x4db8a0[_0xa752('0x27')])){_0x4db8a0['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x4db8a0[_0xa752('0x27')]=moment()[_0xa752('0x44')](_0xa752('0xc0'));loggerPredictive[_0xa752('0x49')](_0x4db8a0['name'],_0xa752('0x1df'),_0x4db8a0['startPredictive']);clearInterval(_0x4db8a0[_0xa752('0x60')]);_0x4db8a0[_0xa752('0x60')]=undefined;hopperUtils[_0xa752('0x1e0')](_0x4db8a0[_0xa752('0x1d3')])[_0xa752('0x99')](this['getDataPredictive'](_0x4db8a0))['then'](mergeDataErlangB(_0x4db8a0))[_0xa752('0x99')](this[_0xa752('0x1dd')](_0x4db8a0))[_0xa752('0x9d')](loggerCatchPredictive(_0xa752('0x1e1'),_0x4db8a0));}else if(_0x4db8a0[_0xa752('0x1ca')]&&_0x5e4bff<_0x4db8a0[_0xa752('0x1ca')]-_0x5ac050){clearPredictiveAttributes(_0x4db8a0);loggerPredictive[_0xa752('0x49')](_0x4db8a0['name'],_0xa752('0x1e2'),_0x5e4bff,_0xa752('0x1e3'),_0x4db8a0[_0xa752('0x1ca')],'-',_0x5ac050,'=',_0x4db8a0[_0xa752('0x1ca')]-_0x5ac050,')');}else if(_0x4db8a0[_0xa752('0x1ca')]&&_0x5e4bff>_0x4db8a0[_0xa752('0x1ca')]+_0x149ed5){clearPredictiveAttributes(_0x4db8a0);loggerPredictive['info'](_0x4db8a0[_0xa752('0x46')],_0xa752('0x1e2'),_0x5e4bff,_0xa752('0x1e4'),_0x4db8a0[_0xa752('0x1ca')],'+',_0x149ed5,'=',_0x4db8a0[_0xa752('0x1ca')]+_0x149ed5,')');}};Dialer[_0xa752('0x19')][_0xa752('0x1e5')]=function(_0x5791a6){var _0x43f15d=this;return function(_0x17d0ed){return new Promise(function(_0x4503f5,_0x3675d1){_[_0xa752('0x5d')](_0x5791a6,_0x17d0ed[0x0]);if(checkGetDataPredictive(_0x17d0ed[0x0])){var _0x515d5f=_0x5791a6[_0xa752('0x1ca')]=_0x5791a6[_0xa752('0x13d')]+_0x5791a6[_0xa752('0x13a')];var _0x3340ab=_0x5791a6[_0xa752('0x1d3')]*0x3c;var _0x5de1b9=_0x17d0ed[0x0][_0xa752('0x52')]+_0x17d0ed[0x0][_0xa752('0x55')];var _0x9a3dd5=(_0x17d0ed[0x0][_0xa752('0x1e6')]+_0x17d0ed[0x0][_0xa752('0x4e')]+_0x17d0ed[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x17d0ed[0x0][_0xa752('0x4c')];_0x5791a6[_0xa752('0x1ce')]=_0x9a3dd5>0x0?_0x9a3dd5:0x1;switch(_0x5791a6[_0xa752('0x1d5')]){case _0xa752('0x1d8'):var _0x16f65b=_0x5791a6[_0xa752('0x1c7')]/0x64;return _0x43f15d[_0xa752('0x1e7')](_0x515d5f,_0x3340ab,_0x5de1b9,_0x9a3dd5,_0x16f65b)[_0xa752('0x99')](function(_0x1f9b04){return _0x4503f5(_0x1f9b04);});case _0xa752('0x1e8'):var _0x16b6c9=_0x5791a6[_0xa752('0x1c7')]/0x64;return _0x43f15d[_0xa752('0x1e9')](_0x515d5f,_0x3340ab,_0x5de1b9,_0x9a3dd5,_0x16b6c9)['then'](function(_0x2f08db){return _0x4503f5(_0x2f08db);});default:return _0x3675d1(msgResponse(_0xa752('0x1ea'),_0xa752('0x90'),_0xa752('0x1eb')));}}else{return _0x3675d1(msgResponse(_0xa752('0x1ea'),_0xa752('0x90'),_0xa752('0x1ec')));}});};};Dialer[_0xa752('0x19')]['getDataPredictiveOld']=function(_0x41ce4c){var _0x238490=this;return function(_0x22f417){return new Promise(function(_0x33b8cf,_0x4aaa79){_[_0xa752('0x5d')](_0x41ce4c,_0x22f417[0x0]);if(checkGetDataPredictive(_0x22f417[0x0])){loggerPredictive['info'](JSON['stringify'](_0x22f417[0x0]));if(_0x41ce4c[_0xa752('0x1d5')]===_0xa752('0x1d8')){return _0x238490[_0xa752('0x15a')](_0x41ce4c['id'])[_0xa752('0x99')](function(_0x196c38){var _0x3cbcb0=_0x41ce4c[_0xa752('0x1ed')]-_0x196c38[0x0][_0xa752('0x1ee')];var _0x49310b=_0x41ce4c[_0xa752('0x1d3')]*0x3c;var _0x4b3c63=_0x22f417[0x0][_0xa752('0x52')]+_0x22f417[0x0][_0xa752('0x55')];var _0x5d2dcf=(_0x22f417[0x0][_0xa752('0x1e6')]+_0x22f417[0x0][_0xa752('0x4e')]+_0x22f417[0x0][_0xa752('0x50')])/_0x22f417[0x0]['predictiveIntervalTotalCalls'];var _0xa893fd=_0x41ce4c[_0xa752('0x1c7')]/0x64;_0x41ce4c[_0xa752('0x1ef')]=_0x196c38[0x0][_0xa752('0x1ee')]||0x0;_0x41ce4c[_0xa752('0x1ce')]=_0x5d2dcf>0x0?_0x5d2dcf:0x1;return _0x238490[_0xa752('0x1e7')](_0x3cbcb0,_0x49310b,_0x4b3c63,_0x5d2dcf,_0xa893fd);})['then'](function(_0x459899){return _0x33b8cf(_0x459899);})[_0xa752('0x9d')](function(_0x18f753){return _0x4aaa79(msgResponse(_0xa752('0x1f0'),_0xa752('0x90'),JSON[_0xa752('0x81')](_0x18f753)));});}if(_0x41ce4c[_0xa752('0x1d5')]===_0xa752('0x1e8')){return _0x238490[_0xa752('0x15a')](_0x41ce4c['id'])['then'](function(_0x4ba3c0){var _0x4160fc=_0x41ce4c[_0xa752('0x1ed')]-_0x4ba3c0[0x0][_0xa752('0x1ee')];var _0x3729df=_0x41ce4c[_0xa752('0x1d3')]*0x3c;var _0x515326=_0x22f417[0x0][_0xa752('0x52')]+_0x22f417[0x0][_0xa752('0x55')];var _0x10b00c=(_0x22f417[0x0][_0xa752('0x1e6')]+_0x22f417[0x0][_0xa752('0x4e')]+_0x22f417[0x0][_0xa752('0x50')])/_0x22f417[0x0][_0xa752('0x4c')];var _0x58aa7f=_0x41ce4c[_0xa752('0x1c7')]/0x64;_0x41ce4c[_0xa752('0x1ef')]=_0x4ba3c0[0x0][_0xa752('0x1ee')]||0x0;_0x41ce4c[_0xa752('0x1ce')]=_0x10b00c>0x0?_0x10b00c:0x1;return _0x238490['busyFactor'](_0x4160fc,_0x3729df,_0x515326,_0x10b00c,_0x58aa7f);})[_0xa752('0x99')](function(_0x11c47d){return _0x33b8cf(_0x11c47d);})['catch'](function(_0x13e65d){return _0x4aaa79(msgResponse(_0xa752('0x1f0'),_0xa752('0x90'),JSON[_0xa752('0x81')](_0x13e65d)));});}}else{return _0x4aaa79(msgResponse('[getDataPredictive]',_0xa752('0x90'),_0xa752('0x1ec')));}});};};Dialer[_0xa752('0x19')]['startMethodPredictive']=function(_0x4c0413){var _0x30bb4=this;return function(){var _0xb26803=0x0;var _0x103e43=Math[_0xa752('0x1cd')](_0x4c0413['erlangCallToSecond']*0x3e8);if(_0x103e43>0x0){_0x103e43=_0x103e43<0x64?0x64:_0x103e43;loggerPredictive[_0xa752('0x49')](_0x4c0413['name'],'one\x20call\x20every:',_0x103e43,_0xa752('0x1f1'));_0x4c0413[_0xa752('0x60')]=setInterval(function(){_0x30bb4[_0xa752('0x60')](_0x4c0413);loggerPredictiveCalls[_0xa752('0x49')](_0xa752('0x1f2'),_0xb26803+=0x1);},_0x103e43);}else{loggerPredictive[_0xa752('0x49')](_0x4c0413['name'],_0xa752('0x1f3'));}};};Dialer[_0xa752('0x19')][_0xa752('0x1f4')]=function(_0x54628b,_0x515b2a){var _0x1548de=this;return function(_0x167071){if(_[_0xa752('0x48')](_0x167071)){if(_[_0xa752('0xf0')](_0x515b2a[_0xa752('0x15f')])||!_0x515b2a[_0xa752('0x1f5')]){if(_0x54628b[_0xa752('0xae')]===_0xa752('0xa')){_0x54628b[_0xa752('0x6e')]=_[_0xa752('0x3e')](_0x54628b[_0xa752('0x6e')])?!![]:_0x54628b['queueStatusComplete'];var _0x464d5f=uuid['v4']();_0x1548de[_0xa752('0x24')][_0x464d5f]=new Action(_0x54628b,_0x515b2a,_0x464d5f);loggerBooked['info'](_0xa752('0x1f6'),_0x464d5f,'queueStatusComplete:\x20',JSON[_0xa752('0x81')](_0x54628b[_0xa752('0x6e')]),_0xa752('0x1f7'),_0x54628b[_0xa752('0x46')]);if(_0x54628b[_0xa752('0x6e')]){_0x54628b['queueStatusComplete']=![];_0x1548de['queueBooked'][_0x1548de['actions'][_0x464d5f][_0xa752('0xb9')]]=[];ami[_0xa752('0x9e')]({'actionid':_0x464d5f,'action':_0xa752('0x1f8'),'queue':_0x54628b['name']})[_0xa752('0x9d')](function(){utils[_0xa752('0xbd')](_0x54628b,_0xa752('0x1f9'));hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x1548de[_0xa752('0x24')][_0x464d5f]['ContactId'],'ListId':_0x1548de[_0xa752('0x24')][_0x464d5f][_0xa752('0xd9')],'VoiceQueueId':_0x1548de['actions'][_0x464d5f]['VoiceQueueId']||undefined,'CampaignId':_0x1548de[_0xa752('0x24')][_0x464d5f]['CampaignId']||undefined})[_0xa752('0x9d')](loggerCatch(_0xa752('0x1fa')));delete _0x1548de[_0xa752('0x24')][_0x464d5f];});}else{loggerBooked['info']('[booked][checkContactBlack][else]',JSON[_0xa752('0x81')](_0x54628b[_0xa752('0x6e')]),_0xa752('0x1f7'),_0x54628b[_0xa752('0x46')]);utils[_0xa752('0xbd')](_0x54628b,_0xa752('0x1f9'));hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x1548de[_0xa752('0x24')][_0x464d5f]['ContactId'],'ListId':_0x1548de[_0xa752('0x24')][_0x464d5f][_0xa752('0xd9')],'VoiceQueueId':_0x1548de[_0xa752('0x24')][_0x464d5f][_0xa752('0xe6')]||undefined,'CampaignId':_0x1548de[_0xa752('0x24')][_0x464d5f][_0xa752('0xda')]||undefined})[_0xa752('0x9d')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x1548de[_0xa752('0x24')][_0x464d5f];}}else{return _0x1548de[_0xa752('0x166')](_0x54628b,_0x515b2a);}}else{if(utils[_0xa752('0xc9')](undefined,_0x515b2a[_0xa752('0x1fb')])<_0x54628b['dialRecallMeTimeout']*0x3c){if(_0x515b2a[_0xa752('0x14e')]&&!_0x515b2a[_0xa752('0x14e')][_0xa752('0x1fc')]){_0x1548de[_0xa752('0x1d')][_0xa752('0x1fd')](_0x515b2a['id'])['finally'](function(){utils[_0xa752('0xbd')](_0x54628b,'[checkContactBlack]');});}else{hopperUtils['unlockContact']({'active':![]},_0x515b2a['id'],0x1)[_0xa752('0x1b')](function(){utils[_0xa752('0xbd')](_0x54628b,'[checkContactBlack]');});}}else{_0x54628b['outboundReCallsDay']+=0x1;utils[_0xa752('0xbd')](_0x54628b,'[checkContactBlack]');if(_0x54628b[_0xa752('0x1fe')]){hopperUtils[_0xa752('0xd5')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x515b2a[_0xa752('0xd8')],'ListId':_0x515b2a[_0xa752('0xd9')],'VoiceQueueId':_0x515b2a[_0xa752('0xe6')]||undefined,'CampaignId':_0x515b2a[_0xa752('0xda')]||undefined})[_0xa752('0x9d')](loggerCatch(_0xa752('0x1ff')));hopperUtils[_0xa752('0xe9')](createObjHistory(_0x54628b,_0x515b2a,utils[_0xa752('0x73')][_0xa752('0x200')],0x17,_0xa752('0x201')))['catch'](loggerCatch(_0xa752('0x202')));}else{_0x1548de[_0xa752('0x115')](createObjHistory(_0x54628b,_0x515b2a,utils[_0xa752('0x73')][_0xa752('0x203')],0x16,_0xa752('0x204')),_0xa752('0x205'),_0xa752('0x206'));}}}}else{_0x54628b[_0xa752('0x207')]+=0x1;_0x1548de[_0xa752('0x115')](createObjHistory(_0x54628b,_0x515b2a,utils[_0xa752('0x73')][_0xa752('0x208')],0xd,'Blacklist'),_0xa752('0x209'),_0xa752('0x20a'));throw _0xa752('0x20b');}};};Dialer[_0xa752('0x19')][_0xa752('0x165')]=function(_0x4fe1f6){var _0x553234=this;var _0x7222b0=_0x4fe1f6[_0xa752('0x20c')]-_0x4fe1f6['originated'];emitCampaignSummary(_0x4fe1f6);if(_0x7222b0>0x0&&_0x4fe1f6[_0xa752('0x20d')]==0x0){if(_0x7222b0>this['maxNumberOriginate']){_0x7222b0=this['maxNumberOriginate'];}_0x4fe1f6[_0xa752('0x20d')]=0x1;hopperUtils['getContactDialerIvr'](_0x4fe1f6,_0x7222b0)[_0xa752('0x99')](function(_0x32ee5f){_0x4fe1f6['temp']=0x0;if(_0x32ee5f){if(!utils[_0xa752('0x20e')](_0x32ee5f)){_0x4fe1f6[_0xa752('0x65')]=utils[_0xa752('0x73')]['NO_AVAILABLE_CONTACTS'];logger['info'](_0xa752('0x20f')+_0x4fe1f6['name']);}else{_0x4fe1f6[_0xa752('0x7a')]+=_0x32ee5f['length'];_0x4fe1f6[_0xa752('0x65')]=utils[_0xa752('0x73')][_0xa752('0x210')];for(var _0x450dbe=0x0;_0x450dbe<_0x32ee5f['length'];_0x450dbe+=0x1){_0x4fe1f6[_0xa752('0x211')]+=0x1;if(_['isNil'](_0x32ee5f[_0x450dbe])||_[_0xa752('0xf0')](_0x32ee5f[_0x450dbe][_0xa752('0x180')])||_['isNil'](_0x32ee5f[_0x450dbe][_0xa752('0x169')])){_0x553234[_0xa752('0x15c')](_0xa752('0x212'),_0x4fe1f6,_0x32ee5f[_0x450dbe]);}else{hopperUtils['checkIsBlackListIvr'](_[_0xa752('0x71')](_0x32ee5f[_0x450dbe],['CampaignId',_0xa752('0x169')]))['then'](_0x553234[_0xa752('0x1f4')](_0x4fe1f6,_0x32ee5f[_0x450dbe]))['catch'](function(_0x193db7){logger[_0xa752('0x62')]('[actionOriginateIvr]',_0x193db7);utils[_0xa752('0xbd')](_0x4fe1f6,_0xa752('0x213'));});}}}}})[_0xa752('0x9d')](function(_0x47b503){_0x4fe1f6[_0xa752('0x20d')]=0x0;logger[_0xa752('0x62')]('[getContactCampaign2]',_0x47b503);});}};Dialer[_0xa752('0x19')][_0xa752('0xaf')]=function(_0x44ca38,_0x6cbc84){var _0x29ad29=this;var _0x29126b=[];if(_0x6cbc84<0x1||_0x44ca38['dialMethod']==='booked'){_0x6cbc84=0x1;}var _0x1bd700=Math[_0xa752('0x1cd')](_0x44ca38[_0xa752('0x13a')]*_0x6cbc84)-_0x44ca38[_0xa752('0x7a')];if(_0x44ca38[_0xa752('0x214')]>0x0){var _0x15d172=_0x44ca38['dialLimitQueue']-_0x44ca38['originated']-_0x44ca38[_0xa752('0x13d')]-_0x44ca38[_0xa752('0x13e')];if(_0x1bd700>_0x15d172){_0x1bd700=_0x15d172;}}if(_0x1bd700>0x0&&_0x44ca38[_0xa752('0x20d')]==0x0){if(_0x44ca38['dialMethod']===_0xa752('0xa')){_0x1bd700=0x1;}if(_0x1bd700>this['maxNumberOriginate']){_0x1bd700=this[_0xa752('0x22')];}for(var _0x2c09bd in this['agents']){if(typeof this['agents'][_0x2c09bd]!==_0xa752('0x154')){if(this[_0xa752('0x20')][_0x2c09bd][_0xa752('0x6b')]===_0xa752('0x215')&&this[_0xa752('0x20')][_0x2c09bd][_0xa752('0x85')]===_0xa752('0x14b')){_0x29126b[_0xa752('0x96')](this[_0xa752('0x20')][_0x2c09bd]['id']);}}}_0x44ca38[_0xa752('0x20d')]=0x1;hopperUtils[_0xa752('0x216')](_0x44ca38,_0x29126b,_0x1bd700)[_0xa752('0x99')](function(_0x2f33ea){_0x44ca38['temp']=0x0;if(_0x2f33ea){if(!utils[_0xa752('0x20e')](_0x2f33ea)){hopperUtils[_0xa752('0x217')](_0x44ca38)['then'](sendMessageReschedule(_0x44ca38))[_0xa752('0x9d')](loggerCatch('[countReScheduled]\x20'));}else{_0x44ca38['originated']+=_0x2f33ea[_0xa752('0xf7')];_0x44ca38['message']=_0x44ca38[_0xa752('0xae')]===_0xa752('0xa')?utils[_0xa752('0x73')][_0xa752('0x13f')]:utils[_0xa752('0x73')][_0xa752('0x210')];for(var _0x5a4f59=0x0;_0x5a4f59<_0x2f33ea['length'];_0x5a4f59+=0x1){if(_[_0xa752('0xf0')](_0x2f33ea[_0x5a4f59])||_[_0xa752('0xf0')](_0x2f33ea[_0x5a4f59][_0xa752('0x180')])||_[_0xa752('0xf0')](_0x2f33ea[_0x5a4f59][_0xa752('0x169')])){_0x29ad29[_0xa752('0x15c')](_0xa752('0x212'),_0x44ca38,_0x2f33ea[_0x5a4f59]);}else{hopperUtils[_0xa752('0x218')](_[_0xa752('0x71')](_0x2f33ea[_0x5a4f59],['VoiceQueueId',_0xa752('0x169')]))[_0xa752('0x99')](_0x29ad29[_0xa752('0x1f4')](_0x44ca38,_0x2f33ea[_0x5a4f59]))[_0xa752('0x9d')](function(_0x5ed567){logger['error']('[actionOriginate]',_0x5ed567);utils['decrementOriginate'](_0x44ca38,_0xa752('0x219'));});}}}}})[_0xa752('0x9d')](function(_0x35a8e4){_0x44ca38[_0xa752('0x20d')]=0x0;logger[_0xa752('0x62')](_0xa752('0x21a'),_0x35a8e4);});}};Dialer['prototype'][_0xa752('0x60')]=function(_0x2f6d68){if(_0x2f6d68[_0xa752('0x214')]>0x0){var _0x526232=_0x2f6d68[_0xa752('0x214')]-_0x2f6d68[_0xa752('0x7a')]-_0x2f6d68[_0xa752('0x13d')];if(_0x526232>0x0&&_0x2f6d68['temp']==0x0){this['tryOriginatePredictive'](_0x2f6d68);}else{loggerPredictiveCalls['info'](_0xa752('0x21b'));}}else{this[_0xa752('0x21c')](_0x2f6d68);}};Dialer['prototype']['tryOriginatePredictive']=function(_0x594c8f){var _0x4c3220=this;var _0x39ecb8=[];_0x594c8f['originated']+=0x1;for(var _0x4e21a9 in this['agents']){if(typeof this['agents'][_0x4e21a9]!==_0xa752('0x154')){if(this[_0xa752('0x20')][_0x4e21a9][_0xa752('0x6b')]===_0xa752('0x215')&&this[_0xa752('0x20')][_0x4e21a9][_0xa752('0x85')]===_0xa752('0x14b')){_0x39ecb8[_0xa752('0x96')](this['agents'][_0x4e21a9]['id']);}}}_0x594c8f[_0xa752('0x20d')]=0x1;return this[_0xa752('0x216')](_0x594c8f['id'],_0x39ecb8,0x1,_0x594c8f[_0xa752('0x21d')],_0x594c8f)[_0xa752('0x99')](function(_0x5d4366){_0x594c8f['temp']=0x1;if(_0x5d4366){if(!utils[_0xa752('0x20e')](_0x5d4366)){utils[_0xa752('0x21e')](_0x594c8f,0x1,0x0);return hopperUtils[_0xa752('0x217')](_0x594c8f)[_0xa752('0x99')](sendMessageReschedule(_0x594c8f))[_0xa752('0x9d')](loggerCatch(_0xa752('0x21f')));}else{_0x594c8f['message']=utils[_0xa752('0x73')][_0xa752('0x210')];if(_[_0xa752('0xf0')](_0x5d4366[0x0])||_[_0xa752('0xf0')](_0x5d4366[0x0][_0xa752('0x180')])||_[_0xa752('0xf0')](_0x5d4366[0x0][_0xa752('0x169')])){_0x4c3220['emptyContact'](_0xa752('0x212'),_0x594c8f,_0x5d4366[0x0]);}else{return hopperUtils[_0xa752('0x218')](_[_0xa752('0x71')](_0x5d4366[0x0],[_0xa752('0xe6'),'phone']))[_0xa752('0x99')](_0x4c3220['checkContactBlack'](_0x594c8f,_0x5d4366[0x0]))[_0xa752('0x9d')](function(_0x51a3e9){logger['error'](_0xa752('0x220'),_0x51a3e9);utils[_0xa752('0xbd')](_0x594c8f,_0xa752('0x220'));});}}}})[_0xa752('0x9d')](function(_0x5b5cec){_0x594c8f[_0xa752('0x20d')]=0x0;logger['error'](_0xa752('0x21a'),_0x5b5cec);});};Dialer['prototype'][_0xa752('0x1e7')]=function(_0x54c49b,_0x4057f4,_0x2835eb,_0x43af09,_0xac8ee2,_0xc003af){loggerPredictive[_0xa752('0x49')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0xa752('0x49')](_0xa752('0x221'),_0x54c49b);loggerPredictive[_0xa752('0x49')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4057f4);loggerPredictive[_0xa752('0x49')](_0xa752('0x222'),_0x2835eb);loggerPredictive[_0xa752('0x49')]('P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x43af09);loggerPredictive['info']('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xac8ee2);loggerPredictive[_0xa752('0x49')](_0xa752('0x53'));return new Promise(function(_0x3005c1,_0x371bc2){if(_0x54c49b<=0x0||isNaN(_0x54c49b)){return _0x371bc2(msgResponse('[abandonmentRate]','Error','m\x20=\x20'+_0x54c49b));}if(_0x2835eb<=0x0||isNaN(_0x2835eb)){return _0x371bc2(msgResponse(_0xa752('0x223'),'Error','Ts\x20=\x20'+_0x2835eb));}if(_0x43af09<=0x0||isNaN(_0x43af09)){return _0x371bc2(msgResponse('[abandonmentRate]',_0xa752('0x195'),_0xa752('0x224')+_0x43af09));}if(_0x4057f4<=0x0||isNaN(_0x4057f4)){return _0x371bc2(msgResponse('[abandonmentRate]','Error',_0xa752('0x225')+_0x4057f4));}if(_0xac8ee2<=0x0||isNaN(_0xac8ee2)){return _0x371bc2(msgResponse('[abandonmentRate]','Error',_0xa752('0x226')+_0xac8ee2));}_0xc003af=_0xc003af||0x0;var _0x2a6075=0x1/_0x2835eb;var _0x2338a2=0x0;var _0x23297f=0x0;var _0x1f2c57=0x0;var _0x474e97=0x0;for(var _0x2c5e94=0x0;_0x1f2c57<_0xac8ee2;_0x2c5e94+=0x1){_0x23297f=_0x2c5e94/_0x4057f4;_0x2338a2=(_0x43af09*_0x23297f+_0xc003af)/_0x2a6075;_0x1f2c57=utils[_0xa752('0x227')](_0x2338a2,_0x54c49b);_0x474e97=_0x2338a2/_0x54c49b*(0x1-utils['erlangb'](_0x2338a2,_0x54c49b));}return _0x3005c1({'erlangCalls':_0x2c5e94,'erlangCallToSecond':_0x4057f4/_0x2c5e94,'erlangAbandonmentRate':_0x1f2c57,'erlangBusyFactor':_0x474e97});});};Dialer[_0xa752('0x19')][_0xa752('0x1e9')]=function(_0x3e1d34,_0x4c1bba,_0x109694,_0x474feb,_0x240c76,_0x1e8105){loggerPredictive['info']('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0xa752('0x49')](_0xa752('0x221'),_0x3e1d34);loggerPredictive[_0xa752('0x49')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4c1bba);loggerPredictive[_0xa752('0x49')](_0xa752('0x222'),_0x109694);loggerPredictive[_0xa752('0x49')](_0xa752('0x228'),_0x474feb);loggerPredictive[_0xa752('0x49')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x240c76);loggerPredictive[_0xa752('0x49')](_0xa752('0x53'));return new Promise(function(_0x5116e5,_0x514855){if(_0x3e1d34<=0x0||isNaN(_0x3e1d34)){return _0x514855(msgResponse(_0xa752('0x229'),_0xa752('0x195'),'m\x20=\x20'+_0x3e1d34));}if(_0x109694<=0x0||isNaN(_0x109694)){return _0x514855(msgResponse(_0xa752('0x229'),_0xa752('0x195'),_0xa752('0x22a')+_0x109694));}if(_0x474feb<=0x0||isNaN(_0x474feb)){return _0x514855(msgResponse('[busyFactor]','Error',_0xa752('0x224')+_0x474feb));}if(_0x4c1bba<=0x0||isNaN(_0x4c1bba)){return _0x514855(msgResponse(_0xa752('0x229'),'Error',_0xa752('0x225')+_0x4c1bba));}if(_0x240c76<=0x0||isNaN(_0x240c76)){return _0x514855(msgResponse(_0xa752('0x229'),_0xa752('0x195'),'Umin\x20=\x20'+_0x240c76));}_0x1e8105=_0x1e8105||0x0;var _0x13c892=0x1/_0x109694;var _0x1ff21f=0x0;var _0x36dd43=0x0;var _0xadfbd2=0x0;var _0x3b9e5e=0x0;for(var _0x155ae9=0x0;_0x3b9e5e<_0x240c76;_0x155ae9+=0x1){_0x36dd43=_0x155ae9/_0x4c1bba;_0x1ff21f=(_0x474feb*_0x36dd43+_0x1e8105)/_0x13c892;_0xadfbd2=utils[_0xa752('0x227')](_0x1ff21f,_0x3e1d34);_0x3b9e5e=_0x1ff21f/_0x3e1d34*(0x1-utils[_0xa752('0x227')](_0x1ff21f,_0x3e1d34));}return _0x5116e5({'erlangCalls':_0x155ae9,'erlangCallToSecond':_0x4c1bba/_0x155ae9,'erlangAbandonmentRate':_0xadfbd2,'erlangBusyFactor':_0x3b9e5e});});};module[_0xa752('0x22b')]=Dialer;
\ No newline at end of file