b817eec395054fc445f116c0f949405cac9b8f50
[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 _0xe351=['dialPowerLevel','predictive','Queue','method\x20not\x20recognized','silly','Voice\x20Queue\x20%s\x20$s','intervalIftime','Global:\x20','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','AMI\x20IfTime','queue','uniqueid','ivr','updateOriginated','answertime','YYYY-MM-DD\x20HH:mm:ss','outboundAnswerCallsDay','reason','agent','dialQueueProject2','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','getSeconds','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','TIMEOUT','agiafterat','countdropretry','callAdditionalPhoneAfterMin','verifyAdditionalPhones','voiceQueue','additional','dialDropMaxRetry','queueCallerAbandonCreateState','rescheduleContact','add','dialDropRetryFrequency','ContactId','ListId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','endtime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','predictiveIntervalDroppedCallsCallersExit','CALLEREXIT','countglobal','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','syncNewExten','channel','actionid','strategy','rrmemory','isNil','locked','paused','stateinterface','idHopper','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock2]','[booked][unlock3]','getQueue','response','Success','callProgressDetecting','variable','amdstatus','exten','dialAMDActive','value','HANGUP','outboundAnswerAgiCallsDay','membername','AMD','custom:amd','buildObj','saveInDb','[syncHangupInAMD][createHistory]','Machine','countmachineretry','amd','[syncAgentComplete][createHistory][0]','countbusyretry','countnoanswerretry','countabandonedretry','countagentrejectretry','reason19\x20machine....','dialMachineMaxRetry','reason\x2019\x20machine....','dialMachineRetryFrequency','minutes','[rescheduleContact][Machine]','HangupInAMD','MACHINE','countcongestionretry','countnosuchnumberretry','dialGlobalMaxRetry','stateGlobal','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AGI','cause-txt','Normal\x20Clearing','outboundUnknownCallsDay','queuesSummary','running','isPreviewCampaign','statusMessage','getQueueCampaignStatusMessage','available','inUse','ACTIVE','[syncQueueSummary]','compareToOutboundQueue','updateReportFromOutboundQueue','assign','throttle','filter','dialPreviewRecallmeReminder','online','handlePreviewRecallNotifications','map','clearZombieChannels','[uniqueid]','[actions]','enqueue','Action','No\x20such\x20channel','[Dialer][checkChannel]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','loggerHandler','emptyContact','notFound','[emptyContact]','[syncQueueCallerAbandon]\x20[Drop]','checkPreviewRecallReminder','Agent','user:%s','user:dialPreviewRecallReminder','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','isOutboundQueue','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialAgiAfterHangupAgent','NONE','getCaller','xcally-motion-dialer','dialAMDInitialSilence','XMD-AMDGREETING','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-CAMPAIGNID','setXMDContactVariables','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','getCallerId','TrunkBackup','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','dialPrefix','trim','dialCutDigit','substring','SIP/%s/%s%s','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originate][error]','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','[rescheduleContact]\x20[Busy]','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','createStateFinal','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','custom:agentbusy','busy','dialBusyRetryFrequency','[syncAgentComplete][createHistory][5]','dialBusyMaxRetry','reason\x205\x20busy','outboundCongestionCallsDay','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','talking','floor','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','check\x20predictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','dialPredictiveInterval','recalculate\x20predictive\x20at','avgHandleTime','startMethodPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','predictiveIntervalTotalCalls','[getDataPredictive]','Unknown\x20Predictive','getDataPredictiveOld','loggedIn','predictiveIntervalPauses','outboundQueuePauses','[CatchErlangB]','busyFactor','check\x20failure','milliseconds','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','scheduledat','unlockContact','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][MoveBlacklist]','inBlackList','handleIvr','limitCalls','temp','maxNumberOriginate','getContactDialerIvr','checkContactEmpty','RUNNING','ivrTotalCallsDays','[actionOriginateIvr]\x20','dialLimitQueue','pTalking','undefined','not_inuse','countReScheduled','[countReScheduled]\x20','Contact','[actionOriginate]\x20','checkIsBlackList','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','getContactDialer','[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','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','m\x20=\x20','[abandonmentRate]','Ts\x20=\x20','interval\x20=\x20','erlangb','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','p\x20=\x20','Umin\x20=\x20','util','uuid','moment','ioredis','./utils','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictiveCalls','syncQueueSummary','redis','defaults','localhost','../rpc/cmHopper','../rpc/setting','../rpc/interval','./models/action','./models/history','./models/final','./models/agentComplete','env','prototype','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','syncHangup','newexten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined','emit','type','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','format','voice:queue:%s','name','voice_queue:save','isEmpty','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','predictiveIntervalAvgHoldtime','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','merge','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','inspect','checkContactLowerLimitOriginate','contactsRescheduled','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','message','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','statedesc','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','pick','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Interval','Intervals','INACTIVE','\x20NOT\x20Active','isIVRCampaign','campaign:ivr:%s','sendMessageOneNotActive','originated','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','DISACTIVED','is\x20disactive','Error','isTrunkReachable','active','SIP/%s','status','reachable','unmonitored','Trunk','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTimeIvr','ifTime','Failure','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','\x20Intervals\x20is\x20empty\x20','timezones','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','length','push','command','interval','content','true','catch','indexOf','all','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','stringify','resetActiveCalls','syncCampaigns','isIVRCampaignActive','resolve','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','launchHandleIvr','[syncCampaigns]','checkDialMethod','dialMethod','power','handlePower'];(function(_0x15e735,_0x1f18ea){var _0x270ce1=function(_0x36bb87){while(--_0x36bb87){_0x15e735['push'](_0x15e735['shift']());}};_0x270ce1(++_0x1f18ea);}(_0xe351,0x165));var _0x1e35=function(_0x522128,_0x3a4911){_0x522128=_0x522128-0x0;var _0x2f8416=_0xe351[_0x522128];return _0x2f8416;};'use strict';var util=require(_0x1e35('0x0'));var _=require('lodash');var uuid=require(_0x1e35('0x1'));var moment=require(_0x1e35('0x2'));var rr=require('rr');var Redis=require(_0x1e35('0x3'));var utils=require(_0x1e35('0x4'));var hopperUtils=require('./utils/hopper');var ut=require(_0x1e35('0x5'));var config=require(_0x1e35('0x6'));var logger=require(_0x1e35('0x7'))(_0x1e35('0x8'));var loggerBooked=require('../../../config/logger')(_0x1e35('0x9'));var loggerPredictive=require('../../../config/logger')('predictive');var loggerPredictiveCalls=require(_0x1e35('0x7'))(_0x1e35('0xa'));var loggerSyncQueueSummary=require(_0x1e35('0x7'))(_0x1e35('0xb'));var ami=require('../ami');config[_0x1e35('0xc')]=_[_0x1e35('0xd')](config[_0x1e35('0xc')],{'host':_0x1e35('0xe'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1e35('0xc')]));var cmHopper=require(_0x1e35('0xf'));var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require(_0x1e35('0x10'));var Interval=require(_0x1e35('0x11'));var Action=require(_0x1e35('0x12'));var History=require(_0x1e35('0x13'));var Final=require(_0x1e35('0x14'));var AgentComplete=require(_0x1e35('0x15'));var QueueCallerAbandon=require('./models/queueCallerAbandon');var Hangup=require('./models/hangup');var ipAgi=process[_0x1e35('0x16')]['XCALLY_IP_AGI']||'127.0.0.1';var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x1e35('0x17')]['enqueue']=function(_0x328e30){this[_0x1e35('0x18')]=this[_0x1e35('0x18')]?this['tail'][_0x1e35('0x19')](_0x328e30):_0x328e30();};function Dialer(_0x22437f,_0x532dc8){this[_0x1e35('0x1a')]=new Sequence();this[_0x1e35('0x1b')]=_0x532dc8;this[_0x1e35('0x1c')]=_0x22437f['voiceQueues'];this[_0x1e35('0x1d')]=_0x22437f[_0x1e35('0x1d')];this[_0x1e35('0x1e')]=_0x22437f[_0x1e35('0x1e')];this['trunks']=_0x22437f[_0x1e35('0x1f')];this['maxNumberOriginate']=config['maxNumberOriginate']||0x2;this[_0x1e35('0x20')]={};this[_0x1e35('0x21')]={};this[_0x1e35('0x22')]={};this[_0x1e35('0x23')]={};this[_0x1e35('0x24')]={};this[_0x1e35('0x25')]={};this[_0x1e35('0x26')]={};this[_0x1e35('0x27')]={};this[_0x1e35('0x28')]={};this[_0x1e35('0x29')]={};this['queuesSummary']={};ami['on'](_0x1e35('0x2a'),this[_0x1e35('0x2b')][_0x1e35('0x2c')](this));ami['on']('queuecallerabandon',this[_0x1e35('0x2d')][_0x1e35('0x2c')](this));ami['on'](_0x1e35('0x2e'),this[_0x1e35('0x2f')][_0x1e35('0x2c')](this));ami['on'](_0x1e35('0x30'),this[_0x1e35('0x31')][_0x1e35('0x2c')](this));ami['on'](_0x1e35('0x32'),this[_0x1e35('0xb')]['bind'](this));ami['on'](_0x1e35('0x33'),this['syncQueueSummaryComplete'][_0x1e35('0x2c')](this));ami['on']('hangup',this[_0x1e35('0x34')]['bind'](this));ami['on'](_0x1e35('0x35'),this['syncNewExten'][_0x1e35('0x2c')](this));ami['on'](_0x1e35('0x36'),this[_0x1e35('0x37')][_0x1e35('0x2c')](this));ami['on'](_0x1e35('0x38'),this[_0x1e35('0x39')][_0x1e35('0x2c')](this));ami['on'](_0x1e35('0x3a'),this[_0x1e35('0x3b')][_0x1e35('0x2c')](this));this[_0x1e35('0x3c')]();this[_0x1e35('0x3d')]();RpcSetting[_0x1e35('0x3e')]()[_0x1e35('0x3f')](function(_0x262cb0){previewRecallmeReminderInterval=_0x262cb0[_0x1e35('0x40')];});}function isNotNull(_0x31a223){return _0x31a223!==null&&!_[_0x1e35('0x41')](_0x31a223);}function msgResponse(_0x34afef,_0x33a889,_0x2d2b1f){return{'action':_0x34afef,'response':_0x33a889,'message':_0x2d2b1f,'stack':_0x2d2b1f};}function emit(_0x30698c,_0x2e2159,_0x41eba8){io['to'](_0x30698c)[_0x1e35('0x42')](_0x2e2159,_0x41eba8);}function emitOutboundVoiceQueueSummary(_0x14d39f){if(_0x14d39f[_0x1e35('0x43')]==='outbound'){logger[_0x1e35('0x44')](_0x1e35('0x45'),util['inspect'](_0x14d39f,{'showHidden':![],'depth':null}));emit(util[_0x1e35('0x46')](_0x1e35('0x47'),_0x14d39f[_0x1e35('0x48')]),_0x1e35('0x49'),_0x14d39f);}}function checkGetDataPredictive(_0x530276){if(isNotNull(_0x530276)&&!_[_0x1e35('0x4a')](_0x530276)){loggerPredictive[_0x1e35('0x4b')](_0x1e35('0x4c'));loggerPredictive[_0x1e35('0x4b')](_0x1e35('0x4d'),_0x530276['predictiveIntervalTotalCalls']);loggerPredictive[_0x1e35('0x4b')](_0x1e35('0x4e'),_0x530276[_0x1e35('0x4f')]);loggerPredictive['info'](_0x1e35('0x50'),_0x530276[_0x1e35('0x51')]);loggerPredictive[_0x1e35('0x4b')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x530276['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x1e35('0x4b')](_0x1e35('0x52'),_0x530276['predictiveIntervalAvgHoldtime']);loggerPredictive[_0x1e35('0x4b')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x530276[_0x1e35('0x53')]);loggerPredictive[_0x1e35('0x4b')](_0x1e35('0x54'));if(_0x530276['predictiveIntervalTotalCalls']>0x0){if(!_[_0x1e35('0x41')](_0x530276[_0x1e35('0x53')])&&_0x530276[_0x1e35('0x53')]>0x0){return!![];}loggerPredictive[_0x1e35('0x4b')](_0x1e35('0x55'));if(!_[_0x1e35('0x41')](_0x530276['predictiveIntervalAvgHoldtime'])&&_0x530276[_0x1e35('0x56')]>0x0){return!![];}loggerPredictive[_0x1e35('0x4b')](_0x1e35('0x57'));}else{loggerPredictive[_0x1e35('0x4b')](_0x1e35('0x58'));}}else{loggerPredictive[_0x1e35('0x4b')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x55c438){return function(_0x426268){loggerPredictive[_0x1e35('0x4b')](_0x1e35('0x59'));loggerPredictive[_0x1e35('0x4b')](_0x1e35('0x5a'),_0x426268[_0x1e35('0x5b')]);loggerPredictive[_0x1e35('0x4b')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x426268[_0x1e35('0x5c')]);loggerPredictive[_0x1e35('0x4b')](_0x1e35('0x5d'),_0x426268[_0x1e35('0x5e')]);loggerPredictive[_0x1e35('0x4b')](_0x1e35('0x5f'),_0x426268[_0x1e35('0x60')]);loggerPredictive[_0x1e35('0x4b')](_0x1e35('0x5d'),_0x426268[_0x1e35('0x5e')]);loggerPredictive['info'](_0x1e35('0x54'));_[_0x1e35('0x61')](_0x55c438,_0x426268);};}function ifInterval(_0x2ced7b,_0x3f5108){if(_[_0x1e35('0x41')](_0x3f5108)){return![];}return utils['getSeconds'](undefined,_0x3f5108)<_0x2ced7b*0x3c;}function clearPredictiveAttributes(_0x4a476d){if(_0x4a476d[_0x1e35('0x26')]){_0x4a476d['startProgressive']=undefined;loggerPredictive['debug'](_0x4a476d[_0x1e35('0x48')],'startProgressive\x20value\x20cleared');}if(_0x4a476d['startPredictive']){_0x4a476d['startPredictive']=undefined;loggerPredictive[_0x1e35('0x44')](_0x4a476d['name'],'startPredictive\x20value\x20cleared');}if(_0x4a476d[_0x1e35('0x62')]){clearInterval(_0x4a476d[_0x1e35('0x62')]);_0x4a476d['handlePredictive']=undefined;loggerPredictive[_0x1e35('0x44')](_0x4a476d[_0x1e35('0x48')],_0x1e35('0x63'));}}function loggerCatchPredictive(_0x3a1a63,_0x5a072b){return function(_0x2e68d1){loggerPredictive[_0x1e35('0x64')](_0x5a072b['name'],_0x3a1a63);loggerPredictive[_0x1e35('0x64')](_0x2e68d1[_0x1e35('0x65')]);clearPredictiveAttributes(_0x5a072b);};}function loggerCatch(_0x123b78){return function(_0x4677c0){logger[_0x1e35('0x64')](_0x123b78,util[_0x1e35('0x66')](_0x4677c0,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x3632ff,_0x4d0792,_0xf56dcd){return function(_0x3d0cb0){utils[_0x1e35('0x67')](_0x4d0792,_0xf56dcd,0x0);_0x4d0792['temp']=0x0;logger['error'](_0x3632ff,util[_0x1e35('0x66')](_0x3d0cb0,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x364475){return function(_0x42a903){if(isNotNull(_0x42a903)&&isNotNull(_0x42a903[0x0])){if(_0x42a903[0x0][_0x1e35('0x68')]>0x0){_0x364475['message']=utils[_0x1e35('0x69')][_0x1e35('0x6a')];logger[_0x1e35('0x4b')](_0x1e35('0x6b')+_0x364475[_0x1e35('0x48')],_0x42a903[0x0][_0x1e35('0x68')],'contacts');}else{_0x364475[_0x1e35('0x6c')]=utils['CAMPAIGN_STATUS'][_0x1e35('0x6d')];logger[_0x1e35('0x4b')](_0x1e35('0x6e')+_0x364475['name']);}}};}function createObjHistory(_0x403c0a,_0x1c7c79,_0x17e8b7,_0x2cb13d,_0x4e3cba){_0x403c0a[_0x1e35('0x6c')]=_0x17e8b7;var _0xdff37=new Action(_0x403c0a,_0x1c7c79);var _0x506ce5=new History(_0xdff37);_0x506ce5[_0x1e35('0x6f')]=_0x2cb13d;_0x506ce5[_0x1e35('0x70')]=_0x4e3cba;_0x506ce5['endtime']=_0xdff37[_0x1e35('0x71')];return _0x506ce5;}function unlockQueueStatus(_0x2d4e65,_0x45b8a8){setTimeout(function(){if(_[_0x1e35('0x41')](_0x2d4e65[_0x1e35('0x72')])){loggerBooked[_0x1e35('0x64')](_0x1e35('0x73'),_0x45b8a8);}_0x2d4e65[_0x1e35('0x72')]=!![];loggerBooked[_0x1e35('0x4b')](_0x1e35('0x74'),_0x45b8a8,JSON['stringify'](_[_0x1e35('0x75')](_0x2d4e65,[_0x1e35('0x48'),_0x1e35('0x72')])));},0x1f3);}function checkInterval(_0x423700){return function(){if(!isNotNull(_0x423700['Interval'])){_0x423700[_0x1e35('0x6c')]=utils[_0x1e35('0x69')][_0x1e35('0x76')];throw _0x423700[_0x1e35('0x48')]+_0x1e35('0x77');}if(!isNotNull(_0x423700[_0x1e35('0x78')][_0x1e35('0x79')])){_0x423700[_0x1e35('0x6c')]=utils['CAMPAIGN_STATUS'][_0x1e35('0x76')];throw _0x423700[_0x1e35('0x48')]+_0x1e35('0x77');}if(!isNotNull(_['isEmpty'](_0x423700[_0x1e35('0x78')]['Intervals']))){_0x423700[_0x1e35('0x6c')]=utils[_0x1e35('0x69')][_0x1e35('0x76')];throw _0x423700[_0x1e35('0x48')]+_0x1e35('0x77');}};}function checkIsIVRCampaignActive(_0x4bac1c){return function(){if(!utils['isIVRCampaignActive'](_0x4bac1c)){_0x4bac1c[_0x1e35('0x6c')]=utils[_0x1e35('0x69')][_0x1e35('0x7a')];throw _0x4bac1c[_0x1e35('0x48')]+_0x1e35('0x7b');}};}function emitCampaignSummary(_0x37ddec){if(utils[_0x1e35('0x7c')](_0x37ddec)){emit(util['format'](_0x1e35('0x7d'),_0x37ddec[_0x1e35('0x48')]),'campaign:save',_0x37ddec);}}function loggerCatchQueueSummary(_0x4a8654,_0x4e234a){return function(_0x3aa871){clearPredictiveAttributes(_0x4e234a);emitCampaignSummary(_0x4e234a);loggerSyncQueueSummary[_0x1e35('0x44')](_0x4a8654,util[_0x1e35('0x66')](_0x3aa871,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x1dc458){if(_0x1dc458[_0x1e35('0x7e')]){if(_0x1dc458[_0x1e35('0x7f')]===0x0){_0x1dc458[_0x1e35('0x7e')]=![];_0x1dc458[_0x1e35('0x6c')]=utils[_0x1e35('0x69')][_0x1e35('0x7a')];loggerSyncQueueSummary['debug'](_0x1e35('0x80'),_0x1dc458[_0x1e35('0x48')],'is\x20not\x20active');}else{_0x1dc458[_0x1e35('0x6c')]=utils[_0x1e35('0x69')][_0x1e35('0x81')];loggerSyncQueueSummary[_0x1e35('0x44')](_0x1e35('0x80'),_0x1dc458[_0x1e35('0x48')],_0x1e35('0x82'));}emitCampaignSummary(_0x1dc458);}}function myreject(_0x4a607c){return function(_0x1d9655){return _0x4a607c(msgResponse('[ifTime][Action]',_0x1e35('0x83'),JSON['stringify'](_0x1d9655)));};}Dialer[_0x1e35('0x17')][_0x1e35('0x84')]=function(_0x56823d){return!_['isUndefined'](_0x56823d)&&_0x56823d&&!_[_0x1e35('0x41')](_0x56823d[_0x1e35('0x48')])&&!_[_0x1e35('0x41')](_0x56823d[_0x1e35('0x85')])&&_0x56823d[_0x1e35('0x85')]&&(this[_0x1e35('0x1f')][util[_0x1e35('0x46')](_0x1e35('0x86'),_0x56823d['name'])][_0x1e35('0x87')]===_0x1e35('0x88')||this[_0x1e35('0x1f')][util[_0x1e35('0x46')](_0x1e35('0x86'),_0x56823d[_0x1e35('0x48')])][_0x1e35('0x87')]===_0x1e35('0x89'));};Dialer[_0x1e35('0x17')]['checkIsTrunkReachable']=function(_0x4bc41f){var _0xbb3c5=this;return function(){if(!_0xbb3c5[_0x1e35('0x84')](_0x4bc41f[_0x1e35('0x8a')])){if(!_0xbb3c5[_0x1e35('0x84')](_0x4bc41f['TrunkBackup'])){_0x4bc41f[_0x1e35('0x6c')]=utils[_0x1e35('0x69')][_0x1e35('0x8b')];throw _0x4bc41f[_0x1e35('0x48')]+_0x1e35('0x8c');}}};};Dialer[_0x1e35('0x17')][_0x1e35('0x8d')]=function(_0x39e12d,_0x182fa8,_0x172097,_0x55b6ab){var _0xc56a42=this;return function(){var _0x5edc4e=!![];return _0xc56a42[_0x1e35('0x8e')](_0x39e12d,_0x182fa8,_0x172097,_0x55b6ab,_0x5edc4e);};};Dialer[_0x1e35('0x17')]['checkIfTimeIntervals']=function(_0x56eb86,_0x773c37,_0x269f98,_0x4a9a02){var _0x56936b=this;return function(){var _0x52766d=![];return _0x56936b[_0x1e35('0x8e')](_0x56eb86[_0x1e35('0x79')],_0x773c37,_0x269f98,_0x4a9a02,_0x52766d);};};Dialer[_0x1e35('0x17')][_0x1e35('0x8e')]=function(_0x7694e0,_0xf4a6e2,_0x1639bd,_0x46504c,_0x1d0085){var _0x378a49=[];return new Promise(function(_0x3c9664,_0x3396d5){if(!isNotNull(_0x7694e0)){_0x46504c[_0x1e35('0x6c')]=utils[_0x1e35('0x69')][_0x1e35('0x76')];return _0x3396d5(msgResponse(_0x1e35('0x8f'),_0x1e35('0x90'),_0x1639bd+_0x1e35('0x91')));}if(_[_0x1e35('0x4a')](_0x7694e0)){_0x46504c['message']=utils[_0x1e35('0x69')][_0x1e35('0x92')];return _0x3396d5(msgResponse('ifTime',_0x1e35('0x90'),_0x1639bd+_0x1e35('0x93')));}if(_0xf4a6e2&&_[_0x1e35('0x41')](config[_0x1e35('0x94')][_0xf4a6e2])){_0x46504c['message']=utils['CAMPAIGN_STATUS'][_0x1e35('0x95')];return _0x3396d5(msgResponse(_0x1e35('0x8f'),_0x1e35('0x90'),_0x1639bd+_0x1e35('0x96')+_0xf4a6e2));}if(_['isArray'](_0x7694e0)){for(var _0x4cef12=0x0;_0x4cef12<_0x7694e0[_0x1e35('0x97')];_0x4cef12+=0x1){_0x378a49[_0x1e35('0x98')](ami['Action']({'action':_0x1e35('0x99'),'command':util[_0x1e35('0x46')]('iftime\x20%s,%s',_0x7694e0[_0x4cef12][_0x1e35('0x9a')],!_['isUndefined'](config[_0x1e35('0x94')][_0xf4a6e2])?_0xf4a6e2:'')})[_0x1e35('0x3f')](function(_0xf6f6f9){return _0xf6f6f9[_0x1e35('0x9b')]['indexOf'](_0x1e35('0x9c'))>=0x0;})[_0x1e35('0x9d')](myreject(_0x3396d5)));}}else{_0x378a49[_0x1e35('0x98')](ami['Action']({'action':'command','command':util['format']('iftime\x20%s,%s',_0x7694e0,!_[_0x1e35('0x41')](config[_0x1e35('0x94')][_0xf4a6e2])?_0xf4a6e2:'')})[_0x1e35('0x3f')](function(_0x54c1f5){return _0x54c1f5[_0x1e35('0x9b')][_0x1e35('0x9e')](_0x1e35('0x9c'))>=0x0;})[_0x1e35('0x9d')](myreject(_0x3396d5)));}Promise[_0x1e35('0x9f')](_0x378a49)[_0x1e35('0x3f')](function(_0x14574e){var _0x41920f=_['some'](_0x14574e);if(_0x41920f){return _0x3c9664(_0x41920f);}else{_0x46504c[_0x1e35('0x6c')]=_0x1d0085?utils[_0x1e35('0x69')][_0x1e35('0xa0')]:utils[_0x1e35('0x69')][_0x1e35('0xa1')];return _0x3396d5(msgResponse('[ifTime][promiseAll]',_0x1e35('0x90'),'Global:\x20'+_0x1d0085+'\x20'+_0x1639bd+_0x1e35('0xa2')+util[_0x1e35('0x66')](_0x7694e0,{'showHidden':![],'depth':null})+_0x1e35('0xa3')+_0xf4a6e2));}})[_0x1e35('0x9d')](function(_0x1f639d){return _0x3396d5(msgResponse(_0x1e35('0x8f'),'Failure',JSON[_0x1e35('0xa4')](_0x1f639d)));});});};Dialer[_0x1e35('0x17')][_0x1e35('0x3c')]=function(){var _0x408247=this;return cmHopper[_0x1e35('0xa5')]({'active':![]},{'where':{'active':!![]}})[_0x1e35('0x3f')](function(){setInterval(function(){_0x408247['syncCampaigns']();},0x3e8);});};Dialer[_0x1e35('0x17')][_0x1e35('0xa6')]=function(){var _0x37d5be=this;var _0x552ec6;for(var _0x232e1e in this[_0x1e35('0x1d')]){if(typeof this[_0x1e35('0x1d')][_0x232e1e]!=='undefined'){_0x552ec6=this[_0x1e35('0x1d')][_0x232e1e];if(utils[_0x1e35('0x7c')](_0x552ec6)&&utils[_0x1e35('0xa7')](_0x552ec6)){_0x552ec6[_0x1e35('0x7e')]=!![];Promise[_0x1e35('0xa8')]()['then'](checkIsIVRCampaignActive(_0x552ec6))[_0x1e35('0x3f')](checkInterval(_0x552ec6))[_0x1e35('0x3f')](_0x37d5be[_0x1e35('0xa9')](_0x552ec6))[_0x1e35('0x3f')](_0x37d5be[_0x1e35('0x8d')](_0x552ec6[_0x1e35('0xaa')],_0x552ec6[_0x1e35('0xab')],_0x552ec6['name'],_0x552ec6))[_0x1e35('0x3f')](_0x37d5be[_0x1e35('0xac')](_0x552ec6['Interval'],_0x552ec6[_0x1e35('0xab')],_0x552ec6[_0x1e35('0x48')],_0x552ec6))[_0x1e35('0x3f')](_0x37d5be[_0x1e35('0xad')](_0x552ec6))[_0x1e35('0x9d')](loggerCatchQueueSummary(_0x1e35('0xae'),_0x552ec6));}else{notSendMessagesCampaign(_0x552ec6);}}}};Dialer['prototype'][_0x1e35('0xaf')]=function(_0xf69491){if(_0xf69491['dialMethod']!=='predictive'){clearPredictiveAttributes(_0xf69491);}switch(_0xf69491[_0x1e35('0xb0')]){case'progressive':this['handlePower'](_0xf69491,0x1);break;case _0x1e35('0xb1'):this[_0x1e35('0xb2')](_0xf69491,_0xf69491[_0x1e35('0xb3')]);break;case'predictive':this[_0x1e35('0xb4')](_0xf69491);break;case'booked':this[_0x1e35('0xb2')](_0xf69491,0x1);break;default:logger[_0x1e35('0x64')](_0x1e35('0xb5'),_0xf69491[_0x1e35('0x48')],_0x1e35('0xb6'));}};Dialer[_0x1e35('0x17')][_0x1e35('0x8f')]=function(_0x587807,_0x22fc4e){var _0x24103b=_0x587807[_0x1e35('0xab')];var _0x6b3a44=_0x22fc4e?_0x587807[_0x1e35('0xaa')]:_0x587807['Interval'][_0x1e35('0x79')];logger[_0x1e35('0xb7')]('Dialer::ifTime()',_0x6b3a44,_0x24103b,_0x587807[_0x1e35('0x48')],util[_0x1e35('0x46')](_0x1e35('0xb8'),_0x587807['name'],_0x587807['id']));var _0x401f95=null;return Interval[_0x1e35('0xb9')](_0x6b3a44,_0x24103b)[_0x1e35('0x3f')](function(_0x2d75dc){if(_0x2d75dc===!![]){return _0x2d75dc;}else{_0x587807[_0x1e35('0x6c')]=_0x22fc4e?utils[_0x1e35('0x69')]['OVERTIME_GLOBAL_INTERVAL']:utils[_0x1e35('0x69')][_0x1e35('0xa1')];_0x401f95=msgResponse('[ifTime][promiseAll]','Failure',_0x1e35('0xba')+_0x22fc4e+'\x20'+_0x587807['name']+_0x1e35('0xa2')+util[_0x1e35('0x66')](_0x6b3a44,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x24103b);}if(_0x401f95!==null){logger[_0x1e35('0xb7')](_0x1e35('0xbb'),_0x401f95);_0x401f95[_0x1e35('0xbc')]=_0x22fc4e;throw _0x401f95;}})[_0x1e35('0x9d')](function(_0x54948b){logger[_0x1e35('0x64')](_0x1e35('0xbd'),_0x54948b);throw msgResponse('[ifTime][Action]','Error',util['inspect'](_0x54948b,{'showHidden':![],'depth':null}));});};Dialer[_0x1e35('0x17')]['syncAgentConnect']=function(_0x245014){if(this['voiceQueues'][_0x245014[_0x1e35('0xbe')]]){if(this[_0x1e35('0x23')][_0x245014[_0x1e35('0xbf')]]&&this['uniqueId'][_0x245014['uniqueid']]['type']!==_0x1e35('0xc0')){this[_0x1e35('0xc1')](this[_0x1e35('0x1c')][_0x245014[_0x1e35('0xbe')]]);this[_0x1e35('0x23')][_0x245014[_0x1e35('0xbf')]][_0x1e35('0xc2')]=moment()[_0x1e35('0x46')](_0x1e35('0xc3'));}}};Dialer[_0x1e35('0x17')][_0x1e35('0x31')]=function(_0x1a1d07){var _0x488c23=this[_0x1e35('0x23')][_0x1a1d07[_0x1e35('0xbf')]];if(this['voiceQueues'][_0x1a1d07[_0x1e35('0xbe')]]){if(_0x488c23&&_0x488c23['type']!==_0x1e35('0xc0')){delete this['uniqueId'][_0x1a1d07['uniqueid']];this[_0x1e35('0x1c')][_0x1a1d07[_0x1e35('0xbe')]][_0x1e35('0xc4')]+=0x1;var _0x113b6f=new AgentComplete(_0x488c23,_0x1a1d07);if(_0x1a1d07[_0x1e35('0xc5')]===_0x1e35('0xc6')){_0x113b6f['agiafterat']=this[_0x1e35('0x1c')][_0x1a1d07[_0x1e35('0xbe')]][_0x1e35('0xc7')]&&this[_0x1e35('0x1c')][_0x1a1d07[_0x1e35('0xbe')]]['dialAgiAfterHangupAgent']?moment()['format'](_0x1e35('0xc3')):undefined;}hopperUtils[_0x1e35('0xc8')](_0x113b6f)[_0x1e35('0x9d')](loggerCatch(_0x1e35('0xc9')));hopperUtils[_0x1e35('0xca')](_0x113b6f)[_0x1e35('0x9d')](loggerCatch(_0x1e35('0xcb')));}}};Dialer[_0x1e35('0x17')][_0x1e35('0x2d')]=function(_0x8e8e15){var _0xcbeaa7=this[_0x1e35('0x23')][_0x8e8e15[_0x1e35('0xbf')]];var _0x58e418=this;var _0x1402a5=![];var _0x318362;var _0x5b46e3;if(this['voiceQueues'][_0x8e8e15[_0x1e35('0xbe')]]){if(_0xcbeaa7&&_0xcbeaa7[_0x1e35('0x43')]!==_0x1e35('0xc0')){delete this[_0x1e35('0x23')][_0x8e8e15[_0x1e35('0xbf')]];this[_0x1e35('0xc1')](this[_0x1e35('0x1c')][_0x8e8e15[_0x1e35('0xbe')]]);_0xcbeaa7['droptime']=moment()['format'](_0x1e35('0xc3'));var _0xc5aced=new QueueCallerAbandon(_0xcbeaa7,_0x8e8e15);if(utils[_0x1e35('0xcc')](_0xcbeaa7['droptime'],_0xcbeaa7[_0x1e35('0xcd')])>=_0xcbeaa7[_0x1e35('0xce')]){this[_0x1e35('0x1c')][_0x8e8e15[_0x1e35('0xbe')]][_0x1e35('0x51')]+=0x1;this['voiceQueues'][_0x8e8e15['queue']][_0x1e35('0xcf')]+=0x1;this[_0x1e35('0x1c')][_0x8e8e15[_0x1e35('0xbe')]][_0x1e35('0xd0')]+=0x1;_0xc5aced[_0x1e35('0x6f')]=0xa;_0xc5aced[_0x1e35('0x70')]=_0x1e35('0xd1');_0xc5aced[_0x1e35('0xd2')]=_0x1e35('0xd3');_0xc5aced[_0x1e35('0xd4')]=this[_0x1e35('0x1c')][_0x8e8e15['queue']][_0x1e35('0xc7')]?moment()['format'](_0x1e35('0xc3')):undefined;_0xc5aced[_0x1e35('0xd5')]+=0x1;_0xc5aced['countglobal']+=0x1;_0x318362=this['voiceQueues'][_0x8e8e15[_0x1e35('0xbe')]]['dialDropRetryFrequency'];_0x5b46e3=this[_0x1e35('0x1c')][_0x8e8e15['queue']][_0x1e35('0xd6')];hopperUtils[_0x1e35('0xd7')](_0xc5aced,_0xc5aced[_0x1e35('0x6f')],_0xcbeaa7[_0x1e35('0xd8')])['then'](function(_0x3b64ad){_0x1402a5=_0x3b64ad[_0x1e35('0xd9')]==0x1;if(_0xc5aced[_0x1e35('0xd5')]>=_0x58e418[_0x1e35('0x1c')][_0x8e8e15[_0x1e35('0xbe')]][_0x1e35('0xda')]){_0x58e418[_0x1e35('0xdb')](_0xc5aced,_0x3b64ad['additional']);}else{hopperUtils[_0x1e35('0xdc')]({'active':![],'countdropretry':_0xc5aced[_0x1e35('0xd5')],'scheduledat':moment()[_0x1e35('0xdd')](_0x58e418[_0x1e35('0x1c')][_0x8e8e15[_0x1e35('0xbe')]][_0x1e35('0xde')],'minutes')[_0x1e35('0x46')](_0x1e35('0xc3')),'ContactId':_0xcbeaa7[_0x1e35('0xdf')],'ListId':_0xcbeaa7[_0x1e35('0xe0')],'VoiceQueueId':_0xcbeaa7[_0x1e35('0xe1')]||undefined,'CampaignId':_0xcbeaa7[_0x1e35('0xe2')]||undefined})[_0x1e35('0x9d')](loggerCatch(_0x1e35('0xe3')));var _0x5347fd=new History(_0xc5aced);_0x5347fd[_0x1e35('0x6f')]=0xa;_0x5347fd[_0x1e35('0x70')]=_0x1e35('0xd1');_0x5347fd[_0x1e35('0x71')]=moment()[_0x1e35('0x46')](_0x1e35('0xc3'));_0x5347fd[_0x1e35('0xe4')]=_0x5347fd[_0x1e35('0x71')];_0x5347fd[_0x1e35('0xe5')]=_0xc5aced[_0x1e35('0xe5')];_0x5347fd['calleridnum']=_0xc5aced[_0x1e35('0xe6')];hopperUtils[_0x1e35('0xc8')](_0x5347fd)[_0x1e35('0x9d')](loggerCatch(_0x1e35('0xe7')));}})[_0x1e35('0x3f')](function(){if(_0x1402a5)hopperUtils[_0x1e35('0xe8')](_0xc5aced,_0x318362,_0x5b46e3)['then'](function(){return 0x1;});});}else{this[_0x1e35('0x1c')][_0x8e8e15[_0x1e35('0xbe')]][_0x1e35('0xe9')]+=0x1;this[_0x1e35('0x1c')][_0x8e8e15[_0x1e35('0xbe')]]['outboundDropCallsDayCallersExit']+=0x1;_0xc5aced[_0x1e35('0x6f')]=0xb;_0xc5aced[_0x1e35('0x70')]='Abandoned';_0xc5aced['dropreason']=_0x1e35('0xea');_0xc5aced['countabandonedretry']+=0x1;_0xc5aced[_0x1e35('0xeb')]+=0x1;_0x318362=this[_0x1e35('0x1c')][_0x8e8e15['queue']][_0x1e35('0xec')];_0x5b46e3=this['voiceQueues'][_0x8e8e15['queue']][_0x1e35('0xd6')];hopperUtils[_0x1e35('0xd7')](_0xc5aced,_0xc5aced['state'],_0xcbeaa7[_0x1e35('0xd8')])[_0x1e35('0x3f')](function(_0x5a90ba){if(_0xc5aced['countabandonedretry']>=_0x58e418[_0x1e35('0x1c')][_0x8e8e15['queue']][_0x1e35('0xed')]){_0x58e418[_0x1e35('0xdb')](_0xc5aced,_0x5a90ba['additional']);}else{hopperUtils[_0x1e35('0xdc')]({'active':![],'countabandonedretry':_0xc5aced['countabandonedretry'],'scheduledat':moment()[_0x1e35('0xdd')](_0x58e418[_0x1e35('0x1c')][_0x8e8e15[_0x1e35('0xbe')]][_0x1e35('0xec')],'minutes')[_0x1e35('0x46')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xcbeaa7[_0x1e35('0xdf')],'ListId':_0xcbeaa7[_0x1e35('0xe0')],'VoiceQueueId':_0xcbeaa7[_0x1e35('0xe1')]||undefined,'CampaignId':_0xcbeaa7[_0x1e35('0xe2')]||undefined})[_0x1e35('0x9d')](loggerCatch(_0x1e35('0xee')));var _0x3bef2c=new History(_0xc5aced);_0x3bef2c[_0x1e35('0x6f')]=0xb;_0x3bef2c[_0x1e35('0x70')]='Abandoned';_0x3bef2c[_0x1e35('0x71')]=moment()[_0x1e35('0x46')]('YYYY-MM-DD\x20HH:mm:ss');_0x3bef2c['endtime']=_0x3bef2c[_0x1e35('0x71')];_0x3bef2c['calleridname']=_0xc5aced['calleridname'];_0x3bef2c[_0x1e35('0xe6')]=_0xc5aced[_0x1e35('0xe6')];hopperUtils[_0x1e35('0xc8')](_0x3bef2c)['catch'](loggerCatch('[syncAgentComplete][createHistory][11]'));}})['then'](function(){if(_0x1402a5)hopperUtils[_0x1e35('0xe8')](_0xc5aced,_0x318362,_0x5b46e3)[_0x1e35('0x3f')](function(){return 0x1;});});}}}};Dialer[_0x1e35('0x17')][_0x1e35('0xef')]=function(_0x3eba71){if(this[_0x1e35('0x21')][_0x3eba71['uniqueid']]){this[_0x1e35('0x21')][_0x3eba71[_0x1e35('0xbf')]][_0x1e35('0xf0')]=_0x3eba71[_0x1e35('0xf0')];}if(this[_0x1e35('0x23')][_0x3eba71[_0x1e35('0xbf')]]){this[_0x1e35('0x23')][_0x3eba71['uniqueid']][_0x1e35('0xf0')]=_0x3eba71[_0x1e35('0xf0')];}};Dialer[_0x1e35('0x17')][_0x1e35('0x39')]=function(_0x25e58e){if(!this['actions'][_0x25e58e['actionid']]){return;}var _0xab3ac9=this[_0x1e35('0x1c')][this[_0x1e35('0x21')][_0x25e58e[_0x1e35('0xf1')]]['queue']][_0x1e35('0xf2')]||_0x1e35('0xf3');if(_0xab3ac9==='roundrobin'){if(this[_0x1e35('0x21')][_0x25e58e['actionid']]&&_[_0x1e35('0xf4')](this['actions'][_0x25e58e[_0x1e35('0xf1')]][_0x1e35('0xf5')])&&_0x25e58e[_0x1e35('0x87')]==='1'&&_0x25e58e[_0x1e35('0xf6')]==='0'){if(this[_0x1e35('0x1e')][_0x25e58e[_0x1e35('0xf7')]]){if(!this[_0x1e35('0x1e')][_0x25e58e[_0x1e35('0xf7')]]['locked']){this[_0x1e35('0x1e')][_0x25e58e[_0x1e35('0xf7')]][_0x1e35('0xf5')]=!![];this['actions'][_0x25e58e['actionid']][_0x1e35('0xf5')]=!![];this[_0x1e35('0x21')][_0x25e58e[_0x1e35('0xf1')]][_0x1e35('0xf7')]=_0x25e58e[_0x1e35('0xf7')];}}}}else if(_0xab3ac9===_0x1e35('0xf3')){if(this[_0x1e35('0x21')][_0x25e58e[_0x1e35('0xf1')]]){if(this[_0x1e35('0x1e')][_0x25e58e['stateinterface']]){this[_0x1e35('0x21')][_0x25e58e[_0x1e35('0xf1')]][_0x1e35('0xf7')]=_0x25e58e[_0x1e35('0xf7')];if(_['isNil'](this[_0x1e35('0x28')][this[_0x1e35('0x21')][_0x25e58e[_0x1e35('0xf1')]]['queue']])){this[_0x1e35('0x28')][this['actions'][_0x25e58e[_0x1e35('0xf1')]][_0x1e35('0xbe')]]=[];}this[_0x1e35('0x28')][this[_0x1e35('0x21')][_0x25e58e[_0x1e35('0xf1')]][_0x1e35('0xbe')]][_0x1e35('0x98')](_[_0x1e35('0x61')](_[_0x1e35('0x75')](this[_0x1e35('0x21')][_0x25e58e[_0x1e35('0xf1')]],[_0x1e35('0xf8'),_0x1e35('0xf7')]),{'status':_0x25e58e[_0x1e35('0x87')],'paused':_0x25e58e[_0x1e35('0xf6')]}));}}}};Dialer['prototype']['syncQueueStatusComplete']=function(_0x3cfa4b){if(!this[_0x1e35('0x21')][_0x3cfa4b[_0x1e35('0xf1')]]){return;}var _0x335970=this;var _0x56b144=this[_0x1e35('0x1c')][this[_0x1e35('0x21')][_0x3cfa4b[_0x1e35('0xf1')]][_0x1e35('0xbe')]];var _0x17a765=_0x56b144['strategy']||_0x1e35('0xf3');if(_0x17a765==='roundrobin'){if(this[_0x1e35('0x21')][_0x3cfa4b[_0x1e35('0xf1')]]&&this[_0x1e35('0x21')][_0x3cfa4b[_0x1e35('0xf1')]][_0x1e35('0xf7')]){this['preview'][_0x1e35('0xf9')](this['actions'][_0x3cfa4b[_0x1e35('0xf1')]][_0x1e35('0xf8')],this[_0x1e35('0x21')][_0x3cfa4b[_0x1e35('0xf1')]]['stateinterface'])[_0x1e35('0x9d')](function(_0x321cba){logger[_0x1e35('0x64')](_0x1e35('0xfa'),util[_0x1e35('0x66')](_0x321cba,{'showHidden':![],'depth':null}));})['finally'](function(){_0x335970[_0x1e35('0xc1')](_0x335970[_0x1e35('0x1c')][_0x335970[_0x1e35('0x21')][_0x3cfa4b[_0x1e35('0xf1')]][_0x1e35('0xbe')]]);_0x335970['agents'][_0x335970[_0x1e35('0x21')][_0x3cfa4b['actionid']]['stateinterface']][_0x1e35('0xf5')]=![];delete _0x335970[_0x1e35('0x21')][_0x3cfa4b[_0x1e35('0xf1')]];unlockQueueStatus(_0x56b144);});}else{this[_0x1e35('0xc1')](this[_0x1e35('0x1c')][this[_0x1e35('0x21')][_0x3cfa4b[_0x1e35('0xf1')]][_0x1e35('0xbe')]]);hopperUtils[_0x1e35('0xdc')]({'active':![],'ContactId':this[_0x1e35('0x21')][_0x3cfa4b[_0x1e35('0xf1')]][_0x1e35('0xdf')],'ListId':this[_0x1e35('0x21')][_0x3cfa4b['actionid']][_0x1e35('0xe0')],'VoiceQueueId':this['actions'][_0x3cfa4b[_0x1e35('0xf1')]][_0x1e35('0xe1')]||undefined,'CampaignId':this['actions'][_0x3cfa4b[_0x1e35('0xf1')]][_0x1e35('0xe2')]||undefined})[_0x1e35('0x9d')](loggerCatch(_0x1e35('0xfb')));delete this['actions'][_0x3cfa4b[_0x1e35('0xf1')]];unlockQueueStatus(_0x56b144);}}else if(_0x17a765===_0x1e35('0xf3')){var _0xdbc000;if(this[_0x1e35('0x21')][_0x3cfa4b['actionid']]&&!_['isEmpty'](this[_0x1e35('0x28')][this[_0x1e35('0x21')][_0x3cfa4b[_0x1e35('0xf1')]][_0x1e35('0xbe')]])){if(this[_0x1e35('0x29')][_0x335970[_0x1e35('0x21')][_0x3cfa4b['actionid']]['queue']]){this[_0x1e35('0x29')][_0x335970[_0x1e35('0x21')][_0x3cfa4b[_0x1e35('0xf1')]]['queue']]=this[_0x1e35('0x29')][this[_0x1e35('0x21')][_0x3cfa4b[_0x1e35('0xf1')]][_0x1e35('0xbe')]]?this[_0x1e35('0x29')][this[_0x1e35('0x21')][_0x3cfa4b['actionid']][_0x1e35('0xbe')]]:this[_0x1e35('0x28')][this[_0x1e35('0x21')][_0x3cfa4b['actionid']][_0x1e35('0xbe')]]?this[_0x1e35('0x28')][this[_0x1e35('0x21')][_0x3cfa4b[_0x1e35('0xf1')]][_0x1e35('0xbe')]][_0x1e35('0xfc')]||0x0:0x0;}this[_0x1e35('0x28')][this['actions'][_0x3cfa4b[_0x1e35('0xf1')]]['queue']][_0x1e35('0xfc')]=this[_0x1e35('0x29')][this[_0x1e35('0x21')][_0x3cfa4b[_0x1e35('0xf1')]]['queue']];for(var _0xe7cce2=0x0;_0xe7cce2<this[_0x1e35('0x28')][this[_0x1e35('0x21')][_0x3cfa4b[_0x1e35('0xf1')]][_0x1e35('0xbe')]]['length'];_0xe7cce2+=0x1){_0xdbc000=rr(this[_0x1e35('0x28')][this[_0x1e35('0x21')][_0x3cfa4b[_0x1e35('0xf1')]][_0x1e35('0xbe')]]);this['queueBookedRR'][_0x335970[_0x1e35('0x21')][_0x3cfa4b[_0x1e35('0xf1')]][_0x1e35('0xbe')]]=this[_0x1e35('0x28')][this[_0x1e35('0x21')][_0x3cfa4b[_0x1e35('0xf1')]][_0x1e35('0xbe')]][_0x1e35('0xfc')];if(_0xdbc000['status']==='1'&&_0xdbc000[_0x1e35('0xf6')]==='0'){break;}}if(!_[_0x1e35('0xf4')](_0xdbc000)){this['agents'][_0xdbc000[_0x1e35('0xf7')]][_0x1e35('0xfd')]=_[_0x1e35('0x41')](this[_0x1e35('0x1e')][_0xdbc000['stateinterface']][_0x1e35('0xfd')])?!![]:this['agents'][_0xdbc000[_0x1e35('0xf7')]][_0x1e35('0xfd')];}loggerBooked[_0x1e35('0x4b')]('[booked][RR]',_0x3cfa4b[_0x1e35('0xf1')],_0x1e35('0xfe'),JSON[_0x1e35('0xa4')](_[_0x1e35('0x75')](this['agents'][_0xdbc000['stateinterface']],[_0x1e35('0x48'),'unlockRR'])),_0x1e35('0xff'),JSON['stringify'](_0xdbc000[_0x1e35('0xf8')]));if(!_['isNil'](_0xdbc000)&&_0xdbc000[_0x1e35('0x87')]==='1'&&_0xdbc000[_0x1e35('0xf6')]==='0'&&this[_0x1e35('0x1e')][_0xdbc000[_0x1e35('0xf7')]]['unlockRR']){this[_0x1e35('0x1e')][_0xdbc000['stateinterface']][_0x1e35('0xfd')]=![];this['queueBooked'][_0x335970[_0x1e35('0x21')][_0x3cfa4b[_0x1e35('0xf1')]]['queue']]=[];this['preview']['run'](_0xdbc000[_0x1e35('0xf8')],_0xdbc000[_0x1e35('0xf7')])[_0x1e35('0x9d')](function(_0x5246cd){logger[_0x1e35('0x64')](_0x1e35('0xfa'),util[_0x1e35('0x66')](_0x5246cd,{'showHidden':![],'depth':null}));})[_0x1e35('0x19')](function(){_0x335970['updateOriginated'](_0x335970[_0x1e35('0x1c')][_0x335970[_0x1e35('0x21')][_0x3cfa4b[_0x1e35('0xf1')]][_0x1e35('0xbe')]]);setTimeout(function(){_0x335970[_0x1e35('0x1e')][_0xdbc000[_0x1e35('0xf7')]][_0x1e35('0xfd')]=!![];loggerBooked[_0x1e35('0x4b')](_0x1e35('0x100'),_0x3cfa4b[_0x1e35('0xf1')],'Agent:\x20',JSON['stringify'](_[_0x1e35('0x75')](_0x335970[_0x1e35('0x1e')][_0xdbc000[_0x1e35('0xf7')]],[_0x1e35('0x48'),_0x1e35('0xfd')])),_0x1e35('0xff'),JSON[_0x1e35('0xa4')](_0xdbc000[_0x1e35('0xf8')]));},0xc7);delete _0x335970[_0x1e35('0x21')][_0x3cfa4b[_0x1e35('0xf1')]];unlockQueueStatus(_0x56b144,_0x3cfa4b[_0x1e35('0xf1')]);});}else{loggerBooked[_0x1e35('0x4b')]('[booked][unlock]');this[_0x1e35('0xc1')](this[_0x1e35('0x1c')][this[_0x1e35('0x21')][_0x3cfa4b['actionid']]['queue']]);hopperUtils['rescheduleContact']({'active':![],'ContactId':this['actions'][_0x3cfa4b[_0x1e35('0xf1')]]['ContactId'],'ListId':this[_0x1e35('0x21')][_0x3cfa4b[_0x1e35('0xf1')]][_0x1e35('0xe0')],'VoiceQueueId':this['actions'][_0x3cfa4b[_0x1e35('0xf1')]][_0x1e35('0xe1')]||undefined,'CampaignId':this['actions'][_0x3cfa4b[_0x1e35('0xf1')]][_0x1e35('0xe2')]||undefined})['catch'](loggerCatch(_0x1e35('0xfb')));delete this['actions'][_0x3cfa4b['actionid']];unlockQueueStatus(_0x56b144);}}else{loggerBooked[_0x1e35('0x4b')](_0x1e35('0x101'));this['updateOriginated'](this[_0x1e35('0x1c')][this['actions'][_0x3cfa4b[_0x1e35('0xf1')]]['queue']]);hopperUtils[_0x1e35('0xdc')]({'active':![],'ContactId':this[_0x1e35('0x21')][_0x3cfa4b['actionid']][_0x1e35('0xdf')],'ListId':this[_0x1e35('0x21')][_0x3cfa4b[_0x1e35('0xf1')]][_0x1e35('0xe0')],'VoiceQueueId':this[_0x1e35('0x21')][_0x3cfa4b['actionid']][_0x1e35('0xe1')]||undefined,'CampaignId':this[_0x1e35('0x21')][_0x3cfa4b[_0x1e35('0xf1')]][_0x1e35('0xe2')]||undefined})[_0x1e35('0x9d')](loggerCatch('[unlock2][syncQueueStatusComplete]'));delete this[_0x1e35('0x21')][_0x3cfa4b['actionid']];unlockQueueStatus(_0x56b144);}}else{loggerBooked[_0x1e35('0x4b')](_0x1e35('0x102'));this[_0x1e35('0xc1')](this[_0x1e35('0x1c')][this[_0x1e35('0x21')][_0x3cfa4b[_0x1e35('0xf1')]][_0x1e35('0xbe')]]);hopperUtils[_0x1e35('0xdc')]({'active':![],'ContactId':this[_0x1e35('0x21')][_0x3cfa4b[_0x1e35('0xf1')]][_0x1e35('0xdf')],'ListId':this[_0x1e35('0x21')][_0x3cfa4b[_0x1e35('0xf1')]][_0x1e35('0xe0')],'VoiceQueueId':this[_0x1e35('0x21')][_0x3cfa4b[_0x1e35('0xf1')]][_0x1e35('0xe1')]||undefined,'CampaignId':this['actions'][_0x3cfa4b[_0x1e35('0xf1')]][_0x1e35('0xe2')]||undefined})[_0x1e35('0x9d')](loggerCatch('[unlock3][syncQueueStatusComplete]'));delete this[_0x1e35('0x21')][_0x3cfa4b[_0x1e35('0xf1')]];unlockQueueStatus(_0x56b144);}};Dialer[_0x1e35('0x17')]['syncOriginateResponse']=function(_0x10180b){var _0x2fcac8=this['actions'][_0x10180b['actionid']];if(_0x2fcac8){delete this[_0x1e35('0x21')][_0x10180b['actionid']];_0x2fcac8['responsetime']=moment()['format'](_0x1e35('0xc3'));var _0x10b693=_0x2fcac8[_0x1e35('0x43')]===_0x1e35('0xc0')?this[_0x1e35('0x1d')][_0x2fcac8[_0x1e35('0xbe')]]:this[_0x1e35('0x1c')][_0x2fcac8[_0x1e35('0x103')]()];if(_0x10180b[_0x1e35('0x104')]!==_0x1e35('0x105')){this[_0x1e35('0xc1')](_0x10b693);return this[_0x1e35('0x106')](_0x2fcac8,_0x10b693,_0x10180b)[_0x1e35('0x9d')](loggerCatch('[callProgressDetecting]\x20'));}this[_0x1e35('0x23')][_0x10180b['uniqueid']]=_0x2fcac8;}};Dialer[_0x1e35('0x17')][_0x1e35('0x37')]=function(_0x372b01){var _0x40eaa6=this;var _0x39375a=this[_0x1e35('0x23')][_0x372b01['uniqueid']];var _0x11172c;if(!_[_0x1e35('0xf4')](_0x372b01)&&!_[_0x1e35('0xf4')](_0x372b01[_0x1e35('0x107')])&&!_[_0x1e35('0xf4')](_0x372b01[_0x1e35('0x107')][_0x1e35('0x108')])&&_0x372b01[_0x1e35('0x109')]==='xcally-motion-dialer'&&_0x39375a){if(_0x39375a[_0x1e35('0x43')]!==_0x1e35('0xc0')&&this[_0x1e35('0x1c')][_0x39375a[_0x1e35('0xbe')]][_0x1e35('0x10a')]&&_0x372b01[_0x1e35('0x10b')]===_0x1e35('0x10c')){delete this['uniqueId'][_0x372b01[_0x1e35('0xbf')]];this[_0x1e35('0xc1')](this['voiceQueues'][_0x39375a[_0x1e35('0xbe')]]);this[_0x1e35('0x1c')][_0x39375a[_0x1e35('0xbe')]][_0x1e35('0xc4')]+=0x1;this[_0x1e35('0x1c')][_0x39375a[_0x1e35('0xbe')]][_0x1e35('0x10d')]+=0x1;_0x11172c=new Hangup(_0x39375a,_0x372b01);_0x11172c[_0x1e35('0x6f')]=0x12;_0x11172c[_0x1e35('0x70')]='HangupInAMD';_0x11172c[_0x1e35('0x10e')]=_0x1e35('0x10f');ami[_0x1e35('0x42')](_0x1e35('0x110'),ut[_0x1e35('0x111')](_0x11172c,'amd'));this[_0x1e35('0x112')](_0x11172c,_0x1e35('0x113'),'[syncHangupInAMD]');}if(_0x39375a[_0x1e35('0x43')]!==_0x1e35('0xc0')&&this[_0x1e35('0x1c')][_0x39375a[_0x1e35('0xbe')]][_0x1e35('0x10a')]&&_0x372b01[_0x1e35('0x10b')]==='MACHINE'){return new Promise(function(_0x25905b,_0x49b00a){delete _0x40eaa6[_0x1e35('0x23')][_0x372b01[_0x1e35('0xbf')]];_0x40eaa6[_0x1e35('0xc1')](_0x40eaa6[_0x1e35('0x1c')][_0x39375a[_0x1e35('0xbe')]]);_0x40eaa6[_0x1e35('0x1c')][_0x39375a[_0x1e35('0xbe')]][_0x1e35('0xc4')]+=0x1;_0x40eaa6[_0x1e35('0x1c')][_0x39375a['queue']][_0x1e35('0x10d')]+=0x1;var _0x4c745d=_0x40eaa6['voiceQueues'][_0x39375a[_0x1e35('0xbe')]];var _0x29df62=new Hangup(_0x39375a,_0x372b01);_0x29df62[_0x1e35('0x6f')]=0x13;_0x29df62[_0x1e35('0x70')]=_0x1e35('0x114');_0x29df62[_0x1e35('0x10e')]='AMD';_0x29df62[_0x1e35('0x115')]+=0x1;_0x29df62[_0x1e35('0xeb')]+=0x1;_0x29df62[_0x1e35('0x116')]=!![];ami['emit'](_0x1e35('0x110'),ut['buildObj'](_0x29df62,_0x1e35('0x116')));hopperUtils[_0x1e35('0xc8')](_0x29df62)[_0x1e35('0x9d')](loggerCatch(_0x1e35('0x117')));if(_0x29df62[_0x1e35('0x118')]+_0x29df62['countcongestionretry']+_0x29df62[_0x1e35('0x119')]+_0x29df62['countnosuchnumberretry']+_0x29df62[_0x1e35('0xd5')]+_0x29df62[_0x1e35('0x11a')]+_0x29df62[_0x1e35('0x115')]+_0x29df62[_0x1e35('0x11b')]>=_0x4c745d['dialGlobalMaxRetry']){_0x40eaa6['stateGlobal'](_0x29df62,_0x25905b,_0x49b00a,_0x1e35('0x11c'));}else{if(_0x29df62[_0x1e35('0x115')]>=_0x4c745d[_0x1e35('0x11d')]){_0x40eaa6['createStateFinal'](_0x29df62,_0x25905b,_0x49b00a,_0x1e35('0x11e'));}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x29df62[_0x1e35('0x115')],'scheduledat':moment()[_0x1e35('0xdd')](_0x4c745d[_0x1e35('0x11f')],_0x1e35('0x120'))[_0x1e35('0x46')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x29df62[_0x1e35('0xdf')],'ListId':_0x29df62[_0x1e35('0xe0')],'VoiceQueueId':_0x29df62[_0x1e35('0xe1')]||undefined,'CampaignId':_0x29df62['CampaignId']||undefined})['catch'](loggerCatch(_0x1e35('0x121')));_0x25905b({'reschedule':0x1});}}});}if(_0x39375a[_0x1e35('0x43')]===_0x1e35('0xc0')&&this[_0x1e35('0x1d')][_0x39375a[_0x1e35('0xbe')]][_0x1e35('0x10a')]&&_0x372b01[_0x1e35('0x10b')]==='HANGUP'){delete this['uniqueId'][_0x372b01[_0x1e35('0xbf')]];this['updateOriginated'](this['campaigns'][_0x39375a[_0x1e35('0xbe')]]);_0x11172c=new Hangup(_0x39375a,_0x372b01);_0x11172c[_0x1e35('0x6f')]=0x12;_0x11172c[_0x1e35('0x70')]=_0x1e35('0x122');_0x11172c['membername']=_0x1e35('0x10f');ami['emit']('custom:amd',ut[_0x1e35('0x111')](_0x11172c,_0x1e35('0x116')));this[_0x1e35('0x112')](_0x11172c,'[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]');}if(_0x39375a[_0x1e35('0x43')]==='ivr'&&this['campaigns'][_0x39375a['queue']][_0x1e35('0x10a')]&&_0x372b01[_0x1e35('0x10b')]===_0x1e35('0x123')){return new Promise(function(_0x8be506,_0x30162c){delete _0x40eaa6['uniqueId'][_0x372b01[_0x1e35('0xbf')]];_0x40eaa6[_0x1e35('0xc1')](_0x40eaa6['campaigns'][_0x39375a[_0x1e35('0xbe')]]);_0x40eaa6[_0x1e35('0x1d')][_0x39375a[_0x1e35('0xbe')]]['outboundAnswerCallsDay']+=0x1;_0x40eaa6[_0x1e35('0x1d')][_0x39375a[_0x1e35('0xbe')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x58a04c=_0x40eaa6[_0x1e35('0x1d')][_0x39375a[_0x1e35('0xbe')]];var _0x388429=new Hangup(_0x39375a,_0x372b01);_0x388429['state']=0x13;_0x388429[_0x1e35('0x70')]=_0x1e35('0x114');_0x388429[_0x1e35('0x10e')]='AMD';_0x388429[_0x1e35('0x115')]+=0x1;_0x388429['countglobal']+=0x1;_0x388429[_0x1e35('0x116')]=!![];ami['emit'](_0x1e35('0x110'),ut[_0x1e35('0x111')](_0x388429,_0x1e35('0x116')));hopperUtils[_0x1e35('0xc8')](_0x388429)[_0x1e35('0x9d')](loggerCatch(_0x1e35('0x117')));if(_0x388429[_0x1e35('0x118')]+_0x388429[_0x1e35('0x124')]+_0x388429[_0x1e35('0x119')]+_0x388429[_0x1e35('0x125')]+_0x388429[_0x1e35('0xd5')]+_0x388429[_0x1e35('0x11a')]+_0x388429['countmachineretry']+_0x388429['countagentrejectretry']>=_0x58a04c[_0x1e35('0x126')]){_0x40eaa6[_0x1e35('0x127')](_0x388429,_0x8be506,_0x30162c,_0x1e35('0x11c'));}else{if(_0x388429['countmachineretry']>=_0x58a04c[_0x1e35('0x11d')]){_0x40eaa6['createStateFinal'](_0x388429,_0x8be506,_0x30162c,'reason\x2019\x20machine....');}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x388429[_0x1e35('0x115')],'scheduledat':moment()['add'](_0x58a04c[_0x1e35('0x11f')],_0x1e35('0x120'))['format'](_0x1e35('0xc3')),'ContactId':_0x388429[_0x1e35('0xdf')],'ListId':_0x388429[_0x1e35('0xe0')],'VoiceQueueId':_0x388429[_0x1e35('0xe1')]||undefined,'CampaignId':_0x388429[_0x1e35('0xe2')]||undefined})[_0x1e35('0x9d')](loggerCatch('[rescheduleContact][Machine]'));_0x8be506({'reschedule':0x1});}}});}}};Dialer['prototype'][_0x1e35('0x34')]=function(_0x33ba0e){var _0x4416d4=this[_0x1e35('0x23')][_0x33ba0e[_0x1e35('0xbf')]];var _0x3d61e4;if(_0x4416d4&&_0x4416d4[_0x1e35('0x43')]===_0x1e35('0xc0')){delete this[_0x1e35('0x23')][_0x33ba0e[_0x1e35('0xbf')]];this[_0x1e35('0xc1')](this[_0x1e35('0x1d')][_0x4416d4[_0x1e35('0xbe')]]);this['campaigns'][_0x4416d4[_0x1e35('0xbe')]][_0x1e35('0x128')]+=0x1;_0x3d61e4=new Hangup(_0x4416d4,_0x33ba0e);hopperUtils[_0x1e35('0xc8')](_0x3d61e4)[_0x1e35('0x9d')](loggerCatch(_0x1e35('0x129')));hopperUtils[_0x1e35('0xca')](_0x3d61e4)['catch'](loggerCatch(_0x1e35('0x12a')));}if(_0x4416d4&&_0x4416d4[_0x1e35('0x43')]!=='ivr'&&isNotNull(this[_0x1e35('0x1c')][_0x4416d4[_0x1e35('0xbe')]][_0x1e35('0x12b')])){delete this['uniqueId'][_0x33ba0e[_0x1e35('0xbf')]];this[_0x1e35('0xc1')](this[_0x1e35('0x1c')][_0x4416d4[_0x1e35('0xbe')]]);this[_0x1e35('0x1c')][_0x4416d4[_0x1e35('0xbe')]]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x4416d4[_0x1e35('0xbe')]][_0x1e35('0x10d')]+=0x1;_0x3d61e4=new Hangup(_0x4416d4,_0x33ba0e);_0x3d61e4['state']=0x10;_0x3d61e4[_0x1e35('0x70')]='AnswerAGI';_0x3d61e4[_0x1e35('0x10e')]=_0x1e35('0x12c');hopperUtils[_0x1e35('0xc8')](_0x3d61e4)[_0x1e35('0x9d')](loggerCatch(_0x1e35('0x129')));hopperUtils[_0x1e35('0xca')](_0x3d61e4)['catch'](loggerCatch(_0x1e35('0x12a')));}if(_0x4416d4&&_0x4416d4[_0x1e35('0x43')]!==_0x1e35('0xc0')&&!isNotNull(this[_0x1e35('0x1c')][_0x4416d4[_0x1e35('0xbe')]][_0x1e35('0x12b')])){if(_0x33ba0e[_0x1e35('0x12d')]===_0x1e35('0x12e')){delete this[_0x1e35('0x23')][_0x33ba0e[_0x1e35('0xbf')]];this[_0x1e35('0x1c')][_0x4416d4['queue']]['outboundAnswerCallsDay']+=0x1;const _0x136d2a=new AgentComplete(_0x4416d4,_0x33ba0e);_0x136d2a[_0x1e35('0xe2')]=this[_0x1e35('0x1c')][_0x4416d4[_0x1e35('0xbe')]]['id'];hopperUtils['createHistory'](_0x136d2a)[_0x1e35('0x9d')](loggerCatch('[syncAgentComplete][createHistory]'));hopperUtils['moveContactManagedDialer'](_0x136d2a)[_0x1e35('0x9d')](loggerCatch('[syncAgentComplete]'));}else{delete this[_0x1e35('0x23')][_0x33ba0e['uniqueid']];this[_0x1e35('0xc1')](this['voiceQueues'][_0x4416d4[_0x1e35('0xbe')]]);this['voiceQueues'][_0x4416d4[_0x1e35('0xbe')]][_0x1e35('0x12f')]+=0x1;_0x3d61e4=new Hangup(_0x4416d4,_0x33ba0e);_0x3d61e4[_0x1e35('0x6f')]=0xc;_0x3d61e4[_0x1e35('0x70')]=_0x33ba0e['cause-txt'];_0x3d61e4[_0x1e35('0x10e')]='Unknow';hopperUtils[_0x1e35('0xc8')](_0x3d61e4)[_0x1e35('0x9d')](loggerCatch(_0x1e35('0x129')));hopperUtils[_0x1e35('0xca')](_0x3d61e4)['catch'](loggerCatch('[syncHangupIvr]'));}}};Dialer[_0x1e35('0x17')]['syncQueueSummary']=function(_0x2e61fc){var _0x1fecda=this;if(!_0x1fecda[_0x1e35('0x130')][_0x2e61fc[_0x1e35('0x48')]]){_0x1fecda['queuesSummary'][_0x2e61fc['name']]={'running':![]};}else if(_0x1fecda[_0x1e35('0x130')][_0x2e61fc[_0x1e35('0x48')]][_0x1e35('0x131')]===!![]){return;}else if(_0x1fecda[_0x1e35('0x130')][_0x2e61fc[_0x1e35('0x48')]][_0x1e35('0x131')]===![]){_0x1fecda['queuesSummary'][_0x2e61fc[_0x1e35('0x48')]][_0x1e35('0x131')]=!![];}var _0x5ce386=_0x1fecda['voiceQueues'][_0x2e61fc[_0x1e35('0x48')]];var _0x4f9826=_0x5ce386[_0x1e35('0x6c')]!==utils[_0x1e35('0x69')][_0x1e35('0x7a')];var _0x1d8711=utils[_0x1e35('0x132')](_0x5ce386);_0x5ce386[_0x1e35('0x133')]=utils[_0x1e35('0x134')](_0x5ce386,_0x1fecda[_0x1e35('0x1f')]);Promise[_0x1e35('0xa8')]()[_0x1e35('0x3f')](function(){if(_0x5ce386[_0x1e35('0x133')]===utils[_0x1e35('0x69')]['INACTIVE']){if(_0x4f9826){clearPredictiveAttributes(_0x5ce386);_0x2e61fc[_0x1e35('0x25')]=undefined;_0x2e61fc[_0x1e35('0x26')]=undefined;}if(_0x5ce386[_0x1e35('0x133')]===utils['CAMPAIGN_STATUS'][_0x1e35('0x7a')]){_0x2e61fc[_0x1e35('0x135')]=0x0;_0x2e61fc['paused']=0x0;_0x2e61fc[_0x1e35('0x136')]=0x0;_0x2e61fc['talking']=0x0;_0x2e61fc['pTalking']=0x0;}}else if(_0x5ce386['statusMessage']===utils['CAMPAIGN_STATUS'][_0x1e35('0x137')]&&!_0x1d8711){return _0x1fecda['ifTime'](_0x5ce386,!![])[_0x1e35('0x3f')](function(){return _0x1fecda[_0x1e35('0x8f')](_0x5ce386,![]);})[_0x1e35('0x3f')](function(){return _0x1fecda['checkDialMethod'](_0x5ce386);})[_0x1e35('0x9d')](function(_0x2919c1){loggerSyncQueueSummary['debug'](_0x1e35('0x138'),util[_0x1e35('0x66')](_0x2919c1,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x5ce386);});}else{clearPredictiveAttributes(_0x5ce386);}})['then'](function(){var _0xb62e2f=_0x2e61fc[_0x1e35('0x139')](_0x5ce386);if(_0xb62e2f||_0x5ce386['queueSummaryCountersUpdated']){_0x5ce386['queueSummaryCountersUpdated']=![];_0x2e61fc[_0x1e35('0x13a')](_0x5ce386);Object[_0x1e35('0x13b')](_0x5ce386,_0x2e61fc);emitOutboundVoiceQueueSummary(_0x2e61fc);}_0x1fecda[_0x1e35('0x130')][_0x5ce386[_0x1e35('0x48')]]['running']=![];})[_0x1e35('0x9d')](function(_0x384d5c){logger[_0x1e35('0x64')](_0x1e35('0x138'),util['inspect'](_0x384d5c,{'showHidden':![],'depth':null}));_0x1fecda[_0x1e35('0x130')][_0x5ce386['name']][_0x1e35('0x131')]=![];});};Dialer[_0x1e35('0x17')]['syncQueueSummaryComplete']=_[_0x1e35('0x13c')](function(){var _0x1e6c36=_[_0x1e35('0x13d')](this['voiceQueues'],function(_0x24152d){return _0x24152d[_0x1e35('0x13e')];});var _0x4ff4ba=_[_0x1e35('0x13d')](this[_0x1e35('0x1e')],function(_0x10c48d){return _0x10c48d[_0x1e35('0x13f')]&&_0x10c48d['status']===_0x1e35('0x88');});if(_0x1e6c36[_0x1e35('0x97')]>0x0&&_0x4ff4ba[_0x1e35('0x97')]>0x0){return Promise[_0x1e35('0xa8')]()['then'](cmHopper[_0x1e35('0x140')](_[_0x1e35('0x141')](_0x1e6c36,'id'),previewRecallmeReminderInterval,_[_0x1e35('0x141')](_0x4ff4ba,'id')))[_0x1e35('0x3f')](function(_0x5600c3){for(var _0x426f6a=0x0;_0x426f6a<_0x5600c3[_0x1e35('0x97')];_0x426f6a++){var _0x31789c=_0x5600c3[_0x426f6a]['Agent']['name'];if(_0x31789c)io['to'](util[_0x1e35('0x46')]('user:%s',_0x31789c))[_0x1e35('0x42')]('user:dialPreviewRecallReminder',{'hopper':_0x5600c3[_0x426f6a]});}})[_0x1e35('0x9d')](function(_0x2694e4){logger[_0x1e35('0x64')]('checkPreviewRecallReminder',_0x2694e4);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x1e35('0x17')][_0x1e35('0x3d')]=function(){var _0x3ce88e=this;setInterval(function(){_0x3ce88e[_0x1e35('0x142')](_0x3ce88e[_0x1e35('0x23')],_0x1e35('0x143'));_0x3ce88e[_0x1e35('0x142')](_0x3ce88e[_0x1e35('0x21')],_0x1e35('0x144'));},0x32c8);};Dialer['prototype'][_0x1e35('0x142')]=function(_0x530c38,_0x2b23df){var _0x4aec17=this;for(var _0x23e669 in _0x530c38){if(typeof _0x530c38[_0x23e669]!=='undefined'){this[_0x1e35('0x1a')][_0x1e35('0x145')](function(){if(!_['isNil'](_0x530c38[_0x23e669])){return ami[_0x1e35('0x146')]({'action':_0x1e35('0x87'),'channel':_0x530c38[_0x23e669][_0x1e35('0xf0')]})['catch'](function(_0x57832c){if(_0x57832c[_0x1e35('0x6c')]===_0x1e35('0x147')){setTimeout(function(){if(_0x530c38[_0x23e669]&&_0x530c38[_0x23e669]['type']!=='ivr'){_0x4aec17['updateOriginated'](_0x4aec17[_0x1e35('0x1c')][_0x530c38[_0x23e669][_0x1e35('0xbe')]]);logger['error'](_0x1e35('0x148'),_0x2b23df,_0x23e669,_0x530c38[_0x23e669]['queue']);delete _0x530c38[_0x23e669];}if(_0x530c38[_0x23e669]&&_0x530c38[_0x23e669]['type']===_0x1e35('0xc0')){_0x4aec17['updateOriginated'](_0x4aec17['campaigns'][_0x530c38[_0x23e669][_0x1e35('0xbe')]]);logger[_0x1e35('0x64')]('[Dialer][checkChannel][ivr]',_0x2b23df,_0x23e669,_0x530c38[_0x23e669][_0x1e35('0xbe')]);delete _0x530c38[_0x23e669];}},0x2328);}});}});}}};Dialer['prototype'][_0x1e35('0x149')]=function(_0x1be317){return Promise['resolve']()[_0x1e35('0x3f')](voiceQueueRt[_0x1e35('0x149')](_0x1be317))['catch'](loggerCatch(_0x1e35('0x14a')));};Dialer[_0x1e35('0x17')][_0x1e35('0xc1')]=function(_0x110479){if(!_['isUndefined'](_0x110479)&&_0x110479!==null){if(typeof _0x110479[_0x1e35('0x7f')]!=='undefined'){if(_0x110479[_0x1e35('0x7f')]>0x0){_0x110479[_0x1e35('0x7f')]-=0x1;}else{logger[_0x1e35('0x64')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x1e35('0x64')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer['prototype'][_0x1e35('0x14b')]=function(_0x10e283,_0x371d95){var _0x452c75=this;return function(_0x573f50){_0x452c75[_0x1e35('0xc1')](_0x371d95);logger[_0x1e35('0x64')](_0x10e283,util[_0x1e35('0x66')](_0x573f50,{'showHidden':![],'depth':null}));};};Dialer[_0x1e35('0x17')][_0x1e35('0x14c')]=function(_0x38255b,_0x1d2146,_0x384cea){var _0x405f94={'state':0x19,'statedesc':_0x1e35('0x14d')};this['updateOriginated'](_0x1d2146);this[_0x1e35('0x112')](_[_0x1e35('0x61')](_0x405f94,_['pick'](_0x384cea,['ContactId',_0x1e35('0xe0'),'UserId',_0x1e35('0xe1'),_0x1e35('0xe2')])),'[emptyContact][createHistory]',_0x1e35('0x14e'));logger[_0x1e35('0x64')](_0x38255b);};Dialer['prototype'][_0x1e35('0x112')]=function(_0x47ab0f,_0x370883,_0x2500c6){hopperUtils[_0x1e35('0xc8')](_0x47ab0f)[_0x1e35('0x9d')](loggerCatch(_0x370883));hopperUtils[_0x1e35('0xca')](_0x47ab0f)[_0x1e35('0x9d')](loggerCatch(_0x2500c6));};Dialer[_0x1e35('0x17')][_0x1e35('0xdb')]=function(_0x43ad59,_0x25ad58){hopperUtils[_0x1e35('0xc8')](_0x43ad59)[_0x1e35('0x9d')](loggerCatch(_0x1e35('0xc9')));if(_0x25ad58==0x0){hopperUtils[_0x1e35('0xca')](_0x43ad59)[_0x1e35('0x9d')](loggerCatch(_0x1e35('0x14f')));}};Dialer[_0x1e35('0x17')][_0x1e35('0x150')]=function(_0x2193dd){return Promise[_0x1e35('0xa8')]()[_0x1e35('0x3f')](cmHopper[_0x1e35('0x140')](_0x2193dd['id'],previewRecallmeReminderInterval))[_0x1e35('0x3f')](function(_0x3dece7){for(var _0x197b36=0x0;_0x197b36<_0x3dece7[_0x1e35('0x97')];_0x197b36++){var _0x24e3d0=_0x3dece7[_0x197b36][_0x1e35('0x151')]['name'];if(_0x24e3d0)io['to'](util[_0x1e35('0x46')](_0x1e35('0x152'),_0x24e3d0))[_0x1e35('0x42')](_0x1e35('0x153'),{'hopper':_0x3dece7[_0x197b36]});}})[_0x1e35('0x9d')](function(){});};Dialer['prototype'][_0x1e35('0xad')]=function(_0x21cc60){var _0x506fc7=this;return function(){_0x506fc7['handleIvr'](_0x21cc60);};};Dialer['prototype'][_0x1e35('0x154')]=function(_0xab5bfe,_0x2307a5){var _0x2c9e9c=this;var _0x489ef0=uuid['v4']();this[_0x1e35('0x21')][_0x489ef0]=new Action(_0xab5bfe,_0x2307a5,_0x489ef0);return new Promise(function(_0x4a00cc,_0x3f91b7){if(_[_0x1e35('0x41')](_0xab5bfe)&&typeof _0xab5bfe!==_0x1e35('0x155')){return _0x3f91b7(msgResponse(_0x1e35('0x156'),_0x1e35('0x90'),_0x1e35('0x157')));}if(_[_0x1e35('0x41')](_0x2307a5[_0x1e35('0x158')])||_0x2307a5[_0x1e35('0x158')]===null){return _0x3f91b7(msgResponse(_0x1e35('0x156'),_0x1e35('0x90'),_0x1e35('0x159')));}var _0xc62e47={'XMD-CALLERID':_0x2c9e9c['actions'][_0x489ef0]['getCaller'](),'XMD-AGI':_0xab5bfe['dialQueueProject']?util[_0x1e35('0x46')]('\x22agi://%s/square,%s\x22',ipAgi,_0xab5bfe[_0x1e35('0x12b')]):'NONE','XMD-AGIAFTER':_0xab5bfe[_0x1e35('0xc7')]?util[_0x1e35('0x46')](_0x1e35('0x15a'),ipAgi,_0xab5bfe[_0x1e35('0xc7')]):'NONE','XMD-QUEUE':utils[_0x1e35('0x15b')](_0xab5bfe)?util[_0x1e35('0x46')](_0x1e35('0x15c'),_0xab5bfe['name'],_0xab5bfe[_0x1e35('0x15d')]||'',_0xab5bfe[_0x1e35('0x15e')]?'c':'',_0xab5bfe['dialQueueTimeout']||0x3):_0x1e35('0x15f'),'XMD-CONTACTID':_0x2307a5['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x2c9e9c['actions'][_0x489ef0][_0x1e35('0x160')](),'XMD-AMD':_0xab5bfe[_0x1e35('0x10a')]?_0x1e35('0x137'):_0x1e35('0x15f'),'XMD-DESTINATION':_0x1e35('0x161')};if(_0xab5bfe['dialAMDActive']){_0xc62e47['XMD-AMDINITIALSILENCE']=_0xab5bfe[_0x1e35('0x162')]||0x9c4;_0xc62e47[_0x1e35('0x163')]=_0xab5bfe['dialAMDGreeting']||0x5dc;_0xc62e47[_0x1e35('0x164')]=_0xab5bfe[_0x1e35('0x165')]||0x320;_0xc62e47['XMD-AMDTOTALANALYSISTIME']=_0xab5bfe['dialAMDTotalAnalysisTime']||0x1388;_0xc62e47[_0x1e35('0x166')]=_0xab5bfe[_0x1e35('0x167')]||0x64;_0xc62e47['XMD-AMDBETWEENWORDSSILENCE']=_0xab5bfe['dialAMDBetweenWordsSilence']||0x32;_0xc62e47[_0x1e35('0x168')]=_0xab5bfe[_0x1e35('0x169')]||0x3;_0xc62e47[_0x1e35('0x16a')]=_0xab5bfe[_0x1e35('0x16b')]||0x100;_0xc62e47['XMD-AMDMAXIMUMWORDLENGTH']=_0xab5bfe[_0x1e35('0x16c')]||0x1388;}if(utils[_0x1e35('0x15b')](_0xab5bfe)){_0xc62e47['XMD-VOICEQUEUEID']=_0x2307a5[_0x1e35('0xe1')];}else{_0xc62e47[_0x1e35('0x16d')]=_0x2307a5[_0x1e35('0xe2')];}var _0x5ebc37=utils[_0x1e35('0x16e')](_0x2307a5['Contact']);Object[_0x1e35('0x13b')](_0xc62e47,_0x5ebc37);var _0x2dd86b=_0x2c9e9c[_0x1e35('0x84')](_0xab5bfe[_0x1e35('0x8a')])?utils['getCallerId'](_0xab5bfe[_0x1e35('0x8a')][_0x1e35('0x16f')],_0xab5bfe[_0x1e35('0x170')],_0xab5bfe[_0x1e35('0x171')]>0x0?utils[_0x1e35('0x172')](_0xab5bfe[_0x1e35('0x173')],_0xab5bfe[_0x1e35('0x171')]):_0xab5bfe['dialOriginateCallerIdNumber']):utils[_0x1e35('0x174')](_[_0x1e35('0xf4')](_0xab5bfe[_0x1e35('0x175')])?_0xab5bfe[_0x1e35('0x8a')]['callerid']:_0xab5bfe['TrunkBackup'][_0x1e35('0x16f')],_0xab5bfe[_0x1e35('0x170')],_0xab5bfe[_0x1e35('0x171')]>0x0?utils['getCallerIdRandom'](_0xab5bfe['dialOriginateCallerIdNumber'],_0xab5bfe[_0x1e35('0x171')]):_0xab5bfe[_0x1e35('0x173')]);if(_0x2dd86b){_0xc62e47[_0x1e35('0x176')]=_0x2c9e9c[_0x1e35('0x21')][_0x489ef0][_0x1e35('0x177')]=utils[_0x1e35('0x178')](_0x2dd86b);_0xc62e47[_0x1e35('0x179')]=_0x2307a5[_0x1e35('0x158')];}_0xab5bfe[_0x1e35('0x17a')]=_0xc62e47;return ami[_0x1e35('0x146')]({'actionid':_0x489ef0,'action':'originate','channel':_0x2c9e9c[_0x1e35('0x84')](_0xab5bfe[_0x1e35('0x8a')])?util[_0x1e35('0x46')]('SIP/%s/%s%s',_0xab5bfe[_0x1e35('0x8a')]['name'],isNotNull(_0xab5bfe[_0x1e35('0x17b')])?_0xab5bfe['dialPrefix'][_0x1e35('0x17c')]()||'':'',_0xab5bfe[_0x1e35('0x17d')]>0x0?_0x2307a5[_0x1e35('0x158')][_0x1e35('0x17e')](_0xab5bfe[_0x1e35('0x17d')]):_0x2307a5[_0x1e35('0x158')]):util[_0x1e35('0x46')](_0x1e35('0x17f'),_[_0x1e35('0xf4')](_0xab5bfe[_0x1e35('0x175')])?_0xab5bfe['Trunk'][_0x1e35('0x48')]:_0xab5bfe[_0x1e35('0x175')][_0x1e35('0x48')],isNotNull(_0xab5bfe[_0x1e35('0x17b')])?_0xab5bfe[_0x1e35('0x17b')][_0x1e35('0x17c')]()||'':'',_0xab5bfe['dialCutDigit']>0x0?_0x2307a5[_0x1e35('0x158')][_0x1e35('0x17e')](_0xab5bfe[_0x1e35('0x17d')]):_0x2307a5[_0x1e35('0x158')]),'callerid':_0x2dd86b,'Exten':'xcally-motion-dialer','Context':_0x1e35('0x180'),'Priority':'1','variable':_0xc62e47,'timeout':(_0xab5bfe[_0x1e35('0x181')]||0x1e)*0x3e8,'async':!![],'channelid':_0x489ef0})['then'](function(_0x16e9bb){return _0x4a00cc(_0x16e9bb);})[_0x1e35('0x9d')](function(_0x15f7f2){_0xab5bfe[_0x1e35('0x182')]+=0x1;var _0x1b464e=new History(_0x2c9e9c[_0x1e35('0x21')][_0x489ef0]);logger['error'](util['format']('[originateError]:\x20%s',JSON[_0x1e35('0xa4')](_0x15f7f2)));_0x1b464e['state']=0xe;_0x1b464e[_0x1e35('0x70')]='OriginateError';_0x1b464e[_0x1e35('0x71')]=moment()[_0x1e35('0x46')](_0x1e35('0xc3'));_0x1b464e[_0x1e35('0xe4')]=_0x1b464e['starttime'];hopperUtils[_0x1e35('0xc8')](_0x1b464e)[_0x1e35('0x9d')](loggerCatch('[originate][error]'));_0x2c9e9c[_0x1e35('0xca')](_0x1b464e)[_0x1e35('0x9d')](loggerCatch(_0x1e35('0x183')))['finally'](function(){delete _0x2c9e9c['actions'][_0x489ef0];return _0x3f91b7(msgResponse('originate',_0x1e35('0x83'),'originate\x20action\x20Error'));});});});};Dialer['prototype'][_0x1e35('0x184')]=function(_0x59fb54,_0x8c8722,_0x52f6e1){var _0x4cab62=new History(_0x8c8722);if(_0x4cab62['countbusyretry']+_0x4cab62['countcongestionretry']+_0x4cab62[_0x1e35('0x119')]+_0x4cab62[_0x1e35('0x125')]+_0x4cab62[_0x1e35('0xd5')]+_0x4cab62[_0x1e35('0x11a')]+_0x4cab62[_0x1e35('0x115')]+_0x4cab62[_0x1e35('0x11b')]>=_0x52f6e1[_0x1e35('0x126')]-0x1){return!![];}switch(_0x59fb54){case 0x3:if(_0x4cab62[_0x1e35('0x119')]>=_0x52f6e1[_0x1e35('0x185')]-0x1){return!![];}hopperUtils[_0x1e35('0xdc')]({'active':![],'countnoanswerretry':_0x4cab62[_0x1e35('0x119')]+=0x1,'scheduledat':moment()[_0x1e35('0xdd')](_0x52f6e1[_0x1e35('0x186')],_0x1e35('0x120'))[_0x1e35('0x46')](_0x1e35('0xc3')),'ContactId':_0x4cab62['ContactId'],'ListId':_0x4cab62[_0x1e35('0xe0')],'VoiceQueueId':_0x4cab62[_0x1e35('0xe1')]||undefined,'CampaignId':_0x4cab62[_0x1e35('0xe2')]||undefined})['catch'](loggerCatch(_0x1e35('0x187')));break;case 0x5:if(_0x4cab62[_0x1e35('0x118')]>=_0x52f6e1['dialBusyMaxRetry']-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countbusyretry':_0x4cab62[_0x1e35('0x118')]+=0x1,'scheduledat':moment()[_0x1e35('0xdd')](_0x52f6e1['dialBusyRetryFrequency'],'minutes')[_0x1e35('0x46')](_0x1e35('0xc3')),'ContactId':_0x4cab62[_0x1e35('0xdf')],'ListId':_0x4cab62[_0x1e35('0xe0')],'VoiceQueueId':_0x4cab62['VoiceQueueId']||undefined,'CampaignId':_0x4cab62[_0x1e35('0xe2')]||undefined})[_0x1e35('0x9d')](loggerCatch(_0x1e35('0x188')));break;case 0x8:if(_0x4cab62[_0x1e35('0x124')]>=_0x52f6e1['dialCongestionMaxRetry']-0x1){return!![];}hopperUtils[_0x1e35('0xdc')]({'active':![],'countcongestionretry':_0x4cab62[_0x1e35('0x124')]+=0x1,'scheduledat':moment()[_0x1e35('0xdd')](_0x52f6e1['dialCongestionRetryFrequency'],'minutes')[_0x1e35('0x46')](_0x1e35('0xc3')),'ContactId':_0x4cab62['ContactId'],'ListId':_0x4cab62[_0x1e35('0xe0')],'VoiceQueueId':_0x4cab62[_0x1e35('0xe1')]||undefined,'CampaignId':_0x4cab62[_0x1e35('0xe2')]||undefined})[_0x1e35('0x9d')](loggerCatch(_0x1e35('0x189')));break;case 0x0:if(_0x4cab62[_0x1e35('0x125')]>=_0x52f6e1[_0x1e35('0x18a')]-0x1){return!![];}else{hopperUtils[_0x1e35('0xdc')]({'active':![],'countnosuchnumberretry':_0x4cab62['countnosuchnumberretry']+=0x1,'scheduledat':moment()['add'](_0x52f6e1[_0x1e35('0x18b')],_0x1e35('0x120'))[_0x1e35('0x46')](_0x1e35('0xc3')),'ContactId':_0x4cab62[_0x1e35('0xdf')],'ListId':_0x4cab62[_0x1e35('0xe0')],'VoiceQueueId':_0x4cab62['VoiceQueueId']||undefined,'CampaignId':_0x4cab62['CampaignId']||undefined})[_0x1e35('0x9d')](loggerCatch(_0x1e35('0x18c')));}break;case 0xa:if(_0x4cab62['countdropretry']>=_0x52f6e1[_0x1e35('0xda')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x4cab62[_0x1e35('0xd5')]+=0x1,'scheduledat':moment()[_0x1e35('0xdd')](_0x52f6e1['dialDropRetryFrequency'],_0x1e35('0x120'))[_0x1e35('0x46')](_0x1e35('0xc3')),'ContactId':_0x4cab62[_0x1e35('0xdf')],'ListId':_0x4cab62[_0x1e35('0xe0')],'VoiceQueueId':_0x4cab62[_0x1e35('0xe1')]||undefined,'CampaignId':_0x4cab62[_0x1e35('0xe2')]||undefined})['catch'](loggerCatch(_0x1e35('0xe3')));break;case 0xb:if(_0x4cab62[_0x1e35('0x11a')]>=_0x52f6e1[_0x1e35('0xed')]-0x1){return!![];}hopperUtils[_0x1e35('0xdc')]({'active':![],'countabandonedretry':_0x4cab62[_0x1e35('0x11a')]+=0x1,'scheduledat':moment()[_0x1e35('0xdd')](_0x52f6e1[_0x1e35('0xec')],'minutes')[_0x1e35('0x46')](_0x1e35('0xc3')),'ContactId':_0x4cab62[_0x1e35('0xdf')],'ListId':_0x4cab62[_0x1e35('0xe0')],'VoiceQueueId':_0x4cab62[_0x1e35('0xe1')]||undefined,'CampaignId':_0x4cab62['CampaignId']||undefined})[_0x1e35('0x9d')](loggerCatch(_0x1e35('0xee')));break;case 0x13:if(_0x4cab62[_0x1e35('0x115')]>=_0x52f6e1[_0x1e35('0x11d')]-0x1){return!![];}hopperUtils[_0x1e35('0xdc')]({'active':![],'countmachineretry':_0x4cab62[_0x1e35('0x115')]+=0x1,'scheduledat':moment()[_0x1e35('0xdd')](_0x52f6e1[_0x1e35('0x11f')],'minutes')['format'](_0x1e35('0xc3')),'ContactId':_0x4cab62['ContactId'],'ListId':_0x4cab62[_0x1e35('0xe0')],'VoiceQueueId':_0x4cab62[_0x1e35('0xe1')]||undefined,'CampaignId':_0x4cab62[_0x1e35('0xe2')]||undefined})['catch'](loggerCatch(_0x1e35('0x121')));break;case 0x14:if(_0x4cab62[_0x1e35('0x11b')]>=_0x52f6e1[_0x1e35('0x18d')]-0x1){return!![];}hopperUtils[_0x1e35('0xdc')]({'active':![],'countagentrejectretry':_0x4cab62[_0x1e35('0x11b')]+=0x1,'scheduledat':moment()['add'](_0x52f6e1[_0x1e35('0x18e')],_0x1e35('0x120'))[_0x1e35('0x46')](_0x1e35('0xc3')),'ContactId':_0x4cab62[_0x1e35('0xdf')],'ListId':_0x4cab62[_0x1e35('0xe0')],'VoiceQueueId':_0x4cab62['VoiceQueueId']||undefined,'CampaignId':_0x4cab62[_0x1e35('0xe2')]||undefined})[_0x1e35('0x9d')](loggerCatch(_0x1e35('0x18f')));break;default:return!![];}};Dialer[_0x1e35('0x17')][_0x1e35('0x106')]=function(_0xc2d882,_0x30306f,_0x1069c7){var _0x352c5e=this;var _0x3833eb=new History(_0xc2d882);var _0x1d938d=![];var _0x29b27a;var _0x8e6091;return new Promise(function(_0xd639ea,_0x419fef){if(_[_0x1e35('0x41')](_0x30306f)&&typeof _0x30306f!=='object'){return _0x419fef(msgResponse(_0x1e35('0x190'),_0x1e35('0x90'),_0x1e35('0x191')));}if(_[_0x1e35('0x41')](_0x1069c7)&&typeof _0x1069c7!=='object'){return _0x419fef(msgResponse(_0x1e35('0x190'),_0x1e35('0x90'),_0x1e35('0x192')));}hopperUtils[_0x1e35('0xd7')](_0x3833eb,_0x1069c7[_0x1e35('0xc5')],_0x30306f)[_0x1e35('0x3f')](function(_0x11bb67){if(_0x11bb67[_0x1e35('0xd9')]==0x1)_0x1d938d=!![];switch(_0x1069c7[_0x1e35('0xc5')]){case'0':_0x30306f[_0x1e35('0x193')]+=0x1;_0x3833eb[_0x1e35('0x6f')]=0x0;_0x3833eb[_0x1e35('0x70')]=_0x1e35('0x194');_0x3833eb[_0x1e35('0x125')]+=0x1;_0x3833eb['countglobal']+=0x1;ami['emit'](_0x1e35('0x195'),ut[_0x1e35('0x111')](_0xc2d882,_0x1e35('0x196')));_0x29b27a=_0x30306f[_0x1e35('0x18b')];_0x8e6091=_0x30306f[_0x1e35('0xd6')];hopperUtils['createHistory'](_0x3833eb)[_0x1e35('0x9d')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x352c5e[_0x1e35('0x184')](0x0,_0xc2d882,_0x30306f)&&!_0x1d938d){if(_0x3833eb[_0x1e35('0x125')]>=_0x30306f[_0x1e35('0x18a')]){_0x352c5e[_0x1e35('0x197')](_0x3833eb,_0xd639ea,_0x419fef,'reason\x200\x20no\x20such\x20number....');}else{_0x352c5e[_0x1e35('0x127')](_0x3833eb,_0xd639ea,_0x419fef,_0x1e35('0x198'));}}break;case'3':_0x30306f[_0x1e35('0x199')]+=0x1;_0x3833eb[_0x1e35('0x6f')]=0x3;_0x3833eb[_0x1e35('0x70')]=_0x1e35('0x19a');_0x3833eb[_0x1e35('0x119')]+=0x1;_0x3833eb[_0x1e35('0xeb')]+=0x1;var _0x117f0f=ut[_0x1e35('0x19b')](_0xc2d882,_0x30306f);ami[_0x1e35('0x42')](_0x1e35('0x19c'),_0x117f0f);_0x29b27a=_0x30306f[_0x1e35('0x186')];_0x8e6091=_0x30306f['callAdditionalPhoneAfterMin'];hopperUtils[_0x1e35('0xc8')](_0x3833eb)[_0x1e35('0x9d')](loggerCatch(_0x1e35('0x19d')));if(_0x352c5e[_0x1e35('0x184')](0x3,_0xc2d882,_0x30306f)&&!_0x1d938d){if(_0x3833eb[_0x1e35('0x119')]>=_0x30306f[_0x1e35('0x185')]){_0x352c5e['createStateFinal'](_0x3833eb,_0xd639ea,_0x419fef,_0x1e35('0x19e'));}else{_0x352c5e['stateGlobal'](_0x3833eb,_0xd639ea,_0x419fef,_0x1e35('0x19e'));}}break;case'5':_0x30306f[_0x1e35('0x19f')]+=0x1;_0x3833eb[_0x1e35('0x6f')]=0x5;_0x3833eb[_0x1e35('0x70')]='Busy';_0x3833eb[_0x1e35('0x118')]+=0x1;_0x3833eb[_0x1e35('0xeb')]+=0x1;ami['emit'](_0x1e35('0x1a0'),ut[_0x1e35('0x111')](_0xc2d882,_0x1e35('0x1a1')));_0x29b27a=_0x30306f[_0x1e35('0x1a2')];_0x8e6091=_0x30306f[_0x1e35('0xd6')];hopperUtils[_0x1e35('0xc8')](_0x3833eb)[_0x1e35('0x9d')](loggerCatch(_0x1e35('0x1a3')));if(_0x352c5e[_0x1e35('0x184')](0x5,_0xc2d882,_0x30306f)&&!_0x1d938d){if(_0x3833eb['countbusyretry']>=_0x30306f[_0x1e35('0x1a4')]){_0x352c5e[_0x1e35('0x197')](_0x3833eb,_0xd639ea,_0x419fef,_0x1e35('0x1a5'));}else{_0x352c5e[_0x1e35('0x127')](_0x3833eb,_0xd639ea,_0x419fef,_0x1e35('0x1a5'));}}break;case'8':_0x30306f[_0x1e35('0x1a6')]+=0x1;_0x3833eb[_0x1e35('0x6f')]=0x8;_0x3833eb['statedesc']='Congestion';_0x3833eb[_0x1e35('0x124')]+=0x1;_0x3833eb[_0x1e35('0xeb')]+=0x1;_0x29b27a=_0x30306f[_0x1e35('0x1a7')];_0x8e6091=_0x30306f[_0x1e35('0xd6')];ami[_0x1e35('0x42')](_0x1e35('0x1a8'),ut['buildObj'](_0xc2d882,_0x1e35('0x1a9')));hopperUtils[_0x1e35('0xc8')](_0x3833eb)[_0x1e35('0x9d')](loggerCatch(_0x1e35('0x1aa')));if(_0x352c5e[_0x1e35('0x184')](0x8,_0xc2d882,_0x30306f)&&!_0x1d938d){if(_0x3833eb[_0x1e35('0x124')]>=_0x30306f[_0x1e35('0x1ab')]){_0x352c5e[_0x1e35('0x197')](_0x3833eb,_0xd639ea,_0x419fef,_0x1e35('0x1ac'));}else{_0x352c5e[_0x1e35('0x127')](_0x3833eb,_0xd639ea,_0x419fef,_0x1e35('0x1ac'));}}break;case'11':_0x30306f['outboundAbandonedCallsDay']+=0x1;_0x3833eb['state']=0xb;_0x3833eb[_0x1e35('0x70')]='Abandoned';_0x3833eb[_0x1e35('0x11a')]+=0x1;_0x3833eb[_0x1e35('0xeb')]+=0x1;_0x29b27a=_0x30306f[_0x1e35('0xec')];_0x8e6091=_0x30306f[_0x1e35('0xd6')];hopperUtils[_0x1e35('0xc8')](_0x3833eb)[_0x1e35('0x9d')](loggerCatch(_0x1e35('0x1ad')));if(_0x352c5e[_0x1e35('0x184')](0xb,_0xc2d882,_0x30306f)&&!_0x1d938d){if(_0x3833eb[_0x1e35('0x11a')]>=_0x30306f[_0x1e35('0xed')]){_0x352c5e['createStateFinal'](_0x3833eb,_0xd639ea,_0x419fef,_0x1e35('0x1ae'));}else{_0x352c5e[_0x1e35('0x127')](_0x3833eb,_0xd639ea,_0x419fef,_0x1e35('0x1ae'));}}break;case'20':_0x30306f[_0x1e35('0x1af')]+=0x1;_0x3833eb['state']=0x14;_0x3833eb['statedesc']=_0x1e35('0x1b0');_0x3833eb[_0x1e35('0x11b')]+=0x1;_0x3833eb[_0x1e35('0xeb')]+=0x1;_0x29b27a=_0x30306f[_0x1e35('0x18e')];_0x8e6091=_0x30306f['callAdditionalPhoneAfterMin'];ami[_0x1e35('0x42')](_0x1e35('0x1b1'),ut[_0x1e35('0x111')](_0xc2d882,_0x1e35('0x1b2')));hopperUtils['createHistory'](_0x3833eb)[_0x1e35('0x9d')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x352c5e[_0x1e35('0x184')](0x14,_0xc2d882,_0x30306f)&&!_0x1d938d){if(_0x3833eb[_0x1e35('0x11b')]>=_0x30306f['dialAgentRejectMaxRetry']){_0x352c5e['createStateFinal'](_0x3833eb,_0xd639ea,_0x419fef,'reason\x2020\x20agentreject');}else{_0x352c5e[_0x1e35('0x127')](_0x3833eb,_0xd639ea,_0x419fef,'reason\x2020\x20agentreject');}}break;default:_0x30306f[_0x1e35('0x12f')]+=0x1;_0x3833eb[_0x1e35('0x6f')]=0xc;_0x3833eb[_0x1e35('0x70')]=_0x1069c7['reason'];_0x29b27a=_0x30306f[_0x1e35('0x18e')];_0x8e6091=_0x30306f[_0x1e35('0xd6')];hopperUtils['createHistory'](_0x3833eb)[_0x1e35('0x9d')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x352c5e[_0x1e35('0x184')](_0x1069c7[_0x1e35('0xc5')],_0xc2d882,_0x30306f)&&!_0x1d938d){if(_0x3833eb['countbusyretry']+_0x3833eb[_0x1e35('0x124')]+_0x3833eb[_0x1e35('0x119')]+_0x3833eb['countnosuchnumberretry']+_0x3833eb[_0x1e35('0xd5')]+_0x3833eb['countabandonedretry']+_0x3833eb[_0x1e35('0x115')]+_0x3833eb['countagentrejectretry']>=_0x30306f['dialGlobalMaxRetry']){_0x352c5e[_0x1e35('0x127')](_0x3833eb,_0xd639ea,_0x419fef,_0x1069c7[_0x1e35('0xc5')]);}else{_0x352c5e[_0x1e35('0x197')](_0x3833eb,_0xd639ea,_0x419fef,_0x1069c7['reason']);}}}})['then'](function(){if(_0x1d938d){hopperUtils['swapAdditionalPhones'](_0x3833eb,_0x29b27a,_0x8e6091)[_0x1e35('0x3f')](function(){return _0xd639ea(0x1);});}});});};Dialer[_0x1e35('0x17')][_0x1e35('0x127')]=function(_0xbe7738,_0x4eab3e,_0x5244d9,_0x26eb92){var _0x188cdb=new Final(_0xbe7738);_0x188cdb[_0x1e35('0x6f')]=0xf;_0x188cdb[_0x1e35('0x70')]='Global';this['createStateFinal'](_0x188cdb,_0x4eab3e,_0x5244d9,_0x26eb92);};Dialer[_0x1e35('0x17')][_0x1e35('0x197')]=function(_0x18a9b5,_0x5d67a9,_0x1e5b35,_0x1261fb){hopperUtils['moveContactManagedDialer'](_0x18a9b5)[_0x1e35('0x3f')](function(){return _0x5d67a9(msgResponse(_0x1e35('0x190'),_0x1e35('0x105'),_0x1261fb));})[_0x1e35('0x9d')](function(){return _0x1e5b35(msgResponse('[moveContactManagedDialer][0]',_0x1e35('0x90'),_0x1e35('0x1b3')));});};Dialer['prototype']['predictive']=function(_0x5a45d6){var _0x4b4279=_0x5a45d6[_0x1e35('0x1b4')]/0x64;var _0x315d1a=_0x5a45d6[_0x1e35('0xcf')]/(_0x5a45d6['outboundDropCallsDayTimeout']+_0x5a45d6['outboundAnswerCallsDay']);var _0x2cf5b0=Math[_0x1e35('0x1b5')](_0x5a45d6[_0x1e35('0x1b6')]*(_0x5a45d6[_0x1e35('0x1b7')]/0x64));var _0x13acaf=Math[_0x1e35('0x1b5')](_0x5a45d6[_0x1e35('0x1b6')]*(_0x5a45d6['predictiveIntervalMinThreshold']/0x64));var _0x2de555=_0x5a45d6[_0x1e35('0x135')]+_0x5a45d6[_0x1e35('0x1b8')];var _0x4590aa=Math[_0x1e35('0x1b9')](_0x5a45d6['erlangCalls']*_0x5a45d6['erlangAbandonmentRate']*_0x5a45d6[_0x1e35('0x1ba')]*_0x5a45d6[_0x1e35('0x1bb')]);if(_['isUndefined'](_0x5a45d6[_0x1e35('0x26')])){if(!_[_0x1e35('0x41')](_0x5a45d6['startPredictive'])){_0x5a45d6[_0x1e35('0x25')]=undefined;loggerPredictive[_0x1e35('0x64')]('[startMethodPredictive][StartProgressive]',_0x1e35('0x1bc'));}if(!_[_0x1e35('0x41')](_0x5a45d6[_0x1e35('0x62')])){loggerPredictive['error'](_0x1e35('0x1bd'),_0x1e35('0x1be'));clearInterval(_0x5a45d6['handlePredictive']);_0x5a45d6['handlePredictive']=undefined;}_0x5a45d6[_0x1e35('0x26')]=moment()[_0x1e35('0x46')](_0x1e35('0xc3'));loggerPredictive['info'](_0x5a45d6[_0x1e35('0x48')],_0x1e35('0x1bf'),_0x5a45d6[_0x1e35('0x26')]);this[_0x1e35('0xb2')](_0x5a45d6,0x1);}else if(ifInterval(_0x5a45d6['dialPredictiveInterval'],_0x5a45d6['startProgressive'])){this[_0x1e35('0xb2')](_0x5a45d6,0x1);loggerPredictiveCalls['info']('[startMethodPredictive][StartProgressive][Loop]',_0x5a45d6[_0x1e35('0x26')],_0x5a45d6['name']);_0x5a45d6[_0x1e35('0x5b')]=0x0;_0x5a45d6[_0x1e35('0xd0')]=0x0;}else if(_0x4b4279<_0x315d1a&&_0x5a45d6['dialPredictiveOptimization']===_0x1e35('0x1c0')){clearPredictiveAttributes(_0x5a45d6);loggerPredictive[_0x1e35('0x4b')](_0x1e35('0x1c1'),_0x1e35('0x1c2'),_0x315d1a,_0x1e35('0x26'),_0x5a45d6[_0x1e35('0x48')]);}else if(_0x4590aa<_0x5a45d6[_0x1e35('0xd0')]&&_0x5a45d6[_0x1e35('0x1c3')]===_0x1e35('0x1c0')){clearPredictiveAttributes(_0x5a45d6);loggerPredictive[_0x1e35('0x4b')](_0x1e35('0x1c4'),'Max\x20Drop\x20',_0x4590aa,_0x1e35('0x1c5'),_0x5a45d6['predictiveIntervalErlangCallsDroppedCalls'],_0x1e35('0x26'),_0x5a45d6[_0x1e35('0x48')]);}else if(!ifInterval(_0x5a45d6['dialPredictiveInterval'],_0x5a45d6[_0x1e35('0x26')])&&_[_0x1e35('0x41')](_0x5a45d6['startPredictive'])&&!_[_0x1e35('0x41')](_0x5a45d6[_0x1e35('0x26')])){_0x5a45d6[_0x1e35('0x25')]=moment()['format'](_0x1e35('0xc3'));loggerPredictive['info'](_0x5a45d6[_0x1e35('0x48')],_0x1e35('0x1c6'),_0x5a45d6[_0x1e35('0x25')]);hopperUtils['avgHandleTime'](_0x5a45d6['dialPredictiveInterval'])[_0x1e35('0x3f')](this[_0x1e35('0x1c7')](_0x5a45d6))[_0x1e35('0x3f')](mergeDataErlangB(_0x5a45d6))['then'](this['startMethodPredictive'](_0x5a45d6))[_0x1e35('0x9d')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x5a45d6));}else if(!ifInterval(_0x5a45d6[_0x1e35('0x1c8')],_0x5a45d6[_0x1e35('0x25')])){_0x5a45d6[_0x1e35('0xd0')]=0x0;_0x5a45d6[_0x1e35('0x25')]=moment()[_0x1e35('0x46')](_0x1e35('0xc3'));loggerPredictive[_0x1e35('0x4b')](_0x5a45d6['name'],_0x1e35('0x1c9'),_0x5a45d6[_0x1e35('0x25')]);clearInterval(_0x5a45d6['handlePredictive']);_0x5a45d6['handlePredictive']=undefined;hopperUtils[_0x1e35('0x1ca')](_0x5a45d6[_0x1e35('0x1c8')])[_0x1e35('0x3f')](this['getDataPredictive'](_0x5a45d6))[_0x1e35('0x3f')](mergeDataErlangB(_0x5a45d6))[_0x1e35('0x3f')](this[_0x1e35('0x1cb')](_0x5a45d6))[_0x1e35('0x9d')](loggerCatchPredictive(_0x1e35('0x1cc'),_0x5a45d6));}else if(_0x5a45d6[_0x1e35('0x1b6')]&&_0x2de555<_0x5a45d6['predictiveIntervalAvailable']-_0x13acaf){clearPredictiveAttributes(_0x5a45d6);loggerPredictive[_0x1e35('0x4b')](_0x5a45d6['name'],_0x1e35('0x1cd'),_0x2de555,_0x1e35('0x1ce'),_0x5a45d6['predictiveIntervalAvailable'],'-',_0x13acaf,'=',_0x5a45d6['predictiveIntervalAvailable']-_0x13acaf,')');}else if(_0x5a45d6[_0x1e35('0x1b6')]&&_0x2de555>_0x5a45d6[_0x1e35('0x1b6')]+_0x2cf5b0){clearPredictiveAttributes(_0x5a45d6);loggerPredictive[_0x1e35('0x4b')](_0x5a45d6[_0x1e35('0x48')],_0x1e35('0x1cd'),_0x2de555,_0x1e35('0x1cf'),_0x5a45d6['predictiveIntervalAvailable'],'+',_0x2cf5b0,'=',_0x5a45d6[_0x1e35('0x1b6')]+_0x2cf5b0,')');}};Dialer[_0x1e35('0x17')]['getDataPredictive']=function(_0x34e9d6){var _0x423d94=this;return function(_0x4cec43){return new Promise(function(_0x4df008,_0x8e3179){_['merge'](_0x34e9d6,_0x4cec43[0x0]);if(checkGetDataPredictive(_0x4cec43[0x0])){var _0x3b535e=_0x34e9d6['predictiveIntervalAvailable']=_0x34e9d6[_0x1e35('0x1b8')]+_0x34e9d6['available'];var _0xf696e9=_0x34e9d6['dialPredictiveInterval']*0x3c;var _0x36197b=_0x4cec43[0x0][_0x1e35('0x53')]+_0x4cec43[0x0][_0x1e35('0x56')];var _0x19ab03=(_0x4cec43[0x0][_0x1e35('0x4f')]+_0x4cec43[0x0][_0x1e35('0x51')]+_0x4cec43[0x0][_0x1e35('0xe9')])/_0x4cec43[0x0][_0x1e35('0x1d0')];_0x34e9d6['predictiveIntervalHitRate']=_0x19ab03>0x0?_0x19ab03:0x1;switch(_0x34e9d6[_0x1e35('0x1c3')]){case _0x1e35('0x1c0'):var _0x25c64d=_0x34e9d6[_0x1e35('0x1b4')]/0x64;return _0x423d94['abandonmentRate'](_0x3b535e,_0xf696e9,_0x36197b,_0x19ab03,_0x25c64d)[_0x1e35('0x3f')](function(_0x12fc82){return _0x4df008(_0x12fc82);});case'agentBusyFactor':var _0x540bb8=_0x34e9d6['dialPredictiveOptimizationPercentage']/0x64;return _0x423d94['busyFactor'](_0x3b535e,_0xf696e9,_0x36197b,_0x19ab03,_0x540bb8)[_0x1e35('0x3f')](function(_0x49d153){return _0x4df008(_0x49d153);});default:return _0x8e3179(msgResponse(_0x1e35('0x1d1'),'Failure',_0x1e35('0x1d2')));}}else{return _0x8e3179(msgResponse(_0x1e35('0x1d1'),_0x1e35('0x90'),'check\x20failure'));}});};};Dialer[_0x1e35('0x17')][_0x1e35('0x1d3')]=function(_0x14be08){var _0x59e1d0=this;return function(_0x4a4f61){return new Promise(function(_0xc5d9de,_0x272704){_[_0x1e35('0x61')](_0x14be08,_0x4a4f61[0x0]);if(checkGetDataPredictive(_0x4a4f61[0x0])){loggerPredictive[_0x1e35('0x4b')](JSON[_0x1e35('0xa4')](_0x4a4f61[0x0]));if(_0x14be08['dialPredictiveOptimization']==='dropRate'){return _0x59e1d0['getVoiceQueueRtPauses'](_0x14be08['id'])[_0x1e35('0x3f')](function(_0x342e9b){var _0x298669=_0x14be08[_0x1e35('0x1d4')]-_0x342e9b[0x0]['outboundQueuePauses'];var _0x2bcc44=_0x14be08[_0x1e35('0x1c8')]*0x3c;var _0x462f50=_0x4a4f61[0x0][_0x1e35('0x53')]+_0x4a4f61[0x0][_0x1e35('0x56')];var _0x1b4a90=(_0x4a4f61[0x0][_0x1e35('0x4f')]+_0x4a4f61[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x4a4f61[0x0][_0x1e35('0xe9')])/_0x4a4f61[0x0][_0x1e35('0x1d0')];var _0x16a140=_0x14be08[_0x1e35('0x1b4')]/0x64;_0x14be08[_0x1e35('0x1d5')]=_0x342e9b[0x0][_0x1e35('0x1d6')]||0x0;_0x14be08[_0x1e35('0x1ba')]=_0x1b4a90>0x0?_0x1b4a90:0x1;return _0x59e1d0['abandonmentRate'](_0x298669,_0x2bcc44,_0x462f50,_0x1b4a90,_0x16a140);})[_0x1e35('0x3f')](function(_0x5424a5){return _0xc5d9de(_0x5424a5);})[_0x1e35('0x9d')](function(_0x468ac4){return _0x272704(msgResponse(_0x1e35('0x1d7'),_0x1e35('0x90'),JSON[_0x1e35('0xa4')](_0x468ac4)));});}if(_0x14be08[_0x1e35('0x1c3')]==='agentBusyFactor'){return _0x59e1d0[_0x1e35('0x149')](_0x14be08['id'])[_0x1e35('0x3f')](function(_0x11067c){var _0x4c896b=_0x14be08[_0x1e35('0x1d4')]-_0x11067c[0x0][_0x1e35('0x1d6')];var _0x2d1853=_0x14be08[_0x1e35('0x1c8')]*0x3c;var _0x189371=_0x4a4f61[0x0]['predictiveIntervalAvgTalktime']+_0x4a4f61[0x0][_0x1e35('0x56')];var _0x290f76=(_0x4a4f61[0x0][_0x1e35('0x4f')]+_0x4a4f61[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x4a4f61[0x0][_0x1e35('0xe9')])/_0x4a4f61[0x0][_0x1e35('0x1d0')];var _0xd730fd=_0x14be08[_0x1e35('0x1b4')]/0x64;_0x14be08[_0x1e35('0x1d5')]=_0x11067c[0x0]['outboundQueuePauses']||0x0;_0x14be08[_0x1e35('0x1ba')]=_0x290f76>0x0?_0x290f76:0x1;return _0x59e1d0[_0x1e35('0x1d8')](_0x4c896b,_0x2d1853,_0x189371,_0x290f76,_0xd730fd);})[_0x1e35('0x3f')](function(_0x18bcec){return _0xc5d9de(_0x18bcec);})[_0x1e35('0x9d')](function(_0x2a59c4){return _0x272704(msgResponse(_0x1e35('0x1d7'),_0x1e35('0x90'),JSON[_0x1e35('0xa4')](_0x2a59c4)));});}}else{return _0x272704(msgResponse('[getDataPredictive]',_0x1e35('0x90'),_0x1e35('0x1d9')));}});};};Dialer[_0x1e35('0x17')][_0x1e35('0x1cb')]=function(_0x5afbbc){var _0x207df0=this;return function(){var _0x54f1ca=0x0;var _0x3fe2ac=Math[_0x1e35('0x1b9')](_0x5afbbc[_0x1e35('0x5c')]*0x3e8);if(_0x3fe2ac>0x0){_0x3fe2ac=_0x3fe2ac<0x64?0x64:_0x3fe2ac;loggerPredictive['info'](_0x5afbbc['name'],'one\x20call\x20every:',_0x3fe2ac,_0x1e35('0x1da'));_0x5afbbc[_0x1e35('0x62')]=setInterval(function(){_0x207df0['handlePredictive'](_0x5afbbc);loggerPredictiveCalls[_0x1e35('0x4b')](_0x1e35('0x1db'),_0x54f1ca+=0x1);},_0x3fe2ac);}else{loggerPredictive['info'](_0x5afbbc[_0x1e35('0x48')],_0x1e35('0x1dc'));}};};Dialer[_0x1e35('0x17')][_0x1e35('0x1dd')]=function(_0x560f9f,_0x1eeb61){var _0x145bee=this;return function(_0x1b79c5){if(_[_0x1e35('0x4a')](_0x1b79c5)){if(_[_0x1e35('0xf4')](_0x1eeb61['UserId'])||!_0x1eeb61[_0x1e35('0x1de')]){if(_0x560f9f[_0x1e35('0xb0')]===_0x1e35('0x9')){_0x560f9f['queueStatusComplete']=_[_0x1e35('0x41')](_0x560f9f[_0x1e35('0x72')])?!![]:_0x560f9f['queueStatusComplete'];var _0x38a248=uuid['v4']();_0x145bee[_0x1e35('0x21')][_0x38a248]=new Action(_0x560f9f,_0x1eeb61,_0x38a248);loggerBooked[_0x1e35('0x4b')](_0x1e35('0x1df'),_0x38a248,'queueStatusComplete:\x20',JSON['stringify'](_0x560f9f[_0x1e35('0x72')]),_0x1e35('0x1e0'),_0x560f9f[_0x1e35('0x48')]);if(_0x560f9f['queueStatusComplete']){_0x560f9f['queueStatusComplete']=![];_0x145bee[_0x1e35('0x28')][_0x145bee[_0x1e35('0x21')][_0x38a248]['queue']]=[];ami[_0x1e35('0x146')]({'actionid':_0x38a248,'action':_0x1e35('0x1e1'),'queue':_0x560f9f[_0x1e35('0x48')]})['catch'](function(){_0x145bee[_0x1e35('0xc1')](_0x560f9f);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x145bee[_0x1e35('0x21')][_0x38a248][_0x1e35('0xdf')],'ListId':_0x145bee[_0x1e35('0x21')][_0x38a248][_0x1e35('0xe0')],'VoiceQueueId':_0x145bee[_0x1e35('0x21')][_0x38a248]['VoiceQueueId']||undefined,'CampaignId':_0x145bee[_0x1e35('0x21')][_0x38a248][_0x1e35('0xe2')]||undefined})[_0x1e35('0x9d')](loggerCatch(_0x1e35('0x1e2')));delete _0x145bee[_0x1e35('0x21')][_0x38a248];});}else{loggerBooked[_0x1e35('0x4b')]('[booked][checkContactBlack][else]',JSON[_0x1e35('0xa4')](_0x560f9f[_0x1e35('0x72')]),_0x1e35('0x1e0'),_0x560f9f['name']);_0x145bee[_0x1e35('0xc1')](_0x560f9f);hopperUtils[_0x1e35('0xdc')]({'active':![],'ContactId':_0x145bee[_0x1e35('0x21')][_0x38a248]['ContactId'],'ListId':_0x145bee['actions'][_0x38a248]['ListId'],'VoiceQueueId':_0x145bee[_0x1e35('0x21')][_0x38a248][_0x1e35('0xe1')]||undefined,'CampaignId':_0x145bee[_0x1e35('0x21')][_0x38a248]['CampaignId']||undefined})[_0x1e35('0x9d')](loggerCatch(_0x1e35('0x1e2')));delete _0x145bee[_0x1e35('0x21')][_0x38a248];}}else{return _0x145bee[_0x1e35('0x154')](_0x560f9f,_0x1eeb61);}}else{if(utils[_0x1e35('0xcc')](undefined,_0x1eeb61[_0x1e35('0x1e3')])<_0x560f9f['dialRecallMeTimeout']*0x3c){if(_0x1eeb61[_0x1e35('0x151')]&&!_0x1eeb61[_0x1e35('0x151')]['voicePause']){_0x145bee[_0x1e35('0x1b')]['run'](_0x1eeb61['id'])['finally'](function(){_0x145bee[_0x1e35('0xc1')](_0x560f9f);});}else{hopperUtils[_0x1e35('0x1e4')]({'active':![]},_0x1eeb61['id'],0x1)['finally'](function(){_0x145bee[_0x1e35('0xc1')](_0x560f9f);});}}else{_0x560f9f['outboundReCallsDay']+=0x1;_0x145bee[_0x1e35('0xc1')](_0x560f9f);if(_0x560f9f[_0x1e35('0x1e5')]){hopperUtils['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x1eeb61[_0x1e35('0xdf')],'ListId':_0x1eeb61['ListId'],'VoiceQueueId':_0x1eeb61[_0x1e35('0xe1')]||undefined,'CampaignId':_0x1eeb61[_0x1e35('0xe2')]||undefined})[_0x1e35('0x9d')](loggerCatch(_0x1e35('0x1e6')));hopperUtils['createHistory'](createObjHistory(_0x560f9f,_0x1eeb61,utils[_0x1e35('0x69')]['QUEUE_RECALL'],0x17,'RecallInQueue'))[_0x1e35('0x9d')](loggerCatch(_0x1e35('0x1e7')));}else{_0x145bee[_0x1e35('0x112')](createObjHistory(_0x560f9f,_0x1eeb61,utils['CAMPAIGN_STATUS'][_0x1e35('0x1e8')],0x16,_0x1e35('0x1e9')),_0x1e35('0x1ea'),_0x1e35('0x1eb'));}}}}else{_0x560f9f[_0x1e35('0x1ec')]+=0x1;_0x145bee[_0x1e35('0x112')](createObjHistory(_0x560f9f,_0x1eeb61,utils['CAMPAIGN_STATUS'][_0x1e35('0x1ed')],0xd,_0x1e35('0x1ee')),'[Originate][historyBlacklist]',_0x1e35('0x1ef'));throw _0x1e35('0x1f0');}};};Dialer[_0x1e35('0x17')][_0x1e35('0x1f1')]=function(_0x266234){var _0x25b03a=this;var _0x2bd7c9=_0x266234[_0x1e35('0x1f2')]-_0x266234[_0x1e35('0x7f')];emitCampaignSummary(_0x266234);if(_0x2bd7c9>0x0&&_0x266234[_0x1e35('0x1f3')]==0x0){if(_0x2bd7c9>this[_0x1e35('0x1f4')]){_0x2bd7c9=this[_0x1e35('0x1f4')];}_0x266234[_0x1e35('0x1f3')]=0x1;hopperUtils[_0x1e35('0x1f5')](_0x266234,_0x2bd7c9)[_0x1e35('0x3f')](function(_0x216934){_0x266234[_0x1e35('0x1f3')]=0x0;if(_0x216934){if(!utils[_0x1e35('0x1f6')](_0x216934)){_0x266234[_0x1e35('0x6c')]=utils['CAMPAIGN_STATUS']['NO_AVAILABLE_CONTACTS'];logger[_0x1e35('0x4b')]('[getContactCampaign2][Empty]'+_0x266234[_0x1e35('0x48')]);}else{_0x266234[_0x1e35('0x7f')]+=_0x216934[_0x1e35('0x97')];_0x266234['message']=utils[_0x1e35('0x69')][_0x1e35('0x1f7')];for(var _0x4f1450=0x0;_0x4f1450<_0x216934['length'];_0x4f1450+=0x1){_0x266234[_0x1e35('0x1f8')]+=0x1;if(_[_0x1e35('0xf4')](_0x216934[_0x4f1450])||_['isNil'](_0x216934[_0x4f1450]['Contact'])||_[_0x1e35('0xf4')](_0x216934[_0x4f1450][_0x1e35('0x158')])){_0x25b03a[_0x1e35('0x14c')]('[actionOriginate]\x20',_0x266234,_0x216934[_0x4f1450]);}else{hopperUtils['checkIsBlackListIvr'](_[_0x1e35('0x75')](_0x216934[_0x4f1450],[_0x1e35('0xe2'),'phone']))[_0x1e35('0x3f')](_0x25b03a[_0x1e35('0x1dd')](_0x266234,_0x216934[_0x4f1450]))[_0x1e35('0x9d')](_0x25b03a[_0x1e35('0x14b')](_0x1e35('0x1f9'),_0x266234));}}}}})['catch'](loggerGetContactDialer('[getContactCampaign2]',_0x266234,_0x2bd7c9));}};Dialer[_0x1e35('0x17')][_0x1e35('0xb2')]=function(_0x1cc88e,_0x2dbb88){var _0x1992f1=this;var _0x2c11d5=[];if(_0x2dbb88<0x1||_0x1cc88e['dialMethod']===_0x1e35('0x9')){_0x2dbb88=0x1;}var _0x21de71=Math[_0x1e35('0x1b9')](_0x1cc88e[_0x1e35('0x135')]*_0x2dbb88)-_0x1cc88e['originated'];if(_0x1cc88e[_0x1e35('0x1fa')]>0x0){var _0x2add84=_0x1cc88e[_0x1e35('0x1fa')]-_0x1cc88e[_0x1e35('0x7f')]-_0x1cc88e['talking']-_0x1cc88e[_0x1e35('0x1fb')];if(_0x21de71>_0x2add84){_0x21de71=_0x2add84;}}if(_0x21de71>0x0&&_0x1cc88e[_0x1e35('0x1f3')]==0x0){if(_0x1cc88e['dialMethod']===_0x1e35('0x9')){_0x21de71=0x1;}if(_0x21de71>this['maxNumberOriginate']){_0x21de71=this['maxNumberOriginate'];}for(var _0x4a4bd0 in this[_0x1e35('0x1e')]){if(typeof this[_0x1e35('0x1e')][_0x4a4bd0]!==_0x1e35('0x1fc')){if(this['agents'][_0x4a4bd0][_0x1e35('0x6f')]===_0x1e35('0x1fd')&&this[_0x1e35('0x1e')][_0x4a4bd0][_0x1e35('0x87')]===_0x1e35('0x88')){_0x2c11d5['push'](this[_0x1e35('0x1e')][_0x4a4bd0]['id']);}}}_0x1cc88e[_0x1e35('0x1f3')]=0x1;hopperUtils['getContactDialer'](_0x1cc88e,_0x2c11d5,_0x21de71)['then'](function(_0x29f9fe){_0x1cc88e[_0x1e35('0x1f3')]=0x0;if(_0x29f9fe){if(!utils[_0x1e35('0x1f6')](_0x29f9fe)){hopperUtils[_0x1e35('0x1fe')](_0x1cc88e)[_0x1e35('0x3f')](sendMessageReschedule(_0x1cc88e))['catch'](loggerCatch(_0x1e35('0x1ff')));}else{_0x1cc88e[_0x1e35('0x7f')]+=_0x29f9fe[_0x1e35('0x97')];_0x1cc88e[_0x1e35('0x6c')]=_0x1cc88e[_0x1e35('0xb0')]==='booked'?utils[_0x1e35('0x69')][_0x1e35('0x137')]:utils[_0x1e35('0x69')]['RUNNING'];for(var _0x5be6d8=0x0;_0x5be6d8<_0x29f9fe['length'];_0x5be6d8+=0x1){if(_[_0x1e35('0xf4')](_0x29f9fe[_0x5be6d8])||_[_0x1e35('0xf4')](_0x29f9fe[_0x5be6d8][_0x1e35('0x200')])||_[_0x1e35('0xf4')](_0x29f9fe[_0x5be6d8][_0x1e35('0x158')])){_0x1992f1[_0x1e35('0x14c')](_0x1e35('0x201'),_0x1cc88e,_0x29f9fe[_0x5be6d8]);}else{hopperUtils[_0x1e35('0x202')](_[_0x1e35('0x75')](_0x29f9fe[_0x5be6d8],[_0x1e35('0xe1'),_0x1e35('0x158')]))[_0x1e35('0x3f')](_0x1992f1[_0x1e35('0x1dd')](_0x1cc88e,_0x29f9fe[_0x5be6d8]))[_0x1e35('0x9d')](_0x1992f1['loggerHandler'](_0x1e35('0x201'),_0x1cc88e));}}}}})[_0x1e35('0x9d')](loggerGetContactDialer(_0x1e35('0x203'),_0x1cc88e,_0x21de71));}};Dialer[_0x1e35('0x17')][_0x1e35('0x62')]=function(_0x17d9d3){if(_0x17d9d3['dialLimitQueue']>0x0){var _0x7edfb5=_0x17d9d3['dialLimitQueue']-_0x17d9d3['originated']-_0x17d9d3[_0x1e35('0x1b8')];if(_0x7edfb5>0x0&&_0x17d9d3[_0x1e35('0x1f3')]==0x0){this[_0x1e35('0x204')](_0x17d9d3);}else{loggerPredictiveCalls[_0x1e35('0x4b')](_0x1e35('0x205'));}}else{this['tryOriginatePredictive'](_0x17d9d3);}};Dialer['prototype'][_0x1e35('0x204')]=function(_0x1b61b0){var _0x398ec3=this;var _0x4fe6bb=[];_0x1b61b0[_0x1e35('0x7f')]+=0x1;for(var _0x24cb37 in this['agents']){if(typeof this['agents'][_0x24cb37]!==_0x1e35('0x1fc')){if(this[_0x1e35('0x1e')][_0x24cb37]['state']==='not_inuse'&&this['agents'][_0x24cb37]['status']==='reachable'){_0x4fe6bb[_0x1e35('0x98')](this[_0x1e35('0x1e')][_0x24cb37]['id']);}}}_0x1b61b0[_0x1e35('0x1f3')]=0x1;return this[_0x1e35('0x206')](_0x1b61b0['id'],_0x4fe6bb,0x1,_0x1b61b0['dialOrderByScheduledAt'],_0x1b61b0)['then'](function(_0x5f542a){_0x1b61b0[_0x1e35('0x1f3')]=0x1;if(_0x5f542a){if(!utils[_0x1e35('0x1f6')](_0x5f542a)){utils[_0x1e35('0x67')](_0x1b61b0,0x1,0x0);return hopperUtils[_0x1e35('0x1fe')](_0x1b61b0)[_0x1e35('0x3f')](sendMessageReschedule(_0x1b61b0))[_0x1e35('0x9d')](loggerCatch(_0x1e35('0x1ff')));}else{_0x1b61b0[_0x1e35('0x6c')]=utils[_0x1e35('0x69')]['RUNNING'];if(_['isNil'](_0x5f542a[0x0])||_['isNil'](_0x5f542a[0x0][_0x1e35('0x200')])||_[_0x1e35('0xf4')](_0x5f542a[0x0][_0x1e35('0x158')])){_0x398ec3[_0x1e35('0x14c')](_0x1e35('0x201'),_0x1b61b0,_0x5f542a[0x0]);}else{return hopperUtils['checkIsBlackList'](_['pick'](_0x5f542a[0x0],[_0x1e35('0xe1'),_0x1e35('0x158')]))[_0x1e35('0x3f')](_0x398ec3[_0x1e35('0x1dd')](_0x1b61b0,_0x5f542a[0x0]))[_0x1e35('0x9d')](_0x398ec3['loggerHandler']('[actionOriginatePredictive]\x20',_0x1b61b0));}}}})[_0x1e35('0x9d')](loggerGetContactDialer(_0x1e35('0x207'),_0x1b61b0,0x1));};Dialer[_0x1e35('0x17')]['abandonmentRate']=function(_0x2a10e8,_0x481dfd,_0xa72574,_0x2cef2f,_0x3e5fac,_0x1f0607){loggerPredictive[_0x1e35('0x4b')](_0x1e35('0x208'));loggerPredictive[_0x1e35('0x4b')](_0x1e35('0x209'),_0x2a10e8);loggerPredictive['info'](_0x1e35('0x20a'),_0x481dfd);loggerPredictive[_0x1e35('0x4b')](_0x1e35('0x20b'),_0xa72574);loggerPredictive[_0x1e35('0x4b')](_0x1e35('0x20c'),_0x2cef2f);loggerPredictive[_0x1e35('0x4b')](_0x1e35('0x20d'),_0x3e5fac);loggerPredictive['info'](_0x1e35('0x54'));return new Promise(function(_0x33a83d,_0x35fe16){if(_0x2a10e8<=0x0||isNaN(_0x2a10e8)){return _0x35fe16(msgResponse('[abandonmentRate]','Error',_0x1e35('0x20e')+_0x2a10e8));}if(_0xa72574<=0x0||isNaN(_0xa72574)){return _0x35fe16(msgResponse(_0x1e35('0x20f'),'Error',_0x1e35('0x210')+_0xa72574));}if(_0x2cef2f<=0x0||isNaN(_0x2cef2f)){return _0x35fe16(msgResponse(_0x1e35('0x20f'),_0x1e35('0x83'),'p\x20=\x20'+_0x2cef2f));}if(_0x481dfd<=0x0||isNaN(_0x481dfd)){return _0x35fe16(msgResponse(_0x1e35('0x20f'),_0x1e35('0x83'),_0x1e35('0x211')+_0x481dfd));}if(_0x3e5fac<=0x0||isNaN(_0x3e5fac)){return _0x35fe16(msgResponse(_0x1e35('0x20f'),_0x1e35('0x83'),'Amax\x20=\x20'+_0x3e5fac));}_0x1f0607=_0x1f0607||0x0;var _0x29af51=0x1/_0xa72574;var _0x4864c3=0x0;var _0x5e34a9=0x0;var _0x3c8950=0x0;var _0x5f1621=0x0;for(var _0x1b35f4=0x0;_0x3c8950<_0x3e5fac;_0x1b35f4+=0x1){_0x5e34a9=_0x1b35f4/_0x481dfd;_0x4864c3=(_0x2cef2f*_0x5e34a9+_0x1f0607)/_0x29af51;_0x3c8950=utils[_0x1e35('0x212')](_0x4864c3,_0x2a10e8);_0x5f1621=_0x4864c3/_0x2a10e8*(0x1-utils['erlangb'](_0x4864c3,_0x2a10e8));}return _0x33a83d({'erlangCalls':_0x1b35f4,'erlangCallToSecond':_0x481dfd/_0x1b35f4,'erlangAbandonmentRate':_0x3c8950,'erlangBusyFactor':_0x5f1621});});};Dialer[_0x1e35('0x17')][_0x1e35('0x1d8')]=function(_0x55260b,_0x5bcdda,_0x1682db,_0x711518,_0x306e2b,_0x116e1e){loggerPredictive['info'](_0x1e35('0x213'));loggerPredictive[_0x1e35('0x4b')](_0x1e35('0x209'),_0x55260b);loggerPredictive[_0x1e35('0x4b')](_0x1e35('0x20a'),_0x5bcdda);loggerPredictive[_0x1e35('0x4b')](_0x1e35('0x20b'),_0x1682db);loggerPredictive[_0x1e35('0x4b')](_0x1e35('0x20c'),_0x711518);loggerPredictive[_0x1e35('0x4b')](_0x1e35('0x214'),_0x306e2b);loggerPredictive['info'](_0x1e35('0x54'));return new Promise(function(_0x104884,_0x422c2e){if(_0x55260b<=0x0||isNaN(_0x55260b)){return _0x422c2e(msgResponse(_0x1e35('0x215'),_0x1e35('0x83'),'m\x20=\x20'+_0x55260b));}if(_0x1682db<=0x0||isNaN(_0x1682db)){return _0x422c2e(msgResponse(_0x1e35('0x215'),_0x1e35('0x83'),_0x1e35('0x210')+_0x1682db));}if(_0x711518<=0x0||isNaN(_0x711518)){return _0x422c2e(msgResponse(_0x1e35('0x215'),_0x1e35('0x83'),_0x1e35('0x216')+_0x711518));}if(_0x5bcdda<=0x0||isNaN(_0x5bcdda)){return _0x422c2e(msgResponse(_0x1e35('0x215'),'Error',_0x1e35('0x211')+_0x5bcdda));}if(_0x306e2b<=0x0||isNaN(_0x306e2b)){return _0x422c2e(msgResponse('[busyFactor]',_0x1e35('0x83'),_0x1e35('0x217')+_0x306e2b));}_0x116e1e=_0x116e1e||0x0;var _0x4d2af8=0x1/_0x1682db;var _0x1eafd6=0x0;var _0x254d8d=0x0;var _0x2a6241=0x0;var _0x11ee70=0x0;for(var _0x272204=0x0;_0x11ee70<_0x306e2b;_0x272204+=0x1){_0x254d8d=_0x272204/_0x5bcdda;_0x1eafd6=(_0x711518*_0x254d8d+_0x116e1e)/_0x4d2af8;_0x2a6241=utils[_0x1e35('0x212')](_0x1eafd6,_0x55260b);_0x11ee70=_0x1eafd6/_0x55260b*(0x1-utils[_0x1e35('0x212')](_0x1eafd6,_0x55260b));}return _0x104884({'erlangCalls':_0x272204,'erlangCallToSecond':_0x5bcdda/_0x272204,'erlangAbandonmentRate':_0x2a6241,'erlangBusyFactor':_0x11ee70});});};module['exports']=Dialer;