Built motion from commit ae138b72.|2.6.28
[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 _0xa3d8=['content','indexOf','true','catch','some','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','resetActiveCalls','syncCampaigns','resolve','dialGlobalInterval','[syncCampaigns]','dialMethod','progressive','power','handlePower','method\x20not\x20recognized','dialTimezone','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','isGlobal','AMI\x20IfTime','uniqueid','ivr','updateOriginated','queue','answertime','YYYY-MM-DD\x20HH:mm:ss','outboundAnswerCallsDay','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','syncQueueCallerAbandon','droptime','responsetime','dialQueueTimeout','Drop','dropreason','countdropretry','countglobal','dialDropRetryFrequency','voiceQueue','additional','dialDropMaxRetry','queueCallerAbandonCreateState','add','minutes','ListId','calleridname','calleridnum','createHistory','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','countabandonedretry','callAdditionalPhoneAfterMin','verifyAdditionalPhones','dialAbandonedMaxRetry','rescheduleContact','dialAbandonedRetryFrequency','ContactId','syncNewExten','channel','actionid','strategy','rrmemory','roundrobin','isNil','locked','paused','stateinterface','queueBooked','idHopper','preview','run','CampaignId','queueBookedRR','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[Catch][Preview][syncQueueStatusComplete]','[booked][RR][finaly]','[booked][unlock]','[unlock][syncQueueStatusComplete]','[booked][unlock2]','VoiceQueueId','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','getQueue','response','Success','[callProgressDetecting]\x20','variable','xcally-motion-dialer','value','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','emit','custom:amd','buildObj','amd','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','countmachineretry','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','dialGlobalMaxRetry','stateGlobal','dialMachineMaxRetry','createStateFinal','[rescheduleContact][Machine]','dialAMDActive','[syncHangupInAMDIvr][createHistory]','reason19\x20machine....','reason\x2019\x20machine....','syncHangup','[syncHangupIvr]','AnswerAGI','AGI','[syncHangupIvr][createHistory]','dialQueueProject','Normal\x20Clearing','cause-txt','Unknow','running','isPreviewCampaign','getQueueCampaignStatusMessage','statusMessage','available','inUse','talking','pTalking','ACTIVE','checkDialMethod','compareToOutboundQueue','queueSummaryCountersUpdated','assign','[syncQueueSummary]','throttle','filter','dialPreviewRecallmeReminder','online','handlePreviewRecallNotifications','map','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','clearZombieChannels','[uniqueid]','[actions]','undefined','enqueue','No\x20such\x20channel','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','UserId','[emptyContact]','launchHandleIvr','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','isOutboundQueue','\x22%s,%s%s,,,%s\x22','dialQueueOptions','getCaller','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','setXMDContactVariables','Contact','Trunk','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','dialOriginateCallerIdName','getCallerIdRandom','XMD-ORIGINATECALLERIDNAME','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','dialPrefix','trim','substring','dialCutDigit','[originateError]:\x20%s','[originate][error]','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Drop]','[rescheduleContact][Abandoned]','dialMachineRetryFrequency','dialAgentRejectMaxRetry','countagentrejectretry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','reason','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','checkRetriveMax','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','[syncAgentComplete][createHistory][3]','dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','busy','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','outboundAbandonedCallsDay','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','outboundDropCallsDayTimeout','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','predictiveIntervalErlangCallsDroppedCalls','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','avgHandleTime','getDataPredictive','startMethodPredictive','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','predictiveIntervalHitRate','agentBusyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','loggedIn','outboundQueuePauses','predictiveIntervalPauses','abandonmentRate','[CatchErlangB]','one\x20call\x20every:','milliseconds','fail\x20to\x20scheduled\x20calls','checkContactBlack','[booked][checkContactBlack]','queueStatusComplete:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','Queue:\x20','scheduledat','dialRecallMeTimeout','Agent','unlockContact','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','handleIvr','limitCalls','checkContactEmpty','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','checkIsBlackListIvr','[actionOriginateIvr]\x20','[getContactCampaign2]','floor','dialLimitQueue','not_inuse','getContactDialer','countReScheduled','[countReScheduled]\x20','checkIsBlackList','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','dialOrderByScheduledAt','--------\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','p\x20=\x20','Amax\x20=\x20','erlangb','busyFactor','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','[busyFactor]','interval\x20=\x20','Umin\x20=\x20','util','lodash','ioredis','./utils','./utils/hopper','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','localhost','socket.io-emitter','../rpc/voiceQueueRt','../rpc/setting','../rpc/interval','./models/history','./models/final','./models/queueCallerAbandon','./models/hangup','env','XCALLY_IP_AGI','127.0.0.1','prototype','tail','finally','sequence','voiceQueues','campaigns','agents','maxNumberOriginate','actions','contactsId','uniqueId','optionPredictive','startProgressive','ivrOriginated','queuesSummary','agentconnect','syncAgentConnect','queuecallerabandon','bind','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','previewRecallmeReminderInterval','isUndefined','type','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','format','voice:queue:%s','voice_queue:save','info','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','getSeconds','name','startProgressive\x20value\x20cleared','startPredictive','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','checkContactLowerLimitOriginate','temp','CAMPAIGN_STATUS','[getContactDialer2][ReScheduled]','contacts','message','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','statedesc','endtime','starttime','queueStatusComplete','pick','Interval','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','isIVRCampaignActive','INACTIVE','\x20NOT\x20Active','isIVRCampaign','campaign:ivr:%s','sendMessageOneNotActive','originated','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','[ifTime][Action]','Error','stringify','isTrunkReachable','active','trunks','SIP/%s','status','reachable','unmonitored','checkIsTrunkReachable','TrunkBackup','checkIfTime','checkIfTimeIntervals','ifTimeIvr','ifTime','Failure','\x20Intervals\x20is\x20null\x20','\x20Intervals\x20is\x20empty\x20','timezones','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','length','push','Action','command','iftime\x20%s,%s','then'];(function(_0x156a0d,_0x3946ce){var _0x98a9ba=function(_0x46c1b2){while(--_0x46c1b2){_0x156a0d['push'](_0x156a0d['shift']());}};_0x98a9ba(++_0x3946ce);}(_0xa3d8,0x17a));var _0x8a3d=function(_0x4ba5f6,_0x3db231){_0x4ba5f6=_0x4ba5f6-0x0;var _0x48ab7e=_0xa3d8[_0x4ba5f6];return _0x48ab7e;};'use strict';var util=require(_0x8a3d('0x0'));var _=require(_0x8a3d('0x1'));var uuid=require('uuid');var moment=require('moment');var rr=require('rr');var Redis=require(_0x8a3d('0x2'));var utils=require(_0x8a3d('0x3'));var hopperUtils=require(_0x8a3d('0x4'));var ut=require(_0x8a3d('0x5'));var config=require(_0x8a3d('0x6'));var logger=require(_0x8a3d('0x7'))(_0x8a3d('0x8'));var loggerBooked=require(_0x8a3d('0x7'))(_0x8a3d('0x9'));var loggerPredictive=require(_0x8a3d('0x7'))(_0x8a3d('0xa'));var loggerPredictiveCalls=require('../../../config/logger')(_0x8a3d('0xb'));var loggerSyncQueueSummary=require(_0x8a3d('0x7'))(_0x8a3d('0xc'));var ami=require(_0x8a3d('0xd'));config[_0x8a3d('0xe')]=_['defaults'](config[_0x8a3d('0xe')],{'host':_0x8a3d('0xf'),'port':0x18eb});var io=require(_0x8a3d('0x10'))(new Redis(config[_0x8a3d('0xe')]));var cmHopper=require('../rpc/cmHopper');var voiceQueueRt=require(_0x8a3d('0x11'));var RpcSetting=require(_0x8a3d('0x12'));var Interval=require(_0x8a3d('0x13'));var Action=require('./models/action');var History=require(_0x8a3d('0x14'));var Final=require(_0x8a3d('0x15'));var AgentComplete=require('./models/agentComplete');var QueueCallerAbandon=require(_0x8a3d('0x16'));var Hangup=require(_0x8a3d('0x17'));var ipAgi=process[_0x8a3d('0x18')][_0x8a3d('0x19')]||_0x8a3d('0x1a');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x8a3d('0x1b')]['enqueue']=function(_0x5985b9){this[_0x8a3d('0x1c')]=this[_0x8a3d('0x1c')]?this['tail'][_0x8a3d('0x1d')](_0x5985b9):_0x5985b9();};function Dialer(_0x51a54c,_0x4224be){this[_0x8a3d('0x1e')]=new Sequence();this['preview']=_0x4224be;this[_0x8a3d('0x1f')]=_0x51a54c[_0x8a3d('0x1f')];this['campaigns']=_0x51a54c[_0x8a3d('0x20')];this[_0x8a3d('0x21')]=_0x51a54c['agents'];this['trunks']=_0x51a54c['trunks'];this[_0x8a3d('0x22')]=config[_0x8a3d('0x22')]||0x2;this['channels']={};this[_0x8a3d('0x23')]={};this[_0x8a3d('0x24')]={};this[_0x8a3d('0x25')]={};this[_0x8a3d('0x26')]={};this['startPredictive']={};this[_0x8a3d('0x27')]={};this[_0x8a3d('0x28')]={};this['queueBooked']={};this['queueBookedRR']={};this[_0x8a3d('0x29')]={};ami['on'](_0x8a3d('0x2a'),this[_0x8a3d('0x2b')]['bind'](this));ami['on'](_0x8a3d('0x2c'),this['syncQueueCallerAbandon'][_0x8a3d('0x2d')](this));ami['on'](_0x8a3d('0x2e'),this[_0x8a3d('0x2f')][_0x8a3d('0x2d')](this));ami['on'](_0x8a3d('0x30'),this[_0x8a3d('0x31')][_0x8a3d('0x2d')](this));ami['on'](_0x8a3d('0x32'),this[_0x8a3d('0xc')][_0x8a3d('0x2d')](this));ami['on'](_0x8a3d('0x33'),this[_0x8a3d('0x34')][_0x8a3d('0x2d')](this));ami['on'](_0x8a3d('0x35'),this['syncHangup'][_0x8a3d('0x2d')](this));ami['on']('newexten',this['syncNewExten']['bind'](this));ami['on']('varset',this[_0x8a3d('0x36')][_0x8a3d('0x2d')](this));ami['on'](_0x8a3d('0x37'),this[_0x8a3d('0x38')]['bind'](this));ami['on'](_0x8a3d('0x39'),this[_0x8a3d('0x3a')][_0x8a3d('0x2d')](this));this[_0x8a3d('0x3b')]();this[_0x8a3d('0x3c')]();RpcSetting[_0x8a3d('0x3d')]()['then'](function(_0xe11e3c){previewRecallmeReminderInterval=_0xe11e3c[_0x8a3d('0x3e')];});}function isNotNull(_0x3b35ea){return _0x3b35ea!==null&&!_[_0x8a3d('0x3f')](_0x3b35ea);}function msgResponse(_0x516a04,_0x4d25a9,_0x2f283e){return{'action':_0x516a04,'response':_0x4d25a9,'message':_0x2f283e,'stack':_0x2f283e};}function emit(_0x1e1deb,_0x5102b1,_0x1f2655){io['to'](_0x1e1deb)['emit'](_0x5102b1,_0x1f2655);}function emitOutboundVoiceQueueSummary(_0x4833da){if(_0x4833da[_0x8a3d('0x40')]==='outbound'){logger[_0x8a3d('0x41')](_0x8a3d('0x42'),util[_0x8a3d('0x43')](_0x4833da,{'showHidden':![],'depth':null}));emit(util[_0x8a3d('0x44')](_0x8a3d('0x45'),_0x4833da['name']),_0x8a3d('0x46'),_0x4833da);}}function checkGetDataPredictive(_0x5bd701){if(isNotNull(_0x5bd701)&&!_['isEmpty'](_0x5bd701)){loggerPredictive['info']('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0x8a3d('0x47')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5bd701[_0x8a3d('0x48')]);loggerPredictive[_0x8a3d('0x47')](_0x8a3d('0x49'),_0x5bd701[_0x8a3d('0x4a')]);loggerPredictive[_0x8a3d('0x47')](_0x8a3d('0x4b'),_0x5bd701[_0x8a3d('0x4c')]);loggerPredictive['info']('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5bd701[_0x8a3d('0x4d')]);loggerPredictive[_0x8a3d('0x47')](_0x8a3d('0x4e'),_0x5bd701[_0x8a3d('0x4f')]);loggerPredictive[_0x8a3d('0x47')](_0x8a3d('0x50'),_0x5bd701[_0x8a3d('0x51')]);loggerPredictive[_0x8a3d('0x47')]('---------------------------');if(_0x5bd701[_0x8a3d('0x48')]>0x0){if(!_['isUndefined'](_0x5bd701[_0x8a3d('0x51')])&&_0x5bd701[_0x8a3d('0x51')]>0x0){return!![];}loggerPredictive[_0x8a3d('0x47')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_[_0x8a3d('0x3f')](_0x5bd701[_0x8a3d('0x4f')])&&_0x5bd701[_0x8a3d('0x4f')]>0x0){return!![];}loggerPredictive[_0x8a3d('0x47')](_0x8a3d('0x52'));}else{loggerPredictive[_0x8a3d('0x47')](_0x8a3d('0x53'));}}else{loggerPredictive['info'](_0x8a3d('0x54'));}return![];}function mergeDataErlangB(_0x4045e3){return function(_0x22f134){loggerPredictive[_0x8a3d('0x47')](_0x8a3d('0x55'));loggerPredictive[_0x8a3d('0x47')](_0x8a3d('0x56'),_0x22f134[_0x8a3d('0x57')]);loggerPredictive[_0x8a3d('0x47')](_0x8a3d('0x58'),_0x22f134[_0x8a3d('0x59')]);loggerPredictive[_0x8a3d('0x47')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x22f134[_0x8a3d('0x5a')]);loggerPredictive[_0x8a3d('0x47')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x22f134[_0x8a3d('0x5b')]);loggerPredictive[_0x8a3d('0x47')](_0x8a3d('0x5c'),_0x22f134['erlangAbandonmentRate']);loggerPredictive[_0x8a3d('0x47')]('---------------------------');_[_0x8a3d('0x5d')](_0x4045e3,_0x22f134);};}function ifInterval(_0x33b38c,_0x26098e){if(_[_0x8a3d('0x3f')](_0x26098e)){return![];}return utils[_0x8a3d('0x5e')](undefined,_0x26098e)<_0x33b38c*0x3c;}function clearPredictiveAttributes(_0x688eff){if(_0x688eff[_0x8a3d('0x27')]){_0x688eff['startProgressive']=undefined;loggerPredictive[_0x8a3d('0x41')](_0x688eff[_0x8a3d('0x5f')],_0x8a3d('0x60'));}if(_0x688eff['startPredictive']){_0x688eff[_0x8a3d('0x61')]=undefined;loggerPredictive[_0x8a3d('0x41')](_0x688eff[_0x8a3d('0x5f')],_0x8a3d('0x62'));}if(_0x688eff[_0x8a3d('0x63')]){clearInterval(_0x688eff[_0x8a3d('0x63')]);_0x688eff['handlePredictive']=undefined;loggerPredictive[_0x8a3d('0x41')](_0x688eff[_0x8a3d('0x5f')],_0x8a3d('0x64'));}}function loggerCatchPredictive(_0x341f2d,_0x360364){return function(_0x371759){loggerPredictive[_0x8a3d('0x65')](_0x360364['name'],_0x341f2d);loggerPredictive[_0x8a3d('0x65')](_0x371759[_0x8a3d('0x66')]);clearPredictiveAttributes(_0x360364);};}function loggerCatch(_0x4e7821){return function(_0x4db6e1){logger[_0x8a3d('0x65')](_0x4e7821,util[_0x8a3d('0x43')](_0x4db6e1,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x3f55fc,_0x17da66,_0xa87880){return function(_0x2d9fc6){utils[_0x8a3d('0x67')](_0x17da66,_0xa87880,0x0);_0x17da66[_0x8a3d('0x68')]=0x0;logger['error'](_0x3f55fc,util['inspect'](_0x2d9fc6,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x2cea7d){return function(_0x39b653){if(isNotNull(_0x39b653)&&isNotNull(_0x39b653[0x0])){if(_0x39b653[0x0]['contactsRescheduled']>0x0){_0x2cea7d['message']=utils[_0x8a3d('0x69')]['CONTACTS_RESCHEDULED'];logger[_0x8a3d('0x47')](_0x8a3d('0x6a')+_0x2cea7d[_0x8a3d('0x5f')],_0x39b653[0x0]['contactsRescheduled'],_0x8a3d('0x6b'));}else{_0x2cea7d[_0x8a3d('0x6c')]=utils[_0x8a3d('0x69')][_0x8a3d('0x6d')];logger[_0x8a3d('0x47')](_0x8a3d('0x6e')+_0x2cea7d[_0x8a3d('0x5f')]);}}};}function createObjHistory(_0x5eb99a,_0x535a18,_0x3dcf,_0x4e7dfd,_0x48203f){_0x5eb99a[_0x8a3d('0x6c')]=_0x3dcf;var _0x31e739=new Action(_0x5eb99a,_0x535a18);var _0x4f04cd=new History(_0x31e739);_0x4f04cd[_0x8a3d('0x6f')]=_0x4e7dfd;_0x4f04cd[_0x8a3d('0x70')]=_0x48203f;_0x4f04cd[_0x8a3d('0x71')]=_0x31e739[_0x8a3d('0x72')];return _0x4f04cd;}function unlockQueueStatus(_0x1571bd,_0x2f2a62){setTimeout(function(){if(_[_0x8a3d('0x3f')](_0x1571bd[_0x8a3d('0x73')])){loggerBooked[_0x8a3d('0x65')]('[unlockQueueStatus][undefined]',_0x2f2a62);}_0x1571bd[_0x8a3d('0x73')]=!![];loggerBooked['info']('[booked][unlockQueueStatus]',_0x2f2a62,JSON['stringify'](_[_0x8a3d('0x74')](_0x1571bd,[_0x8a3d('0x5f'),_0x8a3d('0x73')])));},0x1f3);}function checkInterval(_0x22bc37){return function(){if(!isNotNull(_0x22bc37[_0x8a3d('0x75')])){_0x22bc37[_0x8a3d('0x6c')]=utils[_0x8a3d('0x69')][_0x8a3d('0x76')];throw _0x22bc37[_0x8a3d('0x5f')]+_0x8a3d('0x77');}if(!isNotNull(_0x22bc37[_0x8a3d('0x75')][_0x8a3d('0x78')])){_0x22bc37[_0x8a3d('0x6c')]=utils[_0x8a3d('0x69')][_0x8a3d('0x76')];throw _0x22bc37['name']+_0x8a3d('0x77');}if(!isNotNull(_[_0x8a3d('0x79')](_0x22bc37[_0x8a3d('0x75')][_0x8a3d('0x78')]))){_0x22bc37[_0x8a3d('0x6c')]=utils[_0x8a3d('0x69')][_0x8a3d('0x76')];throw _0x22bc37[_0x8a3d('0x5f')]+_0x8a3d('0x77');}};}function checkIsIVRCampaignActive(_0x5aecd2){return function(){if(!utils[_0x8a3d('0x7a')](_0x5aecd2)){_0x5aecd2[_0x8a3d('0x6c')]=utils['CAMPAIGN_STATUS'][_0x8a3d('0x7b')];throw _0x5aecd2['name']+_0x8a3d('0x7c');}};}function emitCampaignSummary(_0x4de886){if(utils[_0x8a3d('0x7d')](_0x4de886)){emit(util[_0x8a3d('0x44')](_0x8a3d('0x7e'),_0x4de886['name']),'campaign:save',_0x4de886);}}function loggerCatchQueueSummary(_0x5b6253,_0x525c20){return function(_0x1964e2){clearPredictiveAttributes(_0x525c20);emitCampaignSummary(_0x525c20);loggerSyncQueueSummary['debug'](_0x5b6253,util[_0x8a3d('0x43')](_0x1964e2,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x5334b8){if(_0x5334b8[_0x8a3d('0x7f')]){if(_0x5334b8[_0x8a3d('0x80')]===0x0){_0x5334b8[_0x8a3d('0x7f')]=![];_0x5334b8['message']=utils['CAMPAIGN_STATUS'][_0x8a3d('0x7b')];loggerSyncQueueSummary[_0x8a3d('0x41')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x5334b8['name'],'is\x20not\x20active');}else{_0x5334b8['message']=utils['CAMPAIGN_STATUS']['DISACTIVED'];loggerSyncQueueSummary[_0x8a3d('0x41')](_0x8a3d('0x81'),_0x5334b8['name'],_0x8a3d('0x82'));}emitCampaignSummary(_0x5334b8);}}function myreject(_0xd5d38b){return function(_0x204d01){return _0xd5d38b(msgResponse(_0x8a3d('0x83'),_0x8a3d('0x84'),JSON[_0x8a3d('0x85')](_0x204d01)));};}Dialer[_0x8a3d('0x1b')][_0x8a3d('0x86')]=function(_0x47b150){return!_[_0x8a3d('0x3f')](_0x47b150)&&_0x47b150&&!_['isUndefined'](_0x47b150[_0x8a3d('0x5f')])&&!_[_0x8a3d('0x3f')](_0x47b150[_0x8a3d('0x87')])&&_0x47b150['active']&&(this[_0x8a3d('0x88')][util[_0x8a3d('0x44')](_0x8a3d('0x89'),_0x47b150['name'])][_0x8a3d('0x8a')]===_0x8a3d('0x8b')||this['trunks'][util[_0x8a3d('0x44')](_0x8a3d('0x89'),_0x47b150[_0x8a3d('0x5f')])][_0x8a3d('0x8a')]===_0x8a3d('0x8c'));};Dialer[_0x8a3d('0x1b')][_0x8a3d('0x8d')]=function(_0x9b2419){var _0x167593=this;return function(){if(!_0x167593[_0x8a3d('0x86')](_0x9b2419['Trunk'])){if(!_0x167593['isTrunkReachable'](_0x9b2419[_0x8a3d('0x8e')])){_0x9b2419[_0x8a3d('0x6c')]=utils['CAMPAIGN_STATUS']['TRUNK_NOT_REACHABLE'];throw _0x9b2419[_0x8a3d('0x5f')]+'\x20trunk\x20is\x20not\x20reachable';}}};};Dialer[_0x8a3d('0x1b')][_0x8a3d('0x8f')]=function(_0x20893d,_0x35f321,_0xa40343,_0x386923){var _0x485e8d=this;return function(){var _0x2cc58d=!![];return _0x485e8d['ifTimeIvr'](_0x20893d,_0x35f321,_0xa40343,_0x386923,_0x2cc58d);};};Dialer['prototype'][_0x8a3d('0x90')]=function(_0x2cba7e,_0x133ce6,_0x5229c1,_0x4cf9f5){var _0x533859=this;return function(){var _0x32ea1c=![];return _0x533859[_0x8a3d('0x91')](_0x2cba7e[_0x8a3d('0x78')],_0x133ce6,_0x5229c1,_0x4cf9f5,_0x32ea1c);};};Dialer[_0x8a3d('0x1b')][_0x8a3d('0x91')]=function(_0x5a4d3b,_0xdced6,_0x5b014f,_0x199402,_0x8ae63f){var _0x568aa1=[];return new Promise(function(_0x71d7b8,_0x1bb252){if(!isNotNull(_0x5a4d3b)){_0x199402[_0x8a3d('0x6c')]=utils['CAMPAIGN_STATUS']['NULL_INTERVAL'];return _0x1bb252(msgResponse(_0x8a3d('0x92'),_0x8a3d('0x93'),_0x5b014f+_0x8a3d('0x94')));}if(_['isEmpty'](_0x5a4d3b)){_0x199402[_0x8a3d('0x6c')]=utils[_0x8a3d('0x69')]['EMPTY_INTERVAL'];return _0x1bb252(msgResponse(_0x8a3d('0x92'),'Failure',_0x5b014f+_0x8a3d('0x95')));}if(_0xdced6&&_[_0x8a3d('0x3f')](config[_0x8a3d('0x96')][_0xdced6])){_0x199402[_0x8a3d('0x6c')]=utils[_0x8a3d('0x69')][_0x8a3d('0x97')];return _0x1bb252(msgResponse('ifTime','Failure',_0x5b014f+_0x8a3d('0x98')+_0xdced6));}if(_['isArray'](_0x5a4d3b)){for(var _0xd78351=0x0;_0xd78351<_0x5a4d3b[_0x8a3d('0x99')];_0xd78351+=0x1){_0x568aa1[_0x8a3d('0x9a')](ami[_0x8a3d('0x9b')]({'action':_0x8a3d('0x9c'),'command':util[_0x8a3d('0x44')](_0x8a3d('0x9d'),_0x5a4d3b[_0xd78351]['interval'],!_[_0x8a3d('0x3f')](config[_0x8a3d('0x96')][_0xdced6])?_0xdced6:'')})[_0x8a3d('0x9e')](function(_0x5652ea){return _0x5652ea[_0x8a3d('0x9f')][_0x8a3d('0xa0')](_0x8a3d('0xa1'))>=0x0;})[_0x8a3d('0xa2')](myreject(_0x1bb252)));}}else{_0x568aa1[_0x8a3d('0x9a')](ami['Action']({'action':_0x8a3d('0x9c'),'command':util[_0x8a3d('0x44')](_0x8a3d('0x9d'),_0x5a4d3b,!_[_0x8a3d('0x3f')](config[_0x8a3d('0x96')][_0xdced6])?_0xdced6:'')})[_0x8a3d('0x9e')](function(_0x17e218){return _0x17e218[_0x8a3d('0x9f')]['indexOf'](_0x8a3d('0xa1'))>=0x0;})[_0x8a3d('0xa2')](myreject(_0x1bb252)));}Promise['all'](_0x568aa1)[_0x8a3d('0x9e')](function(_0x16bbae){var _0x293c54=_[_0x8a3d('0xa3')](_0x16bbae);if(_0x293c54){return _0x71d7b8(_0x293c54);}else{_0x199402['message']=_0x8ae63f?utils[_0x8a3d('0x69')][_0x8a3d('0xa4')]:utils[_0x8a3d('0x69')][_0x8a3d('0xa5')];return _0x1bb252(msgResponse(_0x8a3d('0xa6'),_0x8a3d('0x93'),_0x8a3d('0xa7')+_0x8ae63f+'\x20'+_0x5b014f+_0x8a3d('0xa8')+util[_0x8a3d('0x43')](_0x5a4d3b,{'showHidden':![],'depth':null})+_0x8a3d('0xa9')+_0xdced6));}})[_0x8a3d('0xa2')](function(_0x3523fb){return _0x1bb252(msgResponse(_0x8a3d('0x92'),_0x8a3d('0x93'),JSON[_0x8a3d('0x85')](_0x3523fb)));});});};Dialer['prototype'][_0x8a3d('0x3b')]=function(){var _0x5af893=this;return cmHopper[_0x8a3d('0xaa')]({'active':![]},{'where':{'active':!![]}})['then'](function(){setInterval(function(){_0x5af893[_0x8a3d('0xab')]();},0x3e8);});};Dialer[_0x8a3d('0x1b')][_0x8a3d('0xab')]=function(){var _0x551fa1=this;var _0x21ce1a;for(var _0x535a48 in this[_0x8a3d('0x20')]){if(typeof this[_0x8a3d('0x20')][_0x535a48]!=='undefined'){_0x21ce1a=this[_0x8a3d('0x20')][_0x535a48];if(utils[_0x8a3d('0x7d')](_0x21ce1a)&&utils[_0x8a3d('0x7a')](_0x21ce1a)){_0x21ce1a[_0x8a3d('0x7f')]=!![];Promise[_0x8a3d('0xac')]()[_0x8a3d('0x9e')](checkIsIVRCampaignActive(_0x21ce1a))[_0x8a3d('0x9e')](checkInterval(_0x21ce1a))[_0x8a3d('0x9e')](_0x551fa1[_0x8a3d('0x8d')](_0x21ce1a))[_0x8a3d('0x9e')](_0x551fa1[_0x8a3d('0x8f')](_0x21ce1a[_0x8a3d('0xad')],_0x21ce1a['dialTimezone'],_0x21ce1a[_0x8a3d('0x5f')],_0x21ce1a))['then'](_0x551fa1[_0x8a3d('0x90')](_0x21ce1a[_0x8a3d('0x75')],_0x21ce1a['dialTimezone'],_0x21ce1a['name'],_0x21ce1a))[_0x8a3d('0x9e')](_0x551fa1['launchHandleIvr'](_0x21ce1a))[_0x8a3d('0xa2')](loggerCatchQueueSummary(_0x8a3d('0xae'),_0x21ce1a));}else{notSendMessagesCampaign(_0x21ce1a);}}}};Dialer['prototype']['checkDialMethod']=function(_0xd311b){if(_0xd311b['dialMethod']!==_0x8a3d('0xa')){clearPredictiveAttributes(_0xd311b);}switch(_0xd311b[_0x8a3d('0xaf')]){case _0x8a3d('0xb0'):this['handlePower'](_0xd311b,0x1);break;case _0x8a3d('0xb1'):this['handlePower'](_0xd311b,_0xd311b['dialPowerLevel']);break;case _0x8a3d('0xa'):this[_0x8a3d('0xa')](_0xd311b);break;case'booked':this[_0x8a3d('0xb2')](_0xd311b,0x1);break;default:logger[_0x8a3d('0x65')]('Queue',_0xd311b[_0x8a3d('0x5f')],_0x8a3d('0xb3'));}};Dialer[_0x8a3d('0x1b')]['ifTime']=function(_0x42ba01,_0x262bb6){var _0x3bac5c=_0x42ba01[_0x8a3d('0xb4')];var _0x5b7a98=_0x262bb6?_0x42ba01['dialGlobalInterval']:_0x42ba01[_0x8a3d('0x75')][_0x8a3d('0x78')];logger[_0x8a3d('0xb5')](_0x8a3d('0xb6'),_0x5b7a98,_0x3bac5c,_0x42ba01[_0x8a3d('0x5f')],util['format'](_0x8a3d('0xb7'),_0x42ba01['name'],_0x42ba01['id']));var _0x455c94=null;return Interval[_0x8a3d('0xb8')](_0x5b7a98,_0x3bac5c)[_0x8a3d('0x9e')](function(_0x382cc9){if(_0x382cc9===!![]){return _0x382cc9;}else{_0x42ba01[_0x8a3d('0x6c')]=_0x262bb6?utils[_0x8a3d('0x69')]['OVERTIME_GLOBAL_INTERVAL']:utils[_0x8a3d('0x69')][_0x8a3d('0xa5')];_0x455c94=msgResponse('[ifTime][promiseAll]',_0x8a3d('0x93'),_0x8a3d('0xa7')+_0x262bb6+'\x20'+_0x42ba01[_0x8a3d('0x5f')]+_0x8a3d('0xa8')+util['inspect'](_0x5b7a98,{'showHidden':![],'depth':null})+_0x8a3d('0xa9')+_0x3bac5c);}if(_0x455c94!==null){logger['silly']('Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:',_0x455c94);_0x455c94[_0x8a3d('0xb9')]=_0x262bb6;throw _0x455c94;}})[_0x8a3d('0xa2')](function(_0x3b9294){logger['error'](_0x8a3d('0xba'),_0x3b9294);throw msgResponse(_0x8a3d('0x83'),_0x8a3d('0x84'),util[_0x8a3d('0x43')](_0x3b9294,{'showHidden':![],'depth':null}));});};Dialer[_0x8a3d('0x1b')][_0x8a3d('0x2b')]=function(_0x58a28e){if(this[_0x8a3d('0x1f')][_0x58a28e['queue']]){if(this['uniqueId'][_0x58a28e['uniqueid']]&&this[_0x8a3d('0x25')][_0x58a28e[_0x8a3d('0xbb')]][_0x8a3d('0x40')]!==_0x8a3d('0xbc')){this[_0x8a3d('0xbd')](this[_0x8a3d('0x1f')][_0x58a28e[_0x8a3d('0xbe')]]);this[_0x8a3d('0x25')][_0x58a28e['uniqueid']][_0x8a3d('0xbf')]=moment()[_0x8a3d('0x44')](_0x8a3d('0xc0'));}}};Dialer[_0x8a3d('0x1b')][_0x8a3d('0x31')]=function(_0x4a73f4){var _0x3e07f1=this['uniqueId'][_0x4a73f4[_0x8a3d('0xbb')]];if(this[_0x8a3d('0x1f')][_0x4a73f4['queue']]){if(_0x3e07f1&&_0x3e07f1[_0x8a3d('0x40')]!==_0x8a3d('0xbc')){delete this[_0x8a3d('0x25')][_0x4a73f4['uniqueid']];this['voiceQueues'][_0x4a73f4['queue']][_0x8a3d('0xc1')]+=0x1;var _0x449913=new AgentComplete(_0x3e07f1,_0x4a73f4);if(_0x4a73f4['reason']===_0x8a3d('0xc2')){_0x449913[_0x8a3d('0xc3')]=this['voiceQueues'][_0x4a73f4['queue']][_0x8a3d('0xc4')]&&this['voiceQueues'][_0x4a73f4[_0x8a3d('0xbe')]][_0x8a3d('0xc5')]?moment()[_0x8a3d('0x44')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}hopperUtils['createHistory'](_0x449913)['catch'](loggerCatch(_0x8a3d('0xc6')));hopperUtils[_0x8a3d('0xc7')](_0x449913)[_0x8a3d('0xa2')](loggerCatch(_0x8a3d('0xc8')));}}};Dialer['prototype'][_0x8a3d('0xc9')]=function(_0xb3e118){var _0x437473=this['uniqueId'][_0xb3e118[_0x8a3d('0xbb')]];var _0x2b8018=this;var _0x4c6a88=![];var _0x318ffe;var _0x279e6b;if(this['voiceQueues'][_0xb3e118['queue']]){if(_0x437473&&_0x437473[_0x8a3d('0x40')]!==_0x8a3d('0xbc')){delete this['uniqueId'][_0xb3e118['uniqueid']];this[_0x8a3d('0xbd')](this['voiceQueues'][_0xb3e118[_0x8a3d('0xbe')]]);_0x437473[_0x8a3d('0xca')]=moment()[_0x8a3d('0x44')](_0x8a3d('0xc0'));var _0x5356da=new QueueCallerAbandon(_0x437473,_0xb3e118);if(utils[_0x8a3d('0x5e')](_0x437473[_0x8a3d('0xca')],_0x437473[_0x8a3d('0xcb')])>=_0x437473[_0x8a3d('0xcc')]){this[_0x8a3d('0x1f')][_0xb3e118['queue']][_0x8a3d('0x4c')]+=0x1;this['voiceQueues'][_0xb3e118[_0x8a3d('0xbe')]]['outboundDropCallsDayTimeout']+=0x1;this[_0x8a3d('0x1f')][_0xb3e118[_0x8a3d('0xbe')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x5356da['state']=0xa;_0x5356da['statedesc']=_0x8a3d('0xcd');_0x5356da[_0x8a3d('0xce')]='TIMEOUT';_0x5356da[_0x8a3d('0xc3')]=this[_0x8a3d('0x1f')][_0xb3e118[_0x8a3d('0xbe')]][_0x8a3d('0xc4')]?moment()[_0x8a3d('0x44')](_0x8a3d('0xc0')):undefined;_0x5356da[_0x8a3d('0xcf')]+=0x1;_0x5356da[_0x8a3d('0xd0')]+=0x1;_0x318ffe=this[_0x8a3d('0x1f')][_0xb3e118['queue']][_0x8a3d('0xd1')];_0x279e6b=this[_0x8a3d('0x1f')][_0xb3e118[_0x8a3d('0xbe')]]['callAdditionalPhoneAfterMin'];hopperUtils['verifyAdditionalPhones'](_0x5356da,_0x5356da[_0x8a3d('0x6f')],_0x437473[_0x8a3d('0xd2')])['then'](function(_0x23e67d){_0x4c6a88=_0x23e67d[_0x8a3d('0xd3')]==0x1;if(_0x5356da[_0x8a3d('0xcf')]>=_0x2b8018[_0x8a3d('0x1f')][_0xb3e118[_0x8a3d('0xbe')]][_0x8a3d('0xd4')]){_0x2b8018[_0x8a3d('0xd5')](_0x5356da,_0x23e67d[_0x8a3d('0xd3')]);}else{hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x5356da['countdropretry'],'scheduledat':moment()[_0x8a3d('0xd6')](_0x2b8018[_0x8a3d('0x1f')][_0xb3e118[_0x8a3d('0xbe')]][_0x8a3d('0xd1')],_0x8a3d('0xd7'))[_0x8a3d('0x44')](_0x8a3d('0xc0')),'ContactId':_0x437473['ContactId'],'ListId':_0x437473[_0x8a3d('0xd8')],'VoiceQueueId':_0x437473['VoiceQueueId']||undefined,'CampaignId':_0x437473['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][Drop]'));var _0x307ff2=new History(_0x5356da);_0x307ff2[_0x8a3d('0x6f')]=0xa;_0x307ff2[_0x8a3d('0x70')]=_0x8a3d('0xcd');_0x307ff2[_0x8a3d('0x72')]=moment()[_0x8a3d('0x44')](_0x8a3d('0xc0'));_0x307ff2[_0x8a3d('0x71')]=_0x307ff2[_0x8a3d('0x72')];_0x307ff2[_0x8a3d('0xd9')]=_0x5356da[_0x8a3d('0xd9')];_0x307ff2['calleridnum']=_0x5356da[_0x8a3d('0xda')];hopperUtils[_0x8a3d('0xdb')](_0x307ff2)['catch'](loggerCatch(_0x8a3d('0xdc')));}})[_0x8a3d('0x9e')](function(){if(_0x4c6a88)hopperUtils[_0x8a3d('0xdd')](_0x5356da,_0x318ffe,_0x279e6b)[_0x8a3d('0x9e')](function(){return 0x1;});});}else{this[_0x8a3d('0x1f')][_0xb3e118[_0x8a3d('0xbe')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this['voiceQueues'][_0xb3e118[_0x8a3d('0xbe')]][_0x8a3d('0xde')]+=0x1;_0x5356da[_0x8a3d('0x6f')]=0xb;_0x5356da[_0x8a3d('0x70')]=_0x8a3d('0xdf');_0x5356da[_0x8a3d('0xce')]=_0x8a3d('0xe0');_0x5356da[_0x8a3d('0xe1')]+=0x1;_0x5356da['countglobal']+=0x1;_0x318ffe=this[_0x8a3d('0x1f')][_0xb3e118[_0x8a3d('0xbe')]]['dialAbandonedRetryFrequency'];_0x279e6b=this[_0x8a3d('0x1f')][_0xb3e118[_0x8a3d('0xbe')]][_0x8a3d('0xe2')];hopperUtils[_0x8a3d('0xe3')](_0x5356da,_0x5356da[_0x8a3d('0x6f')],_0x437473[_0x8a3d('0xd2')])[_0x8a3d('0x9e')](function(_0x41a1e4){if(_0x5356da['countabandonedretry']>=_0x2b8018[_0x8a3d('0x1f')][_0xb3e118[_0x8a3d('0xbe')]][_0x8a3d('0xe4')]){_0x2b8018[_0x8a3d('0xd5')](_0x5356da,_0x41a1e4[_0x8a3d('0xd3')]);}else{hopperUtils[_0x8a3d('0xe5')]({'active':![],'countabandonedretry':_0x5356da['countabandonedretry'],'scheduledat':moment()[_0x8a3d('0xd6')](_0x2b8018[_0x8a3d('0x1f')][_0xb3e118[_0x8a3d('0xbe')]][_0x8a3d('0xe6')],'minutes')[_0x8a3d('0x44')](_0x8a3d('0xc0')),'ContactId':_0x437473[_0x8a3d('0xe7')],'ListId':_0x437473[_0x8a3d('0xd8')],'VoiceQueueId':_0x437473['VoiceQueueId']||undefined,'CampaignId':_0x437473['CampaignId']||undefined})[_0x8a3d('0xa2')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x3f4471=new History(_0x5356da);_0x3f4471['state']=0xb;_0x3f4471[_0x8a3d('0x70')]=_0x8a3d('0xdf');_0x3f4471[_0x8a3d('0x72')]=moment()['format'](_0x8a3d('0xc0'));_0x3f4471[_0x8a3d('0x71')]=_0x3f4471[_0x8a3d('0x72')];_0x3f4471[_0x8a3d('0xd9')]=_0x5356da[_0x8a3d('0xd9')];_0x3f4471[_0x8a3d('0xda')]=_0x5356da[_0x8a3d('0xda')];hopperUtils[_0x8a3d('0xdb')](_0x3f4471)[_0x8a3d('0xa2')](loggerCatch('[syncAgentComplete][createHistory][11]'));}})[_0x8a3d('0x9e')](function(){if(_0x4c6a88)hopperUtils[_0x8a3d('0xdd')](_0x5356da,_0x318ffe,_0x279e6b)[_0x8a3d('0x9e')](function(){return 0x1;});});}}}};Dialer[_0x8a3d('0x1b')][_0x8a3d('0xe8')]=function(_0x5a4f66){if(this[_0x8a3d('0x23')][_0x5a4f66[_0x8a3d('0xbb')]]){this[_0x8a3d('0x23')][_0x5a4f66[_0x8a3d('0xbb')]]['channel']=_0x5a4f66[_0x8a3d('0xe9')];}if(this[_0x8a3d('0x25')][_0x5a4f66[_0x8a3d('0xbb')]]){this[_0x8a3d('0x25')][_0x5a4f66['uniqueid']]['channel']=_0x5a4f66[_0x8a3d('0xe9')];}};Dialer[_0x8a3d('0x1b')][_0x8a3d('0x38')]=function(_0x3f485e){if(!this[_0x8a3d('0x23')][_0x3f485e['actionid']]){return;}var _0x27d434=this[_0x8a3d('0x1f')][this[_0x8a3d('0x23')][_0x3f485e[_0x8a3d('0xea')]][_0x8a3d('0xbe')]][_0x8a3d('0xeb')]||_0x8a3d('0xec');if(_0x27d434===_0x8a3d('0xed')){if(this[_0x8a3d('0x23')][_0x3f485e['actionid']]&&_[_0x8a3d('0xee')](this['actions'][_0x3f485e[_0x8a3d('0xea')]][_0x8a3d('0xef')])&&_0x3f485e[_0x8a3d('0x8a')]==='1'&&_0x3f485e[_0x8a3d('0xf0')]==='0'){if(this[_0x8a3d('0x21')][_0x3f485e[_0x8a3d('0xf1')]]){if(!this[_0x8a3d('0x21')][_0x3f485e['stateinterface']][_0x8a3d('0xef')]){this[_0x8a3d('0x21')][_0x3f485e['stateinterface']][_0x8a3d('0xef')]=!![];this[_0x8a3d('0x23')][_0x3f485e[_0x8a3d('0xea')]]['locked']=!![];this['actions'][_0x3f485e[_0x8a3d('0xea')]][_0x8a3d('0xf1')]=_0x3f485e[_0x8a3d('0xf1')];}}}}else if(_0x27d434===_0x8a3d('0xec')){if(this[_0x8a3d('0x23')][_0x3f485e[_0x8a3d('0xea')]]){if(this[_0x8a3d('0x21')][_0x3f485e['stateinterface']]){this['actions'][_0x3f485e[_0x8a3d('0xea')]][_0x8a3d('0xf1')]=_0x3f485e[_0x8a3d('0xf1')];if(_['isNil'](this[_0x8a3d('0xf2')][this[_0x8a3d('0x23')][_0x3f485e[_0x8a3d('0xea')]][_0x8a3d('0xbe')]])){this[_0x8a3d('0xf2')][this[_0x8a3d('0x23')][_0x3f485e[_0x8a3d('0xea')]][_0x8a3d('0xbe')]]=[];}this[_0x8a3d('0xf2')][this['actions'][_0x3f485e[_0x8a3d('0xea')]][_0x8a3d('0xbe')]]['push'](_[_0x8a3d('0x5d')](_['pick'](this[_0x8a3d('0x23')][_0x3f485e['actionid']],[_0x8a3d('0xf3'),_0x8a3d('0xf1')]),{'status':_0x3f485e[_0x8a3d('0x8a')],'paused':_0x3f485e[_0x8a3d('0xf0')]}));}}}};Dialer['prototype'][_0x8a3d('0x3a')]=function(_0x457648){if(!this[_0x8a3d('0x23')][_0x457648[_0x8a3d('0xea')]]){return;}var _0x4c406f=this;var _0x513e74=this['voiceQueues'][this['actions'][_0x457648[_0x8a3d('0xea')]][_0x8a3d('0xbe')]];var _0x401c45=_0x513e74['strategy']||'rrmemory';if(_0x401c45===_0x8a3d('0xed')){if(this[_0x8a3d('0x23')][_0x457648['actionid']]&&this[_0x8a3d('0x23')][_0x457648[_0x8a3d('0xea')]][_0x8a3d('0xf1')]){this[_0x8a3d('0xf4')][_0x8a3d('0xf5')](this[_0x8a3d('0x23')][_0x457648[_0x8a3d('0xea')]]['idHopper'],this[_0x8a3d('0x23')][_0x457648[_0x8a3d('0xea')]][_0x8a3d('0xf1')])[_0x8a3d('0xa2')](function(_0x150746){logger[_0x8a3d('0x65')]('[Catch][Preview][syncQueueStatusComplete]',util[_0x8a3d('0x43')](_0x150746,{'showHidden':![],'depth':null}));})[_0x8a3d('0x1d')](function(){_0x4c406f['updateOriginated'](_0x4c406f[_0x8a3d('0x1f')][_0x4c406f['actions'][_0x457648[_0x8a3d('0xea')]]['queue']]);_0x4c406f[_0x8a3d('0x21')][_0x4c406f[_0x8a3d('0x23')][_0x457648[_0x8a3d('0xea')]][_0x8a3d('0xf1')]]['locked']=![];delete _0x4c406f[_0x8a3d('0x23')][_0x457648[_0x8a3d('0xea')]];unlockQueueStatus(_0x513e74);});}else{this['updateOriginated'](this[_0x8a3d('0x1f')][this['actions'][_0x457648[_0x8a3d('0xea')]][_0x8a3d('0xbe')]]);hopperUtils['rescheduleContact']({'active':![],'ContactId':this[_0x8a3d('0x23')][_0x457648['actionid']][_0x8a3d('0xe7')],'ListId':this[_0x8a3d('0x23')][_0x457648['actionid']][_0x8a3d('0xd8')],'VoiceQueueId':this['actions'][_0x457648[_0x8a3d('0xea')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x8a3d('0x23')][_0x457648[_0x8a3d('0xea')]][_0x8a3d('0xf6')]||undefined})['catch'](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this['actions'][_0x457648[_0x8a3d('0xea')]];unlockQueueStatus(_0x513e74);}}else if(_0x401c45===_0x8a3d('0xec')){var _0x2970b2;if(this['actions'][_0x457648[_0x8a3d('0xea')]]&&!_[_0x8a3d('0x79')](this[_0x8a3d('0xf2')][this['actions'][_0x457648[_0x8a3d('0xea')]][_0x8a3d('0xbe')]])){if(this[_0x8a3d('0xf7')][_0x4c406f[_0x8a3d('0x23')][_0x457648['actionid']][_0x8a3d('0xbe')]]){this[_0x8a3d('0xf7')][_0x4c406f[_0x8a3d('0x23')][_0x457648[_0x8a3d('0xea')]][_0x8a3d('0xbe')]]=this[_0x8a3d('0xf7')][this['actions'][_0x457648[_0x8a3d('0xea')]]['queue']]?this['queueBookedRR'][this['actions'][_0x457648['actionid']][_0x8a3d('0xbe')]]:this[_0x8a3d('0xf2')][this['actions'][_0x457648[_0x8a3d('0xea')]][_0x8a3d('0xbe')]]?this['queueBooked'][this[_0x8a3d('0x23')][_0x457648[_0x8a3d('0xea')]][_0x8a3d('0xbe')]][_0x8a3d('0xf8')]||0x0:0x0;}this['queueBooked'][this[_0x8a3d('0x23')][_0x457648[_0x8a3d('0xea')]][_0x8a3d('0xbe')]][_0x8a3d('0xf8')]=this[_0x8a3d('0xf7')][this['actions'][_0x457648[_0x8a3d('0xea')]]['queue']];for(var _0x3ba623=0x0;_0x3ba623<this[_0x8a3d('0xf2')][this['actions'][_0x457648[_0x8a3d('0xea')]]['queue']][_0x8a3d('0x99')];_0x3ba623+=0x1){_0x2970b2=rr(this[_0x8a3d('0xf2')][this['actions'][_0x457648[_0x8a3d('0xea')]][_0x8a3d('0xbe')]]);this[_0x8a3d('0xf7')][_0x4c406f[_0x8a3d('0x23')][_0x457648[_0x8a3d('0xea')]][_0x8a3d('0xbe')]]=this[_0x8a3d('0xf2')][this[_0x8a3d('0x23')][_0x457648[_0x8a3d('0xea')]]['queue']][_0x8a3d('0xf8')];if(_0x2970b2[_0x8a3d('0x8a')]==='1'&&_0x2970b2[_0x8a3d('0xf0')]==='0'){break;}}if(!_['isNil'](_0x2970b2)){this[_0x8a3d('0x21')][_0x2970b2[_0x8a3d('0xf1')]][_0x8a3d('0xf9')]=_[_0x8a3d('0x3f')](this[_0x8a3d('0x21')][_0x2970b2[_0x8a3d('0xf1')]][_0x8a3d('0xf9')])?!![]:this[_0x8a3d('0x21')][_0x2970b2[_0x8a3d('0xf1')]][_0x8a3d('0xf9')];}loggerBooked[_0x8a3d('0x47')](_0x8a3d('0xfa'),_0x457648['actionid'],_0x8a3d('0xfb'),JSON[_0x8a3d('0x85')](_[_0x8a3d('0x74')](this[_0x8a3d('0x21')][_0x2970b2[_0x8a3d('0xf1')]],['name',_0x8a3d('0xf9')])),_0x8a3d('0xfc'),JSON['stringify'](_0x2970b2[_0x8a3d('0xf3')]));if(!_[_0x8a3d('0xee')](_0x2970b2)&&_0x2970b2[_0x8a3d('0x8a')]==='1'&&_0x2970b2[_0x8a3d('0xf0')]==='0'&&this[_0x8a3d('0x21')][_0x2970b2[_0x8a3d('0xf1')]][_0x8a3d('0xf9')]){this['agents'][_0x2970b2[_0x8a3d('0xf1')]]['unlockRR']=![];this[_0x8a3d('0xf2')][_0x4c406f[_0x8a3d('0x23')][_0x457648['actionid']][_0x8a3d('0xbe')]]=[];this['preview'][_0x8a3d('0xf5')](_0x2970b2['idHopper'],_0x2970b2[_0x8a3d('0xf1')])[_0x8a3d('0xa2')](function(_0x8ec05d){logger[_0x8a3d('0x65')](_0x8a3d('0xfd'),util[_0x8a3d('0x43')](_0x8ec05d,{'showHidden':![],'depth':null}));})[_0x8a3d('0x1d')](function(){_0x4c406f['updateOriginated'](_0x4c406f['voiceQueues'][_0x4c406f[_0x8a3d('0x23')][_0x457648[_0x8a3d('0xea')]]['queue']]);setTimeout(function(){_0x4c406f['agents'][_0x2970b2[_0x8a3d('0xf1')]]['unlockRR']=!![];loggerBooked[_0x8a3d('0x47')](_0x8a3d('0xfe'),_0x457648['actionid'],_0x8a3d('0xfb'),JSON[_0x8a3d('0x85')](_[_0x8a3d('0x74')](_0x4c406f[_0x8a3d('0x21')][_0x2970b2[_0x8a3d('0xf1')]],['name','unlockRR'])),_0x8a3d('0xfc'),JSON[_0x8a3d('0x85')](_0x2970b2[_0x8a3d('0xf3')]));},0xc7);delete _0x4c406f[_0x8a3d('0x23')][_0x457648[_0x8a3d('0xea')]];unlockQueueStatus(_0x513e74,_0x457648[_0x8a3d('0xea')]);});}else{loggerBooked[_0x8a3d('0x47')](_0x8a3d('0xff'));this[_0x8a3d('0xbd')](this[_0x8a3d('0x1f')][this[_0x8a3d('0x23')][_0x457648[_0x8a3d('0xea')]][_0x8a3d('0xbe')]]);hopperUtils[_0x8a3d('0xe5')]({'active':![],'ContactId':this[_0x8a3d('0x23')][_0x457648[_0x8a3d('0xea')]]['ContactId'],'ListId':this[_0x8a3d('0x23')][_0x457648[_0x8a3d('0xea')]][_0x8a3d('0xd8')],'VoiceQueueId':this[_0x8a3d('0x23')][_0x457648[_0x8a3d('0xea')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x8a3d('0x23')][_0x457648['actionid']][_0x8a3d('0xf6')]||undefined})[_0x8a3d('0xa2')](loggerCatch(_0x8a3d('0x100')));delete this['actions'][_0x457648[_0x8a3d('0xea')]];unlockQueueStatus(_0x513e74);}}else{loggerBooked[_0x8a3d('0x47')](_0x8a3d('0x101'));this[_0x8a3d('0xbd')](this[_0x8a3d('0x1f')][this[_0x8a3d('0x23')][_0x457648[_0x8a3d('0xea')]][_0x8a3d('0xbe')]]);hopperUtils[_0x8a3d('0xe5')]({'active':![],'ContactId':this[_0x8a3d('0x23')][_0x457648['actionid']][_0x8a3d('0xe7')],'ListId':this['actions'][_0x457648[_0x8a3d('0xea')]]['ListId'],'VoiceQueueId':this['actions'][_0x457648[_0x8a3d('0xea')]][_0x8a3d('0x102')]||undefined,'CampaignId':this[_0x8a3d('0x23')][_0x457648[_0x8a3d('0xea')]][_0x8a3d('0xf6')]||undefined})[_0x8a3d('0xa2')](loggerCatch(_0x8a3d('0x103')));delete this[_0x8a3d('0x23')][_0x457648['actionid']];unlockQueueStatus(_0x513e74);}}else{loggerBooked[_0x8a3d('0x47')](_0x8a3d('0x104'));this[_0x8a3d('0xbd')](this['voiceQueues'][this['actions'][_0x457648[_0x8a3d('0xea')]]['queue']]);hopperUtils[_0x8a3d('0xe5')]({'active':![],'ContactId':this['actions'][_0x457648['actionid']]['ContactId'],'ListId':this[_0x8a3d('0x23')][_0x457648[_0x8a3d('0xea')]]['ListId'],'VoiceQueueId':this[_0x8a3d('0x23')][_0x457648['actionid']][_0x8a3d('0x102')]||undefined,'CampaignId':this[_0x8a3d('0x23')][_0x457648[_0x8a3d('0xea')]]['CampaignId']||undefined})['catch'](loggerCatch(_0x8a3d('0x105')));delete this[_0x8a3d('0x23')][_0x457648[_0x8a3d('0xea')]];unlockQueueStatus(_0x513e74);}};Dialer[_0x8a3d('0x1b')][_0x8a3d('0x2f')]=function(_0x2c725b){var _0x26fde0=this[_0x8a3d('0x23')][_0x2c725b[_0x8a3d('0xea')]];if(_0x26fde0){delete this[_0x8a3d('0x23')][_0x2c725b[_0x8a3d('0xea')]];_0x26fde0[_0x8a3d('0xcb')]=moment()['format'](_0x8a3d('0xc0'));var _0x188843=_0x26fde0['type']===_0x8a3d('0xbc')?this[_0x8a3d('0x20')][_0x26fde0[_0x8a3d('0xbe')]]:this[_0x8a3d('0x1f')][_0x26fde0[_0x8a3d('0x106')]()];if(_0x2c725b[_0x8a3d('0x107')]!==_0x8a3d('0x108')){this['updateOriginated'](_0x188843);return this['callProgressDetecting'](_0x26fde0,_0x188843,_0x2c725b)['catch'](loggerCatch(_0x8a3d('0x109')));}this[_0x8a3d('0x25')][_0x2c725b[_0x8a3d('0xbb')]]=_0x26fde0;}};Dialer[_0x8a3d('0x1b')][_0x8a3d('0x36')]=function(_0x4fa736){var _0x5ab1fb=this;var _0x4e6998=this[_0x8a3d('0x25')][_0x4fa736[_0x8a3d('0xbb')]];var _0x52e90c;if(!_['isNil'](_0x4fa736)&&!_[_0x8a3d('0xee')](_0x4fa736[_0x8a3d('0x10a')])&&!_['isNil'](_0x4fa736[_0x8a3d('0x10a')]['amdstatus'])&&_0x4fa736['exten']===_0x8a3d('0x10b')&&_0x4e6998){if(_0x4e6998['type']!==_0x8a3d('0xbc')&&this[_0x8a3d('0x1f')][_0x4e6998[_0x8a3d('0xbe')]]['dialAMDActive']&&_0x4fa736[_0x8a3d('0x10c')]===_0x8a3d('0x10d')){delete this[_0x8a3d('0x25')][_0x4fa736['uniqueid']];this[_0x8a3d('0xbd')](this[_0x8a3d('0x1f')][_0x4e6998[_0x8a3d('0xbe')]]);this[_0x8a3d('0x1f')][_0x4e6998[_0x8a3d('0xbe')]]['outboundAnswerCallsDay']+=0x1;this[_0x8a3d('0x1f')][_0x4e6998[_0x8a3d('0xbe')]][_0x8a3d('0x10e')]+=0x1;_0x52e90c=new Hangup(_0x4e6998,_0x4fa736);_0x52e90c['state']=0x12;_0x52e90c[_0x8a3d('0x70')]=_0x8a3d('0x10f');_0x52e90c[_0x8a3d('0x110')]=_0x8a3d('0x111');ami[_0x8a3d('0x112')](_0x8a3d('0x113'),ut[_0x8a3d('0x114')](_0x52e90c,_0x8a3d('0x115')));this[_0x8a3d('0x116')](_0x52e90c,_0x8a3d('0x117'),_0x8a3d('0x118'));}if(_0x4e6998[_0x8a3d('0x40')]!==_0x8a3d('0xbc')&&this[_0x8a3d('0x1f')][_0x4e6998[_0x8a3d('0xbe')]]['dialAMDActive']&&_0x4fa736[_0x8a3d('0x10c')]===_0x8a3d('0x119')){return new Promise(function(_0x2ba2f2,_0x52d718){delete _0x5ab1fb['uniqueId'][_0x4fa736['uniqueid']];_0x5ab1fb[_0x8a3d('0xbd')](_0x5ab1fb[_0x8a3d('0x1f')][_0x4e6998[_0x8a3d('0xbe')]]);_0x5ab1fb[_0x8a3d('0x1f')][_0x4e6998[_0x8a3d('0xbe')]]['outboundAnswerCallsDay']+=0x1;_0x5ab1fb[_0x8a3d('0x1f')][_0x4e6998[_0x8a3d('0xbe')]][_0x8a3d('0x10e')]+=0x1;var _0x20e9d2=_0x5ab1fb[_0x8a3d('0x1f')][_0x4e6998[_0x8a3d('0xbe')]];var _0x3bc1a3=new Hangup(_0x4e6998,_0x4fa736);_0x3bc1a3[_0x8a3d('0x6f')]=0x13;_0x3bc1a3[_0x8a3d('0x70')]=_0x8a3d('0x11a');_0x3bc1a3[_0x8a3d('0x110')]=_0x8a3d('0x111');_0x3bc1a3[_0x8a3d('0x11b')]+=0x1;_0x3bc1a3['countglobal']+=0x1;_0x3bc1a3[_0x8a3d('0x115')]=!![];ami[_0x8a3d('0x112')](_0x8a3d('0x113'),ut[_0x8a3d('0x114')](_0x3bc1a3,_0x8a3d('0x115')));hopperUtils[_0x8a3d('0xdb')](_0x3bc1a3)[_0x8a3d('0xa2')](loggerCatch(_0x8a3d('0x11c')));if(_0x3bc1a3[_0x8a3d('0x11d')]+_0x3bc1a3[_0x8a3d('0x11e')]+_0x3bc1a3[_0x8a3d('0x11f')]+_0x3bc1a3[_0x8a3d('0x120')]+_0x3bc1a3[_0x8a3d('0xcf')]+_0x3bc1a3[_0x8a3d('0xe1')]+_0x3bc1a3[_0x8a3d('0x11b')]+_0x3bc1a3['countagentrejectretry']>=_0x20e9d2[_0x8a3d('0x121')]){_0x5ab1fb[_0x8a3d('0x122')](_0x3bc1a3,_0x2ba2f2,_0x52d718,'reason19\x20machine....');}else{if(_0x3bc1a3['countmachineretry']>=_0x20e9d2[_0x8a3d('0x123')]){_0x5ab1fb[_0x8a3d('0x124')](_0x3bc1a3,_0x2ba2f2,_0x52d718,'reason\x2019\x20machine....');}else{hopperUtils[_0x8a3d('0xe5')]({'active':![],'countmachineretry':_0x3bc1a3[_0x8a3d('0x11b')],'scheduledat':moment()[_0x8a3d('0xd6')](_0x20e9d2['dialMachineRetryFrequency'],_0x8a3d('0xd7'))[_0x8a3d('0x44')](_0x8a3d('0xc0')),'ContactId':_0x3bc1a3[_0x8a3d('0xe7')],'ListId':_0x3bc1a3[_0x8a3d('0xd8')],'VoiceQueueId':_0x3bc1a3['VoiceQueueId']||undefined,'CampaignId':_0x3bc1a3[_0x8a3d('0xf6')]||undefined})[_0x8a3d('0xa2')](loggerCatch(_0x8a3d('0x125')));_0x2ba2f2({'reschedule':0x1});}}});}if(_0x4e6998[_0x8a3d('0x40')]===_0x8a3d('0xbc')&&this[_0x8a3d('0x20')][_0x4e6998['queue']][_0x8a3d('0x126')]&&_0x4fa736['value']==='HANGUP'){delete this['uniqueId'][_0x4fa736['uniqueid']];this[_0x8a3d('0xbd')](this['campaigns'][_0x4e6998[_0x8a3d('0xbe')]]);_0x52e90c=new Hangup(_0x4e6998,_0x4fa736);_0x52e90c[_0x8a3d('0x6f')]=0x12;_0x52e90c['statedesc']=_0x8a3d('0x10f');_0x52e90c[_0x8a3d('0x110')]='AMD';ami[_0x8a3d('0x112')](_0x8a3d('0x113'),ut[_0x8a3d('0x114')](_0x52e90c,_0x8a3d('0x115')));this[_0x8a3d('0x116')](_0x52e90c,_0x8a3d('0x127'),'[syncHangupInAMDIvr]');}if(_0x4e6998['type']===_0x8a3d('0xbc')&&this[_0x8a3d('0x20')][_0x4e6998[_0x8a3d('0xbe')]][_0x8a3d('0x126')]&&_0x4fa736[_0x8a3d('0x10c')]===_0x8a3d('0x119')){return new Promise(function(_0x5aeaa4,_0x90ef0c){delete _0x5ab1fb[_0x8a3d('0x25')][_0x4fa736[_0x8a3d('0xbb')]];_0x5ab1fb[_0x8a3d('0xbd')](_0x5ab1fb[_0x8a3d('0x20')][_0x4e6998['queue']]);_0x5ab1fb['campaigns'][_0x4e6998[_0x8a3d('0xbe')]][_0x8a3d('0xc1')]+=0x1;_0x5ab1fb[_0x8a3d('0x20')][_0x4e6998['queue']][_0x8a3d('0x10e')]+=0x1;var _0x4a1443=_0x5ab1fb[_0x8a3d('0x20')][_0x4e6998[_0x8a3d('0xbe')]];var _0x196383=new Hangup(_0x4e6998,_0x4fa736);_0x196383[_0x8a3d('0x6f')]=0x13;_0x196383['statedesc']=_0x8a3d('0x11a');_0x196383[_0x8a3d('0x110')]=_0x8a3d('0x111');_0x196383[_0x8a3d('0x11b')]+=0x1;_0x196383[_0x8a3d('0xd0')]+=0x1;_0x196383[_0x8a3d('0x115')]=!![];ami[_0x8a3d('0x112')](_0x8a3d('0x113'),ut[_0x8a3d('0x114')](_0x196383,_0x8a3d('0x115')));hopperUtils['createHistory'](_0x196383)[_0x8a3d('0xa2')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x196383[_0x8a3d('0x11d')]+_0x196383[_0x8a3d('0x11e')]+_0x196383[_0x8a3d('0x11f')]+_0x196383['countnosuchnumberretry']+_0x196383[_0x8a3d('0xcf')]+_0x196383[_0x8a3d('0xe1')]+_0x196383[_0x8a3d('0x11b')]+_0x196383['countagentrejectretry']>=_0x4a1443[_0x8a3d('0x121')]){_0x5ab1fb[_0x8a3d('0x122')](_0x196383,_0x5aeaa4,_0x90ef0c,_0x8a3d('0x128'));}else{if(_0x196383[_0x8a3d('0x11b')]>=_0x4a1443[_0x8a3d('0x123')]){_0x5ab1fb['createStateFinal'](_0x196383,_0x5aeaa4,_0x90ef0c,_0x8a3d('0x129'));}else{hopperUtils[_0x8a3d('0xe5')]({'active':![],'countmachineretry':_0x196383['countmachineretry'],'scheduledat':moment()[_0x8a3d('0xd6')](_0x4a1443['dialMachineRetryFrequency'],_0x8a3d('0xd7'))['format'](_0x8a3d('0xc0')),'ContactId':_0x196383[_0x8a3d('0xe7')],'ListId':_0x196383[_0x8a3d('0xd8')],'VoiceQueueId':_0x196383[_0x8a3d('0x102')]||undefined,'CampaignId':_0x196383['CampaignId']||undefined})[_0x8a3d('0xa2')](loggerCatch(_0x8a3d('0x125')));_0x5aeaa4({'reschedule':0x1});}}});}}};Dialer[_0x8a3d('0x1b')][_0x8a3d('0x12a')]=function(_0x51276d){var _0x58d82d=this[_0x8a3d('0x25')][_0x51276d[_0x8a3d('0xbb')]];var _0x5b04a1;if(_0x58d82d&&_0x58d82d['type']===_0x8a3d('0xbc')){delete this[_0x8a3d('0x25')][_0x51276d['uniqueid']];this[_0x8a3d('0xbd')](this[_0x8a3d('0x20')][_0x58d82d[_0x8a3d('0xbe')]]);this[_0x8a3d('0x20')][_0x58d82d[_0x8a3d('0xbe')]]['ivrAnswerCallsDay']+=0x1;_0x5b04a1=new Hangup(_0x58d82d,_0x51276d);hopperUtils['createHistory'](_0x5b04a1)[_0x8a3d('0xa2')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils['moveContactManagedDialer'](_0x5b04a1)['catch'](loggerCatch(_0x8a3d('0x12b')));}if(_0x58d82d&&_0x58d82d[_0x8a3d('0x40')]!==_0x8a3d('0xbc')&&isNotNull(this[_0x8a3d('0x1f')][_0x58d82d[_0x8a3d('0xbe')]]['dialQueueProject'])){delete this['uniqueId'][_0x51276d[_0x8a3d('0xbb')]];this[_0x8a3d('0xbd')](this[_0x8a3d('0x1f')][_0x58d82d[_0x8a3d('0xbe')]]);this[_0x8a3d('0x1f')][_0x58d82d[_0x8a3d('0xbe')]][_0x8a3d('0xc1')]+=0x1;this[_0x8a3d('0x1f')][_0x58d82d[_0x8a3d('0xbe')]][_0x8a3d('0x10e')]+=0x1;_0x5b04a1=new Hangup(_0x58d82d,_0x51276d);_0x5b04a1[_0x8a3d('0x6f')]=0x10;_0x5b04a1[_0x8a3d('0x70')]=_0x8a3d('0x12c');_0x5b04a1[_0x8a3d('0x110')]=_0x8a3d('0x12d');hopperUtils[_0x8a3d('0xdb')](_0x5b04a1)[_0x8a3d('0xa2')](loggerCatch(_0x8a3d('0x12e')));hopperUtils['moveContactManagedDialer'](_0x5b04a1)[_0x8a3d('0xa2')](loggerCatch(_0x8a3d('0x12b')));}if(_0x58d82d&&_0x58d82d['type']!=='ivr'&&!isNotNull(this[_0x8a3d('0x1f')][_0x58d82d['queue']][_0x8a3d('0x12f')])){if(_0x51276d['cause-txt']===_0x8a3d('0x130')){delete this[_0x8a3d('0x25')][_0x51276d[_0x8a3d('0xbb')]];this[_0x8a3d('0x1f')][_0x58d82d[_0x8a3d('0xbe')]]['outboundAnswerCallsDay']+=0x1;const _0x1865fb=new AgentComplete(_0x58d82d,_0x51276d);_0x1865fb['CampaignId']=this[_0x8a3d('0x1f')][_0x58d82d[_0x8a3d('0xbe')]]['id'];hopperUtils[_0x8a3d('0xdb')](_0x1865fb)[_0x8a3d('0xa2')](loggerCatch('[syncAgentComplete][createHistory]'));hopperUtils[_0x8a3d('0xc7')](_0x1865fb)[_0x8a3d('0xa2')](loggerCatch(_0x8a3d('0xc8')));}else{delete this[_0x8a3d('0x25')][_0x51276d[_0x8a3d('0xbb')]];this['updateOriginated'](this[_0x8a3d('0x1f')][_0x58d82d[_0x8a3d('0xbe')]]);this[_0x8a3d('0x1f')][_0x58d82d[_0x8a3d('0xbe')]]['outboundUnknownCallsDay']+=0x1;_0x5b04a1=new Hangup(_0x58d82d,_0x51276d);_0x5b04a1[_0x8a3d('0x6f')]=0xc;_0x5b04a1[_0x8a3d('0x70')]=_0x51276d[_0x8a3d('0x131')];_0x5b04a1[_0x8a3d('0x110')]=_0x8a3d('0x132');hopperUtils[_0x8a3d('0xdb')](_0x5b04a1)[_0x8a3d('0xa2')](loggerCatch(_0x8a3d('0x12e')));hopperUtils[_0x8a3d('0xc7')](_0x5b04a1)['catch'](loggerCatch('[syncHangupIvr]'));}}};Dialer[_0x8a3d('0x1b')][_0x8a3d('0xc')]=function(_0x2f5492){var _0x1ec5ba=this;if(!_0x1ec5ba[_0x8a3d('0x29')][_0x2f5492['name']]){_0x1ec5ba[_0x8a3d('0x29')][_0x2f5492[_0x8a3d('0x5f')]]={'running':![]};}else if(_0x1ec5ba[_0x8a3d('0x29')][_0x2f5492[_0x8a3d('0x5f')]][_0x8a3d('0x133')]===!![]){return;}else if(_0x1ec5ba['queuesSummary'][_0x2f5492[_0x8a3d('0x5f')]][_0x8a3d('0x133')]===![]){_0x1ec5ba[_0x8a3d('0x29')][_0x2f5492[_0x8a3d('0x5f')]][_0x8a3d('0x133')]=!![];}var _0x1fd86c=_0x1ec5ba[_0x8a3d('0x1f')][_0x2f5492['name']];var _0x56ece0=_0x1fd86c[_0x8a3d('0x6c')]!==utils[_0x8a3d('0x69')][_0x8a3d('0x7b')];var _0x19231e=utils[_0x8a3d('0x134')](_0x1fd86c);_0x1fd86c['statusMessage']=utils[_0x8a3d('0x135')](_0x1fd86c,_0x1ec5ba[_0x8a3d('0x88')]);Promise[_0x8a3d('0xac')]()['then'](function(){if(_0x1fd86c[_0x8a3d('0x136')]===utils[_0x8a3d('0x69')][_0x8a3d('0x7b')]){if(_0x56ece0){clearPredictiveAttributes(_0x1fd86c);_0x2f5492['startPredictive']=undefined;_0x2f5492[_0x8a3d('0x27')]=undefined;}if(_0x1fd86c[_0x8a3d('0x136')]===utils[_0x8a3d('0x69')]['INACTIVE']){_0x2f5492[_0x8a3d('0x137')]=0x0;_0x2f5492[_0x8a3d('0xf0')]=0x0;_0x2f5492[_0x8a3d('0x138')]=0x0;_0x2f5492[_0x8a3d('0x139')]=0x0;_0x2f5492[_0x8a3d('0x13a')]=0x0;}}else if(_0x1fd86c[_0x8a3d('0x136')]===utils[_0x8a3d('0x69')][_0x8a3d('0x13b')]&&!_0x19231e){return _0x1ec5ba[_0x8a3d('0x92')](_0x1fd86c,!![])[_0x8a3d('0x9e')](function(){return _0x1ec5ba['ifTime'](_0x1fd86c,![]);})['then'](function(){return _0x1ec5ba[_0x8a3d('0x13c')](_0x1fd86c);})[_0x8a3d('0xa2')](function(_0x3901da){loggerSyncQueueSummary[_0x8a3d('0x41')]('[syncQueueSummary]',util[_0x8a3d('0x43')](_0x3901da,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x1fd86c);});}else{clearPredictiveAttributes(_0x1fd86c);}})['then'](function(){var _0x1e9ba6=_0x2f5492[_0x8a3d('0x13d')](_0x1fd86c);if(_0x1e9ba6||_0x1fd86c[_0x8a3d('0x13e')]){_0x1fd86c[_0x8a3d('0x13e')]=![];_0x2f5492['updateReportFromOutboundQueue'](_0x1fd86c);Object[_0x8a3d('0x13f')](_0x1fd86c,_0x2f5492);emitOutboundVoiceQueueSummary(_0x2f5492);}_0x1ec5ba[_0x8a3d('0x29')][_0x1fd86c[_0x8a3d('0x5f')]]['running']=![];})[_0x8a3d('0xa2')](function(_0x2905ad){logger[_0x8a3d('0x65')](_0x8a3d('0x140'),util[_0x8a3d('0x43')](_0x2905ad,{'showHidden':![],'depth':null}));_0x1ec5ba[_0x8a3d('0x29')][_0x1fd86c[_0x8a3d('0x5f')]]['running']=![];});};Dialer[_0x8a3d('0x1b')][_0x8a3d('0x34')]=_[_0x8a3d('0x141')](function(){var _0x382674=_[_0x8a3d('0x142')](this[_0x8a3d('0x1f')],function(_0x448e84){return _0x448e84[_0x8a3d('0x143')];});var _0x1d9fc2=_[_0x8a3d('0x142')](this[_0x8a3d('0x21')],function(_0x2b9225){return _0x2b9225[_0x8a3d('0x144')]&&_0x2b9225[_0x8a3d('0x8a')]===_0x8a3d('0x8b');});if(_0x382674[_0x8a3d('0x99')]>0x0&&_0x1d9fc2['length']>0x0){return Promise[_0x8a3d('0xac')]()['then'](cmHopper[_0x8a3d('0x145')](_['map'](_0x382674,'id'),previewRecallmeReminderInterval,_[_0x8a3d('0x146')](_0x1d9fc2,'id')))[_0x8a3d('0x9e')](function(_0x5663fd){for(var _0x3222ea=0x0;_0x3222ea<_0x5663fd[_0x8a3d('0x99')];_0x3222ea++){var _0x34e252=_0x5663fd[_0x3222ea]['Agent'][_0x8a3d('0x5f')];if(_0x34e252)io['to'](util['format'](_0x8a3d('0x147'),_0x34e252))['emit'](_0x8a3d('0x148'),{'hopper':_0x5663fd[_0x3222ea]});}})[_0x8a3d('0xa2')](function(_0x330b65){logger[_0x8a3d('0x65')](_0x8a3d('0x149'),_0x330b65);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x8a3d('0x1b')]['loopClearZombieChannels']=function(){var _0x4c9f26=this;setInterval(function(){_0x4c9f26[_0x8a3d('0x14a')](_0x4c9f26['uniqueId'],_0x8a3d('0x14b'));_0x4c9f26[_0x8a3d('0x14a')](_0x4c9f26['actions'],_0x8a3d('0x14c'));},0x32c8);};Dialer[_0x8a3d('0x1b')][_0x8a3d('0x14a')]=function(_0x59a030,_0x15d81d){var _0x184ad3=this;for(var _0x5187b4 in _0x59a030){if(typeof _0x59a030[_0x5187b4]!==_0x8a3d('0x14d')){this['sequence'][_0x8a3d('0x14e')](function(){if(!_['isNil'](_0x59a030[_0x5187b4])){return ami['Action']({'action':_0x8a3d('0x8a'),'channel':_0x59a030[_0x5187b4][_0x8a3d('0xe9')]})['catch'](function(_0x482da6){if(_0x482da6[_0x8a3d('0x6c')]===_0x8a3d('0x14f')){setTimeout(function(){if(_0x59a030[_0x5187b4]&&_0x59a030[_0x5187b4][_0x8a3d('0x40')]!==_0x8a3d('0xbc')){_0x184ad3[_0x8a3d('0xbd')](_0x184ad3[_0x8a3d('0x1f')][_0x59a030[_0x5187b4][_0x8a3d('0xbe')]]);logger[_0x8a3d('0x65')]('[Dialer][checkChannel]',_0x15d81d,_0x5187b4,_0x59a030[_0x5187b4]['queue']);delete _0x59a030[_0x5187b4];}if(_0x59a030[_0x5187b4]&&_0x59a030[_0x5187b4]['type']===_0x8a3d('0xbc')){_0x184ad3[_0x8a3d('0xbd')](_0x184ad3[_0x8a3d('0x20')][_0x59a030[_0x5187b4][_0x8a3d('0xbe')]]);logger['error'](_0x8a3d('0x150'),_0x15d81d,_0x5187b4,_0x59a030[_0x5187b4][_0x8a3d('0xbe')]);delete _0x59a030[_0x5187b4];}},0x2328);}});}});}}};Dialer[_0x8a3d('0x1b')]['getVoiceQueueRtPauses']=function(_0x11a61d){return Promise[_0x8a3d('0xac')]()[_0x8a3d('0x9e')](voiceQueueRt[_0x8a3d('0x151')](_0x11a61d))[_0x8a3d('0xa2')](loggerCatch(_0x8a3d('0x152')));};Dialer['prototype'][_0x8a3d('0xbd')]=function(_0xa2c7b4){if(!_[_0x8a3d('0x3f')](_0xa2c7b4)&&_0xa2c7b4!==null){if(typeof _0xa2c7b4[_0x8a3d('0x80')]!==_0x8a3d('0x14d')){if(_0xa2c7b4['originated']>0x0){_0xa2c7b4[_0x8a3d('0x80')]-=0x1;}else{logger[_0x8a3d('0x65')](_0x8a3d('0x153'));}}}else{logger[_0x8a3d('0x65')](_0x8a3d('0x154'));}};Dialer[_0x8a3d('0x1b')][_0x8a3d('0x155')]=function(_0x550483,_0x4b7965){var _0x5e1ef3=this;return function(_0x19aecf){_0x5e1ef3['updateOriginated'](_0x4b7965);logger[_0x8a3d('0x65')](_0x550483,util['inspect'](_0x19aecf,{'showHidden':![],'depth':null}));};};Dialer[_0x8a3d('0x1b')][_0x8a3d('0x156')]=function(_0x1f6340,_0x13e2b2,_0x1bc749){var _0x1556c0={'state':0x19,'statedesc':_0x8a3d('0x157')};this[_0x8a3d('0xbd')](_0x13e2b2);this[_0x8a3d('0x116')](_[_0x8a3d('0x5d')](_0x1556c0,_[_0x8a3d('0x74')](_0x1bc749,[_0x8a3d('0xe7'),_0x8a3d('0xd8'),_0x8a3d('0x158'),_0x8a3d('0x102'),_0x8a3d('0xf6')])),'[emptyContact][createHistory]',_0x8a3d('0x159'));logger[_0x8a3d('0x65')](_0x1f6340);};Dialer[_0x8a3d('0x1b')][_0x8a3d('0x116')]=function(_0x5665db,_0x3797f6,_0x14ecf5){hopperUtils[_0x8a3d('0xdb')](_0x5665db)[_0x8a3d('0xa2')](loggerCatch(_0x3797f6));hopperUtils[_0x8a3d('0xc7')](_0x5665db)[_0x8a3d('0xa2')](loggerCatch(_0x14ecf5));};Dialer[_0x8a3d('0x1b')][_0x8a3d('0xd5')]=function(_0x21e0f7,_0x51958){hopperUtils[_0x8a3d('0xdb')](_0x21e0f7)[_0x8a3d('0xa2')](loggerCatch(_0x8a3d('0xc6')));if(_0x51958==0x0){hopperUtils[_0x8a3d('0xc7')](_0x21e0f7)[_0x8a3d('0xa2')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));}};Dialer[_0x8a3d('0x1b')][_0x8a3d('0x149')]=function(_0x5a6474){return Promise[_0x8a3d('0xac')]()['then'](cmHopper[_0x8a3d('0x145')](_0x5a6474['id'],previewRecallmeReminderInterval))[_0x8a3d('0x9e')](function(_0x5cd657){for(var _0x2d72e1=0x0;_0x2d72e1<_0x5cd657[_0x8a3d('0x99')];_0x2d72e1++){var _0x4a4dd2=_0x5cd657[_0x2d72e1]['Agent']['name'];if(_0x4a4dd2)io['to'](util[_0x8a3d('0x44')](_0x8a3d('0x147'),_0x4a4dd2))[_0x8a3d('0x112')]('user:dialPreviewRecallReminder',{'hopper':_0x5cd657[_0x2d72e1]});}})[_0x8a3d('0xa2')](function(){});};Dialer[_0x8a3d('0x1b')][_0x8a3d('0x15a')]=function(_0x1caf4c){var _0x3302ea=this;return function(){_0x3302ea['handleIvr'](_0x1caf4c);};};Dialer[_0x8a3d('0x1b')][_0x8a3d('0x15b')]=function(_0x3d8b5c,_0x4c37ee){var _0x40129f=this;var _0x61106e=uuid['v4']();this[_0x8a3d('0x23')][_0x61106e]=new Action(_0x3d8b5c,_0x4c37ee,_0x61106e);return new Promise(function(_0x58d77f,_0x5de2b1){if(_[_0x8a3d('0x3f')](_0x3d8b5c)&&typeof _0x3d8b5c!==_0x8a3d('0x15c')){return _0x5de2b1(msgResponse(_0x8a3d('0x15d'),'Failure',_0x8a3d('0x15e')));}if(_['isUndefined'](_0x4c37ee[_0x8a3d('0x15f')])||_0x4c37ee[_0x8a3d('0x15f')]===null){return _0x5de2b1(msgResponse(_0x8a3d('0x15d'),'Failure',_0x8a3d('0x160')));}var _0x1469f9={'XMD-CALLERID':_0x40129f[_0x8a3d('0x23')][_0x61106e]['getCaller'](),'XMD-AGI':_0x3d8b5c[_0x8a3d('0x12f')]?util['format'](_0x8a3d('0x161'),ipAgi,_0x3d8b5c[_0x8a3d('0x12f')]):_0x8a3d('0x162'),'XMD-AGIAFTER':_0x3d8b5c[_0x8a3d('0xc4')]?util['format'](_0x8a3d('0x161'),ipAgi,_0x3d8b5c[_0x8a3d('0xc4')]):_0x8a3d('0x162'),'XMD-QUEUE':utils[_0x8a3d('0x163')](_0x3d8b5c)?util['format'](_0x8a3d('0x164'),_0x3d8b5c[_0x8a3d('0x5f')],_0x3d8b5c[_0x8a3d('0x165')]||'',_0x3d8b5c[_0x8a3d('0xc5')]?'c':'',_0x3d8b5c[_0x8a3d('0xcc')]||0x3):_0x8a3d('0x162'),'XMD-CONTACTID':_0x4c37ee[_0x8a3d('0xe7')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x40129f['actions'][_0x61106e][_0x8a3d('0x166')](),'XMD-AMD':_0x3d8b5c[_0x8a3d('0x126')]?_0x8a3d('0x13b'):_0x8a3d('0x162'),'XMD-DESTINATION':_0x8a3d('0x10b')};if(_0x3d8b5c[_0x8a3d('0x126')]){_0x1469f9['XMD-AMDINITIALSILENCE']=_0x3d8b5c[_0x8a3d('0x167')]||0x9c4;_0x1469f9[_0x8a3d('0x168')]=_0x3d8b5c[_0x8a3d('0x169')]||0x5dc;_0x1469f9[_0x8a3d('0x16a')]=_0x3d8b5c[_0x8a3d('0x16b')]||0x320;_0x1469f9['XMD-AMDTOTALANALYSISTIME']=_0x3d8b5c['dialAMDTotalAnalysisTime']||0x1388;_0x1469f9[_0x8a3d('0x16c')]=_0x3d8b5c[_0x8a3d('0x16d')]||0x64;_0x1469f9[_0x8a3d('0x16e')]=_0x3d8b5c['dialAMDBetweenWordsSilence']||0x32;_0x1469f9['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x3d8b5c[_0x8a3d('0x16f')]||0x3;_0x1469f9['XMD-AMDSILENCETHRESHOLD']=_0x3d8b5c[_0x8a3d('0x170')]||0x100;_0x1469f9[_0x8a3d('0x171')]=_0x3d8b5c[_0x8a3d('0x172')]||0x1388;}if(utils[_0x8a3d('0x163')](_0x3d8b5c)){_0x1469f9[_0x8a3d('0x173')]=_0x4c37ee[_0x8a3d('0x102')];}else{_0x1469f9['XMD-CAMPAIGNID']=_0x4c37ee[_0x8a3d('0xf6')];}var _0xf96fbb=utils[_0x8a3d('0x174')](_0x4c37ee[_0x8a3d('0x175')]);Object['assign'](_0x1469f9,_0xf96fbb);var _0x4c2083=_0x40129f['isTrunkReachable'](_0x3d8b5c[_0x8a3d('0x176')])?utils[_0x8a3d('0x177')](_0x3d8b5c[_0x8a3d('0x176')][_0x8a3d('0x178')],_0x3d8b5c['dialOriginateCallerIdName'],_0x3d8b5c[_0x8a3d('0x179')]>0x0?utils['getCallerIdRandom'](_0x3d8b5c[_0x8a3d('0x17a')],_0x3d8b5c['dialRandomLastDigitCallerIdNumber']):_0x3d8b5c[_0x8a3d('0x17a')]):utils['getCallerId'](_['isNil'](_0x3d8b5c[_0x8a3d('0x8e')])?_0x3d8b5c[_0x8a3d('0x176')][_0x8a3d('0x178')]:_0x3d8b5c[_0x8a3d('0x8e')]['callerid'],_0x3d8b5c[_0x8a3d('0x17b')],_0x3d8b5c[_0x8a3d('0x179')]>0x0?utils[_0x8a3d('0x17c')](_0x3d8b5c[_0x8a3d('0x17a')],_0x3d8b5c[_0x8a3d('0x179')]):_0x3d8b5c[_0x8a3d('0x17a')]);if(_0x4c2083){_0x1469f9[_0x8a3d('0x17d')]=_0x40129f[_0x8a3d('0x23')][_0x61106e]['originatecalleridname']=utils['extractCalleridName'](_0x4c2083);_0x1469f9[_0x8a3d('0x17e')]=_0x4c37ee[_0x8a3d('0x15f')];}_0x3d8b5c[_0x8a3d('0x17f')]=_0x1469f9;return ami[_0x8a3d('0x9b')]({'actionid':_0x61106e,'action':_0x8a3d('0x15d'),'channel':_0x40129f[_0x8a3d('0x86')](_0x3d8b5c[_0x8a3d('0x176')])?util[_0x8a3d('0x44')](_0x8a3d('0x180'),_0x3d8b5c[_0x8a3d('0x176')][_0x8a3d('0x5f')],isNotNull(_0x3d8b5c[_0x8a3d('0x181')])?_0x3d8b5c[_0x8a3d('0x181')][_0x8a3d('0x182')]()||'':'',_0x3d8b5c['dialCutDigit']>0x0?_0x4c37ee[_0x8a3d('0x15f')][_0x8a3d('0x183')](_0x3d8b5c[_0x8a3d('0x184')]):_0x4c37ee['phone']):util['format'](_0x8a3d('0x180'),_[_0x8a3d('0xee')](_0x3d8b5c[_0x8a3d('0x8e')])?_0x3d8b5c[_0x8a3d('0x176')][_0x8a3d('0x5f')]:_0x3d8b5c[_0x8a3d('0x8e')][_0x8a3d('0x5f')],isNotNull(_0x3d8b5c[_0x8a3d('0x181')])?_0x3d8b5c[_0x8a3d('0x181')][_0x8a3d('0x182')]()||'':'',_0x3d8b5c[_0x8a3d('0x184')]>0x0?_0x4c37ee[_0x8a3d('0x15f')][_0x8a3d('0x183')](_0x3d8b5c['dialCutDigit']):_0x4c37ee[_0x8a3d('0x15f')]),'callerid':_0x4c2083,'Exten':_0x8a3d('0x10b'),'Context':'from-sip','Priority':'1','variable':_0x1469f9,'timeout':(_0x3d8b5c['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x61106e})[_0x8a3d('0x9e')](function(_0x9780a1){return _0x58d77f(_0x9780a1);})[_0x8a3d('0xa2')](function(_0x14e138){_0x3d8b5c['outboundOriginateFailureCallsDay']+=0x1;var _0x5898d2=new History(_0x40129f[_0x8a3d('0x23')][_0x61106e]);logger[_0x8a3d('0x65')](util['format'](_0x8a3d('0x185'),JSON['stringify'](_0x14e138)));_0x5898d2['state']=0xe;_0x5898d2[_0x8a3d('0x70')]='OriginateError';_0x5898d2[_0x8a3d('0x72')]=moment()['format'](_0x8a3d('0xc0'));_0x5898d2[_0x8a3d('0x71')]=_0x5898d2[_0x8a3d('0x72')];hopperUtils[_0x8a3d('0xdb')](_0x5898d2)[_0x8a3d('0xa2')](loggerCatch(_0x8a3d('0x186')));_0x40129f[_0x8a3d('0xc7')](_0x5898d2)['catch'](loggerCatch(_0x8a3d('0x186')))[_0x8a3d('0x1d')](function(){delete _0x40129f[_0x8a3d('0x23')][_0x61106e];return _0x5de2b1(msgResponse(_0x8a3d('0x15d'),_0x8a3d('0x84'),'originate\x20action\x20Error'));});});});};Dialer['prototype']['checkRetriveMax']=function(_0x6dde38,_0x15e64c,_0x17557d){var _0x5474ee=new History(_0x15e64c);if(_0x5474ee[_0x8a3d('0x11d')]+_0x5474ee[_0x8a3d('0x11e')]+_0x5474ee[_0x8a3d('0x11f')]+_0x5474ee['countnosuchnumberretry']+_0x5474ee[_0x8a3d('0xcf')]+_0x5474ee[_0x8a3d('0xe1')]+_0x5474ee['countmachineretry']+_0x5474ee['countagentrejectretry']>=_0x17557d[_0x8a3d('0x121')]-0x1){return!![];}switch(_0x6dde38){case 0x3:if(_0x5474ee[_0x8a3d('0x11f')]>=_0x17557d['dialNoAnswerMaxRetry']-0x1){return!![];}hopperUtils[_0x8a3d('0xe5')]({'active':![],'countnoanswerretry':_0x5474ee[_0x8a3d('0x11f')]+=0x1,'scheduledat':moment()['add'](_0x17557d[_0x8a3d('0x187')],_0x8a3d('0xd7'))[_0x8a3d('0x44')](_0x8a3d('0xc0')),'ContactId':_0x5474ee['ContactId'],'ListId':_0x5474ee['ListId'],'VoiceQueueId':_0x5474ee[_0x8a3d('0x102')]||undefined,'CampaignId':_0x5474ee[_0x8a3d('0xf6')]||undefined})['catch'](loggerCatch(_0x8a3d('0x188')));break;case 0x5:if(_0x5474ee[_0x8a3d('0x11d')]>=_0x17557d[_0x8a3d('0x189')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countbusyretry':_0x5474ee['countbusyretry']+=0x1,'scheduledat':moment()[_0x8a3d('0xd6')](_0x17557d[_0x8a3d('0x18a')],_0x8a3d('0xd7'))[_0x8a3d('0x44')](_0x8a3d('0xc0')),'ContactId':_0x5474ee[_0x8a3d('0xe7')],'ListId':_0x5474ee['ListId'],'VoiceQueueId':_0x5474ee[_0x8a3d('0x102')]||undefined,'CampaignId':_0x5474ee[_0x8a3d('0xf6')]||undefined})[_0x8a3d('0xa2')](loggerCatch(_0x8a3d('0x18b')));break;case 0x8:if(_0x5474ee[_0x8a3d('0x11e')]>=_0x17557d['dialCongestionMaxRetry']-0x1){return!![];}hopperUtils[_0x8a3d('0xe5')]({'active':![],'countcongestionretry':_0x5474ee[_0x8a3d('0x11e')]+=0x1,'scheduledat':moment()[_0x8a3d('0xd6')](_0x17557d['dialCongestionRetryFrequency'],_0x8a3d('0xd7'))['format'](_0x8a3d('0xc0')),'ContactId':_0x5474ee[_0x8a3d('0xe7')],'ListId':_0x5474ee[_0x8a3d('0xd8')],'VoiceQueueId':_0x5474ee[_0x8a3d('0x102')]||undefined,'CampaignId':_0x5474ee[_0x8a3d('0xf6')]||undefined})[_0x8a3d('0xa2')](loggerCatch(_0x8a3d('0x18c')));break;case 0x0:if(_0x5474ee[_0x8a3d('0x120')]>=_0x17557d[_0x8a3d('0x18d')]-0x1){return!![];}else{hopperUtils[_0x8a3d('0xe5')]({'active':![],'countnosuchnumberretry':_0x5474ee[_0x8a3d('0x120')]+=0x1,'scheduledat':moment()['add'](_0x17557d['dialNoSuchNumberRetryFrequency'],_0x8a3d('0xd7'))[_0x8a3d('0x44')](_0x8a3d('0xc0')),'ContactId':_0x5474ee['ContactId'],'ListId':_0x5474ee[_0x8a3d('0xd8')],'VoiceQueueId':_0x5474ee[_0x8a3d('0x102')]||undefined,'CampaignId':_0x5474ee['CampaignId']||undefined})[_0x8a3d('0xa2')](loggerCatch(_0x8a3d('0x18e')));}break;case 0xa:if(_0x5474ee['countdropretry']>=_0x17557d[_0x8a3d('0xd4')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x5474ee[_0x8a3d('0xcf')]+=0x1,'scheduledat':moment()[_0x8a3d('0xd6')](_0x17557d[_0x8a3d('0xd1')],_0x8a3d('0xd7'))[_0x8a3d('0x44')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5474ee[_0x8a3d('0xe7')],'ListId':_0x5474ee['ListId'],'VoiceQueueId':_0x5474ee[_0x8a3d('0x102')]||undefined,'CampaignId':_0x5474ee[_0x8a3d('0xf6')]||undefined})[_0x8a3d('0xa2')](loggerCatch(_0x8a3d('0x18f')));break;case 0xb:if(_0x5474ee[_0x8a3d('0xe1')]>=_0x17557d[_0x8a3d('0xe4')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x5474ee['countabandonedretry']+=0x1,'scheduledat':moment()['add'](_0x17557d[_0x8a3d('0xe6')],'minutes')[_0x8a3d('0x44')](_0x8a3d('0xc0')),'ContactId':_0x5474ee[_0x8a3d('0xe7')],'ListId':_0x5474ee[_0x8a3d('0xd8')],'VoiceQueueId':_0x5474ee[_0x8a3d('0x102')]||undefined,'CampaignId':_0x5474ee[_0x8a3d('0xf6')]||undefined})[_0x8a3d('0xa2')](loggerCatch(_0x8a3d('0x190')));break;case 0x13:if(_0x5474ee['countmachineretry']>=_0x17557d[_0x8a3d('0x123')]-0x1){return!![];}hopperUtils[_0x8a3d('0xe5')]({'active':![],'countmachineretry':_0x5474ee[_0x8a3d('0x11b')]+=0x1,'scheduledat':moment()['add'](_0x17557d[_0x8a3d('0x191')],_0x8a3d('0xd7'))[_0x8a3d('0x44')](_0x8a3d('0xc0')),'ContactId':_0x5474ee[_0x8a3d('0xe7')],'ListId':_0x5474ee[_0x8a3d('0xd8')],'VoiceQueueId':_0x5474ee[_0x8a3d('0x102')]||undefined,'CampaignId':_0x5474ee[_0x8a3d('0xf6')]||undefined})[_0x8a3d('0xa2')](loggerCatch(_0x8a3d('0x125')));break;case 0x14:if(_0x5474ee['countagentrejectretry']>=_0x17557d[_0x8a3d('0x192')]-0x1){return!![];}hopperUtils[_0x8a3d('0xe5')]({'active':![],'countagentrejectretry':_0x5474ee[_0x8a3d('0x193')]+=0x1,'scheduledat':moment()[_0x8a3d('0xd6')](_0x17557d[_0x8a3d('0x194')],'minutes')[_0x8a3d('0x44')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5474ee['ContactId'],'ListId':_0x5474ee['ListId'],'VoiceQueueId':_0x5474ee['VoiceQueueId']||undefined,'CampaignId':_0x5474ee['CampaignId']||undefined})[_0x8a3d('0xa2')](loggerCatch(_0x8a3d('0x195')));break;default:return!![];}};Dialer[_0x8a3d('0x1b')]['callProgressDetecting']=function(_0x5dda18,_0x23c2e6,_0xa447cc){var _0x531d31=this;var _0x75ba97=new History(_0x5dda18);var _0x52c531=![];var _0x9c1865;var _0x7d0b43;return new Promise(function(_0x10e969,_0x5e3a0d){if(_[_0x8a3d('0x3f')](_0x23c2e6)&&typeof _0x23c2e6!=='object'){return _0x5e3a0d(msgResponse(_0x8a3d('0x196'),'Failure',_0x8a3d('0x197')));}if(_[_0x8a3d('0x3f')](_0xa447cc)&&typeof _0xa447cc!==_0x8a3d('0x15c')){return _0x5e3a0d(msgResponse(_0x8a3d('0x196'),_0x8a3d('0x93'),_0x8a3d('0x198')));}hopperUtils[_0x8a3d('0xe3')](_0x75ba97,_0xa447cc[_0x8a3d('0x199')],_0x23c2e6)[_0x8a3d('0x9e')](function(_0x2587fd){if(_0x2587fd[_0x8a3d('0xd3')]==0x1)_0x52c531=!![];switch(_0xa447cc[_0x8a3d('0x199')]){case'0':_0x23c2e6['outboundNoSuchCallsDay']+=0x1;_0x75ba97[_0x8a3d('0x6f')]=0x0;_0x75ba97[_0x8a3d('0x70')]=_0x8a3d('0x19a');_0x75ba97['countnosuchnumberretry']+=0x1;_0x75ba97[_0x8a3d('0xd0')]+=0x1;ami['emit'](_0x8a3d('0x19b'),ut[_0x8a3d('0x114')](_0x5dda18,_0x8a3d('0x19c')));_0x9c1865=_0x23c2e6['dialNoSuchNumberRetryFrequency'];_0x7d0b43=_0x23c2e6[_0x8a3d('0xe2')];hopperUtils['createHistory'](_0x75ba97)[_0x8a3d('0xa2')](loggerCatch(_0x8a3d('0x11c')));if(_0x531d31[_0x8a3d('0x19d')](0x0,_0x5dda18,_0x23c2e6)&&!_0x52c531){if(_0x75ba97[_0x8a3d('0x120')]>=_0x23c2e6['dialNoSuchNumberMaxRetry']){_0x531d31[_0x8a3d('0x124')](_0x75ba97,_0x10e969,_0x5e3a0d,_0x8a3d('0x19e'));}else{_0x531d31[_0x8a3d('0x122')](_0x75ba97,_0x10e969,_0x5e3a0d,_0x8a3d('0x19e'));}}break;case'3':_0x23c2e6[_0x8a3d('0x19f')]+=0x1;_0x75ba97[_0x8a3d('0x6f')]=0x3;_0x75ba97[_0x8a3d('0x70')]=_0x8a3d('0x1a0');_0x75ba97['countnoanswerretry']+=0x1;_0x75ba97[_0x8a3d('0xd0')]+=0x1;var _0x1a83d3=ut['buildNoAnswerEventPayload'](_0x5dda18,_0x23c2e6);ami[_0x8a3d('0x112')]('custom:agentnoanswer',_0x1a83d3);_0x9c1865=_0x23c2e6[_0x8a3d('0x187')];_0x7d0b43=_0x23c2e6[_0x8a3d('0xe2')];hopperUtils[_0x8a3d('0xdb')](_0x75ba97)[_0x8a3d('0xa2')](loggerCatch(_0x8a3d('0x1a1')));if(_0x531d31[_0x8a3d('0x19d')](0x3,_0x5dda18,_0x23c2e6)&&!_0x52c531){if(_0x75ba97[_0x8a3d('0x11f')]>=_0x23c2e6[_0x8a3d('0x1a2')]){_0x531d31['createStateFinal'](_0x75ba97,_0x10e969,_0x5e3a0d,_0x8a3d('0x1a3'));}else{_0x531d31[_0x8a3d('0x122')](_0x75ba97,_0x10e969,_0x5e3a0d,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x23c2e6[_0x8a3d('0x1a4')]+=0x1;_0x75ba97[_0x8a3d('0x6f')]=0x5;_0x75ba97[_0x8a3d('0x70')]=_0x8a3d('0x1a5');_0x75ba97[_0x8a3d('0x11d')]+=0x1;_0x75ba97['countglobal']+=0x1;ami['emit'](_0x8a3d('0x1a6'),ut[_0x8a3d('0x114')](_0x5dda18,_0x8a3d('0x1a7')));_0x9c1865=_0x23c2e6[_0x8a3d('0x18a')];_0x7d0b43=_0x23c2e6['callAdditionalPhoneAfterMin'];hopperUtils['createHistory'](_0x75ba97)[_0x8a3d('0xa2')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x531d31[_0x8a3d('0x19d')](0x5,_0x5dda18,_0x23c2e6)&&!_0x52c531){if(_0x75ba97['countbusyretry']>=_0x23c2e6['dialBusyMaxRetry']){_0x531d31['createStateFinal'](_0x75ba97,_0x10e969,_0x5e3a0d,_0x8a3d('0x1a8'));}else{_0x531d31[_0x8a3d('0x122')](_0x75ba97,_0x10e969,_0x5e3a0d,_0x8a3d('0x1a8'));}}break;case'8':_0x23c2e6[_0x8a3d('0x1a9')]+=0x1;_0x75ba97[_0x8a3d('0x6f')]=0x8;_0x75ba97[_0x8a3d('0x70')]=_0x8a3d('0x1aa');_0x75ba97[_0x8a3d('0x11e')]+=0x1;_0x75ba97[_0x8a3d('0xd0')]+=0x1;_0x9c1865=_0x23c2e6['dialCongestionRetryFrequency'];_0x7d0b43=_0x23c2e6[_0x8a3d('0xe2')];ami[_0x8a3d('0x112')]('custom:agentcongestion',ut[_0x8a3d('0x114')](_0x5dda18,'congestion'));hopperUtils[_0x8a3d('0xdb')](_0x75ba97)['catch'](loggerCatch(_0x8a3d('0x1ab')));if(_0x531d31[_0x8a3d('0x19d')](0x8,_0x5dda18,_0x23c2e6)&&!_0x52c531){if(_0x75ba97[_0x8a3d('0x11e')]>=_0x23c2e6[_0x8a3d('0x1ac')]){_0x531d31[_0x8a3d('0x124')](_0x75ba97,_0x10e969,_0x5e3a0d,'reason\x208\x20congestion');}else{_0x531d31['stateGlobal'](_0x75ba97,_0x10e969,_0x5e3a0d,_0x8a3d('0x1ad'));}}break;case'11':_0x23c2e6[_0x8a3d('0x1ae')]+=0x1;_0x75ba97['state']=0xb;_0x75ba97['statedesc']='Abandoned';_0x75ba97[_0x8a3d('0xe1')]+=0x1;_0x75ba97['countglobal']+=0x1;_0x9c1865=_0x23c2e6[_0x8a3d('0xe6')];_0x7d0b43=_0x23c2e6[_0x8a3d('0xe2')];hopperUtils[_0x8a3d('0xdb')](_0x75ba97)['catch'](loggerCatch(_0x8a3d('0x1af')));if(_0x531d31['checkRetriveMax'](0xb,_0x5dda18,_0x23c2e6)&&!_0x52c531){if(_0x75ba97[_0x8a3d('0xe1')]>=_0x23c2e6['dialAbandonedMaxRetry']){_0x531d31[_0x8a3d('0x124')](_0x75ba97,_0x10e969,_0x5e3a0d,_0x8a3d('0x1b0'));}else{_0x531d31['stateGlobal'](_0x75ba97,_0x10e969,_0x5e3a0d,_0x8a3d('0x1b0'));}}break;case'20':_0x23c2e6[_0x8a3d('0x1b1')]+=0x1;_0x75ba97[_0x8a3d('0x6f')]=0x14;_0x75ba97[_0x8a3d('0x70')]=_0x8a3d('0x1b2');_0x75ba97[_0x8a3d('0x193')]+=0x1;_0x75ba97['countglobal']+=0x1;_0x9c1865=_0x23c2e6['dialAgentRejectRetryFrequency'];_0x7d0b43=_0x23c2e6['callAdditionalPhoneAfterMin'];ami['emit'](_0x8a3d('0x1b3'),ut[_0x8a3d('0x114')](_0x5dda18,'agentreject'));hopperUtils[_0x8a3d('0xdb')](_0x75ba97)[_0x8a3d('0xa2')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x531d31['checkRetriveMax'](0x14,_0x5dda18,_0x23c2e6)&&!_0x52c531){if(_0x75ba97[_0x8a3d('0x193')]>=_0x23c2e6[_0x8a3d('0x192')]){_0x531d31['createStateFinal'](_0x75ba97,_0x10e969,_0x5e3a0d,_0x8a3d('0x1b4'));}else{_0x531d31[_0x8a3d('0x122')](_0x75ba97,_0x10e969,_0x5e3a0d,'reason\x2020\x20agentreject');}}break;default:_0x23c2e6['outboundUnknownCallsDay']+=0x1;_0x75ba97[_0x8a3d('0x6f')]=0xc;_0x75ba97[_0x8a3d('0x70')]=_0xa447cc['reason'];_0x9c1865=_0x23c2e6['dialAgentRejectRetryFrequency'];_0x7d0b43=_0x23c2e6[_0x8a3d('0xe2')];hopperUtils[_0x8a3d('0xdb')](_0x75ba97)['catch'](loggerCatch(_0x8a3d('0x1b5')));if(_0x531d31[_0x8a3d('0x19d')](_0xa447cc['reason'],_0x5dda18,_0x23c2e6)&&!_0x52c531){if(_0x75ba97['countbusyretry']+_0x75ba97['countcongestionretry']+_0x75ba97[_0x8a3d('0x11f')]+_0x75ba97['countnosuchnumberretry']+_0x75ba97[_0x8a3d('0xcf')]+_0x75ba97[_0x8a3d('0xe1')]+_0x75ba97[_0x8a3d('0x11b')]+_0x75ba97['countagentrejectretry']>=_0x23c2e6[_0x8a3d('0x121')]){_0x531d31[_0x8a3d('0x122')](_0x75ba97,_0x10e969,_0x5e3a0d,_0xa447cc['reason']);}else{_0x531d31[_0x8a3d('0x124')](_0x75ba97,_0x10e969,_0x5e3a0d,_0xa447cc['reason']);}}}})['then'](function(){if(_0x52c531){hopperUtils[_0x8a3d('0xdd')](_0x75ba97,_0x9c1865,_0x7d0b43)[_0x8a3d('0x9e')](function(){return _0x10e969(0x1);});}});});};Dialer[_0x8a3d('0x1b')][_0x8a3d('0x122')]=function(_0x39a0bd,_0x531661,_0x42b736,_0x196be2){var _0x228380=new Final(_0x39a0bd);_0x228380[_0x8a3d('0x6f')]=0xf;_0x228380[_0x8a3d('0x70')]='Global';this[_0x8a3d('0x124')](_0x228380,_0x531661,_0x42b736,_0x196be2);};Dialer[_0x8a3d('0x1b')][_0x8a3d('0x124')]=function(_0x143054,_0x57f351,_0xfd696,_0x13cb6f){hopperUtils['moveContactManagedDialer'](_0x143054)[_0x8a3d('0x9e')](function(){return _0x57f351(msgResponse(_0x8a3d('0x196'),'Success',_0x13cb6f));})[_0x8a3d('0xa2')](function(){return _0xfd696(msgResponse(_0x8a3d('0x1b6'),_0x8a3d('0x93'),_0x8a3d('0x1b7')));});};Dialer[_0x8a3d('0x1b')][_0x8a3d('0xa')]=function(_0x137d2f){var _0x5b23dc=_0x137d2f[_0x8a3d('0x1b8')]/0x64;var _0x4a843a=_0x137d2f[_0x8a3d('0x1b9')]/(_0x137d2f[_0x8a3d('0x1b9')]+_0x137d2f[_0x8a3d('0xc1')]);var _0x441fee=Math[_0x8a3d('0x1ba')](_0x137d2f[_0x8a3d('0x1bb')]*(_0x137d2f[_0x8a3d('0x1bc')]/0x64));var _0x36b1f7=Math[_0x8a3d('0x1ba')](_0x137d2f[_0x8a3d('0x1bb')]*(_0x137d2f['predictiveIntervalMinThreshold']/0x64));var _0x43ac8a=_0x137d2f['available']+_0x137d2f['talking'];var _0x13d2cb=Math['floor'](_0x137d2f[_0x8a3d('0x57')]*_0x137d2f[_0x8a3d('0x5a')]*_0x137d2f['predictiveIntervalHitRate']*_0x137d2f[_0x8a3d('0x1bd')]);if(_[_0x8a3d('0x3f')](_0x137d2f[_0x8a3d('0x27')])){if(!_[_0x8a3d('0x3f')](_0x137d2f[_0x8a3d('0x61')])){_0x137d2f['startPredictive']=undefined;loggerPredictive[_0x8a3d('0x65')](_0x8a3d('0x1be'),_0x8a3d('0x1bf'));}if(!_['isUndefined'](_0x137d2f[_0x8a3d('0x63')])){loggerPredictive[_0x8a3d('0x65')]('[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x137d2f[_0x8a3d('0x63')]);_0x137d2f[_0x8a3d('0x63')]=undefined;}_0x137d2f[_0x8a3d('0x27')]=moment()[_0x8a3d('0x44')](_0x8a3d('0xc0'));loggerPredictive[_0x8a3d('0x47')](_0x137d2f[_0x8a3d('0x5f')],_0x8a3d('0x1c0'),_0x137d2f['startProgressive']);this[_0x8a3d('0xb2')](_0x137d2f,0x1);}else if(ifInterval(_0x137d2f[_0x8a3d('0x1c1')],_0x137d2f[_0x8a3d('0x27')])){this[_0x8a3d('0xb2')](_0x137d2f,0x1);loggerPredictiveCalls[_0x8a3d('0x47')](_0x8a3d('0x1c2'),_0x137d2f['startProgressive'],_0x137d2f[_0x8a3d('0x5f')]);_0x137d2f[_0x8a3d('0x57')]=0x0;_0x137d2f['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x5b23dc<_0x4a843a&&_0x137d2f[_0x8a3d('0x1c3')]===_0x8a3d('0x1c4')){clearPredictiveAttributes(_0x137d2f);loggerPredictive[_0x8a3d('0x47')](_0x8a3d('0x1c5'),_0x8a3d('0x1c6'),_0x4a843a,_0x8a3d('0x27'),_0x137d2f[_0x8a3d('0x5f')]);}else if(_0x13d2cb<_0x137d2f[_0x8a3d('0x1c7')]&&_0x137d2f[_0x8a3d('0x1c3')]===_0x8a3d('0x1c4')){clearPredictiveAttributes(_0x137d2f);loggerPredictive[_0x8a3d('0x47')](_0x8a3d('0x1c8'),'Max\x20Drop\x20',_0x13d2cb,_0x8a3d('0x1c9'),_0x137d2f[_0x8a3d('0x1c7')],_0x8a3d('0x27'),_0x137d2f[_0x8a3d('0x5f')]);}else if(!ifInterval(_0x137d2f['dialPredictiveInterval'],_0x137d2f[_0x8a3d('0x27')])&&_['isUndefined'](_0x137d2f[_0x8a3d('0x61')])&&!_[_0x8a3d('0x3f')](_0x137d2f['startProgressive'])){_0x137d2f[_0x8a3d('0x61')]=moment()[_0x8a3d('0x44')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x137d2f[_0x8a3d('0x5f')],'started\x20in\x20predictive\x20at',_0x137d2f[_0x8a3d('0x61')]);hopperUtils[_0x8a3d('0x1ca')](_0x137d2f[_0x8a3d('0x1c1')])[_0x8a3d('0x9e')](this[_0x8a3d('0x1cb')](_0x137d2f))[_0x8a3d('0x9e')](mergeDataErlangB(_0x137d2f))['then'](this['startMethodPredictive'](_0x137d2f))['catch'](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x137d2f));}else if(!ifInterval(_0x137d2f[_0x8a3d('0x1c1')],_0x137d2f[_0x8a3d('0x61')])){_0x137d2f[_0x8a3d('0x1c7')]=0x0;_0x137d2f[_0x8a3d('0x61')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x8a3d('0x47')](_0x137d2f[_0x8a3d('0x5f')],'recalculate\x20predictive\x20at',_0x137d2f['startPredictive']);clearInterval(_0x137d2f[_0x8a3d('0x63')]);_0x137d2f[_0x8a3d('0x63')]=undefined;hopperUtils[_0x8a3d('0x1ca')](_0x137d2f['dialPredictiveInterval'])[_0x8a3d('0x9e')](this[_0x8a3d('0x1cb')](_0x137d2f))[_0x8a3d('0x9e')](mergeDataErlangB(_0x137d2f))['then'](this[_0x8a3d('0x1cc')](_0x137d2f))[_0x8a3d('0xa2')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x137d2f));}else if(_0x137d2f[_0x8a3d('0x1bb')]&&_0x43ac8a<_0x137d2f[_0x8a3d('0x1bb')]-_0x36b1f7){clearPredictiveAttributes(_0x137d2f);loggerPredictive[_0x8a3d('0x47')](_0x137d2f['name'],_0x8a3d('0x1cd'),_0x43ac8a,_0x8a3d('0x1ce'),_0x137d2f[_0x8a3d('0x1bb')],'-',_0x36b1f7,'=',_0x137d2f['predictiveIntervalAvailable']-_0x36b1f7,')');}else if(_0x137d2f['predictiveIntervalAvailable']&&_0x43ac8a>_0x137d2f['predictiveIntervalAvailable']+_0x441fee){clearPredictiveAttributes(_0x137d2f);loggerPredictive[_0x8a3d('0x47')](_0x137d2f['name'],_0x8a3d('0x1cd'),_0x43ac8a,_0x8a3d('0x1cf'),_0x137d2f['predictiveIntervalAvailable'],'+',_0x441fee,'=',_0x137d2f[_0x8a3d('0x1bb')]+_0x441fee,')');}};Dialer['prototype'][_0x8a3d('0x1cb')]=function(_0x395756){var _0x558b87=this;return function(_0x59079d){return new Promise(function(_0x292e74,_0x49b409){_[_0x8a3d('0x5d')](_0x395756,_0x59079d[0x0]);if(checkGetDataPredictive(_0x59079d[0x0])){var _0x564a2e=_0x395756[_0x8a3d('0x1bb')]=_0x395756[_0x8a3d('0x139')]+_0x395756[_0x8a3d('0x137')];var _0x533304=_0x395756[_0x8a3d('0x1c1')]*0x3c;var _0x252fed=_0x59079d[0x0]['predictiveIntervalAvgTalktime']+_0x59079d[0x0][_0x8a3d('0x4f')];var _0x5344f9=(_0x59079d[0x0][_0x8a3d('0x4a')]+_0x59079d[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x59079d[0x0][_0x8a3d('0x4d')])/_0x59079d[0x0][_0x8a3d('0x48')];_0x395756[_0x8a3d('0x1d0')]=_0x5344f9>0x0?_0x5344f9:0x1;switch(_0x395756[_0x8a3d('0x1c3')]){case _0x8a3d('0x1c4'):var _0x3d2d44=_0x395756['dialPredictiveOptimizationPercentage']/0x64;return _0x558b87['abandonmentRate'](_0x564a2e,_0x533304,_0x252fed,_0x5344f9,_0x3d2d44)['then'](function(_0x49680e){return _0x292e74(_0x49680e);});case _0x8a3d('0x1d1'):var _0xb1813d=_0x395756[_0x8a3d('0x1b8')]/0x64;return _0x558b87['busyFactor'](_0x564a2e,_0x533304,_0x252fed,_0x5344f9,_0xb1813d)[_0x8a3d('0x9e')](function(_0x974d46){return _0x292e74(_0x974d46);});default:return _0x49b409(msgResponse(_0x8a3d('0x1d2'),_0x8a3d('0x93'),_0x8a3d('0x1d3')));}}else{return _0x49b409(msgResponse(_0x8a3d('0x1d2'),_0x8a3d('0x93'),_0x8a3d('0x1d4')));}});};};Dialer[_0x8a3d('0x1b')][_0x8a3d('0x1d5')]=function(_0x2d40a0){var _0x19c8da=this;return function(_0x1d49fb){return new Promise(function(_0x3a3e43,_0x92e24c){_['merge'](_0x2d40a0,_0x1d49fb[0x0]);if(checkGetDataPredictive(_0x1d49fb[0x0])){loggerPredictive[_0x8a3d('0x47')](JSON['stringify'](_0x1d49fb[0x0]));if(_0x2d40a0[_0x8a3d('0x1c3')]===_0x8a3d('0x1c4')){return _0x19c8da[_0x8a3d('0x151')](_0x2d40a0['id'])[_0x8a3d('0x9e')](function(_0x33e2e5){var _0x1180da=_0x2d40a0[_0x8a3d('0x1d6')]-_0x33e2e5[0x0][_0x8a3d('0x1d7')];var _0x46459e=_0x2d40a0[_0x8a3d('0x1c1')]*0x3c;var _0x2929f2=_0x1d49fb[0x0][_0x8a3d('0x51')]+_0x1d49fb[0x0]['predictiveIntervalAvgHoldtime'];var _0x1ccb36=(_0x1d49fb[0x0]['predictiveIntervalAnsweredCalls']+_0x1d49fb[0x0][_0x8a3d('0x4c')]+_0x1d49fb[0x0][_0x8a3d('0x4d')])/_0x1d49fb[0x0][_0x8a3d('0x48')];var _0x5943a0=_0x2d40a0[_0x8a3d('0x1b8')]/0x64;_0x2d40a0[_0x8a3d('0x1d8')]=_0x33e2e5[0x0][_0x8a3d('0x1d7')]||0x0;_0x2d40a0['predictiveIntervalHitRate']=_0x1ccb36>0x0?_0x1ccb36:0x1;return _0x19c8da[_0x8a3d('0x1d9')](_0x1180da,_0x46459e,_0x2929f2,_0x1ccb36,_0x5943a0);})['then'](function(_0xa5db91){return _0x3a3e43(_0xa5db91);})[_0x8a3d('0xa2')](function(_0x9c31fa){return _0x92e24c(msgResponse(_0x8a3d('0x1da'),'Failure',JSON[_0x8a3d('0x85')](_0x9c31fa)));});}if(_0x2d40a0[_0x8a3d('0x1c3')]===_0x8a3d('0x1d1')){return _0x19c8da[_0x8a3d('0x151')](_0x2d40a0['id'])[_0x8a3d('0x9e')](function(_0x27e85c){var _0x40b0ea=_0x2d40a0['loggedIn']-_0x27e85c[0x0]['outboundQueuePauses'];var _0x17ea55=_0x2d40a0['dialPredictiveInterval']*0x3c;var _0x30d93e=_0x1d49fb[0x0]['predictiveIntervalAvgTalktime']+_0x1d49fb[0x0][_0x8a3d('0x4f')];var _0x11fbdd=(_0x1d49fb[0x0][_0x8a3d('0x4a')]+_0x1d49fb[0x0][_0x8a3d('0x4c')]+_0x1d49fb[0x0][_0x8a3d('0x4d')])/_0x1d49fb[0x0][_0x8a3d('0x48')];var _0x58ac35=_0x2d40a0['dialPredictiveOptimizationPercentage']/0x64;_0x2d40a0[_0x8a3d('0x1d8')]=_0x27e85c[0x0]['outboundQueuePauses']||0x0;_0x2d40a0[_0x8a3d('0x1d0')]=_0x11fbdd>0x0?_0x11fbdd:0x1;return _0x19c8da['busyFactor'](_0x40b0ea,_0x17ea55,_0x30d93e,_0x11fbdd,_0x58ac35);})[_0x8a3d('0x9e')](function(_0x983b74){return _0x3a3e43(_0x983b74);})[_0x8a3d('0xa2')](function(_0xd9605d){return _0x92e24c(msgResponse(_0x8a3d('0x1da'),_0x8a3d('0x93'),JSON[_0x8a3d('0x85')](_0xd9605d)));});}}else{return _0x92e24c(msgResponse(_0x8a3d('0x1d2'),_0x8a3d('0x93'),_0x8a3d('0x1d4')));}});};};Dialer[_0x8a3d('0x1b')]['startMethodPredictive']=function(_0x41e98c){var _0x5b5b97=this;return function(){var _0x288bed=0x0;var _0x13d644=Math['floor'](_0x41e98c['erlangCallToSecond']*0x3e8);if(_0x13d644>0x0){_0x13d644=_0x13d644<0x64?0x64:_0x13d644;loggerPredictive[_0x8a3d('0x47')](_0x41e98c['name'],_0x8a3d('0x1db'),_0x13d644,_0x8a3d('0x1dc'));_0x41e98c[_0x8a3d('0x63')]=setInterval(function(){_0x5b5b97[_0x8a3d('0x63')](_0x41e98c);loggerPredictiveCalls[_0x8a3d('0x47')]('[handlePredictive]',_0x288bed+=0x1);},_0x13d644);}else{loggerPredictive['info'](_0x41e98c[_0x8a3d('0x5f')],_0x8a3d('0x1dd'));}};};Dialer['prototype'][_0x8a3d('0x1de')]=function(_0x3dd754,_0x16b02f){var _0x38d59c=this;return function(_0x2072a9){if(_[_0x8a3d('0x79')](_0x2072a9)){if(_['isNil'](_0x16b02f[_0x8a3d('0x158')])||!_0x16b02f['recallme']){if(_0x3dd754[_0x8a3d('0xaf')]==='booked'){_0x3dd754[_0x8a3d('0x73')]=_[_0x8a3d('0x3f')](_0x3dd754[_0x8a3d('0x73')])?!![]:_0x3dd754[_0x8a3d('0x73')];var _0x5bedfd=uuid['v4']();_0x38d59c[_0x8a3d('0x23')][_0x5bedfd]=new Action(_0x3dd754,_0x16b02f,_0x5bedfd);loggerBooked[_0x8a3d('0x47')](_0x8a3d('0x1df'),_0x5bedfd,_0x8a3d('0x1e0'),JSON[_0x8a3d('0x85')](_0x3dd754['queueStatusComplete']),'Queue:\x20',_0x3dd754[_0x8a3d('0x5f')]);if(_0x3dd754[_0x8a3d('0x73')]){_0x3dd754[_0x8a3d('0x73')]=![];_0x38d59c[_0x8a3d('0xf2')][_0x38d59c[_0x8a3d('0x23')][_0x5bedfd][_0x8a3d('0xbe')]]=[];ami[_0x8a3d('0x9b')]({'actionid':_0x5bedfd,'action':_0x8a3d('0x1e1'),'queue':_0x3dd754[_0x8a3d('0x5f')]})['catch'](function(){_0x38d59c[_0x8a3d('0xbd')](_0x3dd754);hopperUtils[_0x8a3d('0xe5')]({'active':![],'ContactId':_0x38d59c[_0x8a3d('0x23')][_0x5bedfd][_0x8a3d('0xe7')],'ListId':_0x38d59c[_0x8a3d('0x23')][_0x5bedfd][_0x8a3d('0xd8')],'VoiceQueueId':_0x38d59c[_0x8a3d('0x23')][_0x5bedfd]['VoiceQueueId']||undefined,'CampaignId':_0x38d59c['actions'][_0x5bedfd]['CampaignId']||undefined})['catch'](loggerCatch(_0x8a3d('0x1e2')));delete _0x38d59c[_0x8a3d('0x23')][_0x5bedfd];});}else{loggerBooked[_0x8a3d('0x47')]('[booked][checkContactBlack][else]',JSON[_0x8a3d('0x85')](_0x3dd754['queueStatusComplete']),_0x8a3d('0x1e3'),_0x3dd754['name']);_0x38d59c[_0x8a3d('0xbd')](_0x3dd754);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x38d59c[_0x8a3d('0x23')][_0x5bedfd][_0x8a3d('0xe7')],'ListId':_0x38d59c[_0x8a3d('0x23')][_0x5bedfd]['ListId'],'VoiceQueueId':_0x38d59c[_0x8a3d('0x23')][_0x5bedfd][_0x8a3d('0x102')]||undefined,'CampaignId':_0x38d59c[_0x8a3d('0x23')][_0x5bedfd][_0x8a3d('0xf6')]||undefined})[_0x8a3d('0xa2')](loggerCatch(_0x8a3d('0x1e2')));delete _0x38d59c[_0x8a3d('0x23')][_0x5bedfd];}}else{return _0x38d59c[_0x8a3d('0x15b')](_0x3dd754,_0x16b02f);}}else{if(utils[_0x8a3d('0x5e')](undefined,_0x16b02f[_0x8a3d('0x1e4')])<_0x3dd754[_0x8a3d('0x1e5')]*0x3c){if(_0x16b02f['Agent']&&!_0x16b02f[_0x8a3d('0x1e6')]['voicePause']){_0x38d59c['preview']['run'](_0x16b02f['id'])[_0x8a3d('0x1d')](function(){_0x38d59c['updateOriginated'](_0x3dd754);});}else{hopperUtils[_0x8a3d('0x1e7')]({'active':![]},_0x16b02f['id'],0x1)[_0x8a3d('0x1d')](function(){_0x38d59c[_0x8a3d('0xbd')](_0x3dd754);});}}else{_0x3dd754['outboundReCallsDay']+=0x1;_0x38d59c[_0x8a3d('0xbd')](_0x3dd754);if(_0x3dd754[_0x8a3d('0x1e8')]){hopperUtils[_0x8a3d('0xe5')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x16b02f[_0x8a3d('0xe7')],'ListId':_0x16b02f[_0x8a3d('0xd8')],'VoiceQueueId':_0x16b02f[_0x8a3d('0x102')]||undefined,'CampaignId':_0x16b02f['CampaignId']||undefined})['catch'](loggerCatch(_0x8a3d('0x1e9')));hopperUtils[_0x8a3d('0xdb')](createObjHistory(_0x3dd754,_0x16b02f,utils[_0x8a3d('0x69')][_0x8a3d('0x1ea')],0x17,_0x8a3d('0x1eb')))[_0x8a3d('0xa2')](loggerCatch(_0x8a3d('0x1ec')));}else{_0x38d59c[_0x8a3d('0x116')](createObjHistory(_0x3dd754,_0x16b02f,utils[_0x8a3d('0x69')]['RECALL_TIMEOUT'],0x16,_0x8a3d('0x1ed')),'[Originate][HistoryRecallClose][historyCatch]',_0x8a3d('0x1ee'));}}}}else{_0x3dd754[_0x8a3d('0x1ef')]+=0x1;_0x38d59c['saveInDb'](createObjHistory(_0x3dd754,_0x16b02f,utils[_0x8a3d('0x69')]['BLACKLIST'],0xd,'Blacklist'),_0x8a3d('0x1f0'),_0x8a3d('0x1f1'));throw'inBlackList';}};};Dialer['prototype'][_0x8a3d('0x1f2')]=function(_0x354532){var _0x19a669=this;var _0x563631=_0x354532[_0x8a3d('0x1f3')]-_0x354532[_0x8a3d('0x80')];emitCampaignSummary(_0x354532);if(_0x563631>0x0&&_0x354532[_0x8a3d('0x68')]==0x0){if(_0x563631>this[_0x8a3d('0x22')]){_0x563631=this[_0x8a3d('0x22')];}_0x354532[_0x8a3d('0x68')]=0x1;hopperUtils['getContactDialerIvr'](_0x354532,_0x563631)[_0x8a3d('0x9e')](function(_0x1b1e16){_0x354532[_0x8a3d('0x68')]=0x0;if(_0x1b1e16){if(!utils[_0x8a3d('0x1f4')](_0x1b1e16)){_0x354532[_0x8a3d('0x6c')]=utils[_0x8a3d('0x69')][_0x8a3d('0x6d')];logger[_0x8a3d('0x47')](_0x8a3d('0x1f5')+_0x354532[_0x8a3d('0x5f')]);}else{_0x354532[_0x8a3d('0x80')]+=_0x1b1e16[_0x8a3d('0x99')];_0x354532[_0x8a3d('0x6c')]=utils[_0x8a3d('0x69')][_0x8a3d('0x1f6')];for(var _0x182a86=0x0;_0x182a86<_0x1b1e16['length'];_0x182a86+=0x1){_0x354532[_0x8a3d('0x1f7')]+=0x1;if(_[_0x8a3d('0xee')](_0x1b1e16[_0x182a86])||_[_0x8a3d('0xee')](_0x1b1e16[_0x182a86]['Contact'])||_[_0x8a3d('0xee')](_0x1b1e16[_0x182a86][_0x8a3d('0x15f')])){_0x19a669[_0x8a3d('0x156')](_0x8a3d('0x1f8'),_0x354532,_0x1b1e16[_0x182a86]);}else{hopperUtils[_0x8a3d('0x1f9')](_[_0x8a3d('0x74')](_0x1b1e16[_0x182a86],['CampaignId',_0x8a3d('0x15f')]))[_0x8a3d('0x9e')](_0x19a669['checkContactBlack'](_0x354532,_0x1b1e16[_0x182a86]))['catch'](_0x19a669[_0x8a3d('0x155')](_0x8a3d('0x1fa'),_0x354532));}}}}})['catch'](loggerGetContactDialer(_0x8a3d('0x1fb'),_0x354532,_0x563631));}};Dialer[_0x8a3d('0x1b')]['handlePower']=function(_0x40f653,_0x1c6af6){var _0x2ace41=this;var _0x5f51bb=[];if(_0x1c6af6<0x1||_0x40f653[_0x8a3d('0xaf')]===_0x8a3d('0x9')){_0x1c6af6=0x1;}var _0x5cdf20=Math[_0x8a3d('0x1fc')](_0x40f653[_0x8a3d('0x137')]*_0x1c6af6)-_0x40f653[_0x8a3d('0x80')];if(_0x40f653[_0x8a3d('0x1fd')]>0x0){var _0x45f322=_0x40f653['dialLimitQueue']-_0x40f653[_0x8a3d('0x80')]-_0x40f653['talking']-_0x40f653['pTalking'];if(_0x5cdf20>_0x45f322){_0x5cdf20=_0x45f322;}}if(_0x5cdf20>0x0&&_0x40f653[_0x8a3d('0x68')]==0x0){if(_0x40f653[_0x8a3d('0xaf')]==='booked'){_0x5cdf20=0x1;}if(_0x5cdf20>this[_0x8a3d('0x22')]){_0x5cdf20=this[_0x8a3d('0x22')];}for(var _0x1e5cf1 in this['agents']){if(typeof this[_0x8a3d('0x21')][_0x1e5cf1]!==_0x8a3d('0x14d')){if(this['agents'][_0x1e5cf1][_0x8a3d('0x6f')]===_0x8a3d('0x1fe')&&this[_0x8a3d('0x21')][_0x1e5cf1][_0x8a3d('0x8a')]===_0x8a3d('0x8b')){_0x5f51bb[_0x8a3d('0x9a')](this[_0x8a3d('0x21')][_0x1e5cf1]['id']);}}}_0x40f653[_0x8a3d('0x68')]=0x1;hopperUtils[_0x8a3d('0x1ff')](_0x40f653,_0x5f51bb,_0x5cdf20)[_0x8a3d('0x9e')](function(_0x383509){_0x40f653[_0x8a3d('0x68')]=0x0;if(_0x383509){if(!utils[_0x8a3d('0x1f4')](_0x383509)){hopperUtils[_0x8a3d('0x200')](_0x40f653)[_0x8a3d('0x9e')](sendMessageReschedule(_0x40f653))[_0x8a3d('0xa2')](loggerCatch(_0x8a3d('0x201')));}else{_0x40f653['originated']+=_0x383509[_0x8a3d('0x99')];_0x40f653['message']=_0x40f653['dialMethod']===_0x8a3d('0x9')?utils['CAMPAIGN_STATUS']['ACTIVE']:utils['CAMPAIGN_STATUS'][_0x8a3d('0x1f6')];for(var _0x42942f=0x0;_0x42942f<_0x383509[_0x8a3d('0x99')];_0x42942f+=0x1){if(_[_0x8a3d('0xee')](_0x383509[_0x42942f])||_[_0x8a3d('0xee')](_0x383509[_0x42942f][_0x8a3d('0x175')])||_[_0x8a3d('0xee')](_0x383509[_0x42942f][_0x8a3d('0x15f')])){_0x2ace41[_0x8a3d('0x156')](_0x8a3d('0x1f8'),_0x40f653,_0x383509[_0x42942f]);}else{hopperUtils[_0x8a3d('0x202')](_[_0x8a3d('0x74')](_0x383509[_0x42942f],[_0x8a3d('0x102'),_0x8a3d('0x15f')]))['then'](_0x2ace41[_0x8a3d('0x1de')](_0x40f653,_0x383509[_0x42942f]))[_0x8a3d('0xa2')](_0x2ace41['loggerHandler']('[actionOriginate]\x20',_0x40f653));}}}}})['catch'](loggerGetContactDialer(_0x8a3d('0x203'),_0x40f653,_0x5cdf20));}};Dialer[_0x8a3d('0x1b')][_0x8a3d('0x63')]=function(_0x325eca){if(_0x325eca[_0x8a3d('0x1fd')]>0x0){var _0x16f828=_0x325eca['dialLimitQueue']-_0x325eca[_0x8a3d('0x80')]-_0x325eca['talking'];if(_0x16f828>0x0&&_0x325eca[_0x8a3d('0x68')]==0x0){this[_0x8a3d('0x204')](_0x325eca);}else{loggerPredictiveCalls[_0x8a3d('0x47')](_0x8a3d('0x205'));}}else{this[_0x8a3d('0x204')](_0x325eca);}};Dialer['prototype'][_0x8a3d('0x204')]=function(_0x11cdfa){var _0x1efef4=this;var _0x26f8f9=[];_0x11cdfa[_0x8a3d('0x80')]+=0x1;for(var _0x3f4522 in this[_0x8a3d('0x21')]){if(typeof this[_0x8a3d('0x21')][_0x3f4522]!==_0x8a3d('0x14d')){if(this[_0x8a3d('0x21')][_0x3f4522]['state']===_0x8a3d('0x1fe')&&this[_0x8a3d('0x21')][_0x3f4522]['status']==='reachable'){_0x26f8f9[_0x8a3d('0x9a')](this[_0x8a3d('0x21')][_0x3f4522]['id']);}}}_0x11cdfa[_0x8a3d('0x68')]=0x1;return this['getContactDialer'](_0x11cdfa['id'],_0x26f8f9,0x1,_0x11cdfa[_0x8a3d('0x206')],_0x11cdfa)[_0x8a3d('0x9e')](function(_0x436cf3){_0x11cdfa[_0x8a3d('0x68')]=0x1;if(_0x436cf3){if(!utils[_0x8a3d('0x1f4')](_0x436cf3)){utils['checkContactLowerLimitOriginate'](_0x11cdfa,0x1,0x0);return hopperUtils['countReScheduled'](_0x11cdfa)[_0x8a3d('0x9e')](sendMessageReschedule(_0x11cdfa))['catch'](loggerCatch(_0x8a3d('0x201')));}else{_0x11cdfa[_0x8a3d('0x6c')]=utils[_0x8a3d('0x69')]['RUNNING'];if(_[_0x8a3d('0xee')](_0x436cf3[0x0])||_[_0x8a3d('0xee')](_0x436cf3[0x0][_0x8a3d('0x175')])||_['isNil'](_0x436cf3[0x0]['phone'])){_0x1efef4['emptyContact'](_0x8a3d('0x1f8'),_0x11cdfa,_0x436cf3[0x0]);}else{return hopperUtils[_0x8a3d('0x202')](_['pick'](_0x436cf3[0x0],[_0x8a3d('0x102'),_0x8a3d('0x15f')]))[_0x8a3d('0x9e')](_0x1efef4[_0x8a3d('0x1de')](_0x11cdfa,_0x436cf3[0x0]))[_0x8a3d('0xa2')](_0x1efef4[_0x8a3d('0x155')]('[actionOriginatePredictive]\x20',_0x11cdfa));}}}})[_0x8a3d('0xa2')](loggerGetContactDialer('[getContactDialerPredictive]',_0x11cdfa,0x1));};Dialer['prototype'][_0x8a3d('0x1d9')]=function(_0x42e9c0,_0x344573,_0x2e87a6,_0x4f72c8,_0x5b869a,_0x2f57d5){loggerPredictive[_0x8a3d('0x47')](_0x8a3d('0x207'));loggerPredictive[_0x8a3d('0x47')](_0x8a3d('0x208'),_0x42e9c0);loggerPredictive[_0x8a3d('0x47')](_0x8a3d('0x209'),_0x344573);loggerPredictive[_0x8a3d('0x47')](_0x8a3d('0x20a'),_0x2e87a6);loggerPredictive[_0x8a3d('0x47')](_0x8a3d('0x20b'),_0x4f72c8);loggerPredictive[_0x8a3d('0x47')](_0x8a3d('0x20c'),_0x5b869a);loggerPredictive[_0x8a3d('0x47')]('---------------------------');return new Promise(function(_0x204e81,_0x534574){if(_0x42e9c0<=0x0||isNaN(_0x42e9c0)){return _0x534574(msgResponse('[abandonmentRate]',_0x8a3d('0x84'),_0x8a3d('0x20d')+_0x42e9c0));}if(_0x2e87a6<=0x0||isNaN(_0x2e87a6)){return _0x534574(msgResponse(_0x8a3d('0x20e'),_0x8a3d('0x84'),_0x8a3d('0x20f')+_0x2e87a6));}if(_0x4f72c8<=0x0||isNaN(_0x4f72c8)){return _0x534574(msgResponse(_0x8a3d('0x20e'),'Error',_0x8a3d('0x210')+_0x4f72c8));}if(_0x344573<=0x0||isNaN(_0x344573)){return _0x534574(msgResponse(_0x8a3d('0x20e'),'Error','interval\x20=\x20'+_0x344573));}if(_0x5b869a<=0x0||isNaN(_0x5b869a)){return _0x534574(msgResponse('[abandonmentRate]',_0x8a3d('0x84'),_0x8a3d('0x211')+_0x5b869a));}_0x2f57d5=_0x2f57d5||0x0;var _0x6a0a03=0x1/_0x2e87a6;var _0x113dd3=0x0;var _0x1c371e=0x0;var _0x5dd0df=0x0;var _0xa321f1=0x0;for(var _0x47ab35=0x0;_0x5dd0df<_0x5b869a;_0x47ab35+=0x1){_0x1c371e=_0x47ab35/_0x344573;_0x113dd3=(_0x4f72c8*_0x1c371e+_0x2f57d5)/_0x6a0a03;_0x5dd0df=utils['erlangb'](_0x113dd3,_0x42e9c0);_0xa321f1=_0x113dd3/_0x42e9c0*(0x1-utils[_0x8a3d('0x212')](_0x113dd3,_0x42e9c0));}return _0x204e81({'erlangCalls':_0x47ab35,'erlangCallToSecond':_0x344573/_0x47ab35,'erlangAbandonmentRate':_0x5dd0df,'erlangBusyFactor':_0xa321f1});});};Dialer[_0x8a3d('0x1b')][_0x8a3d('0x213')]=function(_0x3e0f01,_0x189ccd,_0x490cdd,_0x25031b,_0x571fdd,_0x1a64b6){loggerPredictive[_0x8a3d('0x47')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive['info'](_0x8a3d('0x208'),_0x3e0f01);loggerPredictive['info'](_0x8a3d('0x209'),_0x189ccd);loggerPredictive['info'](_0x8a3d('0x20a'),_0x490cdd);loggerPredictive[_0x8a3d('0x47')](_0x8a3d('0x20b'),_0x25031b);loggerPredictive[_0x8a3d('0x47')](_0x8a3d('0x214'),_0x571fdd);loggerPredictive[_0x8a3d('0x47')](_0x8a3d('0x215'));return new Promise(function(_0x253713,_0x3e0870){if(_0x3e0f01<=0x0||isNaN(_0x3e0f01)){return _0x3e0870(msgResponse(_0x8a3d('0x216'),_0x8a3d('0x84'),_0x8a3d('0x20d')+_0x3e0f01));}if(_0x490cdd<=0x0||isNaN(_0x490cdd)){return _0x3e0870(msgResponse(_0x8a3d('0x216'),_0x8a3d('0x84'),'Ts\x20=\x20'+_0x490cdd));}if(_0x25031b<=0x0||isNaN(_0x25031b)){return _0x3e0870(msgResponse(_0x8a3d('0x216'),_0x8a3d('0x84'),_0x8a3d('0x210')+_0x25031b));}if(_0x189ccd<=0x0||isNaN(_0x189ccd)){return _0x3e0870(msgResponse(_0x8a3d('0x216'),_0x8a3d('0x84'),_0x8a3d('0x217')+_0x189ccd));}if(_0x571fdd<=0x0||isNaN(_0x571fdd)){return _0x3e0870(msgResponse(_0x8a3d('0x216'),_0x8a3d('0x84'),_0x8a3d('0x218')+_0x571fdd));}_0x1a64b6=_0x1a64b6||0x0;var _0x440736=0x1/_0x490cdd;var _0x43a80e=0x0;var _0x5b1edd=0x0;var _0x53f47b=0x0;var _0x4d238b=0x0;for(var _0x24fcb6=0x0;_0x4d238b<_0x571fdd;_0x24fcb6+=0x1){_0x5b1edd=_0x24fcb6/_0x189ccd;_0x43a80e=(_0x25031b*_0x5b1edd+_0x1a64b6)/_0x440736;_0x53f47b=utils[_0x8a3d('0x212')](_0x43a80e,_0x3e0f01);_0x4d238b=_0x43a80e/_0x3e0f01*(0x1-utils[_0x8a3d('0x212')](_0x43a80e,_0x3e0f01));}return _0x253713({'erlangCalls':_0x24fcb6,'erlangCallToSecond':_0x189ccd/_0x24fcb6,'erlangAbandonmentRate':_0x53f47b,'erlangBusyFactor':_0x4d238b});});};module['exports']=Dialer;