f9c371211f22078e72709c30a24398b6bd137892
[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 _0x4a40=['TrunkBackup','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','ifTime','\x20Intervals\x20is\x20empty\x20','timezones','\x20Timezone\x20unknow\x20','isArray','length','push','Action','command','iftime\x20%s,%s','interval','indexOf','true','catch','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','Global:\x20','Timezone:\x20','resetActiveCalls','syncCampaigns','undefined','resolve','checkIsTrunkReachable','checkIfTime','dialGlobalInterval','launchHandleIvr','[syncCampaigns]','checkDialMethod','dialMethod','progressive','handlePower','dialPowerLevel','Queue','dialTimezone','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','queue','uniqueid','updateOriginated','voiceQueues','YYYY-MM-DD\x20HH:mm:ss','ivr','outboundAnswerCallsDay','agent','dialQueueProject2','dialAgiAfterHangupAgent','createHistory','moveContactManagedDialer','droptime','responsetime','dialQueueTimeout','predictiveIntervalDroppedCallsTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','dropreason','TIMEOUT','agiafterat','countdropretry','countglobal','dialDropRetryFrequency','callAdditionalPhoneAfterMin','verifyAdditionalPhones','additional','dialDropMaxRetry','queueCallerAbandonCreateState','rescheduleContact','add','minutes','ContactId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','Drop','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','outboundDropCallsDayCallersExit','Abandoned','countabandonedretry','dialAbandonedRetryFrequency','voiceQueue','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','syncNewExten','channel','actionid','strategy','rrmemory','roundrobin','isNil','locked','paused','stateinterface','syncQueueStatusComplete','preview','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','ListId','[unlock][syncQueueStatusComplete]','_rr','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','getQueue','response','syncVarSet','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','outboundAnswerAgiCallsDay','membername','AMD','custom:amd','buildObj','[syncHangupInAMD][createHistory]','MACHINE','Machine','countmachineretry','amd','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','dialGlobalMaxRetry','reason19\x20machine....','createStateFinal','dialMachineRetryFrequency','[rescheduleContact][Machine]','HangupInAMD','saveInDb','[syncHangupInAMDIvr][createHistory]','countnosuchnumberretry','stateGlobal','dialMachineMaxRetry','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','outboundUnknownCallsDay','Unknow','running','isPreviewCampaign','statusMessage','getQueueCampaignStatusMessage','talking','ACTIVE','[syncQueueSummary]','compareToOutboundQueue','updateReportFromOutboundQueue','assign','filter','dialPreviewRecallmeReminder','online','handlePreviewRecallNotifications','map','user:%s','user:dialPreviewRecallReminder','clearZombieChannels','[actions]','[Dialer][checkChannel][ivr]','[getVoiceQueueRtPauses]\x20','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','UserId','[emptyContact]','[syncAgentComplete][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','checkPreviewRecallReminder','handleIvr','actionOriginate','object','phone','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','isOutboundQueue','\x22%s,%s%s,,,%s\x22','NONE','getCaller','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','setXMDContactVariables','Contact','getCallerId','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','callerid','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','originate','dialPrefix','trim','dialCutDigit','substring','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originate][error]','originate\x20action\x20Error','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callProgressDetecting','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','reason','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','buildNoAnswerEventPayload','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','busy','dialBusyRetryFrequency','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','outboundRejectCallsDay','custom:agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','available','floor','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','avgHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','predictiveIntervalTotalCalls','dialPredictiveOptimizationPercentage','abandonmentRate','agentBusyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getVoiceQueueRtPauses','loggedIn','predictiveIntervalPauses','outboundQueuePauses','busyFactor','erlangCallToSecond','milliseconds','[handlePredictive]','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','scheduledat','Agent','voicePause','unlockContact','outboundReCallsDay','dialRecallInQueue','QUEUE_RECALL','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','Blacklist','[Originate][historyBlacklist]','inBlackList','checkContactEmpty','[getContactCampaign2][Empty]','ivrTotalCallsDays','checkIsBlackListIvr','[actionOriginateIvr]\x20','pTalking','not_inuse','getContactDialer','countReScheduled','[countReScheduled]\x20','[actionOriginate]\x20','[getContactDialer2]','dialLimitQueue','tryOriginatePredictive','[handlePredictive][limitChannel]','dialOrderByScheduledAt','RUNNING','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','m\x20=\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','erlangb','----\x20Agent\x20Busy\x20Factor\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','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','exports','util','lodash','uuid','moment','ioredis','./utils','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/setting','./models/action','./models/final','./models/agentComplete','./models/queueCallerAbandon','./models/hangup','env','XCALLY_IP_AGI','127.0.0.1','prototype','enqueue','tail','finally','sequence','campaigns','agents','trunks','maxNumberOriginate','channels','actions','uniqueId','startProgressive','queueBooked','queueBookedRR','queuesSummary','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','syncOriginateResponse','agentcomplete','custom:queuesummary','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncHangup','newexten','varset','queuemember','syncQueueMember','queuestatuscomplete','loopCampaigns','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined','emit','type','outbound','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','format','voice_queue:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','predictiveIntervalAvgHoldtime','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','---------------------------','merge','getSeconds','startProgressive\x20value\x20cleared','startPredictive','name','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','checkContactLowerLimitOriginate','temp','contactsRescheduled','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contacts','message','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','statedesc','endtime','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','pick','NULL_INTERVAL','Interval','Intervals','\x20INTERVAL_IS_NULL','isEmpty','isIVRCampaignActive','INACTIVE','\x20NOT\x20Active','isIVRCampaign','campaign:ivr:%s','campaign:save','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','DISACTIVED','is\x20disactive','[ifTime][Action]','Error','isTrunkReachable','active','status','reachable','SIP/%s','unmonitored','Trunk'];(function(_0x318a7e,_0x182222){var _0x2172d0=function(_0xa6f13){while(--_0xa6f13){_0x318a7e['push'](_0x318a7e['shift']());}};_0x2172d0(++_0x182222);}(_0x4a40,0x184));var _0x04a4=function(_0x171028,_0x7ee648){_0x171028=_0x171028-0x0;var _0x5c4c7b=_0x4a40[_0x171028];return _0x5c4c7b;};'use strict';var util=require(_0x04a4('0x0'));var _=require(_0x04a4('0x1'));var uuid=require(_0x04a4('0x2'));var moment=require(_0x04a4('0x3'));var rr=require('rr');var Redis=require(_0x04a4('0x4'));var utils=require(_0x04a4('0x5'));var hopperUtils=require('./utils/hopper');var ut=require(_0x04a4('0x6'));var config=require(_0x04a4('0x7'));var logger=require(_0x04a4('0x8'))(_0x04a4('0x9'));var loggerBooked=require(_0x04a4('0x8'))(_0x04a4('0xa'));var loggerPredictive=require(_0x04a4('0x8'))(_0x04a4('0xb'));var loggerPredictiveCalls=require(_0x04a4('0x8'))('predictiveCalls');var loggerSyncQueueSummary=require(_0x04a4('0x8'))(_0x04a4('0xc'));var ami=require(_0x04a4('0xd'));config[_0x04a4('0xe')]=_[_0x04a4('0xf')](config[_0x04a4('0xe')],{'host':_0x04a4('0x10'),'port':0x18eb});var io=require(_0x04a4('0x11'))(new Redis(config[_0x04a4('0xe')]));var cmHopper=require(_0x04a4('0x12'));var voiceQueueRt=require(_0x04a4('0x13'));var RpcSetting=require(_0x04a4('0x14'));var Interval=require('../rpc/interval');var Action=require(_0x04a4('0x15'));var History=require('./models/history');var Final=require(_0x04a4('0x16'));var AgentComplete=require(_0x04a4('0x17'));var QueueCallerAbandon=require(_0x04a4('0x18'));var Hangup=require(_0x04a4('0x19'));var ipAgi=process[_0x04a4('0x1a')][_0x04a4('0x1b')]||_0x04a4('0x1c');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x04a4('0x1d')][_0x04a4('0x1e')]=function(_0x195b29){this[_0x04a4('0x1f')]=this[_0x04a4('0x1f')]?this[_0x04a4('0x1f')][_0x04a4('0x20')](_0x195b29):_0x195b29();};function Dialer(_0x128939,_0x262495){this[_0x04a4('0x21')]=new Sequence();this['preview']=_0x262495;this['voiceQueues']=_0x128939['voiceQueues'];this[_0x04a4('0x22')]=_0x128939[_0x04a4('0x22')];this[_0x04a4('0x23')]=_0x128939[_0x04a4('0x23')];this[_0x04a4('0x24')]=_0x128939[_0x04a4('0x24')];this[_0x04a4('0x25')]=config[_0x04a4('0x25')]||0x2;this[_0x04a4('0x26')]={};this[_0x04a4('0x27')]={};this['contactsId']={};this[_0x04a4('0x28')]={};this['optionPredictive']={};this['startPredictive']={};this[_0x04a4('0x29')]={};this['ivrOriginated']={};this[_0x04a4('0x2a')]={};this[_0x04a4('0x2b')]={};this[_0x04a4('0x2c')]={};ami['on'](_0x04a4('0x2d'),this[_0x04a4('0x2e')][_0x04a4('0x2f')](this));ami['on'](_0x04a4('0x30'),this[_0x04a4('0x31')][_0x04a4('0x2f')](this));ami['on']('originateresponse',this[_0x04a4('0x32')][_0x04a4('0x2f')](this));ami['on'](_0x04a4('0x33'),this['syncAgentComplete']['bind'](this));ami['on'](_0x04a4('0x34'),this['syncQueueSummary'][_0x04a4('0x2f')](this));ami['on'](_0x04a4('0x35'),this[_0x04a4('0x36')][_0x04a4('0x2f')](this));ami['on'](_0x04a4('0x37'),this[_0x04a4('0x38')][_0x04a4('0x2f')](this));ami['on'](_0x04a4('0x39'),this['syncNewExten'][_0x04a4('0x2f')](this));ami['on'](_0x04a4('0x3a'),this['syncVarSet'][_0x04a4('0x2f')](this));ami['on'](_0x04a4('0x3b'),this[_0x04a4('0x3c')][_0x04a4('0x2f')](this));ami['on'](_0x04a4('0x3d'),this['syncQueueStatusComplete'][_0x04a4('0x2f')](this));this[_0x04a4('0x3e')]();this[_0x04a4('0x3f')]();RpcSetting[_0x04a4('0x40')]()[_0x04a4('0x41')](function(_0x1f626b){previewRecallmeReminderInterval=_0x1f626b[_0x04a4('0x42')];});}function isNotNull(_0x1bbb63){return _0x1bbb63!==null&&!_[_0x04a4('0x43')](_0x1bbb63);}function msgResponse(_0x2f381d,_0xa06a45,_0x56fed9){return{'action':_0x2f381d,'response':_0xa06a45,'message':_0x56fed9,'stack':_0x56fed9};}function emit(_0x239a05,_0x349f16,_0x4eb5d7){io['to'](_0x239a05)[_0x04a4('0x44')](_0x349f16,_0x4eb5d7);}function emitOutboundVoiceQueueSummary(_0x14a8cd){if(_0x14a8cd[_0x04a4('0x45')]===_0x04a4('0x46')){logger[_0x04a4('0x47')](_0x04a4('0x48'),util[_0x04a4('0x49')](_0x14a8cd,{'showHidden':![],'depth':null}));emit(util[_0x04a4('0x4a')]('voice:queue:%s',_0x14a8cd['name']),_0x04a4('0x4b'),_0x14a8cd);}}function checkGetDataPredictive(_0x58f16a){if(isNotNull(_0x58f16a)&&!_['isEmpty'](_0x58f16a)){loggerPredictive[_0x04a4('0x4c')](_0x04a4('0x4d'));loggerPredictive['info'](_0x04a4('0x4e'),_0x58f16a['predictiveIntervalTotalCalls']);loggerPredictive[_0x04a4('0x4c')](_0x04a4('0x4f'),_0x58f16a[_0x04a4('0x50')]);loggerPredictive[_0x04a4('0x4c')](_0x04a4('0x51'),_0x58f16a['predictiveIntervalDroppedCallsTimeout']);loggerPredictive['info'](_0x04a4('0x52'),_0x58f16a[_0x04a4('0x53')]);loggerPredictive[_0x04a4('0x4c')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x58f16a['predictiveIntervalAvgHoldtime']);loggerPredictive[_0x04a4('0x4c')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x58f16a[_0x04a4('0x54')]);loggerPredictive[_0x04a4('0x4c')]('---------------------------');if(_0x58f16a['predictiveIntervalTotalCalls']>0x0){if(!_[_0x04a4('0x43')](_0x58f16a[_0x04a4('0x54')])&&_0x58f16a[_0x04a4('0x54')]>0x0){return!![];}loggerPredictive[_0x04a4('0x4c')](_0x04a4('0x55'));if(!_[_0x04a4('0x43')](_0x58f16a[_0x04a4('0x56')])&&_0x58f16a['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0x04a4('0x4c')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0x04a4('0x4c')](_0x04a4('0x57'));}}else{loggerPredictive[_0x04a4('0x4c')](_0x04a4('0x58'));}return![];}function mergeDataErlangB(_0x13655b){return function(_0x2b7d47){loggerPredictive[_0x04a4('0x4c')](_0x04a4('0x59'));loggerPredictive[_0x04a4('0x4c')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2b7d47[_0x04a4('0x5a')]);loggerPredictive[_0x04a4('0x4c')](_0x04a4('0x5b'),_0x2b7d47['erlangCallToSecond']);loggerPredictive[_0x04a4('0x4c')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2b7d47['erlangAbandonmentRate']);loggerPredictive['info']('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2b7d47['erlangBusyFactor']);loggerPredictive[_0x04a4('0x4c')](_0x04a4('0x5c'),_0x2b7d47[_0x04a4('0x5d')]);loggerPredictive[_0x04a4('0x4c')](_0x04a4('0x5e'));_[_0x04a4('0x5f')](_0x13655b,_0x2b7d47);};}function ifInterval(_0x20af04,_0x251ef8){if(_['isUndefined'](_0x251ef8)){return![];}return utils[_0x04a4('0x60')](undefined,_0x251ef8)<_0x20af04*0x3c;}function clearPredictiveAttributes(_0x301a91){if(_0x301a91[_0x04a4('0x29')]){_0x301a91[_0x04a4('0x29')]=undefined;loggerPredictive[_0x04a4('0x47')](_0x301a91['name'],_0x04a4('0x61'));}if(_0x301a91[_0x04a4('0x62')]){_0x301a91[_0x04a4('0x62')]=undefined;loggerPredictive[_0x04a4('0x47')](_0x301a91[_0x04a4('0x63')],_0x04a4('0x64'));}if(_0x301a91[_0x04a4('0x65')]){clearInterval(_0x301a91['handlePredictive']);_0x301a91[_0x04a4('0x65')]=undefined;loggerPredictive[_0x04a4('0x47')](_0x301a91[_0x04a4('0x63')],_0x04a4('0x66'));}}function loggerCatchPredictive(_0x48984c,_0x53421a){return function(_0xf19e90){loggerPredictive[_0x04a4('0x67')](_0x53421a['name'],_0x48984c);loggerPredictive[_0x04a4('0x67')](_0xf19e90[_0x04a4('0x68')]);clearPredictiveAttributes(_0x53421a);};}function loggerCatch(_0x4eaf9f){return function(_0x53cd16){logger['error'](_0x4eaf9f,util['inspect'](_0x53cd16,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x52573c,_0x3fec35,_0xef1cdf){return function(_0xbe5c75){utils[_0x04a4('0x69')](_0x3fec35,_0xef1cdf,0x0);_0x3fec35[_0x04a4('0x6a')]=0x0;logger[_0x04a4('0x67')](_0x52573c,util[_0x04a4('0x49')](_0xbe5c75,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0xa4a324){return function(_0x184387){if(isNotNull(_0x184387)&&isNotNull(_0x184387[0x0])){if(_0x184387[0x0][_0x04a4('0x6b')]>0x0){_0xa4a324['message']=utils[_0x04a4('0x6c')][_0x04a4('0x6d')];logger[_0x04a4('0x4c')](_0x04a4('0x6e')+_0xa4a324[_0x04a4('0x63')],_0x184387[0x0]['contactsRescheduled'],_0x04a4('0x6f'));}else{_0xa4a324[_0x04a4('0x70')]=utils[_0x04a4('0x6c')][_0x04a4('0x71')];logger[_0x04a4('0x4c')](_0x04a4('0x72')+_0xa4a324[_0x04a4('0x63')]);}}};}function createObjHistory(_0x23cf96,_0x28d0b4,_0x1d14a3,_0x48e1bb,_0x47e7bc){_0x23cf96['message']=_0x1d14a3;var _0x144f2c=new Action(_0x23cf96,_0x28d0b4);var _0x4616c1=new History(_0x144f2c);_0x4616c1[_0x04a4('0x73')]=_0x48e1bb;_0x4616c1[_0x04a4('0x74')]=_0x47e7bc;_0x4616c1[_0x04a4('0x75')]=_0x144f2c[_0x04a4('0x76')];return _0x4616c1;}function unlockQueueStatus(_0x4ffeb5,_0x383aa0){setTimeout(function(){if(_['isUndefined'](_0x4ffeb5[_0x04a4('0x77')])){loggerBooked['error'](_0x04a4('0x78'),_0x383aa0);}_0x4ffeb5[_0x04a4('0x77')]=!![];loggerBooked['info'](_0x04a4('0x79'),_0x383aa0,JSON[_0x04a4('0x7a')](_[_0x04a4('0x7b')](_0x4ffeb5,['name',_0x04a4('0x77')])));},0x1f3);}function checkInterval(_0x23b7b8){return function(){if(!isNotNull(_0x23b7b8['Interval'])){_0x23b7b8[_0x04a4('0x70')]=utils['CAMPAIGN_STATUS'][_0x04a4('0x7c')];throw _0x23b7b8[_0x04a4('0x63')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x23b7b8[_0x04a4('0x7d')][_0x04a4('0x7e')])){_0x23b7b8[_0x04a4('0x70')]=utils[_0x04a4('0x6c')]['NULL_INTERVAL'];throw _0x23b7b8['name']+_0x04a4('0x7f');}if(!isNotNull(_[_0x04a4('0x80')](_0x23b7b8[_0x04a4('0x7d')]['Intervals']))){_0x23b7b8[_0x04a4('0x70')]=utils['CAMPAIGN_STATUS'][_0x04a4('0x7c')];throw _0x23b7b8[_0x04a4('0x63')]+_0x04a4('0x7f');}};}function checkIsIVRCampaignActive(_0x354685){return function(){if(!utils[_0x04a4('0x81')](_0x354685)){_0x354685['message']=utils[_0x04a4('0x6c')][_0x04a4('0x82')];throw _0x354685['name']+_0x04a4('0x83');}};}function emitCampaignSummary(_0x54b569){if(utils[_0x04a4('0x84')](_0x54b569)){emit(util['format'](_0x04a4('0x85'),_0x54b569[_0x04a4('0x63')]),_0x04a4('0x86'),_0x54b569);}}function loggerCatchQueueSummary(_0x542714,_0x12b60e){return function(_0x5d5910){clearPredictiveAttributes(_0x12b60e);emitCampaignSummary(_0x12b60e);loggerSyncQueueSummary[_0x04a4('0x47')](_0x542714,util[_0x04a4('0x49')](_0x5d5910,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x7d8510){if(_0x7d8510[_0x04a4('0x87')]){if(_0x7d8510['originated']===0x0){_0x7d8510['sendMessageOneNotActive']=![];_0x7d8510[_0x04a4('0x70')]=utils[_0x04a4('0x6c')][_0x04a4('0x82')];loggerSyncQueueSummary['debug'](_0x04a4('0x88'),_0x7d8510[_0x04a4('0x63')],_0x04a4('0x89'));}else{_0x7d8510[_0x04a4('0x70')]=utils[_0x04a4('0x6c')][_0x04a4('0x8a')];loggerSyncQueueSummary['debug'](_0x04a4('0x88'),_0x7d8510['name'],_0x04a4('0x8b'));}emitCampaignSummary(_0x7d8510);}}function myreject(_0x18c9a7){return function(_0x562128){return _0x18c9a7(msgResponse(_0x04a4('0x8c'),_0x04a4('0x8d'),JSON['stringify'](_0x562128)));};}Dialer['prototype'][_0x04a4('0x8e')]=function(_0x3eb544){return!_[_0x04a4('0x43')](_0x3eb544)&&_0x3eb544&&!_['isUndefined'](_0x3eb544[_0x04a4('0x63')])&&!_['isUndefined'](_0x3eb544['active'])&&_0x3eb544[_0x04a4('0x8f')]&&(this[_0x04a4('0x24')][util[_0x04a4('0x4a')]('SIP/%s',_0x3eb544[_0x04a4('0x63')])][_0x04a4('0x90')]===_0x04a4('0x91')||this[_0x04a4('0x24')][util['format'](_0x04a4('0x92'),_0x3eb544[_0x04a4('0x63')])][_0x04a4('0x90')]===_0x04a4('0x93'));};Dialer[_0x04a4('0x1d')]['checkIsTrunkReachable']=function(_0x5004bc){var _0x131c51=this;return function(){if(!_0x131c51[_0x04a4('0x8e')](_0x5004bc[_0x04a4('0x94')])){if(!_0x131c51[_0x04a4('0x8e')](_0x5004bc[_0x04a4('0x95')])){_0x5004bc[_0x04a4('0x70')]=utils[_0x04a4('0x6c')][_0x04a4('0x96')];throw _0x5004bc[_0x04a4('0x63')]+_0x04a4('0x97');}}};};Dialer[_0x04a4('0x1d')]['checkIfTime']=function(_0x421f22,_0x14053c,_0x3691c7,_0x5aec99){var _0x1c1148=this;return function(){var _0x5a0861=!![];return _0x1c1148['ifTimeIvr'](_0x421f22,_0x14053c,_0x3691c7,_0x5aec99,_0x5a0861);};};Dialer['prototype'][_0x04a4('0x98')]=function(_0x6edeb6,_0x3471ce,_0x3f38a5,_0x39b451){var _0x330fd9=this;return function(){var _0x443507=![];return _0x330fd9['ifTimeIvr'](_0x6edeb6['Intervals'],_0x3471ce,_0x3f38a5,_0x39b451,_0x443507);};};Dialer[_0x04a4('0x1d')]['ifTimeIvr']=function(_0x232abc,_0x1f43cb,_0x172db8,_0x1c1542,_0x4df267){var _0x3257a9=[];return new Promise(function(_0x46e19c,_0x403e57){if(!isNotNull(_0x232abc)){_0x1c1542['message']=utils[_0x04a4('0x6c')]['NULL_INTERVAL'];return _0x403e57(msgResponse('ifTime',_0x04a4('0x99'),_0x172db8+_0x04a4('0x9a')));}if(_[_0x04a4('0x80')](_0x232abc)){_0x1c1542[_0x04a4('0x70')]=utils['CAMPAIGN_STATUS'][_0x04a4('0x9b')];return _0x403e57(msgResponse(_0x04a4('0x9c'),_0x04a4('0x99'),_0x172db8+_0x04a4('0x9d')));}if(_0x1f43cb&&_['isUndefined'](config[_0x04a4('0x9e')][_0x1f43cb])){_0x1c1542[_0x04a4('0x70')]=utils[_0x04a4('0x6c')]['UNKNOWN_TIMEZONE'];return _0x403e57(msgResponse(_0x04a4('0x9c'),_0x04a4('0x99'),_0x172db8+_0x04a4('0x9f')+_0x1f43cb));}if(_[_0x04a4('0xa0')](_0x232abc)){for(var _0x329434=0x0;_0x329434<_0x232abc[_0x04a4('0xa1')];_0x329434+=0x1){_0x3257a9[_0x04a4('0xa2')](ami[_0x04a4('0xa3')]({'action':_0x04a4('0xa4'),'command':util[_0x04a4('0x4a')](_0x04a4('0xa5'),_0x232abc[_0x329434][_0x04a4('0xa6')],!_[_0x04a4('0x43')](config[_0x04a4('0x9e')][_0x1f43cb])?_0x1f43cb:'')})[_0x04a4('0x41')](function(_0xb78364){return _0xb78364['content'][_0x04a4('0xa7')](_0x04a4('0xa8'))>=0x0;})[_0x04a4('0xa9')](myreject(_0x403e57)));}}else{_0x3257a9['push'](ami[_0x04a4('0xa3')]({'action':'command','command':util[_0x04a4('0x4a')](_0x04a4('0xa5'),_0x232abc,!_[_0x04a4('0x43')](config[_0x04a4('0x9e')][_0x1f43cb])?_0x1f43cb:'')})[_0x04a4('0x41')](function(_0x377b41){return _0x377b41['content'][_0x04a4('0xa7')](_0x04a4('0xa8'))>=0x0;})[_0x04a4('0xa9')](myreject(_0x403e57)));}Promise['all'](_0x3257a9)[_0x04a4('0x41')](function(_0x250a5a){var _0x52f702=_['some'](_0x250a5a);if(_0x52f702){return _0x46e19c(_0x52f702);}else{_0x1c1542[_0x04a4('0x70')]=_0x4df267?utils[_0x04a4('0x6c')][_0x04a4('0xaa')]:utils[_0x04a4('0x6c')][_0x04a4('0xab')];return _0x403e57(msgResponse('[ifTime][promiseAll]',_0x04a4('0x99'),_0x04a4('0xac')+_0x4df267+'\x20'+_0x172db8+'\x20Interval\x20is\x20overtime:\x20'+util['inspect'](_0x232abc,{'showHidden':![],'depth':null})+_0x04a4('0xad')+_0x1f43cb));}})[_0x04a4('0xa9')](function(_0x453f8f){return _0x403e57(msgResponse(_0x04a4('0x9c'),_0x04a4('0x99'),JSON[_0x04a4('0x7a')](_0x453f8f)));});});};Dialer[_0x04a4('0x1d')][_0x04a4('0x3e')]=function(){var _0x5276e8=this;return cmHopper[_0x04a4('0xae')]({'active':![]},{'where':{'active':!![]}})['then'](function(){setInterval(function(){_0x5276e8[_0x04a4('0xaf')]();},0x3e8);});};Dialer['prototype'][_0x04a4('0xaf')]=function(){var _0x500309=this;var _0x13eeac;for(var _0x110a98 in this[_0x04a4('0x22')]){if(typeof this[_0x04a4('0x22')][_0x110a98]!==_0x04a4('0xb0')){_0x13eeac=this[_0x04a4('0x22')][_0x110a98];if(utils[_0x04a4('0x84')](_0x13eeac)&&utils[_0x04a4('0x81')](_0x13eeac)){_0x13eeac[_0x04a4('0x87')]=!![];Promise[_0x04a4('0xb1')]()[_0x04a4('0x41')](checkIsIVRCampaignActive(_0x13eeac))[_0x04a4('0x41')](checkInterval(_0x13eeac))['then'](_0x500309[_0x04a4('0xb2')](_0x13eeac))[_0x04a4('0x41')](_0x500309[_0x04a4('0xb3')](_0x13eeac[_0x04a4('0xb4')],_0x13eeac['dialTimezone'],_0x13eeac[_0x04a4('0x63')],_0x13eeac))['then'](_0x500309['checkIfTimeIntervals'](_0x13eeac[_0x04a4('0x7d')],_0x13eeac['dialTimezone'],_0x13eeac[_0x04a4('0x63')],_0x13eeac))[_0x04a4('0x41')](_0x500309[_0x04a4('0xb5')](_0x13eeac))['catch'](loggerCatchQueueSummary(_0x04a4('0xb6'),_0x13eeac));}else{notSendMessagesCampaign(_0x13eeac);}}}};Dialer['prototype'][_0x04a4('0xb7')]=function(_0x29cb88){if(_0x29cb88[_0x04a4('0xb8')]!==_0x04a4('0xb')){clearPredictiveAttributes(_0x29cb88);}switch(_0x29cb88[_0x04a4('0xb8')]){case _0x04a4('0xb9'):this[_0x04a4('0xba')](_0x29cb88,0x1);break;case'power':this['handlePower'](_0x29cb88,_0x29cb88[_0x04a4('0xbb')]);break;case _0x04a4('0xb'):this[_0x04a4('0xb')](_0x29cb88);break;case'booked':this[_0x04a4('0xba')](_0x29cb88,0x1);break;default:logger['error'](_0x04a4('0xbc'),_0x29cb88['name'],'method\x20not\x20recognized');}};Dialer[_0x04a4('0x1d')][_0x04a4('0x9c')]=function(_0x4a0270,_0x230ed8){var _0x19339d=_0x4a0270[_0x04a4('0xbd')];var _0x20d95d=_0x230ed8?_0x4a0270[_0x04a4('0xb4')]:_0x4a0270[_0x04a4('0x7d')][_0x04a4('0x7e')];logger[_0x04a4('0xbe')](_0x04a4('0xbf'),_0x20d95d,_0x19339d,_0x4a0270[_0x04a4('0x63')],util[_0x04a4('0x4a')](_0x04a4('0xc0'),_0x4a0270[_0x04a4('0x63')],_0x4a0270['id']));var _0x351d90=null;return Interval[_0x04a4('0xc1')](_0x20d95d,_0x19339d)['then'](function(_0x4eb472){if(_0x4eb472===!![]){return _0x4eb472;}else{_0x4a0270[_0x04a4('0x70')]=_0x230ed8?utils['CAMPAIGN_STATUS'][_0x04a4('0xaa')]:utils[_0x04a4('0x6c')]['OVERTIME_INTERVAL'];_0x351d90=msgResponse(_0x04a4('0xc2'),_0x04a4('0x99'),'Global:\x20'+_0x230ed8+'\x20'+_0x4a0270[_0x04a4('0x63')]+_0x04a4('0xc3')+util[_0x04a4('0x49')](_0x20d95d,{'showHidden':![],'depth':null})+_0x04a4('0xad')+_0x19339d);}if(_0x351d90!==null){logger[_0x04a4('0xbe')](_0x04a4('0xc4'),_0x351d90);_0x351d90[_0x04a4('0xc5')]=_0x230ed8;throw _0x351d90;}})[_0x04a4('0xa9')](function(_0x4b9fdb){logger['error']('AMI\x20IfTime',_0x4b9fdb);throw msgResponse('[ifTime][Action]',_0x04a4('0x8d'),util[_0x04a4('0x49')](_0x4b9fdb,{'showHidden':![],'depth':null}));});};Dialer[_0x04a4('0x1d')][_0x04a4('0x2e')]=function(_0x2028b6){if(this['voiceQueues'][_0x2028b6[_0x04a4('0xc6')]]){if(this[_0x04a4('0x28')][_0x2028b6[_0x04a4('0xc7')]]&&this[_0x04a4('0x28')][_0x2028b6['uniqueid']][_0x04a4('0x45')]!=='ivr'){this[_0x04a4('0xc8')](this[_0x04a4('0xc9')][_0x2028b6[_0x04a4('0xc6')]]);this[_0x04a4('0x28')][_0x2028b6[_0x04a4('0xc7')]]['answertime']=moment()['format'](_0x04a4('0xca'));}}};Dialer[_0x04a4('0x1d')]['syncAgentComplete']=function(_0x501a5e){var _0x1dde7f=this[_0x04a4('0x28')][_0x501a5e[_0x04a4('0xc7')]];if(this[_0x04a4('0xc9')][_0x501a5e[_0x04a4('0xc6')]]){if(_0x1dde7f&&_0x1dde7f[_0x04a4('0x45')]!==_0x04a4('0xcb')){delete this['uniqueId'][_0x501a5e[_0x04a4('0xc7')]];this['voiceQueues'][_0x501a5e[_0x04a4('0xc6')]][_0x04a4('0xcc')]+=0x1;var _0x2ebfcd=new AgentComplete(_0x1dde7f,_0x501a5e);if(_0x501a5e['reason']===_0x04a4('0xcd')){_0x2ebfcd['agiafterat']=this['voiceQueues'][_0x501a5e[_0x04a4('0xc6')]][_0x04a4('0xce')]&&this['voiceQueues'][_0x501a5e[_0x04a4('0xc6')]][_0x04a4('0xcf')]?moment()[_0x04a4('0x4a')](_0x04a4('0xca')):undefined;}hopperUtils[_0x04a4('0xd0')](_0x2ebfcd)[_0x04a4('0xa9')](loggerCatch('[syncAgentComplete][createHistory]'));hopperUtils[_0x04a4('0xd1')](_0x2ebfcd)[_0x04a4('0xa9')](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0x04a4('0x1d')]['syncQueueCallerAbandon']=function(_0x45a429){var _0x112aaf=this[_0x04a4('0x28')][_0x45a429[_0x04a4('0xc7')]];var _0x35218c=this;var _0x577140=![];var _0x2bb367;var _0xc313a;if(this[_0x04a4('0xc9')][_0x45a429['queue']]){if(_0x112aaf&&_0x112aaf[_0x04a4('0x45')]!==_0x04a4('0xcb')){delete this[_0x04a4('0x28')][_0x45a429['uniqueid']];this[_0x04a4('0xc8')](this[_0x04a4('0xc9')][_0x45a429[_0x04a4('0xc6')]]);_0x112aaf[_0x04a4('0xd2')]=moment()[_0x04a4('0x4a')](_0x04a4('0xca'));var _0x49f536=new QueueCallerAbandon(_0x112aaf,_0x45a429);if(utils[_0x04a4('0x60')](_0x112aaf[_0x04a4('0xd2')],_0x112aaf[_0x04a4('0xd3')])>=_0x112aaf[_0x04a4('0xd4')]){this['voiceQueues'][_0x45a429[_0x04a4('0xc6')]][_0x04a4('0xd5')]+=0x1;this[_0x04a4('0xc9')][_0x45a429['queue']][_0x04a4('0xd6')]+=0x1;this['voiceQueues'][_0x45a429['queue']][_0x04a4('0xd7')]+=0x1;_0x49f536['state']=0xa;_0x49f536[_0x04a4('0x74')]='Drop';_0x49f536[_0x04a4('0xd8')]=_0x04a4('0xd9');_0x49f536[_0x04a4('0xda')]=this[_0x04a4('0xc9')][_0x45a429[_0x04a4('0xc6')]][_0x04a4('0xce')]?moment()[_0x04a4('0x4a')](_0x04a4('0xca')):undefined;_0x49f536[_0x04a4('0xdb')]+=0x1;_0x49f536[_0x04a4('0xdc')]+=0x1;_0x2bb367=this[_0x04a4('0xc9')][_0x45a429[_0x04a4('0xc6')]][_0x04a4('0xdd')];_0xc313a=this[_0x04a4('0xc9')][_0x45a429['queue']][_0x04a4('0xde')];hopperUtils[_0x04a4('0xdf')](_0x49f536,_0x49f536[_0x04a4('0x73')],_0x112aaf['voiceQueue'])[_0x04a4('0x41')](function(_0x243c31){_0x577140=_0x243c31[_0x04a4('0xe0')]==0x1;if(_0x49f536[_0x04a4('0xdb')]>=_0x35218c[_0x04a4('0xc9')][_0x45a429[_0x04a4('0xc6')]][_0x04a4('0xe1')]){_0x35218c[_0x04a4('0xe2')](_0x49f536,_0x243c31[_0x04a4('0xe0')]);}else{hopperUtils[_0x04a4('0xe3')]({'active':![],'countdropretry':_0x49f536[_0x04a4('0xdb')],'scheduledat':moment()[_0x04a4('0xe4')](_0x35218c[_0x04a4('0xc9')][_0x45a429['queue']][_0x04a4('0xdd')],_0x04a4('0xe5'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x112aaf[_0x04a4('0xe6')],'ListId':_0x112aaf['ListId'],'VoiceQueueId':_0x112aaf[_0x04a4('0xe7')]||undefined,'CampaignId':_0x112aaf[_0x04a4('0xe8')]||undefined})[_0x04a4('0xa9')](loggerCatch(_0x04a4('0xe9')));var _0x126ebc=new History(_0x49f536);_0x126ebc[_0x04a4('0x73')]=0xa;_0x126ebc['statedesc']=_0x04a4('0xea');_0x126ebc[_0x04a4('0x76')]=moment()[_0x04a4('0x4a')](_0x04a4('0xca'));_0x126ebc['endtime']=_0x126ebc['starttime'];_0x126ebc[_0x04a4('0xeb')]=_0x49f536['calleridname'];_0x126ebc[_0x04a4('0xec')]=_0x49f536['calleridnum'];hopperUtils[_0x04a4('0xd0')](_0x126ebc)[_0x04a4('0xa9')](loggerCatch(_0x04a4('0xed')));}})['then'](function(){if(_0x577140)hopperUtils[_0x04a4('0xee')](_0x49f536,_0x2bb367,_0xc313a)[_0x04a4('0x41')](function(){return 0x1;});});}else{this[_0x04a4('0xc9')][_0x45a429[_0x04a4('0xc6')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0x04a4('0xc9')][_0x45a429[_0x04a4('0xc6')]][_0x04a4('0xef')]+=0x1;_0x49f536[_0x04a4('0x73')]=0xb;_0x49f536[_0x04a4('0x74')]=_0x04a4('0xf0');_0x49f536[_0x04a4('0xd8')]='CALLEREXIT';_0x49f536[_0x04a4('0xf1')]+=0x1;_0x49f536[_0x04a4('0xdc')]+=0x1;_0x2bb367=this[_0x04a4('0xc9')][_0x45a429[_0x04a4('0xc6')]][_0x04a4('0xf2')];_0xc313a=this[_0x04a4('0xc9')][_0x45a429[_0x04a4('0xc6')]]['callAdditionalPhoneAfterMin'];hopperUtils[_0x04a4('0xdf')](_0x49f536,_0x49f536[_0x04a4('0x73')],_0x112aaf[_0x04a4('0xf3')])['then'](function(_0x3bdc94){if(_0x49f536['countabandonedretry']>=_0x35218c[_0x04a4('0xc9')][_0x45a429[_0x04a4('0xc6')]][_0x04a4('0xf4')]){_0x35218c[_0x04a4('0xe2')](_0x49f536,_0x3bdc94[_0x04a4('0xe0')]);}else{hopperUtils[_0x04a4('0xe3')]({'active':![],'countabandonedretry':_0x49f536[_0x04a4('0xf1')],'scheduledat':moment()['add'](_0x35218c[_0x04a4('0xc9')][_0x45a429[_0x04a4('0xc6')]][_0x04a4('0xf2')],_0x04a4('0xe5'))['format'](_0x04a4('0xca')),'ContactId':_0x112aaf[_0x04a4('0xe6')],'ListId':_0x112aaf['ListId'],'VoiceQueueId':_0x112aaf[_0x04a4('0xe7')]||undefined,'CampaignId':_0x112aaf[_0x04a4('0xe8')]||undefined})[_0x04a4('0xa9')](loggerCatch(_0x04a4('0xf5')));var _0x12889b=new History(_0x49f536);_0x12889b[_0x04a4('0x73')]=0xb;_0x12889b[_0x04a4('0x74')]=_0x04a4('0xf0');_0x12889b['starttime']=moment()['format'](_0x04a4('0xca'));_0x12889b['endtime']=_0x12889b['starttime'];_0x12889b[_0x04a4('0xeb')]=_0x49f536[_0x04a4('0xeb')];_0x12889b[_0x04a4('0xec')]=_0x49f536[_0x04a4('0xec')];hopperUtils[_0x04a4('0xd0')](_0x12889b)[_0x04a4('0xa9')](loggerCatch(_0x04a4('0xf6')));}})[_0x04a4('0x41')](function(){if(_0x577140)hopperUtils[_0x04a4('0xee')](_0x49f536,_0x2bb367,_0xc313a)[_0x04a4('0x41')](function(){return 0x1;});});}}}};Dialer[_0x04a4('0x1d')][_0x04a4('0xf7')]=function(_0x37094a){if(this['actions'][_0x37094a[_0x04a4('0xc7')]]){this['actions'][_0x37094a[_0x04a4('0xc7')]]['channel']=_0x37094a[_0x04a4('0xf8')];}if(this['uniqueId'][_0x37094a[_0x04a4('0xc7')]]){this[_0x04a4('0x28')][_0x37094a[_0x04a4('0xc7')]][_0x04a4('0xf8')]=_0x37094a['channel'];}};Dialer[_0x04a4('0x1d')]['syncQueueMember']=function(_0x3e8e42){if(!this[_0x04a4('0x27')][_0x3e8e42[_0x04a4('0xf9')]]){return;}var _0x10876f=this['voiceQueues'][this['actions'][_0x3e8e42[_0x04a4('0xf9')]][_0x04a4('0xc6')]][_0x04a4('0xfa')]||_0x04a4('0xfb');if(_0x10876f===_0x04a4('0xfc')){if(this['actions'][_0x3e8e42[_0x04a4('0xf9')]]&&_[_0x04a4('0xfd')](this[_0x04a4('0x27')][_0x3e8e42[_0x04a4('0xf9')]][_0x04a4('0xfe')])&&_0x3e8e42[_0x04a4('0x90')]==='1'&&_0x3e8e42[_0x04a4('0xff')]==='0'){if(this[_0x04a4('0x23')][_0x3e8e42[_0x04a4('0x100')]]){if(!this['agents'][_0x3e8e42[_0x04a4('0x100')]]['locked']){this[_0x04a4('0x23')][_0x3e8e42['stateinterface']]['locked']=!![];this['actions'][_0x3e8e42['actionid']][_0x04a4('0xfe')]=!![];this[_0x04a4('0x27')][_0x3e8e42['actionid']][_0x04a4('0x100')]=_0x3e8e42['stateinterface'];}}}}else if(_0x10876f==='rrmemory'){if(this[_0x04a4('0x27')][_0x3e8e42[_0x04a4('0xf9')]]){if(this[_0x04a4('0x23')][_0x3e8e42[_0x04a4('0x100')]]){this[_0x04a4('0x27')][_0x3e8e42[_0x04a4('0xf9')]][_0x04a4('0x100')]=_0x3e8e42[_0x04a4('0x100')];if(_[_0x04a4('0xfd')](this['queueBooked'][this[_0x04a4('0x27')][_0x3e8e42[_0x04a4('0xf9')]][_0x04a4('0xc6')]])){this[_0x04a4('0x2a')][this[_0x04a4('0x27')][_0x3e8e42[_0x04a4('0xf9')]][_0x04a4('0xc6')]]=[];}this[_0x04a4('0x2a')][this[_0x04a4('0x27')][_0x3e8e42['actionid']][_0x04a4('0xc6')]][_0x04a4('0xa2')](_['merge'](_[_0x04a4('0x7b')](this[_0x04a4('0x27')][_0x3e8e42[_0x04a4('0xf9')]],['idHopper',_0x04a4('0x100')]),{'status':_0x3e8e42[_0x04a4('0x90')],'paused':_0x3e8e42[_0x04a4('0xff')]}));}}}};Dialer[_0x04a4('0x1d')][_0x04a4('0x101')]=function(_0xa50de1){if(!this[_0x04a4('0x27')][_0xa50de1[_0x04a4('0xf9')]]){return;}var _0x1a5051=this;var _0x5809eb=this[_0x04a4('0xc9')][this[_0x04a4('0x27')][_0xa50de1['actionid']][_0x04a4('0xc6')]];var _0x3ec3f6=_0x5809eb['strategy']||_0x04a4('0xfb');if(_0x3ec3f6==='roundrobin'){if(this[_0x04a4('0x27')][_0xa50de1[_0x04a4('0xf9')]]&&this[_0x04a4('0x27')][_0xa50de1[_0x04a4('0xf9')]][_0x04a4('0x100')]){this[_0x04a4('0x102')][_0x04a4('0x103')](this[_0x04a4('0x27')][_0xa50de1[_0x04a4('0xf9')]][_0x04a4('0x104')],this['actions'][_0xa50de1[_0x04a4('0xf9')]][_0x04a4('0x100')])[_0x04a4('0xa9')](function(_0x40d772){logger['error'](_0x04a4('0x105'),util[_0x04a4('0x49')](_0x40d772,{'showHidden':![],'depth':null}));})[_0x04a4('0x20')](function(){_0x1a5051[_0x04a4('0xc8')](_0x1a5051[_0x04a4('0xc9')][_0x1a5051['actions'][_0xa50de1[_0x04a4('0xf9')]][_0x04a4('0xc6')]]);_0x1a5051[_0x04a4('0x23')][_0x1a5051[_0x04a4('0x27')][_0xa50de1['actionid']][_0x04a4('0x100')]][_0x04a4('0xfe')]=![];delete _0x1a5051[_0x04a4('0x27')][_0xa50de1[_0x04a4('0xf9')]];unlockQueueStatus(_0x5809eb);});}else{this[_0x04a4('0xc8')](this['voiceQueues'][this[_0x04a4('0x27')][_0xa50de1[_0x04a4('0xf9')]][_0x04a4('0xc6')]]);hopperUtils['rescheduleContact']({'active':![],'ContactId':this[_0x04a4('0x27')][_0xa50de1[_0x04a4('0xf9')]][_0x04a4('0xe6')],'ListId':this[_0x04a4('0x27')][_0xa50de1[_0x04a4('0xf9')]][_0x04a4('0x106')],'VoiceQueueId':this[_0x04a4('0x27')][_0xa50de1['actionid']]['VoiceQueueId']||undefined,'CampaignId':this['actions'][_0xa50de1[_0x04a4('0xf9')]][_0x04a4('0xe8')]||undefined})['catch'](loggerCatch(_0x04a4('0x107')));delete this[_0x04a4('0x27')][_0xa50de1[_0x04a4('0xf9')]];unlockQueueStatus(_0x5809eb);}}else if(_0x3ec3f6==='rrmemory'){var _0x56ef00;if(this[_0x04a4('0x27')][_0xa50de1[_0x04a4('0xf9')]]&&!_[_0x04a4('0x80')](this[_0x04a4('0x2a')][this[_0x04a4('0x27')][_0xa50de1[_0x04a4('0xf9')]][_0x04a4('0xc6')]])){if(this[_0x04a4('0x2b')][_0x1a5051[_0x04a4('0x27')][_0xa50de1[_0x04a4('0xf9')]][_0x04a4('0xc6')]]){this['queueBookedRR'][_0x1a5051[_0x04a4('0x27')][_0xa50de1[_0x04a4('0xf9')]][_0x04a4('0xc6')]]=this[_0x04a4('0x2b')][this[_0x04a4('0x27')][_0xa50de1['actionid']][_0x04a4('0xc6')]]?this[_0x04a4('0x2b')][this[_0x04a4('0x27')][_0xa50de1[_0x04a4('0xf9')]][_0x04a4('0xc6')]]:this[_0x04a4('0x2a')][this[_0x04a4('0x27')][_0xa50de1[_0x04a4('0xf9')]][_0x04a4('0xc6')]]?this[_0x04a4('0x2a')][this[_0x04a4('0x27')][_0xa50de1[_0x04a4('0xf9')]]['queue']][_0x04a4('0x108')]||0x0:0x0;}this[_0x04a4('0x2a')][this[_0x04a4('0x27')][_0xa50de1[_0x04a4('0xf9')]][_0x04a4('0xc6')]]['_rr']=this[_0x04a4('0x2b')][this['actions'][_0xa50de1[_0x04a4('0xf9')]][_0x04a4('0xc6')]];for(var _0x21f3e7=0x0;_0x21f3e7<this[_0x04a4('0x2a')][this['actions'][_0xa50de1['actionid']][_0x04a4('0xc6')]][_0x04a4('0xa1')];_0x21f3e7+=0x1){_0x56ef00=rr(this[_0x04a4('0x2a')][this[_0x04a4('0x27')][_0xa50de1[_0x04a4('0xf9')]]['queue']]);this[_0x04a4('0x2b')][_0x1a5051[_0x04a4('0x27')][_0xa50de1[_0x04a4('0xf9')]][_0x04a4('0xc6')]]=this[_0x04a4('0x2a')][this[_0x04a4('0x27')][_0xa50de1[_0x04a4('0xf9')]][_0x04a4('0xc6')]][_0x04a4('0x108')];if(_0x56ef00[_0x04a4('0x90')]==='1'&&_0x56ef00['paused']==='0'){break;}}if(!_[_0x04a4('0xfd')](_0x56ef00)){this['agents'][_0x56ef00[_0x04a4('0x100')]][_0x04a4('0x109')]=_[_0x04a4('0x43')](this[_0x04a4('0x23')][_0x56ef00[_0x04a4('0x100')]]['unlockRR'])?!![]:this[_0x04a4('0x23')][_0x56ef00['stateinterface']][_0x04a4('0x109')];}loggerBooked['info']('[booked][RR]',_0xa50de1[_0x04a4('0xf9')],_0x04a4('0x10a'),JSON['stringify'](_['pick'](this[_0x04a4('0x23')][_0x56ef00[_0x04a4('0x100')]],['name',_0x04a4('0x109')])),_0x04a4('0x10b'),JSON[_0x04a4('0x7a')](_0x56ef00['idHopper']));if(!_[_0x04a4('0xfd')](_0x56ef00)&&_0x56ef00['status']==='1'&&_0x56ef00[_0x04a4('0xff')]==='0'&&this[_0x04a4('0x23')][_0x56ef00[_0x04a4('0x100')]][_0x04a4('0x109')]){this[_0x04a4('0x23')][_0x56ef00['stateinterface']]['unlockRR']=![];this[_0x04a4('0x2a')][_0x1a5051[_0x04a4('0x27')][_0xa50de1['actionid']][_0x04a4('0xc6')]]=[];this[_0x04a4('0x102')][_0x04a4('0x103')](_0x56ef00[_0x04a4('0x104')],_0x56ef00[_0x04a4('0x100')])[_0x04a4('0xa9')](function(_0x146cc8){logger[_0x04a4('0x67')](_0x04a4('0x105'),util[_0x04a4('0x49')](_0x146cc8,{'showHidden':![],'depth':null}));})[_0x04a4('0x20')](function(){_0x1a5051[_0x04a4('0xc8')](_0x1a5051[_0x04a4('0xc9')][_0x1a5051[_0x04a4('0x27')][_0xa50de1[_0x04a4('0xf9')]][_0x04a4('0xc6')]]);setTimeout(function(){_0x1a5051['agents'][_0x56ef00[_0x04a4('0x100')]][_0x04a4('0x109')]=!![];loggerBooked['info'](_0x04a4('0x10c'),_0xa50de1[_0x04a4('0xf9')],_0x04a4('0x10a'),JSON[_0x04a4('0x7a')](_[_0x04a4('0x7b')](_0x1a5051['agents'][_0x56ef00[_0x04a4('0x100')]],['name',_0x04a4('0x109')])),_0x04a4('0x10b'),JSON[_0x04a4('0x7a')](_0x56ef00[_0x04a4('0x104')]));},0xc7);delete _0x1a5051[_0x04a4('0x27')][_0xa50de1[_0x04a4('0xf9')]];unlockQueueStatus(_0x5809eb,_0xa50de1[_0x04a4('0xf9')]);});}else{loggerBooked[_0x04a4('0x4c')]('[booked][unlock]');this['updateOriginated'](this[_0x04a4('0xc9')][this[_0x04a4('0x27')][_0xa50de1[_0x04a4('0xf9')]]['queue']]);hopperUtils[_0x04a4('0xe3')]({'active':![],'ContactId':this[_0x04a4('0x27')][_0xa50de1['actionid']]['ContactId'],'ListId':this[_0x04a4('0x27')][_0xa50de1['actionid']]['ListId'],'VoiceQueueId':this[_0x04a4('0x27')][_0xa50de1['actionid']]['VoiceQueueId']||undefined,'CampaignId':this[_0x04a4('0x27')][_0xa50de1['actionid']][_0x04a4('0xe8')]||undefined})[_0x04a4('0xa9')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this['actions'][_0xa50de1[_0x04a4('0xf9')]];unlockQueueStatus(_0x5809eb);}}else{loggerBooked['info'](_0x04a4('0x10d'));this['updateOriginated'](this[_0x04a4('0xc9')][this[_0x04a4('0x27')][_0xa50de1[_0x04a4('0xf9')]][_0x04a4('0xc6')]]);hopperUtils[_0x04a4('0xe3')]({'active':![],'ContactId':this[_0x04a4('0x27')][_0xa50de1[_0x04a4('0xf9')]][_0x04a4('0xe6')],'ListId':this[_0x04a4('0x27')][_0xa50de1[_0x04a4('0xf9')]][_0x04a4('0x106')],'VoiceQueueId':this[_0x04a4('0x27')][_0xa50de1[_0x04a4('0xf9')]][_0x04a4('0xe7')]||undefined,'CampaignId':this[_0x04a4('0x27')][_0xa50de1['actionid']]['CampaignId']||undefined})['catch'](loggerCatch(_0x04a4('0x10e')));delete this[_0x04a4('0x27')][_0xa50de1[_0x04a4('0xf9')]];unlockQueueStatus(_0x5809eb);}}else{loggerBooked[_0x04a4('0x4c')]('[booked][unlock3]');this['updateOriginated'](this['voiceQueues'][this[_0x04a4('0x27')][_0xa50de1[_0x04a4('0xf9')]][_0x04a4('0xc6')]]);hopperUtils['rescheduleContact']({'active':![],'ContactId':this[_0x04a4('0x27')][_0xa50de1[_0x04a4('0xf9')]][_0x04a4('0xe6')],'ListId':this[_0x04a4('0x27')][_0xa50de1[_0x04a4('0xf9')]][_0x04a4('0x106')],'VoiceQueueId':this[_0x04a4('0x27')][_0xa50de1['actionid']][_0x04a4('0xe7')]||undefined,'CampaignId':this[_0x04a4('0x27')][_0xa50de1[_0x04a4('0xf9')]][_0x04a4('0xe8')]||undefined})[_0x04a4('0xa9')](loggerCatch('[unlock3][syncQueueStatusComplete]'));delete this[_0x04a4('0x27')][_0xa50de1[_0x04a4('0xf9')]];unlockQueueStatus(_0x5809eb);}};Dialer[_0x04a4('0x1d')][_0x04a4('0x32')]=function(_0x32bd50){var _0x3ed54c=this[_0x04a4('0x27')][_0x32bd50[_0x04a4('0xf9')]];if(_0x3ed54c){delete this[_0x04a4('0x27')][_0x32bd50['actionid']];_0x3ed54c[_0x04a4('0xd3')]=moment()[_0x04a4('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');var _0x2b7099=_0x3ed54c[_0x04a4('0x45')]===_0x04a4('0xcb')?this['campaigns'][_0x3ed54c['queue']]:this[_0x04a4('0xc9')][_0x3ed54c[_0x04a4('0x10f')]()];if(_0x32bd50[_0x04a4('0x110')]!=='Success'){this[_0x04a4('0xc8')](_0x2b7099);return this['callProgressDetecting'](_0x3ed54c,_0x2b7099,_0x32bd50)['catch'](loggerCatch('[callProgressDetecting]\x20'));}this[_0x04a4('0x28')][_0x32bd50[_0x04a4('0xc7')]]=_0x3ed54c;}};Dialer[_0x04a4('0x1d')][_0x04a4('0x111')]=function(_0x9f7d01){var _0x48bf40=this;var _0x39d98d=this[_0x04a4('0x28')][_0x9f7d01[_0x04a4('0xc7')]];var _0x3e0af6;if(!_[_0x04a4('0xfd')](_0x9f7d01)&&!_[_0x04a4('0xfd')](_0x9f7d01[_0x04a4('0x112')])&&!_[_0x04a4('0xfd')](_0x9f7d01['variable'][_0x04a4('0x113')])&&_0x9f7d01[_0x04a4('0x114')]===_0x04a4('0x115')&&_0x39d98d){if(_0x39d98d[_0x04a4('0x45')]!==_0x04a4('0xcb')&&this['voiceQueues'][_0x39d98d['queue']][_0x04a4('0x116')]&&_0x9f7d01[_0x04a4('0x117')]===_0x04a4('0x118')){delete this[_0x04a4('0x28')][_0x9f7d01[_0x04a4('0xc7')]];this[_0x04a4('0xc8')](this[_0x04a4('0xc9')][_0x39d98d[_0x04a4('0xc6')]]);this[_0x04a4('0xc9')][_0x39d98d[_0x04a4('0xc6')]][_0x04a4('0xcc')]+=0x1;this['voiceQueues'][_0x39d98d[_0x04a4('0xc6')]][_0x04a4('0x119')]+=0x1;_0x3e0af6=new Hangup(_0x39d98d,_0x9f7d01);_0x3e0af6[_0x04a4('0x73')]=0x12;_0x3e0af6['statedesc']='HangupInAMD';_0x3e0af6[_0x04a4('0x11a')]=_0x04a4('0x11b');ami[_0x04a4('0x44')](_0x04a4('0x11c'),ut[_0x04a4('0x11d')](_0x3e0af6,'amd'));this['saveInDb'](_0x3e0af6,_0x04a4('0x11e'),'[syncHangupInAMD]');}if(_0x39d98d[_0x04a4('0x45')]!=='ivr'&&this[_0x04a4('0xc9')][_0x39d98d[_0x04a4('0xc6')]][_0x04a4('0x116')]&&_0x9f7d01[_0x04a4('0x117')]===_0x04a4('0x11f')){return new Promise(function(_0x3445b4,_0x2c4651){delete _0x48bf40[_0x04a4('0x28')][_0x9f7d01[_0x04a4('0xc7')]];_0x48bf40['updateOriginated'](_0x48bf40[_0x04a4('0xc9')][_0x39d98d[_0x04a4('0xc6')]]);_0x48bf40['voiceQueues'][_0x39d98d[_0x04a4('0xc6')]][_0x04a4('0xcc')]+=0x1;_0x48bf40[_0x04a4('0xc9')][_0x39d98d[_0x04a4('0xc6')]][_0x04a4('0x119')]+=0x1;var _0x43a1a2=_0x48bf40[_0x04a4('0xc9')][_0x39d98d[_0x04a4('0xc6')]];var _0xae9315=new Hangup(_0x39d98d,_0x9f7d01);_0xae9315['state']=0x13;_0xae9315[_0x04a4('0x74')]=_0x04a4('0x120');_0xae9315[_0x04a4('0x11a')]='AMD';_0xae9315[_0x04a4('0x121')]+=0x1;_0xae9315[_0x04a4('0xdc')]+=0x1;_0xae9315[_0x04a4('0x122')]=!![];ami[_0x04a4('0x44')](_0x04a4('0x11c'),ut[_0x04a4('0x11d')](_0xae9315,'amd'));hopperUtils[_0x04a4('0xd0')](_0xae9315)[_0x04a4('0xa9')](loggerCatch(_0x04a4('0x123')));if(_0xae9315[_0x04a4('0x124')]+_0xae9315[_0x04a4('0x125')]+_0xae9315[_0x04a4('0x126')]+_0xae9315['countnosuchnumberretry']+_0xae9315[_0x04a4('0xdb')]+_0xae9315['countabandonedretry']+_0xae9315[_0x04a4('0x121')]+_0xae9315[_0x04a4('0x127')]>=_0x43a1a2[_0x04a4('0x128')]){_0x48bf40['stateGlobal'](_0xae9315,_0x3445b4,_0x2c4651,_0x04a4('0x129'));}else{if(_0xae9315[_0x04a4('0x121')]>=_0x43a1a2['dialMachineMaxRetry']){_0x48bf40[_0x04a4('0x12a')](_0xae9315,_0x3445b4,_0x2c4651,'reason\x2019\x20machine....');}else{hopperUtils[_0x04a4('0xe3')]({'active':![],'countmachineretry':_0xae9315['countmachineretry'],'scheduledat':moment()['add'](_0x43a1a2[_0x04a4('0x12b')],_0x04a4('0xe5'))['format'](_0x04a4('0xca')),'ContactId':_0xae9315[_0x04a4('0xe6')],'ListId':_0xae9315[_0x04a4('0x106')],'VoiceQueueId':_0xae9315['VoiceQueueId']||undefined,'CampaignId':_0xae9315['CampaignId']||undefined})['catch'](loggerCatch(_0x04a4('0x12c')));_0x3445b4({'reschedule':0x1});}}});}if(_0x39d98d[_0x04a4('0x45')]==='ivr'&&this[_0x04a4('0x22')][_0x39d98d[_0x04a4('0xc6')]]['dialAMDActive']&&_0x9f7d01[_0x04a4('0x117')]==='HANGUP'){delete this[_0x04a4('0x28')][_0x9f7d01[_0x04a4('0xc7')]];this[_0x04a4('0xc8')](this[_0x04a4('0x22')][_0x39d98d[_0x04a4('0xc6')]]);_0x3e0af6=new Hangup(_0x39d98d,_0x9f7d01);_0x3e0af6[_0x04a4('0x73')]=0x12;_0x3e0af6[_0x04a4('0x74')]=_0x04a4('0x12d');_0x3e0af6[_0x04a4('0x11a')]=_0x04a4('0x11b');ami[_0x04a4('0x44')](_0x04a4('0x11c'),ut[_0x04a4('0x11d')](_0x3e0af6,_0x04a4('0x122')));this[_0x04a4('0x12e')](_0x3e0af6,_0x04a4('0x12f'),'[syncHangupInAMDIvr]');}if(_0x39d98d[_0x04a4('0x45')]==='ivr'&&this[_0x04a4('0x22')][_0x39d98d[_0x04a4('0xc6')]]['dialAMDActive']&&_0x9f7d01['value']===_0x04a4('0x11f')){return new Promise(function(_0x360f0c,_0x28ae92){delete _0x48bf40['uniqueId'][_0x9f7d01[_0x04a4('0xc7')]];_0x48bf40[_0x04a4('0xc8')](_0x48bf40[_0x04a4('0x22')][_0x39d98d[_0x04a4('0xc6')]]);_0x48bf40[_0x04a4('0x22')][_0x39d98d[_0x04a4('0xc6')]][_0x04a4('0xcc')]+=0x1;_0x48bf40['campaigns'][_0x39d98d[_0x04a4('0xc6')]][_0x04a4('0x119')]+=0x1;var _0x410335=_0x48bf40[_0x04a4('0x22')][_0x39d98d[_0x04a4('0xc6')]];var _0x208b79=new Hangup(_0x39d98d,_0x9f7d01);_0x208b79[_0x04a4('0x73')]=0x13;_0x208b79[_0x04a4('0x74')]=_0x04a4('0x120');_0x208b79[_0x04a4('0x11a')]=_0x04a4('0x11b');_0x208b79[_0x04a4('0x121')]+=0x1;_0x208b79[_0x04a4('0xdc')]+=0x1;_0x208b79[_0x04a4('0x122')]=!![];ami[_0x04a4('0x44')](_0x04a4('0x11c'),ut['buildObj'](_0x208b79,_0x04a4('0x122')));hopperUtils[_0x04a4('0xd0')](_0x208b79)[_0x04a4('0xa9')](loggerCatch(_0x04a4('0x123')));if(_0x208b79['countbusyretry']+_0x208b79[_0x04a4('0x125')]+_0x208b79[_0x04a4('0x126')]+_0x208b79[_0x04a4('0x130')]+_0x208b79[_0x04a4('0xdb')]+_0x208b79[_0x04a4('0xf1')]+_0x208b79[_0x04a4('0x121')]+_0x208b79['countagentrejectretry']>=_0x410335[_0x04a4('0x128')]){_0x48bf40[_0x04a4('0x131')](_0x208b79,_0x360f0c,_0x28ae92,'reason19\x20machine....');}else{if(_0x208b79[_0x04a4('0x121')]>=_0x410335[_0x04a4('0x132')]){_0x48bf40['createStateFinal'](_0x208b79,_0x360f0c,_0x28ae92,'reason\x2019\x20machine....');}else{hopperUtils[_0x04a4('0xe3')]({'active':![],'countmachineretry':_0x208b79[_0x04a4('0x121')],'scheduledat':moment()[_0x04a4('0xe4')](_0x410335[_0x04a4('0x12b')],_0x04a4('0xe5'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x208b79[_0x04a4('0xe6')],'ListId':_0x208b79[_0x04a4('0x106')],'VoiceQueueId':_0x208b79['VoiceQueueId']||undefined,'CampaignId':_0x208b79[_0x04a4('0xe8')]||undefined})['catch'](loggerCatch(_0x04a4('0x12c')));_0x360f0c({'reschedule':0x1});}}});}}};Dialer['prototype'][_0x04a4('0x38')]=function(_0x2f5034){var _0x45eb61=this['uniqueId'][_0x2f5034[_0x04a4('0xc7')]];var _0x27fc47;if(_0x45eb61&&_0x45eb61[_0x04a4('0x45')]==='ivr'){delete this[_0x04a4('0x28')][_0x2f5034[_0x04a4('0xc7')]];this[_0x04a4('0xc8')](this['campaigns'][_0x45eb61[_0x04a4('0xc6')]]);this['campaigns'][_0x45eb61[_0x04a4('0xc6')]][_0x04a4('0x133')]+=0x1;_0x27fc47=new Hangup(_0x45eb61,_0x2f5034);hopperUtils[_0x04a4('0xd0')](_0x27fc47)[_0x04a4('0xa9')](loggerCatch(_0x04a4('0x134')));hopperUtils[_0x04a4('0xd1')](_0x27fc47)[_0x04a4('0xa9')](loggerCatch(_0x04a4('0x135')));}if(_0x45eb61&&_0x45eb61[_0x04a4('0x45')]!==_0x04a4('0xcb')&&isNotNull(this[_0x04a4('0xc9')][_0x45eb61[_0x04a4('0xc6')]][_0x04a4('0x136')])){delete this[_0x04a4('0x28')][_0x2f5034[_0x04a4('0xc7')]];this[_0x04a4('0xc8')](this['voiceQueues'][_0x45eb61[_0x04a4('0xc6')]]);this[_0x04a4('0xc9')][_0x45eb61[_0x04a4('0xc6')]]['outboundAnswerCallsDay']+=0x1;this[_0x04a4('0xc9')][_0x45eb61[_0x04a4('0xc6')]][_0x04a4('0x119')]+=0x1;_0x27fc47=new Hangup(_0x45eb61,_0x2f5034);_0x27fc47['state']=0x10;_0x27fc47[_0x04a4('0x74')]='AnswerAGI';_0x27fc47[_0x04a4('0x11a')]='AGI';hopperUtils[_0x04a4('0xd0')](_0x27fc47)[_0x04a4('0xa9')](loggerCatch(_0x04a4('0x134')));hopperUtils[_0x04a4('0xd1')](_0x27fc47)[_0x04a4('0xa9')](loggerCatch(_0x04a4('0x135')));}if(_0x45eb61&&_0x45eb61[_0x04a4('0x45')]!==_0x04a4('0xcb')&&!isNotNull(this[_0x04a4('0xc9')][_0x45eb61[_0x04a4('0xc6')]][_0x04a4('0x136')])){delete this[_0x04a4('0x28')][_0x2f5034[_0x04a4('0xc7')]];this[_0x04a4('0xc8')](this['voiceQueues'][_0x45eb61['queue']]);this[_0x04a4('0xc9')][_0x45eb61[_0x04a4('0xc6')]][_0x04a4('0x137')]+=0x1;_0x27fc47=new Hangup(_0x45eb61,_0x2f5034);_0x27fc47[_0x04a4('0x73')]=0xc;_0x27fc47['statedesc']=_0x2f5034['cause-txt'];_0x27fc47[_0x04a4('0x11a')]=_0x04a4('0x138');hopperUtils[_0x04a4('0xd0')](_0x27fc47)['catch'](loggerCatch(_0x04a4('0x134')));hopperUtils[_0x04a4('0xd1')](_0x27fc47)[_0x04a4('0xa9')](loggerCatch(_0x04a4('0x135')));}};Dialer[_0x04a4('0x1d')]['syncQueueSummary']=function(_0x195635){var _0x330bb3=this;if(!_0x330bb3[_0x04a4('0x2c')][_0x195635[_0x04a4('0x63')]]){_0x330bb3[_0x04a4('0x2c')][_0x195635[_0x04a4('0x63')]]={'running':![]};}else if(_0x330bb3[_0x04a4('0x2c')][_0x195635[_0x04a4('0x63')]][_0x04a4('0x139')]===!![]){return;}else if(_0x330bb3[_0x04a4('0x2c')][_0x195635[_0x04a4('0x63')]][_0x04a4('0x139')]===![]){_0x330bb3[_0x04a4('0x2c')][_0x195635['name']]['running']=!![];}var _0x445ae0=_0x330bb3['voiceQueues'][_0x195635[_0x04a4('0x63')]];var _0x23aec7=_0x445ae0[_0x04a4('0x70')]!==utils['CAMPAIGN_STATUS'][_0x04a4('0x82')];var _0x4d98c5=utils[_0x04a4('0x13a')](_0x445ae0);_0x445ae0[_0x04a4('0x13b')]=utils[_0x04a4('0x13c')](_0x445ae0,_0x330bb3[_0x04a4('0x24')]);Promise[_0x04a4('0xb1')]()[_0x04a4('0x41')](function(){if(_0x445ae0[_0x04a4('0x13b')]===utils[_0x04a4('0x6c')][_0x04a4('0x82')]){if(_0x23aec7){clearPredictiveAttributes(_0x445ae0);_0x195635['startPredictive']=undefined;_0x195635[_0x04a4('0x29')]=undefined;}if(_0x445ae0[_0x04a4('0x13b')]===utils['CAMPAIGN_STATUS'][_0x04a4('0x82')]){_0x195635['available']=0x0;_0x195635[_0x04a4('0xff')]=0x0;_0x195635['inUse']=0x0;_0x195635[_0x04a4('0x13d')]=0x0;_0x195635['pTalking']=0x0;}}else if(_0x445ae0[_0x04a4('0x13b')]===utils[_0x04a4('0x6c')][_0x04a4('0x13e')]&&!_0x4d98c5){return _0x330bb3['ifTime'](_0x445ae0,!![])['then'](function(){return _0x330bb3['ifTime'](_0x445ae0,![]);})['then'](function(){return _0x330bb3[_0x04a4('0xb7')](_0x445ae0);})['catch'](function(_0x28031e){loggerSyncQueueSummary[_0x04a4('0x47')](_0x04a4('0x13f'),util[_0x04a4('0x49')](_0x28031e,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x445ae0);});}else{clearPredictiveAttributes(_0x445ae0);}})[_0x04a4('0x41')](function(){var _0x24ccb1=_0x195635[_0x04a4('0x140')](_0x445ae0);if(_0x24ccb1||_0x445ae0['queueSummaryCountersUpdated']){_0x445ae0['queueSummaryCountersUpdated']=![];_0x195635[_0x04a4('0x141')](_0x445ae0);Object[_0x04a4('0x142')](_0x445ae0,_0x195635);emitOutboundVoiceQueueSummary(_0x195635);}_0x330bb3[_0x04a4('0x2c')][_0x445ae0['name']][_0x04a4('0x139')]=![];})['catch'](function(_0x3a976b){logger[_0x04a4('0x67')](_0x04a4('0x13f'),util['inspect'](_0x3a976b,{'showHidden':![],'depth':null}));_0x330bb3[_0x04a4('0x2c')][_0x445ae0[_0x04a4('0x63')]][_0x04a4('0x139')]=![];});};Dialer[_0x04a4('0x1d')]['syncQueueSummaryComplete']=_['throttle'](function(){var _0x23f080=_[_0x04a4('0x143')](this[_0x04a4('0xc9')],function(_0x3fa425){return _0x3fa425[_0x04a4('0x144')];});var _0x1c0e54=_[_0x04a4('0x143')](this[_0x04a4('0x23')],function(_0x10e1e1){return _0x10e1e1[_0x04a4('0x145')]&&_0x10e1e1[_0x04a4('0x90')]==='reachable';});if(_0x23f080[_0x04a4('0xa1')]>0x0&&_0x1c0e54[_0x04a4('0xa1')]>0x0){return Promise['resolve']()['then'](cmHopper[_0x04a4('0x146')](_['map'](_0x23f080,'id'),previewRecallmeReminderInterval,_[_0x04a4('0x147')](_0x1c0e54,'id')))[_0x04a4('0x41')](function(_0x26d558){for(var _0x5c8057=0x0;_0x5c8057<_0x26d558[_0x04a4('0xa1')];_0x5c8057++){var _0x4d9246=_0x26d558[_0x5c8057]['Agent'][_0x04a4('0x63')];if(_0x4d9246)io['to'](util[_0x04a4('0x4a')](_0x04a4('0x148'),_0x4d9246))[_0x04a4('0x44')](_0x04a4('0x149'),{'hopper':_0x26d558[_0x5c8057]});}})[_0x04a4('0xa9')](function(_0x1c2165){logger['error']('checkPreviewRecallReminder',_0x1c2165);});}},0x3c*0x3e8,{'leading':!![]});Dialer['prototype']['loopClearZombieChannels']=function(){var _0x35fead=this;setInterval(function(){_0x35fead['clearZombieChannels'](_0x35fead[_0x04a4('0x28')],'[uniqueid]');_0x35fead[_0x04a4('0x14a')](_0x35fead[_0x04a4('0x27')],_0x04a4('0x14b'));},0x32c8);};Dialer[_0x04a4('0x1d')]['clearZombieChannels']=function(_0x1afc47,_0x588936){var _0x9110f2=this;for(var _0x22ccea in _0x1afc47){if(typeof _0x1afc47[_0x22ccea]!==_0x04a4('0xb0')){this[_0x04a4('0x21')]['enqueue'](function(){if(!_['isNil'](_0x1afc47[_0x22ccea])){return ami['Action']({'action':_0x04a4('0x90'),'channel':_0x1afc47[_0x22ccea][_0x04a4('0xf8')]})[_0x04a4('0xa9')](function(_0x514b8f){if(_0x514b8f[_0x04a4('0x70')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x1afc47[_0x22ccea]&&_0x1afc47[_0x22ccea][_0x04a4('0x45')]!=='ivr'){_0x9110f2[_0x04a4('0xc8')](_0x9110f2['voiceQueues'][_0x1afc47[_0x22ccea][_0x04a4('0xc6')]]);logger[_0x04a4('0x67')]('[Dialer][checkChannel]',_0x588936,_0x22ccea,_0x1afc47[_0x22ccea][_0x04a4('0xc6')]);delete _0x1afc47[_0x22ccea];}if(_0x1afc47[_0x22ccea]&&_0x1afc47[_0x22ccea]['type']===_0x04a4('0xcb')){_0x9110f2[_0x04a4('0xc8')](_0x9110f2[_0x04a4('0x22')][_0x1afc47[_0x22ccea][_0x04a4('0xc6')]]);logger[_0x04a4('0x67')](_0x04a4('0x14c'),_0x588936,_0x22ccea,_0x1afc47[_0x22ccea][_0x04a4('0xc6')]);delete _0x1afc47[_0x22ccea];}},0x2328);}});}});}}};Dialer['prototype']['getVoiceQueueRtPauses']=function(_0x2839b3){return Promise[_0x04a4('0xb1')]()[_0x04a4('0x41')](voiceQueueRt['getVoiceQueueRtPauses'](_0x2839b3))[_0x04a4('0xa9')](loggerCatch(_0x04a4('0x14d')));};Dialer['prototype'][_0x04a4('0xc8')]=function(_0x30fe4c){if(!_['isUndefined'](_0x30fe4c)&&_0x30fe4c!==null){if(typeof _0x30fe4c[_0x04a4('0x14e')]!==_0x04a4('0xb0')){if(_0x30fe4c[_0x04a4('0x14e')]>0x0){_0x30fe4c[_0x04a4('0x14e')]-=0x1;}else{logger['error'](_0x04a4('0x14f'));}}}else{logger[_0x04a4('0x67')](_0x04a4('0x150'));}};Dialer['prototype'][_0x04a4('0x151')]=function(_0x1a671a,_0x1bb315){var _0xacec49=this;return function(_0x656057){_0xacec49[_0x04a4('0xc8')](_0x1bb315);logger[_0x04a4('0x67')](_0x1a671a,util[_0x04a4('0x49')](_0x656057,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0x04a4('0x152')]=function(_0x307790,_0x29dee3,_0x1a0643){var _0x4e1c57={'state':0x19,'statedesc':_0x04a4('0x153')};this[_0x04a4('0xc8')](_0x29dee3);this[_0x04a4('0x12e')](_[_0x04a4('0x5f')](_0x4e1c57,_[_0x04a4('0x7b')](_0x1a0643,[_0x04a4('0xe6'),'ListId',_0x04a4('0x154'),_0x04a4('0xe7'),_0x04a4('0xe8')])),'[emptyContact][createHistory]',_0x04a4('0x155'));logger[_0x04a4('0x67')](_0x307790);};Dialer['prototype']['saveInDb']=function(_0x17f1d6,_0x3ed28a,_0x4029da){hopperUtils[_0x04a4('0xd0')](_0x17f1d6)[_0x04a4('0xa9')](loggerCatch(_0x3ed28a));hopperUtils[_0x04a4('0xd1')](_0x17f1d6)[_0x04a4('0xa9')](loggerCatch(_0x4029da));};Dialer[_0x04a4('0x1d')][_0x04a4('0xe2')]=function(_0xfd21ff,_0x5a5a1f){hopperUtils[_0x04a4('0xd0')](_0xfd21ff)[_0x04a4('0xa9')](loggerCatch(_0x04a4('0x156')));if(_0x5a5a1f==0x0){hopperUtils[_0x04a4('0xd1')](_0xfd21ff)[_0x04a4('0xa9')](loggerCatch(_0x04a4('0x157')));}};Dialer[_0x04a4('0x1d')][_0x04a4('0x158')]=function(_0x7bf9e6){return Promise[_0x04a4('0xb1')]()[_0x04a4('0x41')](cmHopper[_0x04a4('0x146')](_0x7bf9e6['id'],previewRecallmeReminderInterval))[_0x04a4('0x41')](function(_0x40c4d4){for(var _0x5aa167=0x0;_0x5aa167<_0x40c4d4[_0x04a4('0xa1')];_0x5aa167++){var _0x119ae6=_0x40c4d4[_0x5aa167]['Agent'][_0x04a4('0x63')];if(_0x119ae6)io['to'](util[_0x04a4('0x4a')](_0x04a4('0x148'),_0x119ae6))[_0x04a4('0x44')]('user:dialPreviewRecallReminder',{'hopper':_0x40c4d4[_0x5aa167]});}})[_0x04a4('0xa9')](function(){});};Dialer[_0x04a4('0x1d')][_0x04a4('0xb5')]=function(_0x4ebb54){var _0x2eaf9f=this;return function(){_0x2eaf9f[_0x04a4('0x159')](_0x4ebb54);};};Dialer[_0x04a4('0x1d')][_0x04a4('0x15a')]=function(_0x13de28,_0x3da590){var _0x1add3a=this;var _0x42f4ab=uuid['v4']();this[_0x04a4('0x27')][_0x42f4ab]=new Action(_0x13de28,_0x3da590,_0x42f4ab);return new Promise(function(_0x1bdf62,_0x4b9c01){if(_[_0x04a4('0x43')](_0x13de28)&&typeof _0x13de28!==_0x04a4('0x15b')){return _0x4b9c01(msgResponse('originate','Failure','voiceQueue\x20is\x20undefine'));}if(_['isUndefined'](_0x3da590[_0x04a4('0x15c')])||_0x3da590[_0x04a4('0x15c')]===null){return _0x4b9c01(msgResponse('originate',_0x04a4('0x99'),_0x04a4('0x15d')));}var _0x3847a1={'XMD-CALLERID':_0x1add3a[_0x04a4('0x27')][_0x42f4ab]['getCaller'](),'XMD-AGI':_0x13de28[_0x04a4('0x136')]?util[_0x04a4('0x4a')](_0x04a4('0x15e'),ipAgi,_0x13de28[_0x04a4('0x136')]):'NONE','XMD-AGIAFTER':_0x13de28[_0x04a4('0xce')]?util[_0x04a4('0x4a')](_0x04a4('0x15e'),ipAgi,_0x13de28[_0x04a4('0xce')]):'NONE','XMD-QUEUE':utils[_0x04a4('0x15f')](_0x13de28)?util[_0x04a4('0x4a')](_0x04a4('0x160'),_0x13de28[_0x04a4('0x63')],_0x13de28['dialQueueOptions']||'',_0x13de28[_0x04a4('0xcf')]?'c':'',_0x13de28[_0x04a4('0xd4')]||0x3):_0x04a4('0x161'),'XMD-CONTACTID':_0x3da590[_0x04a4('0xe6')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x1add3a[_0x04a4('0x27')][_0x42f4ab][_0x04a4('0x162')](),'XMD-AMD':_0x13de28[_0x04a4('0x116')]?_0x04a4('0x13e'):'NONE','XMD-DESTINATION':_0x04a4('0x115')};if(_0x13de28['dialAMDActive']){_0x3847a1[_0x04a4('0x163')]=_0x13de28[_0x04a4('0x164')]||0x9c4;_0x3847a1[_0x04a4('0x165')]=_0x13de28['dialAMDGreeting']||0x5dc;_0x3847a1[_0x04a4('0x166')]=_0x13de28[_0x04a4('0x167')]||0x320;_0x3847a1[_0x04a4('0x168')]=_0x13de28['dialAMDTotalAnalysisTime']||0x1388;_0x3847a1[_0x04a4('0x169')]=_0x13de28[_0x04a4('0x16a')]||0x64;_0x3847a1['XMD-AMDBETWEENWORDSSILENCE']=_0x13de28[_0x04a4('0x16b')]||0x32;_0x3847a1[_0x04a4('0x16c')]=_0x13de28['dialAMDMaximumNumberOfWords']||0x3;_0x3847a1[_0x04a4('0x16d')]=_0x13de28[_0x04a4('0x16e')]||0x100;_0x3847a1['XMD-AMDMAXIMUMWORDLENGTH']=_0x13de28[_0x04a4('0x16f')]||0x1388;}if(utils[_0x04a4('0x15f')](_0x13de28)){_0x3847a1[_0x04a4('0x170')]=_0x3da590['VoiceQueueId'];}else{_0x3847a1[_0x04a4('0x171')]=_0x3da590['CampaignId'];}var _0x315068=utils[_0x04a4('0x172')](_0x3da590[_0x04a4('0x173')]);Object[_0x04a4('0x142')](_0x3847a1,_0x315068);var _0x2e7c44=_0x1add3a['isTrunkReachable'](_0x13de28['Trunk'])?utils[_0x04a4('0x174')](_0x13de28[_0x04a4('0x94')]['callerid'],_0x13de28[_0x04a4('0x175')],_0x13de28[_0x04a4('0x176')]>0x0?utils[_0x04a4('0x177')](_0x13de28['dialOriginateCallerIdNumber'],_0x13de28[_0x04a4('0x176')]):_0x13de28[_0x04a4('0x178')]):utils[_0x04a4('0x174')](_[_0x04a4('0xfd')](_0x13de28['TrunkBackup'])?_0x13de28[_0x04a4('0x94')][_0x04a4('0x179')]:_0x13de28['TrunkBackup'][_0x04a4('0x179')],_0x13de28[_0x04a4('0x175')],_0x13de28[_0x04a4('0x176')]>0x0?utils[_0x04a4('0x177')](_0x13de28[_0x04a4('0x178')],_0x13de28[_0x04a4('0x176')]):_0x13de28['dialOriginateCallerIdNumber']);if(_0x2e7c44){_0x3847a1[_0x04a4('0x17a')]=_0x1add3a[_0x04a4('0x27')][_0x42f4ab][_0x04a4('0x17b')]=utils[_0x04a4('0x17c')](_0x2e7c44);_0x3847a1[_0x04a4('0x17d')]=_0x3da590['phone'];}_0x13de28[_0x04a4('0x17e')]=_0x3847a1;return ami['Action']({'actionid':_0x42f4ab,'action':_0x04a4('0x17f'),'channel':_0x1add3a[_0x04a4('0x8e')](_0x13de28[_0x04a4('0x94')])?util[_0x04a4('0x4a')]('SIP/%s/%s%s',_0x13de28['Trunk'][_0x04a4('0x63')],isNotNull(_0x13de28[_0x04a4('0x180')])?_0x13de28[_0x04a4('0x180')][_0x04a4('0x181')]()||'':'',_0x13de28[_0x04a4('0x182')]>0x0?_0x3da590[_0x04a4('0x15c')][_0x04a4('0x183')](_0x13de28[_0x04a4('0x182')]):_0x3da590[_0x04a4('0x15c')]):util[_0x04a4('0x4a')]('SIP/%s/%s%s',_[_0x04a4('0xfd')](_0x13de28[_0x04a4('0x95')])?_0x13de28['Trunk'][_0x04a4('0x63')]:_0x13de28[_0x04a4('0x95')][_0x04a4('0x63')],isNotNull(_0x13de28[_0x04a4('0x180')])?_0x13de28[_0x04a4('0x180')]['trim']()||'':'',_0x13de28[_0x04a4('0x182')]>0x0?_0x3da590[_0x04a4('0x15c')]['substring'](_0x13de28[_0x04a4('0x182')]):_0x3da590[_0x04a4('0x15c')]),'callerid':_0x2e7c44,'Exten':_0x04a4('0x115'),'Context':'from-sip','Priority':'1','variable':_0x3847a1,'timeout':(_0x13de28[_0x04a4('0x184')]||0x1e)*0x3e8,'async':!![],'channelid':_0x42f4ab})['then'](function(_0x3b7224){return _0x1bdf62(_0x3b7224);})[_0x04a4('0xa9')](function(_0x1d9b9a){_0x13de28[_0x04a4('0x185')]+=0x1;var _0xd19739=new History(_0x1add3a[_0x04a4('0x27')][_0x42f4ab]);logger[_0x04a4('0x67')](util[_0x04a4('0x4a')]('[originateError]:\x20%s',JSON[_0x04a4('0x7a')](_0x1d9b9a)));_0xd19739[_0x04a4('0x73')]=0xe;_0xd19739[_0x04a4('0x74')]='OriginateError';_0xd19739[_0x04a4('0x76')]=moment()[_0x04a4('0x4a')](_0x04a4('0xca'));_0xd19739[_0x04a4('0x75')]=_0xd19739['starttime'];hopperUtils[_0x04a4('0xd0')](_0xd19739)['catch'](loggerCatch(_0x04a4('0x186')));_0x1add3a[_0x04a4('0xd1')](_0xd19739)[_0x04a4('0xa9')](loggerCatch('[originate][error]'))[_0x04a4('0x20')](function(){delete _0x1add3a[_0x04a4('0x27')][_0x42f4ab];return _0x4b9c01(msgResponse(_0x04a4('0x17f'),_0x04a4('0x8d'),_0x04a4('0x187')));});});});};Dialer[_0x04a4('0x1d')][_0x04a4('0x188')]=function(_0x2cdd7a,_0x28ebca,_0x172a06){var _0x5dc186=new History(_0x28ebca);if(_0x5dc186[_0x04a4('0x124')]+_0x5dc186[_0x04a4('0x125')]+_0x5dc186[_0x04a4('0x126')]+_0x5dc186[_0x04a4('0x130')]+_0x5dc186[_0x04a4('0xdb')]+_0x5dc186['countabandonedretry']+_0x5dc186[_0x04a4('0x121')]+_0x5dc186[_0x04a4('0x127')]>=_0x172a06[_0x04a4('0x128')]-0x1){return!![];}switch(_0x2cdd7a){case 0x3:if(_0x5dc186[_0x04a4('0x126')]>=_0x172a06[_0x04a4('0x189')]-0x1){return!![];}hopperUtils[_0x04a4('0xe3')]({'active':![],'countnoanswerretry':_0x5dc186[_0x04a4('0x126')]+=0x1,'scheduledat':moment()[_0x04a4('0xe4')](_0x172a06[_0x04a4('0x18a')],_0x04a4('0xe5'))[_0x04a4('0x4a')](_0x04a4('0xca')),'ContactId':_0x5dc186[_0x04a4('0xe6')],'ListId':_0x5dc186[_0x04a4('0x106')],'VoiceQueueId':_0x5dc186[_0x04a4('0xe7')]||undefined,'CampaignId':_0x5dc186[_0x04a4('0xe8')]||undefined})['catch'](loggerCatch(_0x04a4('0x18b')));break;case 0x5:if(_0x5dc186[_0x04a4('0x124')]>=_0x172a06[_0x04a4('0x18c')]-0x1){return!![];}hopperUtils[_0x04a4('0xe3')]({'active':![],'countbusyretry':_0x5dc186[_0x04a4('0x124')]+=0x1,'scheduledat':moment()[_0x04a4('0xe4')](_0x172a06['dialBusyRetryFrequency'],_0x04a4('0xe5'))[_0x04a4('0x4a')](_0x04a4('0xca')),'ContactId':_0x5dc186[_0x04a4('0xe6')],'ListId':_0x5dc186[_0x04a4('0x106')],'VoiceQueueId':_0x5dc186[_0x04a4('0xe7')]||undefined,'CampaignId':_0x5dc186[_0x04a4('0xe8')]||undefined})[_0x04a4('0xa9')](loggerCatch(_0x04a4('0x18d')));break;case 0x8:if(_0x5dc186[_0x04a4('0x125')]>=_0x172a06[_0x04a4('0x18e')]-0x1){return!![];}hopperUtils[_0x04a4('0xe3')]({'active':![],'countcongestionretry':_0x5dc186[_0x04a4('0x125')]+=0x1,'scheduledat':moment()[_0x04a4('0xe4')](_0x172a06[_0x04a4('0x18f')],_0x04a4('0xe5'))[_0x04a4('0x4a')](_0x04a4('0xca')),'ContactId':_0x5dc186['ContactId'],'ListId':_0x5dc186[_0x04a4('0x106')],'VoiceQueueId':_0x5dc186[_0x04a4('0xe7')]||undefined,'CampaignId':_0x5dc186[_0x04a4('0xe8')]||undefined})[_0x04a4('0xa9')](loggerCatch(_0x04a4('0x190')));break;case 0x0:if(_0x5dc186[_0x04a4('0x130')]>=_0x172a06['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{hopperUtils[_0x04a4('0xe3')]({'active':![],'countnosuchnumberretry':_0x5dc186[_0x04a4('0x130')]+=0x1,'scheduledat':moment()['add'](_0x172a06[_0x04a4('0x191')],_0x04a4('0xe5'))[_0x04a4('0x4a')](_0x04a4('0xca')),'ContactId':_0x5dc186['ContactId'],'ListId':_0x5dc186[_0x04a4('0x106')],'VoiceQueueId':_0x5dc186[_0x04a4('0xe7')]||undefined,'CampaignId':_0x5dc186['CampaignId']||undefined})[_0x04a4('0xa9')](loggerCatch(_0x04a4('0x192')));}break;case 0xa:if(_0x5dc186['countdropretry']>=_0x172a06[_0x04a4('0xe1')]-0x1){return!![];}hopperUtils[_0x04a4('0xe3')]({'active':![],'countdropretry':_0x5dc186[_0x04a4('0xdb')]+=0x1,'scheduledat':moment()[_0x04a4('0xe4')](_0x172a06[_0x04a4('0xdd')],_0x04a4('0xe5'))[_0x04a4('0x4a')](_0x04a4('0xca')),'ContactId':_0x5dc186[_0x04a4('0xe6')],'ListId':_0x5dc186[_0x04a4('0x106')],'VoiceQueueId':_0x5dc186[_0x04a4('0xe7')]||undefined,'CampaignId':_0x5dc186[_0x04a4('0xe8')]||undefined})[_0x04a4('0xa9')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x5dc186[_0x04a4('0xf1')]>=_0x172a06[_0x04a4('0xf4')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x5dc186[_0x04a4('0xf1')]+=0x1,'scheduledat':moment()[_0x04a4('0xe4')](_0x172a06[_0x04a4('0xf2')],_0x04a4('0xe5'))[_0x04a4('0x4a')](_0x04a4('0xca')),'ContactId':_0x5dc186[_0x04a4('0xe6')],'ListId':_0x5dc186[_0x04a4('0x106')],'VoiceQueueId':_0x5dc186['VoiceQueueId']||undefined,'CampaignId':_0x5dc186['CampaignId']||undefined})['catch'](loggerCatch(_0x04a4('0xf5')));break;case 0x13:if(_0x5dc186['countmachineretry']>=_0x172a06['dialMachineMaxRetry']-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x5dc186['countmachineretry']+=0x1,'scheduledat':moment()[_0x04a4('0xe4')](_0x172a06[_0x04a4('0x12b')],_0x04a4('0xe5'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5dc186[_0x04a4('0xe6')],'ListId':_0x5dc186[_0x04a4('0x106')],'VoiceQueueId':_0x5dc186['VoiceQueueId']||undefined,'CampaignId':_0x5dc186[_0x04a4('0xe8')]||undefined})[_0x04a4('0xa9')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x5dc186[_0x04a4('0x127')]>=_0x172a06[_0x04a4('0x193')]-0x1){return!![];}hopperUtils[_0x04a4('0xe3')]({'active':![],'countagentrejectretry':_0x5dc186[_0x04a4('0x127')]+=0x1,'scheduledat':moment()[_0x04a4('0xe4')](_0x172a06[_0x04a4('0x194')],_0x04a4('0xe5'))[_0x04a4('0x4a')](_0x04a4('0xca')),'ContactId':_0x5dc186['ContactId'],'ListId':_0x5dc186[_0x04a4('0x106')],'VoiceQueueId':_0x5dc186['VoiceQueueId']||undefined,'CampaignId':_0x5dc186[_0x04a4('0xe8')]||undefined})[_0x04a4('0xa9')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0x04a4('0x1d')][_0x04a4('0x195')]=function(_0x1ad5c8,_0x409605,_0x36991a){var _0x337b20=this;var _0x3e3a19=new History(_0x1ad5c8);var _0x2dd6a1=![];var _0x1eb85a;var _0x390ae8;return new Promise(function(_0x4d71d4,_0xe9c6c3){if(_[_0x04a4('0x43')](_0x409605)&&typeof _0x409605!==_0x04a4('0x15b')){return _0xe9c6c3(msgResponse(_0x04a4('0x196'),_0x04a4('0x99'),_0x04a4('0x197')));}if(_[_0x04a4('0x43')](_0x36991a)&&typeof _0x36991a!==_0x04a4('0x15b')){return _0xe9c6c3(msgResponse(_0x04a4('0x196'),_0x04a4('0x99'),_0x04a4('0x198')));}hopperUtils['verifyAdditionalPhones'](_0x3e3a19,_0x36991a['reason'],_0x409605)[_0x04a4('0x41')](function(_0x437b8e){if(_0x437b8e[_0x04a4('0xe0')]==0x1)_0x2dd6a1=!![];switch(_0x36991a[_0x04a4('0x199')]){case'0':_0x409605['outboundNoSuchCallsDay']+=0x1;_0x3e3a19[_0x04a4('0x73')]=0x0;_0x3e3a19['statedesc']=_0x04a4('0x19a');_0x3e3a19[_0x04a4('0x130')]+=0x1;_0x3e3a19[_0x04a4('0xdc')]+=0x1;ami[_0x04a4('0x44')](_0x04a4('0x19b'),ut[_0x04a4('0x11d')](_0x1ad5c8,_0x04a4('0x19c')));_0x1eb85a=_0x409605[_0x04a4('0x191')];_0x390ae8=_0x409605[_0x04a4('0xde')];hopperUtils['createHistory'](_0x3e3a19)[_0x04a4('0xa9')](loggerCatch(_0x04a4('0x123')));if(_0x337b20['checkRetriveMax'](0x0,_0x1ad5c8,_0x409605)&&!_0x2dd6a1){if(_0x3e3a19[_0x04a4('0x130')]>=_0x409605['dialNoSuchNumberMaxRetry']){_0x337b20[_0x04a4('0x12a')](_0x3e3a19,_0x4d71d4,_0xe9c6c3,'reason\x200\x20no\x20such\x20number....');}else{_0x337b20[_0x04a4('0x131')](_0x3e3a19,_0x4d71d4,_0xe9c6c3,_0x04a4('0x19d'));}}break;case'3':_0x409605[_0x04a4('0x19e')]+=0x1;_0x3e3a19['state']=0x3;_0x3e3a19[_0x04a4('0x74')]='NoAnswer';_0x3e3a19[_0x04a4('0x126')]+=0x1;_0x3e3a19[_0x04a4('0xdc')]+=0x1;var _0x5ad30d=ut[_0x04a4('0x19f')](_0x1ad5c8,_0x409605);ami[_0x04a4('0x44')]('custom:agentnoanswer',_0x5ad30d);_0x1eb85a=_0x409605[_0x04a4('0x18a')];_0x390ae8=_0x409605['callAdditionalPhoneAfterMin'];hopperUtils[_0x04a4('0xd0')](_0x3e3a19)[_0x04a4('0xa9')](loggerCatch(_0x04a4('0x1a0')));if(_0x337b20[_0x04a4('0x188')](0x3,_0x1ad5c8,_0x409605)&&!_0x2dd6a1){if(_0x3e3a19[_0x04a4('0x126')]>=_0x409605[_0x04a4('0x189')]){_0x337b20['createStateFinal'](_0x3e3a19,_0x4d71d4,_0xe9c6c3,'reason\x203\x20ringing\x20no\x20answer');}else{_0x337b20['stateGlobal'](_0x3e3a19,_0x4d71d4,_0xe9c6c3,_0x04a4('0x1a1'));}}break;case'5':_0x409605[_0x04a4('0x1a2')]+=0x1;_0x3e3a19[_0x04a4('0x73')]=0x5;_0x3e3a19['statedesc']='Busy';_0x3e3a19[_0x04a4('0x124')]+=0x1;_0x3e3a19[_0x04a4('0xdc')]+=0x1;ami[_0x04a4('0x44')]('custom:agentbusy',ut[_0x04a4('0x11d')](_0x1ad5c8,_0x04a4('0x1a3')));_0x1eb85a=_0x409605[_0x04a4('0x1a4')];_0x390ae8=_0x409605['callAdditionalPhoneAfterMin'];hopperUtils[_0x04a4('0xd0')](_0x3e3a19)['catch'](loggerCatch(_0x04a4('0x1a5')));if(_0x337b20[_0x04a4('0x188')](0x5,_0x1ad5c8,_0x409605)&&!_0x2dd6a1){if(_0x3e3a19[_0x04a4('0x124')]>=_0x409605[_0x04a4('0x18c')]){_0x337b20[_0x04a4('0x12a')](_0x3e3a19,_0x4d71d4,_0xe9c6c3,_0x04a4('0x1a6'));}else{_0x337b20['stateGlobal'](_0x3e3a19,_0x4d71d4,_0xe9c6c3,_0x04a4('0x1a6'));}}break;case'8':_0x409605[_0x04a4('0x1a7')]+=0x1;_0x3e3a19[_0x04a4('0x73')]=0x8;_0x3e3a19['statedesc']=_0x04a4('0x1a8');_0x3e3a19[_0x04a4('0x125')]+=0x1;_0x3e3a19[_0x04a4('0xdc')]+=0x1;_0x1eb85a=_0x409605[_0x04a4('0x18f')];_0x390ae8=_0x409605[_0x04a4('0xde')];ami[_0x04a4('0x44')](_0x04a4('0x1a9'),ut[_0x04a4('0x11d')](_0x1ad5c8,_0x04a4('0x1aa')));hopperUtils[_0x04a4('0xd0')](_0x3e3a19)[_0x04a4('0xa9')](loggerCatch(_0x04a4('0x1ab')));if(_0x337b20[_0x04a4('0x188')](0x8,_0x1ad5c8,_0x409605)&&!_0x2dd6a1){if(_0x3e3a19[_0x04a4('0x125')]>=_0x409605[_0x04a4('0x18e')]){_0x337b20[_0x04a4('0x12a')](_0x3e3a19,_0x4d71d4,_0xe9c6c3,'reason\x208\x20congestion');}else{_0x337b20[_0x04a4('0x131')](_0x3e3a19,_0x4d71d4,_0xe9c6c3,_0x04a4('0x1ac'));}}break;case'11':_0x409605[_0x04a4('0x1ad')]+=0x1;_0x3e3a19['state']=0xb;_0x3e3a19[_0x04a4('0x74')]='Abandoned';_0x3e3a19[_0x04a4('0xf1')]+=0x1;_0x3e3a19[_0x04a4('0xdc')]+=0x1;_0x1eb85a=_0x409605['dialAbandonedRetryFrequency'];_0x390ae8=_0x409605['callAdditionalPhoneAfterMin'];hopperUtils[_0x04a4('0xd0')](_0x3e3a19)[_0x04a4('0xa9')](loggerCatch(_0x04a4('0xf6')));if(_0x337b20['checkRetriveMax'](0xb,_0x1ad5c8,_0x409605)&&!_0x2dd6a1){if(_0x3e3a19[_0x04a4('0xf1')]>=_0x409605[_0x04a4('0xf4')]){_0x337b20['createStateFinal'](_0x3e3a19,_0x4d71d4,_0xe9c6c3,'reason\x2011\x20abandoned');}else{_0x337b20[_0x04a4('0x131')](_0x3e3a19,_0x4d71d4,_0xe9c6c3,_0x04a4('0x1ae'));}}break;case'20':_0x409605[_0x04a4('0x1af')]+=0x1;_0x3e3a19[_0x04a4('0x73')]=0x14;_0x3e3a19[_0x04a4('0x74')]='AgentReject';_0x3e3a19[_0x04a4('0x127')]+=0x1;_0x3e3a19['countglobal']+=0x1;_0x1eb85a=_0x409605[_0x04a4('0x194')];_0x390ae8=_0x409605['callAdditionalPhoneAfterMin'];ami['emit'](_0x04a4('0x1b0'),ut[_0x04a4('0x11d')](_0x1ad5c8,'agentreject'));hopperUtils['createHistory'](_0x3e3a19)['catch'](loggerCatch(_0x04a4('0x1b1')));if(_0x337b20['checkRetriveMax'](0x14,_0x1ad5c8,_0x409605)&&!_0x2dd6a1){if(_0x3e3a19['countagentrejectretry']>=_0x409605[_0x04a4('0x193')]){_0x337b20[_0x04a4('0x12a')](_0x3e3a19,_0x4d71d4,_0xe9c6c3,'reason\x2020\x20agentreject');}else{_0x337b20[_0x04a4('0x131')](_0x3e3a19,_0x4d71d4,_0xe9c6c3,_0x04a4('0x1b2'));}}break;default:_0x409605[_0x04a4('0x137')]+=0x1;_0x3e3a19['state']=0xc;_0x3e3a19[_0x04a4('0x74')]=_0x36991a[_0x04a4('0x199')];_0x1eb85a=_0x409605[_0x04a4('0x194')];_0x390ae8=_0x409605['callAdditionalPhoneAfterMin'];hopperUtils[_0x04a4('0xd0')](_0x3e3a19)['catch'](loggerCatch(_0x04a4('0x1b3')));if(_0x337b20[_0x04a4('0x188')](_0x36991a[_0x04a4('0x199')],_0x1ad5c8,_0x409605)&&!_0x2dd6a1){if(_0x3e3a19[_0x04a4('0x124')]+_0x3e3a19[_0x04a4('0x125')]+_0x3e3a19[_0x04a4('0x126')]+_0x3e3a19[_0x04a4('0x130')]+_0x3e3a19['countdropretry']+_0x3e3a19[_0x04a4('0xf1')]+_0x3e3a19[_0x04a4('0x121')]+_0x3e3a19[_0x04a4('0x127')]>=_0x409605[_0x04a4('0x128')]){_0x337b20[_0x04a4('0x131')](_0x3e3a19,_0x4d71d4,_0xe9c6c3,_0x36991a['reason']);}else{_0x337b20[_0x04a4('0x12a')](_0x3e3a19,_0x4d71d4,_0xe9c6c3,_0x36991a[_0x04a4('0x199')]);}}}})['then'](function(){if(_0x2dd6a1){hopperUtils['swapAdditionalPhones'](_0x3e3a19,_0x1eb85a,_0x390ae8)[_0x04a4('0x41')](function(){return _0x4d71d4(0x1);});}});});};Dialer[_0x04a4('0x1d')]['stateGlobal']=function(_0x458984,_0x521d84,_0x5b2439,_0xbdbc98){var _0x1da03a=new Final(_0x458984);_0x1da03a[_0x04a4('0x73')]=0xf;_0x1da03a[_0x04a4('0x74')]=_0x04a4('0x1b4');this['createStateFinal'](_0x1da03a,_0x521d84,_0x5b2439,_0xbdbc98);};Dialer['prototype'][_0x04a4('0x12a')]=function(_0x3b5f3c,_0x398a3a,_0xf34fa6,_0x2c5999){hopperUtils['moveContactManagedDialer'](_0x3b5f3c)[_0x04a4('0x41')](function(){return _0x398a3a(msgResponse(_0x04a4('0x196'),'Success',_0x2c5999));})['catch'](function(){return _0xf34fa6(msgResponse('[moveContactManagedDialer][0]',_0x04a4('0x99'),'contact\x20not\x20moved'));});};Dialer[_0x04a4('0x1d')]['predictive']=function(_0xdb1a4e){var _0x34a2a1=_0xdb1a4e['dialPredictiveOptimizationPercentage']/0x64;var _0x41f049=_0xdb1a4e[_0x04a4('0xd6')]/(_0xdb1a4e['outboundDropCallsDayTimeout']+_0xdb1a4e['outboundAnswerCallsDay']);var _0x520462=Math[_0x04a4('0x1b5')](_0xdb1a4e[_0x04a4('0x1b6')]*(_0xdb1a4e[_0x04a4('0x1b7')]/0x64));var _0xa32467=Math[_0x04a4('0x1b5')](_0xdb1a4e[_0x04a4('0x1b6')]*(_0xdb1a4e[_0x04a4('0x1b8')]/0x64));var _0x4f8a23=_0xdb1a4e[_0x04a4('0x1b9')]+_0xdb1a4e[_0x04a4('0x13d')];var _0x2bfe58=Math[_0x04a4('0x1ba')](_0xdb1a4e[_0x04a4('0x5a')]*_0xdb1a4e[_0x04a4('0x5d')]*_0xdb1a4e[_0x04a4('0x1bb')]*_0xdb1a4e[_0x04a4('0x1bc')]);if(_[_0x04a4('0x43')](_0xdb1a4e[_0x04a4('0x29')])){if(!_[_0x04a4('0x43')](_0xdb1a4e[_0x04a4('0x62')])){_0xdb1a4e[_0x04a4('0x62')]=undefined;loggerPredictive[_0x04a4('0x67')](_0x04a4('0x1bd'),_0x04a4('0x1be'));}if(!_[_0x04a4('0x43')](_0xdb1a4e[_0x04a4('0x65')])){loggerPredictive[_0x04a4('0x67')](_0x04a4('0x1bd'),_0x04a4('0x1bf'));clearInterval(_0xdb1a4e['handlePredictive']);_0xdb1a4e['handlePredictive']=undefined;}_0xdb1a4e[_0x04a4('0x29')]=moment()[_0x04a4('0x4a')](_0x04a4('0xca'));loggerPredictive[_0x04a4('0x4c')](_0xdb1a4e[_0x04a4('0x63')],_0x04a4('0x1c0'),_0xdb1a4e[_0x04a4('0x29')]);this[_0x04a4('0xba')](_0xdb1a4e,0x1);}else if(ifInterval(_0xdb1a4e[_0x04a4('0x1c1')],_0xdb1a4e[_0x04a4('0x29')])){this[_0x04a4('0xba')](_0xdb1a4e,0x1);loggerPredictiveCalls[_0x04a4('0x4c')](_0x04a4('0x1c2'),_0xdb1a4e[_0x04a4('0x29')],_0xdb1a4e[_0x04a4('0x63')]);_0xdb1a4e[_0x04a4('0x5a')]=0x0;_0xdb1a4e[_0x04a4('0xd7')]=0x0;}else if(_0x34a2a1<_0x41f049&&_0xdb1a4e[_0x04a4('0x1c3')]==='dropRate'){clearPredictiveAttributes(_0xdb1a4e);loggerPredictive[_0x04a4('0x4c')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day',_0x41f049,_0x04a4('0x29'),_0xdb1a4e[_0x04a4('0x63')]);}else if(_0x2bfe58<_0xdb1a4e['predictiveIntervalErlangCallsDroppedCalls']&&_0xdb1a4e[_0x04a4('0x1c3')]===_0x04a4('0x1c4')){clearPredictiveAttributes(_0xdb1a4e);loggerPredictive['info'](_0x04a4('0x1c5'),_0x04a4('0x1c6'),_0x2bfe58,_0x04a4('0x1c7'),_0xdb1a4e[_0x04a4('0xd7')],_0x04a4('0x29'),_0xdb1a4e[_0x04a4('0x63')]);}else if(!ifInterval(_0xdb1a4e[_0x04a4('0x1c1')],_0xdb1a4e['startProgressive'])&&_[_0x04a4('0x43')](_0xdb1a4e[_0x04a4('0x62')])&&!_[_0x04a4('0x43')](_0xdb1a4e[_0x04a4('0x29')])){_0xdb1a4e[_0x04a4('0x62')]=moment()[_0x04a4('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0xdb1a4e['name'],_0x04a4('0x1c8'),_0xdb1a4e['startPredictive']);hopperUtils[_0x04a4('0x1c9')](_0xdb1a4e[_0x04a4('0x1c1')])[_0x04a4('0x41')](this[_0x04a4('0x1ca')](_0xdb1a4e))[_0x04a4('0x41')](mergeDataErlangB(_0xdb1a4e))['then'](this[_0x04a4('0x1cb')](_0xdb1a4e))[_0x04a4('0xa9')](loggerCatchPredictive(_0x04a4('0x1cc'),_0xdb1a4e));}else if(!ifInterval(_0xdb1a4e[_0x04a4('0x1c1')],_0xdb1a4e[_0x04a4('0x62')])){_0xdb1a4e[_0x04a4('0xd7')]=0x0;_0xdb1a4e[_0x04a4('0x62')]=moment()['format'](_0x04a4('0xca'));loggerPredictive[_0x04a4('0x4c')](_0xdb1a4e['name'],_0x04a4('0x1cd'),_0xdb1a4e[_0x04a4('0x62')]);clearInterval(_0xdb1a4e[_0x04a4('0x65')]);_0xdb1a4e['handlePredictive']=undefined;hopperUtils[_0x04a4('0x1c9')](_0xdb1a4e[_0x04a4('0x1c1')])[_0x04a4('0x41')](this[_0x04a4('0x1ca')](_0xdb1a4e))[_0x04a4('0x41')](mergeDataErlangB(_0xdb1a4e))[_0x04a4('0x41')](this[_0x04a4('0x1cb')](_0xdb1a4e))[_0x04a4('0xa9')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0xdb1a4e));}else if(_0xdb1a4e[_0x04a4('0x1b6')]&&_0x4f8a23<_0xdb1a4e[_0x04a4('0x1b6')]-_0xa32467){clearPredictiveAttributes(_0xdb1a4e);loggerPredictive[_0x04a4('0x4c')](_0xdb1a4e[_0x04a4('0x63')],_0x04a4('0x1ce'),_0x4f8a23,_0x04a4('0x1cf'),_0xdb1a4e[_0x04a4('0x1b6')],'-',_0xa32467,'=',_0xdb1a4e[_0x04a4('0x1b6')]-_0xa32467,')');}else if(_0xdb1a4e[_0x04a4('0x1b6')]&&_0x4f8a23>_0xdb1a4e[_0x04a4('0x1b6')]+_0x520462){clearPredictiveAttributes(_0xdb1a4e);loggerPredictive['info'](_0xdb1a4e['name'],_0x04a4('0x1ce'),_0x4f8a23,_0x04a4('0x1d0'),_0xdb1a4e['predictiveIntervalAvailable'],'+',_0x520462,'=',_0xdb1a4e[_0x04a4('0x1b6')]+_0x520462,')');}};Dialer[_0x04a4('0x1d')][_0x04a4('0x1ca')]=function(_0x1c0a1c){var _0x349dc4=this;return function(_0x1859e8){return new Promise(function(_0x262287,_0x459e65){_[_0x04a4('0x5f')](_0x1c0a1c,_0x1859e8[0x0]);if(checkGetDataPredictive(_0x1859e8[0x0])){var _0x3ee93a=_0x1c0a1c['predictiveIntervalAvailable']=_0x1c0a1c[_0x04a4('0x13d')]+_0x1c0a1c['available'];var _0x4750f3=_0x1c0a1c[_0x04a4('0x1c1')]*0x3c;var _0x32efbb=_0x1859e8[0x0][_0x04a4('0x54')]+_0x1859e8[0x0][_0x04a4('0x56')];var _0x3cbb8a=(_0x1859e8[0x0]['predictiveIntervalAnsweredCalls']+_0x1859e8[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x1859e8[0x0][_0x04a4('0x53')])/_0x1859e8[0x0][_0x04a4('0x1d1')];_0x1c0a1c[_0x04a4('0x1bb')]=_0x3cbb8a>0x0?_0x3cbb8a:0x1;switch(_0x1c0a1c[_0x04a4('0x1c3')]){case'dropRate':var _0x1792f7=_0x1c0a1c[_0x04a4('0x1d2')]/0x64;return _0x349dc4[_0x04a4('0x1d3')](_0x3ee93a,_0x4750f3,_0x32efbb,_0x3cbb8a,_0x1792f7)['then'](function(_0x3f34dc){return _0x262287(_0x3f34dc);});case _0x04a4('0x1d4'):var _0x2065aa=_0x1c0a1c[_0x04a4('0x1d2')]/0x64;return _0x349dc4['busyFactor'](_0x3ee93a,_0x4750f3,_0x32efbb,_0x3cbb8a,_0x2065aa)[_0x04a4('0x41')](function(_0x5def56){return _0x262287(_0x5def56);});default:return _0x459e65(msgResponse(_0x04a4('0x1d5'),_0x04a4('0x99'),_0x04a4('0x1d6')));}}else{return _0x459e65(msgResponse(_0x04a4('0x1d5'),_0x04a4('0x99'),_0x04a4('0x1d7')));}});};};Dialer[_0x04a4('0x1d')]['getDataPredictiveOld']=function(_0x2d88d4){var _0x4ef6e0=this;return function(_0x33a79d){return new Promise(function(_0x4fba4e,_0x14a26e){_[_0x04a4('0x5f')](_0x2d88d4,_0x33a79d[0x0]);if(checkGetDataPredictive(_0x33a79d[0x0])){loggerPredictive[_0x04a4('0x4c')](JSON['stringify'](_0x33a79d[0x0]));if(_0x2d88d4[_0x04a4('0x1c3')]===_0x04a4('0x1c4')){return _0x4ef6e0[_0x04a4('0x1d8')](_0x2d88d4['id'])[_0x04a4('0x41')](function(_0x3b5772){var _0x41c290=_0x2d88d4[_0x04a4('0x1d9')]-_0x3b5772[0x0]['outboundQueuePauses'];var _0xbe5c02=_0x2d88d4['dialPredictiveInterval']*0x3c;var _0x5b3562=_0x33a79d[0x0][_0x04a4('0x54')]+_0x33a79d[0x0][_0x04a4('0x56')];var _0x4ef4c8=(_0x33a79d[0x0]['predictiveIntervalAnsweredCalls']+_0x33a79d[0x0][_0x04a4('0xd5')]+_0x33a79d[0x0][_0x04a4('0x53')])/_0x33a79d[0x0]['predictiveIntervalTotalCalls'];var _0xe96796=_0x2d88d4[_0x04a4('0x1d2')]/0x64;_0x2d88d4[_0x04a4('0x1da')]=_0x3b5772[0x0]['outboundQueuePauses']||0x0;_0x2d88d4['predictiveIntervalHitRate']=_0x4ef4c8>0x0?_0x4ef4c8:0x1;return _0x4ef6e0['abandonmentRate'](_0x41c290,_0xbe5c02,_0x5b3562,_0x4ef4c8,_0xe96796);})[_0x04a4('0x41')](function(_0x25f964){return _0x4fba4e(_0x25f964);})[_0x04a4('0xa9')](function(_0x280df8){return _0x14a26e(msgResponse('[CatchErlangB]',_0x04a4('0x99'),JSON[_0x04a4('0x7a')](_0x280df8)));});}if(_0x2d88d4[_0x04a4('0x1c3')]===_0x04a4('0x1d4')){return _0x4ef6e0[_0x04a4('0x1d8')](_0x2d88d4['id'])['then'](function(_0xbc07fd){var _0x4f2bc1=_0x2d88d4[_0x04a4('0x1d9')]-_0xbc07fd[0x0]['outboundQueuePauses'];var _0x5d81c8=_0x2d88d4[_0x04a4('0x1c1')]*0x3c;var _0x179d8e=_0x33a79d[0x0][_0x04a4('0x54')]+_0x33a79d[0x0]['predictiveIntervalAvgHoldtime'];var _0x412abf=(_0x33a79d[0x0][_0x04a4('0x50')]+_0x33a79d[0x0][_0x04a4('0xd5')]+_0x33a79d[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x33a79d[0x0]['predictiveIntervalTotalCalls'];var _0x1ab749=_0x2d88d4['dialPredictiveOptimizationPercentage']/0x64;_0x2d88d4[_0x04a4('0x1da')]=_0xbc07fd[0x0][_0x04a4('0x1db')]||0x0;_0x2d88d4[_0x04a4('0x1bb')]=_0x412abf>0x0?_0x412abf:0x1;return _0x4ef6e0[_0x04a4('0x1dc')](_0x4f2bc1,_0x5d81c8,_0x179d8e,_0x412abf,_0x1ab749);})[_0x04a4('0x41')](function(_0x1b1a97){return _0x4fba4e(_0x1b1a97);})[_0x04a4('0xa9')](function(_0x6faa27){return _0x14a26e(msgResponse('[CatchErlangB]',_0x04a4('0x99'),JSON['stringify'](_0x6faa27)));});}}else{return _0x14a26e(msgResponse(_0x04a4('0x1d5'),_0x04a4('0x99'),_0x04a4('0x1d7')));}});};};Dialer[_0x04a4('0x1d')][_0x04a4('0x1cb')]=function(_0x2d937d){var _0x4d9b39=this;return function(){var _0x3609e8=0x0;var _0x3b6e1c=Math['floor'](_0x2d937d[_0x04a4('0x1dd')]*0x3e8);if(_0x3b6e1c>0x0){_0x3b6e1c=_0x3b6e1c<0x64?0x64:_0x3b6e1c;loggerPredictive[_0x04a4('0x4c')](_0x2d937d['name'],'one\x20call\x20every:',_0x3b6e1c,_0x04a4('0x1de'));_0x2d937d[_0x04a4('0x65')]=setInterval(function(){_0x4d9b39[_0x04a4('0x65')](_0x2d937d);loggerPredictiveCalls[_0x04a4('0x4c')](_0x04a4('0x1df'),_0x3609e8+=0x1);},_0x3b6e1c);}else{loggerPredictive[_0x04a4('0x4c')](_0x2d937d[_0x04a4('0x63')],'fail\x20to\x20scheduled\x20calls');}};};Dialer['prototype'][_0x04a4('0x1e0')]=function(_0x512c0a,_0xe096b1){var _0x2f361e=this;return function(_0x39fe5f){if(_[_0x04a4('0x80')](_0x39fe5f)){if(_['isNil'](_0xe096b1['UserId'])||!_0xe096b1[_0x04a4('0x1e1')]){if(_0x512c0a['dialMethod']===_0x04a4('0xa')){_0x512c0a[_0x04a4('0x77')]=_['isUndefined'](_0x512c0a[_0x04a4('0x77')])?!![]:_0x512c0a['queueStatusComplete'];var _0x2379c0=uuid['v4']();_0x2f361e[_0x04a4('0x27')][_0x2379c0]=new Action(_0x512c0a,_0xe096b1,_0x2379c0);loggerBooked['info'](_0x04a4('0x1e2'),_0x2379c0,_0x04a4('0x1e3'),JSON[_0x04a4('0x7a')](_0x512c0a[_0x04a4('0x77')]),_0x04a4('0x1e4'),_0x512c0a[_0x04a4('0x63')]);if(_0x512c0a[_0x04a4('0x77')]){_0x512c0a[_0x04a4('0x77')]=![];_0x2f361e[_0x04a4('0x2a')][_0x2f361e['actions'][_0x2379c0]['queue']]=[];ami[_0x04a4('0xa3')]({'actionid':_0x2379c0,'action':_0x04a4('0x1e5'),'queue':_0x512c0a[_0x04a4('0x63')]})[_0x04a4('0xa9')](function(){_0x2f361e[_0x04a4('0xc8')](_0x512c0a);hopperUtils[_0x04a4('0xe3')]({'active':![],'ContactId':_0x2f361e[_0x04a4('0x27')][_0x2379c0][_0x04a4('0xe6')],'ListId':_0x2f361e[_0x04a4('0x27')][_0x2379c0][_0x04a4('0x106')],'VoiceQueueId':_0x2f361e[_0x04a4('0x27')][_0x2379c0][_0x04a4('0xe7')]||undefined,'CampaignId':_0x2f361e[_0x04a4('0x27')][_0x2379c0][_0x04a4('0xe8')]||undefined})[_0x04a4('0xa9')](loggerCatch(_0x04a4('0x1e6')));delete _0x2f361e[_0x04a4('0x27')][_0x2379c0];});}else{loggerBooked['info']('[booked][checkContactBlack][else]',JSON['stringify'](_0x512c0a[_0x04a4('0x77')]),'Queue:\x20',_0x512c0a[_0x04a4('0x63')]);_0x2f361e[_0x04a4('0xc8')](_0x512c0a);hopperUtils[_0x04a4('0xe3')]({'active':![],'ContactId':_0x2f361e[_0x04a4('0x27')][_0x2379c0][_0x04a4('0xe6')],'ListId':_0x2f361e[_0x04a4('0x27')][_0x2379c0]['ListId'],'VoiceQueueId':_0x2f361e[_0x04a4('0x27')][_0x2379c0]['VoiceQueueId']||undefined,'CampaignId':_0x2f361e['actions'][_0x2379c0][_0x04a4('0xe8')]||undefined})['catch'](loggerCatch(_0x04a4('0x1e6')));delete _0x2f361e['actions'][_0x2379c0];}}else{return _0x2f361e[_0x04a4('0x15a')](_0x512c0a,_0xe096b1);}}else{if(utils[_0x04a4('0x60')](undefined,_0xe096b1[_0x04a4('0x1e7')])<_0x512c0a['dialRecallMeTimeout']*0x3c){if(_0xe096b1[_0x04a4('0x1e8')]&&!_0xe096b1['Agent'][_0x04a4('0x1e9')]){_0x2f361e[_0x04a4('0x102')][_0x04a4('0x103')](_0xe096b1['id'])[_0x04a4('0x20')](function(){_0x2f361e['updateOriginated'](_0x512c0a);});}else{hopperUtils[_0x04a4('0x1ea')]({'active':![]},_0xe096b1['id'],0x1)[_0x04a4('0x20')](function(){_0x2f361e['updateOriginated'](_0x512c0a);});}}else{_0x512c0a[_0x04a4('0x1eb')]+=0x1;_0x2f361e[_0x04a4('0xc8')](_0x512c0a);if(_0x512c0a[_0x04a4('0x1ec')]){hopperUtils[_0x04a4('0xe3')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0xe096b1['ContactId'],'ListId':_0xe096b1[_0x04a4('0x106')],'VoiceQueueId':_0xe096b1[_0x04a4('0xe7')]||undefined,'CampaignId':_0xe096b1['CampaignId']||undefined})[_0x04a4('0xa9')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));hopperUtils[_0x04a4('0xd0')](createObjHistory(_0x512c0a,_0xe096b1,utils[_0x04a4('0x6c')][_0x04a4('0x1ed')],0x17,'RecallInQueue'))['catch'](loggerCatch(_0x04a4('0x1ee')));}else{_0x2f361e[_0x04a4('0x12e')](createObjHistory(_0x512c0a,_0xe096b1,utils['CAMPAIGN_STATUS']['RECALL_TIMEOUT'],0x16,_0x04a4('0x1ef')),'[Originate][HistoryRecallClose][historyCatch]',_0x04a4('0x1f0'));}}}}else{_0x512c0a[_0x04a4('0x1f1')]+=0x1;_0x2f361e['saveInDb'](createObjHistory(_0x512c0a,_0xe096b1,utils['CAMPAIGN_STATUS']['BLACKLIST'],0xd,_0x04a4('0x1f2')),_0x04a4('0x1f3'),'[Originate][MoveBlacklist]');throw _0x04a4('0x1f4');}};};Dialer[_0x04a4('0x1d')]['handleIvr']=function(_0x3d3b6a){var _0x5adacb=this;var _0x639b51=_0x3d3b6a['limitCalls']-_0x3d3b6a['originated'];emitCampaignSummary(_0x3d3b6a);if(_0x639b51>0x0&&_0x3d3b6a['temp']==0x0){if(_0x639b51>this[_0x04a4('0x25')]){_0x639b51=this[_0x04a4('0x25')];}_0x3d3b6a['temp']=0x1;hopperUtils['getContactDialerIvr'](_0x3d3b6a,_0x639b51)[_0x04a4('0x41')](function(_0x129a59){_0x3d3b6a[_0x04a4('0x6a')]=0x0;if(_0x129a59){if(!utils[_0x04a4('0x1f5')](_0x129a59)){_0x3d3b6a[_0x04a4('0x70')]=utils[_0x04a4('0x6c')][_0x04a4('0x71')];logger[_0x04a4('0x4c')](_0x04a4('0x1f6')+_0x3d3b6a[_0x04a4('0x63')]);}else{_0x3d3b6a['originated']+=_0x129a59['length'];_0x3d3b6a[_0x04a4('0x70')]=utils[_0x04a4('0x6c')]['RUNNING'];for(var _0x25d994=0x0;_0x25d994<_0x129a59[_0x04a4('0xa1')];_0x25d994+=0x1){_0x3d3b6a[_0x04a4('0x1f7')]+=0x1;if(_['isNil'](_0x129a59[_0x25d994])||_['isNil'](_0x129a59[_0x25d994][_0x04a4('0x173')])||_[_0x04a4('0xfd')](_0x129a59[_0x25d994][_0x04a4('0x15c')])){_0x5adacb[_0x04a4('0x152')]('[actionOriginate]\x20',_0x3d3b6a,_0x129a59[_0x25d994]);}else{hopperUtils[_0x04a4('0x1f8')](_[_0x04a4('0x7b')](_0x129a59[_0x25d994],[_0x04a4('0xe8'),_0x04a4('0x15c')]))[_0x04a4('0x41')](_0x5adacb[_0x04a4('0x1e0')](_0x3d3b6a,_0x129a59[_0x25d994]))[_0x04a4('0xa9')](_0x5adacb[_0x04a4('0x151')](_0x04a4('0x1f9'),_0x3d3b6a));}}}}})[_0x04a4('0xa9')](loggerGetContactDialer('[getContactCampaign2]',_0x3d3b6a,_0x639b51));}};Dialer[_0x04a4('0x1d')]['handlePower']=function(_0x16ed77,_0x2267f2){var _0x142456=this;var _0x461c18=[];if(_0x2267f2<0x1||_0x16ed77[_0x04a4('0xb8')]===_0x04a4('0xa')){_0x2267f2=0x1;}var _0x5afed9=Math[_0x04a4('0x1ba')](_0x16ed77[_0x04a4('0x1b9')]*_0x2267f2)-_0x16ed77[_0x04a4('0x14e')];if(_0x16ed77['dialLimitQueue']>0x0){var _0x2b0909=_0x16ed77['dialLimitQueue']-_0x16ed77[_0x04a4('0x14e')]-_0x16ed77[_0x04a4('0x13d')]-_0x16ed77[_0x04a4('0x1fa')];if(_0x5afed9>_0x2b0909){_0x5afed9=_0x2b0909;}}if(_0x5afed9>0x0&&_0x16ed77['temp']==0x0){if(_0x16ed77[_0x04a4('0xb8')]===_0x04a4('0xa')){_0x5afed9=0x1;}if(_0x5afed9>this[_0x04a4('0x25')]){_0x5afed9=this['maxNumberOriginate'];}for(var _0x555ad0 in this[_0x04a4('0x23')]){if(typeof this[_0x04a4('0x23')][_0x555ad0]!==_0x04a4('0xb0')){if(this[_0x04a4('0x23')][_0x555ad0]['state']===_0x04a4('0x1fb')&&this[_0x04a4('0x23')][_0x555ad0][_0x04a4('0x90')]==='reachable'){_0x461c18[_0x04a4('0xa2')](this[_0x04a4('0x23')][_0x555ad0]['id']);}}}_0x16ed77[_0x04a4('0x6a')]=0x1;hopperUtils[_0x04a4('0x1fc')](_0x16ed77,_0x461c18,_0x5afed9)['then'](function(_0x1487ff){_0x16ed77[_0x04a4('0x6a')]=0x0;if(_0x1487ff){if(!utils[_0x04a4('0x1f5')](_0x1487ff)){hopperUtils[_0x04a4('0x1fd')](_0x16ed77)['then'](sendMessageReschedule(_0x16ed77))[_0x04a4('0xa9')](loggerCatch(_0x04a4('0x1fe')));}else{_0x16ed77['originated']+=_0x1487ff[_0x04a4('0xa1')];_0x16ed77['message']=_0x16ed77[_0x04a4('0xb8')]===_0x04a4('0xa')?utils['CAMPAIGN_STATUS'][_0x04a4('0x13e')]:utils[_0x04a4('0x6c')]['RUNNING'];for(var _0x156fa2=0x0;_0x156fa2<_0x1487ff[_0x04a4('0xa1')];_0x156fa2+=0x1){if(_['isNil'](_0x1487ff[_0x156fa2])||_[_0x04a4('0xfd')](_0x1487ff[_0x156fa2][_0x04a4('0x173')])||_[_0x04a4('0xfd')](_0x1487ff[_0x156fa2][_0x04a4('0x15c')])){_0x142456['emptyContact']('[actionOriginate]\x20',_0x16ed77,_0x1487ff[_0x156fa2]);}else{hopperUtils['checkIsBlackList'](_[_0x04a4('0x7b')](_0x1487ff[_0x156fa2],[_0x04a4('0xe7'),_0x04a4('0x15c')]))[_0x04a4('0x41')](_0x142456['checkContactBlack'](_0x16ed77,_0x1487ff[_0x156fa2]))[_0x04a4('0xa9')](_0x142456[_0x04a4('0x151')](_0x04a4('0x1ff'),_0x16ed77));}}}}})[_0x04a4('0xa9')](loggerGetContactDialer(_0x04a4('0x200'),_0x16ed77,_0x5afed9));}};Dialer[_0x04a4('0x1d')][_0x04a4('0x65')]=function(_0x491161){if(_0x491161[_0x04a4('0x201')]>0x0){var _0x2498c3=_0x491161[_0x04a4('0x201')]-_0x491161[_0x04a4('0x14e')]-_0x491161[_0x04a4('0x13d')];if(_0x2498c3>0x0&&_0x491161[_0x04a4('0x6a')]==0x0){this[_0x04a4('0x202')](_0x491161);}else{loggerPredictiveCalls[_0x04a4('0x4c')](_0x04a4('0x203'));}}else{this[_0x04a4('0x202')](_0x491161);}};Dialer[_0x04a4('0x1d')][_0x04a4('0x202')]=function(_0x475e58){var _0x57d5a4=this;var _0x1cd23a=[];_0x475e58['originated']+=0x1;for(var _0x4e8958 in this[_0x04a4('0x23')]){if(typeof this[_0x04a4('0x23')][_0x4e8958]!=='undefined'){if(this[_0x04a4('0x23')][_0x4e8958][_0x04a4('0x73')]===_0x04a4('0x1fb')&&this['agents'][_0x4e8958][_0x04a4('0x90')]==='reachable'){_0x1cd23a[_0x04a4('0xa2')](this['agents'][_0x4e8958]['id']);}}}_0x475e58[_0x04a4('0x6a')]=0x1;return this[_0x04a4('0x1fc')](_0x475e58['id'],_0x1cd23a,0x1,_0x475e58[_0x04a4('0x204')],_0x475e58)[_0x04a4('0x41')](function(_0x4c09fa){_0x475e58[_0x04a4('0x6a')]=0x1;if(_0x4c09fa){if(!utils[_0x04a4('0x1f5')](_0x4c09fa)){utils[_0x04a4('0x69')](_0x475e58,0x1,0x0);return hopperUtils[_0x04a4('0x1fd')](_0x475e58)[_0x04a4('0x41')](sendMessageReschedule(_0x475e58))[_0x04a4('0xa9')](loggerCatch('[countReScheduled]\x20'));}else{_0x475e58['message']=utils[_0x04a4('0x6c')][_0x04a4('0x205')];if(_['isNil'](_0x4c09fa[0x0])||_[_0x04a4('0xfd')](_0x4c09fa[0x0][_0x04a4('0x173')])||_['isNil'](_0x4c09fa[0x0][_0x04a4('0x15c')])){_0x57d5a4[_0x04a4('0x152')]('[actionOriginate]\x20',_0x475e58,_0x4c09fa[0x0]);}else{return hopperUtils['checkIsBlackList'](_[_0x04a4('0x7b')](_0x4c09fa[0x0],[_0x04a4('0xe7'),_0x04a4('0x15c')]))['then'](_0x57d5a4[_0x04a4('0x1e0')](_0x475e58,_0x4c09fa[0x0]))[_0x04a4('0xa9')](_0x57d5a4[_0x04a4('0x151')](_0x04a4('0x206'),_0x475e58));}}}})['catch'](loggerGetContactDialer(_0x04a4('0x207'),_0x475e58,0x1));};Dialer[_0x04a4('0x1d')][_0x04a4('0x1d3')]=function(_0x7cf8,_0x203ec2,_0x5be7b6,_0x418ed4,_0x3593fd,_0x381d0b){loggerPredictive[_0x04a4('0x4c')](_0x04a4('0x208'));loggerPredictive[_0x04a4('0x4c')](_0x04a4('0x209'),_0x7cf8);loggerPredictive[_0x04a4('0x4c')](_0x04a4('0x20a'),_0x203ec2);loggerPredictive['info'](_0x04a4('0x20b'),_0x5be7b6);loggerPredictive['info']('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',_0x418ed4);loggerPredictive[_0x04a4('0x4c')](_0x04a4('0x20c'),_0x3593fd);loggerPredictive['info'](_0x04a4('0x5e'));return new Promise(function(_0x4d1164,_0x307d81){if(_0x7cf8<=0x0||isNaN(_0x7cf8)){return _0x307d81(msgResponse('[abandonmentRate]','Error',_0x04a4('0x20d')+_0x7cf8));}if(_0x5be7b6<=0x0||isNaN(_0x5be7b6)){return _0x307d81(msgResponse(_0x04a4('0x20e'),_0x04a4('0x8d'),_0x04a4('0x20f')+_0x5be7b6));}if(_0x418ed4<=0x0||isNaN(_0x418ed4)){return _0x307d81(msgResponse(_0x04a4('0x20e'),_0x04a4('0x8d'),_0x04a4('0x210')+_0x418ed4));}if(_0x203ec2<=0x0||isNaN(_0x203ec2)){return _0x307d81(msgResponse(_0x04a4('0x20e'),_0x04a4('0x8d'),_0x04a4('0x211')+_0x203ec2));}if(_0x3593fd<=0x0||isNaN(_0x3593fd)){return _0x307d81(msgResponse(_0x04a4('0x20e'),_0x04a4('0x8d'),_0x04a4('0x212')+_0x3593fd));}_0x381d0b=_0x381d0b||0x0;var _0x1dcebf=0x1/_0x5be7b6;var _0x28476c=0x0;var _0x5d037a=0x0;var _0x31e00f=0x0;var _0x1fdba0=0x0;for(var _0xed208d=0x0;_0x31e00f<_0x3593fd;_0xed208d+=0x1){_0x5d037a=_0xed208d/_0x203ec2;_0x28476c=(_0x418ed4*_0x5d037a+_0x381d0b)/_0x1dcebf;_0x31e00f=utils[_0x04a4('0x213')](_0x28476c,_0x7cf8);_0x1fdba0=_0x28476c/_0x7cf8*(0x1-utils[_0x04a4('0x213')](_0x28476c,_0x7cf8));}return _0x4d1164({'erlangCalls':_0xed208d,'erlangCallToSecond':_0x203ec2/_0xed208d,'erlangAbandonmentRate':_0x31e00f,'erlangBusyFactor':_0x1fdba0});});};Dialer[_0x04a4('0x1d')][_0x04a4('0x1dc')]=function(_0x133190,_0x56ac79,_0x5c963c,_0x3f3b07,_0x9553dd,_0x38f552){loggerPredictive[_0x04a4('0x4c')](_0x04a4('0x214'));loggerPredictive[_0x04a4('0x4c')]('M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x133190);loggerPredictive[_0x04a4('0x4c')](_0x04a4('0x20a'),_0x56ac79);loggerPredictive[_0x04a4('0x4c')](_0x04a4('0x20b'),_0x5c963c);loggerPredictive[_0x04a4('0x4c')](_0x04a4('0x215'),_0x3f3b07);loggerPredictive[_0x04a4('0x4c')](_0x04a4('0x216'),_0x9553dd);loggerPredictive[_0x04a4('0x4c')](_0x04a4('0x5e'));return new Promise(function(_0x5613d6,_0x35c695){if(_0x133190<=0x0||isNaN(_0x133190)){return _0x35c695(msgResponse(_0x04a4('0x217'),_0x04a4('0x8d'),_0x04a4('0x20d')+_0x133190));}if(_0x5c963c<=0x0||isNaN(_0x5c963c)){return _0x35c695(msgResponse(_0x04a4('0x217'),'Error',_0x04a4('0x20f')+_0x5c963c));}if(_0x3f3b07<=0x0||isNaN(_0x3f3b07)){return _0x35c695(msgResponse(_0x04a4('0x217'),'Error','p\x20=\x20'+_0x3f3b07));}if(_0x56ac79<=0x0||isNaN(_0x56ac79)){return _0x35c695(msgResponse('[busyFactor]','Error',_0x04a4('0x211')+_0x56ac79));}if(_0x9553dd<=0x0||isNaN(_0x9553dd)){return _0x35c695(msgResponse(_0x04a4('0x217'),_0x04a4('0x8d'),'Umin\x20=\x20'+_0x9553dd));}_0x38f552=_0x38f552||0x0;var _0x5c35c6=0x1/_0x5c963c;var _0x24a4aa=0x0;var _0x3436b1=0x0;var _0x5637ec=0x0;var _0x4633d6=0x0;for(var _0x3358f1=0x0;_0x4633d6<_0x9553dd;_0x3358f1+=0x1){_0x3436b1=_0x3358f1/_0x56ac79;_0x24a4aa=(_0x3f3b07*_0x3436b1+_0x38f552)/_0x5c35c6;_0x5637ec=utils[_0x04a4('0x213')](_0x24a4aa,_0x133190);_0x4633d6=_0x24a4aa/_0x133190*(0x1-utils[_0x04a4('0x213')](_0x24a4aa,_0x133190));}return _0x5613d6({'erlangCalls':_0x3358f1,'erlangCallToSecond':_0x56ac79/_0x3358f1,'erlangAbandonmentRate':_0x5637ec,'erlangBusyFactor':_0x4633d6});});};module[_0x04a4('0x218')]=Dialer;