4f6325172980ebd8c5f4ef2d4e90480f8f4f2f65
[motion2.git] / server / services / ami / dialer / index.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0xead0=['stateinterface','merge','pick','strategy','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','VoiceQueueId','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','[booked][RR]','contactAgent-idHopper:\x20','preview','[booked][RR][finaly]','Agent:\x20','[booked][unlock]','[booked][unlock2]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncOriginateResponse','getQueue','Success','callProgressDetecting','[callProgressDetecting]\x20','variable','amdstatus','xcally-motion-dialer','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','custom:amd','buildObj','amd','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','dialAMDActive','value','MACHINE','outboundAnswerCallsDay','Machine','countmachineretry','[syncAgentComplete][createHistory][0]','countbusyretry','countnosuchnumberretry','countagentrejectretry','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','dialMachineRetryFrequency','[rescheduleContact][Machine]','[syncHangupInAMDIvr]','countnoanswerretry','dialGlobalMaxRetry','stateGlobal','ivrAnswerCallsDay','[syncHangupIvr]','dialQueueProject','AnswerAGI','[syncHangupIvr][createHistory]','cause-txt','Normal\x20Clearing','[syncAgentComplete]','outboundUnknownCallsDay','running','statusMessage','getQueueCampaignStatusMessage','available','inUse','talking','pTalking','ACTIVE','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','throttle','filter','dialPreviewRecallmeReminder','online','handlePreviewRecallNotifications','map','Agent','user:dialPreviewRecallReminder','checkPreviewRecallReminder','clearZombieChannels','[uniqueid]','[actions]','enqueue','No\x20such\x20channel','[Dialer][checkChannel]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','notFound','UserId','[emptyContact][createHistory]','[emptyContact]','[syncQueueCallerAbandon]\x20[Drop]','user:%s','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','isOutboundQueue','\x22%s,%s%s,,,%s\x22','dialQueueOptions','NONE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','dialAMDGreeting','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDMAXIMUMNUMBEROFWORDS','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','setXMDContactVariables','getCallerId','Trunk','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','OriginateError','[originate][error]','originate\x20action\x20Error','checkRetriveMax','countcongestionretry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','[rescheduleContact]\x20[Busy]','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','dialNoSuchNumberRetryFrequency','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','buildNoAnswerEventPayload','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','busy','dialBusyRetryFrequency','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','custom:agentcongestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','round','predictiveIntervalMinThreshold','predictiveIntervalHitRate','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','predictiveIntervalErlangCallsDroppedCalls','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','dialPredictiveInterval','avgHandleTime','getDataPredictive','startMethodPredictive','recalculate\x20predictive\x20at',')\x20are\x20less\x20than\x20threshold\x20(','dropRate','agentBusyFactor','busyFactor','Unknown\x20Predictive','[getDataPredictive]','predictiveIntervalPauses','outboundQueuePauses','[CatchErlangB]','check\x20failure','one\x20call\x20every:','milliseconds','[handlePredictive]','fail\x20to\x20scheduled\x20calls','recallme','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','dialRecallMeTimeout','voicePause','unlockContact','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','RecallFailedTimeout','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','handleIvr','limitCalls','checkContactEmpty','RUNNING','ivrTotalCallsDays','Contact','emptyContact','[actionOriginate]\x20','checkIsBlackListIvr','checkContactBlack','[actionOriginateIvr]\x20','[getContactCampaign2]','floor','dialLimitQueue','not_inuse','getContactDialer','countReScheduled','booked','checkIsBlackList','tryOriginatePredictive','[handlePredictive][limitChannel]','dialOrderByScheduledAt','[countReScheduled]\x20','[actionOriginatePredictive]\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','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]','Ts\x20=\x20','Umin\x20=\x20','util','lodash','moment','./utils','./utils/hopper','../../../config/environment/','../../../config/logger','dialer','predictive','predictiveCalls','syncQueueSummary','../ami','redis','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/setting','../rpc/interval','./models/action','./models/history','./models/final','./models/agentComplete','./models/hangup','XCALLY_IP_AGI','127.0.0.1','prototype','tail','finally','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queuesSummary','agentconnect','queuecallerabandon','bind','originateresponse','agentcomplete','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','previewRecallmeReminderInterval','emit','type','debug','format','name','info','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','isUndefined','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---------','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','getSeconds','startProgressive\x20value\x20cleared','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','inspect','checkContactLowerLimitOriginate','temp','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contactsRescheduled','contacts','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','message','state','statedesc','endtime','queueStatusComplete','[unlockQueueStatus][undefined]','stringify','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Interval','Intervals','isEmpty','\x20NOT\x20Active','isIVRCampaign','campaign:ivr:%s','campaign:save','sendMessageOneNotActive','INACTIVE','is\x20not\x20active','DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','Error','isTrunkReachable','active','SIP/%s','status','reachable','checkIsTrunkReachable','TrunkBackup','\x20trunk\x20is\x20not\x20reachable','ifTimeIvr','checkIfTimeIntervals','ifTime','Failure','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','\x20Intervals\x20is\x20empty\x20','\x20Timezone\x20unknow\x20','isArray','length','push','command','iftime\x20%s,%s','interval','timezones','then','content','catch','Action','indexOf','all','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','resetActiveCalls','syncCampaigns','undefined','isIVRCampaignActive','resolve','checkIfTime','dialGlobalInterval','dialTimezone','launchHandleIvr','[syncCampaigns]','checkDialMethod','dialMethod','handlePower','power','dialPowerLevel','method\x20not\x20recognized','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','AMI\x20IfTime','syncAgentConnect','uniqueid','ivr','updateOriginated','queue','answertime','YYYY-MM-DD\x20HH:mm:ss','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','createHistory','moveContactManagedDialer','droptime','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','Drop','dropreason','TIMEOUT','countdropretry','dialDropRetryFrequency','callAdditionalPhoneAfterMin','verifyAdditionalPhones','voiceQueue','additional','dialDropMaxRetry','rescheduleContact','add','minutes','ContactId','ListId','CampaignId','[rescheduleContact][Drop]','starttime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','outboundDropCallsDayCallersExit','Abandoned','countabandonedretry','countglobal','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','queueCallerAbandonCreateState','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','channel','actionid','rrmemory','roundrobin','isNil','locked','paused'];(function(_0x59348a,_0x5d7e16){var _0x5dc4c8=function(_0x54a67c){while(--_0x54a67c){_0x59348a['push'](_0x59348a['shift']());}};_0x5dc4c8(++_0x5d7e16);}(_0xead0,0x123));var _0x0ead=function(_0x548627,_0x4ec392){_0x548627=_0x548627-0x0;var _0x844a84=_0xead0[_0x548627];return _0x844a84;};'use strict';var util=require(_0x0ead('0x0'));var _=require(_0x0ead('0x1'));var uuid=require('uuid');var moment=require(_0x0ead('0x2'));var rr=require('rr');var Redis=require('ioredis');var utils=require(_0x0ead('0x3'));var hopperUtils=require(_0x0ead('0x4'));var ut=require('../preview/util/util');var config=require(_0x0ead('0x5'));var logger=require(_0x0ead('0x6'))(_0x0ead('0x7'));var loggerBooked=require(_0x0ead('0x6'))('booked');var loggerPredictive=require(_0x0ead('0x6'))(_0x0ead('0x8'));var loggerPredictiveCalls=require('../../../config/logger')(_0x0ead('0x9'));var loggerSyncQueueSummary=require('../../../config/logger')(_0x0ead('0xa'));var ami=require(_0x0ead('0xb'));config[_0x0ead('0xc')]=_['defaults'](config['redis'],{'host':_0x0ead('0xd'),'port':0x18eb});var io=require(_0x0ead('0xe'))(new Redis(config[_0x0ead('0xc')]));var cmHopper=require(_0x0ead('0xf'));var voiceQueueRt=require(_0x0ead('0x10'));var RpcSetting=require(_0x0ead('0x11'));var Interval=require(_0x0ead('0x12'));var Action=require(_0x0ead('0x13'));var History=require(_0x0ead('0x14'));var Final=require(_0x0ead('0x15'));var AgentComplete=require(_0x0ead('0x16'));var QueueCallerAbandon=require('./models/queueCallerAbandon');var Hangup=require(_0x0ead('0x17'));var ipAgi=process['env'][_0x0ead('0x18')]||_0x0ead('0x19');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x0ead('0x1a')]['enqueue']=function(_0x215e28){this['tail']=this[_0x0ead('0x1b')]?this['tail'][_0x0ead('0x1c')](_0x215e28):_0x215e28();};function Dialer(_0x30dd83,_0x1a65a6){this[_0x0ead('0x1d')]=new Sequence();this['preview']=_0x1a65a6;this[_0x0ead('0x1e')]=_0x30dd83['voiceQueues'];this[_0x0ead('0x1f')]=_0x30dd83[_0x0ead('0x1f')];this[_0x0ead('0x20')]=_0x30dd83[_0x0ead('0x20')];this['trunks']=_0x30dd83[_0x0ead('0x21')];this[_0x0ead('0x22')]=config[_0x0ead('0x22')]||0x2;this[_0x0ead('0x23')]={};this[_0x0ead('0x24')]={};this['contactsId']={};this[_0x0ead('0x25')]={};this[_0x0ead('0x26')]={};this[_0x0ead('0x27')]={};this[_0x0ead('0x28')]={};this[_0x0ead('0x29')]={};this[_0x0ead('0x2a')]={};this['queueBookedRR']={};this[_0x0ead('0x2b')]={};ami['on'](_0x0ead('0x2c'),this['syncAgentConnect']['bind'](this));ami['on'](_0x0ead('0x2d'),this['syncQueueCallerAbandon'][_0x0ead('0x2e')](this));ami['on'](_0x0ead('0x2f'),this['syncOriginateResponse'][_0x0ead('0x2e')](this));ami['on'](_0x0ead('0x30'),this[_0x0ead('0x31')]['bind'](this));ami['on'](_0x0ead('0x32'),this[_0x0ead('0xa')]['bind'](this));ami['on'](_0x0ead('0x33'),this[_0x0ead('0x34')][_0x0ead('0x2e')](this));ami['on'](_0x0ead('0x35'),this[_0x0ead('0x36')][_0x0ead('0x2e')](this));ami['on'](_0x0ead('0x37'),this[_0x0ead('0x38')]['bind'](this));ami['on'](_0x0ead('0x39'),this[_0x0ead('0x3a')][_0x0ead('0x2e')](this));ami['on']('queuemember',this['syncQueueMember']['bind'](this));ami['on'](_0x0ead('0x3b'),this[_0x0ead('0x3c')][_0x0ead('0x2e')](this));this[_0x0ead('0x3d')]();this[_0x0ead('0x3e')]();RpcSetting[_0x0ead('0x3f')]()['then'](function(_0x3a383d){previewRecallmeReminderInterval=_0x3a383d[_0x0ead('0x40')];});}function isNotNull(_0x2867ff){return _0x2867ff!==null&&!_['isUndefined'](_0x2867ff);}function msgResponse(_0x34bc11,_0x1a3277,_0x470fe9){return{'action':_0x34bc11,'response':_0x1a3277,'message':_0x470fe9,'stack':_0x470fe9};}function emit(_0x49916f,_0x1686a3,_0x507ea2){io['to'](_0x49916f)[_0x0ead('0x41')](_0x1686a3,_0x507ea2);}function emitOutboundVoiceQueueSummary(_0x41bdf6){if(_0x41bdf6[_0x0ead('0x42')]==='outbound'){logger[_0x0ead('0x43')]('[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:',util['inspect'](_0x41bdf6,{'showHidden':![],'depth':null}));emit(util[_0x0ead('0x44')]('voice:queue:%s',_0x41bdf6[_0x0ead('0x45')]),'voice_queue:save',_0x41bdf6);}}function checkGetDataPredictive(_0x372b40){if(isNotNull(_0x372b40)&&!_['isEmpty'](_0x372b40)){loggerPredictive['info']('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0x0ead('0x46')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x372b40[_0x0ead('0x47')]);loggerPredictive[_0x0ead('0x46')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x372b40[_0x0ead('0x48')]);loggerPredictive[_0x0ead('0x46')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x372b40[_0x0ead('0x49')]);loggerPredictive[_0x0ead('0x46')](_0x0ead('0x4a'),_0x372b40[_0x0ead('0x4b')]);loggerPredictive[_0x0ead('0x46')](_0x0ead('0x4c'),_0x372b40[_0x0ead('0x4d')]);loggerPredictive[_0x0ead('0x46')](_0x0ead('0x4e'),_0x372b40[_0x0ead('0x4f')]);loggerPredictive[_0x0ead('0x46')](_0x0ead('0x50'));if(_0x372b40['predictiveIntervalTotalCalls']>0x0){if(!_[_0x0ead('0x51')](_0x372b40['predictiveIntervalAvgTalktime'])&&_0x372b40[_0x0ead('0x4f')]>0x0){return!![];}loggerPredictive[_0x0ead('0x46')](_0x0ead('0x52'));if(!_[_0x0ead('0x51')](_0x372b40[_0x0ead('0x4d')])&&_0x372b40['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0x0ead('0x46')](_0x0ead('0x53'));}else{loggerPredictive[_0x0ead('0x46')](_0x0ead('0x54'));}}else{loggerPredictive[_0x0ead('0x46')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x2d5d8d){return function(_0x14aa97){loggerPredictive[_0x0ead('0x46')](_0x0ead('0x55'));loggerPredictive['info']('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x14aa97[_0x0ead('0x56')]);loggerPredictive[_0x0ead('0x46')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x14aa97[_0x0ead('0x57')]);loggerPredictive[_0x0ead('0x46')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x14aa97[_0x0ead('0x58')]);loggerPredictive[_0x0ead('0x46')](_0x0ead('0x59'),_0x14aa97[_0x0ead('0x5a')]);loggerPredictive[_0x0ead('0x46')](_0x0ead('0x5b'),_0x14aa97['erlangAbandonmentRate']);loggerPredictive[_0x0ead('0x46')](_0x0ead('0x50'));_['merge'](_0x2d5d8d,_0x14aa97);};}function ifInterval(_0x2174e4,_0x2cbd17){if(_['isUndefined'](_0x2cbd17)){return![];}return utils[_0x0ead('0x5c')](undefined,_0x2cbd17)<_0x2174e4*0x3c;}function clearPredictiveAttributes(_0x3626c5){if(_0x3626c5[_0x0ead('0x28')]){_0x3626c5['startProgressive']=undefined;loggerPredictive[_0x0ead('0x43')](_0x3626c5['name'],_0x0ead('0x5d'));}if(_0x3626c5[_0x0ead('0x27')]){_0x3626c5[_0x0ead('0x27')]=undefined;loggerPredictive['debug'](_0x3626c5[_0x0ead('0x45')],_0x0ead('0x5e'));}if(_0x3626c5['handlePredictive']){clearInterval(_0x3626c5[_0x0ead('0x5f')]);_0x3626c5[_0x0ead('0x5f')]=undefined;loggerPredictive[_0x0ead('0x43')](_0x3626c5[_0x0ead('0x45')],_0x0ead('0x60'));}}function loggerCatchPredictive(_0x4ce4f2,_0x4a8975){return function(_0x172d55){loggerPredictive[_0x0ead('0x61')](_0x4a8975['name'],_0x4ce4f2);loggerPredictive[_0x0ead('0x61')](_0x172d55['stack']);clearPredictiveAttributes(_0x4a8975);};}function loggerCatch(_0x5062ef){return function(_0x46c9a9){logger['error'](_0x5062ef,util[_0x0ead('0x62')](_0x46c9a9,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x1e985d,_0x2ce692,_0x58477b){return function(_0x2a5bff){utils[_0x0ead('0x63')](_0x2ce692,_0x58477b,0x0);_0x2ce692[_0x0ead('0x64')]=0x0;logger[_0x0ead('0x61')](_0x1e985d,util['inspect'](_0x2a5bff,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0xcc039){return function(_0x2d09eb){if(isNotNull(_0x2d09eb)&&isNotNull(_0x2d09eb[0x0])){if(_0x2d09eb[0x0]['contactsRescheduled']>0x0){_0xcc039['message']=utils[_0x0ead('0x65')][_0x0ead('0x66')];logger[_0x0ead('0x46')](_0x0ead('0x67')+_0xcc039['name'],_0x2d09eb[0x0][_0x0ead('0x68')],_0x0ead('0x69'));}else{_0xcc039['message']=utils[_0x0ead('0x65')][_0x0ead('0x6a')];logger[_0x0ead('0x46')](_0x0ead('0x6b')+_0xcc039[_0x0ead('0x45')]);}}};}function createObjHistory(_0x583936,_0x31df8a,_0x48c060,_0x256859,_0xe68558){_0x583936[_0x0ead('0x6c')]=_0x48c060;var _0x56f024=new Action(_0x583936,_0x31df8a);var _0x1d157e=new History(_0x56f024);_0x1d157e[_0x0ead('0x6d')]=_0x256859;_0x1d157e[_0x0ead('0x6e')]=_0xe68558;_0x1d157e[_0x0ead('0x6f')]=_0x56f024['starttime'];return _0x1d157e;}function unlockQueueStatus(_0x161466,_0x231a9e){setTimeout(function(){if(_[_0x0ead('0x51')](_0x161466[_0x0ead('0x70')])){loggerBooked[_0x0ead('0x61')](_0x0ead('0x71'),_0x231a9e);}_0x161466[_0x0ead('0x70')]=!![];loggerBooked[_0x0ead('0x46')]('[booked][unlockQueueStatus]',_0x231a9e,JSON[_0x0ead('0x72')](_['pick'](_0x161466,['name',_0x0ead('0x70')])));},0x1f3);}function checkInterval(_0x112679){return function(){if(!isNotNull(_0x112679['Interval'])){_0x112679['message']=utils[_0x0ead('0x65')][_0x0ead('0x73')];throw _0x112679['name']+_0x0ead('0x74');}if(!isNotNull(_0x112679[_0x0ead('0x75')][_0x0ead('0x76')])){_0x112679['message']=utils[_0x0ead('0x65')][_0x0ead('0x73')];throw _0x112679[_0x0ead('0x45')]+_0x0ead('0x74');}if(!isNotNull(_[_0x0ead('0x77')](_0x112679[_0x0ead('0x75')][_0x0ead('0x76')]))){_0x112679[_0x0ead('0x6c')]=utils[_0x0ead('0x65')][_0x0ead('0x73')];throw _0x112679['name']+_0x0ead('0x74');}};}function checkIsIVRCampaignActive(_0x1958bf){return function(){if(!utils['isIVRCampaignActive'](_0x1958bf)){_0x1958bf[_0x0ead('0x6c')]=utils[_0x0ead('0x65')]['INACTIVE'];throw _0x1958bf[_0x0ead('0x45')]+_0x0ead('0x78');}};}function emitCampaignSummary(_0x543e93){if(utils[_0x0ead('0x79')](_0x543e93)){emit(util[_0x0ead('0x44')](_0x0ead('0x7a'),_0x543e93['name']),_0x0ead('0x7b'),_0x543e93);}}function loggerCatchQueueSummary(_0x4a9354,_0x58f519){return function(_0x975a52){clearPredictiveAttributes(_0x58f519);emitCampaignSummary(_0x58f519);loggerSyncQueueSummary[_0x0ead('0x43')](_0x4a9354,util[_0x0ead('0x62')](_0x975a52,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x456fc8){if(_0x456fc8[_0x0ead('0x7c')]){if(_0x456fc8['originated']===0x0){_0x456fc8[_0x0ead('0x7c')]=![];_0x456fc8[_0x0ead('0x6c')]=utils[_0x0ead('0x65')][_0x0ead('0x7d')];loggerSyncQueueSummary[_0x0ead('0x43')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x456fc8[_0x0ead('0x45')],_0x0ead('0x7e'));}else{_0x456fc8[_0x0ead('0x6c')]=utils[_0x0ead('0x65')][_0x0ead('0x7f')];loggerSyncQueueSummary[_0x0ead('0x43')](_0x0ead('0x80'),_0x456fc8[_0x0ead('0x45')],_0x0ead('0x81'));}emitCampaignSummary(_0x456fc8);}}function myreject(_0x242950){return function(_0x4cc3da){return _0x242950(msgResponse('[ifTime][Action]',_0x0ead('0x82'),JSON[_0x0ead('0x72')](_0x4cc3da)));};}Dialer[_0x0ead('0x1a')][_0x0ead('0x83')]=function(_0x1b9d53){return!_['isUndefined'](_0x1b9d53)&&_0x1b9d53&&!_[_0x0ead('0x51')](_0x1b9d53[_0x0ead('0x45')])&&!_[_0x0ead('0x51')](_0x1b9d53[_0x0ead('0x84')])&&_0x1b9d53[_0x0ead('0x84')]&&(this[_0x0ead('0x21')][util[_0x0ead('0x44')](_0x0ead('0x85'),_0x1b9d53[_0x0ead('0x45')])][_0x0ead('0x86')]===_0x0ead('0x87')||this[_0x0ead('0x21')][util[_0x0ead('0x44')]('SIP/%s',_0x1b9d53[_0x0ead('0x45')])]['status']==='unmonitored');};Dialer[_0x0ead('0x1a')][_0x0ead('0x88')]=function(_0x1a9c57){var _0x10795f=this;return function(){if(!_0x10795f[_0x0ead('0x83')](_0x1a9c57['Trunk'])){if(!_0x10795f['isTrunkReachable'](_0x1a9c57[_0x0ead('0x89')])){_0x1a9c57[_0x0ead('0x6c')]=utils[_0x0ead('0x65')]['TRUNK_NOT_REACHABLE'];throw _0x1a9c57[_0x0ead('0x45')]+_0x0ead('0x8a');}}};};Dialer[_0x0ead('0x1a')]['checkIfTime']=function(_0x2640fa,_0x135887,_0x57b08d,_0x51148f){var _0x576d05=this;return function(){var _0xcf7607=!![];return _0x576d05[_0x0ead('0x8b')](_0x2640fa,_0x135887,_0x57b08d,_0x51148f,_0xcf7607);};};Dialer[_0x0ead('0x1a')][_0x0ead('0x8c')]=function(_0x9f9c01,_0x4fb0da,_0x18c539,_0x5a4396){var _0x2c73a3=this;return function(){var _0x4abb90=![];return _0x2c73a3[_0x0ead('0x8b')](_0x9f9c01[_0x0ead('0x76')],_0x4fb0da,_0x18c539,_0x5a4396,_0x4abb90);};};Dialer[_0x0ead('0x1a')][_0x0ead('0x8b')]=function(_0x17cb5e,_0x437314,_0x5e8fa7,_0x2d8de5,_0x17e8a4){var _0x27f1c9=[];return new Promise(function(_0x58925b,_0x522b1d){if(!isNotNull(_0x17cb5e)){_0x2d8de5[_0x0ead('0x6c')]=utils[_0x0ead('0x65')]['NULL_INTERVAL'];return _0x522b1d(msgResponse(_0x0ead('0x8d'),_0x0ead('0x8e'),_0x5e8fa7+_0x0ead('0x8f')));}if(_[_0x0ead('0x77')](_0x17cb5e)){_0x2d8de5[_0x0ead('0x6c')]=utils[_0x0ead('0x65')][_0x0ead('0x90')];return _0x522b1d(msgResponse('ifTime',_0x0ead('0x8e'),_0x5e8fa7+_0x0ead('0x91')));}if(_0x437314&&_[_0x0ead('0x51')](config['timezones'][_0x437314])){_0x2d8de5[_0x0ead('0x6c')]=utils['CAMPAIGN_STATUS']['UNKNOWN_TIMEZONE'];return _0x522b1d(msgResponse(_0x0ead('0x8d'),_0x0ead('0x8e'),_0x5e8fa7+_0x0ead('0x92')+_0x437314));}if(_[_0x0ead('0x93')](_0x17cb5e)){for(var _0x3a41ec=0x0;_0x3a41ec<_0x17cb5e[_0x0ead('0x94')];_0x3a41ec+=0x1){_0x27f1c9[_0x0ead('0x95')](ami['Action']({'action':_0x0ead('0x96'),'command':util[_0x0ead('0x44')](_0x0ead('0x97'),_0x17cb5e[_0x3a41ec][_0x0ead('0x98')],!_[_0x0ead('0x51')](config[_0x0ead('0x99')][_0x437314])?_0x437314:'')})[_0x0ead('0x9a')](function(_0x192511){return _0x192511[_0x0ead('0x9b')]['indexOf']('true')>=0x0;})[_0x0ead('0x9c')](myreject(_0x522b1d)));}}else{_0x27f1c9[_0x0ead('0x95')](ami[_0x0ead('0x9d')]({'action':'command','command':util['format']('iftime\x20%s,%s',_0x17cb5e,!_[_0x0ead('0x51')](config['timezones'][_0x437314])?_0x437314:'')})[_0x0ead('0x9a')](function(_0x2807e6){return _0x2807e6[_0x0ead('0x9b')][_0x0ead('0x9e')]('true')>=0x0;})[_0x0ead('0x9c')](myreject(_0x522b1d)));}Promise[_0x0ead('0x9f')](_0x27f1c9)[_0x0ead('0x9a')](function(_0x5cdb90){var _0x52a96f=_['some'](_0x5cdb90);if(_0x52a96f){return _0x58925b(_0x52a96f);}else{_0x2d8de5[_0x0ead('0x6c')]=_0x17e8a4?utils[_0x0ead('0x65')][_0x0ead('0xa0')]:utils[_0x0ead('0x65')][_0x0ead('0xa1')];return _0x522b1d(msgResponse(_0x0ead('0xa2'),_0x0ead('0x8e'),_0x0ead('0xa3')+_0x17e8a4+'\x20'+_0x5e8fa7+_0x0ead('0xa4')+util[_0x0ead('0x62')](_0x17cb5e,{'showHidden':![],'depth':null})+_0x0ead('0xa5')+_0x437314));}})[_0x0ead('0x9c')](function(_0x8f2b4b){return _0x522b1d(msgResponse(_0x0ead('0x8d'),_0x0ead('0x8e'),JSON['stringify'](_0x8f2b4b)));});});};Dialer[_0x0ead('0x1a')][_0x0ead('0x3d')]=function(){var _0x4bc5e3=this;return cmHopper[_0x0ead('0xa6')]({'active':![]},{'where':{'active':!![]}})[_0x0ead('0x9a')](function(){setInterval(function(){_0x4bc5e3['syncCampaigns']();},0x3e8);});};Dialer[_0x0ead('0x1a')][_0x0ead('0xa7')]=function(){var _0x20420c=this;var _0x4807a1;for(var _0x49a897 in this['campaigns']){if(typeof this[_0x0ead('0x1f')][_0x49a897]!==_0x0ead('0xa8')){_0x4807a1=this['campaigns'][_0x49a897];if(utils[_0x0ead('0x79')](_0x4807a1)&&utils[_0x0ead('0xa9')](_0x4807a1)){_0x4807a1[_0x0ead('0x7c')]=!![];Promise[_0x0ead('0xaa')]()[_0x0ead('0x9a')](checkIsIVRCampaignActive(_0x4807a1))['then'](checkInterval(_0x4807a1))[_0x0ead('0x9a')](_0x20420c[_0x0ead('0x88')](_0x4807a1))['then'](_0x20420c[_0x0ead('0xab')](_0x4807a1[_0x0ead('0xac')],_0x4807a1[_0x0ead('0xad')],_0x4807a1[_0x0ead('0x45')],_0x4807a1))[_0x0ead('0x9a')](_0x20420c[_0x0ead('0x8c')](_0x4807a1[_0x0ead('0x75')],_0x4807a1['dialTimezone'],_0x4807a1[_0x0ead('0x45')],_0x4807a1))[_0x0ead('0x9a')](_0x20420c[_0x0ead('0xae')](_0x4807a1))[_0x0ead('0x9c')](loggerCatchQueueSummary(_0x0ead('0xaf'),_0x4807a1));}else{notSendMessagesCampaign(_0x4807a1);}}}};Dialer['prototype'][_0x0ead('0xb0')]=function(_0x132642){if(_0x132642['dialMethod']!=='predictive'){clearPredictiveAttributes(_0x132642);}switch(_0x132642[_0x0ead('0xb1')]){case'progressive':this[_0x0ead('0xb2')](_0x132642,0x1);break;case _0x0ead('0xb3'):this[_0x0ead('0xb2')](_0x132642,_0x132642[_0x0ead('0xb4')]);break;case _0x0ead('0x8'):this[_0x0ead('0x8')](_0x132642);break;case'booked':this[_0x0ead('0xb2')](_0x132642,0x1);break;default:logger[_0x0ead('0x61')]('Queue',_0x132642[_0x0ead('0x45')],_0x0ead('0xb5'));}};Dialer[_0x0ead('0x1a')][_0x0ead('0x8d')]=function(_0x457620,_0x17acd1){var _0x21ec4d=_0x457620[_0x0ead('0xad')];var _0x26a9da=_0x17acd1?_0x457620[_0x0ead('0xac')]:_0x457620[_0x0ead('0x75')][_0x0ead('0x76')];logger[_0x0ead('0xb6')](_0x0ead('0xb7'),_0x26a9da,_0x21ec4d,_0x457620[_0x0ead('0x45')],util[_0x0ead('0x44')](_0x0ead('0xb8'),_0x457620[_0x0ead('0x45')],_0x457620['id']));var _0x24a00a=null;return Interval['intervalIftime'](_0x26a9da,_0x21ec4d)[_0x0ead('0x9a')](function(_0xdcbb45){if(_0xdcbb45===!![]){return _0xdcbb45;}else{_0x457620[_0x0ead('0x6c')]=_0x17acd1?utils[_0x0ead('0x65')][_0x0ead('0xa0')]:utils[_0x0ead('0x65')][_0x0ead('0xa1')];_0x24a00a=msgResponse(_0x0ead('0xa2'),_0x0ead('0x8e'),_0x0ead('0xa3')+_0x17acd1+'\x20'+_0x457620[_0x0ead('0x45')]+_0x0ead('0xa4')+util[_0x0ead('0x62')](_0x26a9da,{'showHidden':![],'depth':null})+_0x0ead('0xa5')+_0x21ec4d);}if(_0x24a00a!==null){logger[_0x0ead('0xb6')](_0x0ead('0xb9'),_0x24a00a);_0x24a00a[_0x0ead('0xba')]=_0x17acd1;throw _0x24a00a;}})[_0x0ead('0x9c')](function(_0x5bd03e){logger[_0x0ead('0x61')](_0x0ead('0xbb'),_0x5bd03e);throw msgResponse('[ifTime][Action]',_0x0ead('0x82'),util[_0x0ead('0x62')](_0x5bd03e,{'showHidden':![],'depth':null}));});};Dialer[_0x0ead('0x1a')][_0x0ead('0xbc')]=function(_0x291621){if(this[_0x0ead('0x1e')][_0x291621['queue']]){if(this[_0x0ead('0x25')][_0x291621[_0x0ead('0xbd')]]&&this['uniqueId'][_0x291621[_0x0ead('0xbd')]]['type']!==_0x0ead('0xbe')){this[_0x0ead('0xbf')](this[_0x0ead('0x1e')][_0x291621[_0x0ead('0xc0')]]);this[_0x0ead('0x25')][_0x291621[_0x0ead('0xbd')]][_0x0ead('0xc1')]=moment()['format'](_0x0ead('0xc2'));}}};Dialer[_0x0ead('0x1a')][_0x0ead('0x31')]=function(_0x44b12c){var _0xeef778=this['uniqueId'][_0x44b12c['uniqueid']];if(this[_0x0ead('0x1e')][_0x44b12c[_0x0ead('0xc0')]]){if(_0xeef778&&_0xeef778[_0x0ead('0x42')]!==_0x0ead('0xbe')){delete this[_0x0ead('0x25')][_0x44b12c['uniqueid']];this[_0x0ead('0x1e')][_0x44b12c[_0x0ead('0xc0')]]['outboundAnswerCallsDay']+=0x1;var _0x3d4204=new AgentComplete(_0xeef778,_0x44b12c);if(_0x44b12c[_0x0ead('0xc3')]===_0x0ead('0xc4')){_0x3d4204[_0x0ead('0xc5')]=this[_0x0ead('0x1e')][_0x44b12c[_0x0ead('0xc0')]][_0x0ead('0xc6')]&&this[_0x0ead('0x1e')][_0x44b12c[_0x0ead('0xc0')]][_0x0ead('0xc7')]?moment()[_0x0ead('0x44')](_0x0ead('0xc2')):undefined;}hopperUtils[_0x0ead('0xc8')](_0x3d4204)['catch'](loggerCatch('[syncAgentComplete][createHistory]'));hopperUtils[_0x0ead('0xc9')](_0x3d4204)[_0x0ead('0x9c')](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0x0ead('0x1a')]['syncQueueCallerAbandon']=function(_0x1b7c05){var _0x9a41b7=this['uniqueId'][_0x1b7c05[_0x0ead('0xbd')]];var _0x512ae9=this;var _0x45a12c=![];var _0x1c48e2;var _0x58d42b;if(this['voiceQueues'][_0x1b7c05[_0x0ead('0xc0')]]){if(_0x9a41b7&&_0x9a41b7['type']!==_0x0ead('0xbe')){delete this[_0x0ead('0x25')][_0x1b7c05[_0x0ead('0xbd')]];this[_0x0ead('0xbf')](this[_0x0ead('0x1e')][_0x1b7c05[_0x0ead('0xc0')]]);_0x9a41b7['droptime']=moment()[_0x0ead('0x44')](_0x0ead('0xc2'));var _0x4ab85d=new QueueCallerAbandon(_0x9a41b7,_0x1b7c05);if(utils['getSeconds'](_0x9a41b7[_0x0ead('0xca')],_0x9a41b7[_0x0ead('0xcb')])>=_0x9a41b7[_0x0ead('0xcc')]){this[_0x0ead('0x1e')][_0x1b7c05[_0x0ead('0xc0')]][_0x0ead('0x49')]+=0x1;this[_0x0ead('0x1e')][_0x1b7c05[_0x0ead('0xc0')]][_0x0ead('0xcd')]+=0x1;this[_0x0ead('0x1e')][_0x1b7c05[_0x0ead('0xc0')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x4ab85d['state']=0xa;_0x4ab85d[_0x0ead('0x6e')]=_0x0ead('0xce');_0x4ab85d[_0x0ead('0xcf')]=_0x0ead('0xd0');_0x4ab85d[_0x0ead('0xc5')]=this['voiceQueues'][_0x1b7c05[_0x0ead('0xc0')]][_0x0ead('0xc6')]?moment()[_0x0ead('0x44')](_0x0ead('0xc2')):undefined;_0x4ab85d[_0x0ead('0xd1')]+=0x1;_0x4ab85d['countglobal']+=0x1;_0x1c48e2=this[_0x0ead('0x1e')][_0x1b7c05['queue']][_0x0ead('0xd2')];_0x58d42b=this[_0x0ead('0x1e')][_0x1b7c05[_0x0ead('0xc0')]][_0x0ead('0xd3')];hopperUtils[_0x0ead('0xd4')](_0x4ab85d,_0x4ab85d[_0x0ead('0x6d')],_0x9a41b7[_0x0ead('0xd5')])[_0x0ead('0x9a')](function(_0x4a0b6b){_0x45a12c=_0x4a0b6b[_0x0ead('0xd6')]==0x1;if(_0x4ab85d['countdropretry']>=_0x512ae9[_0x0ead('0x1e')][_0x1b7c05[_0x0ead('0xc0')]][_0x0ead('0xd7')]){_0x512ae9['queueCallerAbandonCreateState'](_0x4ab85d,_0x4a0b6b[_0x0ead('0xd6')]);}else{hopperUtils[_0x0ead('0xd8')]({'active':![],'countdropretry':_0x4ab85d[_0x0ead('0xd1')],'scheduledat':moment()[_0x0ead('0xd9')](_0x512ae9[_0x0ead('0x1e')][_0x1b7c05['queue']][_0x0ead('0xd2')],_0x0ead('0xda'))['format'](_0x0ead('0xc2')),'ContactId':_0x9a41b7[_0x0ead('0xdb')],'ListId':_0x9a41b7[_0x0ead('0xdc')],'VoiceQueueId':_0x9a41b7['VoiceQueueId']||undefined,'CampaignId':_0x9a41b7[_0x0ead('0xdd')]||undefined})[_0x0ead('0x9c')](loggerCatch(_0x0ead('0xde')));var _0x541059=new History(_0x4ab85d);_0x541059[_0x0ead('0x6d')]=0xa;_0x541059['statedesc']='Drop';_0x541059[_0x0ead('0xdf')]=moment()[_0x0ead('0x44')]('YYYY-MM-DD\x20HH:mm:ss');_0x541059['endtime']=_0x541059[_0x0ead('0xdf')];_0x541059[_0x0ead('0xe0')]=_0x4ab85d[_0x0ead('0xe0')];_0x541059[_0x0ead('0xe1')]=_0x4ab85d[_0x0ead('0xe1')];hopperUtils['createHistory'](_0x541059)[_0x0ead('0x9c')](loggerCatch(_0x0ead('0xe2')));}})[_0x0ead('0x9a')](function(){if(_0x45a12c)hopperUtils[_0x0ead('0xe3')](_0x4ab85d,_0x1c48e2,_0x58d42b)[_0x0ead('0x9a')](function(){return 0x1;});});}else{this['voiceQueues'][_0x1b7c05[_0x0ead('0xc0')]][_0x0ead('0x4b')]+=0x1;this['voiceQueues'][_0x1b7c05[_0x0ead('0xc0')]][_0x0ead('0xe4')]+=0x1;_0x4ab85d[_0x0ead('0x6d')]=0xb;_0x4ab85d[_0x0ead('0x6e')]=_0x0ead('0xe5');_0x4ab85d[_0x0ead('0xcf')]='CALLEREXIT';_0x4ab85d[_0x0ead('0xe6')]+=0x1;_0x4ab85d[_0x0ead('0xe7')]+=0x1;_0x1c48e2=this['voiceQueues'][_0x1b7c05[_0x0ead('0xc0')]][_0x0ead('0xe8')];_0x58d42b=this['voiceQueues'][_0x1b7c05[_0x0ead('0xc0')]][_0x0ead('0xd3')];hopperUtils[_0x0ead('0xd4')](_0x4ab85d,_0x4ab85d['state'],_0x9a41b7[_0x0ead('0xd5')])[_0x0ead('0x9a')](function(_0x429421){if(_0x4ab85d[_0x0ead('0xe6')]>=_0x512ae9[_0x0ead('0x1e')][_0x1b7c05['queue']][_0x0ead('0xe9')]){_0x512ae9[_0x0ead('0xea')](_0x4ab85d,_0x429421[_0x0ead('0xd6')]);}else{hopperUtils[_0x0ead('0xd8')]({'active':![],'countabandonedretry':_0x4ab85d[_0x0ead('0xe6')],'scheduledat':moment()[_0x0ead('0xd9')](_0x512ae9[_0x0ead('0x1e')][_0x1b7c05[_0x0ead('0xc0')]][_0x0ead('0xe8')],_0x0ead('0xda'))[_0x0ead('0x44')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x9a41b7[_0x0ead('0xdb')],'ListId':_0x9a41b7[_0x0ead('0xdc')],'VoiceQueueId':_0x9a41b7['VoiceQueueId']||undefined,'CampaignId':_0x9a41b7['CampaignId']||undefined})[_0x0ead('0x9c')](loggerCatch(_0x0ead('0xeb')));var _0x126844=new History(_0x4ab85d);_0x126844[_0x0ead('0x6d')]=0xb;_0x126844[_0x0ead('0x6e')]=_0x0ead('0xe5');_0x126844[_0x0ead('0xdf')]=moment()[_0x0ead('0x44')]('YYYY-MM-DD\x20HH:mm:ss');_0x126844['endtime']=_0x126844['starttime'];_0x126844['calleridname']=_0x4ab85d[_0x0ead('0xe0')];_0x126844[_0x0ead('0xe1')]=_0x4ab85d[_0x0ead('0xe1')];hopperUtils['createHistory'](_0x126844)['catch'](loggerCatch(_0x0ead('0xec')));}})['then'](function(){if(_0x45a12c)hopperUtils[_0x0ead('0xe3')](_0x4ab85d,_0x1c48e2,_0x58d42b)[_0x0ead('0x9a')](function(){return 0x1;});});}}}};Dialer[_0x0ead('0x1a')][_0x0ead('0x38')]=function(_0x568617){if(this[_0x0ead('0x24')][_0x568617[_0x0ead('0xbd')]]){this[_0x0ead('0x24')][_0x568617[_0x0ead('0xbd')]][_0x0ead('0xed')]=_0x568617[_0x0ead('0xed')];}if(this[_0x0ead('0x25')][_0x568617[_0x0ead('0xbd')]]){this['uniqueId'][_0x568617[_0x0ead('0xbd')]][_0x0ead('0xed')]=_0x568617[_0x0ead('0xed')];}};Dialer['prototype']['syncQueueMember']=function(_0x5bee06){if(!this['actions'][_0x5bee06['actionid']]){return;}var _0x42876c=this['voiceQueues'][this[_0x0ead('0x24')][_0x5bee06[_0x0ead('0xee')]][_0x0ead('0xc0')]]['strategy']||_0x0ead('0xef');if(_0x42876c===_0x0ead('0xf0')){if(this[_0x0ead('0x24')][_0x5bee06['actionid']]&&_[_0x0ead('0xf1')](this['actions'][_0x5bee06[_0x0ead('0xee')]][_0x0ead('0xf2')])&&_0x5bee06[_0x0ead('0x86')]==='1'&&_0x5bee06[_0x0ead('0xf3')]==='0'){if(this[_0x0ead('0x20')][_0x5bee06[_0x0ead('0xf4')]]){if(!this[_0x0ead('0x20')][_0x5bee06[_0x0ead('0xf4')]]['locked']){this[_0x0ead('0x20')][_0x5bee06['stateinterface']][_0x0ead('0xf2')]=!![];this['actions'][_0x5bee06[_0x0ead('0xee')]][_0x0ead('0xf2')]=!![];this['actions'][_0x5bee06['actionid']][_0x0ead('0xf4')]=_0x5bee06[_0x0ead('0xf4')];}}}}else if(_0x42876c===_0x0ead('0xef')){if(this[_0x0ead('0x24')][_0x5bee06[_0x0ead('0xee')]]){if(this[_0x0ead('0x20')][_0x5bee06['stateinterface']]){this[_0x0ead('0x24')][_0x5bee06['actionid']]['stateinterface']=_0x5bee06[_0x0ead('0xf4')];if(_['isNil'](this[_0x0ead('0x2a')][this['actions'][_0x5bee06[_0x0ead('0xee')]][_0x0ead('0xc0')]])){this[_0x0ead('0x2a')][this[_0x0ead('0x24')][_0x5bee06[_0x0ead('0xee')]]['queue']]=[];}this[_0x0ead('0x2a')][this[_0x0ead('0x24')][_0x5bee06[_0x0ead('0xee')]][_0x0ead('0xc0')]][_0x0ead('0x95')](_[_0x0ead('0xf5')](_[_0x0ead('0xf6')](this[_0x0ead('0x24')][_0x5bee06[_0x0ead('0xee')]],['idHopper',_0x0ead('0xf4')]),{'status':_0x5bee06['status'],'paused':_0x5bee06[_0x0ead('0xf3')]}));}}}};Dialer[_0x0ead('0x1a')][_0x0ead('0x3c')]=function(_0x2aa8e1){if(!this['actions'][_0x2aa8e1[_0x0ead('0xee')]]){return;}var _0x2ea5a1=this;var _0x145695=this[_0x0ead('0x1e')][this['actions'][_0x2aa8e1[_0x0ead('0xee')]][_0x0ead('0xc0')]];var _0x109781=_0x145695[_0x0ead('0xf7')]||_0x0ead('0xef');if(_0x109781===_0x0ead('0xf0')){if(this[_0x0ead('0x24')][_0x2aa8e1[_0x0ead('0xee')]]&&this[_0x0ead('0x24')][_0x2aa8e1[_0x0ead('0xee')]][_0x0ead('0xf4')]){this['preview'][_0x0ead('0xf8')](this[_0x0ead('0x24')][_0x2aa8e1[_0x0ead('0xee')]][_0x0ead('0xf9')],this[_0x0ead('0x24')][_0x2aa8e1['actionid']][_0x0ead('0xf4')])['catch'](function(_0x21d40c){logger[_0x0ead('0x61')](_0x0ead('0xfa'),util[_0x0ead('0x62')](_0x21d40c,{'showHidden':![],'depth':null}));})[_0x0ead('0x1c')](function(){_0x2ea5a1[_0x0ead('0xbf')](_0x2ea5a1['voiceQueues'][_0x2ea5a1[_0x0ead('0x24')][_0x2aa8e1[_0x0ead('0xee')]][_0x0ead('0xc0')]]);_0x2ea5a1[_0x0ead('0x20')][_0x2ea5a1[_0x0ead('0x24')][_0x2aa8e1[_0x0ead('0xee')]][_0x0ead('0xf4')]][_0x0ead('0xf2')]=![];delete _0x2ea5a1['actions'][_0x2aa8e1[_0x0ead('0xee')]];unlockQueueStatus(_0x145695);});}else{this[_0x0ead('0xbf')](this['voiceQueues'][this[_0x0ead('0x24')][_0x2aa8e1[_0x0ead('0xee')]]['queue']]);hopperUtils[_0x0ead('0xd8')]({'active':![],'ContactId':this[_0x0ead('0x24')][_0x2aa8e1[_0x0ead('0xee')]][_0x0ead('0xdb')],'ListId':this['actions'][_0x2aa8e1[_0x0ead('0xee')]][_0x0ead('0xdc')],'VoiceQueueId':this[_0x0ead('0x24')][_0x2aa8e1[_0x0ead('0xee')]][_0x0ead('0xfb')]||undefined,'CampaignId':this[_0x0ead('0x24')][_0x2aa8e1[_0x0ead('0xee')]][_0x0ead('0xdd')]||undefined})['catch'](loggerCatch(_0x0ead('0xfc')));delete this['actions'][_0x2aa8e1[_0x0ead('0xee')]];unlockQueueStatus(_0x145695);}}else if(_0x109781===_0x0ead('0xef')){var _0x4d051c;if(this[_0x0ead('0x24')][_0x2aa8e1[_0x0ead('0xee')]]&&!_['isEmpty'](this[_0x0ead('0x2a')][this[_0x0ead('0x24')][_0x2aa8e1['actionid']][_0x0ead('0xc0')]])){if(this['queueBookedRR'][_0x2ea5a1[_0x0ead('0x24')][_0x2aa8e1[_0x0ead('0xee')]][_0x0ead('0xc0')]]){this[_0x0ead('0xfd')][_0x2ea5a1['actions'][_0x2aa8e1['actionid']][_0x0ead('0xc0')]]=this[_0x0ead('0xfd')][this['actions'][_0x2aa8e1[_0x0ead('0xee')]][_0x0ead('0xc0')]]?this[_0x0ead('0xfd')][this[_0x0ead('0x24')][_0x2aa8e1['actionid']][_0x0ead('0xc0')]]:this[_0x0ead('0x2a')][this['actions'][_0x2aa8e1['actionid']][_0x0ead('0xc0')]]?this[_0x0ead('0x2a')][this[_0x0ead('0x24')][_0x2aa8e1[_0x0ead('0xee')]][_0x0ead('0xc0')]][_0x0ead('0xfe')]||0x0:0x0;}this[_0x0ead('0x2a')][this[_0x0ead('0x24')][_0x2aa8e1[_0x0ead('0xee')]]['queue']]['_rr']=this['queueBookedRR'][this['actions'][_0x2aa8e1[_0x0ead('0xee')]][_0x0ead('0xc0')]];for(var _0xbb0447=0x0;_0xbb0447<this[_0x0ead('0x2a')][this['actions'][_0x2aa8e1['actionid']]['queue']][_0x0ead('0x94')];_0xbb0447+=0x1){_0x4d051c=rr(this[_0x0ead('0x2a')][this['actions'][_0x2aa8e1[_0x0ead('0xee')]][_0x0ead('0xc0')]]);this['queueBookedRR'][_0x2ea5a1[_0x0ead('0x24')][_0x2aa8e1[_0x0ead('0xee')]][_0x0ead('0xc0')]]=this['queueBooked'][this[_0x0ead('0x24')][_0x2aa8e1[_0x0ead('0xee')]][_0x0ead('0xc0')]][_0x0ead('0xfe')];if(_0x4d051c[_0x0ead('0x86')]==='1'&&_0x4d051c['paused']==='0'){break;}}if(!_['isNil'](_0x4d051c)){this[_0x0ead('0x20')][_0x4d051c[_0x0ead('0xf4')]][_0x0ead('0xff')]=_[_0x0ead('0x51')](this[_0x0ead('0x20')][_0x4d051c[_0x0ead('0xf4')]][_0x0ead('0xff')])?!![]:this[_0x0ead('0x20')][_0x4d051c[_0x0ead('0xf4')]]['unlockRR'];}loggerBooked[_0x0ead('0x46')](_0x0ead('0x100'),_0x2aa8e1[_0x0ead('0xee')],'Agent:\x20',JSON[_0x0ead('0x72')](_[_0x0ead('0xf6')](this[_0x0ead('0x20')][_0x4d051c[_0x0ead('0xf4')]],[_0x0ead('0x45'),_0x0ead('0xff')])),_0x0ead('0x101'),JSON[_0x0ead('0x72')](_0x4d051c[_0x0ead('0xf9')]));if(!_[_0x0ead('0xf1')](_0x4d051c)&&_0x4d051c[_0x0ead('0x86')]==='1'&&_0x4d051c[_0x0ead('0xf3')]==='0'&&this[_0x0ead('0x20')][_0x4d051c[_0x0ead('0xf4')]][_0x0ead('0xff')]){this['agents'][_0x4d051c[_0x0ead('0xf4')]]['unlockRR']=![];this[_0x0ead('0x2a')][_0x2ea5a1['actions'][_0x2aa8e1['actionid']]['queue']]=[];this[_0x0ead('0x102')][_0x0ead('0xf8')](_0x4d051c['idHopper'],_0x4d051c['stateinterface'])[_0x0ead('0x9c')](function(_0x2081e0){logger['error'](_0x0ead('0xfa'),util[_0x0ead('0x62')](_0x2081e0,{'showHidden':![],'depth':null}));})['finally'](function(){_0x2ea5a1[_0x0ead('0xbf')](_0x2ea5a1[_0x0ead('0x1e')][_0x2ea5a1['actions'][_0x2aa8e1[_0x0ead('0xee')]][_0x0ead('0xc0')]]);setTimeout(function(){_0x2ea5a1[_0x0ead('0x20')][_0x4d051c['stateinterface']]['unlockRR']=!![];loggerBooked[_0x0ead('0x46')](_0x0ead('0x103'),_0x2aa8e1[_0x0ead('0xee')],_0x0ead('0x104'),JSON['stringify'](_[_0x0ead('0xf6')](_0x2ea5a1[_0x0ead('0x20')][_0x4d051c['stateinterface']],['name',_0x0ead('0xff')])),'contactAgent-idHopper:\x20',JSON['stringify'](_0x4d051c[_0x0ead('0xf9')]));},0xc7);delete _0x2ea5a1['actions'][_0x2aa8e1[_0x0ead('0xee')]];unlockQueueStatus(_0x145695,_0x2aa8e1[_0x0ead('0xee')]);});}else{loggerBooked[_0x0ead('0x46')](_0x0ead('0x105'));this[_0x0ead('0xbf')](this[_0x0ead('0x1e')][this[_0x0ead('0x24')][_0x2aa8e1['actionid']][_0x0ead('0xc0')]]);hopperUtils[_0x0ead('0xd8')]({'active':![],'ContactId':this[_0x0ead('0x24')][_0x2aa8e1[_0x0ead('0xee')]][_0x0ead('0xdb')],'ListId':this[_0x0ead('0x24')][_0x2aa8e1[_0x0ead('0xee')]][_0x0ead('0xdc')],'VoiceQueueId':this[_0x0ead('0x24')][_0x2aa8e1[_0x0ead('0xee')]][_0x0ead('0xfb')]||undefined,'CampaignId':this[_0x0ead('0x24')][_0x2aa8e1[_0x0ead('0xee')]][_0x0ead('0xdd')]||undefined})['catch'](loggerCatch(_0x0ead('0xfc')));delete this[_0x0ead('0x24')][_0x2aa8e1[_0x0ead('0xee')]];unlockQueueStatus(_0x145695);}}else{loggerBooked[_0x0ead('0x46')](_0x0ead('0x106'));this[_0x0ead('0xbf')](this[_0x0ead('0x1e')][this[_0x0ead('0x24')][_0x2aa8e1['actionid']][_0x0ead('0xc0')]]);hopperUtils[_0x0ead('0xd8')]({'active':![],'ContactId':this[_0x0ead('0x24')][_0x2aa8e1[_0x0ead('0xee')]]['ContactId'],'ListId':this[_0x0ead('0x24')][_0x2aa8e1['actionid']][_0x0ead('0xdc')],'VoiceQueueId':this[_0x0ead('0x24')][_0x2aa8e1[_0x0ead('0xee')]][_0x0ead('0xfb')]||undefined,'CampaignId':this['actions'][_0x2aa8e1[_0x0ead('0xee')]]['CampaignId']||undefined})[_0x0ead('0x9c')](loggerCatch('[unlock2][syncQueueStatusComplete]'));delete this[_0x0ead('0x24')][_0x2aa8e1[_0x0ead('0xee')]];unlockQueueStatus(_0x145695);}}else{loggerBooked[_0x0ead('0x46')](_0x0ead('0x107'));this[_0x0ead('0xbf')](this[_0x0ead('0x1e')][this['actions'][_0x2aa8e1[_0x0ead('0xee')]][_0x0ead('0xc0')]]);hopperUtils[_0x0ead('0xd8')]({'active':![],'ContactId':this[_0x0ead('0x24')][_0x2aa8e1[_0x0ead('0xee')]][_0x0ead('0xdb')],'ListId':this[_0x0ead('0x24')][_0x2aa8e1['actionid']]['ListId'],'VoiceQueueId':this['actions'][_0x2aa8e1[_0x0ead('0xee')]]['VoiceQueueId']||undefined,'CampaignId':this['actions'][_0x2aa8e1[_0x0ead('0xee')]][_0x0ead('0xdd')]||undefined})[_0x0ead('0x9c')](loggerCatch(_0x0ead('0x108')));delete this[_0x0ead('0x24')][_0x2aa8e1[_0x0ead('0xee')]];unlockQueueStatus(_0x145695);}};Dialer[_0x0ead('0x1a')][_0x0ead('0x109')]=function(_0x83ecbb){var _0x1bef3a=this[_0x0ead('0x24')][_0x83ecbb[_0x0ead('0xee')]];if(_0x1bef3a){delete this['actions'][_0x83ecbb[_0x0ead('0xee')]];_0x1bef3a[_0x0ead('0xcb')]=moment()['format'](_0x0ead('0xc2'));var _0x54d609=_0x1bef3a[_0x0ead('0x42')]==='ivr'?this[_0x0ead('0x1f')][_0x1bef3a[_0x0ead('0xc0')]]:this[_0x0ead('0x1e')][_0x1bef3a[_0x0ead('0x10a')]()];if(_0x83ecbb['response']!==_0x0ead('0x10b')){this['updateOriginated'](_0x54d609);return this[_0x0ead('0x10c')](_0x1bef3a,_0x54d609,_0x83ecbb)['catch'](loggerCatch(_0x0ead('0x10d')));}this['uniqueId'][_0x83ecbb[_0x0ead('0xbd')]]=_0x1bef3a;}};Dialer['prototype'][_0x0ead('0x3a')]=function(_0x26aac7){var _0x2e1530=this;var _0x5be77=this[_0x0ead('0x25')][_0x26aac7[_0x0ead('0xbd')]];var _0x4be900;if(!_[_0x0ead('0xf1')](_0x26aac7)&&!_[_0x0ead('0xf1')](_0x26aac7[_0x0ead('0x10e')])&&!_['isNil'](_0x26aac7[_0x0ead('0x10e')][_0x0ead('0x10f')])&&_0x26aac7['exten']===_0x0ead('0x110')&&_0x5be77){if(_0x5be77[_0x0ead('0x42')]!==_0x0ead('0xbe')&&this[_0x0ead('0x1e')][_0x5be77[_0x0ead('0xc0')]]['dialAMDActive']&&_0x26aac7['value']===_0x0ead('0x111')){delete this[_0x0ead('0x25')][_0x26aac7[_0x0ead('0xbd')]];this[_0x0ead('0xbf')](this[_0x0ead('0x1e')][_0x5be77[_0x0ead('0xc0')]]);this[_0x0ead('0x1e')][_0x5be77['queue']]['outboundAnswerCallsDay']+=0x1;this[_0x0ead('0x1e')][_0x5be77[_0x0ead('0xc0')]][_0x0ead('0x112')]+=0x1;_0x4be900=new Hangup(_0x5be77,_0x26aac7);_0x4be900[_0x0ead('0x6d')]=0x12;_0x4be900['statedesc']=_0x0ead('0x113');_0x4be900[_0x0ead('0x114')]=_0x0ead('0x115');ami[_0x0ead('0x41')](_0x0ead('0x116'),ut[_0x0ead('0x117')](_0x4be900,_0x0ead('0x118')));this[_0x0ead('0x119')](_0x4be900,_0x0ead('0x11a'),_0x0ead('0x11b'));}if(_0x5be77['type']!=='ivr'&&this['voiceQueues'][_0x5be77[_0x0ead('0xc0')]][_0x0ead('0x11c')]&&_0x26aac7[_0x0ead('0x11d')]===_0x0ead('0x11e')){return new Promise(function(_0x48478f,_0x4b7b2f){delete _0x2e1530[_0x0ead('0x25')][_0x26aac7[_0x0ead('0xbd')]];_0x2e1530[_0x0ead('0xbf')](_0x2e1530[_0x0ead('0x1e')][_0x5be77[_0x0ead('0xc0')]]);_0x2e1530[_0x0ead('0x1e')][_0x5be77[_0x0ead('0xc0')]][_0x0ead('0x11f')]+=0x1;_0x2e1530['voiceQueues'][_0x5be77['queue']][_0x0ead('0x112')]+=0x1;var _0x160252=_0x2e1530[_0x0ead('0x1e')][_0x5be77[_0x0ead('0xc0')]];var _0x54f7ad=new Hangup(_0x5be77,_0x26aac7);_0x54f7ad[_0x0ead('0x6d')]=0x13;_0x54f7ad[_0x0ead('0x6e')]=_0x0ead('0x120');_0x54f7ad['membername']=_0x0ead('0x115');_0x54f7ad[_0x0ead('0x121')]+=0x1;_0x54f7ad['countglobal']+=0x1;_0x54f7ad[_0x0ead('0x118')]=!![];ami['emit']('custom:amd',ut[_0x0ead('0x117')](_0x54f7ad,'amd'));hopperUtils[_0x0ead('0xc8')](_0x54f7ad)[_0x0ead('0x9c')](loggerCatch(_0x0ead('0x122')));if(_0x54f7ad[_0x0ead('0x123')]+_0x54f7ad['countcongestionretry']+_0x54f7ad['countnoanswerretry']+_0x54f7ad[_0x0ead('0x124')]+_0x54f7ad['countdropretry']+_0x54f7ad['countabandonedretry']+_0x54f7ad['countmachineretry']+_0x54f7ad[_0x0ead('0x125')]>=_0x160252['dialGlobalMaxRetry']){_0x2e1530['stateGlobal'](_0x54f7ad,_0x48478f,_0x4b7b2f,_0x0ead('0x126'));}else{if(_0x54f7ad[_0x0ead('0x121')]>=_0x160252[_0x0ead('0x127')]){_0x2e1530[_0x0ead('0x128')](_0x54f7ad,_0x48478f,_0x4b7b2f,'reason\x2019\x20machine....');}else{hopperUtils[_0x0ead('0xd8')]({'active':![],'countmachineretry':_0x54f7ad['countmachineretry'],'scheduledat':moment()[_0x0ead('0xd9')](_0x160252[_0x0ead('0x129')],_0x0ead('0xda'))['format'](_0x0ead('0xc2')),'ContactId':_0x54f7ad[_0x0ead('0xdb')],'ListId':_0x54f7ad['ListId'],'VoiceQueueId':_0x54f7ad[_0x0ead('0xfb')]||undefined,'CampaignId':_0x54f7ad[_0x0ead('0xdd')]||undefined})[_0x0ead('0x9c')](loggerCatch(_0x0ead('0x12a')));_0x48478f({'reschedule':0x1});}}});}if(_0x5be77[_0x0ead('0x42')]===_0x0ead('0xbe')&&this[_0x0ead('0x1f')][_0x5be77[_0x0ead('0xc0')]][_0x0ead('0x11c')]&&_0x26aac7[_0x0ead('0x11d')]==='HANGUP'){delete this[_0x0ead('0x25')][_0x26aac7[_0x0ead('0xbd')]];this['updateOriginated'](this[_0x0ead('0x1f')][_0x5be77[_0x0ead('0xc0')]]);_0x4be900=new Hangup(_0x5be77,_0x26aac7);_0x4be900['state']=0x12;_0x4be900[_0x0ead('0x6e')]=_0x0ead('0x113');_0x4be900[_0x0ead('0x114')]=_0x0ead('0x115');ami['emit']('custom:amd',ut[_0x0ead('0x117')](_0x4be900,_0x0ead('0x118')));this[_0x0ead('0x119')](_0x4be900,'[syncHangupInAMDIvr][createHistory]',_0x0ead('0x12b'));}if(_0x5be77[_0x0ead('0x42')]===_0x0ead('0xbe')&&this['campaigns'][_0x5be77[_0x0ead('0xc0')]][_0x0ead('0x11c')]&&_0x26aac7[_0x0ead('0x11d')]==='MACHINE'){return new Promise(function(_0x221fea,_0x51a8bc){delete _0x2e1530[_0x0ead('0x25')][_0x26aac7[_0x0ead('0xbd')]];_0x2e1530['updateOriginated'](_0x2e1530[_0x0ead('0x1f')][_0x5be77['queue']]);_0x2e1530[_0x0ead('0x1f')][_0x5be77[_0x0ead('0xc0')]][_0x0ead('0x11f')]+=0x1;_0x2e1530['campaigns'][_0x5be77[_0x0ead('0xc0')]][_0x0ead('0x112')]+=0x1;var _0x547c56=_0x2e1530[_0x0ead('0x1f')][_0x5be77[_0x0ead('0xc0')]];var _0x541eb5=new Hangup(_0x5be77,_0x26aac7);_0x541eb5[_0x0ead('0x6d')]=0x13;_0x541eb5['statedesc']=_0x0ead('0x120');_0x541eb5[_0x0ead('0x114')]='AMD';_0x541eb5['countmachineretry']+=0x1;_0x541eb5[_0x0ead('0xe7')]+=0x1;_0x541eb5[_0x0ead('0x118')]=!![];ami[_0x0ead('0x41')](_0x0ead('0x116'),ut['buildObj'](_0x541eb5,'amd'));hopperUtils[_0x0ead('0xc8')](_0x541eb5)['catch'](loggerCatch(_0x0ead('0x122')));if(_0x541eb5['countbusyretry']+_0x541eb5['countcongestionretry']+_0x541eb5[_0x0ead('0x12c')]+_0x541eb5[_0x0ead('0x124')]+_0x541eb5[_0x0ead('0xd1')]+_0x541eb5['countabandonedretry']+_0x541eb5[_0x0ead('0x121')]+_0x541eb5[_0x0ead('0x125')]>=_0x547c56[_0x0ead('0x12d')]){_0x2e1530[_0x0ead('0x12e')](_0x541eb5,_0x221fea,_0x51a8bc,_0x0ead('0x126'));}else{if(_0x541eb5['countmachineretry']>=_0x547c56['dialMachineMaxRetry']){_0x2e1530[_0x0ead('0x128')](_0x541eb5,_0x221fea,_0x51a8bc,'reason\x2019\x20machine....');}else{hopperUtils[_0x0ead('0xd8')]({'active':![],'countmachineretry':_0x541eb5[_0x0ead('0x121')],'scheduledat':moment()[_0x0ead('0xd9')](_0x547c56['dialMachineRetryFrequency'],'minutes')['format'](_0x0ead('0xc2')),'ContactId':_0x541eb5['ContactId'],'ListId':_0x541eb5[_0x0ead('0xdc')],'VoiceQueueId':_0x541eb5[_0x0ead('0xfb')]||undefined,'CampaignId':_0x541eb5[_0x0ead('0xdd')]||undefined})[_0x0ead('0x9c')](loggerCatch('[rescheduleContact][Machine]'));_0x221fea({'reschedule':0x1});}}});}}};Dialer['prototype'][_0x0ead('0x36')]=function(_0x418d68){var _0x59b4e1=this[_0x0ead('0x25')][_0x418d68[_0x0ead('0xbd')]];var _0x5a7904;if(_0x59b4e1&&_0x59b4e1[_0x0ead('0x42')]===_0x0ead('0xbe')){delete this[_0x0ead('0x25')][_0x418d68[_0x0ead('0xbd')]];this[_0x0ead('0xbf')](this[_0x0ead('0x1f')][_0x59b4e1[_0x0ead('0xc0')]]);this[_0x0ead('0x1f')][_0x59b4e1[_0x0ead('0xc0')]][_0x0ead('0x12f')]+=0x1;_0x5a7904=new Hangup(_0x59b4e1,_0x418d68);hopperUtils['createHistory'](_0x5a7904)[_0x0ead('0x9c')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0x0ead('0xc9')](_0x5a7904)[_0x0ead('0x9c')](loggerCatch(_0x0ead('0x130')));}if(_0x59b4e1&&_0x59b4e1[_0x0ead('0x42')]!==_0x0ead('0xbe')&&isNotNull(this[_0x0ead('0x1e')][_0x59b4e1[_0x0ead('0xc0')]][_0x0ead('0x131')])){delete this[_0x0ead('0x25')][_0x418d68[_0x0ead('0xbd')]];this[_0x0ead('0xbf')](this[_0x0ead('0x1e')][_0x59b4e1['queue']]);this[_0x0ead('0x1e')][_0x59b4e1['queue']][_0x0ead('0x11f')]+=0x1;this[_0x0ead('0x1e')][_0x59b4e1['queue']][_0x0ead('0x112')]+=0x1;_0x5a7904=new Hangup(_0x59b4e1,_0x418d68);_0x5a7904['state']=0x10;_0x5a7904['statedesc']=_0x0ead('0x132');_0x5a7904[_0x0ead('0x114')]='AGI';hopperUtils[_0x0ead('0xc8')](_0x5a7904)[_0x0ead('0x9c')](loggerCatch(_0x0ead('0x133')));hopperUtils[_0x0ead('0xc9')](_0x5a7904)[_0x0ead('0x9c')](loggerCatch('[syncHangupIvr]'));}if(_0x59b4e1&&_0x59b4e1['type']!==_0x0ead('0xbe')&&!isNotNull(this[_0x0ead('0x1e')][_0x59b4e1['queue']][_0x0ead('0x131')])){if(_0x418d68[_0x0ead('0x134')]===_0x0ead('0x135')){delete this[_0x0ead('0x25')][_0x418d68[_0x0ead('0xbd')]];this[_0x0ead('0x1e')][_0x59b4e1[_0x0ead('0xc0')]][_0x0ead('0x11f')]+=0x1;const _0x2bbf1d=new AgentComplete(_0x59b4e1,_0x418d68);_0x2bbf1d[_0x0ead('0xdd')]=this['voiceQueues'][_0x59b4e1[_0x0ead('0xc0')]]['id'];hopperUtils[_0x0ead('0xc8')](_0x2bbf1d)[_0x0ead('0x9c')](loggerCatch('[syncAgentComplete][createHistory]'));hopperUtils[_0x0ead('0xc9')](_0x2bbf1d)[_0x0ead('0x9c')](loggerCatch(_0x0ead('0x136')));}else{delete this[_0x0ead('0x25')][_0x418d68[_0x0ead('0xbd')]];this[_0x0ead('0xbf')](this[_0x0ead('0x1e')][_0x59b4e1[_0x0ead('0xc0')]]);this[_0x0ead('0x1e')][_0x59b4e1[_0x0ead('0xc0')]][_0x0ead('0x137')]+=0x1;_0x5a7904=new Hangup(_0x59b4e1,_0x418d68);_0x5a7904[_0x0ead('0x6d')]=0xc;_0x5a7904[_0x0ead('0x6e')]=_0x418d68['cause-txt'];_0x5a7904[_0x0ead('0x114')]='Unknow';hopperUtils[_0x0ead('0xc8')](_0x5a7904)[_0x0ead('0x9c')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils['moveContactManagedDialer'](_0x5a7904)['catch'](loggerCatch(_0x0ead('0x130')));}}};Dialer[_0x0ead('0x1a')][_0x0ead('0xa')]=function(_0x34fef3){var _0x460f62=this;if(!_0x460f62[_0x0ead('0x2b')][_0x34fef3[_0x0ead('0x45')]]){_0x460f62[_0x0ead('0x2b')][_0x34fef3['name']]={'running':![]};}else if(_0x460f62[_0x0ead('0x2b')][_0x34fef3[_0x0ead('0x45')]][_0x0ead('0x138')]===!![]){return;}else if(_0x460f62[_0x0ead('0x2b')][_0x34fef3[_0x0ead('0x45')]][_0x0ead('0x138')]===![]){_0x460f62['queuesSummary'][_0x34fef3[_0x0ead('0x45')]][_0x0ead('0x138')]=!![];}var _0x13ddf3=_0x460f62[_0x0ead('0x1e')][_0x34fef3[_0x0ead('0x45')]];var _0x4a4863=_0x13ddf3[_0x0ead('0x6c')]!==utils[_0x0ead('0x65')][_0x0ead('0x7d')];var _0x1d676a=utils['isPreviewCampaign'](_0x13ddf3);_0x13ddf3[_0x0ead('0x139')]=utils[_0x0ead('0x13a')](_0x13ddf3,_0x460f62[_0x0ead('0x21')]);Promise['resolve']()[_0x0ead('0x9a')](function(){if(_0x13ddf3[_0x0ead('0x139')]===utils[_0x0ead('0x65')][_0x0ead('0x7d')]){if(_0x4a4863){clearPredictiveAttributes(_0x13ddf3);_0x34fef3['startPredictive']=undefined;_0x34fef3['startProgressive']=undefined;}if(_0x13ddf3[_0x0ead('0x139')]===utils[_0x0ead('0x65')][_0x0ead('0x7d')]){_0x34fef3[_0x0ead('0x13b')]=0x0;_0x34fef3[_0x0ead('0xf3')]=0x0;_0x34fef3[_0x0ead('0x13c')]=0x0;_0x34fef3[_0x0ead('0x13d')]=0x0;_0x34fef3[_0x0ead('0x13e')]=0x0;}}else if(_0x13ddf3['statusMessage']===utils[_0x0ead('0x65')][_0x0ead('0x13f')]&&!_0x1d676a){return _0x460f62['ifTime'](_0x13ddf3,!![])[_0x0ead('0x9a')](function(){return _0x460f62[_0x0ead('0x8d')](_0x13ddf3,![]);})[_0x0ead('0x9a')](function(){return _0x460f62[_0x0ead('0xb0')](_0x13ddf3);})['catch'](function(_0x45e549){loggerSyncQueueSummary[_0x0ead('0x43')](_0x0ead('0x140'),util[_0x0ead('0x62')](_0x45e549,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x13ddf3);});}else{clearPredictiveAttributes(_0x13ddf3);}})[_0x0ead('0x9a')](function(){var _0x3d5804=_0x34fef3[_0x0ead('0x141')](_0x13ddf3);if(_0x3d5804||_0x13ddf3[_0x0ead('0x142')]){_0x13ddf3['queueSummaryCountersUpdated']=![];_0x34fef3[_0x0ead('0x143')](_0x13ddf3);Object[_0x0ead('0x144')](_0x13ddf3,_0x34fef3);emitOutboundVoiceQueueSummary(_0x34fef3);}_0x460f62[_0x0ead('0x2b')][_0x13ddf3[_0x0ead('0x45')]][_0x0ead('0x138')]=![];})['catch'](function(_0x1795ab){logger[_0x0ead('0x61')](_0x0ead('0x140'),util[_0x0ead('0x62')](_0x1795ab,{'showHidden':![],'depth':null}));_0x460f62[_0x0ead('0x2b')][_0x13ddf3[_0x0ead('0x45')]][_0x0ead('0x138')]=![];});};Dialer[_0x0ead('0x1a')][_0x0ead('0x34')]=_[_0x0ead('0x145')](function(){var _0x5ab81e=_[_0x0ead('0x146')](this[_0x0ead('0x1e')],function(_0x397d22){return _0x397d22[_0x0ead('0x147')];});var _0x323653=_[_0x0ead('0x146')](this[_0x0ead('0x20')],function(_0x38ff81){return _0x38ff81[_0x0ead('0x148')]&&_0x38ff81[_0x0ead('0x86')]===_0x0ead('0x87');});if(_0x5ab81e[_0x0ead('0x94')]>0x0&&_0x323653['length']>0x0){return Promise['resolve']()[_0x0ead('0x9a')](cmHopper[_0x0ead('0x149')](_[_0x0ead('0x14a')](_0x5ab81e,'id'),previewRecallmeReminderInterval,_[_0x0ead('0x14a')](_0x323653,'id')))[_0x0ead('0x9a')](function(_0x571e8e){for(var _0x279073=0x0;_0x279073<_0x571e8e[_0x0ead('0x94')];_0x279073++){var _0x503102=_0x571e8e[_0x279073][_0x0ead('0x14b')][_0x0ead('0x45')];if(_0x503102)io['to'](util[_0x0ead('0x44')]('user:%s',_0x503102))['emit'](_0x0ead('0x14c'),{'hopper':_0x571e8e[_0x279073]});}})[_0x0ead('0x9c')](function(_0x503912){logger[_0x0ead('0x61')](_0x0ead('0x14d'),_0x503912);});}},0x3c*0x3e8,{'leading':!![]});Dialer['prototype'][_0x0ead('0x3e')]=function(){var _0x5e7a90=this;setInterval(function(){_0x5e7a90[_0x0ead('0x14e')](_0x5e7a90[_0x0ead('0x25')],_0x0ead('0x14f'));_0x5e7a90['clearZombieChannels'](_0x5e7a90[_0x0ead('0x24')],_0x0ead('0x150'));},0x32c8);};Dialer[_0x0ead('0x1a')]['clearZombieChannels']=function(_0x46fd5c,_0x5548ca){var _0x44e4c8=this;for(var _0x22fd78 in _0x46fd5c){if(typeof _0x46fd5c[_0x22fd78]!=='undefined'){this[_0x0ead('0x1d')][_0x0ead('0x151')](function(){if(!_['isNil'](_0x46fd5c[_0x22fd78])){return ami[_0x0ead('0x9d')]({'action':_0x0ead('0x86'),'channel':_0x46fd5c[_0x22fd78][_0x0ead('0xed')]})[_0x0ead('0x9c')](function(_0x3c450b){if(_0x3c450b['message']===_0x0ead('0x152')){setTimeout(function(){if(_0x46fd5c[_0x22fd78]&&_0x46fd5c[_0x22fd78]['type']!==_0x0ead('0xbe')){_0x44e4c8[_0x0ead('0xbf')](_0x44e4c8[_0x0ead('0x1e')][_0x46fd5c[_0x22fd78][_0x0ead('0xc0')]]);logger[_0x0ead('0x61')](_0x0ead('0x153'),_0x5548ca,_0x22fd78,_0x46fd5c[_0x22fd78][_0x0ead('0xc0')]);delete _0x46fd5c[_0x22fd78];}if(_0x46fd5c[_0x22fd78]&&_0x46fd5c[_0x22fd78]['type']===_0x0ead('0xbe')){_0x44e4c8[_0x0ead('0xbf')](_0x44e4c8[_0x0ead('0x1f')][_0x46fd5c[_0x22fd78][_0x0ead('0xc0')]]);logger[_0x0ead('0x61')]('[Dialer][checkChannel][ivr]',_0x5548ca,_0x22fd78,_0x46fd5c[_0x22fd78][_0x0ead('0xc0')]);delete _0x46fd5c[_0x22fd78];}},0x2328);}});}});}}};Dialer[_0x0ead('0x1a')][_0x0ead('0x154')]=function(_0x4ea75a){return Promise[_0x0ead('0xaa')]()['then'](voiceQueueRt['getVoiceQueueRtPauses'](_0x4ea75a))[_0x0ead('0x9c')](loggerCatch(_0x0ead('0x155')));};Dialer[_0x0ead('0x1a')][_0x0ead('0xbf')]=function(_0x4209b6){if(!_['isUndefined'](_0x4209b6)&&_0x4209b6!==null){if(typeof _0x4209b6[_0x0ead('0x156')]!==_0x0ead('0xa8')){if(_0x4209b6[_0x0ead('0x156')]>0x0){_0x4209b6[_0x0ead('0x156')]-=0x1;}else{logger[_0x0ead('0x61')](_0x0ead('0x157'));}}}else{logger['error'](_0x0ead('0x158'));}};Dialer[_0x0ead('0x1a')][_0x0ead('0x159')]=function(_0x1b52ca,_0x191742){var _0x5d0158=this;return function(_0x30a5df){_0x5d0158[_0x0ead('0xbf')](_0x191742);logger['error'](_0x1b52ca,util[_0x0ead('0x62')](_0x30a5df,{'showHidden':![],'depth':null}));};};Dialer[_0x0ead('0x1a')]['emptyContact']=function(_0x243b1c,_0x174d6f,_0x4836b1){var _0x38153e={'state':0x19,'statedesc':_0x0ead('0x15a')};this[_0x0ead('0xbf')](_0x174d6f);this[_0x0ead('0x119')](_[_0x0ead('0xf5')](_0x38153e,_['pick'](_0x4836b1,[_0x0ead('0xdb'),_0x0ead('0xdc'),_0x0ead('0x15b'),_0x0ead('0xfb'),'CampaignId'])),_0x0ead('0x15c'),_0x0ead('0x15d'));logger[_0x0ead('0x61')](_0x243b1c);};Dialer[_0x0ead('0x1a')][_0x0ead('0x119')]=function(_0x108331,_0xbe6d77,_0x38f111){hopperUtils[_0x0ead('0xc8')](_0x108331)['catch'](loggerCatch(_0xbe6d77));hopperUtils['moveContactManagedDialer'](_0x108331)['catch'](loggerCatch(_0x38f111));};Dialer['prototype']['queueCallerAbandonCreateState']=function(_0x1c67b9,_0x2932e8){hopperUtils[_0x0ead('0xc8')](_0x1c67b9)[_0x0ead('0x9c')](loggerCatch('[syncAgentComplete][createHistory]'));if(_0x2932e8==0x0){hopperUtils[_0x0ead('0xc9')](_0x1c67b9)['catch'](loggerCatch(_0x0ead('0x15e')));}};Dialer[_0x0ead('0x1a')][_0x0ead('0x14d')]=function(_0xc5c186){return Promise['resolve']()['then'](cmHopper['handlePreviewRecallNotifications'](_0xc5c186['id'],previewRecallmeReminderInterval))['then'](function(_0x22cb27){for(var _0x20b231=0x0;_0x20b231<_0x22cb27[_0x0ead('0x94')];_0x20b231++){var _0x177797=_0x22cb27[_0x20b231][_0x0ead('0x14b')][_0x0ead('0x45')];if(_0x177797)io['to'](util[_0x0ead('0x44')](_0x0ead('0x15f'),_0x177797))[_0x0ead('0x41')]('user:dialPreviewRecallReminder',{'hopper':_0x22cb27[_0x20b231]});}})['catch'](function(){});};Dialer[_0x0ead('0x1a')]['launchHandleIvr']=function(_0x1039c4){var _0x4e3799=this;return function(){_0x4e3799['handleIvr'](_0x1039c4);};};Dialer[_0x0ead('0x1a')][_0x0ead('0x160')]=function(_0x45b55b,_0x443e50){var _0x31ede6=this;var _0x1b6ac4=uuid['v4']();this[_0x0ead('0x24')][_0x1b6ac4]=new Action(_0x45b55b,_0x443e50,_0x1b6ac4);return new Promise(function(_0x5bbf31,_0x23b412){if(_[_0x0ead('0x51')](_0x45b55b)&&typeof _0x45b55b!==_0x0ead('0x161')){return _0x23b412(msgResponse(_0x0ead('0x162'),_0x0ead('0x8e'),_0x0ead('0x163')));}if(_['isUndefined'](_0x443e50['phone'])||_0x443e50[_0x0ead('0x164')]===null){return _0x23b412(msgResponse(_0x0ead('0x162'),_0x0ead('0x8e'),_0x0ead('0x165')));}var _0x26baca={'XMD-CALLERID':_0x31ede6['actions'][_0x1b6ac4][_0x0ead('0x166')](),'XMD-AGI':_0x45b55b[_0x0ead('0x131')]?util[_0x0ead('0x44')]('\x22agi://%s/square,%s\x22',ipAgi,_0x45b55b[_0x0ead('0x131')]):'NONE','XMD-AGIAFTER':_0x45b55b[_0x0ead('0xc6')]?util[_0x0ead('0x44')](_0x0ead('0x167'),ipAgi,_0x45b55b[_0x0ead('0xc6')]):'NONE','XMD-QUEUE':utils[_0x0ead('0x168')](_0x45b55b)?util['format'](_0x0ead('0x169'),_0x45b55b[_0x0ead('0x45')],_0x45b55b[_0x0ead('0x16a')]||'',_0x45b55b['dialAgiAfterHangupAgent']?'c':'',_0x45b55b['dialQueueTimeout']||0x3):_0x0ead('0x16b'),'XMD-CONTACTID':_0x443e50[_0x0ead('0xdb')],'XMD-CDRTYPE':_0x0ead('0x7'),'CALLERID(all)':_0x31ede6[_0x0ead('0x24')][_0x1b6ac4]['getCaller'](),'XMD-AMD':_0x45b55b[_0x0ead('0x11c')]?_0x0ead('0x13f'):'NONE','XMD-DESTINATION':_0x0ead('0x110')};if(_0x45b55b[_0x0ead('0x11c')]){_0x26baca[_0x0ead('0x16c')]=_0x45b55b[_0x0ead('0x16d')]||0x9c4;_0x26baca['XMD-AMDGREETING']=_0x45b55b[_0x0ead('0x16e')]||0x5dc;_0x26baca['XMD-AMDAFTERGREETINGSILENCE']=_0x45b55b['dialAMDAfterGreetingSilence']||0x320;_0x26baca[_0x0ead('0x16f')]=_0x45b55b[_0x0ead('0x170')]||0x1388;_0x26baca[_0x0ead('0x171')]=_0x45b55b[_0x0ead('0x172')]||0x64;_0x26baca['XMD-AMDBETWEENWORDSSILENCE']=_0x45b55b['dialAMDBetweenWordsSilence']||0x32;_0x26baca[_0x0ead('0x173')]=_0x45b55b['dialAMDMaximumNumberOfWords']||0x3;_0x26baca[_0x0ead('0x174')]=_0x45b55b[_0x0ead('0x175')]||0x100;_0x26baca[_0x0ead('0x176')]=_0x45b55b[_0x0ead('0x177')]||0x1388;}if(utils[_0x0ead('0x168')](_0x45b55b)){_0x26baca['XMD-VOICEQUEUEID']=_0x443e50[_0x0ead('0xfb')];}else{_0x26baca['XMD-CAMPAIGNID']=_0x443e50[_0x0ead('0xdd')];}var _0x34de02=utils[_0x0ead('0x178')](_0x443e50['Contact']);Object['assign'](_0x26baca,_0x34de02);var _0x186837=_0x31ede6[_0x0ead('0x83')](_0x45b55b['Trunk'])?utils[_0x0ead('0x179')](_0x45b55b[_0x0ead('0x17a')][_0x0ead('0x17b')],_0x45b55b[_0x0ead('0x17c')],_0x45b55b[_0x0ead('0x17d')]>0x0?utils[_0x0ead('0x17e')](_0x45b55b[_0x0ead('0x17f')],_0x45b55b[_0x0ead('0x17d')]):_0x45b55b[_0x0ead('0x17f')]):utils[_0x0ead('0x179')](_[_0x0ead('0xf1')](_0x45b55b[_0x0ead('0x89')])?_0x45b55b[_0x0ead('0x17a')][_0x0ead('0x17b')]:_0x45b55b[_0x0ead('0x89')][_0x0ead('0x17b')],_0x45b55b[_0x0ead('0x17c')],_0x45b55b[_0x0ead('0x17d')]>0x0?utils[_0x0ead('0x17e')](_0x45b55b[_0x0ead('0x17f')],_0x45b55b['dialRandomLastDigitCallerIdNumber']):_0x45b55b['dialOriginateCallerIdNumber']);if(_0x186837){_0x26baca[_0x0ead('0x180')]=_0x31ede6['actions'][_0x1b6ac4][_0x0ead('0x181')]=utils[_0x0ead('0x182')](_0x186837);_0x26baca['XMD-ORIGINATECALLERIDNUM']=_0x443e50[_0x0ead('0x164')];}_0x45b55b['variables']=_0x26baca;return ami[_0x0ead('0x9d')]({'actionid':_0x1b6ac4,'action':_0x0ead('0x162'),'channel':_0x31ede6[_0x0ead('0x83')](_0x45b55b[_0x0ead('0x17a')])?util[_0x0ead('0x44')](_0x0ead('0x183'),_0x45b55b[_0x0ead('0x17a')][_0x0ead('0x45')],isNotNull(_0x45b55b['dialPrefix'])?_0x45b55b[_0x0ead('0x184')][_0x0ead('0x185')]()||'':'',_0x45b55b[_0x0ead('0x186')]>0x0?_0x443e50[_0x0ead('0x164')][_0x0ead('0x187')](_0x45b55b[_0x0ead('0x186')]):_0x443e50[_0x0ead('0x164')]):util[_0x0ead('0x44')](_0x0ead('0x183'),_[_0x0ead('0xf1')](_0x45b55b['TrunkBackup'])?_0x45b55b[_0x0ead('0x17a')][_0x0ead('0x45')]:_0x45b55b[_0x0ead('0x89')][_0x0ead('0x45')],isNotNull(_0x45b55b[_0x0ead('0x184')])?_0x45b55b[_0x0ead('0x184')][_0x0ead('0x185')]()||'':'',_0x45b55b[_0x0ead('0x186')]>0x0?_0x443e50[_0x0ead('0x164')][_0x0ead('0x187')](_0x45b55b[_0x0ead('0x186')]):_0x443e50[_0x0ead('0x164')]),'callerid':_0x186837,'Exten':_0x0ead('0x110'),'Context':_0x0ead('0x188'),'Priority':'1','variable':_0x26baca,'timeout':(_0x45b55b[_0x0ead('0x189')]||0x1e)*0x3e8,'async':!![],'channelid':_0x1b6ac4})[_0x0ead('0x9a')](function(_0x375fbc){return _0x5bbf31(_0x375fbc);})[_0x0ead('0x9c')](function(_0x5647eb){_0x45b55b[_0x0ead('0x18a')]+=0x1;var _0xa3bba3=new History(_0x31ede6[_0x0ead('0x24')][_0x1b6ac4]);logger[_0x0ead('0x61')](util[_0x0ead('0x44')]('[originateError]:\x20%s',JSON[_0x0ead('0x72')](_0x5647eb)));_0xa3bba3[_0x0ead('0x6d')]=0xe;_0xa3bba3['statedesc']=_0x0ead('0x18b');_0xa3bba3['starttime']=moment()['format'](_0x0ead('0xc2'));_0xa3bba3[_0x0ead('0x6f')]=_0xa3bba3[_0x0ead('0xdf')];hopperUtils[_0x0ead('0xc8')](_0xa3bba3)[_0x0ead('0x9c')](loggerCatch(_0x0ead('0x18c')));_0x31ede6[_0x0ead('0xc9')](_0xa3bba3)[_0x0ead('0x9c')](loggerCatch('[originate][error]'))[_0x0ead('0x1c')](function(){delete _0x31ede6['actions'][_0x1b6ac4];return _0x23b412(msgResponse(_0x0ead('0x162'),_0x0ead('0x82'),_0x0ead('0x18d')));});});});};Dialer[_0x0ead('0x1a')][_0x0ead('0x18e')]=function(_0x1a1b6f,_0x520cc4,_0x312d10){var _0x545724=new History(_0x520cc4);if(_0x545724['countbusyretry']+_0x545724[_0x0ead('0x18f')]+_0x545724[_0x0ead('0x12c')]+_0x545724[_0x0ead('0x124')]+_0x545724[_0x0ead('0xd1')]+_0x545724[_0x0ead('0xe6')]+_0x545724['countmachineretry']+_0x545724[_0x0ead('0x125')]>=_0x312d10[_0x0ead('0x12d')]-0x1){return!![];}switch(_0x1a1b6f){case 0x3:if(_0x545724['countnoanswerretry']>=_0x312d10[_0x0ead('0x190')]-0x1){return!![];}hopperUtils[_0x0ead('0xd8')]({'active':![],'countnoanswerretry':_0x545724[_0x0ead('0x12c')]+=0x1,'scheduledat':moment()[_0x0ead('0xd9')](_0x312d10[_0x0ead('0x191')],'minutes')[_0x0ead('0x44')](_0x0ead('0xc2')),'ContactId':_0x545724['ContactId'],'ListId':_0x545724['ListId'],'VoiceQueueId':_0x545724[_0x0ead('0xfb')]||undefined,'CampaignId':_0x545724[_0x0ead('0xdd')]||undefined})[_0x0ead('0x9c')](loggerCatch(_0x0ead('0x192')));break;case 0x5:if(_0x545724[_0x0ead('0x123')]>=_0x312d10[_0x0ead('0x193')]-0x1){return!![];}hopperUtils[_0x0ead('0xd8')]({'active':![],'countbusyretry':_0x545724[_0x0ead('0x123')]+=0x1,'scheduledat':moment()[_0x0ead('0xd9')](_0x312d10['dialBusyRetryFrequency'],_0x0ead('0xda'))[_0x0ead('0x44')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x545724[_0x0ead('0xdb')],'ListId':_0x545724[_0x0ead('0xdc')],'VoiceQueueId':_0x545724['VoiceQueueId']||undefined,'CampaignId':_0x545724[_0x0ead('0xdd')]||undefined})[_0x0ead('0x9c')](loggerCatch(_0x0ead('0x194')));break;case 0x8:if(_0x545724[_0x0ead('0x18f')]>=_0x312d10['dialCongestionMaxRetry']-0x1){return!![];}hopperUtils[_0x0ead('0xd8')]({'active':![],'countcongestionretry':_0x545724[_0x0ead('0x18f')]+=0x1,'scheduledat':moment()[_0x0ead('0xd9')](_0x312d10[_0x0ead('0x195')],'minutes')[_0x0ead('0x44')](_0x0ead('0xc2')),'ContactId':_0x545724[_0x0ead('0xdb')],'ListId':_0x545724[_0x0ead('0xdc')],'VoiceQueueId':_0x545724[_0x0ead('0xfb')]||undefined,'CampaignId':_0x545724[_0x0ead('0xdd')]||undefined})['catch'](loggerCatch(_0x0ead('0x196')));break;case 0x0:if(_0x545724['countnosuchnumberretry']>=_0x312d10[_0x0ead('0x197')]-0x1){return!![];}else{hopperUtils[_0x0ead('0xd8')]({'active':![],'countnosuchnumberretry':_0x545724[_0x0ead('0x124')]+=0x1,'scheduledat':moment()[_0x0ead('0xd9')](_0x312d10['dialNoSuchNumberRetryFrequency'],_0x0ead('0xda'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x545724[_0x0ead('0xdb')],'ListId':_0x545724['ListId'],'VoiceQueueId':_0x545724['VoiceQueueId']||undefined,'CampaignId':_0x545724[_0x0ead('0xdd')]||undefined})['catch'](loggerCatch(_0x0ead('0x198')));}break;case 0xa:if(_0x545724[_0x0ead('0xd1')]>=_0x312d10[_0x0ead('0xd7')]-0x1){return!![];}hopperUtils[_0x0ead('0xd8')]({'active':![],'countdropretry':_0x545724[_0x0ead('0xd1')]+=0x1,'scheduledat':moment()[_0x0ead('0xd9')](_0x312d10[_0x0ead('0xd2')],_0x0ead('0xda'))['format'](_0x0ead('0xc2')),'ContactId':_0x545724['ContactId'],'ListId':_0x545724[_0x0ead('0xdc')],'VoiceQueueId':_0x545724[_0x0ead('0xfb')]||undefined,'CampaignId':_0x545724[_0x0ead('0xdd')]||undefined})['catch'](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x545724['countabandonedretry']>=_0x312d10[_0x0ead('0xe9')]-0x1){return!![];}hopperUtils[_0x0ead('0xd8')]({'active':![],'countabandonedretry':_0x545724[_0x0ead('0xe6')]+=0x1,'scheduledat':moment()[_0x0ead('0xd9')](_0x312d10[_0x0ead('0xe8')],_0x0ead('0xda'))['format'](_0x0ead('0xc2')),'ContactId':_0x545724[_0x0ead('0xdb')],'ListId':_0x545724[_0x0ead('0xdc')],'VoiceQueueId':_0x545724[_0x0ead('0xfb')]||undefined,'CampaignId':_0x545724[_0x0ead('0xdd')]||undefined})[_0x0ead('0x9c')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x545724[_0x0ead('0x121')]>=_0x312d10['dialMachineMaxRetry']-0x1){return!![];}hopperUtils[_0x0ead('0xd8')]({'active':![],'countmachineretry':_0x545724[_0x0ead('0x121')]+=0x1,'scheduledat':moment()['add'](_0x312d10[_0x0ead('0x129')],_0x0ead('0xda'))[_0x0ead('0x44')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x545724[_0x0ead('0xdb')],'ListId':_0x545724[_0x0ead('0xdc')],'VoiceQueueId':_0x545724[_0x0ead('0xfb')]||undefined,'CampaignId':_0x545724['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x545724[_0x0ead('0x125')]>=_0x312d10['dialAgentRejectMaxRetry']-0x1){return!![];}hopperUtils[_0x0ead('0xd8')]({'active':![],'countagentrejectretry':_0x545724[_0x0ead('0x125')]+=0x1,'scheduledat':moment()[_0x0ead('0xd9')](_0x312d10[_0x0ead('0x199')],'minutes')[_0x0ead('0x44')](_0x0ead('0xc2')),'ContactId':_0x545724[_0x0ead('0xdb')],'ListId':_0x545724[_0x0ead('0xdc')],'VoiceQueueId':_0x545724[_0x0ead('0xfb')]||undefined,'CampaignId':_0x545724[_0x0ead('0xdd')]||undefined})[_0x0ead('0x9c')](loggerCatch(_0x0ead('0x19a')));break;default:return!![];}};Dialer[_0x0ead('0x1a')][_0x0ead('0x10c')]=function(_0x393b32,_0xa4f2f2,_0x4f4858){var _0x21781e=this;var _0x2e38cf=new History(_0x393b32);var _0x12f81f=![];var _0x5dc904;var _0x12cf78;return new Promise(function(_0x623b46,_0x1c5702){if(_['isUndefined'](_0xa4f2f2)&&typeof _0xa4f2f2!==_0x0ead('0x161')){return _0x1c5702(msgResponse(_0x0ead('0x19b'),'Failure',_0x0ead('0x19c')));}if(_[_0x0ead('0x51')](_0x4f4858)&&typeof _0x4f4858!==_0x0ead('0x161')){return _0x1c5702(msgResponse(_0x0ead('0x19b'),_0x0ead('0x8e'),_0x0ead('0x19d')));}hopperUtils['verifyAdditionalPhones'](_0x2e38cf,_0x4f4858[_0x0ead('0xc3')],_0xa4f2f2)[_0x0ead('0x9a')](function(_0x555ffd){if(_0x555ffd[_0x0ead('0xd6')]==0x1)_0x12f81f=!![];switch(_0x4f4858[_0x0ead('0xc3')]){case'0':_0xa4f2f2['outboundNoSuchCallsDay']+=0x1;_0x2e38cf['state']=0x0;_0x2e38cf[_0x0ead('0x6e')]=_0x0ead('0x19e');_0x2e38cf[_0x0ead('0x124')]+=0x1;_0x2e38cf[_0x0ead('0xe7')]+=0x1;ami['emit'](_0x0ead('0x19f'),ut[_0x0ead('0x117')](_0x393b32,_0x0ead('0x1a0')));_0x5dc904=_0xa4f2f2[_0x0ead('0x1a1')];_0x12cf78=_0xa4f2f2[_0x0ead('0xd3')];hopperUtils[_0x0ead('0xc8')](_0x2e38cf)[_0x0ead('0x9c')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x21781e[_0x0ead('0x18e')](0x0,_0x393b32,_0xa4f2f2)&&!_0x12f81f){if(_0x2e38cf['countnosuchnumberretry']>=_0xa4f2f2[_0x0ead('0x197')]){_0x21781e[_0x0ead('0x128')](_0x2e38cf,_0x623b46,_0x1c5702,_0x0ead('0x1a2'));}else{_0x21781e[_0x0ead('0x12e')](_0x2e38cf,_0x623b46,_0x1c5702,_0x0ead('0x1a2'));}}break;case'3':_0xa4f2f2[_0x0ead('0x1a3')]+=0x1;_0x2e38cf[_0x0ead('0x6d')]=0x3;_0x2e38cf['statedesc']='NoAnswer';_0x2e38cf[_0x0ead('0x12c')]+=0x1;_0x2e38cf[_0x0ead('0xe7')]+=0x1;var _0x3a7d43=ut[_0x0ead('0x1a4')](_0x393b32,_0xa4f2f2);ami[_0x0ead('0x41')](_0x0ead('0x1a5'),_0x3a7d43);_0x5dc904=_0xa4f2f2[_0x0ead('0x191')];_0x12cf78=_0xa4f2f2[_0x0ead('0xd3')];hopperUtils['createHistory'](_0x2e38cf)[_0x0ead('0x9c')](loggerCatch(_0x0ead('0x1a6')));if(_0x21781e[_0x0ead('0x18e')](0x3,_0x393b32,_0xa4f2f2)&&!_0x12f81f){if(_0x2e38cf[_0x0ead('0x12c')]>=_0xa4f2f2[_0x0ead('0x190')]){_0x21781e['createStateFinal'](_0x2e38cf,_0x623b46,_0x1c5702,_0x0ead('0x1a7'));}else{_0x21781e['stateGlobal'](_0x2e38cf,_0x623b46,_0x1c5702,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0xa4f2f2[_0x0ead('0x1a8')]+=0x1;_0x2e38cf['state']=0x5;_0x2e38cf[_0x0ead('0x6e')]='Busy';_0x2e38cf[_0x0ead('0x123')]+=0x1;_0x2e38cf[_0x0ead('0xe7')]+=0x1;ami[_0x0ead('0x41')]('custom:agentbusy',ut[_0x0ead('0x117')](_0x393b32,_0x0ead('0x1a9')));_0x5dc904=_0xa4f2f2[_0x0ead('0x1aa')];_0x12cf78=_0xa4f2f2['callAdditionalPhoneAfterMin'];hopperUtils[_0x0ead('0xc8')](_0x2e38cf)[_0x0ead('0x9c')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x21781e['checkRetriveMax'](0x5,_0x393b32,_0xa4f2f2)&&!_0x12f81f){if(_0x2e38cf[_0x0ead('0x123')]>=_0xa4f2f2[_0x0ead('0x193')]){_0x21781e['createStateFinal'](_0x2e38cf,_0x623b46,_0x1c5702,_0x0ead('0x1ab'));}else{_0x21781e[_0x0ead('0x12e')](_0x2e38cf,_0x623b46,_0x1c5702,_0x0ead('0x1ab'));}}break;case'8':_0xa4f2f2[_0x0ead('0x1ac')]+=0x1;_0x2e38cf[_0x0ead('0x6d')]=0x8;_0x2e38cf['statedesc']=_0x0ead('0x1ad');_0x2e38cf[_0x0ead('0x18f')]+=0x1;_0x2e38cf[_0x0ead('0xe7')]+=0x1;_0x5dc904=_0xa4f2f2[_0x0ead('0x195')];_0x12cf78=_0xa4f2f2[_0x0ead('0xd3')];ami[_0x0ead('0x41')](_0x0ead('0x1ae'),ut[_0x0ead('0x117')](_0x393b32,'congestion'));hopperUtils[_0x0ead('0xc8')](_0x2e38cf)[_0x0ead('0x9c')](loggerCatch(_0x0ead('0x1af')));if(_0x21781e['checkRetriveMax'](0x8,_0x393b32,_0xa4f2f2)&&!_0x12f81f){if(_0x2e38cf[_0x0ead('0x18f')]>=_0xa4f2f2[_0x0ead('0x1b0')]){_0x21781e[_0x0ead('0x128')](_0x2e38cf,_0x623b46,_0x1c5702,_0x0ead('0x1b1'));}else{_0x21781e[_0x0ead('0x12e')](_0x2e38cf,_0x623b46,_0x1c5702,_0x0ead('0x1b1'));}}break;case'11':_0xa4f2f2[_0x0ead('0x1b2')]+=0x1;_0x2e38cf[_0x0ead('0x6d')]=0xb;_0x2e38cf[_0x0ead('0x6e')]=_0x0ead('0xe5');_0x2e38cf[_0x0ead('0xe6')]+=0x1;_0x2e38cf[_0x0ead('0xe7')]+=0x1;_0x5dc904=_0xa4f2f2[_0x0ead('0xe8')];_0x12cf78=_0xa4f2f2[_0x0ead('0xd3')];hopperUtils[_0x0ead('0xc8')](_0x2e38cf)[_0x0ead('0x9c')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x21781e['checkRetriveMax'](0xb,_0x393b32,_0xa4f2f2)&&!_0x12f81f){if(_0x2e38cf[_0x0ead('0xe6')]>=_0xa4f2f2[_0x0ead('0xe9')]){_0x21781e[_0x0ead('0x128')](_0x2e38cf,_0x623b46,_0x1c5702,'reason\x2011\x20abandoned');}else{_0x21781e['stateGlobal'](_0x2e38cf,_0x623b46,_0x1c5702,_0x0ead('0x1b3'));}}break;case'20':_0xa4f2f2[_0x0ead('0x1b4')]+=0x1;_0x2e38cf[_0x0ead('0x6d')]=0x14;_0x2e38cf['statedesc']=_0x0ead('0x1b5');_0x2e38cf[_0x0ead('0x125')]+=0x1;_0x2e38cf[_0x0ead('0xe7')]+=0x1;_0x5dc904=_0xa4f2f2['dialAgentRejectRetryFrequency'];_0x12cf78=_0xa4f2f2[_0x0ead('0xd3')];ami[_0x0ead('0x41')](_0x0ead('0x1b6'),ut['buildObj'](_0x393b32,'agentreject'));hopperUtils['createHistory'](_0x2e38cf)[_0x0ead('0x9c')](loggerCatch(_0x0ead('0x1b7')));if(_0x21781e[_0x0ead('0x18e')](0x14,_0x393b32,_0xa4f2f2)&&!_0x12f81f){if(_0x2e38cf[_0x0ead('0x125')]>=_0xa4f2f2[_0x0ead('0x1b8')]){_0x21781e[_0x0ead('0x128')](_0x2e38cf,_0x623b46,_0x1c5702,_0x0ead('0x1b9'));}else{_0x21781e['stateGlobal'](_0x2e38cf,_0x623b46,_0x1c5702,_0x0ead('0x1b9'));}}break;default:_0xa4f2f2[_0x0ead('0x137')]+=0x1;_0x2e38cf[_0x0ead('0x6d')]=0xc;_0x2e38cf[_0x0ead('0x6e')]=_0x4f4858['reason'];_0x5dc904=_0xa4f2f2[_0x0ead('0x199')];_0x12cf78=_0xa4f2f2[_0x0ead('0xd3')];hopperUtils[_0x0ead('0xc8')](_0x2e38cf)[_0x0ead('0x9c')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x21781e[_0x0ead('0x18e')](_0x4f4858[_0x0ead('0xc3')],_0x393b32,_0xa4f2f2)&&!_0x12f81f){if(_0x2e38cf[_0x0ead('0x123')]+_0x2e38cf[_0x0ead('0x18f')]+_0x2e38cf[_0x0ead('0x12c')]+_0x2e38cf['countnosuchnumberretry']+_0x2e38cf[_0x0ead('0xd1')]+_0x2e38cf['countabandonedretry']+_0x2e38cf[_0x0ead('0x121')]+_0x2e38cf[_0x0ead('0x125')]>=_0xa4f2f2['dialGlobalMaxRetry']){_0x21781e[_0x0ead('0x12e')](_0x2e38cf,_0x623b46,_0x1c5702,_0x4f4858[_0x0ead('0xc3')]);}else{_0x21781e['createStateFinal'](_0x2e38cf,_0x623b46,_0x1c5702,_0x4f4858[_0x0ead('0xc3')]);}}}})[_0x0ead('0x9a')](function(){if(_0x12f81f){hopperUtils[_0x0ead('0xe3')](_0x2e38cf,_0x5dc904,_0x12cf78)[_0x0ead('0x9a')](function(){return _0x623b46(0x1);});}});});};Dialer[_0x0ead('0x1a')][_0x0ead('0x12e')]=function(_0x5cc804,_0x9b3584,_0x34a3bb,_0x4f227d){var _0x557a33=new Final(_0x5cc804);_0x557a33[_0x0ead('0x6d')]=0xf;_0x557a33[_0x0ead('0x6e')]=_0x0ead('0x1ba');this[_0x0ead('0x128')](_0x557a33,_0x9b3584,_0x34a3bb,_0x4f227d);};Dialer[_0x0ead('0x1a')][_0x0ead('0x128')]=function(_0x901e00,_0x41d384,_0xc2dd59,_0x2a2e49){hopperUtils[_0x0ead('0xc9')](_0x901e00)[_0x0ead('0x9a')](function(){return _0x41d384(msgResponse(_0x0ead('0x19b'),_0x0ead('0x10b'),_0x2a2e49));})['catch'](function(){return _0xc2dd59(msgResponse(_0x0ead('0x1bb'),_0x0ead('0x8e'),_0x0ead('0x1bc')));});};Dialer[_0x0ead('0x1a')][_0x0ead('0x8')]=function(_0x7415d2){var _0x4d31b4=_0x7415d2[_0x0ead('0x1bd')]/0x64;var _0x31c87e=_0x7415d2[_0x0ead('0xcd')]/(_0x7415d2[_0x0ead('0xcd')]+_0x7415d2[_0x0ead('0x11f')]);var _0x17f6d7=Math['round'](_0x7415d2[_0x0ead('0x1be')]*(_0x7415d2[_0x0ead('0x1bf')]/0x64));var _0x1b66f8=Math[_0x0ead('0x1c0')](_0x7415d2[_0x0ead('0x1be')]*(_0x7415d2[_0x0ead('0x1c1')]/0x64));var _0x18d138=_0x7415d2['available']+_0x7415d2[_0x0ead('0x13d')];var _0x13416a=Math['floor'](_0x7415d2[_0x0ead('0x56')]*_0x7415d2[_0x0ead('0x58')]*_0x7415d2[_0x0ead('0x1c2')]*_0x7415d2['predictiveIntervalMultiplicativeFactor']);if(_['isUndefined'](_0x7415d2[_0x0ead('0x28')])){if(!_[_0x0ead('0x51')](_0x7415d2['startPredictive'])){_0x7415d2[_0x0ead('0x27')]=undefined;loggerPredictive[_0x0ead('0x61')](_0x0ead('0x1c3'),_0x0ead('0x1c4'));}if(!_[_0x0ead('0x51')](_0x7415d2[_0x0ead('0x5f')])){loggerPredictive[_0x0ead('0x61')](_0x0ead('0x1c3'),_0x0ead('0x1c5'));clearInterval(_0x7415d2['handlePredictive']);_0x7415d2[_0x0ead('0x5f')]=undefined;}_0x7415d2[_0x0ead('0x28')]=moment()['format'](_0x0ead('0xc2'));loggerPredictive['info'](_0x7415d2[_0x0ead('0x45')],_0x0ead('0x1c6'),_0x7415d2[_0x0ead('0x28')]);this[_0x0ead('0xb2')](_0x7415d2,0x1);}else if(ifInterval(_0x7415d2['dialPredictiveInterval'],_0x7415d2[_0x0ead('0x28')])){this[_0x0ead('0xb2')](_0x7415d2,0x1);loggerPredictiveCalls['info'](_0x0ead('0x1c7'),_0x7415d2['startProgressive'],_0x7415d2[_0x0ead('0x45')]);_0x7415d2['erlangCalls']=0x0;_0x7415d2['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x4d31b4<_0x31c87e&&_0x7415d2[_0x0ead('0x1c8')]==='dropRate'){clearPredictiveAttributes(_0x7415d2);loggerPredictive[_0x0ead('0x46')](_0x0ead('0x1c9'),_0x0ead('0x1ca'),_0x31c87e,_0x0ead('0x28'),_0x7415d2[_0x0ead('0x45')]);}else if(_0x13416a<_0x7415d2[_0x0ead('0x1cb')]&&_0x7415d2[_0x0ead('0x1c8')]==='dropRate'){clearPredictiveAttributes(_0x7415d2);loggerPredictive[_0x0ead('0x46')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0x0ead('0x1cc'),_0x13416a,_0x0ead('0x1cd'),_0x7415d2[_0x0ead('0x1cb')],'startProgressive',_0x7415d2[_0x0ead('0x45')]);}else if(!ifInterval(_0x7415d2[_0x0ead('0x1ce')],_0x7415d2['startProgressive'])&&_[_0x0ead('0x51')](_0x7415d2[_0x0ead('0x27')])&&!_['isUndefined'](_0x7415d2[_0x0ead('0x28')])){_0x7415d2[_0x0ead('0x27')]=moment()[_0x0ead('0x44')](_0x0ead('0xc2'));loggerPredictive['info'](_0x7415d2['name'],'started\x20in\x20predictive\x20at',_0x7415d2[_0x0ead('0x27')]);hopperUtils[_0x0ead('0x1cf')](_0x7415d2[_0x0ead('0x1ce')])[_0x0ead('0x9a')](this[_0x0ead('0x1d0')](_0x7415d2))[_0x0ead('0x9a')](mergeDataErlangB(_0x7415d2))[_0x0ead('0x9a')](this[_0x0ead('0x1d1')](_0x7415d2))[_0x0ead('0x9c')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x7415d2));}else if(!ifInterval(_0x7415d2[_0x0ead('0x1ce')],_0x7415d2[_0x0ead('0x27')])){_0x7415d2[_0x0ead('0x1cb')]=0x0;_0x7415d2[_0x0ead('0x27')]=moment()[_0x0ead('0x44')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x7415d2[_0x0ead('0x45')],_0x0ead('0x1d2'),_0x7415d2[_0x0ead('0x27')]);clearInterval(_0x7415d2[_0x0ead('0x5f')]);_0x7415d2[_0x0ead('0x5f')]=undefined;hopperUtils[_0x0ead('0x1cf')](_0x7415d2[_0x0ead('0x1ce')])[_0x0ead('0x9a')](this['getDataPredictive'](_0x7415d2))['then'](mergeDataErlangB(_0x7415d2))[_0x0ead('0x9a')](this[_0x0ead('0x1d1')](_0x7415d2))[_0x0ead('0x9c')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x7415d2));}else if(_0x7415d2[_0x0ead('0x1be')]&&_0x18d138<_0x7415d2[_0x0ead('0x1be')]-_0x1b66f8){clearPredictiveAttributes(_0x7415d2);loggerPredictive['info'](_0x7415d2[_0x0ead('0x45')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x18d138,_0x0ead('0x1d3'),_0x7415d2[_0x0ead('0x1be')],'-',_0x1b66f8,'=',_0x7415d2[_0x0ead('0x1be')]-_0x1b66f8,')');}else if(_0x7415d2['predictiveIntervalAvailable']&&_0x18d138>_0x7415d2[_0x0ead('0x1be')]+_0x17f6d7){clearPredictiveAttributes(_0x7415d2);loggerPredictive[_0x0ead('0x46')](_0x7415d2[_0x0ead('0x45')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x18d138,')\x20are\x20more\x20than\x20threshold\x20(',_0x7415d2['predictiveIntervalAvailable'],'+',_0x17f6d7,'=',_0x7415d2['predictiveIntervalAvailable']+_0x17f6d7,')');}};Dialer['prototype']['getDataPredictive']=function(_0x2a9df2){var _0x107f9a=this;return function(_0xbe2cb8){return new Promise(function(_0x2a0fbc,_0x48c6cf){_['merge'](_0x2a9df2,_0xbe2cb8[0x0]);if(checkGetDataPredictive(_0xbe2cb8[0x0])){var _0x55dbe2=_0x2a9df2[_0x0ead('0x1be')]=_0x2a9df2['talking']+_0x2a9df2[_0x0ead('0x13b')];var _0xb226d2=_0x2a9df2[_0x0ead('0x1ce')]*0x3c;var _0x5876b1=_0xbe2cb8[0x0][_0x0ead('0x4f')]+_0xbe2cb8[0x0][_0x0ead('0x4d')];var _0x22869c=(_0xbe2cb8[0x0]['predictiveIntervalAnsweredCalls']+_0xbe2cb8[0x0][_0x0ead('0x49')]+_0xbe2cb8[0x0][_0x0ead('0x4b')])/_0xbe2cb8[0x0]['predictiveIntervalTotalCalls'];_0x2a9df2[_0x0ead('0x1c2')]=_0x22869c>0x0?_0x22869c:0x1;switch(_0x2a9df2[_0x0ead('0x1c8')]){case _0x0ead('0x1d4'):var _0x23122c=_0x2a9df2['dialPredictiveOptimizationPercentage']/0x64;return _0x107f9a['abandonmentRate'](_0x55dbe2,_0xb226d2,_0x5876b1,_0x22869c,_0x23122c)[_0x0ead('0x9a')](function(_0x3d978d){return _0x2a0fbc(_0x3d978d);});case _0x0ead('0x1d5'):var _0x554cb7=_0x2a9df2[_0x0ead('0x1bd')]/0x64;return _0x107f9a[_0x0ead('0x1d6')](_0x55dbe2,_0xb226d2,_0x5876b1,_0x22869c,_0x554cb7)[_0x0ead('0x9a')](function(_0x364f66){return _0x2a0fbc(_0x364f66);});default:return _0x48c6cf(msgResponse('[getDataPredictive]',_0x0ead('0x8e'),_0x0ead('0x1d7')));}}else{return _0x48c6cf(msgResponse(_0x0ead('0x1d8'),_0x0ead('0x8e'),'check\x20failure'));}});};};Dialer[_0x0ead('0x1a')]['getDataPredictiveOld']=function(_0x43401b){var _0x335aeb=this;return function(_0x335267){return new Promise(function(_0x47b224,_0x4ccbfe){_[_0x0ead('0xf5')](_0x43401b,_0x335267[0x0]);if(checkGetDataPredictive(_0x335267[0x0])){loggerPredictive[_0x0ead('0x46')](JSON[_0x0ead('0x72')](_0x335267[0x0]));if(_0x43401b[_0x0ead('0x1c8')]===_0x0ead('0x1d4')){return _0x335aeb['getVoiceQueueRtPauses'](_0x43401b['id'])[_0x0ead('0x9a')](function(_0x59753d){var _0xbf0c9d=_0x43401b['loggedIn']-_0x59753d[0x0]['outboundQueuePauses'];var _0x1a868f=_0x43401b[_0x0ead('0x1ce')]*0x3c;var _0x3382da=_0x335267[0x0][_0x0ead('0x4f')]+_0x335267[0x0][_0x0ead('0x4d')];var _0x1e9719=(_0x335267[0x0][_0x0ead('0x48')]+_0x335267[0x0][_0x0ead('0x49')]+_0x335267[0x0][_0x0ead('0x4b')])/_0x335267[0x0][_0x0ead('0x47')];var _0x29e990=_0x43401b[_0x0ead('0x1bd')]/0x64;_0x43401b[_0x0ead('0x1d9')]=_0x59753d[0x0][_0x0ead('0x1da')]||0x0;_0x43401b[_0x0ead('0x1c2')]=_0x1e9719>0x0?_0x1e9719:0x1;return _0x335aeb['abandonmentRate'](_0xbf0c9d,_0x1a868f,_0x3382da,_0x1e9719,_0x29e990);})['then'](function(_0x4465c6){return _0x47b224(_0x4465c6);})[_0x0ead('0x9c')](function(_0x53c9b5){return _0x4ccbfe(msgResponse(_0x0ead('0x1db'),_0x0ead('0x8e'),JSON['stringify'](_0x53c9b5)));});}if(_0x43401b[_0x0ead('0x1c8')]===_0x0ead('0x1d5')){return _0x335aeb[_0x0ead('0x154')](_0x43401b['id'])[_0x0ead('0x9a')](function(_0x4ad7e2){var _0x2e61f6=_0x43401b['loggedIn']-_0x4ad7e2[0x0][_0x0ead('0x1da')];var _0x4cc2f2=_0x43401b[_0x0ead('0x1ce')]*0x3c;var _0x2baca8=_0x335267[0x0][_0x0ead('0x4f')]+_0x335267[0x0][_0x0ead('0x4d')];var _0x4ba40d=(_0x335267[0x0][_0x0ead('0x48')]+_0x335267[0x0][_0x0ead('0x49')]+_0x335267[0x0][_0x0ead('0x4b')])/_0x335267[0x0][_0x0ead('0x47')];var _0x3d792a=_0x43401b[_0x0ead('0x1bd')]/0x64;_0x43401b['predictiveIntervalPauses']=_0x4ad7e2[0x0][_0x0ead('0x1da')]||0x0;_0x43401b[_0x0ead('0x1c2')]=_0x4ba40d>0x0?_0x4ba40d:0x1;return _0x335aeb['busyFactor'](_0x2e61f6,_0x4cc2f2,_0x2baca8,_0x4ba40d,_0x3d792a);})[_0x0ead('0x9a')](function(_0x45d670){return _0x47b224(_0x45d670);})[_0x0ead('0x9c')](function(_0x299832){return _0x4ccbfe(msgResponse('[CatchErlangB]',_0x0ead('0x8e'),JSON['stringify'](_0x299832)));});}}else{return _0x4ccbfe(msgResponse(_0x0ead('0x1d8'),_0x0ead('0x8e'),_0x0ead('0x1dc')));}});};};Dialer[_0x0ead('0x1a')][_0x0ead('0x1d1')]=function(_0x38203a){var _0x27ae00=this;return function(){var _0xe3583f=0x0;var _0x1b6081=Math['floor'](_0x38203a[_0x0ead('0x57')]*0x3e8);if(_0x1b6081>0x0){_0x1b6081=_0x1b6081<0x64?0x64:_0x1b6081;loggerPredictive[_0x0ead('0x46')](_0x38203a[_0x0ead('0x45')],_0x0ead('0x1dd'),_0x1b6081,_0x0ead('0x1de'));_0x38203a[_0x0ead('0x5f')]=setInterval(function(){_0x27ae00['handlePredictive'](_0x38203a);loggerPredictiveCalls[_0x0ead('0x46')](_0x0ead('0x1df'),_0xe3583f+=0x1);},_0x1b6081);}else{loggerPredictive[_0x0ead('0x46')](_0x38203a[_0x0ead('0x45')],_0x0ead('0x1e0'));}};};Dialer[_0x0ead('0x1a')]['checkContactBlack']=function(_0x2860ad,_0xb1f38f){var _0x3b51a7=this;return function(_0x193232){if(_[_0x0ead('0x77')](_0x193232)){if(_[_0x0ead('0xf1')](_0xb1f38f[_0x0ead('0x15b')])||!_0xb1f38f[_0x0ead('0x1e1')]){if(_0x2860ad[_0x0ead('0xb1')]==='booked'){_0x2860ad['queueStatusComplete']=_[_0x0ead('0x51')](_0x2860ad[_0x0ead('0x70')])?!![]:_0x2860ad[_0x0ead('0x70')];var _0x35bd84=uuid['v4']();_0x3b51a7['actions'][_0x35bd84]=new Action(_0x2860ad,_0xb1f38f,_0x35bd84);loggerBooked[_0x0ead('0x46')]('[booked][checkContactBlack]',_0x35bd84,'queueStatusComplete:\x20',JSON['stringify'](_0x2860ad[_0x0ead('0x70')]),_0x0ead('0x1e2'),_0x2860ad[_0x0ead('0x45')]);if(_0x2860ad['queueStatusComplete']){_0x2860ad['queueStatusComplete']=![];_0x3b51a7[_0x0ead('0x2a')][_0x3b51a7[_0x0ead('0x24')][_0x35bd84]['queue']]=[];ami[_0x0ead('0x9d')]({'actionid':_0x35bd84,'action':_0x0ead('0x1e3'),'queue':_0x2860ad[_0x0ead('0x45')]})[_0x0ead('0x9c')](function(){_0x3b51a7[_0x0ead('0xbf')](_0x2860ad);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x3b51a7[_0x0ead('0x24')][_0x35bd84]['ContactId'],'ListId':_0x3b51a7[_0x0ead('0x24')][_0x35bd84][_0x0ead('0xdc')],'VoiceQueueId':_0x3b51a7['actions'][_0x35bd84][_0x0ead('0xfb')]||undefined,'CampaignId':_0x3b51a7['actions'][_0x35bd84][_0x0ead('0xdd')]||undefined})[_0x0ead('0x9c')](loggerCatch(_0x0ead('0x1e4')));delete _0x3b51a7[_0x0ead('0x24')][_0x35bd84];});}else{loggerBooked[_0x0ead('0x46')]('[booked][checkContactBlack][else]',JSON[_0x0ead('0x72')](_0x2860ad[_0x0ead('0x70')]),_0x0ead('0x1e2'),_0x2860ad[_0x0ead('0x45')]);_0x3b51a7['updateOriginated'](_0x2860ad);hopperUtils[_0x0ead('0xd8')]({'active':![],'ContactId':_0x3b51a7[_0x0ead('0x24')][_0x35bd84]['ContactId'],'ListId':_0x3b51a7[_0x0ead('0x24')][_0x35bd84]['ListId'],'VoiceQueueId':_0x3b51a7[_0x0ead('0x24')][_0x35bd84][_0x0ead('0xfb')]||undefined,'CampaignId':_0x3b51a7['actions'][_0x35bd84][_0x0ead('0xdd')]||undefined})[_0x0ead('0x9c')](loggerCatch(_0x0ead('0x1e4')));delete _0x3b51a7[_0x0ead('0x24')][_0x35bd84];}}else{return _0x3b51a7[_0x0ead('0x160')](_0x2860ad,_0xb1f38f);}}else{if(utils['getSeconds'](undefined,_0xb1f38f['scheduledat'])<_0x2860ad[_0x0ead('0x1e5')]*0x3c){if(_0xb1f38f['Agent']&&!_0xb1f38f[_0x0ead('0x14b')][_0x0ead('0x1e6')]){_0x3b51a7[_0x0ead('0x102')][_0x0ead('0xf8')](_0xb1f38f['id'])[_0x0ead('0x1c')](function(){_0x3b51a7[_0x0ead('0xbf')](_0x2860ad);});}else{hopperUtils[_0x0ead('0x1e7')]({'active':![]},_0xb1f38f['id'],0x1)[_0x0ead('0x1c')](function(){_0x3b51a7[_0x0ead('0xbf')](_0x2860ad);});}}else{_0x2860ad['outboundReCallsDay']+=0x1;_0x3b51a7[_0x0ead('0xbf')](_0x2860ad);if(_0x2860ad['dialRecallInQueue']){hopperUtils['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0xb1f38f['ContactId'],'ListId':_0xb1f38f[_0x0ead('0xdc')],'VoiceQueueId':_0xb1f38f[_0x0ead('0xfb')]||undefined,'CampaignId':_0xb1f38f[_0x0ead('0xdd')]||undefined})[_0x0ead('0x9c')](loggerCatch(_0x0ead('0x1e8')));hopperUtils[_0x0ead('0xc8')](createObjHistory(_0x2860ad,_0xb1f38f,utils['CAMPAIGN_STATUS'][_0x0ead('0x1e9')],0x17,'RecallInQueue'))[_0x0ead('0x9c')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x3b51a7[_0x0ead('0x119')](createObjHistory(_0x2860ad,_0xb1f38f,utils[_0x0ead('0x65')]['RECALL_TIMEOUT'],0x16,_0x0ead('0x1ea')),'[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]');}}}}else{_0x2860ad[_0x0ead('0x1eb')]+=0x1;_0x3b51a7[_0x0ead('0x119')](createObjHistory(_0x2860ad,_0xb1f38f,utils[_0x0ead('0x65')][_0x0ead('0x1ec')],0xd,_0x0ead('0x1ed')),_0x0ead('0x1ee'),_0x0ead('0x1ef'));throw _0x0ead('0x1f0');}};};Dialer[_0x0ead('0x1a')][_0x0ead('0x1f1')]=function(_0x47f46e){var _0x1f496a=this;var _0x133bd2=_0x47f46e[_0x0ead('0x1f2')]-_0x47f46e['originated'];emitCampaignSummary(_0x47f46e);if(_0x133bd2>0x0&&_0x47f46e['temp']==0x0){if(_0x133bd2>this['maxNumberOriginate']){_0x133bd2=this[_0x0ead('0x22')];}_0x47f46e[_0x0ead('0x64')]=0x1;hopperUtils['getContactDialerIvr'](_0x47f46e,_0x133bd2)[_0x0ead('0x9a')](function(_0x246c79){_0x47f46e['temp']=0x0;if(_0x246c79){if(!utils[_0x0ead('0x1f3')](_0x246c79)){_0x47f46e[_0x0ead('0x6c')]=utils['CAMPAIGN_STATUS'][_0x0ead('0x6a')];logger[_0x0ead('0x46')]('[getContactCampaign2][Empty]'+_0x47f46e[_0x0ead('0x45')]);}else{_0x47f46e[_0x0ead('0x156')]+=_0x246c79[_0x0ead('0x94')];_0x47f46e['message']=utils['CAMPAIGN_STATUS'][_0x0ead('0x1f4')];for(var _0x12b9ac=0x0;_0x12b9ac<_0x246c79[_0x0ead('0x94')];_0x12b9ac+=0x1){_0x47f46e[_0x0ead('0x1f5')]+=0x1;if(_[_0x0ead('0xf1')](_0x246c79[_0x12b9ac])||_[_0x0ead('0xf1')](_0x246c79[_0x12b9ac][_0x0ead('0x1f6')])||_[_0x0ead('0xf1')](_0x246c79[_0x12b9ac][_0x0ead('0x164')])){_0x1f496a[_0x0ead('0x1f7')](_0x0ead('0x1f8'),_0x47f46e,_0x246c79[_0x12b9ac]);}else{hopperUtils[_0x0ead('0x1f9')](_[_0x0ead('0xf6')](_0x246c79[_0x12b9ac],[_0x0ead('0xdd'),_0x0ead('0x164')]))[_0x0ead('0x9a')](_0x1f496a[_0x0ead('0x1fa')](_0x47f46e,_0x246c79[_0x12b9ac]))[_0x0ead('0x9c')](_0x1f496a[_0x0ead('0x159')](_0x0ead('0x1fb'),_0x47f46e));}}}}})[_0x0ead('0x9c')](loggerGetContactDialer(_0x0ead('0x1fc'),_0x47f46e,_0x133bd2));}};Dialer[_0x0ead('0x1a')][_0x0ead('0xb2')]=function(_0x1f3e57,_0x42ebc1){var _0x9f1a4=this;var _0x175be6=[];if(_0x42ebc1<0x1||_0x1f3e57[_0x0ead('0xb1')]==='booked'){_0x42ebc1=0x1;}var _0x40166a=Math[_0x0ead('0x1fd')](_0x1f3e57[_0x0ead('0x13b')]*_0x42ebc1)-_0x1f3e57['originated'];if(_0x1f3e57[_0x0ead('0x1fe')]>0x0){var _0x328e96=_0x1f3e57['dialLimitQueue']-_0x1f3e57[_0x0ead('0x156')]-_0x1f3e57[_0x0ead('0x13d')]-_0x1f3e57[_0x0ead('0x13e')];if(_0x40166a>_0x328e96){_0x40166a=_0x328e96;}}if(_0x40166a>0x0&&_0x1f3e57[_0x0ead('0x64')]==0x0){if(_0x1f3e57[_0x0ead('0xb1')]==='booked'){_0x40166a=0x1;}if(_0x40166a>this[_0x0ead('0x22')]){_0x40166a=this[_0x0ead('0x22')];}for(var _0x4a18c0 in this[_0x0ead('0x20')]){if(typeof this[_0x0ead('0x20')][_0x4a18c0]!==_0x0ead('0xa8')){if(this['agents'][_0x4a18c0][_0x0ead('0x6d')]===_0x0ead('0x1ff')&&this[_0x0ead('0x20')][_0x4a18c0][_0x0ead('0x86')]==='reachable'){_0x175be6[_0x0ead('0x95')](this[_0x0ead('0x20')][_0x4a18c0]['id']);}}}_0x1f3e57[_0x0ead('0x64')]=0x1;hopperUtils[_0x0ead('0x200')](_0x1f3e57,_0x175be6,_0x40166a)[_0x0ead('0x9a')](function(_0xe4902f){_0x1f3e57[_0x0ead('0x64')]=0x0;if(_0xe4902f){if(!utils[_0x0ead('0x1f3')](_0xe4902f)){hopperUtils[_0x0ead('0x201')](_0x1f3e57)['then'](sendMessageReschedule(_0x1f3e57))[_0x0ead('0x9c')](loggerCatch('[countReScheduled]\x20'));}else{_0x1f3e57[_0x0ead('0x156')]+=_0xe4902f[_0x0ead('0x94')];_0x1f3e57['message']=_0x1f3e57[_0x0ead('0xb1')]===_0x0ead('0x202')?utils[_0x0ead('0x65')][_0x0ead('0x13f')]:utils[_0x0ead('0x65')][_0x0ead('0x1f4')];for(var _0x3d3ad9=0x0;_0x3d3ad9<_0xe4902f[_0x0ead('0x94')];_0x3d3ad9+=0x1){if(_['isNil'](_0xe4902f[_0x3d3ad9])||_['isNil'](_0xe4902f[_0x3d3ad9]['Contact'])||_[_0x0ead('0xf1')](_0xe4902f[_0x3d3ad9]['phone'])){_0x9f1a4[_0x0ead('0x1f7')](_0x0ead('0x1f8'),_0x1f3e57,_0xe4902f[_0x3d3ad9]);}else{hopperUtils[_0x0ead('0x203')](_[_0x0ead('0xf6')](_0xe4902f[_0x3d3ad9],[_0x0ead('0xfb'),_0x0ead('0x164')]))['then'](_0x9f1a4[_0x0ead('0x1fa')](_0x1f3e57,_0xe4902f[_0x3d3ad9]))[_0x0ead('0x9c')](_0x9f1a4[_0x0ead('0x159')](_0x0ead('0x1f8'),_0x1f3e57));}}}}})['catch'](loggerGetContactDialer('[getContactDialer2]',_0x1f3e57,_0x40166a));}};Dialer['prototype']['handlePredictive']=function(_0x6d6e8b){if(_0x6d6e8b[_0x0ead('0x1fe')]>0x0){var _0x5ba1ab=_0x6d6e8b[_0x0ead('0x1fe')]-_0x6d6e8b[_0x0ead('0x156')]-_0x6d6e8b[_0x0ead('0x13d')];if(_0x5ba1ab>0x0&&_0x6d6e8b['temp']==0x0){this[_0x0ead('0x204')](_0x6d6e8b);}else{loggerPredictiveCalls['info'](_0x0ead('0x205'));}}else{this[_0x0ead('0x204')](_0x6d6e8b);}};Dialer[_0x0ead('0x1a')][_0x0ead('0x204')]=function(_0x586ef5){var _0x42b906=this;var _0x18bc4=[];_0x586ef5[_0x0ead('0x156')]+=0x1;for(var _0x18c740 in this[_0x0ead('0x20')]){if(typeof this[_0x0ead('0x20')][_0x18c740]!==_0x0ead('0xa8')){if(this[_0x0ead('0x20')][_0x18c740][_0x0ead('0x6d')]===_0x0ead('0x1ff')&&this['agents'][_0x18c740][_0x0ead('0x86')]==='reachable'){_0x18bc4[_0x0ead('0x95')](this[_0x0ead('0x20')][_0x18c740]['id']);}}}_0x586ef5[_0x0ead('0x64')]=0x1;return this[_0x0ead('0x200')](_0x586ef5['id'],_0x18bc4,0x1,_0x586ef5[_0x0ead('0x206')],_0x586ef5)[_0x0ead('0x9a')](function(_0x4f2d9d){_0x586ef5['temp']=0x1;if(_0x4f2d9d){if(!utils[_0x0ead('0x1f3')](_0x4f2d9d)){utils['checkContactLowerLimitOriginate'](_0x586ef5,0x1,0x0);return hopperUtils[_0x0ead('0x201')](_0x586ef5)[_0x0ead('0x9a')](sendMessageReschedule(_0x586ef5))[_0x0ead('0x9c')](loggerCatch(_0x0ead('0x207')));}else{_0x586ef5['message']=utils['CAMPAIGN_STATUS'][_0x0ead('0x1f4')];if(_['isNil'](_0x4f2d9d[0x0])||_[_0x0ead('0xf1')](_0x4f2d9d[0x0][_0x0ead('0x1f6')])||_['isNil'](_0x4f2d9d[0x0][_0x0ead('0x164')])){_0x42b906[_0x0ead('0x1f7')]('[actionOriginate]\x20',_0x586ef5,_0x4f2d9d[0x0]);}else{return hopperUtils[_0x0ead('0x203')](_[_0x0ead('0xf6')](_0x4f2d9d[0x0],[_0x0ead('0xfb'),_0x0ead('0x164')]))[_0x0ead('0x9a')](_0x42b906[_0x0ead('0x1fa')](_0x586ef5,_0x4f2d9d[0x0]))[_0x0ead('0x9c')](_0x42b906[_0x0ead('0x159')](_0x0ead('0x208'),_0x586ef5));}}}})['catch'](loggerGetContactDialer('[getContactDialerPredictive]',_0x586ef5,0x1));};Dialer['prototype']['abandonmentRate']=function(_0x4d9745,_0x540de5,_0x29ae8d,_0x3dc003,_0x3c0355,_0x49d476){loggerPredictive[_0x0ead('0x46')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0x0ead('0x46')](_0x0ead('0x209'),_0x4d9745);loggerPredictive[_0x0ead('0x46')](_0x0ead('0x20a'),_0x540de5);loggerPredictive[_0x0ead('0x46')](_0x0ead('0x20b'),_0x29ae8d);loggerPredictive[_0x0ead('0x46')](_0x0ead('0x20c'),_0x3dc003);loggerPredictive[_0x0ead('0x46')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3c0355);loggerPredictive['info'](_0x0ead('0x50'));return new Promise(function(_0x31eb8a,_0x2c2b3a){if(_0x4d9745<=0x0||isNaN(_0x4d9745)){return _0x2c2b3a(msgResponse(_0x0ead('0x20d'),_0x0ead('0x82'),_0x0ead('0x20e')+_0x4d9745));}if(_0x29ae8d<=0x0||isNaN(_0x29ae8d)){return _0x2c2b3a(msgResponse(_0x0ead('0x20d'),'Error','Ts\x20=\x20'+_0x29ae8d));}if(_0x3dc003<=0x0||isNaN(_0x3dc003)){return _0x2c2b3a(msgResponse(_0x0ead('0x20d'),'Error',_0x0ead('0x20f')+_0x3dc003));}if(_0x540de5<=0x0||isNaN(_0x540de5)){return _0x2c2b3a(msgResponse(_0x0ead('0x20d'),_0x0ead('0x82'),_0x0ead('0x210')+_0x540de5));}if(_0x3c0355<=0x0||isNaN(_0x3c0355)){return _0x2c2b3a(msgResponse(_0x0ead('0x20d'),_0x0ead('0x82'),_0x0ead('0x211')+_0x3c0355));}_0x49d476=_0x49d476||0x0;var _0x3a29dd=0x1/_0x29ae8d;var _0xc6a6f9=0x0;var _0x1df1fd=0x0;var _0x3dbf34=0x0;var _0x5b364e=0x0;for(var _0x223f4e=0x0;_0x3dbf34<_0x3c0355;_0x223f4e+=0x1){_0x1df1fd=_0x223f4e/_0x540de5;_0xc6a6f9=(_0x3dc003*_0x1df1fd+_0x49d476)/_0x3a29dd;_0x3dbf34=utils[_0x0ead('0x212')](_0xc6a6f9,_0x4d9745);_0x5b364e=_0xc6a6f9/_0x4d9745*(0x1-utils[_0x0ead('0x212')](_0xc6a6f9,_0x4d9745));}return _0x31eb8a({'erlangCalls':_0x223f4e,'erlangCallToSecond':_0x540de5/_0x223f4e,'erlangAbandonmentRate':_0x3dbf34,'erlangBusyFactor':_0x5b364e});});};Dialer['prototype'][_0x0ead('0x1d6')]=function(_0x5a5310,_0x55e78b,_0xe0bf2c,_0x5b35a0,_0x190cad,_0x133fed){loggerPredictive[_0x0ead('0x46')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive['info']('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',_0x5a5310);loggerPredictive[_0x0ead('0x46')](_0x0ead('0x20a'),_0x55e78b);loggerPredictive[_0x0ead('0x46')](_0x0ead('0x20b'),_0xe0bf2c);loggerPredictive[_0x0ead('0x46')](_0x0ead('0x20c'),_0x5b35a0);loggerPredictive['info'](_0x0ead('0x213'),_0x190cad);loggerPredictive['info'](_0x0ead('0x50'));return new Promise(function(_0x249157,_0x133bce){if(_0x5a5310<=0x0||isNaN(_0x5a5310)){return _0x133bce(msgResponse('[busyFactor]',_0x0ead('0x82'),_0x0ead('0x20e')+_0x5a5310));}if(_0xe0bf2c<=0x0||isNaN(_0xe0bf2c)){return _0x133bce(msgResponse(_0x0ead('0x214'),_0x0ead('0x82'),_0x0ead('0x215')+_0xe0bf2c));}if(_0x5b35a0<=0x0||isNaN(_0x5b35a0)){return _0x133bce(msgResponse('[busyFactor]',_0x0ead('0x82'),'p\x20=\x20'+_0x5b35a0));}if(_0x55e78b<=0x0||isNaN(_0x55e78b)){return _0x133bce(msgResponse('[busyFactor]',_0x0ead('0x82'),_0x0ead('0x210')+_0x55e78b));}if(_0x190cad<=0x0||isNaN(_0x190cad)){return _0x133bce(msgResponse(_0x0ead('0x214'),_0x0ead('0x82'),_0x0ead('0x216')+_0x190cad));}_0x133fed=_0x133fed||0x0;var _0x3c4ec6=0x1/_0xe0bf2c;var _0x2b0559=0x0;var _0x3b160b=0x0;var _0x1ed753=0x0;var _0xdc23f5=0x0;for(var _0x511847=0x0;_0xdc23f5<_0x190cad;_0x511847+=0x1){_0x3b160b=_0x511847/_0x55e78b;_0x2b0559=(_0x5b35a0*_0x3b160b+_0x133fed)/_0x3c4ec6;_0x1ed753=utils[_0x0ead('0x212')](_0x2b0559,_0x5a5310);_0xdc23f5=_0x2b0559/_0x5a5310*(0x1-utils['erlangb'](_0x2b0559,_0x5a5310));}return _0x249157({'erlangCalls':_0x511847,'erlangCallToSecond':_0x55e78b/_0x511847,'erlangAbandonmentRate':_0x1ed753,'erlangBusyFactor':_0xdc23f5});});};module['exports']=Dialer;