Built motion from commit b0a9a629.|2.6.33
[motion2.git] / server / services / ami / dialer / index.js
index 54e4d86..ab2d4a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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;
\ No newline at end of file
+var _0x71a1=['[syncAgentCompleteIvr]','[syncHangupIvr]','AnswerAGI','AGI','[syncHangup2]','[syncAgentComplete][createHistory]','outboundUnknownCallsDay','Unknown','[syncHangup][createHistory]','running','isPreviewCampaign','statusMessage','getQueueCampaignStatusMessage','resolve','INACTIVE','startPredictive','available','talking','pTalking','ACTIVE','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','throttle','filter','online','handlePreviewRecallNotifications','map','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','clearZombieChannels','[uniqueid]','[actions]','[clearZombieChannels]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','emptyContact','notFound','[emptyContact]','UserId','[emptyContact][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','Agent','handleIvr','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','dialQueueProject','NONE','\x22agi://%s/square,%s\x22','isOutboundQueue','\x22%s,%s%s,,,%s\x22','dialQueueOptions','getCaller','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','dialOriginateCallerIdName','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','trim','dialCutDigit','substring','dialPrefix','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','checkRetriveMax','dialNoAnswerRetryFrequency','dialBusyMaxRetry','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','[rescheduleContact][Abandoned]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callProgressDetecting','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','outboundNoSuchCallsDay','nosuchnumber','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','busy','dialBusyRetryFrequency','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','congestion','[syncAgentComplete][createHistory][8]','outboundAbandonedCallsDay','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','reason\x2020\x20agentreject','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','round','predictiveIntervalMinThreshold','floor','erlangAbandonmentRate','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','dialPredictiveInterval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','avgHandleTime','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(','abandonmentRate','agentBusyFactor','[getDataPredictive]','Unknown\x20Predictive','getDataPredictiveOld','loggedIn','outboundQueuePauses','predictiveIntervalPauses','busyFactor','[CatchErlangB]','check\x20failure','[handlePredictive]','fail\x20to\x20scheduled\x20calls','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','[checkContactBlack]','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','unlockContact','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','temp','getContactDialerIvr','checkContactEmpty','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','checkIsBlackListIvr','checkContactBlack','[actionOriginateIvr]','[handleIvr]','[getContactCampaign2]','dialLimitQueue','not_inuse','getContactDialer','[countReScheduled]\x20','checkIsBlackList','[actionOriginate]','tryOriginatePredictive','[handlePredictive][limitChannel]','dialOrderByScheduledAt','checkContactLowerLimitOriginate','countReScheduled','[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','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','p\x20=\x20','interval\x20=\x20','erlangb','----\x20Agent\x20Busy\x20Factor\x20----','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Ts\x20=\x20','Umin\x20=\x20','util','lodash','uuid','moment','ioredis','./utils','./utils/hopper','../preview/util/util','dialer','../../../config/logger','booked','predictiveCalls','syncQueueSummary','../ami','redis','localhost','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/setting','../rpc/interval','./models/action','./models/history','./models/final','./models/agentComplete','./models/queueCallerAbandon','env','XCALLY_IP_AGI','127.0.0.1','prototype','enqueue','tail','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','optionPredictive','ivrOriginated','queueBooked','queueBookedRR','queuesSummary','agentconnect','syncAgentConnect','queuecallerabandon','bind','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncQueueSummaryComplete','hangup','newexten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','then','type','outbound','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','format','voice:queue:%s','name','voice_queue:save','isEmpty','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','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','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','---------------------------','predictiveIntervalTotalCalls','isUndefined','predictiveIntervalAvgTalktime','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','merge','getSeconds','startProgressive','debug','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','contactsRescheduled','message','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','CAMPAIGN_STATUS','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','statedesc','endtime','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','pick','Interval','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Intervals','isIVRCampaignActive','isIVRCampaign','originated','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','DISACTIVED','is\x20deactivated','[ifTime][Action]','Error','active','SIP/%s','status','reachable','unmonitored','checkIsTrunkReachable','isTrunkReachable','Trunk','TrunkBackup','ifTimeIvr','checkIfTimeIntervals','ifTime','Failure','EMPTY_INTERVAL','\x20Intervals\x20is\x20empty\x20','timezones','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','isArray','length','Action','iftime\x20%s,%s','interval','content','indexOf','true','catch','push','command','all','some','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','resetActiveCalls','syncCampaigns','undefined','checkIfTime','dialGlobalInterval','dialTimezone','launchHandleIvr','[syncCampaigns]','checkDialMethod','dialMethod','predictive','progressive','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','silly','Voice\x20Queue\x20%s\x20$s','intervalIftime','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','AMI\x20IfTime','queue','uniqueid','ivr','decrementOriginate','[syncAgentConnect]','uniqueId','answertime','outboundAnswerCallsDay','reason','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','createHistory','[syncAgentComplete]','syncQueueCallerAbandon','[syncQueueCallerAbandon]','droptime','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','TIMEOUT','countdropretry','countglobal','verifyAdditionalPhones','voiceQueue','additional','dialDropMaxRetry','queueCallerAbandonCreateState','add','dialDropRetryFrequency','minutes','ListId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','calleridname','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','predictiveIntervalDroppedCallsCallersExit','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','countabandonedretry','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','rescheduleContact','ContactId','calleridnum','channel','actionid','strategy','rrmemory','roundrobin','isNil','paused','stateinterface','locked','run','idHopper','finally','[syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[Catch][Preview][syncQueueStatusComplete]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','response','Success','[syncOriginateResponse]','[callProgressDetecting]\x20','variable','amdstatus','dialAMDActive','value','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','emit','buildObj','amd','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','Machine','countmachineretry','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countagentrejectretry','dialGlobalMaxRetry','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','custom:amd','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','stateGlobal','[rescheduleContact][Machine]','syncHangup','[syncHangup]','ivrAnswerCallsDay','cause-txt','Normal\x20Clearing','[syncAgentCompleteIvr][createHistory]','moveContactManagedDialer'];(function(_0x28fd0a,_0x3014c0){var _0x2f9ff6=function(_0xbe8e72){while(--_0xbe8e72){_0x28fd0a['push'](_0x28fd0a['shift']());}};_0x2f9ff6(++_0x3014c0);}(_0x71a1,0xfa));var _0x171a=function(_0x3cf49a,_0x54f14b){_0x3cf49a=_0x3cf49a-0x0;var _0x355fdd=_0x71a1[_0x3cf49a];return _0x355fdd;};'use strict';var util=require(_0x171a('0x0'));var _=require(_0x171a('0x1'));var uuid=require(_0x171a('0x2'));var moment=require(_0x171a('0x3'));var rr=require('rr');var Redis=require(_0x171a('0x4'));var utils=require(_0x171a('0x5'));var hopperUtils=require(_0x171a('0x6'));var ut=require(_0x171a('0x7'));var config=require('../../../config/environment/');var logger=require('../../../config/logger')(_0x171a('0x8'));var loggerBooked=require(_0x171a('0x9'))(_0x171a('0xa'));var loggerPredictive=require(_0x171a('0x9'))('predictive');var loggerPredictiveCalls=require('../../../config/logger')(_0x171a('0xb'));var loggerSyncQueueSummary=require(_0x171a('0x9'))(_0x171a('0xc'));var ami=require(_0x171a('0xd'));config[_0x171a('0xe')]=_['defaults'](config['redis'],{'host':_0x171a('0xf'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var cmHopper=require(_0x171a('0x10'));var voiceQueueRt=require(_0x171a('0x11'));var RpcSetting=require(_0x171a('0x12'));var Interval=require(_0x171a('0x13'));var Action=require(_0x171a('0x14'));var History=require(_0x171a('0x15'));var Final=require(_0x171a('0x16'));var AgentComplete=require(_0x171a('0x17'));var QueueCallerAbandon=require(_0x171a('0x18'));var Hangup=require('./models/hangup');var ipAgi=process[_0x171a('0x19')][_0x171a('0x1a')]||_0x171a('0x1b');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x171a('0x1c')][_0x171a('0x1d')]=function(_0xa589f5){this[_0x171a('0x1e')]=this['tail']?this['tail']['finally'](_0xa589f5):_0xa589f5();};function Dialer(_0x5784ee,_0x4b269f){this['sequence']=new Sequence();this[_0x171a('0x1f')]=_0x4b269f;this['voiceQueues']=_0x5784ee[_0x171a('0x20')];this[_0x171a('0x21')]=_0x5784ee[_0x171a('0x21')];this[_0x171a('0x22')]=_0x5784ee[_0x171a('0x22')];this[_0x171a('0x23')]=_0x5784ee[_0x171a('0x23')];this[_0x171a('0x24')]=config[_0x171a('0x24')]||0x2;this[_0x171a('0x25')]={};this[_0x171a('0x26')]={};this[_0x171a('0x27')]={};this['uniqueId']={};this[_0x171a('0x28')]={};this['startPredictive']={};this['startProgressive']={};this[_0x171a('0x29')]={};this[_0x171a('0x2a')]={};this[_0x171a('0x2b')]={};this[_0x171a('0x2c')]={};ami['on'](_0x171a('0x2d'),this[_0x171a('0x2e')]['bind'](this));ami['on'](_0x171a('0x2f'),this['syncQueueCallerAbandon'][_0x171a('0x30')](this));ami['on'](_0x171a('0x31'),this[_0x171a('0x32')][_0x171a('0x30')](this));ami['on'](_0x171a('0x33'),this[_0x171a('0x34')]['bind'](this));ami['on'](_0x171a('0x35'),this['syncQueueSummary'][_0x171a('0x30')](this));ami['on']('custom:queuesummarycomplete',this[_0x171a('0x36')][_0x171a('0x30')](this));ami['on'](_0x171a('0x37'),this['syncHangup']['bind'](this));ami['on'](_0x171a('0x38'),this['syncNewExten'][_0x171a('0x30')](this));ami['on'](_0x171a('0x39'),this[_0x171a('0x3a')]['bind'](this));ami['on'](_0x171a('0x3b'),this[_0x171a('0x3c')]['bind'](this));ami['on'](_0x171a('0x3d'),this[_0x171a('0x3e')]['bind'](this));this[_0x171a('0x3f')]();this[_0x171a('0x40')]();RpcSetting[_0x171a('0x41')]()[_0x171a('0x42')](function(_0x3226fd){previewRecallmeReminderInterval=_0x3226fd['previewRecallmeReminderInterval'];});}function isNotNull(_0x22deca){return _0x22deca!==null&&!_['isUndefined'](_0x22deca);}function msgResponse(_0x285964,_0x3c05d5,_0x4ec492){return{'action':_0x285964,'response':_0x3c05d5,'message':_0x4ec492,'stack':_0x4ec492};}function emit(_0x441522,_0x2f50bf,_0x4fd6ed){io['to'](_0x441522)['emit'](_0x2f50bf,_0x4fd6ed);}function emitOutboundVoiceQueueSummary(_0x937b45){if(_0x937b45[_0x171a('0x43')]===_0x171a('0x44')){logger['debug'](_0x171a('0x45'),util[_0x171a('0x46')](_0x937b45,{'showHidden':![],'depth':null}));emit(util[_0x171a('0x47')](_0x171a('0x48'),_0x937b45[_0x171a('0x49')]),_0x171a('0x4a'),_0x937b45);}}function checkGetDataPredictive(_0x3666c4){if(isNotNull(_0x3666c4)&&!_[_0x171a('0x4b')](_0x3666c4)){loggerPredictive[_0x171a('0x4c')](_0x171a('0x4d'));loggerPredictive[_0x171a('0x4c')](_0x171a('0x4e'),_0x3666c4['predictiveIntervalTotalCalls']);loggerPredictive[_0x171a('0x4c')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3666c4[_0x171a('0x4f')]);loggerPredictive[_0x171a('0x4c')](_0x171a('0x50'),_0x3666c4[_0x171a('0x51')]);loggerPredictive[_0x171a('0x4c')](_0x171a('0x52'),_0x3666c4['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x171a('0x4c')](_0x171a('0x53'),_0x3666c4[_0x171a('0x54')]);loggerPredictive[_0x171a('0x4c')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3666c4['predictiveIntervalAvgTalktime']);loggerPredictive[_0x171a('0x4c')](_0x171a('0x55'));if(_0x3666c4[_0x171a('0x56')]>0x0){if(!_[_0x171a('0x57')](_0x3666c4['predictiveIntervalAvgTalktime'])&&_0x3666c4[_0x171a('0x58')]>0x0){return!![];}loggerPredictive[_0x171a('0x4c')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_['isUndefined'](_0x3666c4['predictiveIntervalAvgHoldtime'])&&_0x3666c4[_0x171a('0x54')]>0x0){return!![];}loggerPredictive[_0x171a('0x4c')](_0x171a('0x59'));}else{loggerPredictive['info']('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0x171a('0x4c')](_0x171a('0x5a'));}return![];}function mergeDataErlangB(_0x2ffbe1){return function(_0x557924){loggerPredictive['info'](_0x171a('0x5b'));loggerPredictive[_0x171a('0x4c')](_0x171a('0x5c'),_0x557924[_0x171a('0x5d')]);loggerPredictive['info'](_0x171a('0x5e'),_0x557924[_0x171a('0x5f')]);loggerPredictive[_0x171a('0x4c')](_0x171a('0x60'),_0x557924['erlangAbandonmentRate']);loggerPredictive[_0x171a('0x4c')](_0x171a('0x61'),_0x557924[_0x171a('0x62')]);loggerPredictive[_0x171a('0x4c')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x557924['erlangAbandonmentRate']);loggerPredictive['info'](_0x171a('0x55'));_[_0x171a('0x63')](_0x2ffbe1,_0x557924);};}function ifInterval(_0x8e421d,_0x414f50){if(_[_0x171a('0x57')](_0x414f50)){return![];}return utils[_0x171a('0x64')](undefined,_0x414f50)<_0x8e421d*0x3c;}function clearPredictiveAttributes(_0xc070f4){if(_0xc070f4['startProgressive']){_0xc070f4[_0x171a('0x65')]=undefined;loggerPredictive[_0x171a('0x66')](_0xc070f4['name'],'startProgressive\x20value\x20cleared');}if(_0xc070f4['startPredictive']){_0xc070f4['startPredictive']=undefined;loggerPredictive['debug'](_0xc070f4[_0x171a('0x49')],'startPredictive\x20value\x20cleared');}if(_0xc070f4[_0x171a('0x67')]){clearInterval(_0xc070f4[_0x171a('0x67')]);_0xc070f4[_0x171a('0x67')]=undefined;loggerPredictive[_0x171a('0x66')](_0xc070f4[_0x171a('0x49')],_0x171a('0x68'));}}function loggerCatchPredictive(_0x512844,_0x298f5b){return function(_0x58737b){loggerPredictive[_0x171a('0x69')](_0x298f5b[_0x171a('0x49')],_0x512844);loggerPredictive[_0x171a('0x69')](_0x58737b[_0x171a('0x6a')]);clearPredictiveAttributes(_0x298f5b);};}function loggerCatch(_0x59df8e){return function(_0x5176a5){logger['error'](_0x59df8e,util[_0x171a('0x46')](_0x5176a5,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0xaa0ef7){return function(_0x397aab){if(isNotNull(_0x397aab)&&isNotNull(_0x397aab[0x0])){if(_0x397aab[0x0][_0x171a('0x6b')]>0x0){_0xaa0ef7[_0x171a('0x6c')]=utils['CAMPAIGN_STATUS'][_0x171a('0x6d')];logger[_0x171a('0x4c')](_0x171a('0x6e')+_0xaa0ef7[_0x171a('0x49')],_0x397aab[0x0][_0x171a('0x6b')],'contacts');}else{_0xaa0ef7['message']=utils[_0x171a('0x6f')][_0x171a('0x70')];logger['info'](_0x171a('0x71')+_0xaa0ef7['name']);}}};}function createObjHistory(_0x1133ab,_0x503ce7,_0x4cfd82,_0x887316,_0x5445e9){_0x1133ab['message']=_0x4cfd82;var _0x1ff1b4=new Action(_0x1133ab,_0x503ce7);var _0x5d16a8=new History(_0x1ff1b4);_0x5d16a8[_0x171a('0x72')]=_0x887316;_0x5d16a8[_0x171a('0x73')]=_0x5445e9;_0x5d16a8[_0x171a('0x74')]=_0x1ff1b4[_0x171a('0x75')];return _0x5d16a8;}function unlockQueueStatus(_0x470105,_0x5e99d4){setTimeout(function(){if(_['isUndefined'](_0x470105[_0x171a('0x76')])){loggerBooked[_0x171a('0x69')](_0x171a('0x77'),_0x5e99d4);}_0x470105[_0x171a('0x76')]=!![];loggerBooked[_0x171a('0x4c')](_0x171a('0x78'),_0x5e99d4,JSON[_0x171a('0x79')](_[_0x171a('0x7a')](_0x470105,['name','queueStatusComplete'])));},0x1f3);}function checkInterval(_0x1d588e){return function(){if(!isNotNull(_0x1d588e[_0x171a('0x7b')])){_0x1d588e[_0x171a('0x6c')]=utils[_0x171a('0x6f')][_0x171a('0x7c')];throw _0x1d588e[_0x171a('0x49')]+_0x171a('0x7d');}if(!isNotNull(_0x1d588e[_0x171a('0x7b')]['Intervals'])){_0x1d588e[_0x171a('0x6c')]=utils[_0x171a('0x6f')][_0x171a('0x7c')];throw _0x1d588e[_0x171a('0x49')]+_0x171a('0x7d');}if(!isNotNull(_[_0x171a('0x4b')](_0x1d588e[_0x171a('0x7b')][_0x171a('0x7e')]))){_0x1d588e[_0x171a('0x6c')]=utils[_0x171a('0x6f')]['NULL_INTERVAL'];throw _0x1d588e['name']+_0x171a('0x7d');}};}function checkIsIVRCampaignActive(_0x575f4c){return function(){if(!utils[_0x171a('0x7f')](_0x575f4c)){_0x575f4c[_0x171a('0x6c')]=utils['CAMPAIGN_STATUS']['INACTIVE'];throw _0x575f4c['name']+'\x20NOT\x20Active';}};}function emitCampaignSummary(_0x52e74e){if(utils[_0x171a('0x80')](_0x52e74e)){emit(util[_0x171a('0x47')]('campaign:ivr:%s',_0x52e74e[_0x171a('0x49')]),'campaign:save',_0x52e74e);}}function loggerCatchQueueSummary(_0x219edf,_0x3b0c32){return function(_0x623c1){clearPredictiveAttributes(_0x3b0c32);emitCampaignSummary(_0x3b0c32);loggerSyncQueueSummary['debug'](_0x219edf,util[_0x171a('0x46')](_0x623c1,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x27e76e){if(_0x27e76e['sendMessageOneNotActive']){if(_0x27e76e[_0x171a('0x81')]===0x0){_0x27e76e[_0x171a('0x82')]=![];_0x27e76e[_0x171a('0x6c')]=utils[_0x171a('0x6f')]['INACTIVE'];loggerSyncQueueSummary[_0x171a('0x66')](_0x171a('0x83'),_0x27e76e[_0x171a('0x49')],'is\x20not\x20active');}else{_0x27e76e[_0x171a('0x6c')]=utils[_0x171a('0x6f')][_0x171a('0x84')];loggerSyncQueueSummary[_0x171a('0x66')](_0x171a('0x83'),_0x27e76e[_0x171a('0x49')],_0x171a('0x85'));}emitCampaignSummary(_0x27e76e);}}function myreject(_0x218954){return function(_0x439912){return _0x218954(msgResponse(_0x171a('0x86'),_0x171a('0x87'),JSON[_0x171a('0x79')](_0x439912)));};}Dialer['prototype']['isTrunkReachable']=function(_0x5a1969){return!_[_0x171a('0x57')](_0x5a1969)&&_0x5a1969&&!_[_0x171a('0x57')](_0x5a1969['name'])&&!_[_0x171a('0x57')](_0x5a1969[_0x171a('0x88')])&&_0x5a1969['active']&&(this[_0x171a('0x23')][util[_0x171a('0x47')](_0x171a('0x89'),_0x5a1969[_0x171a('0x49')])][_0x171a('0x8a')]===_0x171a('0x8b')||this['trunks'][util[_0x171a('0x47')](_0x171a('0x89'),_0x5a1969[_0x171a('0x49')])][_0x171a('0x8a')]===_0x171a('0x8c'));};Dialer[_0x171a('0x1c')][_0x171a('0x8d')]=function(_0x31a888){var _0x22f70e=this;return function(){if(!_0x22f70e[_0x171a('0x8e')](_0x31a888[_0x171a('0x8f')])){if(!_0x22f70e['isTrunkReachable'](_0x31a888[_0x171a('0x90')])){_0x31a888[_0x171a('0x6c')]=utils[_0x171a('0x6f')]['TRUNK_NOT_REACHABLE'];throw _0x31a888[_0x171a('0x49')]+'\x20trunk\x20is\x20not\x20reachable';}}};};Dialer['prototype']['checkIfTime']=function(_0x2aeb9c,_0x59193c,_0x2212fe,_0x47d6a0){var _0xea1737=this;return function(){var _0x20bb1f=!![];return _0xea1737[_0x171a('0x91')](_0x2aeb9c,_0x59193c,_0x2212fe,_0x47d6a0,_0x20bb1f);};};Dialer[_0x171a('0x1c')][_0x171a('0x92')]=function(_0x3744af,_0x878834,_0x8f745f,_0x22fb0b){var _0x10c780=this;return function(){var _0x68ba5e=![];return _0x10c780[_0x171a('0x91')](_0x3744af['Intervals'],_0x878834,_0x8f745f,_0x22fb0b,_0x68ba5e);};};Dialer['prototype'][_0x171a('0x91')]=function(_0x5d8003,_0x3001f0,_0x1ea4f7,_0x4e6c89,_0xdc883a){var _0x2804d3=[];return new Promise(function(_0x1db486,_0x421ef4){if(!isNotNull(_0x5d8003)){_0x4e6c89[_0x171a('0x6c')]=utils[_0x171a('0x6f')]['NULL_INTERVAL'];return _0x421ef4(msgResponse(_0x171a('0x93'),_0x171a('0x94'),_0x1ea4f7+'\x20Intervals\x20is\x20null\x20'));}if(_[_0x171a('0x4b')](_0x5d8003)){_0x4e6c89['message']=utils['CAMPAIGN_STATUS'][_0x171a('0x95')];return _0x421ef4(msgResponse(_0x171a('0x93'),_0x171a('0x94'),_0x1ea4f7+_0x171a('0x96')));}if(_0x3001f0&&_[_0x171a('0x57')](config[_0x171a('0x97')][_0x3001f0])){_0x4e6c89['message']=utils[_0x171a('0x6f')][_0x171a('0x98')];return _0x421ef4(msgResponse(_0x171a('0x93'),_0x171a('0x94'),_0x1ea4f7+_0x171a('0x99')+_0x3001f0));}if(_[_0x171a('0x9a')](_0x5d8003)){for(var _0x193dab=0x0;_0x193dab<_0x5d8003[_0x171a('0x9b')];_0x193dab+=0x1){_0x2804d3['push'](ami[_0x171a('0x9c')]({'action':'command','command':util[_0x171a('0x47')](_0x171a('0x9d'),_0x5d8003[_0x193dab][_0x171a('0x9e')],!_['isUndefined'](config['timezones'][_0x3001f0])?_0x3001f0:'')})[_0x171a('0x42')](function(_0x1a8594){return _0x1a8594[_0x171a('0x9f')][_0x171a('0xa0')](_0x171a('0xa1'))>=0x0;})[_0x171a('0xa2')](myreject(_0x421ef4)));}}else{_0x2804d3[_0x171a('0xa3')](ami['Action']({'action':_0x171a('0xa4'),'command':util[_0x171a('0x47')](_0x171a('0x9d'),_0x5d8003,!_['isUndefined'](config['timezones'][_0x3001f0])?_0x3001f0:'')})[_0x171a('0x42')](function(_0x4a0055){return _0x4a0055[_0x171a('0x9f')][_0x171a('0xa0')](_0x171a('0xa1'))>=0x0;})[_0x171a('0xa2')](myreject(_0x421ef4)));}Promise[_0x171a('0xa5')](_0x2804d3)[_0x171a('0x42')](function(_0x303859){var _0x2c865b=_[_0x171a('0xa6')](_0x303859);if(_0x2c865b){return _0x1db486(_0x2c865b);}else{_0x4e6c89['message']=_0xdc883a?utils[_0x171a('0x6f')][_0x171a('0xa7')]:utils[_0x171a('0x6f')][_0x171a('0xa8')];return _0x421ef4(msgResponse('[ifTime][promiseAll]',_0x171a('0x94'),_0x171a('0xa9')+_0xdc883a+'\x20'+_0x1ea4f7+_0x171a('0xaa')+util[_0x171a('0x46')](_0x5d8003,{'showHidden':![],'depth':null})+_0x171a('0xab')+_0x3001f0));}})[_0x171a('0xa2')](function(_0x39017f){return _0x421ef4(msgResponse(_0x171a('0x93'),_0x171a('0x94'),JSON[_0x171a('0x79')](_0x39017f)));});});};Dialer['prototype']['loopCampaigns']=function(){var _0x599d56=this;return cmHopper[_0x171a('0xac')]({'active':![]},{'where':{'active':!![]}})['then'](function(){setInterval(function(){_0x599d56[_0x171a('0xad')]();},0x3e8);});};Dialer[_0x171a('0x1c')][_0x171a('0xad')]=function(){var _0x2a2757=this;var _0x6662ba;for(var _0x2300d5 in this[_0x171a('0x21')]){if(typeof this[_0x171a('0x21')][_0x2300d5]!==_0x171a('0xae')){_0x6662ba=this[_0x171a('0x21')][_0x2300d5];if(utils[_0x171a('0x80')](_0x6662ba)&&utils[_0x171a('0x7f')](_0x6662ba)){_0x6662ba[_0x171a('0x82')]=!![];Promise['resolve']()['then'](checkIsIVRCampaignActive(_0x6662ba))['then'](checkInterval(_0x6662ba))[_0x171a('0x42')](_0x2a2757[_0x171a('0x8d')](_0x6662ba))['then'](_0x2a2757[_0x171a('0xaf')](_0x6662ba[_0x171a('0xb0')],_0x6662ba[_0x171a('0xb1')],_0x6662ba[_0x171a('0x49')],_0x6662ba))['then'](_0x2a2757[_0x171a('0x92')](_0x6662ba['Interval'],_0x6662ba[_0x171a('0xb1')],_0x6662ba[_0x171a('0x49')],_0x6662ba))[_0x171a('0x42')](_0x2a2757[_0x171a('0xb2')](_0x6662ba))[_0x171a('0xa2')](loggerCatchQueueSummary(_0x171a('0xb3'),_0x6662ba));}else{notSendMessagesCampaign(_0x6662ba);}}}};Dialer['prototype'][_0x171a('0xb4')]=function(_0x506b33){if(_0x506b33[_0x171a('0xb5')]!==_0x171a('0xb6')){clearPredictiveAttributes(_0x506b33);}switch(_0x506b33[_0x171a('0xb5')]){case _0x171a('0xb7'):this[_0x171a('0xb8')](_0x506b33,0x1);break;case _0x171a('0xb9'):this['handlePower'](_0x506b33,_0x506b33[_0x171a('0xba')]);break;case _0x171a('0xb6'):this[_0x171a('0xb6')](_0x506b33);break;case _0x171a('0xa'):this[_0x171a('0xb8')](_0x506b33,0x1);break;default:logger[_0x171a('0x69')](_0x171a('0xbb'),_0x506b33[_0x171a('0x49')],_0x171a('0xbc'));}};Dialer[_0x171a('0x1c')][_0x171a('0x93')]=function(_0x46d05b,_0x1b4bef){var _0x29c503=_0x46d05b['dialTimezone'];var _0x1c8f50=_0x1b4bef?_0x46d05b[_0x171a('0xb0')]:_0x46d05b[_0x171a('0x7b')][_0x171a('0x7e')];logger[_0x171a('0xbd')]('Dialer::ifTime()',_0x1c8f50,_0x29c503,_0x46d05b['name'],util[_0x171a('0x47')](_0x171a('0xbe'),_0x46d05b[_0x171a('0x49')],_0x46d05b['id']));var _0xbec132=null;return Interval[_0x171a('0xbf')](_0x1c8f50,_0x29c503)[_0x171a('0x42')](function(_0x536c2d){if(_0x536c2d===!![]){return _0x536c2d;}else{_0x46d05b[_0x171a('0x6c')]=_0x1b4bef?utils[_0x171a('0x6f')][_0x171a('0xa7')]:utils[_0x171a('0x6f')][_0x171a('0xa8')];_0xbec132=msgResponse('[ifTime][promiseAll]',_0x171a('0x94'),'Global:\x20'+_0x1b4bef+'\x20'+_0x46d05b[_0x171a('0x49')]+_0x171a('0xaa')+util[_0x171a('0x46')](_0x1c8f50,{'showHidden':![],'depth':null})+_0x171a('0xab')+_0x29c503);}if(_0xbec132!==null){logger[_0x171a('0xbd')](_0x171a('0xc0'),_0xbec132);_0xbec132[_0x171a('0xc1')]=_0x1b4bef;throw _0xbec132;}})[_0x171a('0xa2')](function(_0x4fc68e){logger['error'](_0x171a('0xc2'),_0x4fc68e);throw msgResponse(_0x171a('0x86'),_0x171a('0x87'),util[_0x171a('0x46')](_0x4fc68e,{'showHidden':![],'depth':null}));});};Dialer[_0x171a('0x1c')][_0x171a('0x2e')]=function(_0x1283e8){if(this[_0x171a('0x20')][_0x1283e8[_0x171a('0xc3')]]){if(this['uniqueId'][_0x1283e8[_0x171a('0xc4')]]&&this['uniqueId'][_0x1283e8[_0x171a('0xc4')]][_0x171a('0x43')]!==_0x171a('0xc5')){utils[_0x171a('0xc6')](this['voiceQueues'][_0x1283e8[_0x171a('0xc3')]],_0x171a('0xc7'));this[_0x171a('0xc8')][_0x1283e8[_0x171a('0xc4')]][_0x171a('0xc9')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0x171a('0x1c')]['syncAgentComplete']=function(_0x23b798){var _0x38739b=this[_0x171a('0xc8')][_0x23b798['uniqueid']];if(this[_0x171a('0x20')][_0x23b798[_0x171a('0xc3')]]){if(_0x38739b&&_0x38739b[_0x171a('0x43')]!==_0x171a('0xc5')){delete this[_0x171a('0xc8')][_0x23b798[_0x171a('0xc4')]];this[_0x171a('0x20')][_0x23b798[_0x171a('0xc3')]][_0x171a('0xca')]+=0x1;var _0x35d30a=new AgentComplete(_0x38739b,_0x23b798);if(_0x23b798[_0x171a('0xcb')]==='agent'){_0x35d30a[_0x171a('0xcc')]=this[_0x171a('0x20')][_0x23b798[_0x171a('0xc3')]][_0x171a('0xcd')]&&this[_0x171a('0x20')][_0x23b798['queue']][_0x171a('0xce')]?moment()[_0x171a('0x47')](_0x171a('0xcf')):undefined;}hopperUtils[_0x171a('0xd0')](_0x35d30a)[_0x171a('0xa2')](loggerCatch('[syncAgentComplete][createHistory]'));hopperUtils['moveContactManagedDialer'](_0x35d30a)[_0x171a('0xa2')](loggerCatch(_0x171a('0xd1')));}}};Dialer[_0x171a('0x1c')][_0x171a('0xd2')]=function(_0x406e01){var _0x552275=this[_0x171a('0xc8')][_0x406e01[_0x171a('0xc4')]];var _0xdf8089=this;var _0x52b1eb=![];var _0x8d0a2f;var _0x5b36eb;if(this[_0x171a('0x20')][_0x406e01[_0x171a('0xc3')]]){if(_0x552275&&_0x552275['type']!==_0x171a('0xc5')){delete this['uniqueId'][_0x406e01['uniqueid']];utils[_0x171a('0xc6')](this[_0x171a('0x20')][_0x406e01[_0x171a('0xc3')]],_0x171a('0xd3'));_0x552275[_0x171a('0xd4')]=moment()[_0x171a('0x47')](_0x171a('0xcf'));var _0x4e9e97=new QueueCallerAbandon(_0x552275,_0x406e01);if(utils[_0x171a('0x64')](_0x552275[_0x171a('0xd4')],_0x552275[_0x171a('0xd5')])>=_0x552275[_0x171a('0xd6')]){this['voiceQueues'][_0x406e01[_0x171a('0xc3')]][_0x171a('0x51')]+=0x1;this[_0x171a('0x20')][_0x406e01[_0x171a('0xc3')]][_0x171a('0xd7')]+=0x1;this['voiceQueues'][_0x406e01['queue']][_0x171a('0xd8')]+=0x1;_0x4e9e97[_0x171a('0x72')]=0xa;_0x4e9e97['statedesc']=_0x171a('0xd9');_0x4e9e97['dropreason']=_0x171a('0xda');_0x4e9e97[_0x171a('0xcc')]=this[_0x171a('0x20')][_0x406e01[_0x171a('0xc3')]][_0x171a('0xcd')]?moment()['format'](_0x171a('0xcf')):undefined;_0x4e9e97[_0x171a('0xdb')]+=0x1;_0x4e9e97[_0x171a('0xdc')]+=0x1;_0x8d0a2f=this[_0x171a('0x20')][_0x406e01[_0x171a('0xc3')]]['dialDropRetryFrequency'];_0x5b36eb=this[_0x171a('0x20')][_0x406e01[_0x171a('0xc3')]]['callAdditionalPhoneAfterMin'];hopperUtils[_0x171a('0xdd')](_0x4e9e97,_0x4e9e97[_0x171a('0x72')],_0x552275[_0x171a('0xde')])['then'](function(_0x1b8c8c){_0x52b1eb=_0x1b8c8c[_0x171a('0xdf')]==0x1;if(_0x4e9e97['countdropretry']>=_0xdf8089['voiceQueues'][_0x406e01['queue']][_0x171a('0xe0')]){_0xdf8089[_0x171a('0xe1')](_0x4e9e97,_0x1b8c8c['additional']);}else{hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x4e9e97[_0x171a('0xdb')],'scheduledat':moment()[_0x171a('0xe2')](_0xdf8089[_0x171a('0x20')][_0x406e01[_0x171a('0xc3')]][_0x171a('0xe3')],_0x171a('0xe4'))[_0x171a('0x47')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x552275['ContactId'],'ListId':_0x552275[_0x171a('0xe5')],'VoiceQueueId':_0x552275[_0x171a('0xe6')]||undefined,'CampaignId':_0x552275[_0x171a('0xe7')]||undefined})[_0x171a('0xa2')](loggerCatch(_0x171a('0xe8')));var _0x2ef5ce=new History(_0x4e9e97);_0x2ef5ce[_0x171a('0x72')]=0xa;_0x2ef5ce['statedesc']='Drop';_0x2ef5ce[_0x171a('0x75')]=moment()[_0x171a('0x47')](_0x171a('0xcf'));_0x2ef5ce[_0x171a('0x74')]=_0x2ef5ce[_0x171a('0x75')];_0x2ef5ce[_0x171a('0xe9')]=_0x4e9e97[_0x171a('0xe9')];_0x2ef5ce['calleridnum']=_0x4e9e97['calleridnum'];hopperUtils[_0x171a('0xd0')](_0x2ef5ce)['catch'](loggerCatch(_0x171a('0xea')));}})[_0x171a('0x42')](function(){if(_0x52b1eb)hopperUtils[_0x171a('0xeb')](_0x4e9e97,_0x8d0a2f,_0x5b36eb)[_0x171a('0x42')](function(){return 0x1;});});}else{this[_0x171a('0x20')][_0x406e01['queue']][_0x171a('0xec')]+=0x1;this[_0x171a('0x20')][_0x406e01[_0x171a('0xc3')]][_0x171a('0xed')]+=0x1;_0x4e9e97[_0x171a('0x72')]=0xb;_0x4e9e97['statedesc']=_0x171a('0xee');_0x4e9e97['dropreason']=_0x171a('0xef');_0x4e9e97[_0x171a('0xf0')]+=0x1;_0x4e9e97[_0x171a('0xdc')]+=0x1;_0x8d0a2f=this[_0x171a('0x20')][_0x406e01[_0x171a('0xc3')]][_0x171a('0xf1')];_0x5b36eb=this[_0x171a('0x20')][_0x406e01[_0x171a('0xc3')]]['callAdditionalPhoneAfterMin'];hopperUtils[_0x171a('0xdd')](_0x4e9e97,_0x4e9e97[_0x171a('0x72')],_0x552275[_0x171a('0xde')])[_0x171a('0x42')](function(_0x301840){if(_0x4e9e97[_0x171a('0xf0')]>=_0xdf8089[_0x171a('0x20')][_0x406e01['queue']][_0x171a('0xf2')]){_0xdf8089[_0x171a('0xe1')](_0x4e9e97,_0x301840[_0x171a('0xdf')]);}else{hopperUtils[_0x171a('0xf3')]({'active':![],'countabandonedretry':_0x4e9e97['countabandonedretry'],'scheduledat':moment()[_0x171a('0xe2')](_0xdf8089[_0x171a('0x20')][_0x406e01[_0x171a('0xc3')]][_0x171a('0xf1')],_0x171a('0xe4'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x552275[_0x171a('0xf4')],'ListId':_0x552275[_0x171a('0xe5')],'VoiceQueueId':_0x552275['VoiceQueueId']||undefined,'CampaignId':_0x552275[_0x171a('0xe7')]||undefined})[_0x171a('0xa2')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x383222=new History(_0x4e9e97);_0x383222['state']=0xb;_0x383222[_0x171a('0x73')]='Abandoned';_0x383222[_0x171a('0x75')]=moment()[_0x171a('0x47')](_0x171a('0xcf'));_0x383222[_0x171a('0x74')]=_0x383222[_0x171a('0x75')];_0x383222['calleridname']=_0x4e9e97[_0x171a('0xe9')];_0x383222[_0x171a('0xf5')]=_0x4e9e97[_0x171a('0xf5')];hopperUtils['createHistory'](_0x383222)[_0x171a('0xa2')](loggerCatch('[syncAgentComplete][createHistory][11]'));}})[_0x171a('0x42')](function(){if(_0x52b1eb)hopperUtils[_0x171a('0xeb')](_0x4e9e97,_0x8d0a2f,_0x5b36eb)['then'](function(){return 0x1;});});}}}};Dialer[_0x171a('0x1c')]['syncNewExten']=function(_0x57c820){if(this['actions'][_0x57c820[_0x171a('0xc4')]]){this[_0x171a('0x26')][_0x57c820[_0x171a('0xc4')]][_0x171a('0xf6')]=_0x57c820[_0x171a('0xf6')];}if(this[_0x171a('0xc8')][_0x57c820['uniqueid']]){this[_0x171a('0xc8')][_0x57c820[_0x171a('0xc4')]][_0x171a('0xf6')]=_0x57c820[_0x171a('0xf6')];}};Dialer['prototype'][_0x171a('0x3c')]=function(_0x2f5a92){if(!this[_0x171a('0x26')][_0x2f5a92['actionid']]){return;}var _0x186e32=this[_0x171a('0x20')][this['actions'][_0x2f5a92[_0x171a('0xf7')]][_0x171a('0xc3')]][_0x171a('0xf8')]||_0x171a('0xf9');if(_0x186e32===_0x171a('0xfa')){if(this[_0x171a('0x26')][_0x2f5a92[_0x171a('0xf7')]]&&_[_0x171a('0xfb')](this[_0x171a('0x26')][_0x2f5a92['actionid']]['locked'])&&_0x2f5a92['status']==='1'&&_0x2f5a92[_0x171a('0xfc')]==='0'){if(this[_0x171a('0x22')][_0x2f5a92[_0x171a('0xfd')]]){if(!this[_0x171a('0x22')][_0x2f5a92[_0x171a('0xfd')]]['locked']){this[_0x171a('0x22')][_0x2f5a92[_0x171a('0xfd')]]['locked']=!![];this[_0x171a('0x26')][_0x2f5a92['actionid']][_0x171a('0xfe')]=!![];this[_0x171a('0x26')][_0x2f5a92['actionid']][_0x171a('0xfd')]=_0x2f5a92['stateinterface'];}}}}else if(_0x186e32===_0x171a('0xf9')){if(this[_0x171a('0x26')][_0x2f5a92['actionid']]){if(this[_0x171a('0x22')][_0x2f5a92[_0x171a('0xfd')]]){this[_0x171a('0x26')][_0x2f5a92[_0x171a('0xf7')]][_0x171a('0xfd')]=_0x2f5a92[_0x171a('0xfd')];if(_[_0x171a('0xfb')](this['queueBooked'][this[_0x171a('0x26')][_0x2f5a92[_0x171a('0xf7')]][_0x171a('0xc3')]])){this['queueBooked'][this[_0x171a('0x26')][_0x2f5a92[_0x171a('0xf7')]][_0x171a('0xc3')]]=[];}this[_0x171a('0x2a')][this['actions'][_0x2f5a92[_0x171a('0xf7')]][_0x171a('0xc3')]][_0x171a('0xa3')](_[_0x171a('0x63')](_[_0x171a('0x7a')](this[_0x171a('0x26')][_0x2f5a92[_0x171a('0xf7')]],['idHopper',_0x171a('0xfd')]),{'status':_0x2f5a92[_0x171a('0x8a')],'paused':_0x2f5a92[_0x171a('0xfc')]}));}}}};Dialer[_0x171a('0x1c')][_0x171a('0x3e')]=function(_0x1a24fe){if(!this[_0x171a('0x26')][_0x1a24fe[_0x171a('0xf7')]]){return;}var _0x10a80f=this;var _0xeeec37=this['voiceQueues'][this[_0x171a('0x26')][_0x1a24fe[_0x171a('0xf7')]][_0x171a('0xc3')]];var _0x570839=_0xeeec37['strategy']||'rrmemory';if(_0x570839==='roundrobin'){if(this[_0x171a('0x26')][_0x1a24fe[_0x171a('0xf7')]]&&this[_0x171a('0x26')][_0x1a24fe['actionid']][_0x171a('0xfd')]){this['preview'][_0x171a('0xff')](this[_0x171a('0x26')][_0x1a24fe[_0x171a('0xf7')]][_0x171a('0x100')],this[_0x171a('0x26')][_0x1a24fe['actionid']][_0x171a('0xfd')])['catch'](function(_0x295e07){logger[_0x171a('0x69')]('[Catch][Preview][syncQueueStatusComplete]',util[_0x171a('0x46')](_0x295e07,{'showHidden':![],'depth':null}));})[_0x171a('0x101')](function(){utils[_0x171a('0xc6')](_0x10a80f[_0x171a('0x20')][_0x10a80f[_0x171a('0x26')][_0x1a24fe['actionid']][_0x171a('0xc3')]],_0x171a('0x102'));_0x10a80f[_0x171a('0x22')][_0x10a80f['actions'][_0x1a24fe[_0x171a('0xf7')]][_0x171a('0xfd')]]['locked']=![];delete _0x10a80f['actions'][_0x1a24fe[_0x171a('0xf7')]];unlockQueueStatus(_0xeeec37);});}else{utils[_0x171a('0xc6')](this[_0x171a('0x20')][this[_0x171a('0x26')][_0x1a24fe['actionid']][_0x171a('0xc3')]],_0x171a('0x102'));hopperUtils['rescheduleContact']({'active':![],'ContactId':this[_0x171a('0x26')][_0x1a24fe[_0x171a('0xf7')]]['ContactId'],'ListId':this['actions'][_0x1a24fe[_0x171a('0xf7')]][_0x171a('0xe5')],'VoiceQueueId':this['actions'][_0x1a24fe['actionid']][_0x171a('0xe6')]||undefined,'CampaignId':this['actions'][_0x1a24fe['actionid']]['CampaignId']||undefined})[_0x171a('0xa2')](loggerCatch(_0x171a('0x103')));delete this[_0x171a('0x26')][_0x1a24fe[_0x171a('0xf7')]];unlockQueueStatus(_0xeeec37);}}else if(_0x570839===_0x171a('0xf9')){var _0x40c576;if(this[_0x171a('0x26')][_0x1a24fe[_0x171a('0xf7')]]&&!_[_0x171a('0x4b')](this[_0x171a('0x2a')][this[_0x171a('0x26')][_0x1a24fe[_0x171a('0xf7')]][_0x171a('0xc3')]])){if(this['queueBookedRR'][_0x10a80f[_0x171a('0x26')][_0x1a24fe[_0x171a('0xf7')]][_0x171a('0xc3')]]){this[_0x171a('0x2b')][_0x10a80f[_0x171a('0x26')][_0x1a24fe[_0x171a('0xf7')]][_0x171a('0xc3')]]=this[_0x171a('0x2b')][this[_0x171a('0x26')][_0x1a24fe[_0x171a('0xf7')]]['queue']]?this[_0x171a('0x2b')][this['actions'][_0x1a24fe[_0x171a('0xf7')]]['queue']]:this['queueBooked'][this[_0x171a('0x26')][_0x1a24fe['actionid']][_0x171a('0xc3')]]?this[_0x171a('0x2a')][this['actions'][_0x1a24fe[_0x171a('0xf7')]][_0x171a('0xc3')]][_0x171a('0x104')]||0x0:0x0;}this[_0x171a('0x2a')][this['actions'][_0x1a24fe[_0x171a('0xf7')]][_0x171a('0xc3')]][_0x171a('0x104')]=this['queueBookedRR'][this[_0x171a('0x26')][_0x1a24fe['actionid']][_0x171a('0xc3')]];for(var _0x5d47f4=0x0;_0x5d47f4<this['queueBooked'][this[_0x171a('0x26')][_0x1a24fe['actionid']][_0x171a('0xc3')]]['length'];_0x5d47f4+=0x1){_0x40c576=rr(this[_0x171a('0x2a')][this[_0x171a('0x26')][_0x1a24fe[_0x171a('0xf7')]][_0x171a('0xc3')]]);this['queueBookedRR'][_0x10a80f[_0x171a('0x26')][_0x1a24fe[_0x171a('0xf7')]]['queue']]=this[_0x171a('0x2a')][this[_0x171a('0x26')][_0x1a24fe[_0x171a('0xf7')]][_0x171a('0xc3')]][_0x171a('0x104')];if(_0x40c576[_0x171a('0x8a')]==='1'&&_0x40c576[_0x171a('0xfc')]==='0'){break;}}if(!_[_0x171a('0xfb')](_0x40c576)){this['agents'][_0x40c576[_0x171a('0xfd')]][_0x171a('0x105')]=_[_0x171a('0x57')](this[_0x171a('0x22')][_0x40c576[_0x171a('0xfd')]][_0x171a('0x105')])?!![]:this[_0x171a('0x22')][_0x40c576[_0x171a('0xfd')]][_0x171a('0x105')];}loggerBooked[_0x171a('0x4c')](_0x171a('0x106'),_0x1a24fe[_0x171a('0xf7')],_0x171a('0x107'),JSON[_0x171a('0x79')](_[_0x171a('0x7a')](this[_0x171a('0x22')][_0x40c576[_0x171a('0xfd')]],[_0x171a('0x49'),'unlockRR'])),_0x171a('0x108'),JSON[_0x171a('0x79')](_0x40c576[_0x171a('0x100')]));if(!_[_0x171a('0xfb')](_0x40c576)&&_0x40c576[_0x171a('0x8a')]==='1'&&_0x40c576[_0x171a('0xfc')]==='0'&&this[_0x171a('0x22')][_0x40c576[_0x171a('0xfd')]][_0x171a('0x105')]){this[_0x171a('0x22')][_0x40c576[_0x171a('0xfd')]][_0x171a('0x105')]=![];this[_0x171a('0x2a')][_0x10a80f['actions'][_0x1a24fe[_0x171a('0xf7')]][_0x171a('0xc3')]]=[];this[_0x171a('0x1f')][_0x171a('0xff')](_0x40c576['idHopper'],_0x40c576['stateinterface'])[_0x171a('0xa2')](function(_0x3745b6){logger[_0x171a('0x69')](_0x171a('0x109'),util[_0x171a('0x46')](_0x3745b6,{'showHidden':![],'depth':null}));})[_0x171a('0x101')](function(){utils[_0x171a('0xc6')](_0x10a80f['voiceQueues'][_0x10a80f[_0x171a('0x26')][_0x1a24fe['actionid']][_0x171a('0xc3')]],_0x171a('0x102'));setTimeout(function(){_0x10a80f[_0x171a('0x22')][_0x40c576[_0x171a('0xfd')]][_0x171a('0x105')]=!![];loggerBooked[_0x171a('0x4c')]('[booked][RR][finaly]',_0x1a24fe[_0x171a('0xf7')],'Agent:\x20',JSON[_0x171a('0x79')](_['pick'](_0x10a80f[_0x171a('0x22')][_0x40c576[_0x171a('0xfd')]],['name',_0x171a('0x105')])),_0x171a('0x108'),JSON[_0x171a('0x79')](_0x40c576[_0x171a('0x100')]));},0xc7);delete _0x10a80f[_0x171a('0x26')][_0x1a24fe['actionid']];unlockQueueStatus(_0xeeec37,_0x1a24fe['actionid']);});}else{loggerBooked[_0x171a('0x4c')](_0x171a('0x10a'));utils[_0x171a('0xc6')](this[_0x171a('0x20')][this[_0x171a('0x26')][_0x1a24fe[_0x171a('0xf7')]][_0x171a('0xc3')]],_0x171a('0x102'));hopperUtils[_0x171a('0xf3')]({'active':![],'ContactId':this[_0x171a('0x26')][_0x1a24fe[_0x171a('0xf7')]][_0x171a('0xf4')],'ListId':this[_0x171a('0x26')][_0x1a24fe[_0x171a('0xf7')]]['ListId'],'VoiceQueueId':this[_0x171a('0x26')][_0x1a24fe[_0x171a('0xf7')]][_0x171a('0xe6')]||undefined,'CampaignId':this['actions'][_0x1a24fe[_0x171a('0xf7')]][_0x171a('0xe7')]||undefined})['catch'](loggerCatch(_0x171a('0x103')));delete this[_0x171a('0x26')][_0x1a24fe[_0x171a('0xf7')]];unlockQueueStatus(_0xeeec37);}}else{loggerBooked[_0x171a('0x4c')](_0x171a('0x10b'));utils['decrementOriginate'](this[_0x171a('0x20')][this[_0x171a('0x26')][_0x1a24fe[_0x171a('0xf7')]]['queue']],'[syncQueueStatusComplete]');hopperUtils[_0x171a('0xf3')]({'active':![],'ContactId':this[_0x171a('0x26')][_0x1a24fe['actionid']]['ContactId'],'ListId':this[_0x171a('0x26')][_0x1a24fe[_0x171a('0xf7')]][_0x171a('0xe5')],'VoiceQueueId':this[_0x171a('0x26')][_0x1a24fe[_0x171a('0xf7')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x171a('0x26')][_0x1a24fe[_0x171a('0xf7')]][_0x171a('0xe7')]||undefined})['catch'](loggerCatch(_0x171a('0x10c')));delete this[_0x171a('0x26')][_0x1a24fe[_0x171a('0xf7')]];unlockQueueStatus(_0xeeec37);}}else{loggerBooked['info'](_0x171a('0x10d'));utils[_0x171a('0xc6')](this['voiceQueues'][this[_0x171a('0x26')][_0x1a24fe[_0x171a('0xf7')]][_0x171a('0xc3')]],_0x171a('0x102'));hopperUtils[_0x171a('0xf3')]({'active':![],'ContactId':this[_0x171a('0x26')][_0x1a24fe[_0x171a('0xf7')]][_0x171a('0xf4')],'ListId':this[_0x171a('0x26')][_0x1a24fe[_0x171a('0xf7')]][_0x171a('0xe5')],'VoiceQueueId':this['actions'][_0x1a24fe['actionid']][_0x171a('0xe6')]||undefined,'CampaignId':this[_0x171a('0x26')][_0x1a24fe['actionid']]['CampaignId']||undefined})['catch'](loggerCatch(_0x171a('0x10e')));delete this[_0x171a('0x26')][_0x1a24fe[_0x171a('0xf7')]];unlockQueueStatus(_0xeeec37);}};Dialer['prototype'][_0x171a('0x32')]=function(_0x6a2ad5){var _0xb9e5ab=this['actions'][_0x6a2ad5[_0x171a('0xf7')]];if(_0xb9e5ab){delete this[_0x171a('0x26')][_0x6a2ad5[_0x171a('0xf7')]];_0xb9e5ab[_0x171a('0xd5')]=moment()[_0x171a('0x47')](_0x171a('0xcf'));var _0x31a9d2=_0xb9e5ab[_0x171a('0x43')]===_0x171a('0xc5')?this[_0x171a('0x21')][_0xb9e5ab['queue']]:this['voiceQueues'][_0xb9e5ab['getQueue']()];if(_0x6a2ad5[_0x171a('0x10f')]!==_0x171a('0x110')){utils[_0x171a('0xc6')](_0x31a9d2,_0x171a('0x111'));return this['callProgressDetecting'](_0xb9e5ab,_0x31a9d2,_0x6a2ad5)[_0x171a('0xa2')](loggerCatch(_0x171a('0x112')));}this[_0x171a('0xc8')][_0x6a2ad5[_0x171a('0xc4')]]=_0xb9e5ab;}};Dialer['prototype'][_0x171a('0x3a')]=function(_0x17624c){var _0x317fee=this;var _0x118112=this[_0x171a('0xc8')][_0x17624c[_0x171a('0xc4')]];var _0x387a64;if(!_[_0x171a('0xfb')](_0x17624c)&&!_[_0x171a('0xfb')](_0x17624c[_0x171a('0x113')])&&!_['isNil'](_0x17624c[_0x171a('0x113')][_0x171a('0x114')])&&_0x17624c['exten']==='xcally-motion-dialer'&&_0x118112){if(_0x118112[_0x171a('0x43')]!==_0x171a('0xc5')&&this['voiceQueues'][_0x118112[_0x171a('0xc3')]][_0x171a('0x115')]&&_0x17624c[_0x171a('0x116')]===_0x171a('0x117')){delete this[_0x171a('0xc8')][_0x17624c['uniqueid']];utils[_0x171a('0xc6')](this[_0x171a('0x20')][_0x118112[_0x171a('0xc3')]],'[syncVarSet]');this['voiceQueues'][_0x118112[_0x171a('0xc3')]][_0x171a('0xca')]+=0x1;this['voiceQueues'][_0x118112['queue']][_0x171a('0x118')]+=0x1;_0x387a64=new Hangup(_0x118112,_0x17624c);_0x387a64[_0x171a('0x72')]=0x12;_0x387a64[_0x171a('0x73')]=_0x171a('0x119');_0x387a64[_0x171a('0x11a')]=_0x171a('0x11b');ami[_0x171a('0x11c')]('custom:amd',ut[_0x171a('0x11d')](_0x387a64,_0x171a('0x11e')));this[_0x171a('0x11f')](_0x387a64,_0x171a('0x120'),_0x171a('0x121'));}if(_0x118112['type']!==_0x171a('0xc5')&&this[_0x171a('0x20')][_0x118112[_0x171a('0xc3')]]['dialAMDActive']&&_0x17624c[_0x171a('0x116')]==='MACHINE'){return new Promise(function(_0xec9194,_0x535554){delete _0x317fee['uniqueId'][_0x17624c['uniqueid']];utils['decrementOriginate'](_0x317fee[_0x171a('0x20')][_0x118112[_0x171a('0xc3')]],'[syncVarSet]');_0x317fee[_0x171a('0x20')][_0x118112[_0x171a('0xc3')]]['outboundAnswerCallsDay']+=0x1;_0x317fee[_0x171a('0x20')][_0x118112[_0x171a('0xc3')]][_0x171a('0x118')]+=0x1;var _0x3e5f1a=_0x317fee[_0x171a('0x20')][_0x118112[_0x171a('0xc3')]];var _0x31a2e=new Hangup(_0x118112,_0x17624c);_0x31a2e[_0x171a('0x72')]=0x13;_0x31a2e[_0x171a('0x73')]=_0x171a('0x122');_0x31a2e['membername']=_0x171a('0x11b');_0x31a2e[_0x171a('0x123')]+=0x1;_0x31a2e[_0x171a('0xdc')]+=0x1;_0x31a2e[_0x171a('0x11e')]=!![];ami[_0x171a('0x11c')]('custom:amd',ut['buildObj'](_0x31a2e,_0x171a('0x11e')));hopperUtils['createHistory'](_0x31a2e)['catch'](loggerCatch(_0x171a('0x124')));if(_0x31a2e[_0x171a('0x125')]+_0x31a2e[_0x171a('0x126')]+_0x31a2e[_0x171a('0x127')]+_0x31a2e[_0x171a('0x128')]+_0x31a2e[_0x171a('0xdb')]+_0x31a2e['countabandonedretry']+_0x31a2e[_0x171a('0x123')]+_0x31a2e[_0x171a('0x129')]>=_0x3e5f1a[_0x171a('0x12a')]){_0x317fee['stateGlobal'](_0x31a2e,_0xec9194,_0x535554,_0x171a('0x12b'));}else{if(_0x31a2e[_0x171a('0x123')]>=_0x3e5f1a[_0x171a('0x12c')]){_0x317fee[_0x171a('0x12d')](_0x31a2e,_0xec9194,_0x535554,_0x171a('0x12e'));}else{hopperUtils[_0x171a('0xf3')]({'active':![],'countmachineretry':_0x31a2e[_0x171a('0x123')],'scheduledat':moment()[_0x171a('0xe2')](_0x3e5f1a[_0x171a('0x12f')],_0x171a('0xe4'))[_0x171a('0x47')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x31a2e[_0x171a('0xf4')],'ListId':_0x31a2e[_0x171a('0xe5')],'VoiceQueueId':_0x31a2e[_0x171a('0xe6')]||undefined,'CampaignId':_0x31a2e[_0x171a('0xe7')]||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));_0xec9194({'reschedule':0x1});}}});}if(_0x118112['type']==='ivr'&&this['campaigns'][_0x118112[_0x171a('0xc3')]][_0x171a('0x115')]&&_0x17624c[_0x171a('0x116')]===_0x171a('0x117')){delete this[_0x171a('0xc8')][_0x17624c[_0x171a('0xc4')]];utils['decrementOriginate'](this[_0x171a('0x21')][_0x118112[_0x171a('0xc3')]],'[syncVarSet]');_0x387a64=new Hangup(_0x118112,_0x17624c);_0x387a64[_0x171a('0x72')]=0x12;_0x387a64[_0x171a('0x73')]=_0x171a('0x119');_0x387a64[_0x171a('0x11a')]=_0x171a('0x11b');ami['emit'](_0x171a('0x130'),ut[_0x171a('0x11d')](_0x387a64,_0x171a('0x11e')));this[_0x171a('0x11f')](_0x387a64,_0x171a('0x131'),_0x171a('0x132'));}if(_0x118112[_0x171a('0x43')]===_0x171a('0xc5')&&this['campaigns'][_0x118112[_0x171a('0xc3')]][_0x171a('0x115')]&&_0x17624c['value']===_0x171a('0x133')){return new Promise(function(_0x22704e,_0x3ea510){delete _0x317fee[_0x171a('0xc8')][_0x17624c[_0x171a('0xc4')]];utils[_0x171a('0xc6')](_0x317fee['campaigns'][_0x118112[_0x171a('0xc3')]],'[syncVarSet]');_0x317fee[_0x171a('0x21')][_0x118112[_0x171a('0xc3')]][_0x171a('0xca')]+=0x1;_0x317fee[_0x171a('0x21')][_0x118112[_0x171a('0xc3')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x3d1e86=_0x317fee[_0x171a('0x21')][_0x118112[_0x171a('0xc3')]];var _0x1e482d=new Hangup(_0x118112,_0x17624c);_0x1e482d[_0x171a('0x72')]=0x13;_0x1e482d[_0x171a('0x73')]=_0x171a('0x122');_0x1e482d[_0x171a('0x11a')]=_0x171a('0x11b');_0x1e482d[_0x171a('0x123')]+=0x1;_0x1e482d[_0x171a('0xdc')]+=0x1;_0x1e482d[_0x171a('0x11e')]=!![];ami[_0x171a('0x11c')](_0x171a('0x130'),ut[_0x171a('0x11d')](_0x1e482d,_0x171a('0x11e')));hopperUtils[_0x171a('0xd0')](_0x1e482d)[_0x171a('0xa2')](loggerCatch(_0x171a('0x124')));if(_0x1e482d[_0x171a('0x125')]+_0x1e482d['countcongestionretry']+_0x1e482d[_0x171a('0x127')]+_0x1e482d['countnosuchnumberretry']+_0x1e482d['countdropretry']+_0x1e482d[_0x171a('0xf0')]+_0x1e482d[_0x171a('0x123')]+_0x1e482d[_0x171a('0x129')]>=_0x3d1e86[_0x171a('0x12a')]){_0x317fee[_0x171a('0x134')](_0x1e482d,_0x22704e,_0x3ea510,_0x171a('0x12b'));}else{if(_0x1e482d[_0x171a('0x123')]>=_0x3d1e86[_0x171a('0x12c')]){_0x317fee['createStateFinal'](_0x1e482d,_0x22704e,_0x3ea510,_0x171a('0x12e'));}else{hopperUtils[_0x171a('0xf3')]({'active':![],'countmachineretry':_0x1e482d[_0x171a('0x123')],'scheduledat':moment()['add'](_0x3d1e86[_0x171a('0x12f')],_0x171a('0xe4'))['format'](_0x171a('0xcf')),'ContactId':_0x1e482d['ContactId'],'ListId':_0x1e482d['ListId'],'VoiceQueueId':_0x1e482d['VoiceQueueId']||undefined,'CampaignId':_0x1e482d[_0x171a('0xe7')]||undefined})[_0x171a('0xa2')](loggerCatch(_0x171a('0x135')));_0x22704e({'reschedule':0x1});}}});}}};Dialer[_0x171a('0x1c')][_0x171a('0x136')]=function(_0x46fa19){var _0xe3fc29=this[_0x171a('0xc8')][_0x46fa19[_0x171a('0xc4')]];var _0x52b8b6;if(!_0xe3fc29){return;}if(_0xe3fc29[_0x171a('0x43')]===_0x171a('0xc5')){delete this['uniqueId'][_0x46fa19['uniqueid']];utils[_0x171a('0xc6')](this['campaigns'][_0xe3fc29['queue']],_0x171a('0x137'));this[_0x171a('0x21')][_0xe3fc29['queue']][_0x171a('0x138')]+=0x1;if(_0x46fa19[_0x171a('0x139')]===_0x171a('0x13a')){const _0xaad4ee=new AgentComplete(_0xe3fc29,_0x46fa19);_0xaad4ee[_0x171a('0xe7')]=this[_0x171a('0x21')][_0xe3fc29['queue']]['id'];hopperUtils['createHistory'](_0xaad4ee)[_0x171a('0xa2')](loggerCatch(_0x171a('0x13b')));hopperUtils[_0x171a('0x13c')](_0xaad4ee)[_0x171a('0xa2')](loggerCatch(_0x171a('0x13d')));}else{_0x52b8b6=new Hangup(_0xe3fc29,_0x46fa19);hopperUtils[_0x171a('0xd0')](_0x52b8b6)[_0x171a('0xa2')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0x171a('0x13c')](_0x52b8b6)[_0x171a('0xa2')](loggerCatch(_0x171a('0x13e')));}}else{if(isNotNull(this['voiceQueues'][_0xe3fc29['queue']]['dialQueueProject'])){delete this[_0x171a('0xc8')][_0x46fa19['uniqueid']];utils['decrementOriginate'](this[_0x171a('0x20')][_0xe3fc29[_0x171a('0xc3')]],_0x171a('0x137'));this[_0x171a('0x20')][_0xe3fc29[_0x171a('0xc3')]][_0x171a('0xca')]+=0x1;this[_0x171a('0x20')][_0xe3fc29['queue']]['outboundAnswerAgiCallsDay']+=0x1;_0x52b8b6=new Hangup(_0xe3fc29,_0x46fa19);_0x52b8b6[_0x171a('0x72')]=0x10;_0x52b8b6[_0x171a('0x73')]=_0x171a('0x13f');_0x52b8b6['membername']=_0x171a('0x140');hopperUtils[_0x171a('0xd0')](_0x52b8b6)[_0x171a('0xa2')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils['moveContactManagedDialer'](_0x52b8b6)[_0x171a('0xa2')](loggerCatch(_0x171a('0x13e')));}else{delete this['uniqueId'][_0x46fa19['uniqueid']];utils[_0x171a('0xc6')](this[_0x171a('0x20')][_0xe3fc29[_0x171a('0xc3')]],_0x171a('0x141'));if(_0x46fa19[_0x171a('0x139')]===_0x171a('0x13a')){this[_0x171a('0x20')][_0xe3fc29[_0x171a('0xc3')]][_0x171a('0xca')]+=0x1;const _0x22ce3a=new AgentComplete(_0xe3fc29,_0x46fa19);_0x22ce3a['VoiceQueueId']=this['voiceQueues'][_0xe3fc29[_0x171a('0xc3')]]['id'];hopperUtils[_0x171a('0xd0')](_0x22ce3a)[_0x171a('0xa2')](loggerCatch(_0x171a('0x142')));hopperUtils['moveContactManagedDialer'](_0x22ce3a)[_0x171a('0xa2')](loggerCatch(_0x171a('0xd1')));}else{this[_0x171a('0x20')][_0xe3fc29[_0x171a('0xc3')]][_0x171a('0x143')]+=0x1;_0x52b8b6=new Hangup(_0xe3fc29,_0x46fa19);_0x52b8b6[_0x171a('0x72')]=0xc;_0x52b8b6[_0x171a('0x73')]=_0x46fa19[_0x171a('0x139')];_0x52b8b6[_0x171a('0x11a')]=_0x171a('0x144');hopperUtils[_0x171a('0xd0')](_0x52b8b6)[_0x171a('0xa2')](loggerCatch(_0x171a('0x145')));hopperUtils['moveContactManagedDialer'](_0x52b8b6)['catch'](loggerCatch(_0x171a('0x137')));}}}};Dialer['prototype'][_0x171a('0xc')]=function(_0x48ca10){var _0x160555=this;if(!_0x160555['queuesSummary'][_0x48ca10[_0x171a('0x49')]]){_0x160555[_0x171a('0x2c')][_0x48ca10['name']]={'running':![]};}else if(_0x160555[_0x171a('0x2c')][_0x48ca10[_0x171a('0x49')]][_0x171a('0x146')]===!![]){return;}else if(_0x160555[_0x171a('0x2c')][_0x48ca10['name']]['running']===![]){_0x160555[_0x171a('0x2c')][_0x48ca10[_0x171a('0x49')]][_0x171a('0x146')]=!![];}var _0x2d0d07=_0x160555[_0x171a('0x20')][_0x48ca10[_0x171a('0x49')]];var _0x9b52df=_0x2d0d07[_0x171a('0x6c')]!==utils['CAMPAIGN_STATUS']['INACTIVE'];var _0x2bbadb=utils[_0x171a('0x147')](_0x2d0d07);_0x2d0d07[_0x171a('0x148')]=utils[_0x171a('0x149')](_0x2d0d07,_0x160555[_0x171a('0x23')]);Promise[_0x171a('0x14a')]()['then'](function(){if(_0x2d0d07[_0x171a('0x148')]===utils[_0x171a('0x6f')][_0x171a('0x14b')]){if(_0x9b52df){clearPredictiveAttributes(_0x2d0d07);_0x48ca10[_0x171a('0x14c')]=undefined;_0x48ca10[_0x171a('0x65')]=undefined;}if(_0x2d0d07['statusMessage']===utils[_0x171a('0x6f')]['INACTIVE']){_0x48ca10[_0x171a('0x14d')]=0x0;_0x48ca10[_0x171a('0xfc')]=0x0;_0x48ca10['inUse']=0x0;_0x48ca10[_0x171a('0x14e')]=0x0;_0x48ca10[_0x171a('0x14f')]=0x0;}}else if(_0x2d0d07[_0x171a('0x148')]===utils[_0x171a('0x6f')][_0x171a('0x150')]&&!_0x2bbadb){return _0x160555[_0x171a('0x93')](_0x2d0d07,!![])[_0x171a('0x42')](function(){return _0x160555[_0x171a('0x93')](_0x2d0d07,![]);})['then'](function(){return _0x160555[_0x171a('0xb4')](_0x2d0d07);})[_0x171a('0xa2')](function(_0x522705){loggerSyncQueueSummary[_0x171a('0x66')](_0x171a('0x151'),util[_0x171a('0x46')](_0x522705,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x2d0d07);});}else{clearPredictiveAttributes(_0x2d0d07);}})[_0x171a('0x42')](function(){var _0x3e3217=_0x48ca10[_0x171a('0x152')](_0x2d0d07);if(_0x3e3217||_0x2d0d07[_0x171a('0x153')]){_0x2d0d07[_0x171a('0x153')]=![];_0x48ca10[_0x171a('0x154')](_0x2d0d07);Object[_0x171a('0x155')](_0x2d0d07,_0x48ca10);emitOutboundVoiceQueueSummary(_0x48ca10);}_0x160555[_0x171a('0x2c')][_0x2d0d07['name']][_0x171a('0x146')]=![];})[_0x171a('0xa2')](function(_0x49e574){logger[_0x171a('0x69')]('[syncQueueSummary]',util[_0x171a('0x46')](_0x49e574,{'showHidden':![],'depth':null}));_0x160555[_0x171a('0x2c')][_0x2d0d07[_0x171a('0x49')]][_0x171a('0x146')]=![];});};Dialer[_0x171a('0x1c')]['syncQueueSummaryComplete']=_[_0x171a('0x156')](function(){var _0x4befed=_[_0x171a('0x157')](this[_0x171a('0x20')],function(_0x10e973){return _0x10e973['dialPreviewRecallmeReminder'];});var _0x62c658=_[_0x171a('0x157')](this[_0x171a('0x22')],function(_0x17c122){return _0x17c122[_0x171a('0x158')]&&_0x17c122[_0x171a('0x8a')]===_0x171a('0x8b');});if(_0x4befed[_0x171a('0x9b')]>0x0&&_0x62c658['length']>0x0){return Promise[_0x171a('0x14a')]()[_0x171a('0x42')](cmHopper[_0x171a('0x159')](_[_0x171a('0x15a')](_0x4befed,'id'),previewRecallmeReminderInterval,_[_0x171a('0x15a')](_0x62c658,'id')))[_0x171a('0x42')](function(_0x5cd387){for(var _0x23dbe0=0x0;_0x23dbe0<_0x5cd387['length'];_0x23dbe0++){var _0x264352=_0x5cd387[_0x23dbe0]['Agent']['name'];if(_0x264352)io['to'](util[_0x171a('0x47')](_0x171a('0x15b'),_0x264352))[_0x171a('0x11c')](_0x171a('0x15c'),{'hopper':_0x5cd387[_0x23dbe0]});}})['catch'](function(_0x4553ea){logger[_0x171a('0x69')](_0x171a('0x15d'),_0x4553ea);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x171a('0x1c')][_0x171a('0x40')]=function(){var _0x4fbe88=this;setInterval(function(){_0x4fbe88[_0x171a('0x15e')](_0x4fbe88['uniqueId'],_0x171a('0x15f'));_0x4fbe88[_0x171a('0x15e')](_0x4fbe88['actions'],_0x171a('0x160'));},0x32c8);};Dialer['prototype']['clearZombieChannels']=function(_0x31ca4e,_0x3dc431){var _0x41ed28=this;for(var _0x7c82fa in _0x31ca4e){if(typeof _0x31ca4e[_0x7c82fa]!==_0x171a('0xae')){this['sequence']['enqueue'](function(){if(!_[_0x171a('0xfb')](_0x31ca4e[_0x7c82fa])){return ami[_0x171a('0x9c')]({'action':_0x171a('0x8a'),'channel':_0x31ca4e[_0x7c82fa]['channel']})['catch'](function(_0xa890fc){if(_0xa890fc[_0x171a('0x6c')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x31ca4e[_0x7c82fa]&&_0x31ca4e[_0x7c82fa][_0x171a('0x43')]!==_0x171a('0xc5')){utils[_0x171a('0xc6')](_0x41ed28[_0x171a('0x20')][_0x31ca4e[_0x7c82fa][_0x171a('0xc3')]],_0x171a('0x161'));logger[_0x171a('0x69')]('[Dialer][checkChannel]',_0x3dc431,_0x7c82fa,_0x31ca4e[_0x7c82fa]['queue']);delete _0x31ca4e[_0x7c82fa];}if(_0x31ca4e[_0x7c82fa]&&_0x31ca4e[_0x7c82fa][_0x171a('0x43')]===_0x171a('0xc5')){utils['decrementOriginate'](_0x41ed28[_0x171a('0x21')][_0x31ca4e[_0x7c82fa][_0x171a('0xc3')]],'[clearZombieChannels]');logger[_0x171a('0x69')](_0x171a('0x162'),_0x3dc431,_0x7c82fa,_0x31ca4e[_0x7c82fa][_0x171a('0xc3')]);delete _0x31ca4e[_0x7c82fa];}},0x2328);}});}});}}};Dialer['prototype'][_0x171a('0x163')]=function(_0x3b870e){return Promise[_0x171a('0x14a')]()[_0x171a('0x42')](voiceQueueRt[_0x171a('0x163')](_0x3b870e))[_0x171a('0xa2')](loggerCatch(_0x171a('0x164')));};Dialer[_0x171a('0x1c')][_0x171a('0x165')]=function(_0x4cd9d5,_0x4356c3,_0x2e7168){var _0x2721e4={'state':0x19,'statedesc':_0x171a('0x166')};utils[_0x171a('0xc6')](_0x4356c3,_0x171a('0x167')+_0x4cd9d5);this[_0x171a('0x11f')](_[_0x171a('0x63')](_0x2721e4,_[_0x171a('0x7a')](_0x2e7168,[_0x171a('0xf4'),'ListId',_0x171a('0x168'),_0x171a('0xe6'),_0x171a('0xe7')])),_0x171a('0x169'),_0x171a('0x167'));logger[_0x171a('0x69')](_0x4cd9d5);};Dialer[_0x171a('0x1c')][_0x171a('0x11f')]=function(_0x4ec2c0,_0x379886,_0x38edc7){hopperUtils[_0x171a('0xd0')](_0x4ec2c0)['catch'](loggerCatch(_0x379886));hopperUtils[_0x171a('0x13c')](_0x4ec2c0)[_0x171a('0xa2')](loggerCatch(_0x38edc7));};Dialer[_0x171a('0x1c')][_0x171a('0xe1')]=function(_0x4a30f3,_0x4a872d){hopperUtils['createHistory'](_0x4a30f3)['catch'](loggerCatch(_0x171a('0x142')));if(_0x4a872d==0x0){hopperUtils[_0x171a('0x13c')](_0x4a30f3)[_0x171a('0xa2')](loggerCatch(_0x171a('0x16a')));}};Dialer[_0x171a('0x1c')][_0x171a('0x15d')]=function(_0x531495){return Promise[_0x171a('0x14a')]()[_0x171a('0x42')](cmHopper['handlePreviewRecallNotifications'](_0x531495['id'],previewRecallmeReminderInterval))[_0x171a('0x42')](function(_0x195dc2){for(var _0x1fda31=0x0;_0x1fda31<_0x195dc2[_0x171a('0x9b')];_0x1fda31++){var _0x36966c=_0x195dc2[_0x1fda31][_0x171a('0x16b')][_0x171a('0x49')];if(_0x36966c)io['to'](util[_0x171a('0x47')](_0x171a('0x15b'),_0x36966c))[_0x171a('0x11c')](_0x171a('0x15c'),{'hopper':_0x195dc2[_0x1fda31]});}})[_0x171a('0xa2')](function(){});};Dialer[_0x171a('0x1c')][_0x171a('0xb2')]=function(_0x1c54a0){var _0x2f42fe=this;return function(){_0x2f42fe[_0x171a('0x16c')](_0x1c54a0);};};Dialer[_0x171a('0x1c')][_0x171a('0x16d')]=function(_0x69e2ce,_0x14655a){var _0x59fe50=this;var _0x1499e4=uuid['v4']();this[_0x171a('0x26')][_0x1499e4]=new Action(_0x69e2ce,_0x14655a,_0x1499e4);return new Promise(function(_0x70f34,_0x29678d){if(_[_0x171a('0x57')](_0x69e2ce)&&typeof _0x69e2ce!==_0x171a('0x16e')){return _0x29678d(msgResponse(_0x171a('0x16f'),'Failure',_0x171a('0x170')));}if(_[_0x171a('0x57')](_0x14655a[_0x171a('0x171')])||_0x14655a[_0x171a('0x171')]===null){return _0x29678d(msgResponse(_0x171a('0x16f'),_0x171a('0x94'),_0x171a('0x172')));}var _0x120bc4={'XMD-CALLERID':_0x59fe50[_0x171a('0x26')][_0x1499e4]['getCaller'](),'XMD-AGI':_0x69e2ce[_0x171a('0x173')]?util[_0x171a('0x47')]('\x22agi://%s/square,%s\x22',ipAgi,_0x69e2ce[_0x171a('0x173')]):_0x171a('0x174'),'XMD-AGIAFTER':_0x69e2ce[_0x171a('0xcd')]?util[_0x171a('0x47')](_0x171a('0x175'),ipAgi,_0x69e2ce['dialQueueProject2']):'NONE','XMD-QUEUE':utils[_0x171a('0x176')](_0x69e2ce)?util[_0x171a('0x47')](_0x171a('0x177'),_0x69e2ce[_0x171a('0x49')],_0x69e2ce[_0x171a('0x178')]||'',_0x69e2ce[_0x171a('0xce')]?'c':'',_0x69e2ce[_0x171a('0xd6')]||0x3):'NONE','XMD-CONTACTID':_0x14655a[_0x171a('0xf4')],'XMD-CDRTYPE':_0x171a('0x8'),'CALLERID(all)':_0x59fe50[_0x171a('0x26')][_0x1499e4][_0x171a('0x179')](),'XMD-AMD':_0x69e2ce[_0x171a('0x115')]?'ACTIVE':_0x171a('0x174'),'XMD-DESTINATION':_0x171a('0x17a')};if(_0x69e2ce[_0x171a('0x115')]){_0x120bc4[_0x171a('0x17b')]=_0x69e2ce[_0x171a('0x17c')]||0x9c4;_0x120bc4[_0x171a('0x17d')]=_0x69e2ce[_0x171a('0x17e')]||0x5dc;_0x120bc4[_0x171a('0x17f')]=_0x69e2ce['dialAMDAfterGreetingSilence']||0x320;_0x120bc4[_0x171a('0x180')]=_0x69e2ce[_0x171a('0x181')]||0x1388;_0x120bc4[_0x171a('0x182')]=_0x69e2ce['dialAMDMinWordLength']||0x64;_0x120bc4[_0x171a('0x183')]=_0x69e2ce['dialAMDBetweenWordsSilence']||0x32;_0x120bc4[_0x171a('0x184')]=_0x69e2ce[_0x171a('0x185')]||0x3;_0x120bc4[_0x171a('0x186')]=_0x69e2ce[_0x171a('0x187')]||0x100;_0x120bc4[_0x171a('0x188')]=_0x69e2ce[_0x171a('0x189')]||0x1388;}if(utils[_0x171a('0x176')](_0x69e2ce)){_0x120bc4[_0x171a('0x18a')]=_0x14655a[_0x171a('0xe6')];}else{_0x120bc4[_0x171a('0x18b')]=_0x14655a['CampaignId'];}var _0xf0ef9e=utils['setXMDContactVariables'](_0x14655a[_0x171a('0x18c')]);Object[_0x171a('0x155')](_0x120bc4,_0xf0ef9e);var _0x61e42=_0x59fe50[_0x171a('0x8e')](_0x69e2ce[_0x171a('0x8f')])?utils[_0x171a('0x18d')](_0x69e2ce['Trunk'][_0x171a('0x18e')],_0x69e2ce['dialOriginateCallerIdName'],_0x69e2ce[_0x171a('0x18f')]>0x0?utils[_0x171a('0x190')](_0x69e2ce['dialOriginateCallerIdNumber'],_0x69e2ce[_0x171a('0x18f')]):_0x69e2ce[_0x171a('0x191')]):utils[_0x171a('0x18d')](_[_0x171a('0xfb')](_0x69e2ce[_0x171a('0x90')])?_0x69e2ce[_0x171a('0x8f')]['callerid']:_0x69e2ce[_0x171a('0x90')]['callerid'],_0x69e2ce[_0x171a('0x192')],_0x69e2ce[_0x171a('0x18f')]>0x0?utils[_0x171a('0x190')](_0x69e2ce[_0x171a('0x191')],_0x69e2ce[_0x171a('0x18f')]):_0x69e2ce[_0x171a('0x191')]);if(_0x61e42){_0x120bc4['XMD-ORIGINATECALLERIDNAME']=_0x59fe50['actions'][_0x1499e4][_0x171a('0x193')]=utils[_0x171a('0x194')](_0x61e42);_0x120bc4[_0x171a('0x195')]=_0x14655a['phone'];}_0x69e2ce[_0x171a('0x196')]=_0x120bc4;return ami['Action']({'actionid':_0x1499e4,'action':_0x171a('0x16f'),'channel':_0x59fe50[_0x171a('0x8e')](_0x69e2ce[_0x171a('0x8f')])?util[_0x171a('0x47')](_0x171a('0x197'),_0x69e2ce[_0x171a('0x8f')]['name'],isNotNull(_0x69e2ce['dialPrefix'])?_0x69e2ce['dialPrefix'][_0x171a('0x198')]()||'':'',_0x69e2ce[_0x171a('0x199')]>0x0?_0x14655a[_0x171a('0x171')][_0x171a('0x19a')](_0x69e2ce['dialCutDigit']):_0x14655a[_0x171a('0x171')]):util[_0x171a('0x47')](_0x171a('0x197'),_[_0x171a('0xfb')](_0x69e2ce[_0x171a('0x90')])?_0x69e2ce[_0x171a('0x8f')][_0x171a('0x49')]:_0x69e2ce[_0x171a('0x90')][_0x171a('0x49')],isNotNull(_0x69e2ce[_0x171a('0x19b')])?_0x69e2ce[_0x171a('0x19b')]['trim']()||'':'',_0x69e2ce[_0x171a('0x199')]>0x0?_0x14655a[_0x171a('0x171')][_0x171a('0x19a')](_0x69e2ce[_0x171a('0x199')]):_0x14655a[_0x171a('0x171')]),'callerid':_0x61e42,'Exten':'xcally-motion-dialer','Context':_0x171a('0x19c'),'Priority':'1','variable':_0x120bc4,'timeout':(_0x69e2ce[_0x171a('0x19d')]||0x1e)*0x3e8,'async':!![],'channelid':_0x1499e4})[_0x171a('0x42')](function(_0x377d4b){return _0x70f34(_0x377d4b);})[_0x171a('0xa2')](function(_0x4e1ccf){_0x69e2ce[_0x171a('0x19e')]+=0x1;var _0x6ffef5=new History(_0x59fe50['actions'][_0x1499e4]);logger[_0x171a('0x69')](util['format'](_0x171a('0x19f'),JSON[_0x171a('0x79')](_0x4e1ccf)));_0x6ffef5[_0x171a('0x72')]=0xe;_0x6ffef5['statedesc']=_0x171a('0x1a0');_0x6ffef5[_0x171a('0x75')]=moment()[_0x171a('0x47')](_0x171a('0xcf'));_0x6ffef5[_0x171a('0x74')]=_0x6ffef5[_0x171a('0x75')];hopperUtils['createHistory'](_0x6ffef5)['catch'](loggerCatch(_0x171a('0x1a1')));_0x59fe50[_0x171a('0x13c')](_0x6ffef5)[_0x171a('0xa2')](loggerCatch('[originate][error]'))['finally'](function(){delete _0x59fe50['actions'][_0x1499e4];return _0x29678d(msgResponse(_0x171a('0x16f'),_0x171a('0x87'),_0x171a('0x1a2')));});});});};Dialer['prototype'][_0x171a('0x1a3')]=function(_0x56adc1,_0x755f1c,_0x2189f5){var _0x2596a2=new History(_0x755f1c);if(_0x2596a2['countbusyretry']+_0x2596a2[_0x171a('0x126')]+_0x2596a2[_0x171a('0x127')]+_0x2596a2[_0x171a('0x128')]+_0x2596a2[_0x171a('0xdb')]+_0x2596a2[_0x171a('0xf0')]+_0x2596a2[_0x171a('0x123')]+_0x2596a2['countagentrejectretry']>=_0x2189f5[_0x171a('0x12a')]-0x1){return!![];}switch(_0x56adc1){case 0x3:if(_0x2596a2[_0x171a('0x127')]>=_0x2189f5['dialNoAnswerMaxRetry']-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countnoanswerretry':_0x2596a2[_0x171a('0x127')]+=0x1,'scheduledat':moment()['add'](_0x2189f5[_0x171a('0x1a4')],_0x171a('0xe4'))['format'](_0x171a('0xcf')),'ContactId':_0x2596a2['ContactId'],'ListId':_0x2596a2['ListId'],'VoiceQueueId':_0x2596a2[_0x171a('0xe6')]||undefined,'CampaignId':_0x2596a2[_0x171a('0xe7')]||undefined})[_0x171a('0xa2')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x2596a2[_0x171a('0x125')]>=_0x2189f5[_0x171a('0x1a5')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countbusyretry':_0x2596a2[_0x171a('0x125')]+=0x1,'scheduledat':moment()['add'](_0x2189f5['dialBusyRetryFrequency'],'minutes')[_0x171a('0x47')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2596a2[_0x171a('0xf4')],'ListId':_0x2596a2[_0x171a('0xe5')],'VoiceQueueId':_0x2596a2[_0x171a('0xe6')]||undefined,'CampaignId':_0x2596a2[_0x171a('0xe7')]||undefined})[_0x171a('0xa2')](loggerCatch(_0x171a('0x1a6')));break;case 0x8:if(_0x2596a2[_0x171a('0x126')]>=_0x2189f5[_0x171a('0x1a7')]-0x1){return!![];}hopperUtils[_0x171a('0xf3')]({'active':![],'countcongestionretry':_0x2596a2[_0x171a('0x126')]+=0x1,'scheduledat':moment()['add'](_0x2189f5[_0x171a('0x1a8')],_0x171a('0xe4'))[_0x171a('0x47')](_0x171a('0xcf')),'ContactId':_0x2596a2[_0x171a('0xf4')],'ListId':_0x2596a2[_0x171a('0xe5')],'VoiceQueueId':_0x2596a2[_0x171a('0xe6')]||undefined,'CampaignId':_0x2596a2[_0x171a('0xe7')]||undefined})['catch'](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x2596a2[_0x171a('0x128')]>=_0x2189f5[_0x171a('0x1a9')]-0x1){return!![];}else{hopperUtils[_0x171a('0xf3')]({'active':![],'countnosuchnumberretry':_0x2596a2['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0x171a('0xe2')](_0x2189f5['dialNoSuchNumberRetryFrequency'],_0x171a('0xe4'))[_0x171a('0x47')](_0x171a('0xcf')),'ContactId':_0x2596a2[_0x171a('0xf4')],'ListId':_0x2596a2[_0x171a('0xe5')],'VoiceQueueId':_0x2596a2[_0x171a('0xe6')]||undefined,'CampaignId':_0x2596a2[_0x171a('0xe7')]||undefined})['catch'](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x2596a2[_0x171a('0xdb')]>=_0x2189f5[_0x171a('0xe0')]-0x1){return!![];}hopperUtils[_0x171a('0xf3')]({'active':![],'countdropretry':_0x2596a2['countdropretry']+=0x1,'scheduledat':moment()[_0x171a('0xe2')](_0x2189f5[_0x171a('0xe3')],_0x171a('0xe4'))[_0x171a('0x47')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2596a2[_0x171a('0xf4')],'ListId':_0x2596a2[_0x171a('0xe5')],'VoiceQueueId':_0x2596a2['VoiceQueueId']||undefined,'CampaignId':_0x2596a2[_0x171a('0xe7')]||undefined})[_0x171a('0xa2')](loggerCatch(_0x171a('0xe8')));break;case 0xb:if(_0x2596a2[_0x171a('0xf0')]>=_0x2189f5[_0x171a('0xf2')]-0x1){return!![];}hopperUtils[_0x171a('0xf3')]({'active':![],'countabandonedretry':_0x2596a2[_0x171a('0xf0')]+=0x1,'scheduledat':moment()[_0x171a('0xe2')](_0x2189f5[_0x171a('0xf1')],_0x171a('0xe4'))[_0x171a('0x47')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2596a2['ContactId'],'ListId':_0x2596a2[_0x171a('0xe5')],'VoiceQueueId':_0x2596a2['VoiceQueueId']||undefined,'CampaignId':_0x2596a2[_0x171a('0xe7')]||undefined})[_0x171a('0xa2')](loggerCatch(_0x171a('0x1aa')));break;case 0x13:if(_0x2596a2[_0x171a('0x123')]>=_0x2189f5[_0x171a('0x12c')]-0x1){return!![];}hopperUtils[_0x171a('0xf3')]({'active':![],'countmachineretry':_0x2596a2['countmachineretry']+=0x1,'scheduledat':moment()[_0x171a('0xe2')](_0x2189f5[_0x171a('0x12f')],_0x171a('0xe4'))[_0x171a('0x47')](_0x171a('0xcf')),'ContactId':_0x2596a2[_0x171a('0xf4')],'ListId':_0x2596a2[_0x171a('0xe5')],'VoiceQueueId':_0x2596a2[_0x171a('0xe6')]||undefined,'CampaignId':_0x2596a2['CampaignId']||undefined})[_0x171a('0xa2')](loggerCatch(_0x171a('0x135')));break;case 0x14:if(_0x2596a2[_0x171a('0x129')]>=_0x2189f5[_0x171a('0x1ab')]-0x1){return!![];}hopperUtils[_0x171a('0xf3')]({'active':![],'countagentrejectretry':_0x2596a2['countagentrejectretry']+=0x1,'scheduledat':moment()[_0x171a('0xe2')](_0x2189f5[_0x171a('0x1ac')],_0x171a('0xe4'))[_0x171a('0x47')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2596a2[_0x171a('0xf4')],'ListId':_0x2596a2[_0x171a('0xe5')],'VoiceQueueId':_0x2596a2[_0x171a('0xe6')]||undefined,'CampaignId':_0x2596a2[_0x171a('0xe7')]||undefined})[_0x171a('0xa2')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0x171a('0x1c')][_0x171a('0x1ad')]=function(_0x3fe572,_0x304b0c,_0x37b11e){var _0x5a46ee=this;var _0x47426f=new History(_0x3fe572);var _0x4102b8=![];var _0x45ff5d;var _0x2ea709;return new Promise(function(_0x3e499d,_0x8d513d){if(_['isUndefined'](_0x304b0c)&&typeof _0x304b0c!=='object'){return _0x8d513d(msgResponse(_0x171a('0x1ae'),_0x171a('0x94'),_0x171a('0x1af')));}if(_[_0x171a('0x57')](_0x37b11e)&&typeof _0x37b11e!=='object'){return _0x8d513d(msgResponse(_0x171a('0x1ae'),_0x171a('0x94'),_0x171a('0x1b0')));}hopperUtils['verifyAdditionalPhones'](_0x47426f,_0x37b11e['reason'],_0x304b0c)[_0x171a('0x42')](function(_0x26988c){if(_0x26988c[_0x171a('0xdf')]==0x1)_0x4102b8=!![];switch(_0x37b11e[_0x171a('0xcb')]){case'0':_0x304b0c[_0x171a('0x1b1')]+=0x1;_0x47426f[_0x171a('0x72')]=0x0;_0x47426f[_0x171a('0x73')]='NoSuchNumber';_0x47426f[_0x171a('0x128')]+=0x1;_0x47426f[_0x171a('0xdc')]+=0x1;ami[_0x171a('0x11c')]('custom:agentnosuchnumber',ut['buildObj'](_0x3fe572,_0x171a('0x1b2')));_0x45ff5d=_0x304b0c[_0x171a('0x1b3')];_0x2ea709=_0x304b0c[_0x171a('0x1b4')];hopperUtils['createHistory'](_0x47426f)[_0x171a('0xa2')](loggerCatch(_0x171a('0x124')));if(_0x5a46ee[_0x171a('0x1a3')](0x0,_0x3fe572,_0x304b0c)&&!_0x4102b8){if(_0x47426f[_0x171a('0x128')]>=_0x304b0c[_0x171a('0x1a9')]){_0x5a46ee[_0x171a('0x12d')](_0x47426f,_0x3e499d,_0x8d513d,_0x171a('0x1b5'));}else{_0x5a46ee[_0x171a('0x134')](_0x47426f,_0x3e499d,_0x8d513d,_0x171a('0x1b5'));}}break;case'3':_0x304b0c[_0x171a('0x1b6')]+=0x1;_0x47426f['state']=0x3;_0x47426f['statedesc']=_0x171a('0x1b7');_0x47426f[_0x171a('0x127')]+=0x1;_0x47426f[_0x171a('0xdc')]+=0x1;var _0x3bca81=ut[_0x171a('0x1b8')](_0x3fe572,_0x304b0c);ami['emit'](_0x171a('0x1b9'),_0x3bca81);_0x45ff5d=_0x304b0c[_0x171a('0x1a4')];_0x2ea709=_0x304b0c[_0x171a('0x1b4')];hopperUtils[_0x171a('0xd0')](_0x47426f)[_0x171a('0xa2')](loggerCatch(_0x171a('0x1ba')));if(_0x5a46ee[_0x171a('0x1a3')](0x3,_0x3fe572,_0x304b0c)&&!_0x4102b8){if(_0x47426f[_0x171a('0x127')]>=_0x304b0c['dialNoAnswerMaxRetry']){_0x5a46ee[_0x171a('0x12d')](_0x47426f,_0x3e499d,_0x8d513d,_0x171a('0x1bb'));}else{_0x5a46ee['stateGlobal'](_0x47426f,_0x3e499d,_0x8d513d,_0x171a('0x1bb'));}}break;case'5':_0x304b0c[_0x171a('0x1bc')]+=0x1;_0x47426f['state']=0x5;_0x47426f[_0x171a('0x73')]=_0x171a('0x1bd');_0x47426f[_0x171a('0x125')]+=0x1;_0x47426f['countglobal']+=0x1;ami['emit']('custom:agentbusy',ut[_0x171a('0x11d')](_0x3fe572,_0x171a('0x1be')));_0x45ff5d=_0x304b0c[_0x171a('0x1bf')];_0x2ea709=_0x304b0c[_0x171a('0x1b4')];hopperUtils[_0x171a('0xd0')](_0x47426f)[_0x171a('0xa2')](loggerCatch(_0x171a('0x1c0')));if(_0x5a46ee[_0x171a('0x1a3')](0x5,_0x3fe572,_0x304b0c)&&!_0x4102b8){if(_0x47426f[_0x171a('0x125')]>=_0x304b0c[_0x171a('0x1a5')]){_0x5a46ee['createStateFinal'](_0x47426f,_0x3e499d,_0x8d513d,_0x171a('0x1c1'));}else{_0x5a46ee[_0x171a('0x134')](_0x47426f,_0x3e499d,_0x8d513d,'reason\x205\x20busy');}}break;case'8':_0x304b0c[_0x171a('0x1c2')]+=0x1;_0x47426f['state']=0x8;_0x47426f[_0x171a('0x73')]=_0x171a('0x1c3');_0x47426f[_0x171a('0x126')]+=0x1;_0x47426f['countglobal']+=0x1;_0x45ff5d=_0x304b0c[_0x171a('0x1a8')];_0x2ea709=_0x304b0c['callAdditionalPhoneAfterMin'];ami[_0x171a('0x11c')]('custom:agentcongestion',ut[_0x171a('0x11d')](_0x3fe572,_0x171a('0x1c4')));hopperUtils['createHistory'](_0x47426f)[_0x171a('0xa2')](loggerCatch(_0x171a('0x1c5')));if(_0x5a46ee[_0x171a('0x1a3')](0x8,_0x3fe572,_0x304b0c)&&!_0x4102b8){if(_0x47426f[_0x171a('0x126')]>=_0x304b0c['dialCongestionMaxRetry']){_0x5a46ee[_0x171a('0x12d')](_0x47426f,_0x3e499d,_0x8d513d,'reason\x208\x20congestion');}else{_0x5a46ee[_0x171a('0x134')](_0x47426f,_0x3e499d,_0x8d513d,'reason\x208\x20congestion');}}break;case'11':_0x304b0c[_0x171a('0x1c6')]+=0x1;_0x47426f[_0x171a('0x72')]=0xb;_0x47426f[_0x171a('0x73')]=_0x171a('0xee');_0x47426f['countabandonedretry']+=0x1;_0x47426f[_0x171a('0xdc')]+=0x1;_0x45ff5d=_0x304b0c[_0x171a('0xf1')];_0x2ea709=_0x304b0c['callAdditionalPhoneAfterMin'];hopperUtils['createHistory'](_0x47426f)[_0x171a('0xa2')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x5a46ee[_0x171a('0x1a3')](0xb,_0x3fe572,_0x304b0c)&&!_0x4102b8){if(_0x47426f[_0x171a('0xf0')]>=_0x304b0c[_0x171a('0xf2')]){_0x5a46ee[_0x171a('0x12d')](_0x47426f,_0x3e499d,_0x8d513d,'reason\x2011\x20abandoned');}else{_0x5a46ee[_0x171a('0x134')](_0x47426f,_0x3e499d,_0x8d513d,_0x171a('0x1c7'));}}break;case'20':_0x304b0c[_0x171a('0x1c8')]+=0x1;_0x47426f[_0x171a('0x72')]=0x14;_0x47426f[_0x171a('0x73')]=_0x171a('0x1c9');_0x47426f[_0x171a('0x129')]+=0x1;_0x47426f[_0x171a('0xdc')]+=0x1;_0x45ff5d=_0x304b0c[_0x171a('0x1ac')];_0x2ea709=_0x304b0c[_0x171a('0x1b4')];ami[_0x171a('0x11c')](_0x171a('0x1ca'),ut['buildObj'](_0x3fe572,_0x171a('0x1cb')));hopperUtils[_0x171a('0xd0')](_0x47426f)[_0x171a('0xa2')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x5a46ee[_0x171a('0x1a3')](0x14,_0x3fe572,_0x304b0c)&&!_0x4102b8){if(_0x47426f[_0x171a('0x129')]>=_0x304b0c['dialAgentRejectMaxRetry']){_0x5a46ee['createStateFinal'](_0x47426f,_0x3e499d,_0x8d513d,_0x171a('0x1cc'));}else{_0x5a46ee['stateGlobal'](_0x47426f,_0x3e499d,_0x8d513d,_0x171a('0x1cc'));}}break;default:_0x304b0c['outboundUnknownCallsDay']+=0x1;_0x47426f[_0x171a('0x72')]=0xc;_0x47426f[_0x171a('0x73')]=_0x37b11e['reason'];_0x45ff5d=_0x304b0c[_0x171a('0x1ac')];_0x2ea709=_0x304b0c[_0x171a('0x1b4')];hopperUtils[_0x171a('0xd0')](_0x47426f)[_0x171a('0xa2')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x5a46ee[_0x171a('0x1a3')](_0x37b11e[_0x171a('0xcb')],_0x3fe572,_0x304b0c)&&!_0x4102b8){if(_0x47426f[_0x171a('0x125')]+_0x47426f[_0x171a('0x126')]+_0x47426f[_0x171a('0x127')]+_0x47426f[_0x171a('0x128')]+_0x47426f[_0x171a('0xdb')]+_0x47426f[_0x171a('0xf0')]+_0x47426f[_0x171a('0x123')]+_0x47426f[_0x171a('0x129')]>=_0x304b0c[_0x171a('0x12a')]){_0x5a46ee[_0x171a('0x134')](_0x47426f,_0x3e499d,_0x8d513d,_0x37b11e[_0x171a('0xcb')]);}else{_0x5a46ee[_0x171a('0x12d')](_0x47426f,_0x3e499d,_0x8d513d,_0x37b11e[_0x171a('0xcb')]);}}}})[_0x171a('0x42')](function(){if(_0x4102b8){hopperUtils[_0x171a('0xeb')](_0x47426f,_0x45ff5d,_0x2ea709)[_0x171a('0x42')](function(){return _0x3e499d(0x1);});}});});};Dialer[_0x171a('0x1c')][_0x171a('0x134')]=function(_0x5a5b0c,_0x2b268c,_0xb3180c,_0x23a362){var _0x539f00=new Final(_0x5a5b0c);_0x539f00[_0x171a('0x72')]=0xf;_0x539f00[_0x171a('0x73')]=_0x171a('0x1cd');this[_0x171a('0x12d')](_0x539f00,_0x2b268c,_0xb3180c,_0x23a362);};Dialer[_0x171a('0x1c')][_0x171a('0x12d')]=function(_0x58d735,_0x445719,_0x138ee0,_0x35dc0a){hopperUtils['moveContactManagedDialer'](_0x58d735)[_0x171a('0x42')](function(){return _0x445719(msgResponse(_0x171a('0x1ae'),_0x171a('0x110'),_0x35dc0a));})[_0x171a('0xa2')](function(){return _0x138ee0(msgResponse(_0x171a('0x1ce'),'Failure',_0x171a('0x1cf')));});};Dialer['prototype'][_0x171a('0xb6')]=function(_0x35dd90){var _0x1a844b=_0x35dd90[_0x171a('0x1d0')]/0x64;var _0x26cf5f=_0x35dd90[_0x171a('0xd7')]/(_0x35dd90[_0x171a('0xd7')]+_0x35dd90[_0x171a('0xca')]);var _0x98b199=Math['round'](_0x35dd90[_0x171a('0x1d1')]*(_0x35dd90[_0x171a('0x1d2')]/0x64));var _0x550938=Math[_0x171a('0x1d3')](_0x35dd90[_0x171a('0x1d1')]*(_0x35dd90[_0x171a('0x1d4')]/0x64));var _0x4f4434=_0x35dd90[_0x171a('0x14d')]+_0x35dd90['talking'];var _0xfaf901=Math[_0x171a('0x1d5')](_0x35dd90[_0x171a('0x5d')]*_0x35dd90[_0x171a('0x1d6')]*_0x35dd90[_0x171a('0x1d7')]*_0x35dd90[_0x171a('0x1d8')]);if(_[_0x171a('0x57')](_0x35dd90[_0x171a('0x65')])){if(!_[_0x171a('0x57')](_0x35dd90[_0x171a('0x14c')])){_0x35dd90[_0x171a('0x14c')]=undefined;loggerPredictive[_0x171a('0x69')](_0x171a('0x1d9'),_0x171a('0x1da'));}if(!_['isUndefined'](_0x35dd90[_0x171a('0x67')])){loggerPredictive[_0x171a('0x69')](_0x171a('0x1d9'),_0x171a('0x1db'));clearInterval(_0x35dd90[_0x171a('0x67')]);_0x35dd90['handlePredictive']=undefined;}_0x35dd90['startProgressive']=moment()[_0x171a('0x47')](_0x171a('0xcf'));loggerPredictive['info'](_0x35dd90[_0x171a('0x49')],_0x171a('0x1dc'),_0x35dd90[_0x171a('0x65')]);this[_0x171a('0xb8')](_0x35dd90,0x1);}else if(ifInterval(_0x35dd90['dialPredictiveInterval'],_0x35dd90[_0x171a('0x65')])){this[_0x171a('0xb8')](_0x35dd90,0x1);loggerPredictiveCalls[_0x171a('0x4c')](_0x171a('0x1dd'),_0x35dd90[_0x171a('0x65')],_0x35dd90[_0x171a('0x49')]);_0x35dd90[_0x171a('0x5d')]=0x0;_0x35dd90[_0x171a('0xd8')]=0x0;}else if(_0x1a844b<_0x26cf5f&&_0x35dd90[_0x171a('0x1de')]===_0x171a('0x1df')){clearPredictiveAttributes(_0x35dd90);loggerPredictive[_0x171a('0x4c')](_0x171a('0x1e0'),_0x171a('0x1e1'),_0x26cf5f,'startProgressive',_0x35dd90[_0x171a('0x49')]);}else if(_0xfaf901<_0x35dd90[_0x171a('0xd8')]&&_0x35dd90['dialPredictiveOptimization']===_0x171a('0x1df')){clearPredictiveAttributes(_0x35dd90);loggerPredictive['info'](_0x171a('0x1e2'),_0x171a('0x1e3'),_0xfaf901,_0x171a('0x1e4'),_0x35dd90['predictiveIntervalErlangCallsDroppedCalls'],_0x171a('0x65'),_0x35dd90[_0x171a('0x49')]);}else if(!ifInterval(_0x35dd90[_0x171a('0x1e5')],_0x35dd90[_0x171a('0x65')])&&_[_0x171a('0x57')](_0x35dd90[_0x171a('0x14c')])&&!_[_0x171a('0x57')](_0x35dd90[_0x171a('0x65')])){_0x35dd90[_0x171a('0x14c')]=moment()[_0x171a('0x47')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x171a('0x4c')](_0x35dd90[_0x171a('0x49')],_0x171a('0x1e6'),_0x35dd90[_0x171a('0x14c')]);hopperUtils['avgHandleTime'](_0x35dd90[_0x171a('0x1e5')])['then'](this[_0x171a('0x1e7')](_0x35dd90))[_0x171a('0x42')](mergeDataErlangB(_0x35dd90))[_0x171a('0x42')](this[_0x171a('0x1e8')](_0x35dd90))['catch'](loggerCatchPredictive(_0x171a('0x1e9'),_0x35dd90));}else if(!ifInterval(_0x35dd90[_0x171a('0x1e5')],_0x35dd90[_0x171a('0x14c')])){_0x35dd90[_0x171a('0xd8')]=0x0;_0x35dd90[_0x171a('0x14c')]=moment()[_0x171a('0x47')](_0x171a('0xcf'));loggerPredictive[_0x171a('0x4c')](_0x35dd90['name'],_0x171a('0x1ea'),_0x35dd90[_0x171a('0x14c')]);clearInterval(_0x35dd90[_0x171a('0x67')]);_0x35dd90[_0x171a('0x67')]=undefined;hopperUtils[_0x171a('0x1eb')](_0x35dd90[_0x171a('0x1e5')])[_0x171a('0x42')](this[_0x171a('0x1e7')](_0x35dd90))[_0x171a('0x42')](mergeDataErlangB(_0x35dd90))['then'](this[_0x171a('0x1e8')](_0x35dd90))[_0x171a('0xa2')](loggerCatchPredictive(_0x171a('0x1ec'),_0x35dd90));}else if(_0x35dd90[_0x171a('0x1d1')]&&_0x4f4434<_0x35dd90['predictiveIntervalAvailable']-_0x550938){clearPredictiveAttributes(_0x35dd90);loggerPredictive['info'](_0x35dd90[_0x171a('0x49')],_0x171a('0x1ed'),_0x4f4434,')\x20are\x20less\x20than\x20threshold\x20(',_0x35dd90[_0x171a('0x1d1')],'-',_0x550938,'=',_0x35dd90['predictiveIntervalAvailable']-_0x550938,')');}else if(_0x35dd90[_0x171a('0x1d1')]&&_0x4f4434>_0x35dd90[_0x171a('0x1d1')]+_0x98b199){clearPredictiveAttributes(_0x35dd90);loggerPredictive[_0x171a('0x4c')](_0x35dd90[_0x171a('0x49')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x4f4434,')\x20are\x20more\x20than\x20threshold\x20(',_0x35dd90[_0x171a('0x1d1')],'+',_0x98b199,'=',_0x35dd90[_0x171a('0x1d1')]+_0x98b199,')');}};Dialer[_0x171a('0x1c')][_0x171a('0x1e7')]=function(_0x5d3785){var _0x427c4d=this;return function(_0xec9a20){return new Promise(function(_0x559481,_0x3ee409){_[_0x171a('0x63')](_0x5d3785,_0xec9a20[0x0]);if(checkGetDataPredictive(_0xec9a20[0x0])){var _0x3eec2b=_0x5d3785[_0x171a('0x1d1')]=_0x5d3785[_0x171a('0x14e')]+_0x5d3785[_0x171a('0x14d')];var _0x13e819=_0x5d3785[_0x171a('0x1e5')]*0x3c;var _0x41569b=_0xec9a20[0x0][_0x171a('0x58')]+_0xec9a20[0x0][_0x171a('0x54')];var _0x16f33b=(_0xec9a20[0x0][_0x171a('0x4f')]+_0xec9a20[0x0]['predictiveIntervalDroppedCallsTimeout']+_0xec9a20[0x0][_0x171a('0xec')])/_0xec9a20[0x0][_0x171a('0x56')];_0x5d3785['predictiveIntervalHitRate']=_0x16f33b>0x0?_0x16f33b:0x1;switch(_0x5d3785[_0x171a('0x1de')]){case'dropRate':var _0x916cc5=_0x5d3785[_0x171a('0x1d0')]/0x64;return _0x427c4d[_0x171a('0x1ee')](_0x3eec2b,_0x13e819,_0x41569b,_0x16f33b,_0x916cc5)[_0x171a('0x42')](function(_0x3299fc){return _0x559481(_0x3299fc);});case _0x171a('0x1ef'):var _0x52b035=_0x5d3785[_0x171a('0x1d0')]/0x64;return _0x427c4d['busyFactor'](_0x3eec2b,_0x13e819,_0x41569b,_0x16f33b,_0x52b035)[_0x171a('0x42')](function(_0x3d5dc2){return _0x559481(_0x3d5dc2);});default:return _0x3ee409(msgResponse(_0x171a('0x1f0'),'Failure',_0x171a('0x1f1')));}}else{return _0x3ee409(msgResponse('[getDataPredictive]',_0x171a('0x94'),'check\x20failure'));}});};};Dialer[_0x171a('0x1c')][_0x171a('0x1f2')]=function(_0x1df1de){var _0x4f8a14=this;return function(_0x48ce28){return new Promise(function(_0x20963e,_0x9656e9){_[_0x171a('0x63')](_0x1df1de,_0x48ce28[0x0]);if(checkGetDataPredictive(_0x48ce28[0x0])){loggerPredictive['info'](JSON['stringify'](_0x48ce28[0x0]));if(_0x1df1de[_0x171a('0x1de')]===_0x171a('0x1df')){return _0x4f8a14[_0x171a('0x163')](_0x1df1de['id'])[_0x171a('0x42')](function(_0x189bcd){var _0x2edca2=_0x1df1de[_0x171a('0x1f3')]-_0x189bcd[0x0][_0x171a('0x1f4')];var _0x2b156a=_0x1df1de[_0x171a('0x1e5')]*0x3c;var _0x16c84f=_0x48ce28[0x0][_0x171a('0x58')]+_0x48ce28[0x0]['predictiveIntervalAvgHoldtime'];var _0x5cc0d4=(_0x48ce28[0x0][_0x171a('0x4f')]+_0x48ce28[0x0][_0x171a('0x51')]+_0x48ce28[0x0][_0x171a('0xec')])/_0x48ce28[0x0][_0x171a('0x56')];var _0x2cf02f=_0x1df1de[_0x171a('0x1d0')]/0x64;_0x1df1de[_0x171a('0x1f5')]=_0x189bcd[0x0][_0x171a('0x1f4')]||0x0;_0x1df1de[_0x171a('0x1d7')]=_0x5cc0d4>0x0?_0x5cc0d4:0x1;return _0x4f8a14[_0x171a('0x1ee')](_0x2edca2,_0x2b156a,_0x16c84f,_0x5cc0d4,_0x2cf02f);})[_0x171a('0x42')](function(_0x3c0772){return _0x20963e(_0x3c0772);})[_0x171a('0xa2')](function(_0x39ee1a){return _0x9656e9(msgResponse('[CatchErlangB]',_0x171a('0x94'),JSON[_0x171a('0x79')](_0x39ee1a)));});}if(_0x1df1de[_0x171a('0x1de')]==='agentBusyFactor'){return _0x4f8a14[_0x171a('0x163')](_0x1df1de['id'])[_0x171a('0x42')](function(_0x156045){var _0x28c1f8=_0x1df1de[_0x171a('0x1f3')]-_0x156045[0x0][_0x171a('0x1f4')];var _0x321103=_0x1df1de[_0x171a('0x1e5')]*0x3c;var _0x4a1b51=_0x48ce28[0x0][_0x171a('0x58')]+_0x48ce28[0x0][_0x171a('0x54')];var _0x9b038b=(_0x48ce28[0x0][_0x171a('0x4f')]+_0x48ce28[0x0][_0x171a('0x51')]+_0x48ce28[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x48ce28[0x0][_0x171a('0x56')];var _0x50b67e=_0x1df1de[_0x171a('0x1d0')]/0x64;_0x1df1de[_0x171a('0x1f5')]=_0x156045[0x0]['outboundQueuePauses']||0x0;_0x1df1de[_0x171a('0x1d7')]=_0x9b038b>0x0?_0x9b038b:0x1;return _0x4f8a14[_0x171a('0x1f6')](_0x28c1f8,_0x321103,_0x4a1b51,_0x9b038b,_0x50b67e);})['then'](function(_0x30ecbb){return _0x20963e(_0x30ecbb);})[_0x171a('0xa2')](function(_0x4154f){return _0x9656e9(msgResponse(_0x171a('0x1f7'),_0x171a('0x94'),JSON['stringify'](_0x4154f)));});}}else{return _0x9656e9(msgResponse(_0x171a('0x1f0'),_0x171a('0x94'),_0x171a('0x1f8')));}});};};Dialer[_0x171a('0x1c')][_0x171a('0x1e8')]=function(_0x3fddd4){var _0x2b9c4d=this;return function(){var _0x4c1617=0x0;var _0x2be29a=Math[_0x171a('0x1d5')](_0x3fddd4['erlangCallToSecond']*0x3e8);if(_0x2be29a>0x0){_0x2be29a=_0x2be29a<0x64?0x64:_0x2be29a;loggerPredictive['info'](_0x3fddd4[_0x171a('0x49')],'one\x20call\x20every:',_0x2be29a,'milliseconds');_0x3fddd4[_0x171a('0x67')]=setInterval(function(){_0x2b9c4d[_0x171a('0x67')](_0x3fddd4);loggerPredictiveCalls[_0x171a('0x4c')](_0x171a('0x1f9'),_0x4c1617+=0x1);},_0x2be29a);}else{loggerPredictive['info'](_0x3fddd4[_0x171a('0x49')],_0x171a('0x1fa'));}};};Dialer['prototype']['checkContactBlack']=function(_0xeb846d,_0x4a7ec4){var _0x4a3e64=this;return function(_0x4d0d85){if(_['isEmpty'](_0x4d0d85)){if(_[_0x171a('0xfb')](_0x4a7ec4[_0x171a('0x168')])||!_0x4a7ec4[_0x171a('0x1fb')]){if(_0xeb846d[_0x171a('0xb5')]===_0x171a('0xa')){_0xeb846d[_0x171a('0x76')]=_[_0x171a('0x57')](_0xeb846d[_0x171a('0x76')])?!![]:_0xeb846d[_0x171a('0x76')];var _0x411c65=uuid['v4']();_0x4a3e64[_0x171a('0x26')][_0x411c65]=new Action(_0xeb846d,_0x4a7ec4,_0x411c65);loggerBooked[_0x171a('0x4c')](_0x171a('0x1fc'),_0x411c65,_0x171a('0x1fd'),JSON[_0x171a('0x79')](_0xeb846d[_0x171a('0x76')]),_0x171a('0x1fe'),_0xeb846d[_0x171a('0x49')]);if(_0xeb846d[_0x171a('0x76')]){_0xeb846d[_0x171a('0x76')]=![];_0x4a3e64[_0x171a('0x2a')][_0x4a3e64[_0x171a('0x26')][_0x411c65][_0x171a('0xc3')]]=[];ami[_0x171a('0x9c')]({'actionid':_0x411c65,'action':'queuestatus','queue':_0xeb846d[_0x171a('0x49')]})[_0x171a('0xa2')](function(){utils['decrementOriginate'](_0xeb846d,_0x171a('0x1ff'));hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x4a3e64[_0x171a('0x26')][_0x411c65][_0x171a('0xf4')],'ListId':_0x4a3e64[_0x171a('0x26')][_0x411c65][_0x171a('0xe5')],'VoiceQueueId':_0x4a3e64[_0x171a('0x26')][_0x411c65][_0x171a('0xe6')]||undefined,'CampaignId':_0x4a3e64[_0x171a('0x26')][_0x411c65][_0x171a('0xe7')]||undefined})[_0x171a('0xa2')](loggerCatch(_0x171a('0x200')));delete _0x4a3e64[_0x171a('0x26')][_0x411c65];});}else{loggerBooked[_0x171a('0x4c')](_0x171a('0x201'),JSON[_0x171a('0x79')](_0xeb846d['queueStatusComplete']),_0x171a('0x1fe'),_0xeb846d[_0x171a('0x49')]);utils[_0x171a('0xc6')](_0xeb846d,_0x171a('0x1ff'));hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x4a3e64['actions'][_0x411c65][_0x171a('0xf4')],'ListId':_0x4a3e64[_0x171a('0x26')][_0x411c65][_0x171a('0xe5')],'VoiceQueueId':_0x4a3e64['actions'][_0x411c65][_0x171a('0xe6')]||undefined,'CampaignId':_0x4a3e64[_0x171a('0x26')][_0x411c65]['CampaignId']||undefined})['catch'](loggerCatch(_0x171a('0x200')));delete _0x4a3e64[_0x171a('0x26')][_0x411c65];}}else{return _0x4a3e64[_0x171a('0x16d')](_0xeb846d,_0x4a7ec4);}}else{if(utils[_0x171a('0x64')](undefined,_0x4a7ec4[_0x171a('0x202')])<_0xeb846d[_0x171a('0x203')]*0x3c){if(_0x4a7ec4['Agent']&&!_0x4a7ec4[_0x171a('0x16b')]['voicePause']){_0x4a3e64[_0x171a('0x1f')]['run'](_0x4a7ec4['id'])['finally'](function(){utils['decrementOriginate'](_0xeb846d,'[checkContactBlack]');});}else{hopperUtils[_0x171a('0x204')]({'active':![]},_0x4a7ec4['id'],0x1)[_0x171a('0x101')](function(){utils[_0x171a('0xc6')](_0xeb846d,'[checkContactBlack]');});}}else{_0xeb846d['outboundReCallsDay']+=0x1;utils['decrementOriginate'](_0xeb846d,_0x171a('0x1ff'));if(_0xeb846d['dialRecallInQueue']){hopperUtils['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x4a7ec4[_0x171a('0xf4')],'ListId':_0x4a7ec4[_0x171a('0xe5')],'VoiceQueueId':_0x4a7ec4[_0x171a('0xe6')]||undefined,'CampaignId':_0x4a7ec4['CampaignId']||undefined})[_0x171a('0xa2')](loggerCatch(_0x171a('0x205')));hopperUtils[_0x171a('0xd0')](createObjHistory(_0xeb846d,_0x4a7ec4,utils[_0x171a('0x6f')][_0x171a('0x206')],0x17,_0x171a('0x207')))[_0x171a('0xa2')](loggerCatch(_0x171a('0x208')));}else{_0x4a3e64[_0x171a('0x11f')](createObjHistory(_0xeb846d,_0x4a7ec4,utils['CAMPAIGN_STATUS'][_0x171a('0x209')],0x16,_0x171a('0x20a')),'[Originate][HistoryRecallClose][historyCatch]',_0x171a('0x20b'));}}}}else{_0xeb846d[_0x171a('0x20c')]+=0x1;_0x4a3e64[_0x171a('0x11f')](createObjHistory(_0xeb846d,_0x4a7ec4,utils[_0x171a('0x6f')][_0x171a('0x20d')],0xd,_0x171a('0x20e')),_0x171a('0x20f'),_0x171a('0x210'));throw _0x171a('0x211');}};};Dialer[_0x171a('0x1c')][_0x171a('0x16c')]=function(_0xa4d0d7){var _0x5aa462=this;var _0x3fed25=_0xa4d0d7['limitCalls']-_0xa4d0d7['originated'];emitCampaignSummary(_0xa4d0d7);if(_0x3fed25>0x0&&_0xa4d0d7[_0x171a('0x212')]==0x0){if(_0x3fed25>this['maxNumberOriginate']){_0x3fed25=this[_0x171a('0x24')];}_0xa4d0d7[_0x171a('0x212')]=0x1;hopperUtils[_0x171a('0x213')](_0xa4d0d7,_0x3fed25)['then'](function(_0x18e110){_0xa4d0d7[_0x171a('0x212')]=0x0;if(_0x18e110){if(!utils[_0x171a('0x214')](_0x18e110)){_0xa4d0d7[_0x171a('0x6c')]=utils[_0x171a('0x6f')][_0x171a('0x70')];logger[_0x171a('0x4c')](_0x171a('0x215')+_0xa4d0d7[_0x171a('0x49')]);}else{_0xa4d0d7[_0x171a('0x81')]+=_0x18e110[_0x171a('0x9b')];_0xa4d0d7[_0x171a('0x6c')]=utils[_0x171a('0x6f')][_0x171a('0x216')];for(var _0x12e616=0x0;_0x12e616<_0x18e110[_0x171a('0x9b')];_0x12e616+=0x1){_0xa4d0d7[_0x171a('0x217')]+=0x1;if(_[_0x171a('0xfb')](_0x18e110[_0x12e616])||_[_0x171a('0xfb')](_0x18e110[_0x12e616][_0x171a('0x18c')])||_[_0x171a('0xfb')](_0x18e110[_0x12e616][_0x171a('0x171')])){_0x5aa462[_0x171a('0x165')]('[actionOriginate]\x20',_0xa4d0d7,_0x18e110[_0x12e616]);}else{hopperUtils[_0x171a('0x218')](_[_0x171a('0x7a')](_0x18e110[_0x12e616],[_0x171a('0xe7'),_0x171a('0x171')]))[_0x171a('0x42')](_0x5aa462[_0x171a('0x219')](_0xa4d0d7,_0x18e110[_0x12e616]))[_0x171a('0xa2')](function(_0x5ef1f4){logger[_0x171a('0x69')](_0x171a('0x21a'),_0x5ef1f4);utils['decrementOriginate'](_0xa4d0d7,_0x171a('0x21b'));});}}}}})['catch'](function(_0x448cbb){_0xa4d0d7[_0x171a('0x212')]=0x0;logger['error'](_0x171a('0x21c'),_0x448cbb);});}};Dialer[_0x171a('0x1c')][_0x171a('0xb8')]=function(_0x305a44,_0x445529){var _0x3f525f=this;var _0x215eda=[];if(_0x445529<0x1||_0x305a44[_0x171a('0xb5')]==='booked'){_0x445529=0x1;}var _0x54bd0c=Math[_0x171a('0x1d5')](_0x305a44[_0x171a('0x14d')]*_0x445529)-_0x305a44[_0x171a('0x81')];if(_0x305a44[_0x171a('0x21d')]>0x0){var _0x59df91=_0x305a44[_0x171a('0x21d')]-_0x305a44[_0x171a('0x81')]-_0x305a44[_0x171a('0x14e')]-_0x305a44[_0x171a('0x14f')];if(_0x54bd0c>_0x59df91){_0x54bd0c=_0x59df91;}}if(_0x54bd0c>0x0&&_0x305a44[_0x171a('0x212')]==0x0){if(_0x305a44['dialMethod']===_0x171a('0xa')){_0x54bd0c=0x1;}if(_0x54bd0c>this[_0x171a('0x24')]){_0x54bd0c=this['maxNumberOriginate'];}for(var _0x56424d in this[_0x171a('0x22')]){if(typeof this[_0x171a('0x22')][_0x56424d]!==_0x171a('0xae')){if(this[_0x171a('0x22')][_0x56424d]['state']===_0x171a('0x21e')&&this[_0x171a('0x22')][_0x56424d]['status']===_0x171a('0x8b')){_0x215eda['push'](this['agents'][_0x56424d]['id']);}}}_0x305a44[_0x171a('0x212')]=0x1;hopperUtils[_0x171a('0x21f')](_0x305a44,_0x215eda,_0x54bd0c)[_0x171a('0x42')](function(_0x38474d){_0x305a44['temp']=0x0;if(_0x38474d){if(!utils[_0x171a('0x214')](_0x38474d)){hopperUtils['countReScheduled'](_0x305a44)[_0x171a('0x42')](sendMessageReschedule(_0x305a44))['catch'](loggerCatch(_0x171a('0x220')));}else{_0x305a44[_0x171a('0x81')]+=_0x38474d[_0x171a('0x9b')];_0x305a44['message']=_0x305a44['dialMethod']===_0x171a('0xa')?utils['CAMPAIGN_STATUS'][_0x171a('0x150')]:utils[_0x171a('0x6f')][_0x171a('0x216')];for(var _0x4dfb01=0x0;_0x4dfb01<_0x38474d['length'];_0x4dfb01+=0x1){if(_[_0x171a('0xfb')](_0x38474d[_0x4dfb01])||_['isNil'](_0x38474d[_0x4dfb01]['Contact'])||_[_0x171a('0xfb')](_0x38474d[_0x4dfb01][_0x171a('0x171')])){_0x3f525f[_0x171a('0x165')]('[actionOriginate]\x20',_0x305a44,_0x38474d[_0x4dfb01]);}else{hopperUtils[_0x171a('0x221')](_['pick'](_0x38474d[_0x4dfb01],[_0x171a('0xe6'),_0x171a('0x171')]))[_0x171a('0x42')](_0x3f525f[_0x171a('0x219')](_0x305a44,_0x38474d[_0x4dfb01]))['catch'](function(_0x1a168c){logger['error'](_0x171a('0x222'),_0x1a168c);utils[_0x171a('0xc6')](_0x305a44,'[handlePower]');});}}}}})[_0x171a('0xa2')](function(_0x216608){_0x305a44['temp']=0x0;logger['error'](_0x171a('0x21c'),_0x216608);});}};Dialer[_0x171a('0x1c')]['handlePredictive']=function(_0x3fd0e4){if(_0x3fd0e4[_0x171a('0x21d')]>0x0){var _0x2363b5=_0x3fd0e4[_0x171a('0x21d')]-_0x3fd0e4['originated']-_0x3fd0e4[_0x171a('0x14e')];if(_0x2363b5>0x0&&_0x3fd0e4['temp']==0x0){this[_0x171a('0x223')](_0x3fd0e4);}else{loggerPredictiveCalls[_0x171a('0x4c')](_0x171a('0x224'));}}else{this['tryOriginatePredictive'](_0x3fd0e4);}};Dialer[_0x171a('0x1c')][_0x171a('0x223')]=function(_0x582ea2){var _0x8543c6=this;var _0x5771a3=[];_0x582ea2[_0x171a('0x81')]+=0x1;for(var _0x1a75e1 in this['agents']){if(typeof this[_0x171a('0x22')][_0x1a75e1]!=='undefined'){if(this[_0x171a('0x22')][_0x1a75e1][_0x171a('0x72')]===_0x171a('0x21e')&&this[_0x171a('0x22')][_0x1a75e1][_0x171a('0x8a')]===_0x171a('0x8b')){_0x5771a3['push'](this[_0x171a('0x22')][_0x1a75e1]['id']);}}}_0x582ea2[_0x171a('0x212')]=0x1;return this['getContactDialer'](_0x582ea2['id'],_0x5771a3,0x1,_0x582ea2[_0x171a('0x225')],_0x582ea2)[_0x171a('0x42')](function(_0x3a037b){_0x582ea2['temp']=0x1;if(_0x3a037b){if(!utils[_0x171a('0x214')](_0x3a037b)){utils[_0x171a('0x226')](_0x582ea2,0x1,0x0);return hopperUtils[_0x171a('0x227')](_0x582ea2)[_0x171a('0x42')](sendMessageReschedule(_0x582ea2))[_0x171a('0xa2')](loggerCatch(_0x171a('0x220')));}else{_0x582ea2['message']=utils[_0x171a('0x6f')][_0x171a('0x216')];if(_['isNil'](_0x3a037b[0x0])||_[_0x171a('0xfb')](_0x3a037b[0x0][_0x171a('0x18c')])||_['isNil'](_0x3a037b[0x0]['phone'])){_0x8543c6[_0x171a('0x165')]('[actionOriginate]\x20',_0x582ea2,_0x3a037b[0x0]);}else{return hopperUtils['checkIsBlackList'](_['pick'](_0x3a037b[0x0],[_0x171a('0xe6'),_0x171a('0x171')]))[_0x171a('0x42')](_0x8543c6[_0x171a('0x219')](_0x582ea2,_0x3a037b[0x0]))['catch'](function(_0x41add8){logger[_0x171a('0x69')](_0x171a('0x228'),_0x41add8);utils[_0x171a('0xc6')](_0x582ea2,'[actionOriginatePredictive]');});}}}})[_0x171a('0xa2')](function(_0x131fac){_0x582ea2[_0x171a('0x212')]=0x0;logger['error']('[getContactCampaign2]',_0x131fac);});};Dialer[_0x171a('0x1c')][_0x171a('0x1ee')]=function(_0x3e06c7,_0x2ec1ce,_0x198d0a,_0x16e3c2,_0x26ce33,_0x9359b7){loggerPredictive['info'](_0x171a('0x229'));loggerPredictive['info'](_0x171a('0x22a'),_0x3e06c7);loggerPredictive[_0x171a('0x4c')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2ec1ce);loggerPredictive[_0x171a('0x4c')](_0x171a('0x22b'),_0x198d0a);loggerPredictive[_0x171a('0x4c')]('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',_0x16e3c2);loggerPredictive[_0x171a('0x4c')](_0x171a('0x22c'),_0x26ce33);loggerPredictive[_0x171a('0x4c')](_0x171a('0x55'));return new Promise(function(_0x3b662d,_0x5ee466){if(_0x3e06c7<=0x0||isNaN(_0x3e06c7)){return _0x5ee466(msgResponse(_0x171a('0x22d'),_0x171a('0x87'),_0x171a('0x22e')+_0x3e06c7));}if(_0x198d0a<=0x0||isNaN(_0x198d0a)){return _0x5ee466(msgResponse(_0x171a('0x22d'),'Error','Ts\x20=\x20'+_0x198d0a));}if(_0x16e3c2<=0x0||isNaN(_0x16e3c2)){return _0x5ee466(msgResponse(_0x171a('0x22d'),_0x171a('0x87'),_0x171a('0x22f')+_0x16e3c2));}if(_0x2ec1ce<=0x0||isNaN(_0x2ec1ce)){return _0x5ee466(msgResponse(_0x171a('0x22d'),'Error',_0x171a('0x230')+_0x2ec1ce));}if(_0x26ce33<=0x0||isNaN(_0x26ce33)){return _0x5ee466(msgResponse(_0x171a('0x22d'),_0x171a('0x87'),'Amax\x20=\x20'+_0x26ce33));}_0x9359b7=_0x9359b7||0x0;var _0x55fd58=0x1/_0x198d0a;var _0x2f0595=0x0;var _0x53306c=0x0;var _0x43bc94=0x0;var _0x2b3ca6=0x0;for(var _0x550fcc=0x0;_0x43bc94<_0x26ce33;_0x550fcc+=0x1){_0x53306c=_0x550fcc/_0x2ec1ce;_0x2f0595=(_0x16e3c2*_0x53306c+_0x9359b7)/_0x55fd58;_0x43bc94=utils[_0x171a('0x231')](_0x2f0595,_0x3e06c7);_0x2b3ca6=_0x2f0595/_0x3e06c7*(0x1-utils[_0x171a('0x231')](_0x2f0595,_0x3e06c7));}return _0x3b662d({'erlangCalls':_0x550fcc,'erlangCallToSecond':_0x2ec1ce/_0x550fcc,'erlangAbandonmentRate':_0x43bc94,'erlangBusyFactor':_0x2b3ca6});});};Dialer[_0x171a('0x1c')][_0x171a('0x1f6')]=function(_0x598dc8,_0x5b5a40,_0x11e1b5,_0x384eb2,_0x454794,_0x469ced){loggerPredictive['info'](_0x171a('0x232'));loggerPredictive[_0x171a('0x4c')](_0x171a('0x22a'),_0x598dc8);loggerPredictive[_0x171a('0x4c')](_0x171a('0x233'),_0x5b5a40);loggerPredictive[_0x171a('0x4c')](_0x171a('0x22b'),_0x11e1b5);loggerPredictive['info']('P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x384eb2);loggerPredictive[_0x171a('0x4c')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x454794);loggerPredictive[_0x171a('0x4c')](_0x171a('0x55'));return new Promise(function(_0xfb9c9b,_0x3b1614){if(_0x598dc8<=0x0||isNaN(_0x598dc8)){return _0x3b1614(msgResponse(_0x171a('0x234'),'Error',_0x171a('0x22e')+_0x598dc8));}if(_0x11e1b5<=0x0||isNaN(_0x11e1b5)){return _0x3b1614(msgResponse('[busyFactor]',_0x171a('0x87'),_0x171a('0x235')+_0x11e1b5));}if(_0x384eb2<=0x0||isNaN(_0x384eb2)){return _0x3b1614(msgResponse(_0x171a('0x234'),_0x171a('0x87'),'p\x20=\x20'+_0x384eb2));}if(_0x5b5a40<=0x0||isNaN(_0x5b5a40)){return _0x3b1614(msgResponse(_0x171a('0x234'),'Error','interval\x20=\x20'+_0x5b5a40));}if(_0x454794<=0x0||isNaN(_0x454794)){return _0x3b1614(msgResponse(_0x171a('0x234'),'Error',_0x171a('0x236')+_0x454794));}_0x469ced=_0x469ced||0x0;var _0x4dc4f9=0x1/_0x11e1b5;var _0x50b159=0x0;var _0x502cbf=0x0;var _0x4118eb=0x0;var _0x194a15=0x0;for(var _0x2a6029=0x0;_0x194a15<_0x454794;_0x2a6029+=0x1){_0x502cbf=_0x2a6029/_0x5b5a40;_0x50b159=(_0x384eb2*_0x502cbf+_0x469ced)/_0x4dc4f9;_0x4118eb=utils['erlangb'](_0x50b159,_0x598dc8);_0x194a15=_0x50b159/_0x598dc8*(0x1-utils[_0x171a('0x231')](_0x50b159,_0x598dc8));}return _0xfb9c9b({'erlangCalls':_0x2a6029,'erlangCallToSecond':_0x5b5a40/_0x2a6029,'erlangAbandonmentRate':_0x4118eb,'erlangBusyFactor':_0x194a15});});};module['exports']=Dialer;
\ No newline at end of file