54e4d8695c5b67ff7b3fbbe96ac9689a98ca8428
[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 _0x9279=['busy','[syncAgentComplete][createHistory][5]','Congestion','custom:agentcongestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMinThreshold','floor','erlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','check\x20predictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive]','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','Dropped\x20calls\x20day','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','avgHandleTime','dialPredictiveInterval','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval',')\x20are\x20less\x20than\x20threshold\x20(','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','predictiveIntervalAnsweredCalls','abandonmentRate','agentBusyFactor','Unknown\x20Predictive','[getDataPredictive]','loggedIn','outboundQueuePauses','[CatchErlangB]','erlangCallToSecond','one\x20call\x20every:','milliseconds','fail\x20to\x20scheduled\x20calls','UserId','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','[checkContactBlack]','[unlockOriginate][syncQueueStatusComplete]','actionOriginate','scheduledat','dialRecallMeTimeout','unlockContact','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','originated','temp','checkContactEmpty','NO_AVAILABLE_CONTACTS','[getContactCampaign2][Empty]','[actionOriginate]\x20','checkIsBlackListIvr','checkContactBlack','[actionOriginateIvr]','[handleIvr]','[getContactCampaign2]','dialLimitQueue','not_inuse','getContactDialer','countReScheduled','[countReScheduled]\x20','RUNNING','checkIsBlackList','[actionOriginate]','[handlePower]','[handlePredictive][limitChannel]','tryOriginatePredictive','dialOrderByScheduledAt','checkContactLowerLimitOriginate','[actionOriginatePredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','m\x20=\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','erlangb','busyFactor','----\x20Agent\x20Busy\x20Factor\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','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','util','lodash','uuid','moment','ioredis','./utils/hopper','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/voiceQueueRt','../rpc/setting','./models/history','./models/final','./models/agentComplete','./models/queueCallerAbandon','XCALLY_IP_AGI','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','contactsId','uniqueId','optionPredictive','startPredictive','queueBooked','queuesSummary','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncHangup','syncNewExten','syncVarSet','queuemember','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','then','isUndefined','emit','type','outbound','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','format','voice:queue:%s','-----\x20Stats\x20Predictive\x20---','info','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','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','predictiveIntervalTotalCalls','predictiveIntervalAvgTalktime','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','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','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','getSeconds','startProgressive','name','startProgressive\x20value\x20cleared','startPredictive\x20value\x20cleared','handlePredictive','error','stack','contactsRescheduled','CAMPAIGN_STATUS','[getContactDialer2][ReScheduled]','contacts','[getContactDialer2][Empty]','message','state','statedesc','endtime','starttime','[unlockQueueStatus][undefined]','queueStatusComplete','[booked][unlockQueueStatus]','pick','Interval','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','isIVRCampaignActive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','DISACTIVED','is\x20deactivated','stringify','active','SIP/%s','reachable','status','checkIsTrunkReachable','isTrunkReachable','TrunkBackup','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTimeIvr','checkIfTimeIntervals','ifTime','Failure','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','isArray','length','push','Action','command','interval','timezones','content','indexOf','true','catch','iftime\x20%s,%s','all','some','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','resetActiveCalls','syncCampaigns','undefined','sendMessageOneNotActive','resolve','dialTimezone','[syncCampaigns]','checkDialMethod','dialMethod','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','dialGlobalInterval','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','Timezone:\x20','silly','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','AMI\x20IfTime','[ifTime][Action]','queue','uniqueid','ivr','decrementOriginate','[syncAgentConnect]','YYYY-MM-DD\x20HH:mm:ss','outboundAnswerCallsDay','reason','agent','dialQueueProject2','dialAgiAfterHangupAgent','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','[syncQueueCallerAbandon]','droptime','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','dropreason','TIMEOUT','agiafterat','countdropretry','countglobal','callAdditionalPhoneAfterMin','verifyAdditionalPhones','voiceQueue','dialDropMaxRetry','queueCallerAbandonCreateState','additional','add','minutes','ContactId','ListId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','Drop','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','Abandoned','countabandonedretry','dialAbandonedMaxRetry','rescheduleContact','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','actions','channel','syncQueueMember','actionid','strategy','rrmemory','roundrobin','isNil','paused','stateinterface','locked','idHopper','run','[syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','[Catch][Preview][syncQueueStatusComplete]','[booked][RR][finaly]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','getQueue','Success','[callProgressDetecting]\x20','variable','dialAMDActive','value','HANGUP','[syncVarSet]','HangupInAMD','membername','AMD','buildObj','amd','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','countmachineretry','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','[rescheduleContact][Machine]','custom:amd','[syncHangupInAMDIvr]','outboundAnswerAgiCallsDay','[syncAgentComplete][createHistory][0]','countnosuchnumberretry','reason19\x20machine....','dialMachineMaxRetry','[syncHangup]','ivrAnswerCallsDay','cause-txt','Normal\x20Clearing','[syncAgentCompleteIvr][createHistory]','[syncHangupIvr]','dialQueueProject','[syncHangupIvr][createHistory]','[syncHangup2]','outboundUnknownCallsDay','Unknown','[syncHangup][createHistory]','running','INACTIVE','statusMessage','getQueueCampaignStatusMessage','available','talking','pTalking','ACTIVE','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','[syncQueueSummary]','throttle','filter','dialPreviewRecallmeReminder','online','handlePreviewRecallNotifications','map','Agent','user:dialPreviewRecallReminder','clearZombieChannels','[uniqueid]','No\x20such\x20channel','[clearZombieChannels]','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','emptyContact','[emptyContact]','merge','[emptyContact][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','checkPreviewRecallReminder','launchHandleIvr','handleIvr','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','isOutboundQueue','\x22%s,%s%s,,,%s\x22','dialQueueOptions','NONE','XMD-AMDINITIALSILENCE','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','setXMDContactVariables','Contact','Trunk','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','xcally-motion-dialer','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','Error','originate\x20action\x20Error','dialGlobalMaxRetry','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','callProgressDetecting','object','[callProgressDetecting]','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','nosuchnumber','checkRetriveMax','dialNoSuchNumberMaxRetry','reason\x200\x20no\x20such\x20number....','stateGlobal','outboundNoAnswerCallsDay','buildNoAnswerEventPayload','custom:agentnoanswer','dialNoAnswerRetryFrequency','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy'];(function(_0x58aa81,_0x565835){var _0x1a6990=function(_0x2f1ffa){while(--_0x2f1ffa){_0x58aa81['push'](_0x58aa81['shift']());}};_0x1a6990(++_0x565835);}(_0x9279,0x78));var _0x9927=function(_0x51d71a,_0x596fda){_0x51d71a=_0x51d71a-0x0;var _0xff01f1=_0x9279[_0x51d71a];return _0xff01f1;};'use strict';var util=require(_0x9927('0x0'));var _=require(_0x9927('0x1'));var uuid=require(_0x9927('0x2'));var moment=require(_0x9927('0x3'));var rr=require('rr');var Redis=require(_0x9927('0x4'));var utils=require('./utils');var hopperUtils=require(_0x9927('0x5'));var ut=require(_0x9927('0x6'));var config=require(_0x9927('0x7'));var logger=require(_0x9927('0x8'))(_0x9927('0x9'));var loggerBooked=require(_0x9927('0x8'))(_0x9927('0xa'));var loggerPredictive=require(_0x9927('0x8'))(_0x9927('0xb'));var loggerPredictiveCalls=require(_0x9927('0x8'))(_0x9927('0xc'));var loggerSyncQueueSummary=require(_0x9927('0x8'))(_0x9927('0xd'));var ami=require(_0x9927('0xe'));config[_0x9927('0xf')]=_[_0x9927('0x10')](config[_0x9927('0xf')],{'host':_0x9927('0x11'),'port':0x18eb});var io=require(_0x9927('0x12'))(new Redis(config['redis']));var cmHopper=require('../rpc/cmHopper');var voiceQueueRt=require(_0x9927('0x13'));var RpcSetting=require(_0x9927('0x14'));var Interval=require('../rpc/interval');var Action=require('./models/action');var History=require(_0x9927('0x15'));var Final=require(_0x9927('0x16'));var AgentComplete=require(_0x9927('0x17'));var QueueCallerAbandon=require(_0x9927('0x18'));var Hangup=require('./models/hangup');var ipAgi=process['env'][_0x9927('0x19')]||'127.0.0.1';var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x9927('0x1a')][_0x9927('0x1b')]=function(_0x466920){this[_0x9927('0x1c')]=this[_0x9927('0x1c')]?this['tail'][_0x9927('0x1d')](_0x466920):_0x466920();};function Dialer(_0x4db77f,_0x451857){this[_0x9927('0x1e')]=new Sequence();this[_0x9927('0x1f')]=_0x451857;this[_0x9927('0x20')]=_0x4db77f[_0x9927('0x20')];this[_0x9927('0x21')]=_0x4db77f[_0x9927('0x21')];this[_0x9927('0x22')]=_0x4db77f[_0x9927('0x22')];this['trunks']=_0x4db77f[_0x9927('0x23')];this['maxNumberOriginate']=config[_0x9927('0x24')]||0x2;this[_0x9927('0x25')]={};this['actions']={};this[_0x9927('0x26')]={};this[_0x9927('0x27')]={};this[_0x9927('0x28')]={};this[_0x9927('0x29')]={};this['startProgressive']={};this['ivrOriginated']={};this[_0x9927('0x2a')]={};this['queueBookedRR']={};this[_0x9927('0x2b')]={};ami['on']('agentconnect',this[_0x9927('0x2c')][_0x9927('0x2d')](this));ami['on'](_0x9927('0x2e'),this[_0x9927('0x2f')]['bind'](this));ami['on'](_0x9927('0x30'),this[_0x9927('0x31')][_0x9927('0x2d')](this));ami['on'](_0x9927('0x32'),this[_0x9927('0x33')][_0x9927('0x2d')](this));ami['on'](_0x9927('0x34'),this[_0x9927('0xd')][_0x9927('0x2d')](this));ami['on'](_0x9927('0x35'),this[_0x9927('0x36')][_0x9927('0x2d')](this));ami['on'](_0x9927('0x37'),this[_0x9927('0x38')][_0x9927('0x2d')](this));ami['on']('newexten',this[_0x9927('0x39')][_0x9927('0x2d')](this));ami['on']('varset',this[_0x9927('0x3a')][_0x9927('0x2d')](this));ami['on'](_0x9927('0x3b'),this['syncQueueMember'][_0x9927('0x2d')](this));ami['on']('queuestatuscomplete',this[_0x9927('0x3c')][_0x9927('0x2d')](this));this[_0x9927('0x3d')]();this[_0x9927('0x3e')]();RpcSetting[_0x9927('0x3f')]()[_0x9927('0x40')](function(_0x4cc4ef){previewRecallmeReminderInterval=_0x4cc4ef['previewRecallmeReminderInterval'];});}function isNotNull(_0x3c5b9c){return _0x3c5b9c!==null&&!_[_0x9927('0x41')](_0x3c5b9c);}function msgResponse(_0x4ba2a4,_0x364446,_0x41c534){return{'action':_0x4ba2a4,'response':_0x364446,'message':_0x41c534,'stack':_0x41c534};}function emit(_0x2dd50c,_0x10566a,_0x2b1639){io['to'](_0x2dd50c)[_0x9927('0x42')](_0x10566a,_0x2b1639);}function emitOutboundVoiceQueueSummary(_0xe209f9){if(_0xe209f9[_0x9927('0x43')]===_0x9927('0x44')){logger[_0x9927('0x45')](_0x9927('0x46'),util[_0x9927('0x47')](_0xe209f9,{'showHidden':![],'depth':null}));emit(util[_0x9927('0x48')](_0x9927('0x49'),_0xe209f9['name']),'voice_queue:save',_0xe209f9);}}function checkGetDataPredictive(_0xb6318e){if(isNotNull(_0xb6318e)&&!_['isEmpty'](_0xb6318e)){loggerPredictive['info'](_0x9927('0x4a'));loggerPredictive[_0x9927('0x4b')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xb6318e['predictiveIntervalTotalCalls']);loggerPredictive['info'](_0x9927('0x4c'),_0xb6318e['predictiveIntervalAnsweredCalls']);loggerPredictive[_0x9927('0x4b')](_0x9927('0x4d'),_0xb6318e[_0x9927('0x4e')]);loggerPredictive[_0x9927('0x4b')](_0x9927('0x4f'),_0xb6318e[_0x9927('0x50')]);loggerPredictive[_0x9927('0x4b')](_0x9927('0x51'),_0xb6318e[_0x9927('0x52')]);loggerPredictive[_0x9927('0x4b')](_0x9927('0x53'),_0xb6318e['predictiveIntervalAvgTalktime']);loggerPredictive[_0x9927('0x4b')]('---------------------------');if(_0xb6318e[_0x9927('0x54')]>0x0){if(!_[_0x9927('0x41')](_0xb6318e[_0x9927('0x55')])&&_0xb6318e[_0x9927('0x55')]>0x0){return!![];}loggerPredictive['info'](_0x9927('0x56'));if(!_[_0x9927('0x41')](_0xb6318e[_0x9927('0x52')])&&_0xb6318e[_0x9927('0x52')]>0x0){return!![];}loggerPredictive[_0x9927('0x4b')](_0x9927('0x57'));}else{loggerPredictive[_0x9927('0x4b')](_0x9927('0x58'));}}else{loggerPredictive[_0x9927('0x4b')](_0x9927('0x59'));}return![];}function mergeDataErlangB(_0x4f2109){return function(_0x3aa1f7){loggerPredictive[_0x9927('0x4b')](_0x9927('0x5a'));loggerPredictive[_0x9927('0x4b')](_0x9927('0x5b'),_0x3aa1f7['erlangCalls']);loggerPredictive['info'](_0x9927('0x5c'),_0x3aa1f7['erlangCallToSecond']);loggerPredictive['info'](_0x9927('0x5d'),_0x3aa1f7[_0x9927('0x5e')]);loggerPredictive[_0x9927('0x4b')](_0x9927('0x5f'),_0x3aa1f7[_0x9927('0x60')]);loggerPredictive['info'](_0x9927('0x5d'),_0x3aa1f7['erlangAbandonmentRate']);loggerPredictive['info']('---------------------------');_['merge'](_0x4f2109,_0x3aa1f7);};}function ifInterval(_0x1e7b85,_0x213836){if(_[_0x9927('0x41')](_0x213836)){return![];}return utils[_0x9927('0x61')](undefined,_0x213836)<_0x1e7b85*0x3c;}function clearPredictiveAttributes(_0x5cbc4f){if(_0x5cbc4f[_0x9927('0x62')]){_0x5cbc4f[_0x9927('0x62')]=undefined;loggerPredictive[_0x9927('0x45')](_0x5cbc4f[_0x9927('0x63')],_0x9927('0x64'));}if(_0x5cbc4f[_0x9927('0x29')]){_0x5cbc4f['startPredictive']=undefined;loggerPredictive[_0x9927('0x45')](_0x5cbc4f[_0x9927('0x63')],_0x9927('0x65'));}if(_0x5cbc4f[_0x9927('0x66')]){clearInterval(_0x5cbc4f[_0x9927('0x66')]);_0x5cbc4f[_0x9927('0x66')]=undefined;loggerPredictive[_0x9927('0x45')](_0x5cbc4f[_0x9927('0x63')],'handlePredictive\x20interval\x20cleared');}}function loggerCatchPredictive(_0x4854aa,_0x2c5744){return function(_0x492e3f){loggerPredictive[_0x9927('0x67')](_0x2c5744[_0x9927('0x63')],_0x4854aa);loggerPredictive['error'](_0x492e3f[_0x9927('0x68')]);clearPredictiveAttributes(_0x2c5744);};}function loggerCatch(_0x43c1c4){return function(_0x39bfae){logger[_0x9927('0x67')](_0x43c1c4,util[_0x9927('0x47')](_0x39bfae,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x211635){return function(_0x591459){if(isNotNull(_0x591459)&&isNotNull(_0x591459[0x0])){if(_0x591459[0x0][_0x9927('0x69')]>0x0){_0x211635['message']=utils[_0x9927('0x6a')]['CONTACTS_RESCHEDULED'];logger[_0x9927('0x4b')](_0x9927('0x6b')+_0x211635['name'],_0x591459[0x0]['contactsRescheduled'],_0x9927('0x6c'));}else{_0x211635['message']=utils[_0x9927('0x6a')]['NO_AVAILABLE_CONTACTS'];logger[_0x9927('0x4b')](_0x9927('0x6d')+_0x211635['name']);}}};}function createObjHistory(_0x4ab92d,_0x5e76c7,_0x12c08e,_0x36e3c6,_0x4554ed){_0x4ab92d[_0x9927('0x6e')]=_0x12c08e;var _0x1c6568=new Action(_0x4ab92d,_0x5e76c7);var _0x25fe73=new History(_0x1c6568);_0x25fe73[_0x9927('0x6f')]=_0x36e3c6;_0x25fe73[_0x9927('0x70')]=_0x4554ed;_0x25fe73[_0x9927('0x71')]=_0x1c6568[_0x9927('0x72')];return _0x25fe73;}function unlockQueueStatus(_0x40b915,_0x4af301){setTimeout(function(){if(_[_0x9927('0x41')](_0x40b915['queueStatusComplete'])){loggerBooked['error'](_0x9927('0x73'),_0x4af301);}_0x40b915[_0x9927('0x74')]=!![];loggerBooked[_0x9927('0x4b')](_0x9927('0x75'),_0x4af301,JSON['stringify'](_[_0x9927('0x76')](_0x40b915,['name',_0x9927('0x74')])));},0x1f3);}function checkInterval(_0x20e24b){return function(){if(!isNotNull(_0x20e24b[_0x9927('0x77')])){_0x20e24b[_0x9927('0x6e')]=utils[_0x9927('0x6a')][_0x9927('0x78')];throw _0x20e24b['name']+_0x9927('0x79');}if(!isNotNull(_0x20e24b[_0x9927('0x77')][_0x9927('0x7a')])){_0x20e24b[_0x9927('0x6e')]=utils['CAMPAIGN_STATUS'][_0x9927('0x78')];throw _0x20e24b[_0x9927('0x63')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x9927('0x7b')](_0x20e24b[_0x9927('0x77')][_0x9927('0x7a')]))){_0x20e24b[_0x9927('0x6e')]=utils[_0x9927('0x6a')][_0x9927('0x78')];throw _0x20e24b[_0x9927('0x63')]+_0x9927('0x79');}};}function checkIsIVRCampaignActive(_0xb1d8aa){return function(){if(!utils[_0x9927('0x7c')](_0xb1d8aa)){_0xb1d8aa[_0x9927('0x6e')]=utils[_0x9927('0x6a')]['INACTIVE'];throw _0xb1d8aa[_0x9927('0x63')]+'\x20NOT\x20Active';}};}function emitCampaignSummary(_0x1c3bb4){if(utils['isIVRCampaign'](_0x1c3bb4)){emit(util[_0x9927('0x48')]('campaign:ivr:%s',_0x1c3bb4[_0x9927('0x63')]),'campaign:save',_0x1c3bb4);}}function loggerCatchQueueSummary(_0x436197,_0x549c88){return function(_0x49caa1){clearPredictiveAttributes(_0x549c88);emitCampaignSummary(_0x549c88);loggerSyncQueueSummary[_0x9927('0x45')](_0x436197,util[_0x9927('0x47')](_0x49caa1,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x2fe61e){if(_0x2fe61e['sendMessageOneNotActive']){if(_0x2fe61e['originated']===0x0){_0x2fe61e['sendMessageOneNotActive']=![];_0x2fe61e[_0x9927('0x6e')]=utils[_0x9927('0x6a')]['INACTIVE'];loggerSyncQueueSummary[_0x9927('0x45')](_0x9927('0x7d'),_0x2fe61e[_0x9927('0x63')],_0x9927('0x7e'));}else{_0x2fe61e[_0x9927('0x6e')]=utils[_0x9927('0x6a')][_0x9927('0x7f')];loggerSyncQueueSummary[_0x9927('0x45')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x2fe61e[_0x9927('0x63')],_0x9927('0x80'));}emitCampaignSummary(_0x2fe61e);}}function myreject(_0x19150a){return function(_0x1c1e25){return _0x19150a(msgResponse('[ifTime][Action]','Error',JSON[_0x9927('0x81')](_0x1c1e25)));};}Dialer[_0x9927('0x1a')]['isTrunkReachable']=function(_0x91b53e){return!_[_0x9927('0x41')](_0x91b53e)&&_0x91b53e&&!_['isUndefined'](_0x91b53e[_0x9927('0x63')])&&!_[_0x9927('0x41')](_0x91b53e[_0x9927('0x82')])&&_0x91b53e['active']&&(this[_0x9927('0x23')][util[_0x9927('0x48')](_0x9927('0x83'),_0x91b53e[_0x9927('0x63')])]['status']===_0x9927('0x84')||this[_0x9927('0x23')][util['format'](_0x9927('0x83'),_0x91b53e[_0x9927('0x63')])][_0x9927('0x85')]==='unmonitored');};Dialer[_0x9927('0x1a')][_0x9927('0x86')]=function(_0x1024cc){var _0x45385c=this;return function(){if(!_0x45385c[_0x9927('0x87')](_0x1024cc['Trunk'])){if(!_0x45385c[_0x9927('0x87')](_0x1024cc[_0x9927('0x88')])){_0x1024cc[_0x9927('0x6e')]=utils[_0x9927('0x6a')]['TRUNK_NOT_REACHABLE'];throw _0x1024cc[_0x9927('0x63')]+_0x9927('0x89');}}};};Dialer[_0x9927('0x1a')][_0x9927('0x8a')]=function(_0x33947e,_0x3b49d9,_0x224f6d,_0x58fb1c){var _0x212627=this;return function(){var _0x50451e=!![];return _0x212627[_0x9927('0x8b')](_0x33947e,_0x3b49d9,_0x224f6d,_0x58fb1c,_0x50451e);};};Dialer[_0x9927('0x1a')][_0x9927('0x8c')]=function(_0x3f7059,_0x3189b4,_0x3867d0,_0x504432){var _0x1ce0f5=this;return function(){var _0x1e8518=![];return _0x1ce0f5['ifTimeIvr'](_0x3f7059[_0x9927('0x7a')],_0x3189b4,_0x3867d0,_0x504432,_0x1e8518);};};Dialer['prototype'][_0x9927('0x8b')]=function(_0x159e59,_0x17973e,_0x10d5ca,_0x9eca7f,_0x46ea95){var _0x429aed=[];return new Promise(function(_0x467e23,_0x4ba473){if(!isNotNull(_0x159e59)){_0x9eca7f[_0x9927('0x6e')]=utils[_0x9927('0x6a')][_0x9927('0x78')];return _0x4ba473(msgResponse(_0x9927('0x8d'),_0x9927('0x8e'),_0x10d5ca+'\x20Intervals\x20is\x20null\x20'));}if(_[_0x9927('0x7b')](_0x159e59)){_0x9eca7f[_0x9927('0x6e')]=utils['CAMPAIGN_STATUS']['EMPTY_INTERVAL'];return _0x4ba473(msgResponse(_0x9927('0x8d'),'Failure',_0x10d5ca+'\x20Intervals\x20is\x20empty\x20'));}if(_0x17973e&&_[_0x9927('0x41')](config['timezones'][_0x17973e])){_0x9eca7f[_0x9927('0x6e')]=utils[_0x9927('0x6a')][_0x9927('0x8f')];return _0x4ba473(msgResponse(_0x9927('0x8d'),_0x9927('0x8e'),_0x10d5ca+_0x9927('0x90')+_0x17973e));}if(_[_0x9927('0x91')](_0x159e59)){for(var _0x24243f=0x0;_0x24243f<_0x159e59[_0x9927('0x92')];_0x24243f+=0x1){_0x429aed[_0x9927('0x93')](ami[_0x9927('0x94')]({'action':_0x9927('0x95'),'command':util[_0x9927('0x48')]('iftime\x20%s,%s',_0x159e59[_0x24243f][_0x9927('0x96')],!_[_0x9927('0x41')](config[_0x9927('0x97')][_0x17973e])?_0x17973e:'')})[_0x9927('0x40')](function(_0x23b65d){return _0x23b65d[_0x9927('0x98')][_0x9927('0x99')](_0x9927('0x9a'))>=0x0;})[_0x9927('0x9b')](myreject(_0x4ba473)));}}else{_0x429aed['push'](ami[_0x9927('0x94')]({'action':_0x9927('0x95'),'command':util[_0x9927('0x48')](_0x9927('0x9c'),_0x159e59,!_['isUndefined'](config[_0x9927('0x97')][_0x17973e])?_0x17973e:'')})[_0x9927('0x40')](function(_0xaae9a7){return _0xaae9a7[_0x9927('0x98')]['indexOf'](_0x9927('0x9a'))>=0x0;})[_0x9927('0x9b')](myreject(_0x4ba473)));}Promise[_0x9927('0x9d')](_0x429aed)['then'](function(_0x23b9a0){var _0x45f2d1=_[_0x9927('0x9e')](_0x23b9a0);if(_0x45f2d1){return _0x467e23(_0x45f2d1);}else{_0x9eca7f[_0x9927('0x6e')]=_0x46ea95?utils[_0x9927('0x6a')][_0x9927('0x9f')]:utils[_0x9927('0x6a')][_0x9927('0xa0')];return _0x4ba473(msgResponse(_0x9927('0xa1'),_0x9927('0x8e'),_0x9927('0xa2')+_0x46ea95+'\x20'+_0x10d5ca+_0x9927('0xa3')+util[_0x9927('0x47')](_0x159e59,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x17973e));}})[_0x9927('0x9b')](function(_0x2456c4){return _0x4ba473(msgResponse('ifTime',_0x9927('0x8e'),JSON[_0x9927('0x81')](_0x2456c4)));});});};Dialer[_0x9927('0x1a')]['loopCampaigns']=function(){var _0x12cb0b=this;return cmHopper[_0x9927('0xa4')]({'active':![]},{'where':{'active':!![]}})[_0x9927('0x40')](function(){setInterval(function(){_0x12cb0b[_0x9927('0xa5')]();},0x3e8);});};Dialer[_0x9927('0x1a')][_0x9927('0xa5')]=function(){var _0x1bb955=this;var _0x17bd4d;for(var _0x2432d1 in this[_0x9927('0x21')]){if(typeof this[_0x9927('0x21')][_0x2432d1]!==_0x9927('0xa6')){_0x17bd4d=this[_0x9927('0x21')][_0x2432d1];if(utils['isIVRCampaign'](_0x17bd4d)&&utils[_0x9927('0x7c')](_0x17bd4d)){_0x17bd4d[_0x9927('0xa7')]=!![];Promise[_0x9927('0xa8')]()[_0x9927('0x40')](checkIsIVRCampaignActive(_0x17bd4d))[_0x9927('0x40')](checkInterval(_0x17bd4d))[_0x9927('0x40')](_0x1bb955[_0x9927('0x86')](_0x17bd4d))[_0x9927('0x40')](_0x1bb955[_0x9927('0x8a')](_0x17bd4d['dialGlobalInterval'],_0x17bd4d[_0x9927('0xa9')],_0x17bd4d[_0x9927('0x63')],_0x17bd4d))['then'](_0x1bb955[_0x9927('0x8c')](_0x17bd4d[_0x9927('0x77')],_0x17bd4d[_0x9927('0xa9')],_0x17bd4d['name'],_0x17bd4d))[_0x9927('0x40')](_0x1bb955['launchHandleIvr'](_0x17bd4d))[_0x9927('0x9b')](loggerCatchQueueSummary(_0x9927('0xaa'),_0x17bd4d));}else{notSendMessagesCampaign(_0x17bd4d);}}}};Dialer[_0x9927('0x1a')][_0x9927('0xab')]=function(_0x4cd896){if(_0x4cd896[_0x9927('0xac')]!==_0x9927('0xb')){clearPredictiveAttributes(_0x4cd896);}switch(_0x4cd896[_0x9927('0xac')]){case'progressive':this[_0x9927('0xad')](_0x4cd896,0x1);break;case _0x9927('0xae'):this[_0x9927('0xad')](_0x4cd896,_0x4cd896[_0x9927('0xaf')]);break;case _0x9927('0xb'):this['predictive'](_0x4cd896);break;case _0x9927('0xa'):this['handlePower'](_0x4cd896,0x1);break;default:logger[_0x9927('0x67')](_0x9927('0xb0'),_0x4cd896['name'],_0x9927('0xb1'));}};Dialer[_0x9927('0x1a')]['ifTime']=function(_0x273cc9,_0x3131ee){var _0x411e7b=_0x273cc9[_0x9927('0xa9')];var _0x2cc1cd=_0x3131ee?_0x273cc9[_0x9927('0xb2')]:_0x273cc9['Interval']['Intervals'];logger['silly'](_0x9927('0xb3'),_0x2cc1cd,_0x411e7b,_0x273cc9['name'],util[_0x9927('0x48')](_0x9927('0xb4'),_0x273cc9[_0x9927('0x63')],_0x273cc9['id']));var _0xc88e57=null;return Interval['intervalIftime'](_0x2cc1cd,_0x411e7b)[_0x9927('0x40')](function(_0x37e9f4){if(_0x37e9f4===!![]){return _0x37e9f4;}else{_0x273cc9[_0x9927('0x6e')]=_0x3131ee?utils[_0x9927('0x6a')][_0x9927('0x9f')]:utils['CAMPAIGN_STATUS'][_0x9927('0xa0')];_0xc88e57=msgResponse(_0x9927('0xa1'),'Failure',_0x9927('0xa2')+_0x3131ee+'\x20'+_0x273cc9[_0x9927('0x63')]+'\x20Interval\x20is\x20overtime:\x20'+util['inspect'](_0x2cc1cd,{'showHidden':![],'depth':null})+_0x9927('0xb5')+_0x411e7b);}if(_0xc88e57!==null){logger[_0x9927('0xb6')](_0x9927('0xb7'),_0xc88e57);_0xc88e57['isGlobal']=_0x3131ee;throw _0xc88e57;}})[_0x9927('0x9b')](function(_0x107d04){logger['error'](_0x9927('0xb8'),_0x107d04);throw msgResponse(_0x9927('0xb9'),'Error',util[_0x9927('0x47')](_0x107d04,{'showHidden':![],'depth':null}));});};Dialer[_0x9927('0x1a')][_0x9927('0x2c')]=function(_0x2991f2){if(this[_0x9927('0x20')][_0x2991f2[_0x9927('0xba')]]){if(this['uniqueId'][_0x2991f2[_0x9927('0xbb')]]&&this[_0x9927('0x27')][_0x2991f2[_0x9927('0xbb')]][_0x9927('0x43')]!==_0x9927('0xbc')){utils[_0x9927('0xbd')](this[_0x9927('0x20')][_0x2991f2['queue']],_0x9927('0xbe'));this['uniqueId'][_0x2991f2[_0x9927('0xbb')]]['answertime']=moment()[_0x9927('0x48')](_0x9927('0xbf'));}}};Dialer[_0x9927('0x1a')][_0x9927('0x33')]=function(_0x12af82){var _0x198b42=this[_0x9927('0x27')][_0x12af82[_0x9927('0xbb')]];if(this['voiceQueues'][_0x12af82['queue']]){if(_0x198b42&&_0x198b42['type']!==_0x9927('0xbc')){delete this[_0x9927('0x27')][_0x12af82[_0x9927('0xbb')]];this[_0x9927('0x20')][_0x12af82['queue']][_0x9927('0xc0')]+=0x1;var _0x28b346=new AgentComplete(_0x198b42,_0x12af82);if(_0x12af82[_0x9927('0xc1')]===_0x9927('0xc2')){_0x28b346['agiafterat']=this['voiceQueues'][_0x12af82['queue']][_0x9927('0xc3')]&&this['voiceQueues'][_0x12af82['queue']][_0x9927('0xc4')]?moment()[_0x9927('0x48')](_0x9927('0xbf')):undefined;}hopperUtils[_0x9927('0xc5')](_0x28b346)['catch'](loggerCatch(_0x9927('0xc6')));hopperUtils[_0x9927('0xc7')](_0x28b346)['catch'](loggerCatch(_0x9927('0xc8')));}}};Dialer[_0x9927('0x1a')]['syncQueueCallerAbandon']=function(_0x2714ac){var _0x26e4da=this[_0x9927('0x27')][_0x2714ac[_0x9927('0xbb')]];var _0x1149fa=this;var _0x591204=![];var _0x279e63;var _0x53dbef;if(this[_0x9927('0x20')][_0x2714ac[_0x9927('0xba')]]){if(_0x26e4da&&_0x26e4da[_0x9927('0x43')]!==_0x9927('0xbc')){delete this['uniqueId'][_0x2714ac['uniqueid']];utils[_0x9927('0xbd')](this[_0x9927('0x20')][_0x2714ac['queue']],_0x9927('0xc9'));_0x26e4da[_0x9927('0xca')]=moment()['format'](_0x9927('0xbf'));var _0x13c3ee=new QueueCallerAbandon(_0x26e4da,_0x2714ac);if(utils[_0x9927('0x61')](_0x26e4da[_0x9927('0xca')],_0x26e4da[_0x9927('0xcb')])>=_0x26e4da[_0x9927('0xcc')]){this[_0x9927('0x20')][_0x2714ac[_0x9927('0xba')]][_0x9927('0x4e')]+=0x1;this['voiceQueues'][_0x2714ac[_0x9927('0xba')]][_0x9927('0xcd')]+=0x1;this[_0x9927('0x20')][_0x2714ac[_0x9927('0xba')]][_0x9927('0xce')]+=0x1;_0x13c3ee[_0x9927('0x6f')]=0xa;_0x13c3ee[_0x9927('0x70')]='Drop';_0x13c3ee[_0x9927('0xcf')]=_0x9927('0xd0');_0x13c3ee[_0x9927('0xd1')]=this['voiceQueues'][_0x2714ac[_0x9927('0xba')]][_0x9927('0xc3')]?moment()[_0x9927('0x48')](_0x9927('0xbf')):undefined;_0x13c3ee[_0x9927('0xd2')]+=0x1;_0x13c3ee[_0x9927('0xd3')]+=0x1;_0x279e63=this['voiceQueues'][_0x2714ac['queue']]['dialDropRetryFrequency'];_0x53dbef=this[_0x9927('0x20')][_0x2714ac[_0x9927('0xba')]][_0x9927('0xd4')];hopperUtils[_0x9927('0xd5')](_0x13c3ee,_0x13c3ee['state'],_0x26e4da[_0x9927('0xd6')])[_0x9927('0x40')](function(_0x2fa7d5){_0x591204=_0x2fa7d5['additional']==0x1;if(_0x13c3ee[_0x9927('0xd2')]>=_0x1149fa['voiceQueues'][_0x2714ac['queue']][_0x9927('0xd7')]){_0x1149fa[_0x9927('0xd8')](_0x13c3ee,_0x2fa7d5[_0x9927('0xd9')]);}else{hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x13c3ee[_0x9927('0xd2')],'scheduledat':moment()[_0x9927('0xda')](_0x1149fa[_0x9927('0x20')][_0x2714ac[_0x9927('0xba')]]['dialDropRetryFrequency'],_0x9927('0xdb'))[_0x9927('0x48')](_0x9927('0xbf')),'ContactId':_0x26e4da[_0x9927('0xdc')],'ListId':_0x26e4da[_0x9927('0xdd')],'VoiceQueueId':_0x26e4da[_0x9927('0xde')]||undefined,'CampaignId':_0x26e4da[_0x9927('0xdf')]||undefined})['catch'](loggerCatch(_0x9927('0xe0')));var _0x7e2026=new History(_0x13c3ee);_0x7e2026[_0x9927('0x6f')]=0xa;_0x7e2026[_0x9927('0x70')]=_0x9927('0xe1');_0x7e2026[_0x9927('0x72')]=moment()[_0x9927('0x48')](_0x9927('0xbf'));_0x7e2026[_0x9927('0x71')]=_0x7e2026['starttime'];_0x7e2026[_0x9927('0xe2')]=_0x13c3ee['calleridname'];_0x7e2026[_0x9927('0xe3')]=_0x13c3ee[_0x9927('0xe3')];hopperUtils['createHistory'](_0x7e2026)[_0x9927('0x9b')](loggerCatch(_0x9927('0xe4')));}})[_0x9927('0x40')](function(){if(_0x591204)hopperUtils[_0x9927('0xe5')](_0x13c3ee,_0x279e63,_0x53dbef)[_0x9927('0x40')](function(){return 0x1;});});}else{this['voiceQueues'][_0x2714ac['queue']][_0x9927('0x50')]+=0x1;this['voiceQueues'][_0x2714ac[_0x9927('0xba')]]['outboundDropCallsDayCallersExit']+=0x1;_0x13c3ee[_0x9927('0x6f')]=0xb;_0x13c3ee[_0x9927('0x70')]=_0x9927('0xe6');_0x13c3ee[_0x9927('0xcf')]='CALLEREXIT';_0x13c3ee[_0x9927('0xe7')]+=0x1;_0x13c3ee['countglobal']+=0x1;_0x279e63=this[_0x9927('0x20')][_0x2714ac[_0x9927('0xba')]]['dialAbandonedRetryFrequency'];_0x53dbef=this['voiceQueues'][_0x2714ac[_0x9927('0xba')]][_0x9927('0xd4')];hopperUtils[_0x9927('0xd5')](_0x13c3ee,_0x13c3ee[_0x9927('0x6f')],_0x26e4da[_0x9927('0xd6')])[_0x9927('0x40')](function(_0x53939c){if(_0x13c3ee[_0x9927('0xe7')]>=_0x1149fa['voiceQueues'][_0x2714ac[_0x9927('0xba')]][_0x9927('0xe8')]){_0x1149fa[_0x9927('0xd8')](_0x13c3ee,_0x53939c['additional']);}else{hopperUtils[_0x9927('0xe9')]({'active':![],'countabandonedretry':_0x13c3ee[_0x9927('0xe7')],'scheduledat':moment()['add'](_0x1149fa[_0x9927('0x20')][_0x2714ac['queue']]['dialAbandonedRetryFrequency'],_0x9927('0xdb'))[_0x9927('0x48')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x26e4da['ContactId'],'ListId':_0x26e4da['ListId'],'VoiceQueueId':_0x26e4da['VoiceQueueId']||undefined,'CampaignId':_0x26e4da[_0x9927('0xdf')]||undefined})[_0x9927('0x9b')](loggerCatch(_0x9927('0xea')));var _0x29c743=new History(_0x13c3ee);_0x29c743['state']=0xb;_0x29c743['statedesc']='Abandoned';_0x29c743[_0x9927('0x72')]=moment()['format'](_0x9927('0xbf'));_0x29c743['endtime']=_0x29c743[_0x9927('0x72')];_0x29c743[_0x9927('0xe2')]=_0x13c3ee[_0x9927('0xe2')];_0x29c743[_0x9927('0xe3')]=_0x13c3ee['calleridnum'];hopperUtils[_0x9927('0xc5')](_0x29c743)[_0x9927('0x9b')](loggerCatch(_0x9927('0xeb')));}})[_0x9927('0x40')](function(){if(_0x591204)hopperUtils[_0x9927('0xe5')](_0x13c3ee,_0x279e63,_0x53dbef)[_0x9927('0x40')](function(){return 0x1;});});}}}};Dialer[_0x9927('0x1a')][_0x9927('0x39')]=function(_0xb672f2){if(this[_0x9927('0xec')][_0xb672f2['uniqueid']]){this[_0x9927('0xec')][_0xb672f2[_0x9927('0xbb')]]['channel']=_0xb672f2[_0x9927('0xed')];}if(this[_0x9927('0x27')][_0xb672f2[_0x9927('0xbb')]]){this[_0x9927('0x27')][_0xb672f2[_0x9927('0xbb')]][_0x9927('0xed')]=_0xb672f2[_0x9927('0xed')];}};Dialer[_0x9927('0x1a')][_0x9927('0xee')]=function(_0x225218){if(!this['actions'][_0x225218['actionid']]){return;}var _0xa761ad=this[_0x9927('0x20')][this[_0x9927('0xec')][_0x225218[_0x9927('0xef')]][_0x9927('0xba')]][_0x9927('0xf0')]||_0x9927('0xf1');if(_0xa761ad===_0x9927('0xf2')){if(this[_0x9927('0xec')][_0x225218[_0x9927('0xef')]]&&_[_0x9927('0xf3')](this[_0x9927('0xec')][_0x225218['actionid']]['locked'])&&_0x225218[_0x9927('0x85')]==='1'&&_0x225218[_0x9927('0xf4')]==='0'){if(this[_0x9927('0x22')][_0x225218[_0x9927('0xf5')]]){if(!this['agents'][_0x225218[_0x9927('0xf5')]][_0x9927('0xf6')]){this[_0x9927('0x22')][_0x225218[_0x9927('0xf5')]]['locked']=!![];this[_0x9927('0xec')][_0x225218[_0x9927('0xef')]][_0x9927('0xf6')]=!![];this[_0x9927('0xec')][_0x225218[_0x9927('0xef')]][_0x9927('0xf5')]=_0x225218[_0x9927('0xf5')];}}}}else if(_0xa761ad===_0x9927('0xf1')){if(this[_0x9927('0xec')][_0x225218[_0x9927('0xef')]]){if(this[_0x9927('0x22')][_0x225218[_0x9927('0xf5')]]){this['actions'][_0x225218['actionid']][_0x9927('0xf5')]=_0x225218['stateinterface'];if(_[_0x9927('0xf3')](this[_0x9927('0x2a')][this['actions'][_0x225218[_0x9927('0xef')]][_0x9927('0xba')]])){this['queueBooked'][this[_0x9927('0xec')][_0x225218[_0x9927('0xef')]][_0x9927('0xba')]]=[];}this[_0x9927('0x2a')][this[_0x9927('0xec')][_0x225218[_0x9927('0xef')]]['queue']][_0x9927('0x93')](_['merge'](_[_0x9927('0x76')](this[_0x9927('0xec')][_0x225218['actionid']],[_0x9927('0xf7'),_0x9927('0xf5')]),{'status':_0x225218[_0x9927('0x85')],'paused':_0x225218[_0x9927('0xf4')]}));}}}};Dialer[_0x9927('0x1a')][_0x9927('0x3c')]=function(_0x3a0c87){if(!this['actions'][_0x3a0c87[_0x9927('0xef')]]){return;}var _0x3730ad=this;var _0xe83222=this['voiceQueues'][this[_0x9927('0xec')][_0x3a0c87[_0x9927('0xef')]]['queue']];var _0x23bb81=_0xe83222[_0x9927('0xf0')]||_0x9927('0xf1');if(_0x23bb81===_0x9927('0xf2')){if(this[_0x9927('0xec')][_0x3a0c87[_0x9927('0xef')]]&&this['actions'][_0x3a0c87['actionid']][_0x9927('0xf5')]){this[_0x9927('0x1f')][_0x9927('0xf8')](this[_0x9927('0xec')][_0x3a0c87[_0x9927('0xef')]][_0x9927('0xf7')],this[_0x9927('0xec')][_0x3a0c87[_0x9927('0xef')]]['stateinterface'])[_0x9927('0x9b')](function(_0x2bb8c3){logger['error']('[Catch][Preview][syncQueueStatusComplete]',util[_0x9927('0x47')](_0x2bb8c3,{'showHidden':![],'depth':null}));})['finally'](function(){utils[_0x9927('0xbd')](_0x3730ad[_0x9927('0x20')][_0x3730ad[_0x9927('0xec')][_0x3a0c87[_0x9927('0xef')]][_0x9927('0xba')]],_0x9927('0xf9'));_0x3730ad[_0x9927('0x22')][_0x3730ad['actions'][_0x3a0c87[_0x9927('0xef')]][_0x9927('0xf5')]]['locked']=![];delete _0x3730ad[_0x9927('0xec')][_0x3a0c87[_0x9927('0xef')]];unlockQueueStatus(_0xe83222);});}else{utils[_0x9927('0xbd')](this[_0x9927('0x20')][this['actions'][_0x3a0c87[_0x9927('0xef')]]['queue']],'[syncQueueStatusComplete]');hopperUtils[_0x9927('0xe9')]({'active':![],'ContactId':this[_0x9927('0xec')][_0x3a0c87['actionid']][_0x9927('0xdc')],'ListId':this[_0x9927('0xec')][_0x3a0c87[_0x9927('0xef')]][_0x9927('0xdd')],'VoiceQueueId':this[_0x9927('0xec')][_0x3a0c87[_0x9927('0xef')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x9927('0xec')][_0x3a0c87[_0x9927('0xef')]]['CampaignId']||undefined})[_0x9927('0x9b')](loggerCatch(_0x9927('0xfa')));delete this[_0x9927('0xec')][_0x3a0c87[_0x9927('0xef')]];unlockQueueStatus(_0xe83222);}}else if(_0x23bb81==='rrmemory'){var _0x54f735;if(this[_0x9927('0xec')][_0x3a0c87[_0x9927('0xef')]]&&!_[_0x9927('0x7b')](this[_0x9927('0x2a')][this[_0x9927('0xec')][_0x3a0c87[_0x9927('0xef')]][_0x9927('0xba')]])){if(this[_0x9927('0xfb')][_0x3730ad[_0x9927('0xec')][_0x3a0c87['actionid']]['queue']]){this[_0x9927('0xfb')][_0x3730ad[_0x9927('0xec')][_0x3a0c87[_0x9927('0xef')]][_0x9927('0xba')]]=this[_0x9927('0xfb')][this['actions'][_0x3a0c87[_0x9927('0xef')]][_0x9927('0xba')]]?this[_0x9927('0xfb')][this['actions'][_0x3a0c87[_0x9927('0xef')]][_0x9927('0xba')]]:this['queueBooked'][this[_0x9927('0xec')][_0x3a0c87[_0x9927('0xef')]][_0x9927('0xba')]]?this[_0x9927('0x2a')][this[_0x9927('0xec')][_0x3a0c87[_0x9927('0xef')]][_0x9927('0xba')]][_0x9927('0xfc')]||0x0:0x0;}this[_0x9927('0x2a')][this[_0x9927('0xec')][_0x3a0c87[_0x9927('0xef')]][_0x9927('0xba')]]['_rr']=this[_0x9927('0xfb')][this['actions'][_0x3a0c87[_0x9927('0xef')]][_0x9927('0xba')]];for(var _0x51199a=0x0;_0x51199a<this[_0x9927('0x2a')][this[_0x9927('0xec')][_0x3a0c87[_0x9927('0xef')]]['queue']]['length'];_0x51199a+=0x1){_0x54f735=rr(this[_0x9927('0x2a')][this[_0x9927('0xec')][_0x3a0c87[_0x9927('0xef')]][_0x9927('0xba')]]);this[_0x9927('0xfb')][_0x3730ad['actions'][_0x3a0c87[_0x9927('0xef')]]['queue']]=this['queueBooked'][this[_0x9927('0xec')][_0x3a0c87[_0x9927('0xef')]][_0x9927('0xba')]][_0x9927('0xfc')];if(_0x54f735['status']==='1'&&_0x54f735['paused']==='0'){break;}}if(!_[_0x9927('0xf3')](_0x54f735)){this[_0x9927('0x22')][_0x54f735['stateinterface']][_0x9927('0xfd')]=_[_0x9927('0x41')](this['agents'][_0x54f735[_0x9927('0xf5')]][_0x9927('0xfd')])?!![]:this[_0x9927('0x22')][_0x54f735[_0x9927('0xf5')]]['unlockRR'];}loggerBooked[_0x9927('0x4b')]('[booked][RR]',_0x3a0c87[_0x9927('0xef')],_0x9927('0xfe'),JSON[_0x9927('0x81')](_[_0x9927('0x76')](this['agents'][_0x54f735[_0x9927('0xf5')]],[_0x9927('0x63'),_0x9927('0xfd')])),_0x9927('0xff'),JSON[_0x9927('0x81')](_0x54f735[_0x9927('0xf7')]));if(!_[_0x9927('0xf3')](_0x54f735)&&_0x54f735[_0x9927('0x85')]==='1'&&_0x54f735[_0x9927('0xf4')]==='0'&&this['agents'][_0x54f735[_0x9927('0xf5')]][_0x9927('0xfd')]){this[_0x9927('0x22')][_0x54f735[_0x9927('0xf5')]]['unlockRR']=![];this['queueBooked'][_0x3730ad[_0x9927('0xec')][_0x3a0c87[_0x9927('0xef')]][_0x9927('0xba')]]=[];this[_0x9927('0x1f')]['run'](_0x54f735['idHopper'],_0x54f735[_0x9927('0xf5')])[_0x9927('0x9b')](function(_0x2113c8){logger['error'](_0x9927('0x100'),util[_0x9927('0x47')](_0x2113c8,{'showHidden':![],'depth':null}));})[_0x9927('0x1d')](function(){utils[_0x9927('0xbd')](_0x3730ad[_0x9927('0x20')][_0x3730ad['actions'][_0x3a0c87[_0x9927('0xef')]][_0x9927('0xba')]],'[syncQueueStatusComplete]');setTimeout(function(){_0x3730ad[_0x9927('0x22')][_0x54f735[_0x9927('0xf5')]][_0x9927('0xfd')]=!![];loggerBooked['info'](_0x9927('0x101'),_0x3a0c87[_0x9927('0xef')],_0x9927('0xfe'),JSON[_0x9927('0x81')](_['pick'](_0x3730ad[_0x9927('0x22')][_0x54f735[_0x9927('0xf5')]],[_0x9927('0x63'),'unlockRR'])),_0x9927('0xff'),JSON['stringify'](_0x54f735[_0x9927('0xf7')]));},0xc7);delete _0x3730ad[_0x9927('0xec')][_0x3a0c87[_0x9927('0xef')]];unlockQueueStatus(_0xe83222,_0x3a0c87[_0x9927('0xef')]);});}else{loggerBooked[_0x9927('0x4b')]('[booked][unlock]');utils[_0x9927('0xbd')](this[_0x9927('0x20')][this[_0x9927('0xec')][_0x3a0c87['actionid']]['queue']],_0x9927('0xf9'));hopperUtils['rescheduleContact']({'active':![],'ContactId':this[_0x9927('0xec')][_0x3a0c87[_0x9927('0xef')]][_0x9927('0xdc')],'ListId':this[_0x9927('0xec')][_0x3a0c87[_0x9927('0xef')]][_0x9927('0xdd')],'VoiceQueueId':this[_0x9927('0xec')][_0x3a0c87[_0x9927('0xef')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x9927('0xec')][_0x3a0c87[_0x9927('0xef')]]['CampaignId']||undefined})[_0x9927('0x9b')](loggerCatch(_0x9927('0xfa')));delete this[_0x9927('0xec')][_0x3a0c87[_0x9927('0xef')]];unlockQueueStatus(_0xe83222);}}else{loggerBooked[_0x9927('0x4b')](_0x9927('0x102'));utils['decrementOriginate'](this[_0x9927('0x20')][this['actions'][_0x3a0c87[_0x9927('0xef')]][_0x9927('0xba')]],'[syncQueueStatusComplete]');hopperUtils['rescheduleContact']({'active':![],'ContactId':this['actions'][_0x3a0c87[_0x9927('0xef')]]['ContactId'],'ListId':this[_0x9927('0xec')][_0x3a0c87['actionid']][_0x9927('0xdd')],'VoiceQueueId':this[_0x9927('0xec')][_0x3a0c87[_0x9927('0xef')]][_0x9927('0xde')]||undefined,'CampaignId':this[_0x9927('0xec')][_0x3a0c87[_0x9927('0xef')]][_0x9927('0xdf')]||undefined})[_0x9927('0x9b')](loggerCatch(_0x9927('0x103')));delete this[_0x9927('0xec')][_0x3a0c87['actionid']];unlockQueueStatus(_0xe83222);}}else{loggerBooked['info']('[booked][unlock3]');utils[_0x9927('0xbd')](this[_0x9927('0x20')][this[_0x9927('0xec')][_0x3a0c87[_0x9927('0xef')]]['queue']],_0x9927('0xf9'));hopperUtils[_0x9927('0xe9')]({'active':![],'ContactId':this['actions'][_0x3a0c87['actionid']][_0x9927('0xdc')],'ListId':this[_0x9927('0xec')][_0x3a0c87[_0x9927('0xef')]][_0x9927('0xdd')],'VoiceQueueId':this[_0x9927('0xec')][_0x3a0c87[_0x9927('0xef')]][_0x9927('0xde')]||undefined,'CampaignId':this['actions'][_0x3a0c87['actionid']][_0x9927('0xdf')]||undefined})[_0x9927('0x9b')](loggerCatch(_0x9927('0x104')));delete this[_0x9927('0xec')][_0x3a0c87['actionid']];unlockQueueStatus(_0xe83222);}};Dialer[_0x9927('0x1a')]['syncOriginateResponse']=function(_0x5b4dac){var _0x569e57=this[_0x9927('0xec')][_0x5b4dac['actionid']];if(_0x569e57){delete this[_0x9927('0xec')][_0x5b4dac['actionid']];_0x569e57[_0x9927('0xcb')]=moment()['format'](_0x9927('0xbf'));var _0x17e737=_0x569e57[_0x9927('0x43')]===_0x9927('0xbc')?this[_0x9927('0x21')][_0x569e57['queue']]:this['voiceQueues'][_0x569e57[_0x9927('0x105')]()];if(_0x5b4dac['response']!==_0x9927('0x106')){utils[_0x9927('0xbd')](_0x17e737,'[syncOriginateResponse]');return this['callProgressDetecting'](_0x569e57,_0x17e737,_0x5b4dac)[_0x9927('0x9b')](loggerCatch(_0x9927('0x107')));}this[_0x9927('0x27')][_0x5b4dac[_0x9927('0xbb')]]=_0x569e57;}};Dialer[_0x9927('0x1a')][_0x9927('0x3a')]=function(_0x382882){var _0x136b35=this;var _0x28481b=this['uniqueId'][_0x382882[_0x9927('0xbb')]];var _0x388793;if(!_[_0x9927('0xf3')](_0x382882)&&!_[_0x9927('0xf3')](_0x382882[_0x9927('0x108')])&&!_[_0x9927('0xf3')](_0x382882['variable']['amdstatus'])&&_0x382882['exten']==='xcally-motion-dialer'&&_0x28481b){if(_0x28481b[_0x9927('0x43')]!==_0x9927('0xbc')&&this['voiceQueues'][_0x28481b[_0x9927('0xba')]][_0x9927('0x109')]&&_0x382882[_0x9927('0x10a')]===_0x9927('0x10b')){delete this[_0x9927('0x27')][_0x382882['uniqueid']];utils['decrementOriginate'](this[_0x9927('0x20')][_0x28481b[_0x9927('0xba')]],_0x9927('0x10c'));this[_0x9927('0x20')][_0x28481b['queue']]['outboundAnswerCallsDay']+=0x1;this[_0x9927('0x20')][_0x28481b[_0x9927('0xba')]]['outboundAnswerAgiCallsDay']+=0x1;_0x388793=new Hangup(_0x28481b,_0x382882);_0x388793[_0x9927('0x6f')]=0x12;_0x388793[_0x9927('0x70')]=_0x9927('0x10d');_0x388793[_0x9927('0x10e')]=_0x9927('0x10f');ami[_0x9927('0x42')]('custom:amd',ut[_0x9927('0x110')](_0x388793,_0x9927('0x111')));this[_0x9927('0x112')](_0x388793,_0x9927('0x113'),_0x9927('0x114'));}if(_0x28481b[_0x9927('0x43')]!==_0x9927('0xbc')&&this[_0x9927('0x20')][_0x28481b[_0x9927('0xba')]][_0x9927('0x109')]&&_0x382882[_0x9927('0x10a')]===_0x9927('0x115')){return new Promise(function(_0x182a14,_0x101f52){delete _0x136b35[_0x9927('0x27')][_0x382882['uniqueid']];utils[_0x9927('0xbd')](_0x136b35[_0x9927('0x20')][_0x28481b[_0x9927('0xba')]],'[syncVarSet]');_0x136b35[_0x9927('0x20')][_0x28481b[_0x9927('0xba')]]['outboundAnswerCallsDay']+=0x1;_0x136b35[_0x9927('0x20')][_0x28481b[_0x9927('0xba')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x1bcc60=_0x136b35[_0x9927('0x20')][_0x28481b[_0x9927('0xba')]];var _0x1755bc=new Hangup(_0x28481b,_0x382882);_0x1755bc[_0x9927('0x6f')]=0x13;_0x1755bc[_0x9927('0x70')]=_0x9927('0x116');_0x1755bc[_0x9927('0x10e')]=_0x9927('0x10f');_0x1755bc[_0x9927('0x117')]+=0x1;_0x1755bc[_0x9927('0xd3')]+=0x1;_0x1755bc[_0x9927('0x111')]=!![];ami[_0x9927('0x42')]('custom:amd',ut['buildObj'](_0x1755bc,_0x9927('0x111')));hopperUtils[_0x9927('0xc5')](_0x1755bc)[_0x9927('0x9b')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x1755bc[_0x9927('0x118')]+_0x1755bc[_0x9927('0x119')]+_0x1755bc[_0x9927('0x11a')]+_0x1755bc['countnosuchnumberretry']+_0x1755bc[_0x9927('0xd2')]+_0x1755bc['countabandonedretry']+_0x1755bc[_0x9927('0x117')]+_0x1755bc[_0x9927('0x11b')]>=_0x1bcc60['dialGlobalMaxRetry']){_0x136b35['stateGlobal'](_0x1755bc,_0x182a14,_0x101f52,'reason19\x20machine....');}else{if(_0x1755bc[_0x9927('0x117')]>=_0x1bcc60['dialMachineMaxRetry']){_0x136b35[_0x9927('0x11c')](_0x1755bc,_0x182a14,_0x101f52,_0x9927('0x11d'));}else{hopperUtils[_0x9927('0xe9')]({'active':![],'countmachineretry':_0x1755bc[_0x9927('0x117')],'scheduledat':moment()['add'](_0x1bcc60[_0x9927('0x11e')],_0x9927('0xdb'))[_0x9927('0x48')](_0x9927('0xbf')),'ContactId':_0x1755bc[_0x9927('0xdc')],'ListId':_0x1755bc['ListId'],'VoiceQueueId':_0x1755bc[_0x9927('0xde')]||undefined,'CampaignId':_0x1755bc['CampaignId']||undefined})[_0x9927('0x9b')](loggerCatch(_0x9927('0x11f')));_0x182a14({'reschedule':0x1});}}});}if(_0x28481b[_0x9927('0x43')]===_0x9927('0xbc')&&this['campaigns'][_0x28481b[_0x9927('0xba')]][_0x9927('0x109')]&&_0x382882['value']==='HANGUP'){delete this[_0x9927('0x27')][_0x382882[_0x9927('0xbb')]];utils[_0x9927('0xbd')](this[_0x9927('0x21')][_0x28481b[_0x9927('0xba')]],_0x9927('0x10c'));_0x388793=new Hangup(_0x28481b,_0x382882);_0x388793[_0x9927('0x6f')]=0x12;_0x388793['statedesc']=_0x9927('0x10d');_0x388793[_0x9927('0x10e')]=_0x9927('0x10f');ami[_0x9927('0x42')](_0x9927('0x120'),ut[_0x9927('0x110')](_0x388793,_0x9927('0x111')));this['saveInDb'](_0x388793,'[syncHangupInAMDIvr][createHistory]',_0x9927('0x121'));}if(_0x28481b[_0x9927('0x43')]===_0x9927('0xbc')&&this['campaigns'][_0x28481b['queue']][_0x9927('0x109')]&&_0x382882[_0x9927('0x10a')]==='MACHINE'){return new Promise(function(_0x5b2eaf,_0x4b689d){delete _0x136b35[_0x9927('0x27')][_0x382882[_0x9927('0xbb')]];utils['decrementOriginate'](_0x136b35['campaigns'][_0x28481b[_0x9927('0xba')]],'[syncVarSet]');_0x136b35[_0x9927('0x21')][_0x28481b[_0x9927('0xba')]][_0x9927('0xc0')]+=0x1;_0x136b35['campaigns'][_0x28481b[_0x9927('0xba')]][_0x9927('0x122')]+=0x1;var _0x4d442c=_0x136b35[_0x9927('0x21')][_0x28481b[_0x9927('0xba')]];var _0x3b3949=new Hangup(_0x28481b,_0x382882);_0x3b3949['state']=0x13;_0x3b3949[_0x9927('0x70')]=_0x9927('0x116');_0x3b3949[_0x9927('0x10e')]=_0x9927('0x10f');_0x3b3949[_0x9927('0x117')]+=0x1;_0x3b3949[_0x9927('0xd3')]+=0x1;_0x3b3949['amd']=!![];ami[_0x9927('0x42')](_0x9927('0x120'),ut[_0x9927('0x110')](_0x3b3949,_0x9927('0x111')));hopperUtils['createHistory'](_0x3b3949)[_0x9927('0x9b')](loggerCatch(_0x9927('0x123')));if(_0x3b3949[_0x9927('0x118')]+_0x3b3949[_0x9927('0x119')]+_0x3b3949['countnoanswerretry']+_0x3b3949[_0x9927('0x124')]+_0x3b3949[_0x9927('0xd2')]+_0x3b3949['countabandonedretry']+_0x3b3949[_0x9927('0x117')]+_0x3b3949[_0x9927('0x11b')]>=_0x4d442c['dialGlobalMaxRetry']){_0x136b35['stateGlobal'](_0x3b3949,_0x5b2eaf,_0x4b689d,_0x9927('0x125'));}else{if(_0x3b3949[_0x9927('0x117')]>=_0x4d442c[_0x9927('0x126')]){_0x136b35['createStateFinal'](_0x3b3949,_0x5b2eaf,_0x4b689d,_0x9927('0x11d'));}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x3b3949[_0x9927('0x117')],'scheduledat':moment()['add'](_0x4d442c['dialMachineRetryFrequency'],_0x9927('0xdb'))[_0x9927('0x48')](_0x9927('0xbf')),'ContactId':_0x3b3949[_0x9927('0xdc')],'ListId':_0x3b3949[_0x9927('0xdd')],'VoiceQueueId':_0x3b3949[_0x9927('0xde')]||undefined,'CampaignId':_0x3b3949[_0x9927('0xdf')]||undefined})[_0x9927('0x9b')](loggerCatch(_0x9927('0x11f')));_0x5b2eaf({'reschedule':0x1});}}});}}};Dialer[_0x9927('0x1a')][_0x9927('0x38')]=function(_0x14c4fa){var _0x5c9f5c=this[_0x9927('0x27')][_0x14c4fa[_0x9927('0xbb')]];var _0x4f4001;if(!_0x5c9f5c){return;}if(_0x5c9f5c[_0x9927('0x43')]===_0x9927('0xbc')){delete this['uniqueId'][_0x14c4fa[_0x9927('0xbb')]];utils[_0x9927('0xbd')](this['campaigns'][_0x5c9f5c[_0x9927('0xba')]],_0x9927('0x127'));this[_0x9927('0x21')][_0x5c9f5c['queue']][_0x9927('0x128')]+=0x1;if(_0x14c4fa[_0x9927('0x129')]===_0x9927('0x12a')){const _0x20e22c=new AgentComplete(_0x5c9f5c,_0x14c4fa);_0x20e22c[_0x9927('0xdf')]=this[_0x9927('0x21')][_0x5c9f5c[_0x9927('0xba')]]['id'];hopperUtils[_0x9927('0xc5')](_0x20e22c)[_0x9927('0x9b')](loggerCatch(_0x9927('0x12b')));hopperUtils['moveContactManagedDialer'](_0x20e22c)[_0x9927('0x9b')](loggerCatch('[syncAgentCompleteIvr]'));}else{_0x4f4001=new Hangup(_0x5c9f5c,_0x14c4fa);hopperUtils[_0x9927('0xc5')](_0x4f4001)[_0x9927('0x9b')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0x9927('0xc7')](_0x4f4001)['catch'](loggerCatch(_0x9927('0x12c')));}}else{if(isNotNull(this['voiceQueues'][_0x5c9f5c[_0x9927('0xba')]][_0x9927('0x12d')])){delete this['uniqueId'][_0x14c4fa[_0x9927('0xbb')]];utils[_0x9927('0xbd')](this['voiceQueues'][_0x5c9f5c['queue']],'[syncHangup]');this[_0x9927('0x20')][_0x5c9f5c[_0x9927('0xba')]]['outboundAnswerCallsDay']+=0x1;this[_0x9927('0x20')][_0x5c9f5c[_0x9927('0xba')]][_0x9927('0x122')]+=0x1;_0x4f4001=new Hangup(_0x5c9f5c,_0x14c4fa);_0x4f4001[_0x9927('0x6f')]=0x10;_0x4f4001[_0x9927('0x70')]='AnswerAGI';_0x4f4001['membername']='AGI';hopperUtils[_0x9927('0xc5')](_0x4f4001)[_0x9927('0x9b')](loggerCatch(_0x9927('0x12e')));hopperUtils[_0x9927('0xc7')](_0x4f4001)['catch'](loggerCatch('[syncHangupIvr]'));}else{delete this[_0x9927('0x27')][_0x14c4fa[_0x9927('0xbb')]];utils[_0x9927('0xbd')](this[_0x9927('0x20')][_0x5c9f5c[_0x9927('0xba')]],_0x9927('0x12f'));if(_0x14c4fa['cause-txt']===_0x9927('0x12a')){this[_0x9927('0x20')][_0x5c9f5c[_0x9927('0xba')]][_0x9927('0xc0')]+=0x1;const _0x435daf=new AgentComplete(_0x5c9f5c,_0x14c4fa);_0x435daf[_0x9927('0xde')]=this[_0x9927('0x20')][_0x5c9f5c[_0x9927('0xba')]]['id'];hopperUtils[_0x9927('0xc5')](_0x435daf)[_0x9927('0x9b')](loggerCatch(_0x9927('0xc6')));hopperUtils[_0x9927('0xc7')](_0x435daf)[_0x9927('0x9b')](loggerCatch('[syncAgentComplete]'));}else{this['voiceQueues'][_0x5c9f5c['queue']][_0x9927('0x130')]+=0x1;_0x4f4001=new Hangup(_0x5c9f5c,_0x14c4fa);_0x4f4001[_0x9927('0x6f')]=0xc;_0x4f4001['statedesc']=_0x14c4fa['cause-txt'];_0x4f4001[_0x9927('0x10e')]=_0x9927('0x131');hopperUtils[_0x9927('0xc5')](_0x4f4001)['catch'](loggerCatch(_0x9927('0x132')));hopperUtils['moveContactManagedDialer'](_0x4f4001)[_0x9927('0x9b')](loggerCatch(_0x9927('0x127')));}}}};Dialer[_0x9927('0x1a')]['syncQueueSummary']=function(_0x3cc54e){var _0x5162af=this;if(!_0x5162af[_0x9927('0x2b')][_0x3cc54e[_0x9927('0x63')]]){_0x5162af[_0x9927('0x2b')][_0x3cc54e['name']]={'running':![]};}else if(_0x5162af[_0x9927('0x2b')][_0x3cc54e['name']][_0x9927('0x133')]===!![]){return;}else if(_0x5162af['queuesSummary'][_0x3cc54e[_0x9927('0x63')]]['running']===![]){_0x5162af[_0x9927('0x2b')][_0x3cc54e[_0x9927('0x63')]]['running']=!![];}var _0x55ba03=_0x5162af['voiceQueues'][_0x3cc54e[_0x9927('0x63')]];var _0x15b4e3=_0x55ba03[_0x9927('0x6e')]!==utils[_0x9927('0x6a')][_0x9927('0x134')];var _0x4f8eaf=utils['isPreviewCampaign'](_0x55ba03);_0x55ba03[_0x9927('0x135')]=utils[_0x9927('0x136')](_0x55ba03,_0x5162af[_0x9927('0x23')]);Promise['resolve']()[_0x9927('0x40')](function(){if(_0x55ba03[_0x9927('0x135')]===utils[_0x9927('0x6a')][_0x9927('0x134')]){if(_0x15b4e3){clearPredictiveAttributes(_0x55ba03);_0x3cc54e[_0x9927('0x29')]=undefined;_0x3cc54e['startProgressive']=undefined;}if(_0x55ba03[_0x9927('0x135')]===utils[_0x9927('0x6a')][_0x9927('0x134')]){_0x3cc54e[_0x9927('0x137')]=0x0;_0x3cc54e[_0x9927('0xf4')]=0x0;_0x3cc54e['inUse']=0x0;_0x3cc54e[_0x9927('0x138')]=0x0;_0x3cc54e[_0x9927('0x139')]=0x0;}}else if(_0x55ba03['statusMessage']===utils[_0x9927('0x6a')][_0x9927('0x13a')]&&!_0x4f8eaf){return _0x5162af[_0x9927('0x8d')](_0x55ba03,!![])[_0x9927('0x40')](function(){return _0x5162af[_0x9927('0x8d')](_0x55ba03,![]);})[_0x9927('0x40')](function(){return _0x5162af[_0x9927('0xab')](_0x55ba03);})['catch'](function(_0x17179e){loggerSyncQueueSummary[_0x9927('0x45')]('[syncQueueSummary]',util[_0x9927('0x47')](_0x17179e,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x55ba03);});}else{clearPredictiveAttributes(_0x55ba03);}})[_0x9927('0x40')](function(){var _0x38f86f=_0x3cc54e[_0x9927('0x13b')](_0x55ba03);if(_0x38f86f||_0x55ba03[_0x9927('0x13c')]){_0x55ba03[_0x9927('0x13c')]=![];_0x3cc54e[_0x9927('0x13d')](_0x55ba03);Object[_0x9927('0x13e')](_0x55ba03,_0x3cc54e);emitOutboundVoiceQueueSummary(_0x3cc54e);}_0x5162af[_0x9927('0x2b')][_0x55ba03[_0x9927('0x63')]][_0x9927('0x133')]=![];})[_0x9927('0x9b')](function(_0xbdaa0a){logger[_0x9927('0x67')](_0x9927('0x13f'),util[_0x9927('0x47')](_0xbdaa0a,{'showHidden':![],'depth':null}));_0x5162af[_0x9927('0x2b')][_0x55ba03[_0x9927('0x63')]][_0x9927('0x133')]=![];});};Dialer[_0x9927('0x1a')]['syncQueueSummaryComplete']=_[_0x9927('0x140')](function(){var _0x5a087b=_[_0x9927('0x141')](this['voiceQueues'],function(_0x819b3e){return _0x819b3e[_0x9927('0x142')];});var _0x29daec=_[_0x9927('0x141')](this['agents'],function(_0x3e7b6d){return _0x3e7b6d[_0x9927('0x143')]&&_0x3e7b6d[_0x9927('0x85')]==='reachable';});if(_0x5a087b[_0x9927('0x92')]>0x0&&_0x29daec['length']>0x0){return Promise['resolve']()['then'](cmHopper[_0x9927('0x144')](_[_0x9927('0x145')](_0x5a087b,'id'),previewRecallmeReminderInterval,_[_0x9927('0x145')](_0x29daec,'id')))[_0x9927('0x40')](function(_0x1a6c6f){for(var _0x33f55f=0x0;_0x33f55f<_0x1a6c6f['length'];_0x33f55f++){var _0x11cbdb=_0x1a6c6f[_0x33f55f][_0x9927('0x146')][_0x9927('0x63')];if(_0x11cbdb)io['to'](util[_0x9927('0x48')]('user:%s',_0x11cbdb))[_0x9927('0x42')](_0x9927('0x147'),{'hopper':_0x1a6c6f[_0x33f55f]});}})[_0x9927('0x9b')](function(_0x3b03a4){logger[_0x9927('0x67')]('checkPreviewRecallReminder',_0x3b03a4);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x9927('0x1a')][_0x9927('0x3e')]=function(){var _0x1b5d7d=this;setInterval(function(){_0x1b5d7d[_0x9927('0x148')](_0x1b5d7d[_0x9927('0x27')],_0x9927('0x149'));_0x1b5d7d['clearZombieChannels'](_0x1b5d7d[_0x9927('0xec')],'[actions]');},0x32c8);};Dialer[_0x9927('0x1a')]['clearZombieChannels']=function(_0x2b128d,_0x1b2633){var _0x4e488c=this;for(var _0x1121dc in _0x2b128d){if(typeof _0x2b128d[_0x1121dc]!==_0x9927('0xa6')){this[_0x9927('0x1e')][_0x9927('0x1b')](function(){if(!_[_0x9927('0xf3')](_0x2b128d[_0x1121dc])){return ami[_0x9927('0x94')]({'action':_0x9927('0x85'),'channel':_0x2b128d[_0x1121dc]['channel']})[_0x9927('0x9b')](function(_0x12f60f){if(_0x12f60f[_0x9927('0x6e')]===_0x9927('0x14a')){setTimeout(function(){if(_0x2b128d[_0x1121dc]&&_0x2b128d[_0x1121dc][_0x9927('0x43')]!==_0x9927('0xbc')){utils[_0x9927('0xbd')](_0x4e488c[_0x9927('0x20')][_0x2b128d[_0x1121dc][_0x9927('0xba')]],_0x9927('0x14b'));logger[_0x9927('0x67')](_0x9927('0x14c'),_0x1b2633,_0x1121dc,_0x2b128d[_0x1121dc][_0x9927('0xba')]);delete _0x2b128d[_0x1121dc];}if(_0x2b128d[_0x1121dc]&&_0x2b128d[_0x1121dc][_0x9927('0x43')]==='ivr'){utils[_0x9927('0xbd')](_0x4e488c[_0x9927('0x21')][_0x2b128d[_0x1121dc][_0x9927('0xba')]],_0x9927('0x14b'));logger[_0x9927('0x67')](_0x9927('0x14d'),_0x1b2633,_0x1121dc,_0x2b128d[_0x1121dc][_0x9927('0xba')]);delete _0x2b128d[_0x1121dc];}},0x2328);}});}});}}};Dialer[_0x9927('0x1a')][_0x9927('0x14e')]=function(_0x44fbfe){return Promise[_0x9927('0xa8')]()[_0x9927('0x40')](voiceQueueRt[_0x9927('0x14e')](_0x44fbfe))[_0x9927('0x9b')](loggerCatch(_0x9927('0x14f')));};Dialer[_0x9927('0x1a')][_0x9927('0x150')]=function(_0x279dfd,_0x4e6818,_0x483f2d){var _0xa9c842={'state':0x19,'statedesc':'notFound'};utils[_0x9927('0xbd')](_0x4e6818,_0x9927('0x151')+_0x279dfd);this[_0x9927('0x112')](_[_0x9927('0x152')](_0xa9c842,_[_0x9927('0x76')](_0x483f2d,[_0x9927('0xdc'),_0x9927('0xdd'),'UserId',_0x9927('0xde'),_0x9927('0xdf')])),_0x9927('0x153'),_0x9927('0x151'));logger['error'](_0x279dfd);};Dialer[_0x9927('0x1a')]['saveInDb']=function(_0x1a71f0,_0x349c5f,_0x209c9c){hopperUtils[_0x9927('0xc5')](_0x1a71f0)[_0x9927('0x9b')](loggerCatch(_0x349c5f));hopperUtils[_0x9927('0xc7')](_0x1a71f0)[_0x9927('0x9b')](loggerCatch(_0x209c9c));};Dialer[_0x9927('0x1a')]['queueCallerAbandonCreateState']=function(_0x363c1c,_0x86cc9c){hopperUtils['createHistory'](_0x363c1c)[_0x9927('0x9b')](loggerCatch('[syncAgentComplete][createHistory]'));if(_0x86cc9c==0x0){hopperUtils[_0x9927('0xc7')](_0x363c1c)[_0x9927('0x9b')](loggerCatch(_0x9927('0x154')));}};Dialer[_0x9927('0x1a')][_0x9927('0x155')]=function(_0x12b5fc){return Promise[_0x9927('0xa8')]()[_0x9927('0x40')](cmHopper[_0x9927('0x144')](_0x12b5fc['id'],previewRecallmeReminderInterval))[_0x9927('0x40')](function(_0xa9c088){for(var _0x1f0f1e=0x0;_0x1f0f1e<_0xa9c088['length'];_0x1f0f1e++){var _0x3ef9c1=_0xa9c088[_0x1f0f1e]['Agent'][_0x9927('0x63')];if(_0x3ef9c1)io['to'](util['format']('user:%s',_0x3ef9c1))[_0x9927('0x42')](_0x9927('0x147'),{'hopper':_0xa9c088[_0x1f0f1e]});}})['catch'](function(){});};Dialer[_0x9927('0x1a')][_0x9927('0x156')]=function(_0xb23213){var _0x555643=this;return function(){_0x555643[_0x9927('0x157')](_0xb23213);};};Dialer[_0x9927('0x1a')]['actionOriginate']=function(_0x382ee6,_0x2037fa){var _0x361125=this;var _0x3c8a30=uuid['v4']();this[_0x9927('0xec')][_0x3c8a30]=new Action(_0x382ee6,_0x2037fa,_0x3c8a30);return new Promise(function(_0x321842,_0xa7dd8c){if(_['isUndefined'](_0x382ee6)&&typeof _0x382ee6!=='object'){return _0xa7dd8c(msgResponse(_0x9927('0x158'),_0x9927('0x8e'),_0x9927('0x159')));}if(_[_0x9927('0x41')](_0x2037fa[_0x9927('0x15a')])||_0x2037fa[_0x9927('0x15a')]===null){return _0xa7dd8c(msgResponse('originate',_0x9927('0x8e'),_0x9927('0x15b')));}var _0x336346={'XMD-CALLERID':_0x361125['actions'][_0x3c8a30][_0x9927('0x15c')](),'XMD-AGI':_0x382ee6[_0x9927('0x12d')]?util[_0x9927('0x48')](_0x9927('0x15d'),ipAgi,_0x382ee6[_0x9927('0x12d')]):'NONE','XMD-AGIAFTER':_0x382ee6[_0x9927('0xc3')]?util[_0x9927('0x48')]('\x22agi://%s/square,%s\x22',ipAgi,_0x382ee6[_0x9927('0xc3')]):'NONE','XMD-QUEUE':utils[_0x9927('0x15e')](_0x382ee6)?util[_0x9927('0x48')](_0x9927('0x15f'),_0x382ee6['name'],_0x382ee6[_0x9927('0x160')]||'',_0x382ee6[_0x9927('0xc4')]?'c':'',_0x382ee6[_0x9927('0xcc')]||0x3):'NONE','XMD-CONTACTID':_0x2037fa['ContactId'],'XMD-CDRTYPE':_0x9927('0x9'),'CALLERID(all)':_0x361125['actions'][_0x3c8a30]['getCaller'](),'XMD-AMD':_0x382ee6[_0x9927('0x109')]?_0x9927('0x13a'):_0x9927('0x161'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x382ee6[_0x9927('0x109')]){_0x336346[_0x9927('0x162')]=_0x382ee6['dialAMDInitialSilence']||0x9c4;_0x336346['XMD-AMDGREETING']=_0x382ee6['dialAMDGreeting']||0x5dc;_0x336346[_0x9927('0x163')]=_0x382ee6[_0x9927('0x164')]||0x320;_0x336346['XMD-AMDTOTALANALYSISTIME']=_0x382ee6[_0x9927('0x165')]||0x1388;_0x336346[_0x9927('0x166')]=_0x382ee6[_0x9927('0x167')]||0x64;_0x336346[_0x9927('0x168')]=_0x382ee6[_0x9927('0x169')]||0x32;_0x336346['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x382ee6[_0x9927('0x16a')]||0x3;_0x336346[_0x9927('0x16b')]=_0x382ee6['dialAMDSilenceThreshold']||0x100;_0x336346[_0x9927('0x16c')]=_0x382ee6[_0x9927('0x16d')]||0x1388;}if(utils[_0x9927('0x15e')](_0x382ee6)){_0x336346[_0x9927('0x16e')]=_0x2037fa[_0x9927('0xde')];}else{_0x336346[_0x9927('0x16f')]=_0x2037fa['CampaignId'];}var _0x1f76ff=utils[_0x9927('0x170')](_0x2037fa[_0x9927('0x171')]);Object['assign'](_0x336346,_0x1f76ff);var _0x123335=_0x361125[_0x9927('0x87')](_0x382ee6[_0x9927('0x172')])?utils[_0x9927('0x173')](_0x382ee6[_0x9927('0x172')][_0x9927('0x174')],_0x382ee6[_0x9927('0x175')],_0x382ee6[_0x9927('0x176')]>0x0?utils[_0x9927('0x177')](_0x382ee6['dialOriginateCallerIdNumber'],_0x382ee6['dialRandomLastDigitCallerIdNumber']):_0x382ee6[_0x9927('0x178')]):utils[_0x9927('0x173')](_[_0x9927('0xf3')](_0x382ee6[_0x9927('0x88')])?_0x382ee6[_0x9927('0x172')]['callerid']:_0x382ee6['TrunkBackup'][_0x9927('0x174')],_0x382ee6[_0x9927('0x175')],_0x382ee6[_0x9927('0x176')]>0x0?utils[_0x9927('0x177')](_0x382ee6[_0x9927('0x178')],_0x382ee6[_0x9927('0x176')]):_0x382ee6[_0x9927('0x178')]);if(_0x123335){_0x336346['XMD-ORIGINATECALLERIDNAME']=_0x361125[_0x9927('0xec')][_0x3c8a30][_0x9927('0x179')]=utils['extractCalleridName'](_0x123335);_0x336346[_0x9927('0x17a')]=_0x2037fa[_0x9927('0x15a')];}_0x382ee6[_0x9927('0x17b')]=_0x336346;return ami[_0x9927('0x94')]({'actionid':_0x3c8a30,'action':_0x9927('0x158'),'channel':_0x361125[_0x9927('0x87')](_0x382ee6['Trunk'])?util[_0x9927('0x48')](_0x9927('0x17c'),_0x382ee6[_0x9927('0x172')]['name'],isNotNull(_0x382ee6[_0x9927('0x17d')])?_0x382ee6[_0x9927('0x17d')][_0x9927('0x17e')]()||'':'',_0x382ee6[_0x9927('0x17f')]>0x0?_0x2037fa[_0x9927('0x15a')][_0x9927('0x180')](_0x382ee6[_0x9927('0x17f')]):_0x2037fa[_0x9927('0x15a')]):util[_0x9927('0x48')](_0x9927('0x17c'),_['isNil'](_0x382ee6[_0x9927('0x88')])?_0x382ee6['Trunk'][_0x9927('0x63')]:_0x382ee6[_0x9927('0x88')][_0x9927('0x63')],isNotNull(_0x382ee6['dialPrefix'])?_0x382ee6[_0x9927('0x17d')]['trim']()||'':'',_0x382ee6['dialCutDigit']>0x0?_0x2037fa[_0x9927('0x15a')][_0x9927('0x180')](_0x382ee6[_0x9927('0x17f')]):_0x2037fa[_0x9927('0x15a')]),'callerid':_0x123335,'Exten':_0x9927('0x181'),'Context':_0x9927('0x182'),'Priority':'1','variable':_0x336346,'timeout':(_0x382ee6[_0x9927('0x183')]||0x1e)*0x3e8,'async':!![],'channelid':_0x3c8a30})[_0x9927('0x40')](function(_0x2cf89e){return _0x321842(_0x2cf89e);})[_0x9927('0x9b')](function(_0x1550cf){_0x382ee6[_0x9927('0x184')]+=0x1;var _0x15c156=new History(_0x361125[_0x9927('0xec')][_0x3c8a30]);logger[_0x9927('0x67')](util[_0x9927('0x48')](_0x9927('0x185'),JSON['stringify'](_0x1550cf)));_0x15c156[_0x9927('0x6f')]=0xe;_0x15c156[_0x9927('0x70')]=_0x9927('0x186');_0x15c156[_0x9927('0x72')]=moment()[_0x9927('0x48')](_0x9927('0xbf'));_0x15c156[_0x9927('0x71')]=_0x15c156[_0x9927('0x72')];hopperUtils['createHistory'](_0x15c156)[_0x9927('0x9b')](loggerCatch('[originate][error]'));_0x361125[_0x9927('0xc7')](_0x15c156)[_0x9927('0x9b')](loggerCatch(_0x9927('0x187')))['finally'](function(){delete _0x361125[_0x9927('0xec')][_0x3c8a30];return _0xa7dd8c(msgResponse(_0x9927('0x158'),_0x9927('0x188'),_0x9927('0x189')));});});});};Dialer[_0x9927('0x1a')]['checkRetriveMax']=function(_0x57ef22,_0x5e34e8,_0x31e652){var _0x2a6ace=new History(_0x5e34e8);if(_0x2a6ace[_0x9927('0x118')]+_0x2a6ace['countcongestionretry']+_0x2a6ace['countnoanswerretry']+_0x2a6ace['countnosuchnumberretry']+_0x2a6ace[_0x9927('0xd2')]+_0x2a6ace[_0x9927('0xe7')]+_0x2a6ace[_0x9927('0x117')]+_0x2a6ace['countagentrejectretry']>=_0x31e652[_0x9927('0x18a')]-0x1){return!![];}switch(_0x57ef22){case 0x3:if(_0x2a6ace[_0x9927('0x11a')]>=_0x31e652[_0x9927('0x18b')]-0x1){return!![];}hopperUtils[_0x9927('0xe9')]({'active':![],'countnoanswerretry':_0x2a6ace[_0x9927('0x11a')]+=0x1,'scheduledat':moment()[_0x9927('0xda')](_0x31e652['dialNoAnswerRetryFrequency'],_0x9927('0xdb'))['format'](_0x9927('0xbf')),'ContactId':_0x2a6ace[_0x9927('0xdc')],'ListId':_0x2a6ace[_0x9927('0xdd')],'VoiceQueueId':_0x2a6ace[_0x9927('0xde')]||undefined,'CampaignId':_0x2a6ace['CampaignId']||undefined})[_0x9927('0x9b')](loggerCatch(_0x9927('0x18c')));break;case 0x5:if(_0x2a6ace[_0x9927('0x118')]>=_0x31e652[_0x9927('0x18d')]-0x1){return!![];}hopperUtils[_0x9927('0xe9')]({'active':![],'countbusyretry':_0x2a6ace[_0x9927('0x118')]+=0x1,'scheduledat':moment()[_0x9927('0xda')](_0x31e652[_0x9927('0x18e')],_0x9927('0xdb'))[_0x9927('0x48')](_0x9927('0xbf')),'ContactId':_0x2a6ace['ContactId'],'ListId':_0x2a6ace[_0x9927('0xdd')],'VoiceQueueId':_0x2a6ace[_0x9927('0xde')]||undefined,'CampaignId':_0x2a6ace['CampaignId']||undefined})[_0x9927('0x9b')](loggerCatch(_0x9927('0x18f')));break;case 0x8:if(_0x2a6ace[_0x9927('0x119')]>=_0x31e652[_0x9927('0x190')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countcongestionretry':_0x2a6ace[_0x9927('0x119')]+=0x1,'scheduledat':moment()[_0x9927('0xda')](_0x31e652['dialCongestionRetryFrequency'],_0x9927('0xdb'))[_0x9927('0x48')](_0x9927('0xbf')),'ContactId':_0x2a6ace[_0x9927('0xdc')],'ListId':_0x2a6ace['ListId'],'VoiceQueueId':_0x2a6ace[_0x9927('0xde')]||undefined,'CampaignId':_0x2a6ace[_0x9927('0xdf')]||undefined})[_0x9927('0x9b')](loggerCatch(_0x9927('0x191')));break;case 0x0:if(_0x2a6ace[_0x9927('0x124')]>=_0x31e652['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{hopperUtils[_0x9927('0xe9')]({'active':![],'countnosuchnumberretry':_0x2a6ace[_0x9927('0x124')]+=0x1,'scheduledat':moment()[_0x9927('0xda')](_0x31e652[_0x9927('0x192')],_0x9927('0xdb'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2a6ace[_0x9927('0xdc')],'ListId':_0x2a6ace['ListId'],'VoiceQueueId':_0x2a6ace[_0x9927('0xde')]||undefined,'CampaignId':_0x2a6ace[_0x9927('0xdf')]||undefined})[_0x9927('0x9b')](loggerCatch(_0x9927('0x193')));}break;case 0xa:if(_0x2a6ace[_0x9927('0xd2')]>=_0x31e652[_0x9927('0xd7')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x2a6ace['countdropretry']+=0x1,'scheduledat':moment()[_0x9927('0xda')](_0x31e652[_0x9927('0x194')],_0x9927('0xdb'))[_0x9927('0x48')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2a6ace['ContactId'],'ListId':_0x2a6ace[_0x9927('0xdd')],'VoiceQueueId':_0x2a6ace[_0x9927('0xde')]||undefined,'CampaignId':_0x2a6ace['CampaignId']||undefined})[_0x9927('0x9b')](loggerCatch(_0x9927('0xe0')));break;case 0xb:if(_0x2a6ace[_0x9927('0xe7')]>=_0x31e652[_0x9927('0xe8')]-0x1){return!![];}hopperUtils[_0x9927('0xe9')]({'active':![],'countabandonedretry':_0x2a6ace[_0x9927('0xe7')]+=0x1,'scheduledat':moment()[_0x9927('0xda')](_0x31e652[_0x9927('0x195')],_0x9927('0xdb'))[_0x9927('0x48')](_0x9927('0xbf')),'ContactId':_0x2a6ace[_0x9927('0xdc')],'ListId':_0x2a6ace['ListId'],'VoiceQueueId':_0x2a6ace[_0x9927('0xde')]||undefined,'CampaignId':_0x2a6ace[_0x9927('0xdf')]||undefined})['catch'](loggerCatch(_0x9927('0xea')));break;case 0x13:if(_0x2a6ace['countmachineretry']>=_0x31e652['dialMachineMaxRetry']-0x1){return!![];}hopperUtils[_0x9927('0xe9')]({'active':![],'countmachineretry':_0x2a6ace[_0x9927('0x117')]+=0x1,'scheduledat':moment()[_0x9927('0xda')](_0x31e652['dialMachineRetryFrequency'],_0x9927('0xdb'))[_0x9927('0x48')](_0x9927('0xbf')),'ContactId':_0x2a6ace[_0x9927('0xdc')],'ListId':_0x2a6ace[_0x9927('0xdd')],'VoiceQueueId':_0x2a6ace['VoiceQueueId']||undefined,'CampaignId':_0x2a6ace[_0x9927('0xdf')]||undefined})[_0x9927('0x9b')](loggerCatch(_0x9927('0x11f')));break;case 0x14:if(_0x2a6ace[_0x9927('0x11b')]>=_0x31e652[_0x9927('0x196')]-0x1){return!![];}hopperUtils[_0x9927('0xe9')]({'active':![],'countagentrejectretry':_0x2a6ace[_0x9927('0x11b')]+=0x1,'scheduledat':moment()[_0x9927('0xda')](_0x31e652[_0x9927('0x197')],_0x9927('0xdb'))['format'](_0x9927('0xbf')),'ContactId':_0x2a6ace[_0x9927('0xdc')],'ListId':_0x2a6ace[_0x9927('0xdd')],'VoiceQueueId':_0x2a6ace[_0x9927('0xde')]||undefined,'CampaignId':_0x2a6ace['CampaignId']||undefined})[_0x9927('0x9b')](loggerCatch(_0x9927('0x198')));break;default:return!![];}};Dialer[_0x9927('0x1a')][_0x9927('0x199')]=function(_0x3f9336,_0x1cac19,_0x2a1bda){var _0x25b2cc=this;var _0x5b55b7=new History(_0x3f9336);var _0xd00e85=![];var _0x2bf3bc;var _0x47faac;return new Promise(function(_0x188d2e,_0x1f015d){if(_[_0x9927('0x41')](_0x1cac19)&&typeof _0x1cac19!==_0x9927('0x19a')){return _0x1f015d(msgResponse(_0x9927('0x19b'),_0x9927('0x8e'),'entity\x20is\x20undefine'));}if(_['isUndefined'](_0x2a1bda)&&typeof _0x2a1bda!==_0x9927('0x19a')){return _0x1f015d(msgResponse(_0x9927('0x19b'),_0x9927('0x8e'),_0x9927('0x19c')));}hopperUtils['verifyAdditionalPhones'](_0x5b55b7,_0x2a1bda[_0x9927('0xc1')],_0x1cac19)[_0x9927('0x40')](function(_0x243a5d){if(_0x243a5d[_0x9927('0xd9')]==0x1)_0xd00e85=!![];switch(_0x2a1bda['reason']){case'0':_0x1cac19[_0x9927('0x19d')]+=0x1;_0x5b55b7['state']=0x0;_0x5b55b7['statedesc']=_0x9927('0x19e');_0x5b55b7[_0x9927('0x124')]+=0x1;_0x5b55b7[_0x9927('0xd3')]+=0x1;ami['emit']('custom:agentnosuchnumber',ut['buildObj'](_0x3f9336,_0x9927('0x19f')));_0x2bf3bc=_0x1cac19[_0x9927('0x192')];_0x47faac=_0x1cac19[_0x9927('0xd4')];hopperUtils[_0x9927('0xc5')](_0x5b55b7)[_0x9927('0x9b')](loggerCatch(_0x9927('0x123')));if(_0x25b2cc[_0x9927('0x1a0')](0x0,_0x3f9336,_0x1cac19)&&!_0xd00e85){if(_0x5b55b7[_0x9927('0x124')]>=_0x1cac19[_0x9927('0x1a1')]){_0x25b2cc[_0x9927('0x11c')](_0x5b55b7,_0x188d2e,_0x1f015d,_0x9927('0x1a2'));}else{_0x25b2cc[_0x9927('0x1a3')](_0x5b55b7,_0x188d2e,_0x1f015d,_0x9927('0x1a2'));}}break;case'3':_0x1cac19[_0x9927('0x1a4')]+=0x1;_0x5b55b7['state']=0x3;_0x5b55b7[_0x9927('0x70')]='NoAnswer';_0x5b55b7[_0x9927('0x11a')]+=0x1;_0x5b55b7[_0x9927('0xd3')]+=0x1;var _0x18bc0c=ut[_0x9927('0x1a5')](_0x3f9336,_0x1cac19);ami[_0x9927('0x42')](_0x9927('0x1a6'),_0x18bc0c);_0x2bf3bc=_0x1cac19[_0x9927('0x1a7')];_0x47faac=_0x1cac19[_0x9927('0xd4')];hopperUtils[_0x9927('0xc5')](_0x5b55b7)['catch'](loggerCatch(_0x9927('0x1a8')));if(_0x25b2cc['checkRetriveMax'](0x3,_0x3f9336,_0x1cac19)&&!_0xd00e85){if(_0x5b55b7[_0x9927('0x11a')]>=_0x1cac19['dialNoAnswerMaxRetry']){_0x25b2cc[_0x9927('0x11c')](_0x5b55b7,_0x188d2e,_0x1f015d,_0x9927('0x1a9'));}else{_0x25b2cc[_0x9927('0x1a3')](_0x5b55b7,_0x188d2e,_0x1f015d,_0x9927('0x1a9'));}}break;case'5':_0x1cac19[_0x9927('0x1aa')]+=0x1;_0x5b55b7['state']=0x5;_0x5b55b7['statedesc']=_0x9927('0x1ab');_0x5b55b7[_0x9927('0x118')]+=0x1;_0x5b55b7[_0x9927('0xd3')]+=0x1;ami[_0x9927('0x42')](_0x9927('0x1ac'),ut['buildObj'](_0x3f9336,_0x9927('0x1ad')));_0x2bf3bc=_0x1cac19[_0x9927('0x18e')];_0x47faac=_0x1cac19[_0x9927('0xd4')];hopperUtils[_0x9927('0xc5')](_0x5b55b7)[_0x9927('0x9b')](loggerCatch(_0x9927('0x1ae')));if(_0x25b2cc[_0x9927('0x1a0')](0x5,_0x3f9336,_0x1cac19)&&!_0xd00e85){if(_0x5b55b7[_0x9927('0x118')]>=_0x1cac19['dialBusyMaxRetry']){_0x25b2cc[_0x9927('0x11c')](_0x5b55b7,_0x188d2e,_0x1f015d,'reason\x205\x20busy');}else{_0x25b2cc['stateGlobal'](_0x5b55b7,_0x188d2e,_0x1f015d,'reason\x205\x20busy');}}break;case'8':_0x1cac19['outboundCongestionCallsDay']+=0x1;_0x5b55b7[_0x9927('0x6f')]=0x8;_0x5b55b7[_0x9927('0x70')]=_0x9927('0x1af');_0x5b55b7[_0x9927('0x119')]+=0x1;_0x5b55b7[_0x9927('0xd3')]+=0x1;_0x2bf3bc=_0x1cac19['dialCongestionRetryFrequency'];_0x47faac=_0x1cac19[_0x9927('0xd4')];ami['emit'](_0x9927('0x1b0'),ut['buildObj'](_0x3f9336,'congestion'));hopperUtils[_0x9927('0xc5')](_0x5b55b7)['catch'](loggerCatch(_0x9927('0x1b1')));if(_0x25b2cc['checkRetriveMax'](0x8,_0x3f9336,_0x1cac19)&&!_0xd00e85){if(_0x5b55b7[_0x9927('0x119')]>=_0x1cac19[_0x9927('0x190')]){_0x25b2cc[_0x9927('0x11c')](_0x5b55b7,_0x188d2e,_0x1f015d,_0x9927('0x1b2'));}else{_0x25b2cc[_0x9927('0x1a3')](_0x5b55b7,_0x188d2e,_0x1f015d,_0x9927('0x1b2'));}}break;case'11':_0x1cac19['outboundAbandonedCallsDay']+=0x1;_0x5b55b7['state']=0xb;_0x5b55b7[_0x9927('0x70')]=_0x9927('0xe6');_0x5b55b7[_0x9927('0xe7')]+=0x1;_0x5b55b7['countglobal']+=0x1;_0x2bf3bc=_0x1cac19[_0x9927('0x195')];_0x47faac=_0x1cac19[_0x9927('0xd4')];hopperUtils[_0x9927('0xc5')](_0x5b55b7)[_0x9927('0x9b')](loggerCatch(_0x9927('0xeb')));if(_0x25b2cc[_0x9927('0x1a0')](0xb,_0x3f9336,_0x1cac19)&&!_0xd00e85){if(_0x5b55b7[_0x9927('0xe7')]>=_0x1cac19['dialAbandonedMaxRetry']){_0x25b2cc[_0x9927('0x11c')](_0x5b55b7,_0x188d2e,_0x1f015d,_0x9927('0x1b3'));}else{_0x25b2cc[_0x9927('0x1a3')](_0x5b55b7,_0x188d2e,_0x1f015d,_0x9927('0x1b3'));}}break;case'20':_0x1cac19['outboundRejectCallsDay']+=0x1;_0x5b55b7[_0x9927('0x6f')]=0x14;_0x5b55b7[_0x9927('0x70')]=_0x9927('0x1b4');_0x5b55b7[_0x9927('0x11b')]+=0x1;_0x5b55b7['countglobal']+=0x1;_0x2bf3bc=_0x1cac19['dialAgentRejectRetryFrequency'];_0x47faac=_0x1cac19[_0x9927('0xd4')];ami[_0x9927('0x42')](_0x9927('0x1b5'),ut['buildObj'](_0x3f9336,_0x9927('0x1b6')));hopperUtils[_0x9927('0xc5')](_0x5b55b7)[_0x9927('0x9b')](loggerCatch(_0x9927('0x1b7')));if(_0x25b2cc[_0x9927('0x1a0')](0x14,_0x3f9336,_0x1cac19)&&!_0xd00e85){if(_0x5b55b7[_0x9927('0x11b')]>=_0x1cac19[_0x9927('0x196')]){_0x25b2cc['createStateFinal'](_0x5b55b7,_0x188d2e,_0x1f015d,'reason\x2020\x20agentreject');}else{_0x25b2cc[_0x9927('0x1a3')](_0x5b55b7,_0x188d2e,_0x1f015d,_0x9927('0x1b8'));}}break;default:_0x1cac19[_0x9927('0x130')]+=0x1;_0x5b55b7[_0x9927('0x6f')]=0xc;_0x5b55b7[_0x9927('0x70')]=_0x2a1bda[_0x9927('0xc1')];_0x2bf3bc=_0x1cac19['dialAgentRejectRetryFrequency'];_0x47faac=_0x1cac19[_0x9927('0xd4')];hopperUtils['createHistory'](_0x5b55b7)[_0x9927('0x9b')](loggerCatch(_0x9927('0x1b9')));if(_0x25b2cc[_0x9927('0x1a0')](_0x2a1bda[_0x9927('0xc1')],_0x3f9336,_0x1cac19)&&!_0xd00e85){if(_0x5b55b7['countbusyretry']+_0x5b55b7[_0x9927('0x119')]+_0x5b55b7[_0x9927('0x11a')]+_0x5b55b7[_0x9927('0x124')]+_0x5b55b7[_0x9927('0xd2')]+_0x5b55b7[_0x9927('0xe7')]+_0x5b55b7['countmachineretry']+_0x5b55b7[_0x9927('0x11b')]>=_0x1cac19[_0x9927('0x18a')]){_0x25b2cc[_0x9927('0x1a3')](_0x5b55b7,_0x188d2e,_0x1f015d,_0x2a1bda[_0x9927('0xc1')]);}else{_0x25b2cc[_0x9927('0x11c')](_0x5b55b7,_0x188d2e,_0x1f015d,_0x2a1bda[_0x9927('0xc1')]);}}}})[_0x9927('0x40')](function(){if(_0xd00e85){hopperUtils[_0x9927('0xe5')](_0x5b55b7,_0x2bf3bc,_0x47faac)[_0x9927('0x40')](function(){return _0x188d2e(0x1);});}});});};Dialer[_0x9927('0x1a')][_0x9927('0x1a3')]=function(_0x58446e,_0x5ed1ba,_0x3f3c5c,_0x2e2ae5){var _0x4c4854=new Final(_0x58446e);_0x4c4854[_0x9927('0x6f')]=0xf;_0x4c4854['statedesc']=_0x9927('0x1ba');this[_0x9927('0x11c')](_0x4c4854,_0x5ed1ba,_0x3f3c5c,_0x2e2ae5);};Dialer[_0x9927('0x1a')]['createStateFinal']=function(_0x209525,_0x305fb9,_0x2c6c2b,_0x49f668){hopperUtils[_0x9927('0xc7')](_0x209525)[_0x9927('0x40')](function(){return _0x305fb9(msgResponse(_0x9927('0x19b'),'Success',_0x49f668));})[_0x9927('0x9b')](function(){return _0x2c6c2b(msgResponse('[moveContactManagedDialer][0]','Failure',_0x9927('0x1bb')));});};Dialer[_0x9927('0x1a')][_0x9927('0xb')]=function(_0x107890){var _0x111219=_0x107890[_0x9927('0x1bc')]/0x64;var _0x53a004=_0x107890[_0x9927('0xcd')]/(_0x107890['outboundDropCallsDayTimeout']+_0x107890[_0x9927('0xc0')]);var _0x358c3c=Math[_0x9927('0x1bd')](_0x107890[_0x9927('0x1be')]*(_0x107890['predictiveIntervalMaxThreshold']/0x64));var _0x1e897d=Math['round'](_0x107890[_0x9927('0x1be')]*(_0x107890[_0x9927('0x1bf')]/0x64));var _0x2486d3=_0x107890[_0x9927('0x137')]+_0x107890[_0x9927('0x138')];var _0x317685=Math[_0x9927('0x1c0')](_0x107890[_0x9927('0x1c1')]*_0x107890[_0x9927('0x5e')]*_0x107890[_0x9927('0x1c2')]*_0x107890[_0x9927('0x1c3')]);if(_['isUndefined'](_0x107890['startProgressive'])){if(!_[_0x9927('0x41')](_0x107890[_0x9927('0x29')])){_0x107890[_0x9927('0x29')]=undefined;loggerPredictive['error']('[startMethodPredictive][StartProgressive]',_0x9927('0x1c4'));}if(!_[_0x9927('0x41')](_0x107890[_0x9927('0x66')])){loggerPredictive['error'](_0x9927('0x1c5'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x107890[_0x9927('0x66')]);_0x107890[_0x9927('0x66')]=undefined;}_0x107890['startProgressive']=moment()[_0x9927('0x48')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x107890[_0x9927('0x63')],_0x9927('0x1c6'),_0x107890['startProgressive']);this[_0x9927('0xad')](_0x107890,0x1);}else if(ifInterval(_0x107890['dialPredictiveInterval'],_0x107890[_0x9927('0x62')])){this['handlePower'](_0x107890,0x1);loggerPredictiveCalls['info'](_0x9927('0x1c7'),_0x107890[_0x9927('0x62')],_0x107890[_0x9927('0x63')]);_0x107890[_0x9927('0x1c1')]=0x0;_0x107890[_0x9927('0xce')]=0x0;}else if(_0x111219<_0x53a004&&_0x107890[_0x9927('0x1c8')]==='dropRate'){clearPredictiveAttributes(_0x107890);loggerPredictive[_0x9927('0x4b')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0x9927('0x1c9'),_0x53a004,_0x9927('0x62'),_0x107890[_0x9927('0x63')]);}else if(_0x317685<_0x107890[_0x9927('0xce')]&&_0x107890[_0x9927('0x1c8')]===_0x9927('0x1ca')){clearPredictiveAttributes(_0x107890);loggerPredictive[_0x9927('0x4b')](_0x9927('0x1cb'),'Max\x20Drop\x20',_0x317685,'Drop\x20in\x20this\x20interval',_0x107890[_0x9927('0xce')],_0x9927('0x62'),_0x107890[_0x9927('0x63')]);}else if(!ifInterval(_0x107890['dialPredictiveInterval'],_0x107890[_0x9927('0x62')])&&_[_0x9927('0x41')](_0x107890[_0x9927('0x29')])&&!_[_0x9927('0x41')](_0x107890[_0x9927('0x62')])){_0x107890[_0x9927('0x29')]=moment()[_0x9927('0x48')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x9927('0x4b')](_0x107890['name'],'started\x20in\x20predictive\x20at',_0x107890[_0x9927('0x29')]);hopperUtils[_0x9927('0x1cc')](_0x107890[_0x9927('0x1cd')])[_0x9927('0x40')](this[_0x9927('0x1ce')](_0x107890))[_0x9927('0x40')](mergeDataErlangB(_0x107890))[_0x9927('0x40')](this[_0x9927('0x1cf')](_0x107890))[_0x9927('0x9b')](loggerCatchPredictive(_0x9927('0x1d0'),_0x107890));}else if(!ifInterval(_0x107890['dialPredictiveInterval'],_0x107890['startPredictive'])){_0x107890[_0x9927('0xce')]=0x0;_0x107890[_0x9927('0x29')]=moment()[_0x9927('0x48')](_0x9927('0xbf'));loggerPredictive[_0x9927('0x4b')](_0x107890[_0x9927('0x63')],_0x9927('0x1d1'),_0x107890[_0x9927('0x29')]);clearInterval(_0x107890[_0x9927('0x66')]);_0x107890['handlePredictive']=undefined;hopperUtils[_0x9927('0x1cc')](_0x107890[_0x9927('0x1cd')])['then'](this[_0x9927('0x1ce')](_0x107890))[_0x9927('0x40')](mergeDataErlangB(_0x107890))[_0x9927('0x40')](this[_0x9927('0x1cf')](_0x107890))[_0x9927('0x9b')](loggerCatchPredictive(_0x9927('0x1d2'),_0x107890));}else if(_0x107890[_0x9927('0x1be')]&&_0x2486d3<_0x107890[_0x9927('0x1be')]-_0x1e897d){clearPredictiveAttributes(_0x107890);loggerPredictive[_0x9927('0x4b')](_0x107890[_0x9927('0x63')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x2486d3,_0x9927('0x1d3'),_0x107890['predictiveIntervalAvailable'],'-',_0x1e897d,'=',_0x107890[_0x9927('0x1be')]-_0x1e897d,')');}else if(_0x107890['predictiveIntervalAvailable']&&_0x2486d3>_0x107890[_0x9927('0x1be')]+_0x358c3c){clearPredictiveAttributes(_0x107890);loggerPredictive[_0x9927('0x4b')](_0x107890['name'],_0x9927('0x1d4'),_0x2486d3,_0x9927('0x1d5'),_0x107890[_0x9927('0x1be')],'+',_0x358c3c,'=',_0x107890[_0x9927('0x1be')]+_0x358c3c,')');}};Dialer['prototype'][_0x9927('0x1ce')]=function(_0x24e989){var _0x4acf66=this;return function(_0x1b75fc){return new Promise(function(_0x1af791,_0x5ca290){_[_0x9927('0x152')](_0x24e989,_0x1b75fc[0x0]);if(checkGetDataPredictive(_0x1b75fc[0x0])){var _0x1ce89f=_0x24e989[_0x9927('0x1be')]=_0x24e989[_0x9927('0x138')]+_0x24e989[_0x9927('0x137')];var _0x1838aa=_0x24e989[_0x9927('0x1cd')]*0x3c;var _0x1ce6d9=_0x1b75fc[0x0]['predictiveIntervalAvgTalktime']+_0x1b75fc[0x0][_0x9927('0x52')];var _0x2272f1=(_0x1b75fc[0x0][_0x9927('0x1d6')]+_0x1b75fc[0x0][_0x9927('0x4e')]+_0x1b75fc[0x0][_0x9927('0x50')])/_0x1b75fc[0x0][_0x9927('0x54')];_0x24e989['predictiveIntervalHitRate']=_0x2272f1>0x0?_0x2272f1:0x1;switch(_0x24e989[_0x9927('0x1c8')]){case _0x9927('0x1ca'):var _0xae3115=_0x24e989[_0x9927('0x1bc')]/0x64;return _0x4acf66[_0x9927('0x1d7')](_0x1ce89f,_0x1838aa,_0x1ce6d9,_0x2272f1,_0xae3115)[_0x9927('0x40')](function(_0x191ed8){return _0x1af791(_0x191ed8);});case _0x9927('0x1d8'):var _0x11cccf=_0x24e989[_0x9927('0x1bc')]/0x64;return _0x4acf66['busyFactor'](_0x1ce89f,_0x1838aa,_0x1ce6d9,_0x2272f1,_0x11cccf)[_0x9927('0x40')](function(_0x3492a5){return _0x1af791(_0x3492a5);});default:return _0x5ca290(msgResponse('[getDataPredictive]',_0x9927('0x8e'),_0x9927('0x1d9')));}}else{return _0x5ca290(msgResponse(_0x9927('0x1da'),_0x9927('0x8e'),'check\x20failure'));}});};};Dialer[_0x9927('0x1a')]['getDataPredictiveOld']=function(_0x4bb573){var _0x37322b=this;return function(_0x6041f3){return new Promise(function(_0x51fe11,_0x8c9ac){_['merge'](_0x4bb573,_0x6041f3[0x0]);if(checkGetDataPredictive(_0x6041f3[0x0])){loggerPredictive[_0x9927('0x4b')](JSON['stringify'](_0x6041f3[0x0]));if(_0x4bb573[_0x9927('0x1c8')]===_0x9927('0x1ca')){return _0x37322b[_0x9927('0x14e')](_0x4bb573['id'])[_0x9927('0x40')](function(_0x51db34){var _0x5a4cfc=_0x4bb573[_0x9927('0x1db')]-_0x51db34[0x0][_0x9927('0x1dc')];var _0x4602fb=_0x4bb573[_0x9927('0x1cd')]*0x3c;var _0x4ad51b=_0x6041f3[0x0][_0x9927('0x55')]+_0x6041f3[0x0][_0x9927('0x52')];var _0x1e457b=(_0x6041f3[0x0][_0x9927('0x1d6')]+_0x6041f3[0x0][_0x9927('0x4e')]+_0x6041f3[0x0][_0x9927('0x50')])/_0x6041f3[0x0][_0x9927('0x54')];var _0x5a70db=_0x4bb573[_0x9927('0x1bc')]/0x64;_0x4bb573['predictiveIntervalPauses']=_0x51db34[0x0]['outboundQueuePauses']||0x0;_0x4bb573[_0x9927('0x1c2')]=_0x1e457b>0x0?_0x1e457b:0x1;return _0x37322b[_0x9927('0x1d7')](_0x5a4cfc,_0x4602fb,_0x4ad51b,_0x1e457b,_0x5a70db);})[_0x9927('0x40')](function(_0x222787){return _0x51fe11(_0x222787);})[_0x9927('0x9b')](function(_0x548906){return _0x8c9ac(msgResponse('[CatchErlangB]',_0x9927('0x8e'),JSON[_0x9927('0x81')](_0x548906)));});}if(_0x4bb573['dialPredictiveOptimization']===_0x9927('0x1d8')){return _0x37322b[_0x9927('0x14e')](_0x4bb573['id'])['then'](function(_0x413c72){var _0x327d40=_0x4bb573[_0x9927('0x1db')]-_0x413c72[0x0]['outboundQueuePauses'];var _0x518f65=_0x4bb573[_0x9927('0x1cd')]*0x3c;var _0x1e61e7=_0x6041f3[0x0][_0x9927('0x55')]+_0x6041f3[0x0][_0x9927('0x52')];var _0x52c2ae=(_0x6041f3[0x0][_0x9927('0x1d6')]+_0x6041f3[0x0][_0x9927('0x4e')]+_0x6041f3[0x0][_0x9927('0x50')])/_0x6041f3[0x0][_0x9927('0x54')];var _0x5c6107=_0x4bb573['dialPredictiveOptimizationPercentage']/0x64;_0x4bb573['predictiveIntervalPauses']=_0x413c72[0x0][_0x9927('0x1dc')]||0x0;_0x4bb573['predictiveIntervalHitRate']=_0x52c2ae>0x0?_0x52c2ae:0x1;return _0x37322b['busyFactor'](_0x327d40,_0x518f65,_0x1e61e7,_0x52c2ae,_0x5c6107);})['then'](function(_0x25fa3c){return _0x51fe11(_0x25fa3c);})[_0x9927('0x9b')](function(_0x5a8873){return _0x8c9ac(msgResponse(_0x9927('0x1dd'),_0x9927('0x8e'),JSON[_0x9927('0x81')](_0x5a8873)));});}}else{return _0x8c9ac(msgResponse(_0x9927('0x1da'),'Failure','check\x20failure'));}});};};Dialer['prototype'][_0x9927('0x1cf')]=function(_0x114a99){var _0x1f837a=this;return function(){var _0x34a16=0x0;var _0x3ff731=Math['floor'](_0x114a99[_0x9927('0x1de')]*0x3e8);if(_0x3ff731>0x0){_0x3ff731=_0x3ff731<0x64?0x64:_0x3ff731;loggerPredictive['info'](_0x114a99[_0x9927('0x63')],_0x9927('0x1df'),_0x3ff731,_0x9927('0x1e0'));_0x114a99[_0x9927('0x66')]=setInterval(function(){_0x1f837a[_0x9927('0x66')](_0x114a99);loggerPredictiveCalls[_0x9927('0x4b')]('[handlePredictive]',_0x34a16+=0x1);},_0x3ff731);}else{loggerPredictive[_0x9927('0x4b')](_0x114a99[_0x9927('0x63')],_0x9927('0x1e1'));}};};Dialer[_0x9927('0x1a')]['checkContactBlack']=function(_0xedc773,_0x4e862c){var _0x532678=this;return function(_0x38cb77){if(_['isEmpty'](_0x38cb77)){if(_[_0x9927('0xf3')](_0x4e862c[_0x9927('0x1e2')])||!_0x4e862c[_0x9927('0x1e3')]){if(_0xedc773[_0x9927('0xac')]==='booked'){_0xedc773[_0x9927('0x74')]=_[_0x9927('0x41')](_0xedc773[_0x9927('0x74')])?!![]:_0xedc773['queueStatusComplete'];var _0x3946d3=uuid['v4']();_0x532678['actions'][_0x3946d3]=new Action(_0xedc773,_0x4e862c,_0x3946d3);loggerBooked[_0x9927('0x4b')](_0x9927('0x1e4'),_0x3946d3,_0x9927('0x1e5'),JSON[_0x9927('0x81')](_0xedc773['queueStatusComplete']),_0x9927('0x1e6'),_0xedc773[_0x9927('0x63')]);if(_0xedc773[_0x9927('0x74')]){_0xedc773[_0x9927('0x74')]=![];_0x532678[_0x9927('0x2a')][_0x532678[_0x9927('0xec')][_0x3946d3]['queue']]=[];ami[_0x9927('0x94')]({'actionid':_0x3946d3,'action':'queuestatus','queue':_0xedc773[_0x9927('0x63')]})[_0x9927('0x9b')](function(){utils['decrementOriginate'](_0xedc773,_0x9927('0x1e7'));hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x532678[_0x9927('0xec')][_0x3946d3][_0x9927('0xdc')],'ListId':_0x532678[_0x9927('0xec')][_0x3946d3]['ListId'],'VoiceQueueId':_0x532678['actions'][_0x3946d3][_0x9927('0xde')]||undefined,'CampaignId':_0x532678[_0x9927('0xec')][_0x3946d3][_0x9927('0xdf')]||undefined})[_0x9927('0x9b')](loggerCatch(_0x9927('0x1e8')));delete _0x532678[_0x9927('0xec')][_0x3946d3];});}else{loggerBooked[_0x9927('0x4b')]('[booked][checkContactBlack][else]',JSON[_0x9927('0x81')](_0xedc773['queueStatusComplete']),_0x9927('0x1e6'),_0xedc773[_0x9927('0x63')]);utils['decrementOriginate'](_0xedc773,'[checkContactBlack]');hopperUtils[_0x9927('0xe9')]({'active':![],'ContactId':_0x532678[_0x9927('0xec')][_0x3946d3][_0x9927('0xdc')],'ListId':_0x532678[_0x9927('0xec')][_0x3946d3]['ListId'],'VoiceQueueId':_0x532678[_0x9927('0xec')][_0x3946d3][_0x9927('0xde')]||undefined,'CampaignId':_0x532678[_0x9927('0xec')][_0x3946d3]['CampaignId']||undefined})[_0x9927('0x9b')](loggerCatch(_0x9927('0x1e8')));delete _0x532678[_0x9927('0xec')][_0x3946d3];}}else{return _0x532678[_0x9927('0x1e9')](_0xedc773,_0x4e862c);}}else{if(utils[_0x9927('0x61')](undefined,_0x4e862c[_0x9927('0x1ea')])<_0xedc773[_0x9927('0x1eb')]*0x3c){if(_0x4e862c['Agent']&&!_0x4e862c[_0x9927('0x146')]['voicePause']){_0x532678[_0x9927('0x1f')][_0x9927('0xf8')](_0x4e862c['id'])[_0x9927('0x1d')](function(){utils['decrementOriginate'](_0xedc773,_0x9927('0x1e7'));});}else{hopperUtils[_0x9927('0x1ec')]({'active':![]},_0x4e862c['id'],0x1)[_0x9927('0x1d')](function(){utils[_0x9927('0xbd')](_0xedc773,'[checkContactBlack]');});}}else{_0xedc773['outboundReCallsDay']+=0x1;utils[_0x9927('0xbd')](_0xedc773,'[checkContactBlack]');if(_0xedc773['dialRecallInQueue']){hopperUtils[_0x9927('0xe9')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x4e862c[_0x9927('0xdc')],'ListId':_0x4e862c[_0x9927('0xdd')],'VoiceQueueId':_0x4e862c[_0x9927('0xde')]||undefined,'CampaignId':_0x4e862c[_0x9927('0xdf')]||undefined})['catch'](loggerCatch(_0x9927('0x1ed')));hopperUtils['createHistory'](createObjHistory(_0xedc773,_0x4e862c,utils['CAMPAIGN_STATUS'][_0x9927('0x1ee')],0x17,_0x9927('0x1ef')))['catch'](loggerCatch(_0x9927('0x1f0')));}else{_0x532678['saveInDb'](createObjHistory(_0xedc773,_0x4e862c,utils[_0x9927('0x6a')][_0x9927('0x1f1')],0x16,'RecallFailedTimeout'),_0x9927('0x1f2'),_0x9927('0x1f3'));}}}}else{_0xedc773[_0x9927('0x1f4')]+=0x1;_0x532678[_0x9927('0x112')](createObjHistory(_0xedc773,_0x4e862c,utils[_0x9927('0x6a')][_0x9927('0x1f5')],0xd,'Blacklist'),_0x9927('0x1f6'),_0x9927('0x1f7'));throw _0x9927('0x1f8');}};};Dialer[_0x9927('0x1a')][_0x9927('0x157')]=function(_0x39bb71){var _0x5801d8=this;var _0x8ee7f6=_0x39bb71['limitCalls']-_0x39bb71[_0x9927('0x1f9')];emitCampaignSummary(_0x39bb71);if(_0x8ee7f6>0x0&&_0x39bb71['temp']==0x0){if(_0x8ee7f6>this[_0x9927('0x24')]){_0x8ee7f6=this[_0x9927('0x24')];}_0x39bb71[_0x9927('0x1fa')]=0x1;hopperUtils['getContactDialerIvr'](_0x39bb71,_0x8ee7f6)['then'](function(_0x1c4e18){_0x39bb71['temp']=0x0;if(_0x1c4e18){if(!utils[_0x9927('0x1fb')](_0x1c4e18)){_0x39bb71['message']=utils[_0x9927('0x6a')][_0x9927('0x1fc')];logger[_0x9927('0x4b')](_0x9927('0x1fd')+_0x39bb71['name']);}else{_0x39bb71[_0x9927('0x1f9')]+=_0x1c4e18[_0x9927('0x92')];_0x39bb71['message']=utils[_0x9927('0x6a')]['RUNNING'];for(var _0x27c366=0x0;_0x27c366<_0x1c4e18[_0x9927('0x92')];_0x27c366+=0x1){_0x39bb71['ivrTotalCallsDays']+=0x1;if(_[_0x9927('0xf3')](_0x1c4e18[_0x27c366])||_[_0x9927('0xf3')](_0x1c4e18[_0x27c366][_0x9927('0x171')])||_[_0x9927('0xf3')](_0x1c4e18[_0x27c366][_0x9927('0x15a')])){_0x5801d8[_0x9927('0x150')](_0x9927('0x1fe'),_0x39bb71,_0x1c4e18[_0x27c366]);}else{hopperUtils[_0x9927('0x1ff')](_[_0x9927('0x76')](_0x1c4e18[_0x27c366],[_0x9927('0xdf'),_0x9927('0x15a')]))[_0x9927('0x40')](_0x5801d8[_0x9927('0x200')](_0x39bb71,_0x1c4e18[_0x27c366]))['catch'](function(_0x2c0984){logger[_0x9927('0x67')](_0x9927('0x201'),_0x2c0984);utils['decrementOriginate'](_0x39bb71,_0x9927('0x202'));});}}}}})[_0x9927('0x9b')](function(_0x4f4a73){_0x39bb71[_0x9927('0x1fa')]=0x0;logger[_0x9927('0x67')](_0x9927('0x203'),_0x4f4a73);});}};Dialer[_0x9927('0x1a')][_0x9927('0xad')]=function(_0x1f421f,_0x7f5541){var _0x5b293d=this;var _0x352077=[];if(_0x7f5541<0x1||_0x1f421f[_0x9927('0xac')]===_0x9927('0xa')){_0x7f5541=0x1;}var _0xe1e87c=Math[_0x9927('0x1c0')](_0x1f421f[_0x9927('0x137')]*_0x7f5541)-_0x1f421f[_0x9927('0x1f9')];if(_0x1f421f['dialLimitQueue']>0x0){var _0x44eea=_0x1f421f[_0x9927('0x204')]-_0x1f421f['originated']-_0x1f421f[_0x9927('0x138')]-_0x1f421f[_0x9927('0x139')];if(_0xe1e87c>_0x44eea){_0xe1e87c=_0x44eea;}}if(_0xe1e87c>0x0&&_0x1f421f[_0x9927('0x1fa')]==0x0){if(_0x1f421f[_0x9927('0xac')]==='booked'){_0xe1e87c=0x1;}if(_0xe1e87c>this[_0x9927('0x24')]){_0xe1e87c=this[_0x9927('0x24')];}for(var _0x3b4a70 in this[_0x9927('0x22')]){if(typeof this[_0x9927('0x22')][_0x3b4a70]!==_0x9927('0xa6')){if(this['agents'][_0x3b4a70]['state']===_0x9927('0x205')&&this[_0x9927('0x22')][_0x3b4a70]['status']==='reachable'){_0x352077[_0x9927('0x93')](this[_0x9927('0x22')][_0x3b4a70]['id']);}}}_0x1f421f['temp']=0x1;hopperUtils[_0x9927('0x206')](_0x1f421f,_0x352077,_0xe1e87c)[_0x9927('0x40')](function(_0x353b45){_0x1f421f[_0x9927('0x1fa')]=0x0;if(_0x353b45){if(!utils[_0x9927('0x1fb')](_0x353b45)){hopperUtils[_0x9927('0x207')](_0x1f421f)['then'](sendMessageReschedule(_0x1f421f))[_0x9927('0x9b')](loggerCatch(_0x9927('0x208')));}else{_0x1f421f['originated']+=_0x353b45[_0x9927('0x92')];_0x1f421f[_0x9927('0x6e')]=_0x1f421f[_0x9927('0xac')]===_0x9927('0xa')?utils[_0x9927('0x6a')][_0x9927('0x13a')]:utils['CAMPAIGN_STATUS'][_0x9927('0x209')];for(var _0x5bb519=0x0;_0x5bb519<_0x353b45[_0x9927('0x92')];_0x5bb519+=0x1){if(_['isNil'](_0x353b45[_0x5bb519])||_[_0x9927('0xf3')](_0x353b45[_0x5bb519][_0x9927('0x171')])||_[_0x9927('0xf3')](_0x353b45[_0x5bb519]['phone'])){_0x5b293d['emptyContact'](_0x9927('0x1fe'),_0x1f421f,_0x353b45[_0x5bb519]);}else{hopperUtils[_0x9927('0x20a')](_[_0x9927('0x76')](_0x353b45[_0x5bb519],[_0x9927('0xde'),_0x9927('0x15a')]))['then'](_0x5b293d[_0x9927('0x200')](_0x1f421f,_0x353b45[_0x5bb519]))[_0x9927('0x9b')](function(_0x47bf02){logger['error'](_0x9927('0x20b'),_0x47bf02);utils[_0x9927('0xbd')](_0x1f421f,_0x9927('0x20c'));});}}}}})['catch'](function(_0x1ea189){_0x1f421f[_0x9927('0x1fa')]=0x0;logger['error']('[getContactCampaign2]',_0x1ea189);});}};Dialer[_0x9927('0x1a')][_0x9927('0x66')]=function(_0x523d1){if(_0x523d1['dialLimitQueue']>0x0){var _0x41f058=_0x523d1[_0x9927('0x204')]-_0x523d1['originated']-_0x523d1[_0x9927('0x138')];if(_0x41f058>0x0&&_0x523d1['temp']==0x0){this['tryOriginatePredictive'](_0x523d1);}else{loggerPredictiveCalls[_0x9927('0x4b')](_0x9927('0x20d'));}}else{this[_0x9927('0x20e')](_0x523d1);}};Dialer[_0x9927('0x1a')][_0x9927('0x20e')]=function(_0x333139){var _0x11fd59=this;var _0x23d7ee=[];_0x333139['originated']+=0x1;for(var _0x3a0062 in this['agents']){if(typeof this['agents'][_0x3a0062]!==_0x9927('0xa6')){if(this[_0x9927('0x22')][_0x3a0062][_0x9927('0x6f')]===_0x9927('0x205')&&this['agents'][_0x3a0062][_0x9927('0x85')]==='reachable'){_0x23d7ee[_0x9927('0x93')](this[_0x9927('0x22')][_0x3a0062]['id']);}}}_0x333139[_0x9927('0x1fa')]=0x1;return this['getContactDialer'](_0x333139['id'],_0x23d7ee,0x1,_0x333139[_0x9927('0x20f')],_0x333139)[_0x9927('0x40')](function(_0x4b2402){_0x333139[_0x9927('0x1fa')]=0x1;if(_0x4b2402){if(!utils[_0x9927('0x1fb')](_0x4b2402)){utils[_0x9927('0x210')](_0x333139,0x1,0x0);return hopperUtils[_0x9927('0x207')](_0x333139)[_0x9927('0x40')](sendMessageReschedule(_0x333139))[_0x9927('0x9b')](loggerCatch(_0x9927('0x208')));}else{_0x333139[_0x9927('0x6e')]=utils[_0x9927('0x6a')][_0x9927('0x209')];if(_[_0x9927('0xf3')](_0x4b2402[0x0])||_[_0x9927('0xf3')](_0x4b2402[0x0][_0x9927('0x171')])||_[_0x9927('0xf3')](_0x4b2402[0x0][_0x9927('0x15a')])){_0x11fd59[_0x9927('0x150')](_0x9927('0x1fe'),_0x333139,_0x4b2402[0x0]);}else{return hopperUtils[_0x9927('0x20a')](_[_0x9927('0x76')](_0x4b2402[0x0],[_0x9927('0xde'),_0x9927('0x15a')]))[_0x9927('0x40')](_0x11fd59[_0x9927('0x200')](_0x333139,_0x4b2402[0x0]))[_0x9927('0x9b')](function(_0x2f2b00){logger['error'](_0x9927('0x211'),_0x2f2b00);utils[_0x9927('0xbd')](_0x333139,_0x9927('0x211'));});}}}})[_0x9927('0x9b')](function(_0xc4e42f){_0x333139[_0x9927('0x1fa')]=0x0;logger[_0x9927('0x67')](_0x9927('0x203'),_0xc4e42f);});};Dialer[_0x9927('0x1a')][_0x9927('0x1d7')]=function(_0x517c2b,_0x30387e,_0xf51230,_0x599448,_0x59cdcd,_0x296678){loggerPredictive['info'](_0x9927('0x212'));loggerPredictive['info'](_0x9927('0x213'),_0x517c2b);loggerPredictive[_0x9927('0x4b')](_0x9927('0x214'),_0x30387e);loggerPredictive[_0x9927('0x4b')]('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',_0xf51230);loggerPredictive[_0x9927('0x4b')]('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',_0x599448);loggerPredictive['info'](_0x9927('0x215'),_0x59cdcd);loggerPredictive[_0x9927('0x4b')](_0x9927('0x216'));return new Promise(function(_0x2dec5f,_0x514402){if(_0x517c2b<=0x0||isNaN(_0x517c2b)){return _0x514402(msgResponse('[abandonmentRate]',_0x9927('0x188'),_0x9927('0x217')+_0x517c2b));}if(_0xf51230<=0x0||isNaN(_0xf51230)){return _0x514402(msgResponse(_0x9927('0x218'),_0x9927('0x188'),_0x9927('0x219')+_0xf51230));}if(_0x599448<=0x0||isNaN(_0x599448)){return _0x514402(msgResponse(_0x9927('0x218'),_0x9927('0x188'),_0x9927('0x21a')+_0x599448));}if(_0x30387e<=0x0||isNaN(_0x30387e)){return _0x514402(msgResponse(_0x9927('0x218'),_0x9927('0x188'),_0x9927('0x21b')+_0x30387e));}if(_0x59cdcd<=0x0||isNaN(_0x59cdcd)){return _0x514402(msgResponse(_0x9927('0x218'),_0x9927('0x188'),_0x9927('0x21c')+_0x59cdcd));}_0x296678=_0x296678||0x0;var _0x53a6cd=0x1/_0xf51230;var _0x18f486=0x0;var _0x53ad31=0x0;var _0x2b99a9=0x0;var _0x338154=0x0;for(var _0x41df5d=0x0;_0x2b99a9<_0x59cdcd;_0x41df5d+=0x1){_0x53ad31=_0x41df5d/_0x30387e;_0x18f486=(_0x599448*_0x53ad31+_0x296678)/_0x53a6cd;_0x2b99a9=utils[_0x9927('0x21d')](_0x18f486,_0x517c2b);_0x338154=_0x18f486/_0x517c2b*(0x1-utils[_0x9927('0x21d')](_0x18f486,_0x517c2b));}return _0x2dec5f({'erlangCalls':_0x41df5d,'erlangCallToSecond':_0x30387e/_0x41df5d,'erlangAbandonmentRate':_0x2b99a9,'erlangBusyFactor':_0x338154});});};Dialer['prototype'][_0x9927('0x21e')]=function(_0x5cdbb0,_0x42fc6a,_0x2f67f6,_0xb6b16,_0xae38ae,_0x2e7a5a){loggerPredictive[_0x9927('0x4b')](_0x9927('0x21f'));loggerPredictive[_0x9927('0x4b')]('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',_0x5cdbb0);loggerPredictive[_0x9927('0x4b')](_0x9927('0x214'),_0x42fc6a);loggerPredictive[_0x9927('0x4b')](_0x9927('0x220'),_0x2f67f6);loggerPredictive[_0x9927('0x4b')](_0x9927('0x221'),_0xb6b16);loggerPredictive['info'](_0x9927('0x222'),_0xae38ae);loggerPredictive[_0x9927('0x4b')](_0x9927('0x216'));return new Promise(function(_0x400508,_0x382601){if(_0x5cdbb0<=0x0||isNaN(_0x5cdbb0)){return _0x382601(msgResponse(_0x9927('0x223'),'Error','m\x20=\x20'+_0x5cdbb0));}if(_0x2f67f6<=0x0||isNaN(_0x2f67f6)){return _0x382601(msgResponse('[busyFactor]','Error',_0x9927('0x219')+_0x2f67f6));}if(_0xb6b16<=0x0||isNaN(_0xb6b16)){return _0x382601(msgResponse('[busyFactor]',_0x9927('0x188'),_0x9927('0x21a')+_0xb6b16));}if(_0x42fc6a<=0x0||isNaN(_0x42fc6a)){return _0x382601(msgResponse(_0x9927('0x223'),_0x9927('0x188'),'interval\x20=\x20'+_0x42fc6a));}if(_0xae38ae<=0x0||isNaN(_0xae38ae)){return _0x382601(msgResponse('[busyFactor]','Error',_0x9927('0x224')+_0xae38ae));}_0x2e7a5a=_0x2e7a5a||0x0;var _0x3069ec=0x1/_0x2f67f6;var _0x334475=0x0;var _0x2632f7=0x0;var _0x4d75d8=0x0;var _0x3ce819=0x0;for(var _0x5c8eaf=0x0;_0x3ce819<_0xae38ae;_0x5c8eaf+=0x1){_0x2632f7=_0x5c8eaf/_0x42fc6a;_0x334475=(_0xb6b16*_0x2632f7+_0x2e7a5a)/_0x3069ec;_0x4d75d8=utils[_0x9927('0x21d')](_0x334475,_0x5cdbb0);_0x3ce819=_0x334475/_0x5cdbb0*(0x1-utils[_0x9927('0x21d')](_0x334475,_0x5cdbb0));}return _0x400508({'erlangCalls':_0x5c8eaf,'erlangCallToSecond':_0x42fc6a/_0x5c8eaf,'erlangAbandonmentRate':_0x4d75d8,'erlangBusyFactor':_0x3ce819});});};module['exports']=Dialer;