Built motion from commit f67b3b02.|2.6.31
[motion2.git] / server / services / ami / dialer / index.js
index 46f6cc6..cff87c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x60e1=['checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAbandonedMaxRetry','[rescheduleContact][AgentReject]','[callProgressDetecting]','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','[syncAgentComplete][createHistory][0]','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','buildNoAnswerEventPayload','custom:agentnoanswer','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','reason\x205\x20busy','outboundCongestionCallsDay','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','outboundAbandonedCallsDay','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','Success','[moveContactManagedDialer][0]','contact\x20not\x20moved','round','predictiveIntervalAvailable','predictiveIntervalMinThreshold','floor','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','check\x20predictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive]','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','avgHandleTime','getDataPredictive','recalculate\x20predictive\x20at','startMethodPredictive','Predictive\x20for\x20every\x20interval',')\x20are\x20less\x20than\x20threshold\x20(','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dialPredictiveOptimizationPercentage','abandonmentRate','busyFactor','Unknown\x20Predictive','[getDataPredictive]','check\x20failure','getDataPredictiveOld','loggedIn','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','agentBusyFactor','milliseconds','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[checkContactBlack]','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','inBlackList','limitCalls','temp','getContactDialerIvr','checkContactEmpty','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','checkIsBlackListIvr','[actionOriginateIvr]','[handleIvr]','dialLimitQueue','getContactDialer','countReScheduled','checkIsBlackList','[actionOriginate]','[handlePower]','[getContactCampaign2]','tryOriginatePredictive','dialOrderByScheduledAt','[countReScheduled]\x20','[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','m\x20=\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','erlangb','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','exports','lodash','uuid','moment','ioredis','./utils/hopper','../preview/util/util','../../../config/environment/','dialer','../../../config/logger','booked','predictive','../ami','redis','socket.io-emitter','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/setting','../rpc/interval','./models/action','./models/history','./models/final','./models/agentComplete','./models/hangup','env','XCALLY_IP_AGI','prototype','enqueue','tail','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','queuecallerabandon','bind','originateresponse','syncOriginateResponse','agentcomplete','custom:queuesummary','syncQueueSummary','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','emit','outbound','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','format','name','voice_queue:save','info','-----\x20Stats\x20Predictive\x20---','predictiveIntervalAnsweredCalls','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','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','predictiveIntervalTotalCalls','isUndefined','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','merge','getSeconds','startProgressive\x20value\x20cleared','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','contactsRescheduled','message','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contacts','NO_AVAILABLE_CONTACTS','statedesc','endtime','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','pick','Interval','\x20INTERVAL_IS_NULL','Intervals','NULL_INTERVAL','isEmpty','INACTIVE','\x20NOT\x20Active','isIVRCampaign','campaign:ivr:%s','campaign:save','sendMessageOneNotActive','originated','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','DISACTIVED','is\x20deactivated','Error','isTrunkReachable','active','SIP/%s','status','unmonitored','checkIsTrunkReachable','Trunk','TrunkBackup','checkIfTime','ifTimeIvr','checkIfTimeIntervals','ifTime','Failure','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','\x20Intervals\x20is\x20empty\x20','timezones','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','isArray','length','push','Action','iftime\x20%s,%s','interval','content','indexOf','true','catch','command','all','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','resetActiveCalls','syncCampaigns','undefined','isIVRCampaignActive','resolve','dialGlobalInterval','dialTimezone','launchHandleIvr','[syncCampaigns]','checkDialMethod','dialMethod','progressive','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','intervalIftime','Global:\x20','Timezone:\x20','silly','isGlobal','AMI\x20IfTime','[ifTime][Action]','queue','uniqueid','type','ivr','decrementOriginate','[syncAgentConnect]','YYYY-MM-DD\x20HH:mm:ss','syncAgentComplete','outboundAnswerCallsDay','reason','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','createHistory','[syncAgentComplete][createHistory]','[syncAgentComplete]','syncQueueCallerAbandon','[syncQueueCallerAbandon]','droptime','responsetime','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','TIMEOUT','countdropretry','countglobal','verifyAdditionalPhones','state','voiceQueue','additional','dialDropMaxRetry','queueCallerAbandonCreateState','rescheduleContact','add','dialDropRetryFrequency','minutes','ContactId','ListId','CampaignId','[rescheduleContact][Drop]','calleridname','calleridnum','Abandoned','CALLEREXIT','dialAbandonedRetryFrequency','callAdditionalPhoneAfterMin','countabandonedretry','VoiceQueueId','[rescheduleContact][Abandoned]','channel','syncQueueMember','actionid','strategy','rrmemory','roundrobin','locked','paused','stateinterface','isNil','idHopper','run','finally','[syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','contactAgent-idHopper:\x20','[Catch][Preview][syncQueueStatusComplete]','[booked][RR][finaly]','[booked][unlock]','[unlock2][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','getQueue','response','[syncOriginateResponse]','callProgressDetecting','[callProgressDetecting]\x20','variable','exten','xcally-motion-dialer','value','HANGUP','[syncVarSet]','outboundAnswerAgiCallsDay','HangupInAMD','membername','custom:amd','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','dialAMDActive','AMD','amd','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','dialMachineRetryFrequency','[rescheduleContact][Machine]','buildObj','[syncHangupInAMDIvr][createHistory]','dialGlobalMaxRetry','stateGlobal','reason\x2019\x20machine....','ivrAnswerCallsDay','cause-txt','moveContactManagedDialer','[syncAgentCompleteIvr]','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','[syncHangup]','AnswerAGI','AGI','[syncHangup2]','outboundUnknownCallsDay','queuesSummary','running','isPreviewCampaign','statusMessage','getQueueCampaignStatusMessage','available','inUse','talking','pTalking','[syncQueueSummary]','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','throttle','filter','online','reachable','handlePreviewRecallNotifications','Agent','user:%s','user:dialPreviewRecallReminder','clearZombieChannels','[actions]','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','emptyContact','[emptyContact]','UserId','[emptyContact][createHistory]','checkPreviewRecallReminder','handleIvr','actionOriginate','object','originate','getCaller','\x22agi://%s/square,%s\x22','NONE','isOutboundQueue','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialQueueTimeout','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDMAXIMUMNUMBEROFWORDS','XMD-AMDSILENCETHRESHOLD','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','setXMDContactVariables','Contact','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','dialOriginateCallerIdName','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','dialPrefix','trim','dialCutDigit','phone','substring','SIP/%s/%s%s','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x60e1,0x92));var _0x160e=function(_0x2219db,_0x3d1a92){_0x2219db=_0x2219db-0x0;var _0x244bd3=_0x60e1[_0x2219db];return _0x244bd3;};'use strict';var util=require('util');var _=require(_0x160e('0x0'));var uuid=require(_0x160e('0x1'));var moment=require(_0x160e('0x2'));var rr=require('rr');var Redis=require(_0x160e('0x3'));var utils=require('./utils');var hopperUtils=require(_0x160e('0x4'));var ut=require(_0x160e('0x5'));var config=require(_0x160e('0x6'));var logger=require('../../../config/logger')(_0x160e('0x7'));var loggerBooked=require(_0x160e('0x8'))(_0x160e('0x9'));var loggerPredictive=require(_0x160e('0x8'))(_0x160e('0xa'));var loggerPredictiveCalls=require('../../../config/logger')('predictiveCalls');var loggerSyncQueueSummary=require(_0x160e('0x8'))('syncQueueSummary');var ami=require(_0x160e('0xb'));config['redis']=_['defaults'](config[_0x160e('0xc')],{'host':'localhost','port':0x18eb});var io=require(_0x160e('0xd'))(new Redis(config['redis']));var cmHopper=require(_0x160e('0xe'));var voiceQueueRt=require(_0x160e('0xf'));var RpcSetting=require(_0x160e('0x10'));var Interval=require(_0x160e('0x11'));var Action=require(_0x160e('0x12'));var History=require(_0x160e('0x13'));var Final=require(_0x160e('0x14'));var AgentComplete=require(_0x160e('0x15'));var QueueCallerAbandon=require('./models/queueCallerAbandon');var Hangup=require(_0x160e('0x16'));var ipAgi=process[_0x160e('0x17')][_0x160e('0x18')]||'127.0.0.1';var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x160e('0x19')][_0x160e('0x1a')]=function(_0x4b78bc){this['tail']=this[_0x160e('0x1b')]?this['tail']['finally'](_0x4b78bc):_0x4b78bc();};function Dialer(_0x262fec,_0x2161ef){this[_0x160e('0x1c')]=new Sequence();this[_0x160e('0x1d')]=_0x2161ef;this[_0x160e('0x1e')]=_0x262fec['voiceQueues'];this[_0x160e('0x1f')]=_0x262fec['campaigns'];this[_0x160e('0x20')]=_0x262fec[_0x160e('0x20')];this[_0x160e('0x21')]=_0x262fec[_0x160e('0x21')];this[_0x160e('0x22')]=config[_0x160e('0x22')]||0x2;this['channels']={};this[_0x160e('0x23')]={};this[_0x160e('0x24')]={};this[_0x160e('0x25')]={};this[_0x160e('0x26')]={};this[_0x160e('0x27')]={};this[_0x160e('0x28')]={};this[_0x160e('0x29')]={};this[_0x160e('0x2a')]={};this[_0x160e('0x2b')]={};this['queuesSummary']={};ami['on'](_0x160e('0x2c'),this[_0x160e('0x2d')]['bind'](this));ami['on'](_0x160e('0x2e'),this['syncQueueCallerAbandon'][_0x160e('0x2f')](this));ami['on'](_0x160e('0x30'),this[_0x160e('0x31')][_0x160e('0x2f')](this));ami['on'](_0x160e('0x32'),this['syncAgentComplete'][_0x160e('0x2f')](this));ami['on'](_0x160e('0x33'),this[_0x160e('0x34')]['bind'](this));ami['on'](_0x160e('0x35'),this[_0x160e('0x36')][_0x160e('0x2f')](this));ami['on'](_0x160e('0x37'),this[_0x160e('0x38')][_0x160e('0x2f')](this));ami['on'](_0x160e('0x39'),this[_0x160e('0x3a')][_0x160e('0x2f')](this));ami['on'](_0x160e('0x3b'),this[_0x160e('0x3c')][_0x160e('0x2f')](this));ami['on']('queuemember',this['syncQueueMember'][_0x160e('0x2f')](this));ami['on'](_0x160e('0x3d'),this[_0x160e('0x3e')]['bind'](this));this[_0x160e('0x3f')]();this[_0x160e('0x40')]();RpcSetting[_0x160e('0x41')]()[_0x160e('0x42')](function(_0x2ca448){previewRecallmeReminderInterval=_0x2ca448[_0x160e('0x43')];});}function isNotNull(_0x3dae54){return _0x3dae54!==null&&!_['isUndefined'](_0x3dae54);}function msgResponse(_0x10707d,_0x2916d4,_0x3385ff){return{'action':_0x10707d,'response':_0x2916d4,'message':_0x3385ff,'stack':_0x3385ff};}function emit(_0x2f02b9,_0x392d6e,_0xab0b1c){io['to'](_0x2f02b9)[_0x160e('0x44')](_0x392d6e,_0xab0b1c);}function emitOutboundVoiceQueueSummary(_0x385d59){if(_0x385d59['type']===_0x160e('0x45')){logger[_0x160e('0x46')](_0x160e('0x47'),util[_0x160e('0x48')](_0x385d59,{'showHidden':![],'depth':null}));emit(util[_0x160e('0x49')]('voice:queue:%s',_0x385d59[_0x160e('0x4a')]),_0x160e('0x4b'),_0x385d59);}}function checkGetDataPredictive(_0x366db2){if(isNotNull(_0x366db2)&&!_['isEmpty'](_0x366db2)){loggerPredictive[_0x160e('0x4c')](_0x160e('0x4d'));loggerPredictive['info']('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x366db2['predictiveIntervalTotalCalls']);loggerPredictive[_0x160e('0x4c')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x366db2[_0x160e('0x4e')]);loggerPredictive[_0x160e('0x4c')](_0x160e('0x4f'),_0x366db2[_0x160e('0x50')]);loggerPredictive[_0x160e('0x4c')](_0x160e('0x51'),_0x366db2[_0x160e('0x52')]);loggerPredictive[_0x160e('0x4c')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x366db2[_0x160e('0x53')]);loggerPredictive['info'](_0x160e('0x54'),_0x366db2[_0x160e('0x55')]);loggerPredictive[_0x160e('0x4c')]('---------------------------');if(_0x366db2[_0x160e('0x56')]>0x0){if(!_[_0x160e('0x57')](_0x366db2[_0x160e('0x55')])&&_0x366db2[_0x160e('0x55')]>0x0){return!![];}loggerPredictive['info'](_0x160e('0x58'));if(!_[_0x160e('0x57')](_0x366db2[_0x160e('0x53')])&&_0x366db2[_0x160e('0x53')]>0x0){return!![];}loggerPredictive[_0x160e('0x4c')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0x160e('0x4c')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0x160e('0x4c')](_0x160e('0x59'));}return![];}function mergeDataErlangB(_0x322a79){return function(_0x40f1e4){loggerPredictive['info']('---------\x20ErlangB\x20---------');loggerPredictive[_0x160e('0x4c')](_0x160e('0x5a'),_0x40f1e4[_0x160e('0x5b')]);loggerPredictive[_0x160e('0x4c')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x40f1e4[_0x160e('0x5c')]);loggerPredictive[_0x160e('0x4c')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x40f1e4[_0x160e('0x5d')]);loggerPredictive[_0x160e('0x4c')](_0x160e('0x5e'),_0x40f1e4[_0x160e('0x5f')]);loggerPredictive[_0x160e('0x4c')](_0x160e('0x60'),_0x40f1e4[_0x160e('0x5d')]);loggerPredictive[_0x160e('0x4c')](_0x160e('0x61'));_[_0x160e('0x62')](_0x322a79,_0x40f1e4);};}function ifInterval(_0x159d78,_0x3e6ba7){if(_[_0x160e('0x57')](_0x3e6ba7)){return![];}return utils[_0x160e('0x63')](undefined,_0x3e6ba7)<_0x159d78*0x3c;}function clearPredictiveAttributes(_0xb3a68d){if(_0xb3a68d[_0x160e('0x28')]){_0xb3a68d[_0x160e('0x28')]=undefined;loggerPredictive[_0x160e('0x46')](_0xb3a68d[_0x160e('0x4a')],_0x160e('0x64'));}if(_0xb3a68d[_0x160e('0x27')]){_0xb3a68d['startPredictive']=undefined;loggerPredictive[_0x160e('0x46')](_0xb3a68d['name'],_0x160e('0x65'));}if(_0xb3a68d[_0x160e('0x66')]){clearInterval(_0xb3a68d['handlePredictive']);_0xb3a68d[_0x160e('0x66')]=undefined;loggerPredictive[_0x160e('0x46')](_0xb3a68d[_0x160e('0x4a')],_0x160e('0x67'));}}function loggerCatchPredictive(_0x2e7728,_0x2c6f82){return function(_0x254b67){loggerPredictive[_0x160e('0x68')](_0x2c6f82[_0x160e('0x4a')],_0x2e7728);loggerPredictive[_0x160e('0x68')](_0x254b67['stack']);clearPredictiveAttributes(_0x2c6f82);};}function loggerCatch(_0x2726cd){return function(_0x178bdf){logger[_0x160e('0x68')](_0x2726cd,util[_0x160e('0x48')](_0x178bdf,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x49922b){return function(_0x4cfa19){if(isNotNull(_0x4cfa19)&&isNotNull(_0x4cfa19[0x0])){if(_0x4cfa19[0x0][_0x160e('0x69')]>0x0){_0x49922b[_0x160e('0x6a')]=utils[_0x160e('0x6b')][_0x160e('0x6c')];logger['info'](_0x160e('0x6d')+_0x49922b[_0x160e('0x4a')],_0x4cfa19[0x0]['contactsRescheduled'],_0x160e('0x6e'));}else{_0x49922b[_0x160e('0x6a')]=utils[_0x160e('0x6b')][_0x160e('0x6f')];logger[_0x160e('0x4c')]('[getContactDialer2][Empty]'+_0x49922b[_0x160e('0x4a')]);}}};}function createObjHistory(_0x24c6c6,_0x211685,_0x20ead7,_0x383f20,_0x7735d9){_0x24c6c6[_0x160e('0x6a')]=_0x20ead7;var _0x4bc821=new Action(_0x24c6c6,_0x211685);var _0x455890=new History(_0x4bc821);_0x455890['state']=_0x383f20;_0x455890[_0x160e('0x70')]=_0x7735d9;_0x455890[_0x160e('0x71')]=_0x4bc821[_0x160e('0x72')];return _0x455890;}function unlockQueueStatus(_0x36e540,_0x27aebc){setTimeout(function(){if(_[_0x160e('0x57')](_0x36e540[_0x160e('0x73')])){loggerBooked['error'](_0x160e('0x74'),_0x27aebc);}_0x36e540[_0x160e('0x73')]=!![];loggerBooked[_0x160e('0x4c')](_0x160e('0x75'),_0x27aebc,JSON[_0x160e('0x76')](_[_0x160e('0x77')](_0x36e540,['name',_0x160e('0x73')])));},0x1f3);}function checkInterval(_0x452a6d){return function(){if(!isNotNull(_0x452a6d[_0x160e('0x78')])){_0x452a6d[_0x160e('0x6a')]=utils['CAMPAIGN_STATUS']['NULL_INTERVAL'];throw _0x452a6d[_0x160e('0x4a')]+_0x160e('0x79');}if(!isNotNull(_0x452a6d[_0x160e('0x78')][_0x160e('0x7a')])){_0x452a6d[_0x160e('0x6a')]=utils[_0x160e('0x6b')][_0x160e('0x7b')];throw _0x452a6d['name']+_0x160e('0x79');}if(!isNotNull(_[_0x160e('0x7c')](_0x452a6d[_0x160e('0x78')][_0x160e('0x7a')]))){_0x452a6d[_0x160e('0x6a')]=utils[_0x160e('0x6b')][_0x160e('0x7b')];throw _0x452a6d['name']+_0x160e('0x79');}};}function checkIsIVRCampaignActive(_0x3a7b9d){return function(){if(!utils['isIVRCampaignActive'](_0x3a7b9d)){_0x3a7b9d['message']=utils['CAMPAIGN_STATUS'][_0x160e('0x7d')];throw _0x3a7b9d['name']+_0x160e('0x7e');}};}function emitCampaignSummary(_0x391b76){if(utils[_0x160e('0x7f')](_0x391b76)){emit(util['format'](_0x160e('0x80'),_0x391b76['name']),_0x160e('0x81'),_0x391b76);}}function loggerCatchQueueSummary(_0x55b262,_0x459eab){return function(_0x4aa828){clearPredictiveAttributes(_0x459eab);emitCampaignSummary(_0x459eab);loggerSyncQueueSummary['debug'](_0x55b262,util[_0x160e('0x48')](_0x4aa828,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x48f0a0){if(_0x48f0a0[_0x160e('0x82')]){if(_0x48f0a0[_0x160e('0x83')]===0x0){_0x48f0a0[_0x160e('0x82')]=![];_0x48f0a0[_0x160e('0x6a')]=utils[_0x160e('0x6b')][_0x160e('0x7d')];loggerSyncQueueSummary['debug'](_0x160e('0x84'),_0x48f0a0[_0x160e('0x4a')],_0x160e('0x85'));}else{_0x48f0a0[_0x160e('0x6a')]=utils[_0x160e('0x6b')][_0x160e('0x86')];loggerSyncQueueSummary[_0x160e('0x46')](_0x160e('0x84'),_0x48f0a0['name'],_0x160e('0x87'));}emitCampaignSummary(_0x48f0a0);}}function myreject(_0x44c9e9){return function(_0x186cdc){return _0x44c9e9(msgResponse('[ifTime][Action]',_0x160e('0x88'),JSON[_0x160e('0x76')](_0x186cdc)));};}Dialer[_0x160e('0x19')][_0x160e('0x89')]=function(_0x385abf){return!_['isUndefined'](_0x385abf)&&_0x385abf&&!_[_0x160e('0x57')](_0x385abf[_0x160e('0x4a')])&&!_[_0x160e('0x57')](_0x385abf[_0x160e('0x8a')])&&_0x385abf[_0x160e('0x8a')]&&(this['trunks'][util[_0x160e('0x49')]('SIP/%s',_0x385abf['name'])]['status']==='reachable'||this[_0x160e('0x21')][util[_0x160e('0x49')](_0x160e('0x8b'),_0x385abf[_0x160e('0x4a')])][_0x160e('0x8c')]===_0x160e('0x8d'));};Dialer[_0x160e('0x19')][_0x160e('0x8e')]=function(_0x16e736){var _0x4eba8b=this;return function(){if(!_0x4eba8b['isTrunkReachable'](_0x16e736[_0x160e('0x8f')])){if(!_0x4eba8b[_0x160e('0x89')](_0x16e736[_0x160e('0x90')])){_0x16e736['message']=utils[_0x160e('0x6b')]['TRUNK_NOT_REACHABLE'];throw _0x16e736[_0x160e('0x4a')]+'\x20trunk\x20is\x20not\x20reachable';}}};};Dialer[_0x160e('0x19')][_0x160e('0x91')]=function(_0x4afc93,_0x105e84,_0x38628a,_0x4545d8){var _0x539de7=this;return function(){var _0x461923=!![];return _0x539de7[_0x160e('0x92')](_0x4afc93,_0x105e84,_0x38628a,_0x4545d8,_0x461923);};};Dialer['prototype'][_0x160e('0x93')]=function(_0x37dc75,_0x4f22b2,_0x3c21cc,_0x95b8d0){var _0x26afaf=this;return function(){var _0x2568ea=![];return _0x26afaf[_0x160e('0x92')](_0x37dc75[_0x160e('0x7a')],_0x4f22b2,_0x3c21cc,_0x95b8d0,_0x2568ea);};};Dialer[_0x160e('0x19')][_0x160e('0x92')]=function(_0x35d27e,_0x1ee226,_0x5c011a,_0x1ee3f6,_0x5ddf5b){var _0x3bf9c7=[];return new Promise(function(_0x17d5ba,_0x5d609f){if(!isNotNull(_0x35d27e)){_0x1ee3f6['message']=utils[_0x160e('0x6b')][_0x160e('0x7b')];return _0x5d609f(msgResponse(_0x160e('0x94'),_0x160e('0x95'),_0x5c011a+_0x160e('0x96')));}if(_[_0x160e('0x7c')](_0x35d27e)){_0x1ee3f6[_0x160e('0x6a')]=utils[_0x160e('0x6b')][_0x160e('0x97')];return _0x5d609f(msgResponse(_0x160e('0x94'),_0x160e('0x95'),_0x5c011a+_0x160e('0x98')));}if(_0x1ee226&&_['isUndefined'](config[_0x160e('0x99')][_0x1ee226])){_0x1ee3f6[_0x160e('0x6a')]=utils[_0x160e('0x6b')][_0x160e('0x9a')];return _0x5d609f(msgResponse(_0x160e('0x94'),'Failure',_0x5c011a+_0x160e('0x9b')+_0x1ee226));}if(_[_0x160e('0x9c')](_0x35d27e)){for(var _0x412a4c=0x0;_0x412a4c<_0x35d27e[_0x160e('0x9d')];_0x412a4c+=0x1){_0x3bf9c7[_0x160e('0x9e')](ami[_0x160e('0x9f')]({'action':'command','command':util[_0x160e('0x49')](_0x160e('0xa0'),_0x35d27e[_0x412a4c][_0x160e('0xa1')],!_[_0x160e('0x57')](config[_0x160e('0x99')][_0x1ee226])?_0x1ee226:'')})[_0x160e('0x42')](function(_0x28f564){return _0x28f564[_0x160e('0xa2')][_0x160e('0xa3')](_0x160e('0xa4'))>=0x0;})[_0x160e('0xa5')](myreject(_0x5d609f)));}}else{_0x3bf9c7['push'](ami[_0x160e('0x9f')]({'action':_0x160e('0xa6'),'command':util[_0x160e('0x49')](_0x160e('0xa0'),_0x35d27e,!_[_0x160e('0x57')](config[_0x160e('0x99')][_0x1ee226])?_0x1ee226:'')})[_0x160e('0x42')](function(_0x1ae839){return _0x1ae839[_0x160e('0xa2')]['indexOf'](_0x160e('0xa4'))>=0x0;})[_0x160e('0xa5')](myreject(_0x5d609f)));}Promise[_0x160e('0xa7')](_0x3bf9c7)[_0x160e('0x42')](function(_0x464e96){var _0x38b40a=_['some'](_0x464e96);if(_0x38b40a){return _0x17d5ba(_0x38b40a);}else{_0x1ee3f6[_0x160e('0x6a')]=_0x5ddf5b?utils[_0x160e('0x6b')][_0x160e('0xa8')]:utils['CAMPAIGN_STATUS'][_0x160e('0xa9')];return _0x5d609f(msgResponse(_0x160e('0xaa'),_0x160e('0x95'),'Global:\x20'+_0x5ddf5b+'\x20'+_0x5c011a+_0x160e('0xab')+util[_0x160e('0x48')](_0x35d27e,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x1ee226));}})['catch'](function(_0x9c9793){return _0x5d609f(msgResponse(_0x160e('0x94'),_0x160e('0x95'),JSON[_0x160e('0x76')](_0x9c9793)));});});};Dialer[_0x160e('0x19')]['loopCampaigns']=function(){var _0x17ce44=this;return cmHopper[_0x160e('0xac')]({'active':![]},{'where':{'active':!![]}})[_0x160e('0x42')](function(){setInterval(function(){_0x17ce44[_0x160e('0xad')]();},0x3e8);});};Dialer[_0x160e('0x19')][_0x160e('0xad')]=function(){var _0x440698=this;var _0x1c7501;for(var _0x502bbb in this['campaigns']){if(typeof this[_0x160e('0x1f')][_0x502bbb]!==_0x160e('0xae')){_0x1c7501=this['campaigns'][_0x502bbb];if(utils[_0x160e('0x7f')](_0x1c7501)&&utils[_0x160e('0xaf')](_0x1c7501)){_0x1c7501['sendMessageOneNotActive']=!![];Promise[_0x160e('0xb0')]()[_0x160e('0x42')](checkIsIVRCampaignActive(_0x1c7501))[_0x160e('0x42')](checkInterval(_0x1c7501))[_0x160e('0x42')](_0x440698[_0x160e('0x8e')](_0x1c7501))[_0x160e('0x42')](_0x440698[_0x160e('0x91')](_0x1c7501[_0x160e('0xb1')],_0x1c7501[_0x160e('0xb2')],_0x1c7501[_0x160e('0x4a')],_0x1c7501))[_0x160e('0x42')](_0x440698[_0x160e('0x93')](_0x1c7501[_0x160e('0x78')],_0x1c7501['dialTimezone'],_0x1c7501[_0x160e('0x4a')],_0x1c7501))[_0x160e('0x42')](_0x440698[_0x160e('0xb3')](_0x1c7501))[_0x160e('0xa5')](loggerCatchQueueSummary(_0x160e('0xb4'),_0x1c7501));}else{notSendMessagesCampaign(_0x1c7501);}}}};Dialer['prototype'][_0x160e('0xb5')]=function(_0x31ca6f){if(_0x31ca6f[_0x160e('0xb6')]!==_0x160e('0xa')){clearPredictiveAttributes(_0x31ca6f);}switch(_0x31ca6f[_0x160e('0xb6')]){case _0x160e('0xb7'):this[_0x160e('0xb8')](_0x31ca6f,0x1);break;case _0x160e('0xb9'):this[_0x160e('0xb8')](_0x31ca6f,_0x31ca6f[_0x160e('0xba')]);break;case _0x160e('0xa'):this['predictive'](_0x31ca6f);break;case _0x160e('0x9'):this[_0x160e('0xb8')](_0x31ca6f,0x1);break;default:logger['error'](_0x160e('0xbb'),_0x31ca6f['name'],_0x160e('0xbc'));}};Dialer[_0x160e('0x19')]['ifTime']=function(_0x18c3ff,_0x561601){var _0x4f7e01=_0x18c3ff[_0x160e('0xb2')];var _0x2d22bf=_0x561601?_0x18c3ff[_0x160e('0xb1')]:_0x18c3ff[_0x160e('0x78')]['Intervals'];logger['silly']('Dialer::ifTime()',_0x2d22bf,_0x4f7e01,_0x18c3ff[_0x160e('0x4a')],util[_0x160e('0x49')]('Voice\x20Queue\x20%s\x20$s',_0x18c3ff[_0x160e('0x4a')],_0x18c3ff['id']));var _0x1c2fbe=null;return Interval[_0x160e('0xbd')](_0x2d22bf,_0x4f7e01)[_0x160e('0x42')](function(_0x4abc23){if(_0x4abc23===!![]){return _0x4abc23;}else{_0x18c3ff[_0x160e('0x6a')]=_0x561601?utils['CAMPAIGN_STATUS']['OVERTIME_GLOBAL_INTERVAL']:utils[_0x160e('0x6b')]['OVERTIME_INTERVAL'];_0x1c2fbe=msgResponse(_0x160e('0xaa'),'Failure',_0x160e('0xbe')+_0x561601+'\x20'+_0x18c3ff[_0x160e('0x4a')]+_0x160e('0xab')+util['inspect'](_0x2d22bf,{'showHidden':![],'depth':null})+_0x160e('0xbf')+_0x4f7e01);}if(_0x1c2fbe!==null){logger[_0x160e('0xc0')]('Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:',_0x1c2fbe);_0x1c2fbe[_0x160e('0xc1')]=_0x561601;throw _0x1c2fbe;}})[_0x160e('0xa5')](function(_0x15cca9){logger['error'](_0x160e('0xc2'),_0x15cca9);throw msgResponse(_0x160e('0xc3'),_0x160e('0x88'),util[_0x160e('0x48')](_0x15cca9,{'showHidden':![],'depth':null}));});};Dialer[_0x160e('0x19')]['syncAgentConnect']=function(_0x30bd3e){if(this[_0x160e('0x1e')][_0x30bd3e[_0x160e('0xc4')]]){if(this['uniqueId'][_0x30bd3e[_0x160e('0xc5')]]&&this[_0x160e('0x25')][_0x30bd3e[_0x160e('0xc5')]][_0x160e('0xc6')]!==_0x160e('0xc7')){utils[_0x160e('0xc8')](this['voiceQueues'][_0x30bd3e[_0x160e('0xc4')]],_0x160e('0xc9'));this[_0x160e('0x25')][_0x30bd3e[_0x160e('0xc5')]]['answertime']=moment()['format'](_0x160e('0xca'));}}};Dialer[_0x160e('0x19')][_0x160e('0xcb')]=function(_0x538089){var _0x3497e5=this[_0x160e('0x25')][_0x538089[_0x160e('0xc5')]];if(this[_0x160e('0x1e')][_0x538089['queue']]){if(_0x3497e5&&_0x3497e5['type']!=='ivr'){delete this['uniqueId'][_0x538089[_0x160e('0xc5')]];this[_0x160e('0x1e')][_0x538089[_0x160e('0xc4')]][_0x160e('0xcc')]+=0x1;var _0x485c8c=new AgentComplete(_0x3497e5,_0x538089);if(_0x538089[_0x160e('0xcd')]==='agent'){_0x485c8c[_0x160e('0xce')]=this[_0x160e('0x1e')][_0x538089[_0x160e('0xc4')]][_0x160e('0xcf')]&&this[_0x160e('0x1e')][_0x538089['queue']][_0x160e('0xd0')]?moment()[_0x160e('0x49')](_0x160e('0xca')):undefined;}hopperUtils[_0x160e('0xd1')](_0x485c8c)[_0x160e('0xa5')](loggerCatch(_0x160e('0xd2')));hopperUtils['moveContactManagedDialer'](_0x485c8c)[_0x160e('0xa5')](loggerCatch(_0x160e('0xd3')));}}};Dialer[_0x160e('0x19')][_0x160e('0xd4')]=function(_0x12d742){var _0x506c0d=this[_0x160e('0x25')][_0x12d742[_0x160e('0xc5')]];var _0x5df938=this;var _0x592802=![];var _0x5c8d4d;var _0x43b751;if(this['voiceQueues'][_0x12d742[_0x160e('0xc4')]]){if(_0x506c0d&&_0x506c0d['type']!==_0x160e('0xc7')){delete this[_0x160e('0x25')][_0x12d742['uniqueid']];utils['decrementOriginate'](this[_0x160e('0x1e')][_0x12d742[_0x160e('0xc4')]],_0x160e('0xd5'));_0x506c0d[_0x160e('0xd6')]=moment()[_0x160e('0x49')](_0x160e('0xca'));var _0x24b89a=new QueueCallerAbandon(_0x506c0d,_0x12d742);if(utils['getSeconds'](_0x506c0d[_0x160e('0xd6')],_0x506c0d[_0x160e('0xd7')])>=_0x506c0d['dialQueueTimeout']){this[_0x160e('0x1e')][_0x12d742[_0x160e('0xc4')]][_0x160e('0x50')]+=0x1;this[_0x160e('0x1e')][_0x12d742[_0x160e('0xc4')]][_0x160e('0xd8')]+=0x1;this[_0x160e('0x1e')][_0x12d742['queue']][_0x160e('0xd9')]+=0x1;_0x24b89a['state']=0xa;_0x24b89a[_0x160e('0x70')]=_0x160e('0xda');_0x24b89a[_0x160e('0xdb')]=_0x160e('0xdc');_0x24b89a[_0x160e('0xce')]=this[_0x160e('0x1e')][_0x12d742[_0x160e('0xc4')]][_0x160e('0xcf')]?moment()[_0x160e('0x49')](_0x160e('0xca')):undefined;_0x24b89a[_0x160e('0xdd')]+=0x1;_0x24b89a[_0x160e('0xde')]+=0x1;_0x5c8d4d=this['voiceQueues'][_0x12d742[_0x160e('0xc4')]]['dialDropRetryFrequency'];_0x43b751=this[_0x160e('0x1e')][_0x12d742[_0x160e('0xc4')]]['callAdditionalPhoneAfterMin'];hopperUtils[_0x160e('0xdf')](_0x24b89a,_0x24b89a[_0x160e('0xe0')],_0x506c0d[_0x160e('0xe1')])[_0x160e('0x42')](function(_0x56d79c){_0x592802=_0x56d79c[_0x160e('0xe2')]==0x1;if(_0x24b89a['countdropretry']>=_0x5df938['voiceQueues'][_0x12d742[_0x160e('0xc4')]][_0x160e('0xe3')]){_0x5df938[_0x160e('0xe4')](_0x24b89a,_0x56d79c[_0x160e('0xe2')]);}else{hopperUtils[_0x160e('0xe5')]({'active':![],'countdropretry':_0x24b89a[_0x160e('0xdd')],'scheduledat':moment()[_0x160e('0xe6')](_0x5df938[_0x160e('0x1e')][_0x12d742[_0x160e('0xc4')]][_0x160e('0xe7')],_0x160e('0xe8'))[_0x160e('0x49')](_0x160e('0xca')),'ContactId':_0x506c0d[_0x160e('0xe9')],'ListId':_0x506c0d[_0x160e('0xea')],'VoiceQueueId':_0x506c0d['VoiceQueueId']||undefined,'CampaignId':_0x506c0d[_0x160e('0xeb')]||undefined})[_0x160e('0xa5')](loggerCatch(_0x160e('0xec')));var _0x34df3e=new History(_0x24b89a);_0x34df3e[_0x160e('0xe0')]=0xa;_0x34df3e[_0x160e('0x70')]=_0x160e('0xda');_0x34df3e[_0x160e('0x72')]=moment()['format'](_0x160e('0xca'));_0x34df3e[_0x160e('0x71')]=_0x34df3e[_0x160e('0x72')];_0x34df3e[_0x160e('0xed')]=_0x24b89a['calleridname'];_0x34df3e[_0x160e('0xee')]=_0x24b89a['calleridnum'];hopperUtils[_0x160e('0xd1')](_0x34df3e)[_0x160e('0xa5')](loggerCatch('[syncAgentComplete][createHistory][10]'));}})['then'](function(){if(_0x592802)hopperUtils['swapAdditionalPhones'](_0x24b89a,_0x5c8d4d,_0x43b751)[_0x160e('0x42')](function(){return 0x1;});});}else{this['voiceQueues'][_0x12d742[_0x160e('0xc4')]][_0x160e('0x52')]+=0x1;this['voiceQueues'][_0x12d742['queue']]['outboundDropCallsDayCallersExit']+=0x1;_0x24b89a['state']=0xb;_0x24b89a[_0x160e('0x70')]=_0x160e('0xef');_0x24b89a['dropreason']=_0x160e('0xf0');_0x24b89a['countabandonedretry']+=0x1;_0x24b89a[_0x160e('0xde')]+=0x1;_0x5c8d4d=this[_0x160e('0x1e')][_0x12d742[_0x160e('0xc4')]][_0x160e('0xf1')];_0x43b751=this[_0x160e('0x1e')][_0x12d742['queue']][_0x160e('0xf2')];hopperUtils[_0x160e('0xdf')](_0x24b89a,_0x24b89a[_0x160e('0xe0')],_0x506c0d['voiceQueue'])[_0x160e('0x42')](function(_0x43c728){if(_0x24b89a[_0x160e('0xf3')]>=_0x5df938[_0x160e('0x1e')][_0x12d742[_0x160e('0xc4')]]['dialAbandonedMaxRetry']){_0x5df938['queueCallerAbandonCreateState'](_0x24b89a,_0x43c728[_0x160e('0xe2')]);}else{hopperUtils[_0x160e('0xe5')]({'active':![],'countabandonedretry':_0x24b89a['countabandonedretry'],'scheduledat':moment()[_0x160e('0xe6')](_0x5df938[_0x160e('0x1e')][_0x12d742[_0x160e('0xc4')]][_0x160e('0xf1')],_0x160e('0xe8'))[_0x160e('0x49')](_0x160e('0xca')),'ContactId':_0x506c0d[_0x160e('0xe9')],'ListId':_0x506c0d[_0x160e('0xea')],'VoiceQueueId':_0x506c0d[_0x160e('0xf4')]||undefined,'CampaignId':_0x506c0d[_0x160e('0xeb')]||undefined})[_0x160e('0xa5')](loggerCatch(_0x160e('0xf5')));var _0x582f78=new History(_0x24b89a);_0x582f78[_0x160e('0xe0')]=0xb;_0x582f78[_0x160e('0x70')]='Abandoned';_0x582f78[_0x160e('0x72')]=moment()['format'](_0x160e('0xca'));_0x582f78['endtime']=_0x582f78[_0x160e('0x72')];_0x582f78['calleridname']=_0x24b89a[_0x160e('0xed')];_0x582f78['calleridnum']=_0x24b89a[_0x160e('0xee')];hopperUtils['createHistory'](_0x582f78)[_0x160e('0xa5')](loggerCatch('[syncAgentComplete][createHistory][11]'));}})[_0x160e('0x42')](function(){if(_0x592802)hopperUtils['swapAdditionalPhones'](_0x24b89a,_0x5c8d4d,_0x43b751)['then'](function(){return 0x1;});});}}}};Dialer[_0x160e('0x19')]['syncNewExten']=function(_0x507da6){if(this[_0x160e('0x23')][_0x507da6['uniqueid']]){this['actions'][_0x507da6[_0x160e('0xc5')]][_0x160e('0xf6')]=_0x507da6[_0x160e('0xf6')];}if(this[_0x160e('0x25')][_0x507da6[_0x160e('0xc5')]]){this['uniqueId'][_0x507da6[_0x160e('0xc5')]][_0x160e('0xf6')]=_0x507da6['channel'];}};Dialer[_0x160e('0x19')][_0x160e('0xf7')]=function(_0x373fcc){if(!this[_0x160e('0x23')][_0x373fcc[_0x160e('0xf8')]]){return;}var _0x3a0f11=this[_0x160e('0x1e')][this[_0x160e('0x23')][_0x373fcc[_0x160e('0xf8')]][_0x160e('0xc4')]][_0x160e('0xf9')]||_0x160e('0xfa');if(_0x3a0f11===_0x160e('0xfb')){if(this[_0x160e('0x23')][_0x373fcc['actionid']]&&_['isNil'](this['actions'][_0x373fcc[_0x160e('0xf8')]][_0x160e('0xfc')])&&_0x373fcc[_0x160e('0x8c')]==='1'&&_0x373fcc[_0x160e('0xfd')]==='0'){if(this[_0x160e('0x20')][_0x373fcc[_0x160e('0xfe')]]){if(!this['agents'][_0x373fcc[_0x160e('0xfe')]]['locked']){this['agents'][_0x373fcc['stateinterface']][_0x160e('0xfc')]=!![];this['actions'][_0x373fcc[_0x160e('0xf8')]][_0x160e('0xfc')]=!![];this[_0x160e('0x23')][_0x373fcc[_0x160e('0xf8')]][_0x160e('0xfe')]=_0x373fcc[_0x160e('0xfe')];}}}}else if(_0x3a0f11===_0x160e('0xfa')){if(this[_0x160e('0x23')][_0x373fcc[_0x160e('0xf8')]]){if(this['agents'][_0x373fcc['stateinterface']]){this['actions'][_0x373fcc[_0x160e('0xf8')]][_0x160e('0xfe')]=_0x373fcc[_0x160e('0xfe')];if(_[_0x160e('0xff')](this[_0x160e('0x2a')][this[_0x160e('0x23')][_0x373fcc[_0x160e('0xf8')]][_0x160e('0xc4')]])){this['queueBooked'][this[_0x160e('0x23')][_0x373fcc[_0x160e('0xf8')]][_0x160e('0xc4')]]=[];}this[_0x160e('0x2a')][this[_0x160e('0x23')][_0x373fcc[_0x160e('0xf8')]][_0x160e('0xc4')]][_0x160e('0x9e')](_[_0x160e('0x62')](_[_0x160e('0x77')](this[_0x160e('0x23')][_0x373fcc[_0x160e('0xf8')]],[_0x160e('0x100'),_0x160e('0xfe')]),{'status':_0x373fcc[_0x160e('0x8c')],'paused':_0x373fcc[_0x160e('0xfd')]}));}}}};Dialer[_0x160e('0x19')][_0x160e('0x3e')]=function(_0x494417){if(!this[_0x160e('0x23')][_0x494417['actionid']]){return;}var _0x4d2e4e=this;var _0x4703cd=this['voiceQueues'][this[_0x160e('0x23')][_0x494417[_0x160e('0xf8')]][_0x160e('0xc4')]];var _0x4604af=_0x4703cd['strategy']||_0x160e('0xfa');if(_0x4604af===_0x160e('0xfb')){if(this[_0x160e('0x23')][_0x494417['actionid']]&&this[_0x160e('0x23')][_0x494417[_0x160e('0xf8')]][_0x160e('0xfe')]){this['preview'][_0x160e('0x101')](this[_0x160e('0x23')][_0x494417['actionid']][_0x160e('0x100')],this[_0x160e('0x23')][_0x494417[_0x160e('0xf8')]][_0x160e('0xfe')])[_0x160e('0xa5')](function(_0x3400f6){logger[_0x160e('0x68')]('[Catch][Preview][syncQueueStatusComplete]',util[_0x160e('0x48')](_0x3400f6,{'showHidden':![],'depth':null}));})[_0x160e('0x102')](function(){utils[_0x160e('0xc8')](_0x4d2e4e[_0x160e('0x1e')][_0x4d2e4e[_0x160e('0x23')][_0x494417['actionid']][_0x160e('0xc4')]],_0x160e('0x103'));_0x4d2e4e[_0x160e('0x20')][_0x4d2e4e[_0x160e('0x23')][_0x494417[_0x160e('0xf8')]][_0x160e('0xfe')]]['locked']=![];delete _0x4d2e4e[_0x160e('0x23')][_0x494417[_0x160e('0xf8')]];unlockQueueStatus(_0x4703cd);});}else{utils[_0x160e('0xc8')](this[_0x160e('0x1e')][this[_0x160e('0x23')][_0x494417[_0x160e('0xf8')]]['queue']],_0x160e('0x103'));hopperUtils['rescheduleContact']({'active':![],'ContactId':this[_0x160e('0x23')][_0x494417['actionid']][_0x160e('0xe9')],'ListId':this[_0x160e('0x23')][_0x494417[_0x160e('0xf8')]]['ListId'],'VoiceQueueId':this[_0x160e('0x23')][_0x494417['actionid']]['VoiceQueueId']||undefined,'CampaignId':this[_0x160e('0x23')][_0x494417['actionid']][_0x160e('0xeb')]||undefined})[_0x160e('0xa5')](loggerCatch(_0x160e('0x104')));delete this[_0x160e('0x23')][_0x494417[_0x160e('0xf8')]];unlockQueueStatus(_0x4703cd);}}else if(_0x4604af===_0x160e('0xfa')){var _0x101ae6;if(this['actions'][_0x494417['actionid']]&&!_[_0x160e('0x7c')](this[_0x160e('0x2a')][this[_0x160e('0x23')][_0x494417['actionid']][_0x160e('0xc4')]])){if(this[_0x160e('0x2b')][_0x4d2e4e[_0x160e('0x23')][_0x494417[_0x160e('0xf8')]][_0x160e('0xc4')]]){this[_0x160e('0x2b')][_0x4d2e4e[_0x160e('0x23')][_0x494417[_0x160e('0xf8')]][_0x160e('0xc4')]]=this[_0x160e('0x2b')][this[_0x160e('0x23')][_0x494417[_0x160e('0xf8')]]['queue']]?this[_0x160e('0x2b')][this[_0x160e('0x23')][_0x494417[_0x160e('0xf8')]]['queue']]:this['queueBooked'][this[_0x160e('0x23')][_0x494417[_0x160e('0xf8')]]['queue']]?this[_0x160e('0x2a')][this['actions'][_0x494417[_0x160e('0xf8')]]['queue']][_0x160e('0x105')]||0x0:0x0;}this[_0x160e('0x2a')][this[_0x160e('0x23')][_0x494417[_0x160e('0xf8')]]['queue']][_0x160e('0x105')]=this[_0x160e('0x2b')][this[_0x160e('0x23')][_0x494417[_0x160e('0xf8')]][_0x160e('0xc4')]];for(var _0x215c88=0x0;_0x215c88<this[_0x160e('0x2a')][this[_0x160e('0x23')][_0x494417[_0x160e('0xf8')]][_0x160e('0xc4')]][_0x160e('0x9d')];_0x215c88+=0x1){_0x101ae6=rr(this['queueBooked'][this[_0x160e('0x23')][_0x494417[_0x160e('0xf8')]][_0x160e('0xc4')]]);this[_0x160e('0x2b')][_0x4d2e4e[_0x160e('0x23')][_0x494417[_0x160e('0xf8')]][_0x160e('0xc4')]]=this[_0x160e('0x2a')][this['actions'][_0x494417[_0x160e('0xf8')]][_0x160e('0xc4')]][_0x160e('0x105')];if(_0x101ae6[_0x160e('0x8c')]==='1'&&_0x101ae6[_0x160e('0xfd')]==='0'){break;}}if(!_['isNil'](_0x101ae6)){this[_0x160e('0x20')][_0x101ae6['stateinterface']][_0x160e('0x106')]=_[_0x160e('0x57')](this['agents'][_0x101ae6[_0x160e('0xfe')]][_0x160e('0x106')])?!![]:this[_0x160e('0x20')][_0x101ae6['stateinterface']][_0x160e('0x106')];}loggerBooked[_0x160e('0x4c')](_0x160e('0x107'),_0x494417[_0x160e('0xf8')],'Agent:\x20',JSON[_0x160e('0x76')](_[_0x160e('0x77')](this[_0x160e('0x20')][_0x101ae6['stateinterface']],[_0x160e('0x4a'),'unlockRR'])),_0x160e('0x108'),JSON[_0x160e('0x76')](_0x101ae6[_0x160e('0x100')]));if(!_[_0x160e('0xff')](_0x101ae6)&&_0x101ae6['status']==='1'&&_0x101ae6['paused']==='0'&&this[_0x160e('0x20')][_0x101ae6[_0x160e('0xfe')]][_0x160e('0x106')]){this[_0x160e('0x20')][_0x101ae6[_0x160e('0xfe')]][_0x160e('0x106')]=![];this[_0x160e('0x2a')][_0x4d2e4e[_0x160e('0x23')][_0x494417[_0x160e('0xf8')]][_0x160e('0xc4')]]=[];this[_0x160e('0x1d')][_0x160e('0x101')](_0x101ae6[_0x160e('0x100')],_0x101ae6[_0x160e('0xfe')])[_0x160e('0xa5')](function(_0x3b079c){logger['error'](_0x160e('0x109'),util[_0x160e('0x48')](_0x3b079c,{'showHidden':![],'depth':null}));})[_0x160e('0x102')](function(){utils[_0x160e('0xc8')](_0x4d2e4e[_0x160e('0x1e')][_0x4d2e4e[_0x160e('0x23')][_0x494417[_0x160e('0xf8')]][_0x160e('0xc4')]],'[syncQueueStatusComplete]');setTimeout(function(){_0x4d2e4e[_0x160e('0x20')][_0x101ae6[_0x160e('0xfe')]][_0x160e('0x106')]=!![];loggerBooked[_0x160e('0x4c')](_0x160e('0x10a'),_0x494417[_0x160e('0xf8')],'Agent:\x20',JSON[_0x160e('0x76')](_['pick'](_0x4d2e4e[_0x160e('0x20')][_0x101ae6['stateinterface']],[_0x160e('0x4a'),_0x160e('0x106')])),_0x160e('0x108'),JSON[_0x160e('0x76')](_0x101ae6[_0x160e('0x100')]));},0xc7);delete _0x4d2e4e[_0x160e('0x23')][_0x494417[_0x160e('0xf8')]];unlockQueueStatus(_0x4703cd,_0x494417[_0x160e('0xf8')]);});}else{loggerBooked['info'](_0x160e('0x10b'));utils[_0x160e('0xc8')](this[_0x160e('0x1e')][this[_0x160e('0x23')][_0x494417['actionid']][_0x160e('0xc4')]],_0x160e('0x103'));hopperUtils[_0x160e('0xe5')]({'active':![],'ContactId':this[_0x160e('0x23')][_0x494417[_0x160e('0xf8')]][_0x160e('0xe9')],'ListId':this[_0x160e('0x23')][_0x494417[_0x160e('0xf8')]]['ListId'],'VoiceQueueId':this['actions'][_0x494417[_0x160e('0xf8')]][_0x160e('0xf4')]||undefined,'CampaignId':this[_0x160e('0x23')][_0x494417['actionid']]['CampaignId']||undefined})[_0x160e('0xa5')](loggerCatch(_0x160e('0x104')));delete this[_0x160e('0x23')][_0x494417[_0x160e('0xf8')]];unlockQueueStatus(_0x4703cd);}}else{loggerBooked['info']('[booked][unlock2]');utils[_0x160e('0xc8')](this[_0x160e('0x1e')][this[_0x160e('0x23')][_0x494417[_0x160e('0xf8')]][_0x160e('0xc4')]],_0x160e('0x103'));hopperUtils[_0x160e('0xe5')]({'active':![],'ContactId':this[_0x160e('0x23')][_0x494417[_0x160e('0xf8')]][_0x160e('0xe9')],'ListId':this['actions'][_0x494417[_0x160e('0xf8')]][_0x160e('0xea')],'VoiceQueueId':this[_0x160e('0x23')][_0x494417[_0x160e('0xf8')]][_0x160e('0xf4')]||undefined,'CampaignId':this[_0x160e('0x23')][_0x494417['actionid']]['CampaignId']||undefined})[_0x160e('0xa5')](loggerCatch(_0x160e('0x10c')));delete this[_0x160e('0x23')][_0x494417[_0x160e('0xf8')]];unlockQueueStatus(_0x4703cd);}}else{loggerBooked[_0x160e('0x4c')]('[booked][unlock3]');utils[_0x160e('0xc8')](this[_0x160e('0x1e')][this[_0x160e('0x23')][_0x494417[_0x160e('0xf8')]][_0x160e('0xc4')]],_0x160e('0x103'));hopperUtils[_0x160e('0xe5')]({'active':![],'ContactId':this[_0x160e('0x23')][_0x494417[_0x160e('0xf8')]][_0x160e('0xe9')],'ListId':this[_0x160e('0x23')][_0x494417['actionid']]['ListId'],'VoiceQueueId':this[_0x160e('0x23')][_0x494417['actionid']]['VoiceQueueId']||undefined,'CampaignId':this[_0x160e('0x23')][_0x494417[_0x160e('0xf8')]]['CampaignId']||undefined})[_0x160e('0xa5')](loggerCatch(_0x160e('0x10d')));delete this['actions'][_0x494417[_0x160e('0xf8')]];unlockQueueStatus(_0x4703cd);}};Dialer[_0x160e('0x19')][_0x160e('0x31')]=function(_0x26bb89){var _0xa22e4a=this[_0x160e('0x23')][_0x26bb89[_0x160e('0xf8')]];if(_0xa22e4a){delete this[_0x160e('0x23')][_0x26bb89[_0x160e('0xf8')]];_0xa22e4a[_0x160e('0xd7')]=moment()[_0x160e('0x49')](_0x160e('0xca'));var _0xa66fef=_0xa22e4a[_0x160e('0xc6')]==='ivr'?this[_0x160e('0x1f')][_0xa22e4a['queue']]:this[_0x160e('0x1e')][_0xa22e4a[_0x160e('0x10e')]()];if(_0x26bb89[_0x160e('0x10f')]!=='Success'){utils[_0x160e('0xc8')](_0xa66fef,_0x160e('0x110'));return this[_0x160e('0x111')](_0xa22e4a,_0xa66fef,_0x26bb89)[_0x160e('0xa5')](loggerCatch(_0x160e('0x112')));}this['uniqueId'][_0x26bb89[_0x160e('0xc5')]]=_0xa22e4a;}};Dialer[_0x160e('0x19')][_0x160e('0x3c')]=function(_0x16ea70){var _0x3ebbaf=this;var _0x25231e=this[_0x160e('0x25')][_0x16ea70['uniqueid']];var _0x1e2b02;if(!_['isNil'](_0x16ea70)&&!_['isNil'](_0x16ea70[_0x160e('0x113')])&&!_['isNil'](_0x16ea70[_0x160e('0x113')]['amdstatus'])&&_0x16ea70[_0x160e('0x114')]===_0x160e('0x115')&&_0x25231e){if(_0x25231e[_0x160e('0xc6')]!==_0x160e('0xc7')&&this[_0x160e('0x1e')][_0x25231e['queue']]['dialAMDActive']&&_0x16ea70[_0x160e('0x116')]===_0x160e('0x117')){delete this[_0x160e('0x25')][_0x16ea70['uniqueid']];utils[_0x160e('0xc8')](this[_0x160e('0x1e')][_0x25231e[_0x160e('0xc4')]],_0x160e('0x118'));this[_0x160e('0x1e')][_0x25231e[_0x160e('0xc4')]]['outboundAnswerCallsDay']+=0x1;this[_0x160e('0x1e')][_0x25231e[_0x160e('0xc4')]][_0x160e('0x119')]+=0x1;_0x1e2b02=new Hangup(_0x25231e,_0x16ea70);_0x1e2b02['state']=0x12;_0x1e2b02[_0x160e('0x70')]=_0x160e('0x11a');_0x1e2b02[_0x160e('0x11b')]='AMD';ami[_0x160e('0x44')](_0x160e('0x11c'),ut['buildObj'](_0x1e2b02,'amd'));this[_0x160e('0x11d')](_0x1e2b02,_0x160e('0x11e'),_0x160e('0x11f'));}if(_0x25231e[_0x160e('0xc6')]!=='ivr'&&this[_0x160e('0x1e')][_0x25231e[_0x160e('0xc4')]][_0x160e('0x120')]&&_0x16ea70[_0x160e('0x116')]==='MACHINE'){return new Promise(function(_0x200cf3,_0x3ef1f4){delete _0x3ebbaf[_0x160e('0x25')][_0x16ea70[_0x160e('0xc5')]];utils[_0x160e('0xc8')](_0x3ebbaf[_0x160e('0x1e')][_0x25231e[_0x160e('0xc4')]],'[syncVarSet]');_0x3ebbaf[_0x160e('0x1e')][_0x25231e[_0x160e('0xc4')]][_0x160e('0xcc')]+=0x1;_0x3ebbaf['voiceQueues'][_0x25231e['queue']][_0x160e('0x119')]+=0x1;var _0x475ff2=_0x3ebbaf[_0x160e('0x1e')][_0x25231e[_0x160e('0xc4')]];var _0x548941=new Hangup(_0x25231e,_0x16ea70);_0x548941[_0x160e('0xe0')]=0x13;_0x548941[_0x160e('0x70')]='Machine';_0x548941[_0x160e('0x11b')]=_0x160e('0x121');_0x548941['countmachineretry']+=0x1;_0x548941[_0x160e('0xde')]+=0x1;_0x548941[_0x160e('0x122')]=!![];ami['emit'](_0x160e('0x11c'),ut['buildObj'](_0x548941,_0x160e('0x122')));hopperUtils[_0x160e('0xd1')](_0x548941)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x548941[_0x160e('0x123')]+_0x548941[_0x160e('0x124')]+_0x548941[_0x160e('0x125')]+_0x548941[_0x160e('0x126')]+_0x548941['countdropretry']+_0x548941['countabandonedretry']+_0x548941[_0x160e('0x127')]+_0x548941[_0x160e('0x128')]>=_0x475ff2['dialGlobalMaxRetry']){_0x3ebbaf['stateGlobal'](_0x548941,_0x200cf3,_0x3ef1f4,_0x160e('0x129'));}else{if(_0x548941[_0x160e('0x127')]>=_0x475ff2[_0x160e('0x12a')]){_0x3ebbaf[_0x160e('0x12b')](_0x548941,_0x200cf3,_0x3ef1f4,'reason\x2019\x20machine....');}else{hopperUtils[_0x160e('0xe5')]({'active':![],'countmachineretry':_0x548941[_0x160e('0x127')],'scheduledat':moment()[_0x160e('0xe6')](_0x475ff2[_0x160e('0x12c')],_0x160e('0xe8'))[_0x160e('0x49')](_0x160e('0xca')),'ContactId':_0x548941[_0x160e('0xe9')],'ListId':_0x548941[_0x160e('0xea')],'VoiceQueueId':_0x548941[_0x160e('0xf4')]||undefined,'CampaignId':_0x548941[_0x160e('0xeb')]||undefined})[_0x160e('0xa5')](loggerCatch(_0x160e('0x12d')));_0x200cf3({'reschedule':0x1});}}});}if(_0x25231e[_0x160e('0xc6')]===_0x160e('0xc7')&&this['campaigns'][_0x25231e[_0x160e('0xc4')]][_0x160e('0x120')]&&_0x16ea70[_0x160e('0x116')]==='HANGUP'){delete this[_0x160e('0x25')][_0x16ea70[_0x160e('0xc5')]];utils[_0x160e('0xc8')](this[_0x160e('0x1f')][_0x25231e['queue']],_0x160e('0x118'));_0x1e2b02=new Hangup(_0x25231e,_0x16ea70);_0x1e2b02[_0x160e('0xe0')]=0x12;_0x1e2b02[_0x160e('0x70')]='HangupInAMD';_0x1e2b02['membername']='AMD';ami[_0x160e('0x44')]('custom:amd',ut[_0x160e('0x12e')](_0x1e2b02,_0x160e('0x122')));this[_0x160e('0x11d')](_0x1e2b02,_0x160e('0x12f'),'[syncHangupInAMDIvr]');}if(_0x25231e[_0x160e('0xc6')]==='ivr'&&this[_0x160e('0x1f')][_0x25231e[_0x160e('0xc4')]][_0x160e('0x120')]&&_0x16ea70[_0x160e('0x116')]==='MACHINE'){return new Promise(function(_0x375653,_0x3f76a6){delete _0x3ebbaf['uniqueId'][_0x16ea70['uniqueid']];utils['decrementOriginate'](_0x3ebbaf[_0x160e('0x1f')][_0x25231e[_0x160e('0xc4')]],_0x160e('0x118'));_0x3ebbaf[_0x160e('0x1f')][_0x25231e[_0x160e('0xc4')]][_0x160e('0xcc')]+=0x1;_0x3ebbaf[_0x160e('0x1f')][_0x25231e['queue']][_0x160e('0x119')]+=0x1;var _0xb1bcc4=_0x3ebbaf[_0x160e('0x1f')][_0x25231e[_0x160e('0xc4')]];var _0x3656c1=new Hangup(_0x25231e,_0x16ea70);_0x3656c1[_0x160e('0xe0')]=0x13;_0x3656c1[_0x160e('0x70')]='Machine';_0x3656c1[_0x160e('0x11b')]=_0x160e('0x121');_0x3656c1[_0x160e('0x127')]+=0x1;_0x3656c1[_0x160e('0xde')]+=0x1;_0x3656c1[_0x160e('0x122')]=!![];ami[_0x160e('0x44')]('custom:amd',ut[_0x160e('0x12e')](_0x3656c1,_0x160e('0x122')));hopperUtils['createHistory'](_0x3656c1)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x3656c1[_0x160e('0x123')]+_0x3656c1['countcongestionretry']+_0x3656c1['countnoanswerretry']+_0x3656c1[_0x160e('0x126')]+_0x3656c1[_0x160e('0xdd')]+_0x3656c1[_0x160e('0xf3')]+_0x3656c1[_0x160e('0x127')]+_0x3656c1[_0x160e('0x128')]>=_0xb1bcc4[_0x160e('0x130')]){_0x3ebbaf[_0x160e('0x131')](_0x3656c1,_0x375653,_0x3f76a6,'reason19\x20machine....');}else{if(_0x3656c1[_0x160e('0x127')]>=_0xb1bcc4['dialMachineMaxRetry']){_0x3ebbaf[_0x160e('0x12b')](_0x3656c1,_0x375653,_0x3f76a6,_0x160e('0x132'));}else{hopperUtils[_0x160e('0xe5')]({'active':![],'countmachineretry':_0x3656c1[_0x160e('0x127')],'scheduledat':moment()[_0x160e('0xe6')](_0xb1bcc4[_0x160e('0x12c')],_0x160e('0xe8'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3656c1['ContactId'],'ListId':_0x3656c1[_0x160e('0xea')],'VoiceQueueId':_0x3656c1[_0x160e('0xf4')]||undefined,'CampaignId':_0x3656c1[_0x160e('0xeb')]||undefined})[_0x160e('0xa5')](loggerCatch(_0x160e('0x12d')));_0x375653({'reschedule':0x1});}}});}}};Dialer[_0x160e('0x19')]['syncHangup']=function(_0xe4e626){var _0x2daa15=this[_0x160e('0x25')][_0xe4e626[_0x160e('0xc5')]];var _0x45f5d6;if(!_0x2daa15){return;}if(_0x2daa15[_0x160e('0xc6')]==='ivr'){delete this['uniqueId'][_0xe4e626[_0x160e('0xc5')]];utils[_0x160e('0xc8')](this[_0x160e('0x1f')][_0x2daa15[_0x160e('0xc4')]],'[syncHangup]');this[_0x160e('0x1f')][_0x2daa15[_0x160e('0xc4')]][_0x160e('0x133')]+=0x1;if(_0xe4e626[_0x160e('0x134')]==='Normal\x20Clearing'){const _0x101ac1=new AgentComplete(_0x2daa15,_0xe4e626);_0x101ac1[_0x160e('0xeb')]=this[_0x160e('0x1f')][_0x2daa15[_0x160e('0xc4')]]['id'];hopperUtils[_0x160e('0xd1')](_0x101ac1)[_0x160e('0xa5')](loggerCatch('[syncAgentCompleteIvr][createHistory]'));hopperUtils[_0x160e('0x135')](_0x101ac1)[_0x160e('0xa5')](loggerCatch(_0x160e('0x136')));}else{_0x45f5d6=new Hangup(_0x2daa15,_0xe4e626);hopperUtils['createHistory'](_0x45f5d6)['catch'](loggerCatch(_0x160e('0x137')));hopperUtils[_0x160e('0x135')](_0x45f5d6)[_0x160e('0xa5')](loggerCatch(_0x160e('0x138')));}}else{if(isNotNull(this[_0x160e('0x1e')][_0x2daa15[_0x160e('0xc4')]][_0x160e('0x139')])){delete this[_0x160e('0x25')][_0xe4e626['uniqueid']];utils[_0x160e('0xc8')](this['voiceQueues'][_0x2daa15[_0x160e('0xc4')]],_0x160e('0x13a'));this[_0x160e('0x1e')][_0x2daa15[_0x160e('0xc4')]]['outboundAnswerCallsDay']+=0x1;this[_0x160e('0x1e')][_0x2daa15[_0x160e('0xc4')]][_0x160e('0x119')]+=0x1;_0x45f5d6=new Hangup(_0x2daa15,_0xe4e626);_0x45f5d6[_0x160e('0xe0')]=0x10;_0x45f5d6[_0x160e('0x70')]=_0x160e('0x13b');_0x45f5d6['membername']=_0x160e('0x13c');hopperUtils[_0x160e('0xd1')](_0x45f5d6)[_0x160e('0xa5')](loggerCatch(_0x160e('0x137')));hopperUtils[_0x160e('0x135')](_0x45f5d6)['catch'](loggerCatch('[syncHangupIvr]'));}else{delete this[_0x160e('0x25')][_0xe4e626['uniqueid']];utils[_0x160e('0xc8')](this[_0x160e('0x1e')][_0x2daa15[_0x160e('0xc4')]],_0x160e('0x13d'));if(_0xe4e626[_0x160e('0x134')]==='Normal\x20Clearing'){this[_0x160e('0x1e')][_0x2daa15[_0x160e('0xc4')]][_0x160e('0xcc')]+=0x1;const _0x3266ca=new AgentComplete(_0x2daa15,_0xe4e626);_0x3266ca[_0x160e('0xf4')]=this['voiceQueues'][_0x2daa15[_0x160e('0xc4')]]['id'];hopperUtils['createHistory'](_0x3266ca)[_0x160e('0xa5')](loggerCatch(_0x160e('0xd2')));hopperUtils['moveContactManagedDialer'](_0x3266ca)[_0x160e('0xa5')](loggerCatch('[syncAgentComplete]'));}else{this[_0x160e('0x1e')][_0x2daa15[_0x160e('0xc4')]][_0x160e('0x13e')]+=0x1;_0x45f5d6=new Hangup(_0x2daa15,_0xe4e626);_0x45f5d6[_0x160e('0xe0')]=0xc;_0x45f5d6[_0x160e('0x70')]=_0xe4e626[_0x160e('0x134')];_0x45f5d6[_0x160e('0x11b')]='Unknown';hopperUtils[_0x160e('0xd1')](_0x45f5d6)[_0x160e('0xa5')](loggerCatch('[syncHangup][createHistory]'));hopperUtils['moveContactManagedDialer'](_0x45f5d6)[_0x160e('0xa5')](loggerCatch('[syncHangup]'));}}}};Dialer['prototype'][_0x160e('0x34')]=function(_0x6f70d){var _0x2d1880=this;if(!_0x2d1880[_0x160e('0x13f')][_0x6f70d[_0x160e('0x4a')]]){_0x2d1880['queuesSummary'][_0x6f70d[_0x160e('0x4a')]]={'running':![]};}else if(_0x2d1880['queuesSummary'][_0x6f70d[_0x160e('0x4a')]][_0x160e('0x140')]===!![]){return;}else if(_0x2d1880[_0x160e('0x13f')][_0x6f70d[_0x160e('0x4a')]][_0x160e('0x140')]===![]){_0x2d1880[_0x160e('0x13f')][_0x6f70d[_0x160e('0x4a')]][_0x160e('0x140')]=!![];}var _0x3a88dc=_0x2d1880['voiceQueues'][_0x6f70d[_0x160e('0x4a')]];var _0xd6d3f1=_0x3a88dc['message']!==utils[_0x160e('0x6b')][_0x160e('0x7d')];var _0x1824d8=utils[_0x160e('0x141')](_0x3a88dc);_0x3a88dc[_0x160e('0x142')]=utils[_0x160e('0x143')](_0x3a88dc,_0x2d1880[_0x160e('0x21')]);Promise[_0x160e('0xb0')]()[_0x160e('0x42')](function(){if(_0x3a88dc[_0x160e('0x142')]===utils[_0x160e('0x6b')][_0x160e('0x7d')]){if(_0xd6d3f1){clearPredictiveAttributes(_0x3a88dc);_0x6f70d[_0x160e('0x27')]=undefined;_0x6f70d[_0x160e('0x28')]=undefined;}if(_0x3a88dc[_0x160e('0x142')]===utils[_0x160e('0x6b')][_0x160e('0x7d')]){_0x6f70d[_0x160e('0x144')]=0x0;_0x6f70d[_0x160e('0xfd')]=0x0;_0x6f70d[_0x160e('0x145')]=0x0;_0x6f70d[_0x160e('0x146')]=0x0;_0x6f70d[_0x160e('0x147')]=0x0;}}else if(_0x3a88dc[_0x160e('0x142')]===utils[_0x160e('0x6b')]['ACTIVE']&&!_0x1824d8){return _0x2d1880[_0x160e('0x94')](_0x3a88dc,!![])[_0x160e('0x42')](function(){return _0x2d1880['ifTime'](_0x3a88dc,![]);})[_0x160e('0x42')](function(){return _0x2d1880[_0x160e('0xb5')](_0x3a88dc);})[_0x160e('0xa5')](function(_0x511af4){loggerSyncQueueSummary[_0x160e('0x46')](_0x160e('0x148'),util[_0x160e('0x48')](_0x511af4,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x3a88dc);});}else{clearPredictiveAttributes(_0x3a88dc);}})[_0x160e('0x42')](function(){var _0x26aec8=_0x6f70d['compareToOutboundQueue'](_0x3a88dc);if(_0x26aec8||_0x3a88dc[_0x160e('0x149')]){_0x3a88dc[_0x160e('0x149')]=![];_0x6f70d[_0x160e('0x14a')](_0x3a88dc);Object[_0x160e('0x14b')](_0x3a88dc,_0x6f70d);emitOutboundVoiceQueueSummary(_0x6f70d);}_0x2d1880[_0x160e('0x13f')][_0x3a88dc[_0x160e('0x4a')]][_0x160e('0x140')]=![];})[_0x160e('0xa5')](function(_0x290ee7){logger[_0x160e('0x68')]('[syncQueueSummary]',util[_0x160e('0x48')](_0x290ee7,{'showHidden':![],'depth':null}));_0x2d1880['queuesSummary'][_0x3a88dc['name']][_0x160e('0x140')]=![];});};Dialer[_0x160e('0x19')][_0x160e('0x36')]=_[_0x160e('0x14c')](function(){var _0x572e5c=_[_0x160e('0x14d')](this[_0x160e('0x1e')],function(_0x2396b0){return _0x2396b0['dialPreviewRecallmeReminder'];});var _0x17aa43=_[_0x160e('0x14d')](this['agents'],function(_0x1a7df5){return _0x1a7df5[_0x160e('0x14e')]&&_0x1a7df5[_0x160e('0x8c')]===_0x160e('0x14f');});if(_0x572e5c['length']>0x0&&_0x17aa43[_0x160e('0x9d')]>0x0){return Promise[_0x160e('0xb0')]()['then'](cmHopper[_0x160e('0x150')](_['map'](_0x572e5c,'id'),previewRecallmeReminderInterval,_['map'](_0x17aa43,'id')))[_0x160e('0x42')](function(_0x107a46){for(var _0x17618c=0x0;_0x17618c<_0x107a46['length'];_0x17618c++){var _0x35603d=_0x107a46[_0x17618c][_0x160e('0x151')][_0x160e('0x4a')];if(_0x35603d)io['to'](util[_0x160e('0x49')](_0x160e('0x152'),_0x35603d))[_0x160e('0x44')](_0x160e('0x153'),{'hopper':_0x107a46[_0x17618c]});}})[_0x160e('0xa5')](function(_0x489add){logger[_0x160e('0x68')]('checkPreviewRecallReminder',_0x489add);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x160e('0x19')][_0x160e('0x40')]=function(){var _0x288d14=this;setInterval(function(){_0x288d14[_0x160e('0x154')](_0x288d14['uniqueId'],'[uniqueid]');_0x288d14[_0x160e('0x154')](_0x288d14[_0x160e('0x23')],_0x160e('0x155'));},0x32c8);};Dialer[_0x160e('0x19')]['clearZombieChannels']=function(_0x530230,_0x6dcd48){var _0x362485=this;for(var _0xd03e32 in _0x530230){if(typeof _0x530230[_0xd03e32]!=='undefined'){this[_0x160e('0x1c')]['enqueue'](function(){if(!_[_0x160e('0xff')](_0x530230[_0xd03e32])){return ami[_0x160e('0x9f')]({'action':_0x160e('0x8c'),'channel':_0x530230[_0xd03e32][_0x160e('0xf6')]})[_0x160e('0xa5')](function(_0x5f30be){if(_0x5f30be[_0x160e('0x6a')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x530230[_0xd03e32]&&_0x530230[_0xd03e32][_0x160e('0xc6')]!=='ivr'){utils[_0x160e('0xc8')](_0x362485[_0x160e('0x1e')][_0x530230[_0xd03e32][_0x160e('0xc4')]],'[clearZombieChannels]');logger[_0x160e('0x68')](_0x160e('0x156'),_0x6dcd48,_0xd03e32,_0x530230[_0xd03e32]['queue']);delete _0x530230[_0xd03e32];}if(_0x530230[_0xd03e32]&&_0x530230[_0xd03e32][_0x160e('0xc6')]==='ivr'){utils[_0x160e('0xc8')](_0x362485[_0x160e('0x1f')][_0x530230[_0xd03e32]['queue']],'[clearZombieChannels]');logger[_0x160e('0x68')](_0x160e('0x157'),_0x6dcd48,_0xd03e32,_0x530230[_0xd03e32]['queue']);delete _0x530230[_0xd03e32];}},0x2328);}});}});}}};Dialer['prototype'][_0x160e('0x158')]=function(_0x163f12){return Promise[_0x160e('0xb0')]()['then'](voiceQueueRt[_0x160e('0x158')](_0x163f12))[_0x160e('0xa5')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer['prototype'][_0x160e('0x159')]=function(_0x2a5856,_0x20baa6,_0x2f1d98){var _0x76e527={'state':0x19,'statedesc':'notFound'};utils[_0x160e('0xc8')](_0x20baa6,_0x160e('0x15a')+_0x2a5856);this[_0x160e('0x11d')](_[_0x160e('0x62')](_0x76e527,_[_0x160e('0x77')](_0x2f1d98,[_0x160e('0xe9'),_0x160e('0xea'),_0x160e('0x15b'),_0x160e('0xf4'),_0x160e('0xeb')])),_0x160e('0x15c'),_0x160e('0x15a'));logger[_0x160e('0x68')](_0x2a5856);};Dialer['prototype'][_0x160e('0x11d')]=function(_0x57e47e,_0x48c477,_0x51cb71){hopperUtils[_0x160e('0xd1')](_0x57e47e)[_0x160e('0xa5')](loggerCatch(_0x48c477));hopperUtils['moveContactManagedDialer'](_0x57e47e)[_0x160e('0xa5')](loggerCatch(_0x51cb71));};Dialer[_0x160e('0x19')][_0x160e('0xe4')]=function(_0x410341,_0x128573){hopperUtils[_0x160e('0xd1')](_0x410341)[_0x160e('0xa5')](loggerCatch(_0x160e('0xd2')));if(_0x128573==0x0){hopperUtils[_0x160e('0x135')](_0x410341)[_0x160e('0xa5')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));}};Dialer['prototype'][_0x160e('0x15d')]=function(_0x4b8972){return Promise['resolve']()['then'](cmHopper[_0x160e('0x150')](_0x4b8972['id'],previewRecallmeReminderInterval))['then'](function(_0x886c5e){for(var _0x245b97=0x0;_0x245b97<_0x886c5e[_0x160e('0x9d')];_0x245b97++){var _0x12dadc=_0x886c5e[_0x245b97]['Agent']['name'];if(_0x12dadc)io['to'](util[_0x160e('0x49')]('user:%s',_0x12dadc))[_0x160e('0x44')]('user:dialPreviewRecallReminder',{'hopper':_0x886c5e[_0x245b97]});}})[_0x160e('0xa5')](function(){});};Dialer[_0x160e('0x19')][_0x160e('0xb3')]=function(_0x469258){var _0x2498ca=this;return function(){_0x2498ca[_0x160e('0x15e')](_0x469258);};};Dialer[_0x160e('0x19')][_0x160e('0x15f')]=function(_0x1314bf,_0x228811){var _0x27870c=this;var _0x215e72=uuid['v4']();this[_0x160e('0x23')][_0x215e72]=new Action(_0x1314bf,_0x228811,_0x215e72);return new Promise(function(_0x2d3a54,_0x49ae58){if(_[_0x160e('0x57')](_0x1314bf)&&typeof _0x1314bf!==_0x160e('0x160')){return _0x49ae58(msgResponse(_0x160e('0x161'),_0x160e('0x95'),'voiceQueue\x20is\x20undefine'));}if(_[_0x160e('0x57')](_0x228811['phone'])||_0x228811['phone']===null){return _0x49ae58(msgResponse(_0x160e('0x161'),'Failure','contact\x20is\x20undefine'));}var _0x2a02f8={'XMD-CALLERID':_0x27870c[_0x160e('0x23')][_0x215e72][_0x160e('0x162')](),'XMD-AGI':_0x1314bf['dialQueueProject']?util[_0x160e('0x49')](_0x160e('0x163'),ipAgi,_0x1314bf[_0x160e('0x139')]):_0x160e('0x164'),'XMD-AGIAFTER':_0x1314bf['dialQueueProject2']?util[_0x160e('0x49')]('\x22agi://%s/square,%s\x22',ipAgi,_0x1314bf[_0x160e('0xcf')]):'NONE','XMD-QUEUE':utils[_0x160e('0x165')](_0x1314bf)?util['format'](_0x160e('0x166'),_0x1314bf['name'],_0x1314bf[_0x160e('0x167')]||'',_0x1314bf[_0x160e('0xd0')]?'c':'',_0x1314bf[_0x160e('0x168')]||0x3):_0x160e('0x164'),'XMD-CONTACTID':_0x228811[_0x160e('0xe9')],'XMD-CDRTYPE':_0x160e('0x7'),'CALLERID(all)':_0x27870c['actions'][_0x215e72]['getCaller'](),'XMD-AMD':_0x1314bf['dialAMDActive']?_0x160e('0x169'):_0x160e('0x164'),'XMD-DESTINATION':_0x160e('0x115')};if(_0x1314bf[_0x160e('0x120')]){_0x2a02f8[_0x160e('0x16a')]=_0x1314bf[_0x160e('0x16b')]||0x9c4;_0x2a02f8[_0x160e('0x16c')]=_0x1314bf[_0x160e('0x16d')]||0x5dc;_0x2a02f8[_0x160e('0x16e')]=_0x1314bf[_0x160e('0x16f')]||0x320;_0x2a02f8['XMD-AMDTOTALANALYSISTIME']=_0x1314bf[_0x160e('0x170')]||0x1388;_0x2a02f8[_0x160e('0x171')]=_0x1314bf[_0x160e('0x172')]||0x64;_0x2a02f8['XMD-AMDBETWEENWORDSSILENCE']=_0x1314bf['dialAMDBetweenWordsSilence']||0x32;_0x2a02f8[_0x160e('0x173')]=_0x1314bf['dialAMDMaximumNumberOfWords']||0x3;_0x2a02f8[_0x160e('0x174')]=_0x1314bf['dialAMDSilenceThreshold']||0x100;_0x2a02f8[_0x160e('0x175')]=_0x1314bf[_0x160e('0x176')]||0x1388;}if(utils[_0x160e('0x165')](_0x1314bf)){_0x2a02f8[_0x160e('0x177')]=_0x228811[_0x160e('0xf4')];}else{_0x2a02f8[_0x160e('0x178')]=_0x228811['CampaignId'];}var _0x40377a=utils[_0x160e('0x179')](_0x228811[_0x160e('0x17a')]);Object[_0x160e('0x14b')](_0x2a02f8,_0x40377a);var _0x121e25=_0x27870c['isTrunkReachable'](_0x1314bf[_0x160e('0x8f')])?utils[_0x160e('0x17b')](_0x1314bf['Trunk'][_0x160e('0x17c')],_0x1314bf['dialOriginateCallerIdName'],_0x1314bf['dialRandomLastDigitCallerIdNumber']>0x0?utils['getCallerIdRandom'](_0x1314bf['dialOriginateCallerIdNumber'],_0x1314bf[_0x160e('0x17d')]):_0x1314bf[_0x160e('0x17e')]):utils['getCallerId'](_[_0x160e('0xff')](_0x1314bf[_0x160e('0x90')])?_0x1314bf[_0x160e('0x8f')]['callerid']:_0x1314bf[_0x160e('0x90')][_0x160e('0x17c')],_0x1314bf[_0x160e('0x17f')],_0x1314bf[_0x160e('0x17d')]>0x0?utils['getCallerIdRandom'](_0x1314bf['dialOriginateCallerIdNumber'],_0x1314bf[_0x160e('0x17d')]):_0x1314bf[_0x160e('0x17e')]);if(_0x121e25){_0x2a02f8[_0x160e('0x180')]=_0x27870c['actions'][_0x215e72][_0x160e('0x181')]=utils[_0x160e('0x182')](_0x121e25);_0x2a02f8[_0x160e('0x183')]=_0x228811['phone'];}_0x1314bf[_0x160e('0x184')]=_0x2a02f8;return ami['Action']({'actionid':_0x215e72,'action':_0x160e('0x161'),'channel':_0x27870c[_0x160e('0x89')](_0x1314bf['Trunk'])?util[_0x160e('0x49')]('SIP/%s/%s%s',_0x1314bf[_0x160e('0x8f')]['name'],isNotNull(_0x1314bf[_0x160e('0x185')])?_0x1314bf[_0x160e('0x185')][_0x160e('0x186')]()||'':'',_0x1314bf[_0x160e('0x187')]>0x0?_0x228811[_0x160e('0x188')][_0x160e('0x189')](_0x1314bf[_0x160e('0x187')]):_0x228811[_0x160e('0x188')]):util[_0x160e('0x49')](_0x160e('0x18a'),_[_0x160e('0xff')](_0x1314bf[_0x160e('0x90')])?_0x1314bf[_0x160e('0x8f')][_0x160e('0x4a')]:_0x1314bf['TrunkBackup'][_0x160e('0x4a')],isNotNull(_0x1314bf[_0x160e('0x185')])?_0x1314bf[_0x160e('0x185')][_0x160e('0x186')]()||'':'',_0x1314bf[_0x160e('0x187')]>0x0?_0x228811[_0x160e('0x188')][_0x160e('0x189')](_0x1314bf[_0x160e('0x187')]):_0x228811[_0x160e('0x188')]),'callerid':_0x121e25,'Exten':_0x160e('0x115'),'Context':_0x160e('0x18b'),'Priority':'1','variable':_0x2a02f8,'timeout':(_0x1314bf['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x215e72})[_0x160e('0x42')](function(_0x2c2a64){return _0x2d3a54(_0x2c2a64);})['catch'](function(_0x364bfa){_0x1314bf['outboundOriginateFailureCallsDay']+=0x1;var _0x411329=new History(_0x27870c[_0x160e('0x23')][_0x215e72]);logger[_0x160e('0x68')](util[_0x160e('0x49')](_0x160e('0x18c'),JSON[_0x160e('0x76')](_0x364bfa)));_0x411329['state']=0xe;_0x411329[_0x160e('0x70')]=_0x160e('0x18d');_0x411329[_0x160e('0x72')]=moment()['format'](_0x160e('0xca'));_0x411329['endtime']=_0x411329[_0x160e('0x72')];hopperUtils[_0x160e('0xd1')](_0x411329)['catch'](loggerCatch('[originate][error]'));_0x27870c[_0x160e('0x135')](_0x411329)[_0x160e('0xa5')](loggerCatch(_0x160e('0x18e')))['finally'](function(){delete _0x27870c[_0x160e('0x23')][_0x215e72];return _0x49ae58(msgResponse(_0x160e('0x161'),_0x160e('0x88'),'originate\x20action\x20Error'));});});});};Dialer['prototype'][_0x160e('0x18f')]=function(_0x367c1f,_0x444190,_0x44295e){var _0x4949ea=new History(_0x444190);if(_0x4949ea[_0x160e('0x123')]+_0x4949ea['countcongestionretry']+_0x4949ea[_0x160e('0x125')]+_0x4949ea[_0x160e('0x126')]+_0x4949ea[_0x160e('0xdd')]+_0x4949ea[_0x160e('0xf3')]+_0x4949ea[_0x160e('0x127')]+_0x4949ea['countagentrejectretry']>=_0x44295e[_0x160e('0x130')]-0x1){return!![];}switch(_0x367c1f){case 0x3:if(_0x4949ea[_0x160e('0x125')]>=_0x44295e[_0x160e('0x190')]-0x1){return!![];}hopperUtils[_0x160e('0xe5')]({'active':![],'countnoanswerretry':_0x4949ea['countnoanswerretry']+=0x1,'scheduledat':moment()[_0x160e('0xe6')](_0x44295e[_0x160e('0x191')],_0x160e('0xe8'))['format'](_0x160e('0xca')),'ContactId':_0x4949ea[_0x160e('0xe9')],'ListId':_0x4949ea[_0x160e('0xea')],'VoiceQueueId':_0x4949ea[_0x160e('0xf4')]||undefined,'CampaignId':_0x4949ea[_0x160e('0xeb')]||undefined})[_0x160e('0xa5')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x4949ea[_0x160e('0x123')]>=_0x44295e[_0x160e('0x192')]-0x1){return!![];}hopperUtils[_0x160e('0xe5')]({'active':![],'countbusyretry':_0x4949ea[_0x160e('0x123')]+=0x1,'scheduledat':moment()['add'](_0x44295e[_0x160e('0x193')],_0x160e('0xe8'))[_0x160e('0x49')](_0x160e('0xca')),'ContactId':_0x4949ea[_0x160e('0xe9')],'ListId':_0x4949ea[_0x160e('0xea')],'VoiceQueueId':_0x4949ea['VoiceQueueId']||undefined,'CampaignId':_0x4949ea[_0x160e('0xeb')]||undefined})[_0x160e('0xa5')](loggerCatch(_0x160e('0x194')));break;case 0x8:if(_0x4949ea[_0x160e('0x124')]>=_0x44295e['dialCongestionMaxRetry']-0x1){return!![];}hopperUtils[_0x160e('0xe5')]({'active':![],'countcongestionretry':_0x4949ea[_0x160e('0x124')]+=0x1,'scheduledat':moment()['add'](_0x44295e[_0x160e('0x195')],_0x160e('0xe8'))[_0x160e('0x49')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4949ea[_0x160e('0xe9')],'ListId':_0x4949ea[_0x160e('0xea')],'VoiceQueueId':_0x4949ea[_0x160e('0xf4')]||undefined,'CampaignId':_0x4949ea[_0x160e('0xeb')]||undefined})[_0x160e('0xa5')](loggerCatch(_0x160e('0x196')));break;case 0x0:if(_0x4949ea['countnosuchnumberretry']>=_0x44295e[_0x160e('0x197')]-0x1){return!![];}else{hopperUtils['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x4949ea[_0x160e('0x126')]+=0x1,'scheduledat':moment()[_0x160e('0xe6')](_0x44295e[_0x160e('0x198')],'minutes')[_0x160e('0x49')](_0x160e('0xca')),'ContactId':_0x4949ea['ContactId'],'ListId':_0x4949ea[_0x160e('0xea')],'VoiceQueueId':_0x4949ea['VoiceQueueId']||undefined,'CampaignId':_0x4949ea[_0x160e('0xeb')]||undefined})[_0x160e('0xa5')](loggerCatch(_0x160e('0x199')));}break;case 0xa:if(_0x4949ea['countdropretry']>=_0x44295e[_0x160e('0xe3')]-0x1){return!![];}hopperUtils[_0x160e('0xe5')]({'active':![],'countdropretry':_0x4949ea[_0x160e('0xdd')]+=0x1,'scheduledat':moment()[_0x160e('0xe6')](_0x44295e[_0x160e('0xe7')],'minutes')[_0x160e('0x49')](_0x160e('0xca')),'ContactId':_0x4949ea['ContactId'],'ListId':_0x4949ea['ListId'],'VoiceQueueId':_0x4949ea[_0x160e('0xf4')]||undefined,'CampaignId':_0x4949ea['CampaignId']||undefined})[_0x160e('0xa5')](loggerCatch(_0x160e('0xec')));break;case 0xb:if(_0x4949ea[_0x160e('0xf3')]>=_0x44295e[_0x160e('0x19a')]-0x1){return!![];}hopperUtils[_0x160e('0xe5')]({'active':![],'countabandonedretry':_0x4949ea[_0x160e('0xf3')]+=0x1,'scheduledat':moment()[_0x160e('0xe6')](_0x44295e[_0x160e('0xf1')],'minutes')['format'](_0x160e('0xca')),'ContactId':_0x4949ea[_0x160e('0xe9')],'ListId':_0x4949ea['ListId'],'VoiceQueueId':_0x4949ea[_0x160e('0xf4')]||undefined,'CampaignId':_0x4949ea[_0x160e('0xeb')]||undefined})[_0x160e('0xa5')](loggerCatch(_0x160e('0xf5')));break;case 0x13:if(_0x4949ea[_0x160e('0x127')]>=_0x44295e[_0x160e('0x12a')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x4949ea[_0x160e('0x127')]+=0x1,'scheduledat':moment()[_0x160e('0xe6')](_0x44295e[_0x160e('0x12c')],_0x160e('0xe8'))[_0x160e('0x49')](_0x160e('0xca')),'ContactId':_0x4949ea[_0x160e('0xe9')],'ListId':_0x4949ea[_0x160e('0xea')],'VoiceQueueId':_0x4949ea[_0x160e('0xf4')]||undefined,'CampaignId':_0x4949ea[_0x160e('0xeb')]||undefined})[_0x160e('0xa5')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x4949ea['countagentrejectretry']>=_0x44295e['dialAgentRejectMaxRetry']-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countagentrejectretry':_0x4949ea[_0x160e('0x128')]+=0x1,'scheduledat':moment()['add'](_0x44295e['dialAgentRejectRetryFrequency'],'minutes')[_0x160e('0x49')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4949ea[_0x160e('0xe9')],'ListId':_0x4949ea[_0x160e('0xea')],'VoiceQueueId':_0x4949ea[_0x160e('0xf4')]||undefined,'CampaignId':_0x4949ea[_0x160e('0xeb')]||undefined})[_0x160e('0xa5')](loggerCatch(_0x160e('0x19b')));break;default:return!![];}};Dialer[_0x160e('0x19')][_0x160e('0x111')]=function(_0x24734a,_0x289d00,_0x5ba4af){var _0x203cbf=this;var _0x2becf0=new History(_0x24734a);var _0x3e10e7=![];var _0x21eb9e;var _0xaa4a38;return new Promise(function(_0x211161,_0x5b10c3){if(_[_0x160e('0x57')](_0x289d00)&&typeof _0x289d00!==_0x160e('0x160')){return _0x5b10c3(msgResponse(_0x160e('0x19c'),_0x160e('0x95'),'entity\x20is\x20undefine'));}if(_[_0x160e('0x57')](_0x5ba4af)&&typeof _0x5ba4af!=='object'){return _0x5b10c3(msgResponse(_0x160e('0x19c'),_0x160e('0x95'),_0x160e('0x19d')));}hopperUtils['verifyAdditionalPhones'](_0x2becf0,_0x5ba4af[_0x160e('0xcd')],_0x289d00)[_0x160e('0x42')](function(_0x3af37a){if(_0x3af37a[_0x160e('0xe2')]==0x1)_0x3e10e7=!![];switch(_0x5ba4af[_0x160e('0xcd')]){case'0':_0x289d00[_0x160e('0x19e')]+=0x1;_0x2becf0[_0x160e('0xe0')]=0x0;_0x2becf0[_0x160e('0x70')]=_0x160e('0x19f');_0x2becf0[_0x160e('0x126')]+=0x1;_0x2becf0[_0x160e('0xde')]+=0x1;ami[_0x160e('0x44')](_0x160e('0x1a0'),ut[_0x160e('0x12e')](_0x24734a,'nosuchnumber'));_0x21eb9e=_0x289d00[_0x160e('0x198')];_0xaa4a38=_0x289d00[_0x160e('0xf2')];hopperUtils[_0x160e('0xd1')](_0x2becf0)['catch'](loggerCatch(_0x160e('0x1a1')));if(_0x203cbf[_0x160e('0x18f')](0x0,_0x24734a,_0x289d00)&&!_0x3e10e7){if(_0x2becf0[_0x160e('0x126')]>=_0x289d00[_0x160e('0x197')]){_0x203cbf[_0x160e('0x12b')](_0x2becf0,_0x211161,_0x5b10c3,_0x160e('0x1a2'));}else{_0x203cbf[_0x160e('0x131')](_0x2becf0,_0x211161,_0x5b10c3,_0x160e('0x1a2'));}}break;case'3':_0x289d00[_0x160e('0x1a3')]+=0x1;_0x2becf0[_0x160e('0xe0')]=0x3;_0x2becf0['statedesc']='NoAnswer';_0x2becf0[_0x160e('0x125')]+=0x1;_0x2becf0[_0x160e('0xde')]+=0x1;var _0x4ee41a=ut[_0x160e('0x1a4')](_0x24734a,_0x289d00);ami['emit'](_0x160e('0x1a5'),_0x4ee41a);_0x21eb9e=_0x289d00[_0x160e('0x191')];_0xaa4a38=_0x289d00[_0x160e('0xf2')];hopperUtils[_0x160e('0xd1')](_0x2becf0)['catch'](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x203cbf[_0x160e('0x18f')](0x3,_0x24734a,_0x289d00)&&!_0x3e10e7){if(_0x2becf0[_0x160e('0x125')]>=_0x289d00[_0x160e('0x190')]){_0x203cbf[_0x160e('0x12b')](_0x2becf0,_0x211161,_0x5b10c3,_0x160e('0x1a6'));}else{_0x203cbf[_0x160e('0x131')](_0x2becf0,_0x211161,_0x5b10c3,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x289d00[_0x160e('0x1a7')]+=0x1;_0x2becf0[_0x160e('0xe0')]=0x5;_0x2becf0['statedesc']=_0x160e('0x1a8');_0x2becf0[_0x160e('0x123')]+=0x1;_0x2becf0[_0x160e('0xde')]+=0x1;ami[_0x160e('0x44')](_0x160e('0x1a9'),ut['buildObj'](_0x24734a,'busy'));_0x21eb9e=_0x289d00[_0x160e('0x193')];_0xaa4a38=_0x289d00[_0x160e('0xf2')];hopperUtils[_0x160e('0xd1')](_0x2becf0)[_0x160e('0xa5')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x203cbf['checkRetriveMax'](0x5,_0x24734a,_0x289d00)&&!_0x3e10e7){if(_0x2becf0[_0x160e('0x123')]>=_0x289d00[_0x160e('0x192')]){_0x203cbf[_0x160e('0x12b')](_0x2becf0,_0x211161,_0x5b10c3,_0x160e('0x1aa'));}else{_0x203cbf[_0x160e('0x131')](_0x2becf0,_0x211161,_0x5b10c3,'reason\x205\x20busy');}}break;case'8':_0x289d00[_0x160e('0x1ab')]+=0x1;_0x2becf0[_0x160e('0xe0')]=0x8;_0x2becf0['statedesc']='Congestion';_0x2becf0[_0x160e('0x124')]+=0x1;_0x2becf0[_0x160e('0xde')]+=0x1;_0x21eb9e=_0x289d00['dialCongestionRetryFrequency'];_0xaa4a38=_0x289d00['callAdditionalPhoneAfterMin'];ami[_0x160e('0x44')](_0x160e('0x1ac'),ut[_0x160e('0x12e')](_0x24734a,_0x160e('0x1ad')));hopperUtils[_0x160e('0xd1')](_0x2becf0)[_0x160e('0xa5')](loggerCatch(_0x160e('0x1ae')));if(_0x203cbf['checkRetriveMax'](0x8,_0x24734a,_0x289d00)&&!_0x3e10e7){if(_0x2becf0[_0x160e('0x124')]>=_0x289d00[_0x160e('0x1af')]){_0x203cbf[_0x160e('0x12b')](_0x2becf0,_0x211161,_0x5b10c3,_0x160e('0x1b0'));}else{_0x203cbf['stateGlobal'](_0x2becf0,_0x211161,_0x5b10c3,_0x160e('0x1b0'));}}break;case'11':_0x289d00[_0x160e('0x1b1')]+=0x1;_0x2becf0[_0x160e('0xe0')]=0xb;_0x2becf0[_0x160e('0x70')]=_0x160e('0xef');_0x2becf0[_0x160e('0xf3')]+=0x1;_0x2becf0['countglobal']+=0x1;_0x21eb9e=_0x289d00[_0x160e('0xf1')];_0xaa4a38=_0x289d00[_0x160e('0xf2')];hopperUtils[_0x160e('0xd1')](_0x2becf0)['catch'](loggerCatch(_0x160e('0x1b2')));if(_0x203cbf[_0x160e('0x18f')](0xb,_0x24734a,_0x289d00)&&!_0x3e10e7){if(_0x2becf0[_0x160e('0xf3')]>=_0x289d00[_0x160e('0x19a')]){_0x203cbf[_0x160e('0x12b')](_0x2becf0,_0x211161,_0x5b10c3,_0x160e('0x1b3'));}else{_0x203cbf[_0x160e('0x131')](_0x2becf0,_0x211161,_0x5b10c3,_0x160e('0x1b3'));}}break;case'20':_0x289d00['outboundRejectCallsDay']+=0x1;_0x2becf0['state']=0x14;_0x2becf0['statedesc']='AgentReject';_0x2becf0[_0x160e('0x128')]+=0x1;_0x2becf0[_0x160e('0xde')]+=0x1;_0x21eb9e=_0x289d00[_0x160e('0x1b4')];_0xaa4a38=_0x289d00[_0x160e('0xf2')];ami[_0x160e('0x44')](_0x160e('0x1b5'),ut[_0x160e('0x12e')](_0x24734a,_0x160e('0x1b6')));hopperUtils[_0x160e('0xd1')](_0x2becf0)[_0x160e('0xa5')](loggerCatch(_0x160e('0x1b7')));if(_0x203cbf[_0x160e('0x18f')](0x14,_0x24734a,_0x289d00)&&!_0x3e10e7){if(_0x2becf0['countagentrejectretry']>=_0x289d00[_0x160e('0x1b8')]){_0x203cbf['createStateFinal'](_0x2becf0,_0x211161,_0x5b10c3,_0x160e('0x1b9'));}else{_0x203cbf[_0x160e('0x131')](_0x2becf0,_0x211161,_0x5b10c3,_0x160e('0x1b9'));}}break;default:_0x289d00[_0x160e('0x13e')]+=0x1;_0x2becf0[_0x160e('0xe0')]=0xc;_0x2becf0[_0x160e('0x70')]=_0x5ba4af[_0x160e('0xcd')];_0x21eb9e=_0x289d00[_0x160e('0x1b4')];_0xaa4a38=_0x289d00['callAdditionalPhoneAfterMin'];hopperUtils[_0x160e('0xd1')](_0x2becf0)[_0x160e('0xa5')](loggerCatch(_0x160e('0x1ba')));if(_0x203cbf[_0x160e('0x18f')](_0x5ba4af[_0x160e('0xcd')],_0x24734a,_0x289d00)&&!_0x3e10e7){if(_0x2becf0['countbusyretry']+_0x2becf0[_0x160e('0x124')]+_0x2becf0['countnoanswerretry']+_0x2becf0['countnosuchnumberretry']+_0x2becf0[_0x160e('0xdd')]+_0x2becf0[_0x160e('0xf3')]+_0x2becf0[_0x160e('0x127')]+_0x2becf0['countagentrejectretry']>=_0x289d00[_0x160e('0x130')]){_0x203cbf[_0x160e('0x131')](_0x2becf0,_0x211161,_0x5b10c3,_0x5ba4af[_0x160e('0xcd')]);}else{_0x203cbf[_0x160e('0x12b')](_0x2becf0,_0x211161,_0x5b10c3,_0x5ba4af[_0x160e('0xcd')]);}}}})[_0x160e('0x42')](function(){if(_0x3e10e7){hopperUtils['swapAdditionalPhones'](_0x2becf0,_0x21eb9e,_0xaa4a38)[_0x160e('0x42')](function(){return _0x211161(0x1);});}});});};Dialer['prototype'][_0x160e('0x131')]=function(_0x17b2c3,_0x1906d8,_0x21ea0f,_0x42637e){var _0x23c05d=new Final(_0x17b2c3);_0x23c05d[_0x160e('0xe0')]=0xf;_0x23c05d['statedesc']=_0x160e('0x1bb');this[_0x160e('0x12b')](_0x23c05d,_0x1906d8,_0x21ea0f,_0x42637e);};Dialer[_0x160e('0x19')][_0x160e('0x12b')]=function(_0x28feb3,_0x206b43,_0x2a2491,_0x1f194d){hopperUtils[_0x160e('0x135')](_0x28feb3)[_0x160e('0x42')](function(){return _0x206b43(msgResponse('[callProgressDetecting]',_0x160e('0x1bc'),_0x1f194d));})[_0x160e('0xa5')](function(){return _0x2a2491(msgResponse(_0x160e('0x1bd'),_0x160e('0x95'),_0x160e('0x1be')));});};Dialer[_0x160e('0x19')]['predictive']=function(_0x345e93){var _0x2623cc=_0x345e93['dialPredictiveOptimizationPercentage']/0x64;var _0x31222f=_0x345e93[_0x160e('0xd8')]/(_0x345e93[_0x160e('0xd8')]+_0x345e93[_0x160e('0xcc')]);var _0x202de3=Math[_0x160e('0x1bf')](_0x345e93[_0x160e('0x1c0')]*(_0x345e93['predictiveIntervalMaxThreshold']/0x64));var _0x2afaae=Math[_0x160e('0x1bf')](_0x345e93['predictiveIntervalAvailable']*(_0x345e93[_0x160e('0x1c1')]/0x64));var _0x328314=_0x345e93[_0x160e('0x144')]+_0x345e93[_0x160e('0x146')];var _0x4dedf6=Math[_0x160e('0x1c2')](_0x345e93['erlangCalls']*_0x345e93[_0x160e('0x5d')]*_0x345e93[_0x160e('0x1c3')]*_0x345e93[_0x160e('0x1c4')]);if(_[_0x160e('0x57')](_0x345e93[_0x160e('0x28')])){if(!_['isUndefined'](_0x345e93['startPredictive'])){_0x345e93[_0x160e('0x27')]=undefined;loggerPredictive['error']('[startMethodPredictive][StartProgressive]',_0x160e('0x1c5'));}if(!_['isUndefined'](_0x345e93[_0x160e('0x66')])){loggerPredictive[_0x160e('0x68')](_0x160e('0x1c6'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x345e93[_0x160e('0x66')]);_0x345e93[_0x160e('0x66')]=undefined;}_0x345e93[_0x160e('0x28')]=moment()['format'](_0x160e('0xca'));loggerPredictive[_0x160e('0x4c')](_0x345e93[_0x160e('0x4a')],_0x160e('0x1c7'),_0x345e93['startProgressive']);this[_0x160e('0xb8')](_0x345e93,0x1);}else if(ifInterval(_0x345e93[_0x160e('0x1c8')],_0x345e93[_0x160e('0x28')])){this['handlePower'](_0x345e93,0x1);loggerPredictiveCalls[_0x160e('0x4c')]('[startMethodPredictive][StartProgressive][Loop]',_0x345e93[_0x160e('0x28')],_0x345e93['name']);_0x345e93[_0x160e('0x5b')]=0x0;_0x345e93['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x2623cc<_0x31222f&&_0x345e93[_0x160e('0x1c9')]===_0x160e('0x1ca')){clearPredictiveAttributes(_0x345e93);loggerPredictive[_0x160e('0x4c')](_0x160e('0x1cb'),_0x160e('0x1cc'),_0x31222f,_0x160e('0x28'),_0x345e93[_0x160e('0x4a')]);}else if(_0x4dedf6<_0x345e93['predictiveIntervalErlangCallsDroppedCalls']&&_0x345e93[_0x160e('0x1c9')]===_0x160e('0x1ca')){clearPredictiveAttributes(_0x345e93);loggerPredictive[_0x160e('0x4c')](_0x160e('0x1cd'),_0x160e('0x1ce'),_0x4dedf6,_0x160e('0x1cf'),_0x345e93[_0x160e('0xd9')],_0x160e('0x28'),_0x345e93['name']);}else if(!ifInterval(_0x345e93[_0x160e('0x1c8')],_0x345e93[_0x160e('0x28')])&&_[_0x160e('0x57')](_0x345e93['startPredictive'])&&!_[_0x160e('0x57')](_0x345e93['startProgressive'])){_0x345e93['startPredictive']=moment()['format'](_0x160e('0xca'));loggerPredictive[_0x160e('0x4c')](_0x345e93['name'],_0x160e('0x1d0'),_0x345e93[_0x160e('0x27')]);hopperUtils[_0x160e('0x1d1')](_0x345e93[_0x160e('0x1c8')])[_0x160e('0x42')](this[_0x160e('0x1d2')](_0x345e93))[_0x160e('0x42')](mergeDataErlangB(_0x345e93))[_0x160e('0x42')](this['startMethodPredictive'](_0x345e93))[_0x160e('0xa5')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x345e93));}else if(!ifInterval(_0x345e93[_0x160e('0x1c8')],_0x345e93[_0x160e('0x27')])){_0x345e93['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x345e93[_0x160e('0x27')]=moment()[_0x160e('0x49')](_0x160e('0xca'));loggerPredictive[_0x160e('0x4c')](_0x345e93[_0x160e('0x4a')],_0x160e('0x1d3'),_0x345e93[_0x160e('0x27')]);clearInterval(_0x345e93['handlePredictive']);_0x345e93['handlePredictive']=undefined;hopperUtils[_0x160e('0x1d1')](_0x345e93[_0x160e('0x1c8')])[_0x160e('0x42')](this[_0x160e('0x1d2')](_0x345e93))['then'](mergeDataErlangB(_0x345e93))[_0x160e('0x42')](this[_0x160e('0x1d4')](_0x345e93))[_0x160e('0xa5')](loggerCatchPredictive(_0x160e('0x1d5'),_0x345e93));}else if(_0x345e93[_0x160e('0x1c0')]&&_0x328314<_0x345e93['predictiveIntervalAvailable']-_0x2afaae){clearPredictiveAttributes(_0x345e93);loggerPredictive[_0x160e('0x4c')](_0x345e93[_0x160e('0x4a')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x328314,_0x160e('0x1d6'),_0x345e93[_0x160e('0x1c0')],'-',_0x2afaae,'=',_0x345e93[_0x160e('0x1c0')]-_0x2afaae,')');}else if(_0x345e93[_0x160e('0x1c0')]&&_0x328314>_0x345e93[_0x160e('0x1c0')]+_0x202de3){clearPredictiveAttributes(_0x345e93);loggerPredictive[_0x160e('0x4c')](_0x345e93[_0x160e('0x4a')],_0x160e('0x1d7'),_0x328314,_0x160e('0x1d8'),_0x345e93[_0x160e('0x1c0')],'+',_0x202de3,'=',_0x345e93[_0x160e('0x1c0')]+_0x202de3,')');}};Dialer[_0x160e('0x19')][_0x160e('0x1d2')]=function(_0x573ff1){var _0x4b8fac=this;return function(_0x573bd6){return new Promise(function(_0x368bde,_0x27bfcd){_[_0x160e('0x62')](_0x573ff1,_0x573bd6[0x0]);if(checkGetDataPredictive(_0x573bd6[0x0])){var _0x3ef7f5=_0x573ff1['predictiveIntervalAvailable']=_0x573ff1['talking']+_0x573ff1[_0x160e('0x144')];var _0x31d24c=_0x573ff1['dialPredictiveInterval']*0x3c;var _0x373844=_0x573bd6[0x0][_0x160e('0x55')]+_0x573bd6[0x0][_0x160e('0x53')];var _0x5ba03d=(_0x573bd6[0x0][_0x160e('0x4e')]+_0x573bd6[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x573bd6[0x0][_0x160e('0x52')])/_0x573bd6[0x0][_0x160e('0x56')];_0x573ff1['predictiveIntervalHitRate']=_0x5ba03d>0x0?_0x5ba03d:0x1;switch(_0x573ff1['dialPredictiveOptimization']){case _0x160e('0x1ca'):var _0x194b0a=_0x573ff1[_0x160e('0x1d9')]/0x64;return _0x4b8fac[_0x160e('0x1da')](_0x3ef7f5,_0x31d24c,_0x373844,_0x5ba03d,_0x194b0a)[_0x160e('0x42')](function(_0x8c956e){return _0x368bde(_0x8c956e);});case'agentBusyFactor':var _0x3c621b=_0x573ff1['dialPredictiveOptimizationPercentage']/0x64;return _0x4b8fac[_0x160e('0x1db')](_0x3ef7f5,_0x31d24c,_0x373844,_0x5ba03d,_0x3c621b)[_0x160e('0x42')](function(_0x11c82a){return _0x368bde(_0x11c82a);});default:return _0x27bfcd(msgResponse('[getDataPredictive]',_0x160e('0x95'),_0x160e('0x1dc')));}}else{return _0x27bfcd(msgResponse(_0x160e('0x1dd'),_0x160e('0x95'),_0x160e('0x1de')));}});};};Dialer[_0x160e('0x19')][_0x160e('0x1df')]=function(_0x1bd34c){var _0x1873d4=this;return function(_0x2af1de){return new Promise(function(_0x271f76,_0x44765b){_[_0x160e('0x62')](_0x1bd34c,_0x2af1de[0x0]);if(checkGetDataPredictive(_0x2af1de[0x0])){loggerPredictive[_0x160e('0x4c')](JSON[_0x160e('0x76')](_0x2af1de[0x0]));if(_0x1bd34c[_0x160e('0x1c9')]===_0x160e('0x1ca')){return _0x1873d4['getVoiceQueueRtPauses'](_0x1bd34c['id'])[_0x160e('0x42')](function(_0x5288a4){var _0x5880cc=_0x1bd34c[_0x160e('0x1e0')]-_0x5288a4[0x0][_0x160e('0x1e1')];var _0xf6b9f7=_0x1bd34c[_0x160e('0x1c8')]*0x3c;var _0x1e481b=_0x2af1de[0x0][_0x160e('0x55')]+_0x2af1de[0x0][_0x160e('0x53')];var _0x5ecf02=(_0x2af1de[0x0][_0x160e('0x4e')]+_0x2af1de[0x0][_0x160e('0x50')]+_0x2af1de[0x0][_0x160e('0x52')])/_0x2af1de[0x0][_0x160e('0x56')];var _0x3fc6ae=_0x1bd34c[_0x160e('0x1d9')]/0x64;_0x1bd34c[_0x160e('0x1e2')]=_0x5288a4[0x0][_0x160e('0x1e1')]||0x0;_0x1bd34c[_0x160e('0x1c3')]=_0x5ecf02>0x0?_0x5ecf02:0x1;return _0x1873d4[_0x160e('0x1da')](_0x5880cc,_0xf6b9f7,_0x1e481b,_0x5ecf02,_0x3fc6ae);})[_0x160e('0x42')](function(_0x50abe6){return _0x271f76(_0x50abe6);})[_0x160e('0xa5')](function(_0x919b07){return _0x44765b(msgResponse(_0x160e('0x1e3'),_0x160e('0x95'),JSON[_0x160e('0x76')](_0x919b07)));});}if(_0x1bd34c['dialPredictiveOptimization']===_0x160e('0x1e4')){return _0x1873d4[_0x160e('0x158')](_0x1bd34c['id'])[_0x160e('0x42')](function(_0x6b7c0){var _0x29b44e=_0x1bd34c[_0x160e('0x1e0')]-_0x6b7c0[0x0][_0x160e('0x1e1')];var _0x273223=_0x1bd34c[_0x160e('0x1c8')]*0x3c;var _0x4538e8=_0x2af1de[0x0][_0x160e('0x55')]+_0x2af1de[0x0][_0x160e('0x53')];var _0x138dfe=(_0x2af1de[0x0][_0x160e('0x4e')]+_0x2af1de[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x2af1de[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x2af1de[0x0][_0x160e('0x56')];var _0xb5b914=_0x1bd34c['dialPredictiveOptimizationPercentage']/0x64;_0x1bd34c[_0x160e('0x1e2')]=_0x6b7c0[0x0]['outboundQueuePauses']||0x0;_0x1bd34c[_0x160e('0x1c3')]=_0x138dfe>0x0?_0x138dfe:0x1;return _0x1873d4[_0x160e('0x1db')](_0x29b44e,_0x273223,_0x4538e8,_0x138dfe,_0xb5b914);})['then'](function(_0x54df31){return _0x271f76(_0x54df31);})[_0x160e('0xa5')](function(_0x117c81){return _0x44765b(msgResponse(_0x160e('0x1e3'),_0x160e('0x95'),JSON[_0x160e('0x76')](_0x117c81)));});}}else{return _0x44765b(msgResponse(_0x160e('0x1dd'),_0x160e('0x95'),_0x160e('0x1de')));}});};};Dialer[_0x160e('0x19')][_0x160e('0x1d4')]=function(_0x4da60a){var _0x5b9a4f=this;return function(){var _0x499594=0x0;var _0x38f902=Math[_0x160e('0x1c2')](_0x4da60a[_0x160e('0x5c')]*0x3e8);if(_0x38f902>0x0){_0x38f902=_0x38f902<0x64?0x64:_0x38f902;loggerPredictive['info'](_0x4da60a['name'],'one\x20call\x20every:',_0x38f902,_0x160e('0x1e5'));_0x4da60a['handlePredictive']=setInterval(function(){_0x5b9a4f[_0x160e('0x66')](_0x4da60a);loggerPredictiveCalls[_0x160e('0x4c')](_0x160e('0x1e6'),_0x499594+=0x1);},_0x38f902);}else{loggerPredictive[_0x160e('0x4c')](_0x4da60a[_0x160e('0x4a')],_0x160e('0x1e7'));}};};Dialer[_0x160e('0x19')][_0x160e('0x1e8')]=function(_0x28ae7e,_0x1eb9d8){var _0x36b74e=this;return function(_0x21b800){if(_[_0x160e('0x7c')](_0x21b800)){if(_[_0x160e('0xff')](_0x1eb9d8['UserId'])||!_0x1eb9d8['recallme']){if(_0x28ae7e[_0x160e('0xb6')]==='booked'){_0x28ae7e['queueStatusComplete']=_[_0x160e('0x57')](_0x28ae7e[_0x160e('0x73')])?!![]:_0x28ae7e['queueStatusComplete'];var _0xe82573=uuid['v4']();_0x36b74e[_0x160e('0x23')][_0xe82573]=new Action(_0x28ae7e,_0x1eb9d8,_0xe82573);loggerBooked['info'](_0x160e('0x1e9'),_0xe82573,_0x160e('0x1ea'),JSON['stringify'](_0x28ae7e['queueStatusComplete']),_0x160e('0x1eb'),_0x28ae7e[_0x160e('0x4a')]);if(_0x28ae7e[_0x160e('0x73')]){_0x28ae7e[_0x160e('0x73')]=![];_0x36b74e[_0x160e('0x2a')][_0x36b74e[_0x160e('0x23')][_0xe82573][_0x160e('0xc4')]]=[];ami[_0x160e('0x9f')]({'actionid':_0xe82573,'action':_0x160e('0x1ec'),'queue':_0x28ae7e[_0x160e('0x4a')]})[_0x160e('0xa5')](function(){utils['decrementOriginate'](_0x28ae7e,_0x160e('0x1ed'));hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x36b74e[_0x160e('0x23')][_0xe82573]['ContactId'],'ListId':_0x36b74e[_0x160e('0x23')][_0xe82573]['ListId'],'VoiceQueueId':_0x36b74e[_0x160e('0x23')][_0xe82573][_0x160e('0xf4')]||undefined,'CampaignId':_0x36b74e[_0x160e('0x23')][_0xe82573][_0x160e('0xeb')]||undefined})[_0x160e('0xa5')](loggerCatch(_0x160e('0x1ee')));delete _0x36b74e[_0x160e('0x23')][_0xe82573];});}else{loggerBooked['info']('[booked][checkContactBlack][else]',JSON['stringify'](_0x28ae7e[_0x160e('0x73')]),'Queue:\x20',_0x28ae7e[_0x160e('0x4a')]);utils[_0x160e('0xc8')](_0x28ae7e,_0x160e('0x1ed'));hopperUtils[_0x160e('0xe5')]({'active':![],'ContactId':_0x36b74e['actions'][_0xe82573][_0x160e('0xe9')],'ListId':_0x36b74e[_0x160e('0x23')][_0xe82573][_0x160e('0xea')],'VoiceQueueId':_0x36b74e[_0x160e('0x23')][_0xe82573][_0x160e('0xf4')]||undefined,'CampaignId':_0x36b74e[_0x160e('0x23')][_0xe82573][_0x160e('0xeb')]||undefined})[_0x160e('0xa5')](loggerCatch(_0x160e('0x1ee')));delete _0x36b74e[_0x160e('0x23')][_0xe82573];}}else{return _0x36b74e[_0x160e('0x15f')](_0x28ae7e,_0x1eb9d8);}}else{if(utils[_0x160e('0x63')](undefined,_0x1eb9d8[_0x160e('0x1ef')])<_0x28ae7e[_0x160e('0x1f0')]*0x3c){if(_0x1eb9d8[_0x160e('0x151')]&&!_0x1eb9d8[_0x160e('0x151')]['voicePause']){_0x36b74e[_0x160e('0x1d')][_0x160e('0x101')](_0x1eb9d8['id'])[_0x160e('0x102')](function(){utils[_0x160e('0xc8')](_0x28ae7e,'[checkContactBlack]');});}else{hopperUtils['unlockContact']({'active':![]},_0x1eb9d8['id'],0x1)[_0x160e('0x102')](function(){utils['decrementOriginate'](_0x28ae7e,_0x160e('0x1ed'));});}}else{_0x28ae7e[_0x160e('0x1f1')]+=0x1;utils[_0x160e('0xc8')](_0x28ae7e,_0x160e('0x1ed'));if(_0x28ae7e[_0x160e('0x1f2')]){hopperUtils['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x1eb9d8[_0x160e('0xe9')],'ListId':_0x1eb9d8[_0x160e('0xea')],'VoiceQueueId':_0x1eb9d8['VoiceQueueId']||undefined,'CampaignId':_0x1eb9d8[_0x160e('0xeb')]||undefined})[_0x160e('0xa5')](loggerCatch(_0x160e('0x1f3')));hopperUtils['createHistory'](createObjHistory(_0x28ae7e,_0x1eb9d8,utils[_0x160e('0x6b')][_0x160e('0x1f4')],0x17,_0x160e('0x1f5')))['catch'](loggerCatch(_0x160e('0x1f6')));}else{_0x36b74e[_0x160e('0x11d')](createObjHistory(_0x28ae7e,_0x1eb9d8,utils[_0x160e('0x6b')]['RECALL_TIMEOUT'],0x16,_0x160e('0x1f7')),_0x160e('0x1f8'),_0x160e('0x1f9'));}}}}else{_0x28ae7e['outboundBlacklistCallsDay']+=0x1;_0x36b74e['saveInDb'](createObjHistory(_0x28ae7e,_0x1eb9d8,utils['CAMPAIGN_STATUS'][_0x160e('0x1fa')],0xd,_0x160e('0x1fb')),'[Originate][historyBlacklist]','[Originate][MoveBlacklist]');throw _0x160e('0x1fc');}};};Dialer[_0x160e('0x19')][_0x160e('0x15e')]=function(_0x5dd2ed){var _0x1e81df=this;var _0x311cbe=_0x5dd2ed[_0x160e('0x1fd')]-_0x5dd2ed[_0x160e('0x83')];emitCampaignSummary(_0x5dd2ed);if(_0x311cbe>0x0&&_0x5dd2ed[_0x160e('0x1fe')]==0x0){if(_0x311cbe>this[_0x160e('0x22')]){_0x311cbe=this[_0x160e('0x22')];}_0x5dd2ed[_0x160e('0x1fe')]=0x1;hopperUtils[_0x160e('0x1ff')](_0x5dd2ed,_0x311cbe)[_0x160e('0x42')](function(_0x494654){_0x5dd2ed[_0x160e('0x1fe')]=0x0;if(_0x494654){if(!utils[_0x160e('0x200')](_0x494654)){_0x5dd2ed[_0x160e('0x6a')]=utils[_0x160e('0x6b')]['NO_AVAILABLE_CONTACTS'];logger[_0x160e('0x4c')]('[getContactCampaign2][Empty]'+_0x5dd2ed[_0x160e('0x4a')]);}else{_0x5dd2ed['originated']+=_0x494654[_0x160e('0x9d')];_0x5dd2ed['message']=utils['CAMPAIGN_STATUS'][_0x160e('0x201')];for(var _0x36ea3b=0x0;_0x36ea3b<_0x494654[_0x160e('0x9d')];_0x36ea3b+=0x1){_0x5dd2ed[_0x160e('0x202')]+=0x1;if(_['isNil'](_0x494654[_0x36ea3b])||_[_0x160e('0xff')](_0x494654[_0x36ea3b][_0x160e('0x17a')])||_[_0x160e('0xff')](_0x494654[_0x36ea3b][_0x160e('0x188')])){_0x1e81df[_0x160e('0x159')](_0x160e('0x203'),_0x5dd2ed,_0x494654[_0x36ea3b]);}else{hopperUtils[_0x160e('0x204')](_[_0x160e('0x77')](_0x494654[_0x36ea3b],['CampaignId',_0x160e('0x188')]))[_0x160e('0x42')](_0x1e81df[_0x160e('0x1e8')](_0x5dd2ed,_0x494654[_0x36ea3b]))[_0x160e('0xa5')](function(_0x8a0790){logger[_0x160e('0x68')](_0x160e('0x205'),_0x8a0790);utils[_0x160e('0xc8')](_0x5dd2ed,_0x160e('0x206'));});}}}}})[_0x160e('0xa5')](function(_0x5698ee){_0x5dd2ed[_0x160e('0x1fe')]=0x0;logger['error']('[getContactCampaign2]',_0x5698ee);});}};Dialer[_0x160e('0x19')][_0x160e('0xb8')]=function(_0x2bc361,_0x78aa85){var _0x3ae054=this;var _0x44916a=[];if(_0x78aa85<0x1||_0x2bc361['dialMethod']===_0x160e('0x9')){_0x78aa85=0x1;}var _0x566ac6=Math[_0x160e('0x1c2')](_0x2bc361[_0x160e('0x144')]*_0x78aa85)-_0x2bc361[_0x160e('0x83')];if(_0x2bc361[_0x160e('0x207')]>0x0){var _0x504c7a=_0x2bc361[_0x160e('0x207')]-_0x2bc361[_0x160e('0x83')]-_0x2bc361[_0x160e('0x146')]-_0x2bc361[_0x160e('0x147')];if(_0x566ac6>_0x504c7a){_0x566ac6=_0x504c7a;}}if(_0x566ac6>0x0&&_0x2bc361[_0x160e('0x1fe')]==0x0){if(_0x2bc361['dialMethod']===_0x160e('0x9')){_0x566ac6=0x1;}if(_0x566ac6>this[_0x160e('0x22')]){_0x566ac6=this[_0x160e('0x22')];}for(var _0x60bd32 in this[_0x160e('0x20')]){if(typeof this[_0x160e('0x20')][_0x60bd32]!==_0x160e('0xae')){if(this[_0x160e('0x20')][_0x60bd32][_0x160e('0xe0')]==='not_inuse'&&this[_0x160e('0x20')][_0x60bd32][_0x160e('0x8c')]===_0x160e('0x14f')){_0x44916a[_0x160e('0x9e')](this['agents'][_0x60bd32]['id']);}}}_0x2bc361['temp']=0x1;hopperUtils[_0x160e('0x208')](_0x2bc361,_0x44916a,_0x566ac6)[_0x160e('0x42')](function(_0x48c4c9){_0x2bc361[_0x160e('0x1fe')]=0x0;if(_0x48c4c9){if(!utils['checkContactEmpty'](_0x48c4c9)){hopperUtils[_0x160e('0x209')](_0x2bc361)[_0x160e('0x42')](sendMessageReschedule(_0x2bc361))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x2bc361[_0x160e('0x83')]+=_0x48c4c9[_0x160e('0x9d')];_0x2bc361['message']=_0x2bc361[_0x160e('0xb6')]==='booked'?utils['CAMPAIGN_STATUS'][_0x160e('0x169')]:utils['CAMPAIGN_STATUS'][_0x160e('0x201')];for(var _0x4caf94=0x0;_0x4caf94<_0x48c4c9['length'];_0x4caf94+=0x1){if(_[_0x160e('0xff')](_0x48c4c9[_0x4caf94])||_['isNil'](_0x48c4c9[_0x4caf94][_0x160e('0x17a')])||_[_0x160e('0xff')](_0x48c4c9[_0x4caf94]['phone'])){_0x3ae054['emptyContact'](_0x160e('0x203'),_0x2bc361,_0x48c4c9[_0x4caf94]);}else{hopperUtils[_0x160e('0x20a')](_[_0x160e('0x77')](_0x48c4c9[_0x4caf94],[_0x160e('0xf4'),_0x160e('0x188')]))[_0x160e('0x42')](_0x3ae054[_0x160e('0x1e8')](_0x2bc361,_0x48c4c9[_0x4caf94]))[_0x160e('0xa5')](function(_0x44215b){logger[_0x160e('0x68')](_0x160e('0x20b'),_0x44215b);utils[_0x160e('0xc8')](_0x2bc361,_0x160e('0x20c'));});}}}}})[_0x160e('0xa5')](function(_0x90752f){_0x2bc361[_0x160e('0x1fe')]=0x0;logger[_0x160e('0x68')](_0x160e('0x20d'),_0x90752f);});}};Dialer['prototype'][_0x160e('0x66')]=function(_0x26db52){if(_0x26db52['dialLimitQueue']>0x0){var _0x560343=_0x26db52[_0x160e('0x207')]-_0x26db52[_0x160e('0x83')]-_0x26db52[_0x160e('0x146')];if(_0x560343>0x0&&_0x26db52['temp']==0x0){this[_0x160e('0x20e')](_0x26db52);}else{loggerPredictiveCalls[_0x160e('0x4c')]('[handlePredictive][limitChannel]');}}else{this[_0x160e('0x20e')](_0x26db52);}};Dialer[_0x160e('0x19')][_0x160e('0x20e')]=function(_0x5b806a){var _0x1c747b=this;var _0x220a30=[];_0x5b806a[_0x160e('0x83')]+=0x1;for(var _0x5ca9ad in this[_0x160e('0x20')]){if(typeof this[_0x160e('0x20')][_0x5ca9ad]!==_0x160e('0xae')){if(this[_0x160e('0x20')][_0x5ca9ad]['state']==='not_inuse'&&this[_0x160e('0x20')][_0x5ca9ad][_0x160e('0x8c')]==='reachable'){_0x220a30[_0x160e('0x9e')](this[_0x160e('0x20')][_0x5ca9ad]['id']);}}}_0x5b806a['temp']=0x1;return this[_0x160e('0x208')](_0x5b806a['id'],_0x220a30,0x1,_0x5b806a[_0x160e('0x20f')],_0x5b806a)[_0x160e('0x42')](function(_0xb4bcae){_0x5b806a[_0x160e('0x1fe')]=0x1;if(_0xb4bcae){if(!utils['checkContactEmpty'](_0xb4bcae)){utils['checkContactLowerLimitOriginate'](_0x5b806a,0x1,0x0);return hopperUtils[_0x160e('0x209')](_0x5b806a)[_0x160e('0x42')](sendMessageReschedule(_0x5b806a))[_0x160e('0xa5')](loggerCatch(_0x160e('0x210')));}else{_0x5b806a[_0x160e('0x6a')]=utils['CAMPAIGN_STATUS']['RUNNING'];if(_[_0x160e('0xff')](_0xb4bcae[0x0])||_['isNil'](_0xb4bcae[0x0][_0x160e('0x17a')])||_['isNil'](_0xb4bcae[0x0]['phone'])){_0x1c747b[_0x160e('0x159')](_0x160e('0x203'),_0x5b806a,_0xb4bcae[0x0]);}else{return hopperUtils[_0x160e('0x20a')](_[_0x160e('0x77')](_0xb4bcae[0x0],['VoiceQueueId',_0x160e('0x188')]))[_0x160e('0x42')](_0x1c747b['checkContactBlack'](_0x5b806a,_0xb4bcae[0x0]))[_0x160e('0xa5')](function(_0x4aec76){logger['error'](_0x160e('0x211'),_0x4aec76);utils[_0x160e('0xc8')](_0x5b806a,_0x160e('0x211'));});}}}})[_0x160e('0xa5')](function(_0x10b23a){_0x5b806a[_0x160e('0x1fe')]=0x0;logger[_0x160e('0x68')]('[getContactCampaign2]',_0x10b23a);});};Dialer[_0x160e('0x19')][_0x160e('0x1da')]=function(_0x4013ac,_0x19e306,_0x339d32,_0x2e269b,_0x410550,_0x2f5239){loggerPredictive[_0x160e('0x4c')](_0x160e('0x212'));loggerPredictive[_0x160e('0x4c')]('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',_0x4013ac);loggerPredictive[_0x160e('0x4c')](_0x160e('0x213'),_0x19e306);loggerPredictive[_0x160e('0x4c')](_0x160e('0x214'),_0x339d32);loggerPredictive[_0x160e('0x4c')](_0x160e('0x215'),_0x2e269b);loggerPredictive[_0x160e('0x4c')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x410550);loggerPredictive[_0x160e('0x4c')]('---------------------------');return new Promise(function(_0xe19ea4,_0x14ca4d){if(_0x4013ac<=0x0||isNaN(_0x4013ac)){return _0x14ca4d(msgResponse('[abandonmentRate]',_0x160e('0x88'),_0x160e('0x216')+_0x4013ac));}if(_0x339d32<=0x0||isNaN(_0x339d32)){return _0x14ca4d(msgResponse(_0x160e('0x217'),_0x160e('0x88'),_0x160e('0x218')+_0x339d32));}if(_0x2e269b<=0x0||isNaN(_0x2e269b)){return _0x14ca4d(msgResponse(_0x160e('0x217'),_0x160e('0x88'),_0x160e('0x219')+_0x2e269b));}if(_0x19e306<=0x0||isNaN(_0x19e306)){return _0x14ca4d(msgResponse('[abandonmentRate]',_0x160e('0x88'),_0x160e('0x21a')+_0x19e306));}if(_0x410550<=0x0||isNaN(_0x410550)){return _0x14ca4d(msgResponse('[abandonmentRate]','Error',_0x160e('0x21b')+_0x410550));}_0x2f5239=_0x2f5239||0x0;var _0x41c61e=0x1/_0x339d32;var _0x317f29=0x0;var _0x486a31=0x0;var _0x15fa50=0x0;var _0x41023c=0x0;for(var _0x42e740=0x0;_0x15fa50<_0x410550;_0x42e740+=0x1){_0x486a31=_0x42e740/_0x19e306;_0x317f29=(_0x2e269b*_0x486a31+_0x2f5239)/_0x41c61e;_0x15fa50=utils[_0x160e('0x21c')](_0x317f29,_0x4013ac);_0x41023c=_0x317f29/_0x4013ac*(0x1-utils[_0x160e('0x21c')](_0x317f29,_0x4013ac));}return _0xe19ea4({'erlangCalls':_0x42e740,'erlangCallToSecond':_0x19e306/_0x42e740,'erlangAbandonmentRate':_0x15fa50,'erlangBusyFactor':_0x41023c});});};Dialer[_0x160e('0x19')][_0x160e('0x1db')]=function(_0x1aef19,_0x50fbe7,_0x5eb77e,_0x6d4776,_0x14a928,_0x37bcf4){loggerPredictive['info']('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x160e('0x4c')]('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',_0x1aef19);loggerPredictive['info'](_0x160e('0x213'),_0x50fbe7);loggerPredictive[_0x160e('0x4c')](_0x160e('0x214'),_0x5eb77e);loggerPredictive[_0x160e('0x4c')](_0x160e('0x215'),_0x6d4776);loggerPredictive['info'](_0x160e('0x21d'),_0x14a928);loggerPredictive[_0x160e('0x4c')](_0x160e('0x61'));return new Promise(function(_0x2e3e47,_0xcc4555){if(_0x1aef19<=0x0||isNaN(_0x1aef19)){return _0xcc4555(msgResponse('[busyFactor]',_0x160e('0x88'),_0x160e('0x216')+_0x1aef19));}if(_0x5eb77e<=0x0||isNaN(_0x5eb77e)){return _0xcc4555(msgResponse('[busyFactor]',_0x160e('0x88'),_0x160e('0x218')+_0x5eb77e));}if(_0x6d4776<=0x0||isNaN(_0x6d4776)){return _0xcc4555(msgResponse(_0x160e('0x21e'),'Error',_0x160e('0x219')+_0x6d4776));}if(_0x50fbe7<=0x0||isNaN(_0x50fbe7)){return _0xcc4555(msgResponse(_0x160e('0x21e'),_0x160e('0x88'),'interval\x20=\x20'+_0x50fbe7));}if(_0x14a928<=0x0||isNaN(_0x14a928)){return _0xcc4555(msgResponse('[busyFactor]',_0x160e('0x88'),_0x160e('0x21f')+_0x14a928));}_0x37bcf4=_0x37bcf4||0x0;var _0x577a7d=0x1/_0x5eb77e;var _0x3b538c=0x0;var _0x14215f=0x0;var _0x33223d=0x0;var _0x46d13a=0x0;for(var _0x38c7dc=0x0;_0x46d13a<_0x14a928;_0x38c7dc+=0x1){_0x14215f=_0x38c7dc/_0x50fbe7;_0x3b538c=(_0x6d4776*_0x14215f+_0x37bcf4)/_0x577a7d;_0x33223d=utils['erlangb'](_0x3b538c,_0x1aef19);_0x46d13a=_0x3b538c/_0x1aef19*(0x1-utils[_0x160e('0x21c')](_0x3b538c,_0x1aef19));}return _0x2e3e47({'erlangCalls':_0x38c7dc,'erlangCallToSecond':_0x50fbe7/_0x38c7dc,'erlangAbandonmentRate':_0x33223d,'erlangBusyFactor':_0x46d13a});});};module[_0x160e('0x220')]=Dialer;
\ No newline at end of file
+var _0x9003=['getSeconds','debug','startPredictive','handlePredictive','error','stack','contactsRescheduled','message','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','contacts','NO_AVAILABLE_CONTACTS','state','statedesc','endtime','starttime','queueStatusComplete','[booked][unlockQueueStatus]','pick','NULL_INTERVAL','Interval','Intervals','\x20INTERVAL_IS_NULL','isIVRCampaignActive','INACTIVE','\x20NOT\x20Active','isIVRCampaign','campaign:ivr:%s','campaign:save','sendMessageOneNotActive','originated','is\x20not\x20active','DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20deactivated','Error','stringify','format','SIP/%s','status','unmonitored','checkIsTrunkReachable','isTrunkReachable','Trunk','TRUNK_NOT_REACHABLE','checkIfTime','ifTimeIvr','checkIfTimeIntervals','ifTime','\x20Intervals\x20is\x20null\x20','isEmpty','EMPTY_INTERVAL','timezones','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','isArray','length','push','Action','command','iftime\x20%s,%s','interval','content','indexOf','true','catch','all','OVERTIME_GLOBAL_INTERVAL','[ifTime][promiseAll]','Failure','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','resetActiveCalls','syncCampaigns','undefined','dialTimezone','[syncCampaigns]','dialMethod','progressive','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','dialGlobalInterval','silly','Voice\x20Queue\x20%s\x20$s','OVERTIME_INTERVAL','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','AMI\x20IfTime','[ifTime][Action]','syncAgentConnect','queue','ivr','[syncAgentConnect]','uniqueid','YYYY-MM-DD\x20HH:mm:ss','outboundAnswerCallsDay','reason','agent','dialQueueProject2','dialAgiAfterHangupAgent','createHistory','[syncAgentComplete][createHistory]','[syncAgentComplete]','decrementOriginate','[syncQueueCallerAbandon]','droptime','responsetime','dialQueueTimeout','Drop','dropreason','TIMEOUT','agiafterat','countglobal','dialDropRetryFrequency','verifyAdditionalPhones','dialDropMaxRetry','queueCallerAbandonCreateState','additional','rescheduleContact','minutes','ContactId','ListId','CampaignId','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','predictiveIntervalDroppedCallsCallersExit','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','countabandonedretry','dialAbandonedRetryFrequency','callAdditionalPhoneAfterMin','voiceQueue','dialAbandonedMaxRetry','add','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','syncNewExten','channel','actionid','strategy','rrmemory','roundrobin','locked','paused','stateinterface','idHopper','run','[Catch][Preview][syncQueueStatusComplete]','[syncQueueStatusComplete]','VoiceQueueId','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','isNil','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[booked][unlock3]','response','[syncOriginateResponse]','callProgressDetecting','variable','amdstatus','xcally-motion-dialer','dialAMDActive','value','HANGUP','HangupInAMD','membername','custom:amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','[syncVarSet]','outboundAnswerAgiCallsDay','Machine','AMD','countmachineretry','amd','countbusyretry','countnoanswerretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','[rescheduleContact][Machine]','buildObj','saveInDb','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','[syncAgentComplete][createHistory][0]','countcongestionretry','countnosuchnumberretry','countdropretry','ivrAnswerCallsDay','cause-txt','Normal\x20Clearing','[syncAgentCompleteIvr][createHistory]','[syncAgentCompleteIvr]','moveContactManagedDialer','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','[syncHangupIvr][createHistory]','[syncHangup2]','outboundUnknownCallsDay','Unknown','[syncHangup][createHistory]','[syncHangup]','running','statusMessage','getQueueCampaignStatusMessage','resolve','available','inUse','pTalking','ACTIVE','checkDialMethod','compareToOutboundQueue','queueSummaryCountersUpdated','assign','[syncQueueSummary]','throttle','filter','reachable','handlePreviewRecallNotifications','Agent','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','clearZombieChannels','[uniqueid]','[clearZombieChannels]','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[emptyContact]','UserId','[emptyContact][createHistory]','launchHandleIvr','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','NONE','\x22agi://%s/square,%s\x22','isOutboundQueue','\x22%s,%s%s,,,%s\x22','dialQueueOptions','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','setXMDContactVariables','Contact','getCallerId','callerid','dialOriginateCallerIdName','dialOriginateCallerIdNumber','TrunkBackup','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','dialNoAnswerRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Drop]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','checkRetriveMax','dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','dialBusyRetryFrequency','dialBusyMaxRetry','reason\x205\x20busy','Congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','Global','Success','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','outboundDropCallsDayTimeout','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','talking','erlangCalls','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','predictiveIntervalErlangCallsDroppedCalls','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','avgHandleTime','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','getDataPredictive','predictiveIntervalHitRate','agentBusyFactor','[getDataPredictive]','Unknown\x20Predictive','getDataPredictiveOld','loggedIn','outboundQueuePauses','predictiveIntervalPauses','abandonmentRate','[CatchErlangB]','busyFactor','floor','one\x20call\x20every:','milliseconds','[handlePredictive]','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[checkContactBlack]','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','voicePause','unlockContact','dialRecallInQueue','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','limitCalls','temp','RUNNING','ivrTotalCallsDays','emptyContact','[actionOriginate]\x20','checkIsBlackListIvr','[actionOriginateIvr]','[handleIvr]','[getContactCampaign2]','dialLimitQueue','getContactDialer','checkContactEmpty','countReScheduled','[countReScheduled]\x20','checkIsBlackList','[actionOriginate]','[handlePower]','[handlePredictive][limitChannel]','tryOriginatePredictive','not_inuse','checkContactLowerLimitOriginate','[actionOriginatePredictive]','--------\x20Drop\x20Rate\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','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','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','erlangb','----\x20Agent\x20Busy\x20Factor\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','exports','util','uuid','moment','ioredis','./utils','./utils/hopper','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','syncQueueSummary','../ami','redis','defaults','socket.io-emitter','../rpc/voiceQueueRt','../rpc/interval','./models/history','./models/final','./models/agentComplete','./models/queueCallerAbandon','./models/hangup','env','127.0.0.1','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startProgressive','queueBooked','queuesSummary','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncHangup','varset','syncVarSet','queuemember','syncQueueMember','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined','emit','type','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','voice:queue:%s','name','voice_queue:save','info','-----\x20Stats\x20Predictive\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','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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'];(function(_0xb3f165,_0x1a9fb5){var _0x4eff46=function(_0x12c120){while(--_0x12c120){_0xb3f165['push'](_0xb3f165['shift']());}};_0x4eff46(++_0x1a9fb5);}(_0x9003,0x1c7));var _0x3900=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x9003[_0x2b4411];return _0x8e41ef;};'use strict';var util=require(_0x3900('0x0'));var _=require('lodash');var uuid=require(_0x3900('0x1'));var moment=require(_0x3900('0x2'));var rr=require('rr');var Redis=require(_0x3900('0x3'));var utils=require(_0x3900('0x4'));var hopperUtils=require(_0x3900('0x5'));var ut=require(_0x3900('0x6'));var config=require(_0x3900('0x7'));var logger=require(_0x3900('0x8'))(_0x3900('0x9'));var loggerBooked=require(_0x3900('0x8'))(_0x3900('0xa'));var loggerPredictive=require(_0x3900('0x8'))(_0x3900('0xb'));var loggerPredictiveCalls=require('../../../config/logger')('predictiveCalls');var loggerSyncQueueSummary=require(_0x3900('0x8'))(_0x3900('0xc'));var ami=require(_0x3900('0xd'));config[_0x3900('0xe')]=_[_0x3900('0xf')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x3900('0x10'))(new Redis(config[_0x3900('0xe')]));var cmHopper=require('../rpc/cmHopper');var voiceQueueRt=require(_0x3900('0x11'));var RpcSetting=require('../rpc/setting');var Interval=require(_0x3900('0x12'));var Action=require('./models/action');var History=require(_0x3900('0x13'));var Final=require(_0x3900('0x14'));var AgentComplete=require(_0x3900('0x15'));var QueueCallerAbandon=require(_0x3900('0x16'));var Hangup=require(_0x3900('0x17'));var ipAgi=process[_0x3900('0x18')]['XCALLY_IP_AGI']||_0x3900('0x19');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x3900('0x1a')][_0x3900('0x1b')]=function(_0x300c65){this[_0x3900('0x1c')]=this[_0x3900('0x1c')]?this[_0x3900('0x1c')][_0x3900('0x1d')](_0x300c65):_0x300c65();};function Dialer(_0x5605c8,_0x931432){this[_0x3900('0x1e')]=new Sequence();this[_0x3900('0x1f')]=_0x931432;this[_0x3900('0x20')]=_0x5605c8[_0x3900('0x20')];this[_0x3900('0x21')]=_0x5605c8[_0x3900('0x21')];this[_0x3900('0x22')]=_0x5605c8[_0x3900('0x22')];this[_0x3900('0x23')]=_0x5605c8[_0x3900('0x23')];this[_0x3900('0x24')]=config[_0x3900('0x24')]||0x2;this[_0x3900('0x25')]={};this[_0x3900('0x26')]={};this[_0x3900('0x27')]={};this[_0x3900('0x28')]={};this[_0x3900('0x29')]={};this['startPredictive']={};this[_0x3900('0x2a')]={};this['ivrOriginated']={};this[_0x3900('0x2b')]={};this['queueBookedRR']={};this[_0x3900('0x2c')]={};ami['on']('agentconnect',this['syncAgentConnect'][_0x3900('0x2d')](this));ami['on'](_0x3900('0x2e'),this[_0x3900('0x2f')][_0x3900('0x2d')](this));ami['on'](_0x3900('0x30'),this[_0x3900('0x31')]['bind'](this));ami['on'](_0x3900('0x32'),this[_0x3900('0x33')][_0x3900('0x2d')](this));ami['on'](_0x3900('0x34'),this[_0x3900('0xc')]['bind'](this));ami['on'](_0x3900('0x35'),this[_0x3900('0x36')][_0x3900('0x2d')](this));ami['on'](_0x3900('0x37'),this[_0x3900('0x38')]['bind'](this));ami['on']('newexten',this['syncNewExten'][_0x3900('0x2d')](this));ami['on'](_0x3900('0x39'),this[_0x3900('0x3a')]['bind'](this));ami['on'](_0x3900('0x3b'),this[_0x3900('0x3c')][_0x3900('0x2d')](this));ami['on']('queuestatuscomplete',this[_0x3900('0x3d')][_0x3900('0x2d')](this));this[_0x3900('0x3e')]();this[_0x3900('0x3f')]();RpcSetting[_0x3900('0x40')]()[_0x3900('0x41')](function(_0x19ebe4){previewRecallmeReminderInterval=_0x19ebe4[_0x3900('0x42')];});}function isNotNull(_0x3c41e0){return _0x3c41e0!==null&&!_[_0x3900('0x43')](_0x3c41e0);}function msgResponse(_0x39f0c5,_0x5c78e7,_0x372be6){return{'action':_0x39f0c5,'response':_0x5c78e7,'message':_0x372be6,'stack':_0x372be6};}function emit(_0x4456dd,_0x2fe9ef,_0x2e53b9){io['to'](_0x4456dd)[_0x3900('0x44')](_0x2fe9ef,_0x2e53b9);}function emitOutboundVoiceQueueSummary(_0x23808f){if(_0x23808f[_0x3900('0x45')]==='outbound'){logger['debug'](_0x3900('0x46'),util[_0x3900('0x47')](_0x23808f,{'showHidden':![],'depth':null}));emit(util['format'](_0x3900('0x48'),_0x23808f[_0x3900('0x49')]),_0x3900('0x4a'),_0x23808f);}}function checkGetDataPredictive(_0x4ce710){if(isNotNull(_0x4ce710)&&!_['isEmpty'](_0x4ce710)){loggerPredictive[_0x3900('0x4b')](_0x3900('0x4c'));loggerPredictive[_0x3900('0x4b')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4ce710[_0x3900('0x4d')]);loggerPredictive[_0x3900('0x4b')](_0x3900('0x4e'),_0x4ce710[_0x3900('0x4f')]);loggerPredictive[_0x3900('0x4b')](_0x3900('0x50'),_0x4ce710[_0x3900('0x51')]);loggerPredictive[_0x3900('0x4b')](_0x3900('0x52'),_0x4ce710['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x3900('0x4b')](_0x3900('0x53'),_0x4ce710[_0x3900('0x54')]);loggerPredictive['info'](_0x3900('0x55'),_0x4ce710[_0x3900('0x56')]);loggerPredictive[_0x3900('0x4b')](_0x3900('0x57'));if(_0x4ce710[_0x3900('0x4d')]>0x0){if(!_[_0x3900('0x43')](_0x4ce710[_0x3900('0x56')])&&_0x4ce710['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0x3900('0x4b')](_0x3900('0x58'));if(!_[_0x3900('0x43')](_0x4ce710[_0x3900('0x54')])&&_0x4ce710[_0x3900('0x54')]>0x0){return!![];}loggerPredictive['info'](_0x3900('0x59'));}else{loggerPredictive[_0x3900('0x4b')](_0x3900('0x5a'));}}else{loggerPredictive[_0x3900('0x4b')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x5ec082){return function(_0x50e40e){loggerPredictive[_0x3900('0x4b')](_0x3900('0x5b'));loggerPredictive['info'](_0x3900('0x5c'),_0x50e40e['erlangCalls']);loggerPredictive[_0x3900('0x4b')](_0x3900('0x5d'),_0x50e40e[_0x3900('0x5e')]);loggerPredictive['info'](_0x3900('0x5f'),_0x50e40e[_0x3900('0x60')]);loggerPredictive[_0x3900('0x4b')](_0x3900('0x61'),_0x50e40e['erlangBusyFactor']);loggerPredictive['info'](_0x3900('0x5f'),_0x50e40e[_0x3900('0x60')]);loggerPredictive[_0x3900('0x4b')](_0x3900('0x57'));_[_0x3900('0x62')](_0x5ec082,_0x50e40e);};}function ifInterval(_0x4596ad,_0x443681){if(_[_0x3900('0x43')](_0x443681)){return![];}return utils[_0x3900('0x63')](undefined,_0x443681)<_0x4596ad*0x3c;}function clearPredictiveAttributes(_0x34d491){if(_0x34d491[_0x3900('0x2a')]){_0x34d491[_0x3900('0x2a')]=undefined;loggerPredictive[_0x3900('0x64')](_0x34d491[_0x3900('0x49')],'startProgressive\x20value\x20cleared');}if(_0x34d491[_0x3900('0x65')]){_0x34d491[_0x3900('0x65')]=undefined;loggerPredictive[_0x3900('0x64')](_0x34d491['name'],'startPredictive\x20value\x20cleared');}if(_0x34d491[_0x3900('0x66')]){clearInterval(_0x34d491[_0x3900('0x66')]);_0x34d491[_0x3900('0x66')]=undefined;loggerPredictive[_0x3900('0x64')](_0x34d491[_0x3900('0x49')],'handlePredictive\x20interval\x20cleared');}}function loggerCatchPredictive(_0x9e6112,_0x12c635){return function(_0x1f6899){loggerPredictive['error'](_0x12c635[_0x3900('0x49')],_0x9e6112);loggerPredictive[_0x3900('0x67')](_0x1f6899[_0x3900('0x68')]);clearPredictiveAttributes(_0x12c635);};}function loggerCatch(_0x39a222){return function(_0x1aa408){logger[_0x3900('0x67')](_0x39a222,util['inspect'](_0x1aa408,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x3571ad){return function(_0x91e1cd){if(isNotNull(_0x91e1cd)&&isNotNull(_0x91e1cd[0x0])){if(_0x91e1cd[0x0][_0x3900('0x69')]>0x0){_0x3571ad[_0x3900('0x6a')]=utils[_0x3900('0x6b')][_0x3900('0x6c')];logger[_0x3900('0x4b')]('[getContactDialer2][ReScheduled]'+_0x3571ad[_0x3900('0x49')],_0x91e1cd[0x0]['contactsRescheduled'],_0x3900('0x6d'));}else{_0x3571ad['message']=utils[_0x3900('0x6b')][_0x3900('0x6e')];logger[_0x3900('0x4b')]('[getContactDialer2][Empty]'+_0x3571ad[_0x3900('0x49')]);}}};}function createObjHistory(_0x4e64c4,_0x431c74,_0xe3bf31,_0x2622e8,_0x20d14d){_0x4e64c4[_0x3900('0x6a')]=_0xe3bf31;var _0x38265e=new Action(_0x4e64c4,_0x431c74);var _0x90c157=new History(_0x38265e);_0x90c157[_0x3900('0x6f')]=_0x2622e8;_0x90c157[_0x3900('0x70')]=_0x20d14d;_0x90c157[_0x3900('0x71')]=_0x38265e[_0x3900('0x72')];return _0x90c157;}function unlockQueueStatus(_0x5285a9,_0x1dd347){setTimeout(function(){if(_[_0x3900('0x43')](_0x5285a9[_0x3900('0x73')])){loggerBooked[_0x3900('0x67')]('[unlockQueueStatus][undefined]',_0x1dd347);}_0x5285a9[_0x3900('0x73')]=!![];loggerBooked[_0x3900('0x4b')](_0x3900('0x74'),_0x1dd347,JSON['stringify'](_[_0x3900('0x75')](_0x5285a9,['name',_0x3900('0x73')])));},0x1f3);}function checkInterval(_0x25f375){return function(){if(!isNotNull(_0x25f375['Interval'])){_0x25f375[_0x3900('0x6a')]=utils[_0x3900('0x6b')][_0x3900('0x76')];throw _0x25f375['name']+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x25f375[_0x3900('0x77')][_0x3900('0x78')])){_0x25f375['message']=utils[_0x3900('0x6b')][_0x3900('0x76')];throw _0x25f375[_0x3900('0x49')]+_0x3900('0x79');}if(!isNotNull(_['isEmpty'](_0x25f375['Interval'][_0x3900('0x78')]))){_0x25f375['message']=utils[_0x3900('0x6b')][_0x3900('0x76')];throw _0x25f375[_0x3900('0x49')]+_0x3900('0x79');}};}function checkIsIVRCampaignActive(_0x34e013){return function(){if(!utils[_0x3900('0x7a')](_0x34e013)){_0x34e013[_0x3900('0x6a')]=utils[_0x3900('0x6b')][_0x3900('0x7b')];throw _0x34e013[_0x3900('0x49')]+_0x3900('0x7c');}};}function emitCampaignSummary(_0x3f0adf){if(utils[_0x3900('0x7d')](_0x3f0adf)){emit(util['format'](_0x3900('0x7e'),_0x3f0adf[_0x3900('0x49')]),_0x3900('0x7f'),_0x3f0adf);}}function loggerCatchQueueSummary(_0x2c573f,_0x10f2af){return function(_0x37ee19){clearPredictiveAttributes(_0x10f2af);emitCampaignSummary(_0x10f2af);loggerSyncQueueSummary[_0x3900('0x64')](_0x2c573f,util['inspect'](_0x37ee19,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0xaf78b6){if(_0xaf78b6[_0x3900('0x80')]){if(_0xaf78b6[_0x3900('0x81')]===0x0){_0xaf78b6[_0x3900('0x80')]=![];_0xaf78b6[_0x3900('0x6a')]=utils[_0x3900('0x6b')][_0x3900('0x7b')];loggerSyncQueueSummary['debug']('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0xaf78b6['name'],_0x3900('0x82'));}else{_0xaf78b6[_0x3900('0x6a')]=utils[_0x3900('0x6b')][_0x3900('0x83')];loggerSyncQueueSummary[_0x3900('0x64')](_0x3900('0x84'),_0xaf78b6[_0x3900('0x49')],_0x3900('0x85'));}emitCampaignSummary(_0xaf78b6);}}function myreject(_0x39d557){return function(_0x40187d){return _0x39d557(msgResponse('[ifTime][Action]',_0x3900('0x86'),JSON[_0x3900('0x87')](_0x40187d)));};}Dialer[_0x3900('0x1a')]['isTrunkReachable']=function(_0x3685d5){return!_[_0x3900('0x43')](_0x3685d5)&&_0x3685d5&&!_[_0x3900('0x43')](_0x3685d5[_0x3900('0x49')])&&!_[_0x3900('0x43')](_0x3685d5['active'])&&_0x3685d5['active']&&(this[_0x3900('0x23')][util[_0x3900('0x88')](_0x3900('0x89'),_0x3685d5[_0x3900('0x49')])][_0x3900('0x8a')]==='reachable'||this['trunks'][util[_0x3900('0x88')](_0x3900('0x89'),_0x3685d5['name'])][_0x3900('0x8a')]===_0x3900('0x8b'));};Dialer[_0x3900('0x1a')][_0x3900('0x8c')]=function(_0x3ad702){var _0x4db0b4=this;return function(){if(!_0x4db0b4[_0x3900('0x8d')](_0x3ad702[_0x3900('0x8e')])){if(!_0x4db0b4[_0x3900('0x8d')](_0x3ad702['TrunkBackup'])){_0x3ad702['message']=utils[_0x3900('0x6b')][_0x3900('0x8f')];throw _0x3ad702[_0x3900('0x49')]+'\x20trunk\x20is\x20not\x20reachable';}}};};Dialer[_0x3900('0x1a')][_0x3900('0x90')]=function(_0x48f0de,_0x2176e9,_0x1de34b,_0x59fe4c){var _0x589e20=this;return function(){var _0x4a9025=!![];return _0x589e20[_0x3900('0x91')](_0x48f0de,_0x2176e9,_0x1de34b,_0x59fe4c,_0x4a9025);};};Dialer[_0x3900('0x1a')][_0x3900('0x92')]=function(_0x12fa55,_0x57e53f,_0x26a195,_0xa1c013){var _0x2c4a3e=this;return function(){var _0xa36e79=![];return _0x2c4a3e[_0x3900('0x91')](_0x12fa55['Intervals'],_0x57e53f,_0x26a195,_0xa1c013,_0xa36e79);};};Dialer[_0x3900('0x1a')]['ifTimeIvr']=function(_0x533897,_0x14531f,_0x24a757,_0x46e288,_0x1746f9){var _0x255325=[];return new Promise(function(_0x10d79f,_0x126587){if(!isNotNull(_0x533897)){_0x46e288[_0x3900('0x6a')]=utils['CAMPAIGN_STATUS'][_0x3900('0x76')];return _0x126587(msgResponse(_0x3900('0x93'),'Failure',_0x24a757+_0x3900('0x94')));}if(_[_0x3900('0x95')](_0x533897)){_0x46e288[_0x3900('0x6a')]=utils[_0x3900('0x6b')][_0x3900('0x96')];return _0x126587(msgResponse(_0x3900('0x93'),'Failure',_0x24a757+'\x20Intervals\x20is\x20empty\x20'));}if(_0x14531f&&_[_0x3900('0x43')](config[_0x3900('0x97')][_0x14531f])){_0x46e288[_0x3900('0x6a')]=utils['CAMPAIGN_STATUS'][_0x3900('0x98')];return _0x126587(msgResponse(_0x3900('0x93'),'Failure',_0x24a757+_0x3900('0x99')+_0x14531f));}if(_[_0x3900('0x9a')](_0x533897)){for(var _0x4087ac=0x0;_0x4087ac<_0x533897[_0x3900('0x9b')];_0x4087ac+=0x1){_0x255325[_0x3900('0x9c')](ami[_0x3900('0x9d')]({'action':_0x3900('0x9e'),'command':util['format'](_0x3900('0x9f'),_0x533897[_0x4087ac][_0x3900('0xa0')],!_['isUndefined'](config[_0x3900('0x97')][_0x14531f])?_0x14531f:'')})[_0x3900('0x41')](function(_0x537d3a){return _0x537d3a[_0x3900('0xa1')][_0x3900('0xa2')](_0x3900('0xa3'))>=0x0;})[_0x3900('0xa4')](myreject(_0x126587)));}}else{_0x255325['push'](ami[_0x3900('0x9d')]({'action':_0x3900('0x9e'),'command':util[_0x3900('0x88')]('iftime\x20%s,%s',_0x533897,!_[_0x3900('0x43')](config[_0x3900('0x97')][_0x14531f])?_0x14531f:'')})['then'](function(_0x2c9cd9){return _0x2c9cd9[_0x3900('0xa1')]['indexOf'](_0x3900('0xa3'))>=0x0;})[_0x3900('0xa4')](myreject(_0x126587)));}Promise[_0x3900('0xa5')](_0x255325)[_0x3900('0x41')](function(_0x33256f){var _0x34fb5c=_['some'](_0x33256f);if(_0x34fb5c){return _0x10d79f(_0x34fb5c);}else{_0x46e288['message']=_0x1746f9?utils[_0x3900('0x6b')][_0x3900('0xa6')]:utils['CAMPAIGN_STATUS']['OVERTIME_INTERVAL'];return _0x126587(msgResponse(_0x3900('0xa7'),_0x3900('0xa8'),_0x3900('0xa9')+_0x1746f9+'\x20'+_0x24a757+_0x3900('0xaa')+util[_0x3900('0x47')](_0x533897,{'showHidden':![],'depth':null})+_0x3900('0xab')+_0x14531f));}})[_0x3900('0xa4')](function(_0x19e111){return _0x126587(msgResponse('ifTime',_0x3900('0xa8'),JSON[_0x3900('0x87')](_0x19e111)));});});};Dialer[_0x3900('0x1a')][_0x3900('0x3e')]=function(){var _0x244d20=this;return cmHopper[_0x3900('0xac')]({'active':![]},{'where':{'active':!![]}})[_0x3900('0x41')](function(){setInterval(function(){_0x244d20[_0x3900('0xad')]();},0x3e8);});};Dialer[_0x3900('0x1a')]['syncCampaigns']=function(){var _0x841ff6=this;var _0x2831f1;for(var _0x41b717 in this[_0x3900('0x21')]){if(typeof this['campaigns'][_0x41b717]!==_0x3900('0xae')){_0x2831f1=this[_0x3900('0x21')][_0x41b717];if(utils['isIVRCampaign'](_0x2831f1)&&utils['isIVRCampaignActive'](_0x2831f1)){_0x2831f1[_0x3900('0x80')]=!![];Promise['resolve']()[_0x3900('0x41')](checkIsIVRCampaignActive(_0x2831f1))[_0x3900('0x41')](checkInterval(_0x2831f1))['then'](_0x841ff6[_0x3900('0x8c')](_0x2831f1))['then'](_0x841ff6[_0x3900('0x90')](_0x2831f1['dialGlobalInterval'],_0x2831f1[_0x3900('0xaf')],_0x2831f1[_0x3900('0x49')],_0x2831f1))['then'](_0x841ff6['checkIfTimeIntervals'](_0x2831f1['Interval'],_0x2831f1[_0x3900('0xaf')],_0x2831f1[_0x3900('0x49')],_0x2831f1))[_0x3900('0x41')](_0x841ff6['launchHandleIvr'](_0x2831f1))['catch'](loggerCatchQueueSummary(_0x3900('0xb0'),_0x2831f1));}else{notSendMessagesCampaign(_0x2831f1);}}}};Dialer[_0x3900('0x1a')]['checkDialMethod']=function(_0x4ce203){if(_0x4ce203[_0x3900('0xb1')]!==_0x3900('0xb')){clearPredictiveAttributes(_0x4ce203);}switch(_0x4ce203[_0x3900('0xb1')]){case _0x3900('0xb2'):this[_0x3900('0xb3')](_0x4ce203,0x1);break;case _0x3900('0xb4'):this[_0x3900('0xb3')](_0x4ce203,_0x4ce203[_0x3900('0xb5')]);break;case'predictive':this[_0x3900('0xb')](_0x4ce203);break;case'booked':this[_0x3900('0xb3')](_0x4ce203,0x1);break;default:logger[_0x3900('0x67')](_0x3900('0xb6'),_0x4ce203[_0x3900('0x49')],_0x3900('0xb7'));}};Dialer[_0x3900('0x1a')][_0x3900('0x93')]=function(_0x3135ac,_0x317624){var _0x120578=_0x3135ac[_0x3900('0xaf')];var _0x28c103=_0x317624?_0x3135ac[_0x3900('0xb8')]:_0x3135ac[_0x3900('0x77')][_0x3900('0x78')];logger[_0x3900('0xb9')]('Dialer::ifTime()',_0x28c103,_0x120578,_0x3135ac[_0x3900('0x49')],util[_0x3900('0x88')](_0x3900('0xba'),_0x3135ac['name'],_0x3135ac['id']));var _0xb2393a=null;return Interval['intervalIftime'](_0x28c103,_0x120578)['then'](function(_0x32feb1){if(_0x32feb1===!![]){return _0x32feb1;}else{_0x3135ac['message']=_0x317624?utils[_0x3900('0x6b')][_0x3900('0xa6')]:utils[_0x3900('0x6b')][_0x3900('0xbb')];_0xb2393a=msgResponse(_0x3900('0xa7'),_0x3900('0xa8'),_0x3900('0xa9')+_0x317624+'\x20'+_0x3135ac[_0x3900('0x49')]+'\x20Interval\x20is\x20overtime:\x20'+util[_0x3900('0x47')](_0x28c103,{'showHidden':![],'depth':null})+_0x3900('0xab')+_0x120578);}if(_0xb2393a!==null){logger[_0x3900('0xb9')](_0x3900('0xbc'),_0xb2393a);_0xb2393a[_0x3900('0xbd')]=_0x317624;throw _0xb2393a;}})['catch'](function(_0x339083){logger['error'](_0x3900('0xbe'),_0x339083);throw msgResponse(_0x3900('0xbf'),_0x3900('0x86'),util[_0x3900('0x47')](_0x339083,{'showHidden':![],'depth':null}));});};Dialer[_0x3900('0x1a')][_0x3900('0xc0')]=function(_0x234a74){if(this[_0x3900('0x20')][_0x234a74[_0x3900('0xc1')]]){if(this[_0x3900('0x28')][_0x234a74['uniqueid']]&&this['uniqueId'][_0x234a74['uniqueid']]['type']!==_0x3900('0xc2')){utils['decrementOriginate'](this['voiceQueues'][_0x234a74[_0x3900('0xc1')]],_0x3900('0xc3'));this[_0x3900('0x28')][_0x234a74[_0x3900('0xc4')]]['answertime']=moment()[_0x3900('0x88')](_0x3900('0xc5'));}}};Dialer[_0x3900('0x1a')][_0x3900('0x33')]=function(_0x5c1e6e){var _0x10df76=this['uniqueId'][_0x5c1e6e[_0x3900('0xc4')]];if(this['voiceQueues'][_0x5c1e6e['queue']]){if(_0x10df76&&_0x10df76[_0x3900('0x45')]!=='ivr'){delete this[_0x3900('0x28')][_0x5c1e6e[_0x3900('0xc4')]];this[_0x3900('0x20')][_0x5c1e6e[_0x3900('0xc1')]][_0x3900('0xc6')]+=0x1;var _0x41449f=new AgentComplete(_0x10df76,_0x5c1e6e);if(_0x5c1e6e[_0x3900('0xc7')]===_0x3900('0xc8')){_0x41449f['agiafterat']=this[_0x3900('0x20')][_0x5c1e6e[_0x3900('0xc1')]][_0x3900('0xc9')]&&this[_0x3900('0x20')][_0x5c1e6e['queue']][_0x3900('0xca')]?moment()['format'](_0x3900('0xc5')):undefined;}hopperUtils[_0x3900('0xcb')](_0x41449f)['catch'](loggerCatch(_0x3900('0xcc')));hopperUtils['moveContactManagedDialer'](_0x41449f)[_0x3900('0xa4')](loggerCatch(_0x3900('0xcd')));}}};Dialer['prototype']['syncQueueCallerAbandon']=function(_0x49606d){var _0x1e2e8c=this[_0x3900('0x28')][_0x49606d[_0x3900('0xc4')]];var _0x35fd63=this;var _0x26ea83=![];var _0x25cf6b;var _0x985fd9;if(this[_0x3900('0x20')][_0x49606d['queue']]){if(_0x1e2e8c&&_0x1e2e8c[_0x3900('0x45')]!==_0x3900('0xc2')){delete this[_0x3900('0x28')][_0x49606d[_0x3900('0xc4')]];utils[_0x3900('0xce')](this[_0x3900('0x20')][_0x49606d[_0x3900('0xc1')]],_0x3900('0xcf'));_0x1e2e8c['droptime']=moment()[_0x3900('0x88')](_0x3900('0xc5'));var _0x182ca0=new QueueCallerAbandon(_0x1e2e8c,_0x49606d);if(utils['getSeconds'](_0x1e2e8c[_0x3900('0xd0')],_0x1e2e8c[_0x3900('0xd1')])>=_0x1e2e8c[_0x3900('0xd2')]){this[_0x3900('0x20')][_0x49606d[_0x3900('0xc1')]][_0x3900('0x51')]+=0x1;this[_0x3900('0x20')][_0x49606d['queue']]['outboundDropCallsDayTimeout']+=0x1;this[_0x3900('0x20')][_0x49606d[_0x3900('0xc1')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x182ca0[_0x3900('0x6f')]=0xa;_0x182ca0['statedesc']=_0x3900('0xd3');_0x182ca0[_0x3900('0xd4')]=_0x3900('0xd5');_0x182ca0[_0x3900('0xd6')]=this[_0x3900('0x20')][_0x49606d[_0x3900('0xc1')]]['dialQueueProject2']?moment()[_0x3900('0x88')](_0x3900('0xc5')):undefined;_0x182ca0['countdropretry']+=0x1;_0x182ca0[_0x3900('0xd7')]+=0x1;_0x25cf6b=this[_0x3900('0x20')][_0x49606d[_0x3900('0xc1')]][_0x3900('0xd8')];_0x985fd9=this[_0x3900('0x20')][_0x49606d['queue']]['callAdditionalPhoneAfterMin'];hopperUtils[_0x3900('0xd9')](_0x182ca0,_0x182ca0['state'],_0x1e2e8c['voiceQueue'])[_0x3900('0x41')](function(_0x10ce6e){_0x26ea83=_0x10ce6e['additional']==0x1;if(_0x182ca0['countdropretry']>=_0x35fd63[_0x3900('0x20')][_0x49606d['queue']][_0x3900('0xda')]){_0x35fd63[_0x3900('0xdb')](_0x182ca0,_0x10ce6e[_0x3900('0xdc')]);}else{hopperUtils[_0x3900('0xdd')]({'active':![],'countdropretry':_0x182ca0['countdropretry'],'scheduledat':moment()['add'](_0x35fd63[_0x3900('0x20')][_0x49606d[_0x3900('0xc1')]][_0x3900('0xd8')],_0x3900('0xde'))[_0x3900('0x88')](_0x3900('0xc5')),'ContactId':_0x1e2e8c[_0x3900('0xdf')],'ListId':_0x1e2e8c[_0x3900('0xe0')],'VoiceQueueId':_0x1e2e8c['VoiceQueueId']||undefined,'CampaignId':_0x1e2e8c[_0x3900('0xe1')]||undefined})['catch'](loggerCatch('[rescheduleContact][Drop]'));var _0x3451a6=new History(_0x182ca0);_0x3451a6[_0x3900('0x6f')]=0xa;_0x3451a6[_0x3900('0x70')]=_0x3900('0xd3');_0x3451a6[_0x3900('0x72')]=moment()[_0x3900('0x88')](_0x3900('0xc5'));_0x3451a6[_0x3900('0x71')]=_0x3451a6['starttime'];_0x3451a6[_0x3900('0xe2')]=_0x182ca0[_0x3900('0xe2')];_0x3451a6['calleridnum']=_0x182ca0[_0x3900('0xe3')];hopperUtils[_0x3900('0xcb')](_0x3451a6)[_0x3900('0xa4')](loggerCatch(_0x3900('0xe4')));}})['then'](function(){if(_0x26ea83)hopperUtils[_0x3900('0xe5')](_0x182ca0,_0x25cf6b,_0x985fd9)[_0x3900('0x41')](function(){return 0x1;});});}else{this[_0x3900('0x20')][_0x49606d[_0x3900('0xc1')]][_0x3900('0xe6')]+=0x1;this[_0x3900('0x20')][_0x49606d[_0x3900('0xc1')]][_0x3900('0xe7')]+=0x1;_0x182ca0['state']=0xb;_0x182ca0[_0x3900('0x70')]=_0x3900('0xe8');_0x182ca0['dropreason']=_0x3900('0xe9');_0x182ca0[_0x3900('0xea')]+=0x1;_0x182ca0['countglobal']+=0x1;_0x25cf6b=this['voiceQueues'][_0x49606d['queue']][_0x3900('0xeb')];_0x985fd9=this['voiceQueues'][_0x49606d[_0x3900('0xc1')]][_0x3900('0xec')];hopperUtils[_0x3900('0xd9')](_0x182ca0,_0x182ca0[_0x3900('0x6f')],_0x1e2e8c[_0x3900('0xed')])[_0x3900('0x41')](function(_0x162c89){if(_0x182ca0[_0x3900('0xea')]>=_0x35fd63['voiceQueues'][_0x49606d[_0x3900('0xc1')]][_0x3900('0xee')]){_0x35fd63['queueCallerAbandonCreateState'](_0x182ca0,_0x162c89[_0x3900('0xdc')]);}else{hopperUtils[_0x3900('0xdd')]({'active':![],'countabandonedretry':_0x182ca0[_0x3900('0xea')],'scheduledat':moment()[_0x3900('0xef')](_0x35fd63[_0x3900('0x20')][_0x49606d['queue']][_0x3900('0xeb')],_0x3900('0xde'))[_0x3900('0x88')](_0x3900('0xc5')),'ContactId':_0x1e2e8c[_0x3900('0xdf')],'ListId':_0x1e2e8c[_0x3900('0xe0')],'VoiceQueueId':_0x1e2e8c['VoiceQueueId']||undefined,'CampaignId':_0x1e2e8c['CampaignId']||undefined})[_0x3900('0xa4')](loggerCatch(_0x3900('0xf0')));var _0x574fce=new History(_0x182ca0);_0x574fce['state']=0xb;_0x574fce['statedesc']=_0x3900('0xe8');_0x574fce[_0x3900('0x72')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x574fce['endtime']=_0x574fce[_0x3900('0x72')];_0x574fce[_0x3900('0xe2')]=_0x182ca0['calleridname'];_0x574fce[_0x3900('0xe3')]=_0x182ca0[_0x3900('0xe3')];hopperUtils[_0x3900('0xcb')](_0x574fce)[_0x3900('0xa4')](loggerCatch(_0x3900('0xf1')));}})[_0x3900('0x41')](function(){if(_0x26ea83)hopperUtils[_0x3900('0xe5')](_0x182ca0,_0x25cf6b,_0x985fd9)[_0x3900('0x41')](function(){return 0x1;});});}}}};Dialer['prototype'][_0x3900('0xf2')]=function(_0x435fc2){if(this[_0x3900('0x26')][_0x435fc2['uniqueid']]){this[_0x3900('0x26')][_0x435fc2[_0x3900('0xc4')]][_0x3900('0xf3')]=_0x435fc2['channel'];}if(this[_0x3900('0x28')][_0x435fc2[_0x3900('0xc4')]]){this['uniqueId'][_0x435fc2[_0x3900('0xc4')]]['channel']=_0x435fc2['channel'];}};Dialer['prototype'][_0x3900('0x3c')]=function(_0x124ea8){if(!this[_0x3900('0x26')][_0x124ea8[_0x3900('0xf4')]]){return;}var _0x3bab0b=this['voiceQueues'][this[_0x3900('0x26')][_0x124ea8[_0x3900('0xf4')]][_0x3900('0xc1')]][_0x3900('0xf5')]||_0x3900('0xf6');if(_0x3bab0b===_0x3900('0xf7')){if(this[_0x3900('0x26')][_0x124ea8[_0x3900('0xf4')]]&&_['isNil'](this[_0x3900('0x26')][_0x124ea8[_0x3900('0xf4')]][_0x3900('0xf8')])&&_0x124ea8[_0x3900('0x8a')]==='1'&&_0x124ea8[_0x3900('0xf9')]==='0'){if(this['agents'][_0x124ea8[_0x3900('0xfa')]]){if(!this['agents'][_0x124ea8[_0x3900('0xfa')]][_0x3900('0xf8')]){this[_0x3900('0x22')][_0x124ea8['stateinterface']][_0x3900('0xf8')]=!![];this['actions'][_0x124ea8[_0x3900('0xf4')]]['locked']=!![];this[_0x3900('0x26')][_0x124ea8['actionid']][_0x3900('0xfa')]=_0x124ea8['stateinterface'];}}}}else if(_0x3bab0b===_0x3900('0xf6')){if(this['actions'][_0x124ea8[_0x3900('0xf4')]]){if(this[_0x3900('0x22')][_0x124ea8[_0x3900('0xfa')]]){this['actions'][_0x124ea8[_0x3900('0xf4')]][_0x3900('0xfa')]=_0x124ea8['stateinterface'];if(_['isNil'](this['queueBooked'][this[_0x3900('0x26')][_0x124ea8[_0x3900('0xf4')]][_0x3900('0xc1')]])){this['queueBooked'][this[_0x3900('0x26')][_0x124ea8['actionid']][_0x3900('0xc1')]]=[];}this[_0x3900('0x2b')][this['actions'][_0x124ea8[_0x3900('0xf4')]][_0x3900('0xc1')]][_0x3900('0x9c')](_[_0x3900('0x62')](_['pick'](this[_0x3900('0x26')][_0x124ea8[_0x3900('0xf4')]],[_0x3900('0xfb'),_0x3900('0xfa')]),{'status':_0x124ea8[_0x3900('0x8a')],'paused':_0x124ea8[_0x3900('0xf9')]}));}}}};Dialer[_0x3900('0x1a')][_0x3900('0x3d')]=function(_0x1333c0){if(!this['actions'][_0x1333c0['actionid']]){return;}var _0x7b6c7c=this;var _0x455409=this[_0x3900('0x20')][this[_0x3900('0x26')][_0x1333c0['actionid']][_0x3900('0xc1')]];var _0x2093d5=_0x455409['strategy']||_0x3900('0xf6');if(_0x2093d5==='roundrobin'){if(this[_0x3900('0x26')][_0x1333c0[_0x3900('0xf4')]]&&this[_0x3900('0x26')][_0x1333c0[_0x3900('0xf4')]][_0x3900('0xfa')]){this[_0x3900('0x1f')][_0x3900('0xfc')](this[_0x3900('0x26')][_0x1333c0[_0x3900('0xf4')]][_0x3900('0xfb')],this['actions'][_0x1333c0['actionid']]['stateinterface'])[_0x3900('0xa4')](function(_0x39df01){logger[_0x3900('0x67')](_0x3900('0xfd'),util[_0x3900('0x47')](_0x39df01,{'showHidden':![],'depth':null}));})[_0x3900('0x1d')](function(){utils[_0x3900('0xce')](_0x7b6c7c[_0x3900('0x20')][_0x7b6c7c[_0x3900('0x26')][_0x1333c0['actionid']][_0x3900('0xc1')]],_0x3900('0xfe'));_0x7b6c7c['agents'][_0x7b6c7c[_0x3900('0x26')][_0x1333c0[_0x3900('0xf4')]][_0x3900('0xfa')]]['locked']=![];delete _0x7b6c7c[_0x3900('0x26')][_0x1333c0['actionid']];unlockQueueStatus(_0x455409);});}else{utils[_0x3900('0xce')](this[_0x3900('0x20')][this[_0x3900('0x26')][_0x1333c0[_0x3900('0xf4')]][_0x3900('0xc1')]],_0x3900('0xfe'));hopperUtils[_0x3900('0xdd')]({'active':![],'ContactId':this[_0x3900('0x26')][_0x1333c0['actionid']][_0x3900('0xdf')],'ListId':this[_0x3900('0x26')][_0x1333c0['actionid']][_0x3900('0xe0')],'VoiceQueueId':this[_0x3900('0x26')][_0x1333c0[_0x3900('0xf4')]][_0x3900('0xff')]||undefined,'CampaignId':this['actions'][_0x1333c0[_0x3900('0xf4')]][_0x3900('0xe1')]||undefined})[_0x3900('0xa4')](loggerCatch(_0x3900('0x100')));delete this[_0x3900('0x26')][_0x1333c0[_0x3900('0xf4')]];unlockQueueStatus(_0x455409);}}else if(_0x2093d5===_0x3900('0xf6')){var _0x2296d1;if(this[_0x3900('0x26')][_0x1333c0['actionid']]&&!_[_0x3900('0x95')](this[_0x3900('0x2b')][this[_0x3900('0x26')][_0x1333c0[_0x3900('0xf4')]][_0x3900('0xc1')]])){if(this[_0x3900('0x101')][_0x7b6c7c[_0x3900('0x26')][_0x1333c0[_0x3900('0xf4')]][_0x3900('0xc1')]]){this[_0x3900('0x101')][_0x7b6c7c[_0x3900('0x26')][_0x1333c0[_0x3900('0xf4')]][_0x3900('0xc1')]]=this[_0x3900('0x101')][this[_0x3900('0x26')][_0x1333c0[_0x3900('0xf4')]][_0x3900('0xc1')]]?this[_0x3900('0x101')][this[_0x3900('0x26')][_0x1333c0[_0x3900('0xf4')]]['queue']]:this[_0x3900('0x2b')][this['actions'][_0x1333c0[_0x3900('0xf4')]][_0x3900('0xc1')]]?this['queueBooked'][this[_0x3900('0x26')][_0x1333c0['actionid']][_0x3900('0xc1')]][_0x3900('0x102')]||0x0:0x0;}this[_0x3900('0x2b')][this[_0x3900('0x26')][_0x1333c0[_0x3900('0xf4')]]['queue']][_0x3900('0x102')]=this[_0x3900('0x101')][this[_0x3900('0x26')][_0x1333c0[_0x3900('0xf4')]][_0x3900('0xc1')]];for(var _0x5ba23=0x0;_0x5ba23<this[_0x3900('0x2b')][this[_0x3900('0x26')][_0x1333c0[_0x3900('0xf4')]][_0x3900('0xc1')]][_0x3900('0x9b')];_0x5ba23+=0x1){_0x2296d1=rr(this[_0x3900('0x2b')][this[_0x3900('0x26')][_0x1333c0[_0x3900('0xf4')]][_0x3900('0xc1')]]);this[_0x3900('0x101')][_0x7b6c7c[_0x3900('0x26')][_0x1333c0[_0x3900('0xf4')]][_0x3900('0xc1')]]=this['queueBooked'][this[_0x3900('0x26')][_0x1333c0['actionid']][_0x3900('0xc1')]][_0x3900('0x102')];if(_0x2296d1[_0x3900('0x8a')]==='1'&&_0x2296d1[_0x3900('0xf9')]==='0'){break;}}if(!_[_0x3900('0x103')](_0x2296d1)){this[_0x3900('0x22')][_0x2296d1['stateinterface']][_0x3900('0x104')]=_[_0x3900('0x43')](this[_0x3900('0x22')][_0x2296d1[_0x3900('0xfa')]]['unlockRR'])?!![]:this[_0x3900('0x22')][_0x2296d1[_0x3900('0xfa')]]['unlockRR'];}loggerBooked[_0x3900('0x4b')]('[booked][RR]',_0x1333c0[_0x3900('0xf4')],_0x3900('0x105'),JSON['stringify'](_[_0x3900('0x75')](this['agents'][_0x2296d1['stateinterface']],['name',_0x3900('0x104')])),_0x3900('0x106'),JSON[_0x3900('0x87')](_0x2296d1[_0x3900('0xfb')]));if(!_[_0x3900('0x103')](_0x2296d1)&&_0x2296d1['status']==='1'&&_0x2296d1['paused']==='0'&&this[_0x3900('0x22')][_0x2296d1[_0x3900('0xfa')]][_0x3900('0x104')]){this[_0x3900('0x22')][_0x2296d1[_0x3900('0xfa')]][_0x3900('0x104')]=![];this[_0x3900('0x2b')][_0x7b6c7c[_0x3900('0x26')][_0x1333c0[_0x3900('0xf4')]][_0x3900('0xc1')]]=[];this[_0x3900('0x1f')][_0x3900('0xfc')](_0x2296d1[_0x3900('0xfb')],_0x2296d1[_0x3900('0xfa')])['catch'](function(_0x2960de){logger[_0x3900('0x67')]('[Catch][Preview][syncQueueStatusComplete]',util[_0x3900('0x47')](_0x2960de,{'showHidden':![],'depth':null}));})[_0x3900('0x1d')](function(){utils[_0x3900('0xce')](_0x7b6c7c[_0x3900('0x20')][_0x7b6c7c[_0x3900('0x26')][_0x1333c0[_0x3900('0xf4')]]['queue']],'[syncQueueStatusComplete]');setTimeout(function(){_0x7b6c7c['agents'][_0x2296d1[_0x3900('0xfa')]][_0x3900('0x104')]=!![];loggerBooked[_0x3900('0x4b')](_0x3900('0x107'),_0x1333c0[_0x3900('0xf4')],_0x3900('0x105'),JSON[_0x3900('0x87')](_['pick'](_0x7b6c7c[_0x3900('0x22')][_0x2296d1['stateinterface']],[_0x3900('0x49'),_0x3900('0x104')])),_0x3900('0x106'),JSON[_0x3900('0x87')](_0x2296d1[_0x3900('0xfb')]));},0xc7);delete _0x7b6c7c[_0x3900('0x26')][_0x1333c0[_0x3900('0xf4')]];unlockQueueStatus(_0x455409,_0x1333c0[_0x3900('0xf4')]);});}else{loggerBooked[_0x3900('0x4b')](_0x3900('0x108'));utils[_0x3900('0xce')](this[_0x3900('0x20')][this[_0x3900('0x26')][_0x1333c0[_0x3900('0xf4')]][_0x3900('0xc1')]],'[syncQueueStatusComplete]');hopperUtils[_0x3900('0xdd')]({'active':![],'ContactId':this[_0x3900('0x26')][_0x1333c0['actionid']]['ContactId'],'ListId':this[_0x3900('0x26')][_0x1333c0[_0x3900('0xf4')]][_0x3900('0xe0')],'VoiceQueueId':this[_0x3900('0x26')][_0x1333c0[_0x3900('0xf4')]][_0x3900('0xff')]||undefined,'CampaignId':this[_0x3900('0x26')][_0x1333c0['actionid']][_0x3900('0xe1')]||undefined})['catch'](loggerCatch(_0x3900('0x100')));delete this[_0x3900('0x26')][_0x1333c0[_0x3900('0xf4')]];unlockQueueStatus(_0x455409);}}else{loggerBooked[_0x3900('0x4b')](_0x3900('0x109'));utils[_0x3900('0xce')](this[_0x3900('0x20')][this[_0x3900('0x26')][_0x1333c0['actionid']][_0x3900('0xc1')]],_0x3900('0xfe'));hopperUtils['rescheduleContact']({'active':![],'ContactId':this[_0x3900('0x26')][_0x1333c0[_0x3900('0xf4')]][_0x3900('0xdf')],'ListId':this['actions'][_0x1333c0['actionid']]['ListId'],'VoiceQueueId':this['actions'][_0x1333c0[_0x3900('0xf4')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x3900('0x26')][_0x1333c0[_0x3900('0xf4')]][_0x3900('0xe1')]||undefined})[_0x3900('0xa4')](loggerCatch('[unlock2][syncQueueStatusComplete]'));delete this[_0x3900('0x26')][_0x1333c0[_0x3900('0xf4')]];unlockQueueStatus(_0x455409);}}else{loggerBooked[_0x3900('0x4b')](_0x3900('0x10a'));utils[_0x3900('0xce')](this[_0x3900('0x20')][this[_0x3900('0x26')][_0x1333c0[_0x3900('0xf4')]][_0x3900('0xc1')]],'[syncQueueStatusComplete]');hopperUtils[_0x3900('0xdd')]({'active':![],'ContactId':this[_0x3900('0x26')][_0x1333c0[_0x3900('0xf4')]]['ContactId'],'ListId':this[_0x3900('0x26')][_0x1333c0[_0x3900('0xf4')]][_0x3900('0xe0')],'VoiceQueueId':this[_0x3900('0x26')][_0x1333c0[_0x3900('0xf4')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x3900('0x26')][_0x1333c0[_0x3900('0xf4')]][_0x3900('0xe1')]||undefined})[_0x3900('0xa4')](loggerCatch('[unlock3][syncQueueStatusComplete]'));delete this[_0x3900('0x26')][_0x1333c0[_0x3900('0xf4')]];unlockQueueStatus(_0x455409);}};Dialer['prototype']['syncOriginateResponse']=function(_0x668ee6){var _0x484bc1=this['actions'][_0x668ee6[_0x3900('0xf4')]];if(_0x484bc1){delete this['actions'][_0x668ee6[_0x3900('0xf4')]];_0x484bc1['responsetime']=moment()['format'](_0x3900('0xc5'));var _0xb18157=_0x484bc1[_0x3900('0x45')]===_0x3900('0xc2')?this[_0x3900('0x21')][_0x484bc1[_0x3900('0xc1')]]:this[_0x3900('0x20')][_0x484bc1['getQueue']()];if(_0x668ee6[_0x3900('0x10b')]!=='Success'){utils['decrementOriginate'](_0xb18157,_0x3900('0x10c'));return this[_0x3900('0x10d')](_0x484bc1,_0xb18157,_0x668ee6)[_0x3900('0xa4')](loggerCatch('[callProgressDetecting]\x20'));}this[_0x3900('0x28')][_0x668ee6[_0x3900('0xc4')]]=_0x484bc1;}};Dialer[_0x3900('0x1a')][_0x3900('0x3a')]=function(_0x451fa7){var _0x16f4eb=this;var _0x30eaad=this['uniqueId'][_0x451fa7['uniqueid']];var _0x426168;if(!_[_0x3900('0x103')](_0x451fa7)&&!_[_0x3900('0x103')](_0x451fa7[_0x3900('0x10e')])&&!_[_0x3900('0x103')](_0x451fa7[_0x3900('0x10e')][_0x3900('0x10f')])&&_0x451fa7['exten']===_0x3900('0x110')&&_0x30eaad){if(_0x30eaad['type']!==_0x3900('0xc2')&&this['voiceQueues'][_0x30eaad[_0x3900('0xc1')]][_0x3900('0x111')]&&_0x451fa7[_0x3900('0x112')]===_0x3900('0x113')){delete this['uniqueId'][_0x451fa7[_0x3900('0xc4')]];utils['decrementOriginate'](this[_0x3900('0x20')][_0x30eaad[_0x3900('0xc1')]],'[syncVarSet]');this[_0x3900('0x20')][_0x30eaad[_0x3900('0xc1')]][_0x3900('0xc6')]+=0x1;this[_0x3900('0x20')][_0x30eaad[_0x3900('0xc1')]]['outboundAnswerAgiCallsDay']+=0x1;_0x426168=new Hangup(_0x30eaad,_0x451fa7);_0x426168[_0x3900('0x6f')]=0x12;_0x426168[_0x3900('0x70')]=_0x3900('0x114');_0x426168[_0x3900('0x115')]='AMD';ami['emit'](_0x3900('0x116'),ut['buildObj'](_0x426168,'amd'));this['saveInDb'](_0x426168,_0x3900('0x117'),_0x3900('0x118'));}if(_0x30eaad[_0x3900('0x45')]!==_0x3900('0xc2')&&this[_0x3900('0x20')][_0x30eaad[_0x3900('0xc1')]][_0x3900('0x111')]&&_0x451fa7['value']===_0x3900('0x119')){return new Promise(function(_0x16bae4,_0x2c5dc7){delete _0x16f4eb[_0x3900('0x28')][_0x451fa7[_0x3900('0xc4')]];utils[_0x3900('0xce')](_0x16f4eb[_0x3900('0x20')][_0x30eaad[_0x3900('0xc1')]],_0x3900('0x11a'));_0x16f4eb['voiceQueues'][_0x30eaad[_0x3900('0xc1')]]['outboundAnswerCallsDay']+=0x1;_0x16f4eb['voiceQueues'][_0x30eaad[_0x3900('0xc1')]][_0x3900('0x11b')]+=0x1;var _0x1b2e93=_0x16f4eb[_0x3900('0x20')][_0x30eaad[_0x3900('0xc1')]];var _0x4eccec=new Hangup(_0x30eaad,_0x451fa7);_0x4eccec[_0x3900('0x6f')]=0x13;_0x4eccec[_0x3900('0x70')]=_0x3900('0x11c');_0x4eccec[_0x3900('0x115')]=_0x3900('0x11d');_0x4eccec[_0x3900('0x11e')]+=0x1;_0x4eccec[_0x3900('0xd7')]+=0x1;_0x4eccec[_0x3900('0x11f')]=!![];ami['emit'](_0x3900('0x116'),ut['buildObj'](_0x4eccec,'amd'));hopperUtils['createHistory'](_0x4eccec)[_0x3900('0xa4')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x4eccec[_0x3900('0x120')]+_0x4eccec['countcongestionretry']+_0x4eccec[_0x3900('0x121')]+_0x4eccec['countnosuchnumberretry']+_0x4eccec['countdropretry']+_0x4eccec['countabandonedretry']+_0x4eccec[_0x3900('0x11e')]+_0x4eccec[_0x3900('0x122')]>=_0x1b2e93[_0x3900('0x123')]){_0x16f4eb[_0x3900('0x124')](_0x4eccec,_0x16bae4,_0x2c5dc7,_0x3900('0x125'));}else{if(_0x4eccec[_0x3900('0x11e')]>=_0x1b2e93[_0x3900('0x126')]){_0x16f4eb[_0x3900('0x127')](_0x4eccec,_0x16bae4,_0x2c5dc7,_0x3900('0x128'));}else{hopperUtils[_0x3900('0xdd')]({'active':![],'countmachineretry':_0x4eccec[_0x3900('0x11e')],'scheduledat':moment()[_0x3900('0xef')](_0x1b2e93[_0x3900('0x129')],_0x3900('0xde'))[_0x3900('0x88')](_0x3900('0xc5')),'ContactId':_0x4eccec[_0x3900('0xdf')],'ListId':_0x4eccec[_0x3900('0xe0')],'VoiceQueueId':_0x4eccec[_0x3900('0xff')]||undefined,'CampaignId':_0x4eccec[_0x3900('0xe1')]||undefined})['catch'](loggerCatch(_0x3900('0x12a')));_0x16bae4({'reschedule':0x1});}}});}if(_0x30eaad[_0x3900('0x45')]==='ivr'&&this['campaigns'][_0x30eaad['queue']][_0x3900('0x111')]&&_0x451fa7['value']==='HANGUP'){delete this['uniqueId'][_0x451fa7['uniqueid']];utils[_0x3900('0xce')](this['campaigns'][_0x30eaad[_0x3900('0xc1')]],_0x3900('0x11a'));_0x426168=new Hangup(_0x30eaad,_0x451fa7);_0x426168[_0x3900('0x6f')]=0x12;_0x426168[_0x3900('0x70')]='HangupInAMD';_0x426168[_0x3900('0x115')]=_0x3900('0x11d');ami[_0x3900('0x44')](_0x3900('0x116'),ut[_0x3900('0x12b')](_0x426168,_0x3900('0x11f')));this[_0x3900('0x12c')](_0x426168,_0x3900('0x12d'),_0x3900('0x12e'));}if(_0x30eaad['type']===_0x3900('0xc2')&&this[_0x3900('0x21')][_0x30eaad[_0x3900('0xc1')]]['dialAMDActive']&&_0x451fa7[_0x3900('0x112')]===_0x3900('0x119')){return new Promise(function(_0x2b16bd,_0x5a64a3){delete _0x16f4eb[_0x3900('0x28')][_0x451fa7['uniqueid']];utils[_0x3900('0xce')](_0x16f4eb[_0x3900('0x21')][_0x30eaad[_0x3900('0xc1')]],_0x3900('0x11a'));_0x16f4eb[_0x3900('0x21')][_0x30eaad[_0x3900('0xc1')]][_0x3900('0xc6')]+=0x1;_0x16f4eb['campaigns'][_0x30eaad['queue']][_0x3900('0x11b')]+=0x1;var _0x51350d=_0x16f4eb[_0x3900('0x21')][_0x30eaad[_0x3900('0xc1')]];var _0x248cd1=new Hangup(_0x30eaad,_0x451fa7);_0x248cd1[_0x3900('0x6f')]=0x13;_0x248cd1['statedesc']='Machine';_0x248cd1[_0x3900('0x115')]='AMD';_0x248cd1[_0x3900('0x11e')]+=0x1;_0x248cd1[_0x3900('0xd7')]+=0x1;_0x248cd1[_0x3900('0x11f')]=!![];ami[_0x3900('0x44')](_0x3900('0x116'),ut[_0x3900('0x12b')](_0x248cd1,_0x3900('0x11f')));hopperUtils[_0x3900('0xcb')](_0x248cd1)['catch'](loggerCatch(_0x3900('0x12f')));if(_0x248cd1[_0x3900('0x120')]+_0x248cd1[_0x3900('0x130')]+_0x248cd1[_0x3900('0x121')]+_0x248cd1[_0x3900('0x131')]+_0x248cd1[_0x3900('0x132')]+_0x248cd1[_0x3900('0xea')]+_0x248cd1[_0x3900('0x11e')]+_0x248cd1[_0x3900('0x122')]>=_0x51350d[_0x3900('0x123')]){_0x16f4eb['stateGlobal'](_0x248cd1,_0x2b16bd,_0x5a64a3,_0x3900('0x125'));}else{if(_0x248cd1[_0x3900('0x11e')]>=_0x51350d[_0x3900('0x126')]){_0x16f4eb[_0x3900('0x127')](_0x248cd1,_0x2b16bd,_0x5a64a3,'reason\x2019\x20machine....');}else{hopperUtils[_0x3900('0xdd')]({'active':![],'countmachineretry':_0x248cd1[_0x3900('0x11e')],'scheduledat':moment()['add'](_0x51350d[_0x3900('0x129')],_0x3900('0xde'))[_0x3900('0x88')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x248cd1[_0x3900('0xdf')],'ListId':_0x248cd1[_0x3900('0xe0')],'VoiceQueueId':_0x248cd1['VoiceQueueId']||undefined,'CampaignId':_0x248cd1[_0x3900('0xe1')]||undefined})[_0x3900('0xa4')](loggerCatch('[rescheduleContact][Machine]'));_0x2b16bd({'reschedule':0x1});}}});}}};Dialer['prototype'][_0x3900('0x38')]=function(_0x1ee776){var _0x1e5e68=this[_0x3900('0x28')][_0x1ee776['uniqueid']];var _0x4d478f;if(!_0x1e5e68){return;}if(_0x1e5e68['type']==='ivr'){delete this[_0x3900('0x28')][_0x1ee776['uniqueid']];utils[_0x3900('0xce')](this['campaigns'][_0x1e5e68[_0x3900('0xc1')]],'[syncHangup]');this[_0x3900('0x21')][_0x1e5e68['queue']][_0x3900('0x133')]+=0x1;if(_0x1ee776[_0x3900('0x134')]===_0x3900('0x135')){const _0xebe667=new AgentComplete(_0x1e5e68,_0x1ee776);_0xebe667[_0x3900('0xe1')]=this[_0x3900('0x21')][_0x1e5e68['queue']]['id'];hopperUtils[_0x3900('0xcb')](_0xebe667)[_0x3900('0xa4')](loggerCatch(_0x3900('0x136')));hopperUtils['moveContactManagedDialer'](_0xebe667)['catch'](loggerCatch(_0x3900('0x137')));}else{_0x4d478f=new Hangup(_0x1e5e68,_0x1ee776);hopperUtils['createHistory'](_0x4d478f)[_0x3900('0xa4')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0x3900('0x138')](_0x4d478f)[_0x3900('0xa4')](loggerCatch(_0x3900('0x139')));}}else{if(isNotNull(this[_0x3900('0x20')][_0x1e5e68[_0x3900('0xc1')]][_0x3900('0x13a')])){delete this[_0x3900('0x28')][_0x1ee776[_0x3900('0xc4')]];utils[_0x3900('0xce')](this['voiceQueues'][_0x1e5e68['queue']],'[syncHangup]');this[_0x3900('0x20')][_0x1e5e68[_0x3900('0xc1')]]['outboundAnswerCallsDay']+=0x1;this[_0x3900('0x20')][_0x1e5e68['queue']][_0x3900('0x11b')]+=0x1;_0x4d478f=new Hangup(_0x1e5e68,_0x1ee776);_0x4d478f[_0x3900('0x6f')]=0x10;_0x4d478f[_0x3900('0x70')]=_0x3900('0x13b');_0x4d478f['membername']=_0x3900('0x13c');hopperUtils[_0x3900('0xcb')](_0x4d478f)[_0x3900('0xa4')](loggerCatch(_0x3900('0x13d')));hopperUtils['moveContactManagedDialer'](_0x4d478f)[_0x3900('0xa4')](loggerCatch(_0x3900('0x139')));}else{delete this[_0x3900('0x28')][_0x1ee776[_0x3900('0xc4')]];utils[_0x3900('0xce')](this[_0x3900('0x20')][_0x1e5e68[_0x3900('0xc1')]],_0x3900('0x13e'));if(_0x1ee776[_0x3900('0x134')]===_0x3900('0x135')){this[_0x3900('0x20')][_0x1e5e68[_0x3900('0xc1')]][_0x3900('0xc6')]+=0x1;const _0x5ac8b2=new AgentComplete(_0x1e5e68,_0x1ee776);_0x5ac8b2[_0x3900('0xff')]=this[_0x3900('0x20')][_0x1e5e68[_0x3900('0xc1')]]['id'];hopperUtils[_0x3900('0xcb')](_0x5ac8b2)['catch'](loggerCatch(_0x3900('0xcc')));hopperUtils[_0x3900('0x138')](_0x5ac8b2)[_0x3900('0xa4')](loggerCatch(_0x3900('0xcd')));}else{this[_0x3900('0x20')][_0x1e5e68[_0x3900('0xc1')]][_0x3900('0x13f')]+=0x1;_0x4d478f=new Hangup(_0x1e5e68,_0x1ee776);_0x4d478f['state']=0xc;_0x4d478f['statedesc']=_0x1ee776[_0x3900('0x134')];_0x4d478f[_0x3900('0x115')]=_0x3900('0x140');hopperUtils[_0x3900('0xcb')](_0x4d478f)[_0x3900('0xa4')](loggerCatch(_0x3900('0x141')));hopperUtils['moveContactManagedDialer'](_0x4d478f)[_0x3900('0xa4')](loggerCatch(_0x3900('0x142')));}}}};Dialer[_0x3900('0x1a')][_0x3900('0xc')]=function(_0x5718ca){var _0x5daa7f=this;if(!_0x5daa7f[_0x3900('0x2c')][_0x5718ca[_0x3900('0x49')]]){_0x5daa7f[_0x3900('0x2c')][_0x5718ca[_0x3900('0x49')]]={'running':![]};}else if(_0x5daa7f[_0x3900('0x2c')][_0x5718ca[_0x3900('0x49')]]['running']===!![]){return;}else if(_0x5daa7f[_0x3900('0x2c')][_0x5718ca[_0x3900('0x49')]][_0x3900('0x143')]===![]){_0x5daa7f['queuesSummary'][_0x5718ca[_0x3900('0x49')]][_0x3900('0x143')]=!![];}var _0x5ba29b=_0x5daa7f['voiceQueues'][_0x5718ca[_0x3900('0x49')]];var _0x31037d=_0x5ba29b['message']!==utils['CAMPAIGN_STATUS'][_0x3900('0x7b')];var _0x156cf5=utils['isPreviewCampaign'](_0x5ba29b);_0x5ba29b[_0x3900('0x144')]=utils[_0x3900('0x145')](_0x5ba29b,_0x5daa7f[_0x3900('0x23')]);Promise[_0x3900('0x146')]()[_0x3900('0x41')](function(){if(_0x5ba29b[_0x3900('0x144')]===utils[_0x3900('0x6b')][_0x3900('0x7b')]){if(_0x31037d){clearPredictiveAttributes(_0x5ba29b);_0x5718ca[_0x3900('0x65')]=undefined;_0x5718ca[_0x3900('0x2a')]=undefined;}if(_0x5ba29b[_0x3900('0x144')]===utils[_0x3900('0x6b')][_0x3900('0x7b')]){_0x5718ca[_0x3900('0x147')]=0x0;_0x5718ca['paused']=0x0;_0x5718ca[_0x3900('0x148')]=0x0;_0x5718ca['talking']=0x0;_0x5718ca[_0x3900('0x149')]=0x0;}}else if(_0x5ba29b[_0x3900('0x144')]===utils[_0x3900('0x6b')][_0x3900('0x14a')]&&!_0x156cf5){return _0x5daa7f[_0x3900('0x93')](_0x5ba29b,!![])[_0x3900('0x41')](function(){return _0x5daa7f[_0x3900('0x93')](_0x5ba29b,![]);})['then'](function(){return _0x5daa7f[_0x3900('0x14b')](_0x5ba29b);})['catch'](function(_0xdcdf12){loggerSyncQueueSummary['debug']('[syncQueueSummary]',util[_0x3900('0x47')](_0xdcdf12,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x5ba29b);});}else{clearPredictiveAttributes(_0x5ba29b);}})['then'](function(){var _0x1d3a9a=_0x5718ca[_0x3900('0x14c')](_0x5ba29b);if(_0x1d3a9a||_0x5ba29b[_0x3900('0x14d')]){_0x5ba29b[_0x3900('0x14d')]=![];_0x5718ca['updateReportFromOutboundQueue'](_0x5ba29b);Object[_0x3900('0x14e')](_0x5ba29b,_0x5718ca);emitOutboundVoiceQueueSummary(_0x5718ca);}_0x5daa7f['queuesSummary'][_0x5ba29b[_0x3900('0x49')]]['running']=![];})['catch'](function(_0x1c6d41){logger[_0x3900('0x67')](_0x3900('0x14f'),util[_0x3900('0x47')](_0x1c6d41,{'showHidden':![],'depth':null}));_0x5daa7f[_0x3900('0x2c')][_0x5ba29b[_0x3900('0x49')]][_0x3900('0x143')]=![];});};Dialer['prototype'][_0x3900('0x36')]=_[_0x3900('0x150')](function(){var _0x5d80f6=_[_0x3900('0x151')](this[_0x3900('0x20')],function(_0x24badb){return _0x24badb['dialPreviewRecallmeReminder'];});var _0xc94184=_[_0x3900('0x151')](this['agents'],function(_0x3c8513){return _0x3c8513['online']&&_0x3c8513[_0x3900('0x8a')]===_0x3900('0x152');});if(_0x5d80f6[_0x3900('0x9b')]>0x0&&_0xc94184[_0x3900('0x9b')]>0x0){return Promise[_0x3900('0x146')]()[_0x3900('0x41')](cmHopper[_0x3900('0x153')](_['map'](_0x5d80f6,'id'),previewRecallmeReminderInterval,_['map'](_0xc94184,'id')))[_0x3900('0x41')](function(_0x1053d8){for(var _0x3e0de8=0x0;_0x3e0de8<_0x1053d8[_0x3900('0x9b')];_0x3e0de8++){var _0x2b0689=_0x1053d8[_0x3e0de8][_0x3900('0x154')][_0x3900('0x49')];if(_0x2b0689)io['to'](util[_0x3900('0x88')](_0x3900('0x155'),_0x2b0689))[_0x3900('0x44')](_0x3900('0x156'),{'hopper':_0x1053d8[_0x3e0de8]});}})[_0x3900('0xa4')](function(_0xc5288c){logger[_0x3900('0x67')](_0x3900('0x157'),_0xc5288c);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x3900('0x1a')]['loopClearZombieChannels']=function(){var _0x5e1c64=this;setInterval(function(){_0x5e1c64[_0x3900('0x158')](_0x5e1c64['uniqueId'],_0x3900('0x159'));_0x5e1c64[_0x3900('0x158')](_0x5e1c64[_0x3900('0x26')],'[actions]');},0x32c8);};Dialer[_0x3900('0x1a')][_0x3900('0x158')]=function(_0x144274,_0x16b171){var _0x12e5f4=this;for(var _0x3f966b in _0x144274){if(typeof _0x144274[_0x3f966b]!=='undefined'){this['sequence']['enqueue'](function(){if(!_[_0x3900('0x103')](_0x144274[_0x3f966b])){return ami[_0x3900('0x9d')]({'action':'status','channel':_0x144274[_0x3f966b][_0x3900('0xf3')]})['catch'](function(_0x1f128a){if(_0x1f128a[_0x3900('0x6a')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x144274[_0x3f966b]&&_0x144274[_0x3f966b][_0x3900('0x45')]!==_0x3900('0xc2')){utils[_0x3900('0xce')](_0x12e5f4['voiceQueues'][_0x144274[_0x3f966b][_0x3900('0xc1')]],_0x3900('0x15a'));logger['error'](_0x3900('0x15b'),_0x16b171,_0x3f966b,_0x144274[_0x3f966b][_0x3900('0xc1')]);delete _0x144274[_0x3f966b];}if(_0x144274[_0x3f966b]&&_0x144274[_0x3f966b]['type']===_0x3900('0xc2')){utils[_0x3900('0xce')](_0x12e5f4[_0x3900('0x21')][_0x144274[_0x3f966b][_0x3900('0xc1')]],_0x3900('0x15a'));logger[_0x3900('0x67')](_0x3900('0x15c'),_0x16b171,_0x3f966b,_0x144274[_0x3f966b][_0x3900('0xc1')]);delete _0x144274[_0x3f966b];}},0x2328);}});}});}}};Dialer[_0x3900('0x1a')][_0x3900('0x15d')]=function(_0x3d03eb){return Promise[_0x3900('0x146')]()[_0x3900('0x41')](voiceQueueRt[_0x3900('0x15d')](_0x3d03eb))[_0x3900('0xa4')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0x3900('0x1a')]['emptyContact']=function(_0x485f23,_0x5a3145,_0x27ba2d){var _0x181101={'state':0x19,'statedesc':'notFound'};utils[_0x3900('0xce')](_0x5a3145,_0x3900('0x15e')+_0x485f23);this[_0x3900('0x12c')](_[_0x3900('0x62')](_0x181101,_['pick'](_0x27ba2d,[_0x3900('0xdf'),_0x3900('0xe0'),_0x3900('0x15f'),_0x3900('0xff'),'CampaignId'])),_0x3900('0x160'),'[emptyContact]');logger[_0x3900('0x67')](_0x485f23);};Dialer['prototype'][_0x3900('0x12c')]=function(_0x43d1d9,_0x5946e8,_0x45bbcd){hopperUtils[_0x3900('0xcb')](_0x43d1d9)[_0x3900('0xa4')](loggerCatch(_0x5946e8));hopperUtils['moveContactManagedDialer'](_0x43d1d9)[_0x3900('0xa4')](loggerCatch(_0x45bbcd));};Dialer['prototype'][_0x3900('0xdb')]=function(_0x5ebc25,_0x3fe467){hopperUtils[_0x3900('0xcb')](_0x5ebc25)[_0x3900('0xa4')](loggerCatch('[syncAgentComplete][createHistory]'));if(_0x3fe467==0x0){hopperUtils['moveContactManagedDialer'](_0x5ebc25)[_0x3900('0xa4')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));}};Dialer[_0x3900('0x1a')][_0x3900('0x157')]=function(_0x9d5f29){return Promise[_0x3900('0x146')]()[_0x3900('0x41')](cmHopper[_0x3900('0x153')](_0x9d5f29['id'],previewRecallmeReminderInterval))['then'](function(_0x190cd7){for(var _0x4c988b=0x0;_0x4c988b<_0x190cd7[_0x3900('0x9b')];_0x4c988b++){var _0x372d84=_0x190cd7[_0x4c988b][_0x3900('0x154')][_0x3900('0x49')];if(_0x372d84)io['to'](util[_0x3900('0x88')](_0x3900('0x155'),_0x372d84))[_0x3900('0x44')](_0x3900('0x156'),{'hopper':_0x190cd7[_0x4c988b]});}})[_0x3900('0xa4')](function(){});};Dialer[_0x3900('0x1a')][_0x3900('0x161')]=function(_0x3de160){var _0x3b52d3=this;return function(){_0x3b52d3['handleIvr'](_0x3de160);};};Dialer['prototype']['actionOriginate']=function(_0x284cb9,_0x25db08){var _0x50a83b=this;var _0x12d30f=uuid['v4']();this[_0x3900('0x26')][_0x12d30f]=new Action(_0x284cb9,_0x25db08,_0x12d30f);return new Promise(function(_0x491978,_0x28904a){if(_[_0x3900('0x43')](_0x284cb9)&&typeof _0x284cb9!==_0x3900('0x162')){return _0x28904a(msgResponse(_0x3900('0x163'),_0x3900('0xa8'),_0x3900('0x164')));}if(_[_0x3900('0x43')](_0x25db08[_0x3900('0x165')])||_0x25db08[_0x3900('0x165')]===null){return _0x28904a(msgResponse(_0x3900('0x163'),_0x3900('0xa8'),_0x3900('0x166')));}var _0xbfc54f={'XMD-CALLERID':_0x50a83b[_0x3900('0x26')][_0x12d30f][_0x3900('0x167')](),'XMD-AGI':_0x284cb9[_0x3900('0x13a')]?util[_0x3900('0x88')]('\x22agi://%s/square,%s\x22',ipAgi,_0x284cb9[_0x3900('0x13a')]):_0x3900('0x168'),'XMD-AGIAFTER':_0x284cb9['dialQueueProject2']?util[_0x3900('0x88')](_0x3900('0x169'),ipAgi,_0x284cb9[_0x3900('0xc9')]):_0x3900('0x168'),'XMD-QUEUE':utils[_0x3900('0x16a')](_0x284cb9)?util[_0x3900('0x88')](_0x3900('0x16b'),_0x284cb9[_0x3900('0x49')],_0x284cb9[_0x3900('0x16c')]||'',_0x284cb9[_0x3900('0xca')]?'c':'',_0x284cb9[_0x3900('0xd2')]||0x3):'NONE','XMD-CONTACTID':_0x25db08[_0x3900('0xdf')],'XMD-CDRTYPE':_0x3900('0x9'),'CALLERID(all)':_0x50a83b[_0x3900('0x26')][_0x12d30f][_0x3900('0x167')](),'XMD-AMD':_0x284cb9[_0x3900('0x111')]?_0x3900('0x14a'):_0x3900('0x168'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x284cb9[_0x3900('0x111')]){_0xbfc54f[_0x3900('0x16d')]=_0x284cb9[_0x3900('0x16e')]||0x9c4;_0xbfc54f[_0x3900('0x16f')]=_0x284cb9[_0x3900('0x170')]||0x5dc;_0xbfc54f[_0x3900('0x171')]=_0x284cb9[_0x3900('0x172')]||0x320;_0xbfc54f[_0x3900('0x173')]=_0x284cb9[_0x3900('0x174')]||0x1388;_0xbfc54f[_0x3900('0x175')]=_0x284cb9[_0x3900('0x176')]||0x64;_0xbfc54f[_0x3900('0x177')]=_0x284cb9[_0x3900('0x178')]||0x32;_0xbfc54f[_0x3900('0x179')]=_0x284cb9['dialAMDMaximumNumberOfWords']||0x3;_0xbfc54f[_0x3900('0x17a')]=_0x284cb9[_0x3900('0x17b')]||0x100;_0xbfc54f[_0x3900('0x17c')]=_0x284cb9[_0x3900('0x17d')]||0x1388;}if(utils[_0x3900('0x16a')](_0x284cb9)){_0xbfc54f[_0x3900('0x17e')]=_0x25db08[_0x3900('0xff')];}else{_0xbfc54f[_0x3900('0x17f')]=_0x25db08[_0x3900('0xe1')];}var _0x482046=utils[_0x3900('0x180')](_0x25db08[_0x3900('0x181')]);Object[_0x3900('0x14e')](_0xbfc54f,_0x482046);var _0x467d63=_0x50a83b[_0x3900('0x8d')](_0x284cb9['Trunk'])?utils[_0x3900('0x182')](_0x284cb9[_0x3900('0x8e')][_0x3900('0x183')],_0x284cb9[_0x3900('0x184')],_0x284cb9['dialRandomLastDigitCallerIdNumber']>0x0?utils['getCallerIdRandom'](_0x284cb9[_0x3900('0x185')],_0x284cb9['dialRandomLastDigitCallerIdNumber']):_0x284cb9[_0x3900('0x185')]):utils['getCallerId'](_['isNil'](_0x284cb9[_0x3900('0x186')])?_0x284cb9['Trunk'][_0x3900('0x183')]:_0x284cb9[_0x3900('0x186')][_0x3900('0x183')],_0x284cb9['dialOriginateCallerIdName'],_0x284cb9[_0x3900('0x187')]>0x0?utils['getCallerIdRandom'](_0x284cb9[_0x3900('0x185')],_0x284cb9[_0x3900('0x187')]):_0x284cb9[_0x3900('0x185')]);if(_0x467d63){_0xbfc54f[_0x3900('0x188')]=_0x50a83b[_0x3900('0x26')][_0x12d30f][_0x3900('0x189')]=utils[_0x3900('0x18a')](_0x467d63);_0xbfc54f[_0x3900('0x18b')]=_0x25db08[_0x3900('0x165')];}_0x284cb9[_0x3900('0x18c')]=_0xbfc54f;return ami[_0x3900('0x9d')]({'actionid':_0x12d30f,'action':_0x3900('0x163'),'channel':_0x50a83b[_0x3900('0x8d')](_0x284cb9[_0x3900('0x8e')])?util[_0x3900('0x88')](_0x3900('0x18d'),_0x284cb9[_0x3900('0x8e')][_0x3900('0x49')],isNotNull(_0x284cb9[_0x3900('0x18e')])?_0x284cb9['dialPrefix'][_0x3900('0x18f')]()||'':'',_0x284cb9[_0x3900('0x190')]>0x0?_0x25db08['phone']['substring'](_0x284cb9[_0x3900('0x190')]):_0x25db08[_0x3900('0x165')]):util['format'](_0x3900('0x18d'),_[_0x3900('0x103')](_0x284cb9[_0x3900('0x186')])?_0x284cb9[_0x3900('0x8e')][_0x3900('0x49')]:_0x284cb9[_0x3900('0x186')][_0x3900('0x49')],isNotNull(_0x284cb9['dialPrefix'])?_0x284cb9['dialPrefix'][_0x3900('0x18f')]()||'':'',_0x284cb9[_0x3900('0x190')]>0x0?_0x25db08[_0x3900('0x165')][_0x3900('0x191')](_0x284cb9[_0x3900('0x190')]):_0x25db08[_0x3900('0x165')]),'callerid':_0x467d63,'Exten':_0x3900('0x110'),'Context':_0x3900('0x192'),'Priority':'1','variable':_0xbfc54f,'timeout':(_0x284cb9[_0x3900('0x193')]||0x1e)*0x3e8,'async':!![],'channelid':_0x12d30f})[_0x3900('0x41')](function(_0x4e3529){return _0x491978(_0x4e3529);})['catch'](function(_0x49c674){_0x284cb9[_0x3900('0x194')]+=0x1;var _0x4799e5=new History(_0x50a83b[_0x3900('0x26')][_0x12d30f]);logger[_0x3900('0x67')](util[_0x3900('0x88')](_0x3900('0x195'),JSON[_0x3900('0x87')](_0x49c674)));_0x4799e5[_0x3900('0x6f')]=0xe;_0x4799e5['statedesc']='OriginateError';_0x4799e5[_0x3900('0x72')]=moment()[_0x3900('0x88')](_0x3900('0xc5'));_0x4799e5['endtime']=_0x4799e5[_0x3900('0x72')];hopperUtils[_0x3900('0xcb')](_0x4799e5)[_0x3900('0xa4')](loggerCatch('[originate][error]'));_0x50a83b[_0x3900('0x138')](_0x4799e5)[_0x3900('0xa4')](loggerCatch('[originate][error]'))['finally'](function(){delete _0x50a83b[_0x3900('0x26')][_0x12d30f];return _0x28904a(msgResponse(_0x3900('0x163'),_0x3900('0x86'),'originate\x20action\x20Error'));});});});};Dialer['prototype']['checkRetriveMax']=function(_0x913ea8,_0x85d72d,_0x3bcd9d){var _0xb468ff=new History(_0x85d72d);if(_0xb468ff[_0x3900('0x120')]+_0xb468ff['countcongestionretry']+_0xb468ff[_0x3900('0x121')]+_0xb468ff[_0x3900('0x131')]+_0xb468ff[_0x3900('0x132')]+_0xb468ff['countabandonedretry']+_0xb468ff[_0x3900('0x11e')]+_0xb468ff['countagentrejectretry']>=_0x3bcd9d[_0x3900('0x123')]-0x1){return!![];}switch(_0x913ea8){case 0x3:if(_0xb468ff[_0x3900('0x121')]>=_0x3bcd9d['dialNoAnswerMaxRetry']-0x1){return!![];}hopperUtils[_0x3900('0xdd')]({'active':![],'countnoanswerretry':_0xb468ff['countnoanswerretry']+=0x1,'scheduledat':moment()[_0x3900('0xef')](_0x3bcd9d[_0x3900('0x196')],_0x3900('0xde'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xb468ff[_0x3900('0xdf')],'ListId':_0xb468ff[_0x3900('0xe0')],'VoiceQueueId':_0xb468ff[_0x3900('0xff')]||undefined,'CampaignId':_0xb468ff[_0x3900('0xe1')]||undefined})[_0x3900('0xa4')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0xb468ff['countbusyretry']>=_0x3bcd9d['dialBusyMaxRetry']-0x1){return!![];}hopperUtils[_0x3900('0xdd')]({'active':![],'countbusyretry':_0xb468ff[_0x3900('0x120')]+=0x1,'scheduledat':moment()[_0x3900('0xef')](_0x3bcd9d['dialBusyRetryFrequency'],_0x3900('0xde'))['format'](_0x3900('0xc5')),'ContactId':_0xb468ff[_0x3900('0xdf')],'ListId':_0xb468ff[_0x3900('0xe0')],'VoiceQueueId':_0xb468ff[_0x3900('0xff')]||undefined,'CampaignId':_0xb468ff[_0x3900('0xe1')]||undefined})[_0x3900('0xa4')](loggerCatch(_0x3900('0x197')));break;case 0x8:if(_0xb468ff[_0x3900('0x130')]>=_0x3bcd9d[_0x3900('0x198')]-0x1){return!![];}hopperUtils[_0x3900('0xdd')]({'active':![],'countcongestionretry':_0xb468ff[_0x3900('0x130')]+=0x1,'scheduledat':moment()[_0x3900('0xef')](_0x3bcd9d[_0x3900('0x199')],'minutes')[_0x3900('0x88')](_0x3900('0xc5')),'ContactId':_0xb468ff['ContactId'],'ListId':_0xb468ff[_0x3900('0xe0')],'VoiceQueueId':_0xb468ff[_0x3900('0xff')]||undefined,'CampaignId':_0xb468ff['CampaignId']||undefined})[_0x3900('0xa4')](loggerCatch(_0x3900('0x19a')));break;case 0x0:if(_0xb468ff[_0x3900('0x131')]>=_0x3bcd9d[_0x3900('0x19b')]-0x1){return!![];}else{hopperUtils['rescheduleContact']({'active':![],'countnosuchnumberretry':_0xb468ff[_0x3900('0x131')]+=0x1,'scheduledat':moment()[_0x3900('0xef')](_0x3bcd9d['dialNoSuchNumberRetryFrequency'],_0x3900('0xde'))[_0x3900('0x88')](_0x3900('0xc5')),'ContactId':_0xb468ff[_0x3900('0xdf')],'ListId':_0xb468ff['ListId'],'VoiceQueueId':_0xb468ff[_0x3900('0xff')]||undefined,'CampaignId':_0xb468ff['CampaignId']||undefined})[_0x3900('0xa4')](loggerCatch(_0x3900('0x19c')));}break;case 0xa:if(_0xb468ff[_0x3900('0x132')]>=_0x3bcd9d[_0x3900('0xda')]-0x1){return!![];}hopperUtils[_0x3900('0xdd')]({'active':![],'countdropretry':_0xb468ff[_0x3900('0x132')]+=0x1,'scheduledat':moment()[_0x3900('0xef')](_0x3bcd9d[_0x3900('0xd8')],_0x3900('0xde'))['format'](_0x3900('0xc5')),'ContactId':_0xb468ff[_0x3900('0xdf')],'ListId':_0xb468ff[_0x3900('0xe0')],'VoiceQueueId':_0xb468ff['VoiceQueueId']||undefined,'CampaignId':_0xb468ff[_0x3900('0xe1')]||undefined})[_0x3900('0xa4')](loggerCatch(_0x3900('0x19d')));break;case 0xb:if(_0xb468ff[_0x3900('0xea')]>=_0x3bcd9d[_0x3900('0xee')]-0x1){return!![];}hopperUtils[_0x3900('0xdd')]({'active':![],'countabandonedretry':_0xb468ff['countabandonedretry']+=0x1,'scheduledat':moment()[_0x3900('0xef')](_0x3bcd9d[_0x3900('0xeb')],_0x3900('0xde'))[_0x3900('0x88')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xb468ff[_0x3900('0xdf')],'ListId':_0xb468ff[_0x3900('0xe0')],'VoiceQueueId':_0xb468ff[_0x3900('0xff')]||undefined,'CampaignId':_0xb468ff[_0x3900('0xe1')]||undefined})[_0x3900('0xa4')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0xb468ff[_0x3900('0x11e')]>=_0x3bcd9d[_0x3900('0x126')]-0x1){return!![];}hopperUtils[_0x3900('0xdd')]({'active':![],'countmachineretry':_0xb468ff[_0x3900('0x11e')]+=0x1,'scheduledat':moment()[_0x3900('0xef')](_0x3bcd9d['dialMachineRetryFrequency'],_0x3900('0xde'))[_0x3900('0x88')](_0x3900('0xc5')),'ContactId':_0xb468ff[_0x3900('0xdf')],'ListId':_0xb468ff[_0x3900('0xe0')],'VoiceQueueId':_0xb468ff['VoiceQueueId']||undefined,'CampaignId':_0xb468ff[_0x3900('0xe1')]||undefined})[_0x3900('0xa4')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0xb468ff['countagentrejectretry']>=_0x3bcd9d[_0x3900('0x19e')]-0x1){return!![];}hopperUtils[_0x3900('0xdd')]({'active':![],'countagentrejectretry':_0xb468ff[_0x3900('0x122')]+=0x1,'scheduledat':moment()['add'](_0x3bcd9d[_0x3900('0x19f')],_0x3900('0xde'))['format'](_0x3900('0xc5')),'ContactId':_0xb468ff[_0x3900('0xdf')],'ListId':_0xb468ff['ListId'],'VoiceQueueId':_0xb468ff['VoiceQueueId']||undefined,'CampaignId':_0xb468ff[_0x3900('0xe1')]||undefined})['catch'](loggerCatch(_0x3900('0x1a0')));break;default:return!![];}};Dialer[_0x3900('0x1a')][_0x3900('0x10d')]=function(_0x4f30c2,_0x4e281f,_0x3fd182){var _0x8427b5=this;var _0x437604=new History(_0x4f30c2);var _0x1049cc=![];var _0x447439;var _0x281260;return new Promise(function(_0x303318,_0x291fea){if(_['isUndefined'](_0x4e281f)&&typeof _0x4e281f!=='object'){return _0x291fea(msgResponse(_0x3900('0x1a1'),_0x3900('0xa8'),_0x3900('0x1a2')));}if(_[_0x3900('0x43')](_0x3fd182)&&typeof _0x3fd182!==_0x3900('0x162')){return _0x291fea(msgResponse(_0x3900('0x1a1'),_0x3900('0xa8'),_0x3900('0x1a3')));}hopperUtils[_0x3900('0xd9')](_0x437604,_0x3fd182[_0x3900('0xc7')],_0x4e281f)[_0x3900('0x41')](function(_0x3d8c58){if(_0x3d8c58['additional']==0x1)_0x1049cc=!![];switch(_0x3fd182['reason']){case'0':_0x4e281f[_0x3900('0x1a4')]+=0x1;_0x437604[_0x3900('0x6f')]=0x0;_0x437604['statedesc']=_0x3900('0x1a5');_0x437604[_0x3900('0x131')]+=0x1;_0x437604[_0x3900('0xd7')]+=0x1;ami[_0x3900('0x44')]('custom:agentnosuchnumber',ut[_0x3900('0x12b')](_0x4f30c2,'nosuchnumber'));_0x447439=_0x4e281f['dialNoSuchNumberRetryFrequency'];_0x281260=_0x4e281f[_0x3900('0xec')];hopperUtils['createHistory'](_0x437604)[_0x3900('0xa4')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x8427b5['checkRetriveMax'](0x0,_0x4f30c2,_0x4e281f)&&!_0x1049cc){if(_0x437604['countnosuchnumberretry']>=_0x4e281f[_0x3900('0x19b')]){_0x8427b5[_0x3900('0x127')](_0x437604,_0x303318,_0x291fea,_0x3900('0x1a6'));}else{_0x8427b5[_0x3900('0x124')](_0x437604,_0x303318,_0x291fea,_0x3900('0x1a6'));}}break;case'3':_0x4e281f[_0x3900('0x1a7')]+=0x1;_0x437604[_0x3900('0x6f')]=0x3;_0x437604[_0x3900('0x70')]=_0x3900('0x1a8');_0x437604[_0x3900('0x121')]+=0x1;_0x437604[_0x3900('0xd7')]+=0x1;var _0x50a4fd=ut[_0x3900('0x1a9')](_0x4f30c2,_0x4e281f);ami[_0x3900('0x44')](_0x3900('0x1aa'),_0x50a4fd);_0x447439=_0x4e281f[_0x3900('0x196')];_0x281260=_0x4e281f[_0x3900('0xec')];hopperUtils[_0x3900('0xcb')](_0x437604)[_0x3900('0xa4')](loggerCatch(_0x3900('0x1ab')));if(_0x8427b5[_0x3900('0x1ac')](0x3,_0x4f30c2,_0x4e281f)&&!_0x1049cc){if(_0x437604[_0x3900('0x121')]>=_0x4e281f[_0x3900('0x1ad')]){_0x8427b5['createStateFinal'](_0x437604,_0x303318,_0x291fea,_0x3900('0x1ae'));}else{_0x8427b5['stateGlobal'](_0x437604,_0x303318,_0x291fea,_0x3900('0x1ae'));}}break;case'5':_0x4e281f[_0x3900('0x1af')]+=0x1;_0x437604['state']=0x5;_0x437604['statedesc']=_0x3900('0x1b0');_0x437604[_0x3900('0x120')]+=0x1;_0x437604['countglobal']+=0x1;ami[_0x3900('0x44')](_0x3900('0x1b1'),ut['buildObj'](_0x4f30c2,'busy'));_0x447439=_0x4e281f[_0x3900('0x1b2')];_0x281260=_0x4e281f['callAdditionalPhoneAfterMin'];hopperUtils[_0x3900('0xcb')](_0x437604)['catch'](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x8427b5['checkRetriveMax'](0x5,_0x4f30c2,_0x4e281f)&&!_0x1049cc){if(_0x437604[_0x3900('0x120')]>=_0x4e281f[_0x3900('0x1b3')]){_0x8427b5['createStateFinal'](_0x437604,_0x303318,_0x291fea,_0x3900('0x1b4'));}else{_0x8427b5[_0x3900('0x124')](_0x437604,_0x303318,_0x291fea,_0x3900('0x1b4'));}}break;case'8':_0x4e281f['outboundCongestionCallsDay']+=0x1;_0x437604['state']=0x8;_0x437604[_0x3900('0x70')]=_0x3900('0x1b5');_0x437604[_0x3900('0x130')]+=0x1;_0x437604['countglobal']+=0x1;_0x447439=_0x4e281f['dialCongestionRetryFrequency'];_0x281260=_0x4e281f[_0x3900('0xec')];ami[_0x3900('0x44')]('custom:agentcongestion',ut[_0x3900('0x12b')](_0x4f30c2,'congestion'));hopperUtils[_0x3900('0xcb')](_0x437604)['catch'](loggerCatch(_0x3900('0x1b6')));if(_0x8427b5['checkRetriveMax'](0x8,_0x4f30c2,_0x4e281f)&&!_0x1049cc){if(_0x437604['countcongestionretry']>=_0x4e281f[_0x3900('0x198')]){_0x8427b5[_0x3900('0x127')](_0x437604,_0x303318,_0x291fea,_0x3900('0x1b7'));}else{_0x8427b5['stateGlobal'](_0x437604,_0x303318,_0x291fea,'reason\x208\x20congestion');}}break;case'11':_0x4e281f[_0x3900('0x1b8')]+=0x1;_0x437604[_0x3900('0x6f')]=0xb;_0x437604[_0x3900('0x70')]=_0x3900('0xe8');_0x437604[_0x3900('0xea')]+=0x1;_0x437604['countglobal']+=0x1;_0x447439=_0x4e281f[_0x3900('0xeb')];_0x281260=_0x4e281f[_0x3900('0xec')];hopperUtils[_0x3900('0xcb')](_0x437604)[_0x3900('0xa4')](loggerCatch(_0x3900('0xf1')));if(_0x8427b5['checkRetriveMax'](0xb,_0x4f30c2,_0x4e281f)&&!_0x1049cc){if(_0x437604[_0x3900('0xea')]>=_0x4e281f[_0x3900('0xee')]){_0x8427b5[_0x3900('0x127')](_0x437604,_0x303318,_0x291fea,'reason\x2011\x20abandoned');}else{_0x8427b5[_0x3900('0x124')](_0x437604,_0x303318,_0x291fea,_0x3900('0x1b9'));}}break;case'20':_0x4e281f['outboundRejectCallsDay']+=0x1;_0x437604[_0x3900('0x6f')]=0x14;_0x437604[_0x3900('0x70')]=_0x3900('0x1ba');_0x437604[_0x3900('0x122')]+=0x1;_0x437604[_0x3900('0xd7')]+=0x1;_0x447439=_0x4e281f[_0x3900('0x19f')];_0x281260=_0x4e281f[_0x3900('0xec')];ami[_0x3900('0x44')](_0x3900('0x1bb'),ut[_0x3900('0x12b')](_0x4f30c2,_0x3900('0x1bc')));hopperUtils[_0x3900('0xcb')](_0x437604)[_0x3900('0xa4')](loggerCatch(_0x3900('0x1bd')));if(_0x8427b5['checkRetriveMax'](0x14,_0x4f30c2,_0x4e281f)&&!_0x1049cc){if(_0x437604['countagentrejectretry']>=_0x4e281f['dialAgentRejectMaxRetry']){_0x8427b5[_0x3900('0x127')](_0x437604,_0x303318,_0x291fea,_0x3900('0x1be'));}else{_0x8427b5[_0x3900('0x124')](_0x437604,_0x303318,_0x291fea,_0x3900('0x1be'));}}break;default:_0x4e281f[_0x3900('0x13f')]+=0x1;_0x437604['state']=0xc;_0x437604[_0x3900('0x70')]=_0x3fd182[_0x3900('0xc7')];_0x447439=_0x4e281f[_0x3900('0x19f')];_0x281260=_0x4e281f[_0x3900('0xec')];hopperUtils[_0x3900('0xcb')](_0x437604)[_0x3900('0xa4')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x8427b5[_0x3900('0x1ac')](_0x3fd182[_0x3900('0xc7')],_0x4f30c2,_0x4e281f)&&!_0x1049cc){if(_0x437604[_0x3900('0x120')]+_0x437604[_0x3900('0x130')]+_0x437604[_0x3900('0x121')]+_0x437604[_0x3900('0x131')]+_0x437604[_0x3900('0x132')]+_0x437604['countabandonedretry']+_0x437604[_0x3900('0x11e')]+_0x437604['countagentrejectretry']>=_0x4e281f[_0x3900('0x123')]){_0x8427b5['stateGlobal'](_0x437604,_0x303318,_0x291fea,_0x3fd182[_0x3900('0xc7')]);}else{_0x8427b5['createStateFinal'](_0x437604,_0x303318,_0x291fea,_0x3fd182[_0x3900('0xc7')]);}}}})[_0x3900('0x41')](function(){if(_0x1049cc){hopperUtils[_0x3900('0xe5')](_0x437604,_0x447439,_0x281260)[_0x3900('0x41')](function(){return _0x303318(0x1);});}});});};Dialer[_0x3900('0x1a')]['stateGlobal']=function(_0x310f92,_0x38e6ce,_0x4edeaf,_0x378272){var _0x5ca5f7=new Final(_0x310f92);_0x5ca5f7['state']=0xf;_0x5ca5f7[_0x3900('0x70')]=_0x3900('0x1bf');this[_0x3900('0x127')](_0x5ca5f7,_0x38e6ce,_0x4edeaf,_0x378272);};Dialer[_0x3900('0x1a')][_0x3900('0x127')]=function(_0xc659c9,_0xa62ed8,_0x305dec,_0x253418){hopperUtils[_0x3900('0x138')](_0xc659c9)[_0x3900('0x41')](function(){return _0xa62ed8(msgResponse(_0x3900('0x1a1'),_0x3900('0x1c0'),_0x253418));})['catch'](function(){return _0x305dec(msgResponse('[moveContactManagedDialer][0]',_0x3900('0xa8'),_0x3900('0x1c1')));});};Dialer[_0x3900('0x1a')][_0x3900('0xb')]=function(_0x3283af){var _0x3ad536=_0x3283af[_0x3900('0x1c2')]/0x64;var _0x45e83b=_0x3283af[_0x3900('0x1c3')]/(_0x3283af['outboundDropCallsDayTimeout']+_0x3283af[_0x3900('0xc6')]);var _0x34a26b=Math[_0x3900('0x1c4')](_0x3283af[_0x3900('0x1c5')]*(_0x3283af[_0x3900('0x1c6')]/0x64));var _0x327986=Math[_0x3900('0x1c4')](_0x3283af[_0x3900('0x1c5')]*(_0x3283af[_0x3900('0x1c7')]/0x64));var _0xcb4724=_0x3283af[_0x3900('0x147')]+_0x3283af[_0x3900('0x1c8')];var _0x484daf=Math['floor'](_0x3283af[_0x3900('0x1c9')]*_0x3283af[_0x3900('0x60')]*_0x3283af['predictiveIntervalHitRate']*_0x3283af['predictiveIntervalMultiplicativeFactor']);if(_[_0x3900('0x43')](_0x3283af[_0x3900('0x2a')])){if(!_['isUndefined'](_0x3283af[_0x3900('0x65')])){_0x3283af[_0x3900('0x65')]=undefined;loggerPredictive['error'](_0x3900('0x1ca'),_0x3900('0x1cb'));}if(!_[_0x3900('0x43')](_0x3283af[_0x3900('0x66')])){loggerPredictive[_0x3900('0x67')](_0x3900('0x1ca'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x3283af[_0x3900('0x66')]);_0x3283af['handlePredictive']=undefined;}_0x3283af['startProgressive']=moment()[_0x3900('0x88')](_0x3900('0xc5'));loggerPredictive['info'](_0x3283af[_0x3900('0x49')],_0x3900('0x1cc'),_0x3283af[_0x3900('0x2a')]);this[_0x3900('0xb3')](_0x3283af,0x1);}else if(ifInterval(_0x3283af[_0x3900('0x1cd')],_0x3283af['startProgressive'])){this[_0x3900('0xb3')](_0x3283af,0x1);loggerPredictiveCalls[_0x3900('0x4b')](_0x3900('0x1ce'),_0x3283af[_0x3900('0x2a')],_0x3283af['name']);_0x3283af[_0x3900('0x1c9')]=0x0;_0x3283af[_0x3900('0x1cf')]=0x0;}else if(_0x3ad536<_0x45e83b&&_0x3283af[_0x3900('0x1d0')]===_0x3900('0x1d1')){clearPredictiveAttributes(_0x3283af);loggerPredictive['info']('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day',_0x45e83b,_0x3900('0x2a'),_0x3283af[_0x3900('0x49')]);}else if(_0x484daf<_0x3283af['predictiveIntervalErlangCallsDroppedCalls']&&_0x3283af['dialPredictiveOptimization']===_0x3900('0x1d1')){clearPredictiveAttributes(_0x3283af);loggerPredictive[_0x3900('0x4b')](_0x3900('0x1d2'),_0x3900('0x1d3'),_0x484daf,_0x3900('0x1d4'),_0x3283af[_0x3900('0x1cf')],_0x3900('0x2a'),_0x3283af[_0x3900('0x49')]);}else if(!ifInterval(_0x3283af[_0x3900('0x1cd')],_0x3283af[_0x3900('0x2a')])&&_[_0x3900('0x43')](_0x3283af[_0x3900('0x65')])&&!_[_0x3900('0x43')](_0x3283af[_0x3900('0x2a')])){_0x3283af[_0x3900('0x65')]=moment()[_0x3900('0x88')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x3900('0x4b')](_0x3283af['name'],'started\x20in\x20predictive\x20at',_0x3283af['startPredictive']);hopperUtils[_0x3900('0x1d5')](_0x3283af[_0x3900('0x1cd')])[_0x3900('0x41')](this['getDataPredictive'](_0x3283af))[_0x3900('0x41')](mergeDataErlangB(_0x3283af))[_0x3900('0x41')](this[_0x3900('0x1d6')](_0x3283af))[_0x3900('0xa4')](loggerCatchPredictive(_0x3900('0x1d7'),_0x3283af));}else if(!ifInterval(_0x3283af['dialPredictiveInterval'],_0x3283af[_0x3900('0x65')])){_0x3283af['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x3283af[_0x3900('0x65')]=moment()[_0x3900('0x88')](_0x3900('0xc5'));loggerPredictive['info'](_0x3283af[_0x3900('0x49')],_0x3900('0x1d8'),_0x3283af['startPredictive']);clearInterval(_0x3283af[_0x3900('0x66')]);_0x3283af[_0x3900('0x66')]=undefined;hopperUtils['avgHandleTime'](_0x3283af[_0x3900('0x1cd')])['then'](this['getDataPredictive'](_0x3283af))[_0x3900('0x41')](mergeDataErlangB(_0x3283af))[_0x3900('0x41')](this[_0x3900('0x1d6')](_0x3283af))[_0x3900('0xa4')](loggerCatchPredictive(_0x3900('0x1d9'),_0x3283af));}else if(_0x3283af[_0x3900('0x1c5')]&&_0xcb4724<_0x3283af[_0x3900('0x1c5')]-_0x327986){clearPredictiveAttributes(_0x3283af);loggerPredictive[_0x3900('0x4b')](_0x3283af[_0x3900('0x49')],_0x3900('0x1da'),_0xcb4724,_0x3900('0x1db'),_0x3283af[_0x3900('0x1c5')],'-',_0x327986,'=',_0x3283af[_0x3900('0x1c5')]-_0x327986,')');}else if(_0x3283af[_0x3900('0x1c5')]&&_0xcb4724>_0x3283af[_0x3900('0x1c5')]+_0x34a26b){clearPredictiveAttributes(_0x3283af);loggerPredictive[_0x3900('0x4b')](_0x3283af[_0x3900('0x49')],_0x3900('0x1da'),_0xcb4724,')\x20are\x20more\x20than\x20threshold\x20(',_0x3283af['predictiveIntervalAvailable'],'+',_0x34a26b,'=',_0x3283af[_0x3900('0x1c5')]+_0x34a26b,')');}};Dialer[_0x3900('0x1a')][_0x3900('0x1dc')]=function(_0x3be996){var _0x5bd1df=this;return function(_0x3bcca5){return new Promise(function(_0x5628f3,_0x4e95d5){_[_0x3900('0x62')](_0x3be996,_0x3bcca5[0x0]);if(checkGetDataPredictive(_0x3bcca5[0x0])){var _0x133744=_0x3be996[_0x3900('0x1c5')]=_0x3be996[_0x3900('0x1c8')]+_0x3be996['available'];var _0x4d15a5=_0x3be996[_0x3900('0x1cd')]*0x3c;var _0x490067=_0x3bcca5[0x0]['predictiveIntervalAvgTalktime']+_0x3bcca5[0x0]['predictiveIntervalAvgHoldtime'];var _0x3ad287=(_0x3bcca5[0x0][_0x3900('0x4f')]+_0x3bcca5[0x0][_0x3900('0x51')]+_0x3bcca5[0x0][_0x3900('0xe6')])/_0x3bcca5[0x0][_0x3900('0x4d')];_0x3be996[_0x3900('0x1dd')]=_0x3ad287>0x0?_0x3ad287:0x1;switch(_0x3be996[_0x3900('0x1d0')]){case _0x3900('0x1d1'):var _0x21696f=_0x3be996[_0x3900('0x1c2')]/0x64;return _0x5bd1df['abandonmentRate'](_0x133744,_0x4d15a5,_0x490067,_0x3ad287,_0x21696f)['then'](function(_0x9e0a5a){return _0x5628f3(_0x9e0a5a);});case _0x3900('0x1de'):var _0x4ef76f=_0x3be996[_0x3900('0x1c2')]/0x64;return _0x5bd1df['busyFactor'](_0x133744,_0x4d15a5,_0x490067,_0x3ad287,_0x4ef76f)[_0x3900('0x41')](function(_0x206666){return _0x5628f3(_0x206666);});default:return _0x4e95d5(msgResponse(_0x3900('0x1df'),_0x3900('0xa8'),_0x3900('0x1e0')));}}else{return _0x4e95d5(msgResponse(_0x3900('0x1df'),_0x3900('0xa8'),'check\x20failure'));}});};};Dialer['prototype'][_0x3900('0x1e1')]=function(_0x5c9d40){var _0x5994fe=this;return function(_0x49d52f){return new Promise(function(_0x257711,_0x30e9a5){_['merge'](_0x5c9d40,_0x49d52f[0x0]);if(checkGetDataPredictive(_0x49d52f[0x0])){loggerPredictive[_0x3900('0x4b')](JSON['stringify'](_0x49d52f[0x0]));if(_0x5c9d40[_0x3900('0x1d0')]===_0x3900('0x1d1')){return _0x5994fe[_0x3900('0x15d')](_0x5c9d40['id'])[_0x3900('0x41')](function(_0x501500){var _0x175931=_0x5c9d40[_0x3900('0x1e2')]-_0x501500[0x0][_0x3900('0x1e3')];var _0x49fb25=_0x5c9d40[_0x3900('0x1cd')]*0x3c;var _0x124218=_0x49d52f[0x0][_0x3900('0x56')]+_0x49d52f[0x0][_0x3900('0x54')];var _0x374037=(_0x49d52f[0x0][_0x3900('0x4f')]+_0x49d52f[0x0][_0x3900('0x51')]+_0x49d52f[0x0][_0x3900('0xe6')])/_0x49d52f[0x0][_0x3900('0x4d')];var _0x14b215=_0x5c9d40['dialPredictiveOptimizationPercentage']/0x64;_0x5c9d40[_0x3900('0x1e4')]=_0x501500[0x0]['outboundQueuePauses']||0x0;_0x5c9d40[_0x3900('0x1dd')]=_0x374037>0x0?_0x374037:0x1;return _0x5994fe[_0x3900('0x1e5')](_0x175931,_0x49fb25,_0x124218,_0x374037,_0x14b215);})['then'](function(_0x48a0fc){return _0x257711(_0x48a0fc);})[_0x3900('0xa4')](function(_0x3b785c){return _0x30e9a5(msgResponse(_0x3900('0x1e6'),_0x3900('0xa8'),JSON[_0x3900('0x87')](_0x3b785c)));});}if(_0x5c9d40[_0x3900('0x1d0')]===_0x3900('0x1de')){return _0x5994fe['getVoiceQueueRtPauses'](_0x5c9d40['id'])[_0x3900('0x41')](function(_0x3ada96){var _0x50d880=_0x5c9d40[_0x3900('0x1e2')]-_0x3ada96[0x0][_0x3900('0x1e3')];var _0x12d74f=_0x5c9d40['dialPredictiveInterval']*0x3c;var _0x5054fc=_0x49d52f[0x0][_0x3900('0x56')]+_0x49d52f[0x0][_0x3900('0x54')];var _0x3df4f7=(_0x49d52f[0x0][_0x3900('0x4f')]+_0x49d52f[0x0][_0x3900('0x51')]+_0x49d52f[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x49d52f[0x0][_0x3900('0x4d')];var _0x81976b=_0x5c9d40['dialPredictiveOptimizationPercentage']/0x64;_0x5c9d40[_0x3900('0x1e4')]=_0x3ada96[0x0]['outboundQueuePauses']||0x0;_0x5c9d40[_0x3900('0x1dd')]=_0x3df4f7>0x0?_0x3df4f7:0x1;return _0x5994fe[_0x3900('0x1e7')](_0x50d880,_0x12d74f,_0x5054fc,_0x3df4f7,_0x81976b);})['then'](function(_0xfcaa67){return _0x257711(_0xfcaa67);})[_0x3900('0xa4')](function(_0x4cec8c){return _0x30e9a5(msgResponse(_0x3900('0x1e6'),_0x3900('0xa8'),JSON[_0x3900('0x87')](_0x4cec8c)));});}}else{return _0x30e9a5(msgResponse(_0x3900('0x1df'),_0x3900('0xa8'),'check\x20failure'));}});};};Dialer['prototype']['startMethodPredictive']=function(_0x553435){var _0x3285f0=this;return function(){var _0x4fd2b4=0x0;var _0x693d7c=Math[_0x3900('0x1e8')](_0x553435[_0x3900('0x5e')]*0x3e8);if(_0x693d7c>0x0){_0x693d7c=_0x693d7c<0x64?0x64:_0x693d7c;loggerPredictive[_0x3900('0x4b')](_0x553435['name'],_0x3900('0x1e9'),_0x693d7c,_0x3900('0x1ea'));_0x553435[_0x3900('0x66')]=setInterval(function(){_0x3285f0['handlePredictive'](_0x553435);loggerPredictiveCalls[_0x3900('0x4b')](_0x3900('0x1eb'),_0x4fd2b4+=0x1);},_0x693d7c);}else{loggerPredictive['info'](_0x553435['name'],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x3900('0x1a')][_0x3900('0x1ec')]=function(_0xba3e29,_0x4912c6){var _0x28ae32=this;return function(_0x5d984a){if(_['isEmpty'](_0x5d984a)){if(_['isNil'](_0x4912c6[_0x3900('0x15f')])||!_0x4912c6[_0x3900('0x1ed')]){if(_0xba3e29[_0x3900('0xb1')]===_0x3900('0xa')){_0xba3e29['queueStatusComplete']=_['isUndefined'](_0xba3e29[_0x3900('0x73')])?!![]:_0xba3e29['queueStatusComplete'];var _0x2311ea=uuid['v4']();_0x28ae32['actions'][_0x2311ea]=new Action(_0xba3e29,_0x4912c6,_0x2311ea);loggerBooked[_0x3900('0x4b')](_0x3900('0x1ee'),_0x2311ea,_0x3900('0x1ef'),JSON['stringify'](_0xba3e29['queueStatusComplete']),_0x3900('0x1f0'),_0xba3e29[_0x3900('0x49')]);if(_0xba3e29[_0x3900('0x73')]){_0xba3e29[_0x3900('0x73')]=![];_0x28ae32[_0x3900('0x2b')][_0x28ae32[_0x3900('0x26')][_0x2311ea][_0x3900('0xc1')]]=[];ami[_0x3900('0x9d')]({'actionid':_0x2311ea,'action':_0x3900('0x1f1'),'queue':_0xba3e29[_0x3900('0x49')]})['catch'](function(){utils[_0x3900('0xce')](_0xba3e29,_0x3900('0x1f2'));hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x28ae32['actions'][_0x2311ea][_0x3900('0xdf')],'ListId':_0x28ae32[_0x3900('0x26')][_0x2311ea][_0x3900('0xe0')],'VoiceQueueId':_0x28ae32[_0x3900('0x26')][_0x2311ea]['VoiceQueueId']||undefined,'CampaignId':_0x28ae32['actions'][_0x2311ea][_0x3900('0xe1')]||undefined})[_0x3900('0xa4')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x28ae32[_0x3900('0x26')][_0x2311ea];});}else{loggerBooked[_0x3900('0x4b')]('[booked][checkContactBlack][else]',JSON[_0x3900('0x87')](_0xba3e29[_0x3900('0x73')]),_0x3900('0x1f0'),_0xba3e29[_0x3900('0x49')]);utils[_0x3900('0xce')](_0xba3e29,_0x3900('0x1f2'));hopperUtils[_0x3900('0xdd')]({'active':![],'ContactId':_0x28ae32[_0x3900('0x26')][_0x2311ea][_0x3900('0xdf')],'ListId':_0x28ae32['actions'][_0x2311ea][_0x3900('0xe0')],'VoiceQueueId':_0x28ae32[_0x3900('0x26')][_0x2311ea][_0x3900('0xff')]||undefined,'CampaignId':_0x28ae32[_0x3900('0x26')][_0x2311ea]['CampaignId']||undefined})[_0x3900('0xa4')](loggerCatch(_0x3900('0x1f3')));delete _0x28ae32['actions'][_0x2311ea];}}else{return _0x28ae32['actionOriginate'](_0xba3e29,_0x4912c6);}}else{if(utils[_0x3900('0x63')](undefined,_0x4912c6[_0x3900('0x1f4')])<_0xba3e29[_0x3900('0x1f5')]*0x3c){if(_0x4912c6['Agent']&&!_0x4912c6[_0x3900('0x154')][_0x3900('0x1f6')]){_0x28ae32[_0x3900('0x1f')]['run'](_0x4912c6['id'])['finally'](function(){utils[_0x3900('0xce')](_0xba3e29,_0x3900('0x1f2'));});}else{hopperUtils[_0x3900('0x1f7')]({'active':![]},_0x4912c6['id'],0x1)['finally'](function(){utils[_0x3900('0xce')](_0xba3e29,_0x3900('0x1f2'));});}}else{_0xba3e29['outboundReCallsDay']+=0x1;utils[_0x3900('0xce')](_0xba3e29,_0x3900('0x1f2'));if(_0xba3e29[_0x3900('0x1f8')]){hopperUtils['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x4912c6[_0x3900('0xdf')],'ListId':_0x4912c6[_0x3900('0xe0')],'VoiceQueueId':_0x4912c6['VoiceQueueId']||undefined,'CampaignId':_0x4912c6['CampaignId']||undefined})[_0x3900('0xa4')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));hopperUtils[_0x3900('0xcb')](createObjHistory(_0xba3e29,_0x4912c6,utils[_0x3900('0x6b')]['QUEUE_RECALL'],0x17,_0x3900('0x1f9')))[_0x3900('0xa4')](loggerCatch(_0x3900('0x1fa')));}else{_0x28ae32[_0x3900('0x12c')](createObjHistory(_0xba3e29,_0x4912c6,utils[_0x3900('0x6b')][_0x3900('0x1fb')],0x16,_0x3900('0x1fc')),'[Originate][HistoryRecallClose][historyCatch]',_0x3900('0x1fd'));}}}}else{_0xba3e29['outboundBlacklistCallsDay']+=0x1;_0x28ae32['saveInDb'](createObjHistory(_0xba3e29,_0x4912c6,utils[_0x3900('0x6b')][_0x3900('0x1fe')],0xd,_0x3900('0x1ff')),_0x3900('0x200'),_0x3900('0x201'));throw'inBlackList';}};};Dialer[_0x3900('0x1a')]['handleIvr']=function(_0x42703f){var _0x24044e=this;var _0x5c958f=_0x42703f[_0x3900('0x202')]-_0x42703f[_0x3900('0x81')];emitCampaignSummary(_0x42703f);if(_0x5c958f>0x0&&_0x42703f[_0x3900('0x203')]==0x0){if(_0x5c958f>this[_0x3900('0x24')]){_0x5c958f=this[_0x3900('0x24')];}_0x42703f['temp']=0x1;hopperUtils['getContactDialerIvr'](_0x42703f,_0x5c958f)[_0x3900('0x41')](function(_0x50cd2e){_0x42703f[_0x3900('0x203')]=0x0;if(_0x50cd2e){if(!utils['checkContactEmpty'](_0x50cd2e)){_0x42703f[_0x3900('0x6a')]=utils[_0x3900('0x6b')][_0x3900('0x6e')];logger['info']('[getContactCampaign2][Empty]'+_0x42703f[_0x3900('0x49')]);}else{_0x42703f[_0x3900('0x81')]+=_0x50cd2e['length'];_0x42703f['message']=utils[_0x3900('0x6b')][_0x3900('0x204')];for(var _0x2fec12=0x0;_0x2fec12<_0x50cd2e[_0x3900('0x9b')];_0x2fec12+=0x1){_0x42703f[_0x3900('0x205')]+=0x1;if(_[_0x3900('0x103')](_0x50cd2e[_0x2fec12])||_['isNil'](_0x50cd2e[_0x2fec12][_0x3900('0x181')])||_[_0x3900('0x103')](_0x50cd2e[_0x2fec12][_0x3900('0x165')])){_0x24044e[_0x3900('0x206')](_0x3900('0x207'),_0x42703f,_0x50cd2e[_0x2fec12]);}else{hopperUtils[_0x3900('0x208')](_[_0x3900('0x75')](_0x50cd2e[_0x2fec12],['CampaignId',_0x3900('0x165')]))[_0x3900('0x41')](_0x24044e[_0x3900('0x1ec')](_0x42703f,_0x50cd2e[_0x2fec12]))[_0x3900('0xa4')](function(_0xf873ba){logger[_0x3900('0x67')](_0x3900('0x209'),_0xf873ba);utils[_0x3900('0xce')](_0x42703f,_0x3900('0x20a'));});}}}}})[_0x3900('0xa4')](function(_0x5548eb){_0x42703f[_0x3900('0x203')]=0x0;logger['error'](_0x3900('0x20b'),_0x5548eb);});}};Dialer['prototype'][_0x3900('0xb3')]=function(_0x14c245,_0x204159){var _0x4b2908=this;var _0x42d978=[];if(_0x204159<0x1||_0x14c245[_0x3900('0xb1')]===_0x3900('0xa')){_0x204159=0x1;}var _0x1c8477=Math[_0x3900('0x1e8')](_0x14c245[_0x3900('0x147')]*_0x204159)-_0x14c245[_0x3900('0x81')];if(_0x14c245[_0x3900('0x20c')]>0x0){var _0x9ad682=_0x14c245[_0x3900('0x20c')]-_0x14c245['originated']-_0x14c245['talking']-_0x14c245[_0x3900('0x149')];if(_0x1c8477>_0x9ad682){_0x1c8477=_0x9ad682;}}if(_0x1c8477>0x0&&_0x14c245[_0x3900('0x203')]==0x0){if(_0x14c245[_0x3900('0xb1')]===_0x3900('0xa')){_0x1c8477=0x1;}if(_0x1c8477>this[_0x3900('0x24')]){_0x1c8477=this[_0x3900('0x24')];}for(var _0x551c6b in this['agents']){if(typeof this[_0x3900('0x22')][_0x551c6b]!=='undefined'){if(this[_0x3900('0x22')][_0x551c6b][_0x3900('0x6f')]==='not_inuse'&&this[_0x3900('0x22')][_0x551c6b]['status']===_0x3900('0x152')){_0x42d978[_0x3900('0x9c')](this['agents'][_0x551c6b]['id']);}}}_0x14c245[_0x3900('0x203')]=0x1;hopperUtils[_0x3900('0x20d')](_0x14c245,_0x42d978,_0x1c8477)[_0x3900('0x41')](function(_0x462716){_0x14c245[_0x3900('0x203')]=0x0;if(_0x462716){if(!utils[_0x3900('0x20e')](_0x462716)){hopperUtils[_0x3900('0x20f')](_0x14c245)[_0x3900('0x41')](sendMessageReschedule(_0x14c245))[_0x3900('0xa4')](loggerCatch(_0x3900('0x210')));}else{_0x14c245[_0x3900('0x81')]+=_0x462716[_0x3900('0x9b')];_0x14c245[_0x3900('0x6a')]=_0x14c245['dialMethod']===_0x3900('0xa')?utils[_0x3900('0x6b')]['ACTIVE']:utils[_0x3900('0x6b')][_0x3900('0x204')];for(var _0x327a53=0x0;_0x327a53<_0x462716[_0x3900('0x9b')];_0x327a53+=0x1){if(_[_0x3900('0x103')](_0x462716[_0x327a53])||_[_0x3900('0x103')](_0x462716[_0x327a53][_0x3900('0x181')])||_[_0x3900('0x103')](_0x462716[_0x327a53][_0x3900('0x165')])){_0x4b2908[_0x3900('0x206')](_0x3900('0x207'),_0x14c245,_0x462716[_0x327a53]);}else{hopperUtils[_0x3900('0x211')](_[_0x3900('0x75')](_0x462716[_0x327a53],[_0x3900('0xff'),'phone']))[_0x3900('0x41')](_0x4b2908[_0x3900('0x1ec')](_0x14c245,_0x462716[_0x327a53]))['catch'](function(_0x2c5daa){logger['error'](_0x3900('0x212'),_0x2c5daa);utils[_0x3900('0xce')](_0x14c245,_0x3900('0x213'));});}}}}})['catch'](function(_0x2082af){_0x14c245['temp']=0x0;logger['error'](_0x3900('0x20b'),_0x2082af);});}};Dialer[_0x3900('0x1a')][_0x3900('0x66')]=function(_0x151ccb){if(_0x151ccb[_0x3900('0x20c')]>0x0){var _0x549abb=_0x151ccb[_0x3900('0x20c')]-_0x151ccb[_0x3900('0x81')]-_0x151ccb[_0x3900('0x1c8')];if(_0x549abb>0x0&&_0x151ccb[_0x3900('0x203')]==0x0){this['tryOriginatePredictive'](_0x151ccb);}else{loggerPredictiveCalls[_0x3900('0x4b')](_0x3900('0x214'));}}else{this[_0x3900('0x215')](_0x151ccb);}};Dialer[_0x3900('0x1a')][_0x3900('0x215')]=function(_0x43780f){var _0x7466bd=this;var _0x5a20c3=[];_0x43780f[_0x3900('0x81')]+=0x1;for(var _0xd72d36 in this[_0x3900('0x22')]){if(typeof this[_0x3900('0x22')][_0xd72d36]!==_0x3900('0xae')){if(this[_0x3900('0x22')][_0xd72d36][_0x3900('0x6f')]===_0x3900('0x216')&&this[_0x3900('0x22')][_0xd72d36][_0x3900('0x8a')]===_0x3900('0x152')){_0x5a20c3[_0x3900('0x9c')](this['agents'][_0xd72d36]['id']);}}}_0x43780f['temp']=0x1;return this[_0x3900('0x20d')](_0x43780f['id'],_0x5a20c3,0x1,_0x43780f['dialOrderByScheduledAt'],_0x43780f)[_0x3900('0x41')](function(_0x16c120){_0x43780f['temp']=0x1;if(_0x16c120){if(!utils[_0x3900('0x20e')](_0x16c120)){utils[_0x3900('0x217')](_0x43780f,0x1,0x0);return hopperUtils[_0x3900('0x20f')](_0x43780f)[_0x3900('0x41')](sendMessageReschedule(_0x43780f))[_0x3900('0xa4')](loggerCatch(_0x3900('0x210')));}else{_0x43780f[_0x3900('0x6a')]=utils[_0x3900('0x6b')]['RUNNING'];if(_[_0x3900('0x103')](_0x16c120[0x0])||_[_0x3900('0x103')](_0x16c120[0x0]['Contact'])||_[_0x3900('0x103')](_0x16c120[0x0][_0x3900('0x165')])){_0x7466bd[_0x3900('0x206')]('[actionOriginate]\x20',_0x43780f,_0x16c120[0x0]);}else{return hopperUtils['checkIsBlackList'](_[_0x3900('0x75')](_0x16c120[0x0],[_0x3900('0xff'),_0x3900('0x165')]))[_0x3900('0x41')](_0x7466bd[_0x3900('0x1ec')](_0x43780f,_0x16c120[0x0]))['catch'](function(_0x55fdb3){logger[_0x3900('0x67')]('[actionOriginatePredictive]',_0x55fdb3);utils[_0x3900('0xce')](_0x43780f,_0x3900('0x218'));});}}}})[_0x3900('0xa4')](function(_0x599a4b){_0x43780f['temp']=0x0;logger[_0x3900('0x67')]('[getContactCampaign2]',_0x599a4b);});};Dialer[_0x3900('0x1a')]['abandonmentRate']=function(_0x246780,_0x9308fc,_0xe01901,_0x169434,_0x1a1532,_0x281d86){loggerPredictive[_0x3900('0x4b')](_0x3900('0x219'));loggerPredictive[_0x3900('0x4b')](_0x3900('0x21a'),_0x246780);loggerPredictive[_0x3900('0x4b')](_0x3900('0x21b'),_0x9308fc);loggerPredictive['info'](_0x3900('0x21c'),_0xe01901);loggerPredictive[_0x3900('0x4b')](_0x3900('0x21d'),_0x169434);loggerPredictive[_0x3900('0x4b')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1a1532);loggerPredictive[_0x3900('0x4b')](_0x3900('0x57'));return new Promise(function(_0x94094b,_0x479e9a){if(_0x246780<=0x0||isNaN(_0x246780)){return _0x479e9a(msgResponse(_0x3900('0x21e'),'Error',_0x3900('0x21f')+_0x246780));}if(_0xe01901<=0x0||isNaN(_0xe01901)){return _0x479e9a(msgResponse(_0x3900('0x21e'),_0x3900('0x86'),_0x3900('0x220')+_0xe01901));}if(_0x169434<=0x0||isNaN(_0x169434)){return _0x479e9a(msgResponse('[abandonmentRate]','Error',_0x3900('0x221')+_0x169434));}if(_0x9308fc<=0x0||isNaN(_0x9308fc)){return _0x479e9a(msgResponse(_0x3900('0x21e'),_0x3900('0x86'),_0x3900('0x222')+_0x9308fc));}if(_0x1a1532<=0x0||isNaN(_0x1a1532)){return _0x479e9a(msgResponse(_0x3900('0x21e'),_0x3900('0x86'),_0x3900('0x223')+_0x1a1532));}_0x281d86=_0x281d86||0x0;var _0x3ddb39=0x1/_0xe01901;var _0x4e0c4=0x0;var _0x3ebfe0=0x0;var _0x1dfddc=0x0;var _0x493a16=0x0;for(var _0x4ae80e=0x0;_0x1dfddc<_0x1a1532;_0x4ae80e+=0x1){_0x3ebfe0=_0x4ae80e/_0x9308fc;_0x4e0c4=(_0x169434*_0x3ebfe0+_0x281d86)/_0x3ddb39;_0x1dfddc=utils[_0x3900('0x224')](_0x4e0c4,_0x246780);_0x493a16=_0x4e0c4/_0x246780*(0x1-utils[_0x3900('0x224')](_0x4e0c4,_0x246780));}return _0x94094b({'erlangCalls':_0x4ae80e,'erlangCallToSecond':_0x9308fc/_0x4ae80e,'erlangAbandonmentRate':_0x1dfddc,'erlangBusyFactor':_0x493a16});});};Dialer[_0x3900('0x1a')][_0x3900('0x1e7')]=function(_0x339c9b,_0x37a8e4,_0x196273,_0x10d064,_0x50de1b,_0x5bfabc){loggerPredictive['info'](_0x3900('0x225'));loggerPredictive[_0x3900('0x4b')](_0x3900('0x21a'),_0x339c9b);loggerPredictive[_0x3900('0x4b')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x37a8e4);loggerPredictive[_0x3900('0x4b')](_0x3900('0x21c'),_0x196273);loggerPredictive[_0x3900('0x4b')](_0x3900('0x21d'),_0x10d064);loggerPredictive['info'](_0x3900('0x226'),_0x50de1b);loggerPredictive['info'](_0x3900('0x57'));return new Promise(function(_0x36de6a,_0x1b3577){if(_0x339c9b<=0x0||isNaN(_0x339c9b)){return _0x1b3577(msgResponse(_0x3900('0x227'),_0x3900('0x86'),_0x3900('0x21f')+_0x339c9b));}if(_0x196273<=0x0||isNaN(_0x196273)){return _0x1b3577(msgResponse(_0x3900('0x227'),_0x3900('0x86'),_0x3900('0x220')+_0x196273));}if(_0x10d064<=0x0||isNaN(_0x10d064)){return _0x1b3577(msgResponse(_0x3900('0x227'),_0x3900('0x86'),_0x3900('0x221')+_0x10d064));}if(_0x37a8e4<=0x0||isNaN(_0x37a8e4)){return _0x1b3577(msgResponse('[busyFactor]','Error',_0x3900('0x222')+_0x37a8e4));}if(_0x50de1b<=0x0||isNaN(_0x50de1b)){return _0x1b3577(msgResponse(_0x3900('0x227'),'Error',_0x3900('0x228')+_0x50de1b));}_0x5bfabc=_0x5bfabc||0x0;var _0x5bc7e0=0x1/_0x196273;var _0x7d393f=0x0;var _0x4acf8e=0x0;var _0x3af422=0x0;var _0x598aa6=0x0;for(var _0x1d0921=0x0;_0x598aa6<_0x50de1b;_0x1d0921+=0x1){_0x4acf8e=_0x1d0921/_0x37a8e4;_0x7d393f=(_0x10d064*_0x4acf8e+_0x5bfabc)/_0x5bc7e0;_0x3af422=utils[_0x3900('0x224')](_0x7d393f,_0x339c9b);_0x598aa6=_0x7d393f/_0x339c9b*(0x1-utils[_0x3900('0x224')](_0x7d393f,_0x339c9b));}return _0x36de6a({'erlangCalls':_0x1d0921,'erlangCallToSecond':_0x37a8e4/_0x1d0921,'erlangAbandonmentRate':_0x3af422,'erlangBusyFactor':_0x598aa6});});};module[_0x3900('0x229')]=Dialer;
\ No newline at end of file