Built motion from commit ff78e754.|2.6.29
[motion2.git] / server / services / ami / dialer / index.js
index 75fe4da..b7fb98f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x59c3=['[syncAgentComplete][createHistory][11]','syncNewExten','channel','actionid','strategy','rrmemory','isNil','locked','paused','stateinterface','queueBooked','roundrobin','idHopper','[Catch][Preview][syncQueueStatusComplete]','finally','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','run','[booked][RR][finaly]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','response','Success','callProgressDetecting','[callProgressDetecting]\x20','variable','amdstatus','exten','dialAMDActive','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','emit','custom:amd','amd','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','value','MACHINE','Machine','membername','AMD','buildObj','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countmachineretry','countagentrejectretry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countnosuchnumberretry','dialGlobalMaxRetry','[rescheduleContact][Machine]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','cause-txt','outboundUnknownCallsDay','Unknow','running','isPreviewCampaign','statusMessage','getQueueCampaignStatusMessage','available','talking','pTalking','ACTIVE','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','[syncQueueSummary]','throttle','filter','dialPreviewRecallmeReminder','online','handlePreviewRecallNotifications','map','Agent','user:%s','checkPreviewRecallReminder','clearZombieChannels','No\x20such\x20channel','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','UserId','[emptyContact][createHistory]','[emptyContact]','[syncQueueCallerAbandon]\x20[Drop]','user:dialPreviewRecallReminder','handleIvr','actionOriginate','object','originate','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','isOutboundQueue','dialQueueOptions','dialQueueTimeout','dialAMDInitialSilence','XMD-AMDGREETING','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','setXMDContactVariables','Contact','getCallerId','Trunk','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','XMD-ORIGINATECALLERIDNUM','phone','variables','dialPrefix','trim','dialCutDigit','SIP/%s/%s%s','xcally-motion-dialer','from-sip','dialOriginateTimeout','OriginateError','[originate][error]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','nosuchnumber','checkRetriveMax','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','buildNoAnswerEventPayload','custom:agentnoanswer','dialNoAnswerRetryFrequency','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','outboundDropCallsDayTimeout','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','round','predictiveIntervalMinThreshold','floor','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','avgHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','agentBusyFactor','busyFactor','[getDataPredictive]','getDataPredictiveOld','loggedIn','predictiveIntervalPauses','outboundQueuePauses','abandonmentRate','[CatchErlangB]','check\x20failure','one\x20call\x20every:','[handlePredictive]','checkContactBlack','[booked][checkContactBlack]','queueStatusComplete:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','voicePause','unlockContact','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','inBlackList','limitCalls','getContactDialerIvr','checkContactEmpty','NO_AVAILABLE_CONTACTS','[getContactCampaign2][Empty]','ivrTotalCallsDays','emptyContact','checkIsBlackListIvr','[actionOriginateIvr]\x20','[getContactCampaign2]','not_inuse','[countReScheduled]\x20','RUNNING','checkIsBlackList','tryOriginatePredictive','[handlePredictive][limitChannel]','getContactDialer','countReScheduled','[actionOriginate]\x20','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','m\x20=\x20','[abandonmentRate]','Ts\x20=\x20','interval\x20=\x20','erlangb','----\x20Agent\x20Busy\x20Factor\x20----','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','p\x20=\x20','exports','util','lodash','uuid','moment','ioredis','./utils','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','../ami','defaults','localhost','socket.io-emitter','redis','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/setting','./models/action','./models/history','./models/final','./models/agentComplete','./models/queueCallerAbandon','./models/hangup','env','XCALLY_IP_AGI','127.0.0.1','prototype','enqueue','tail','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','startPredictive','ivrOriginated','queueBookedRR','queuesSummary','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','syncQueueSummaryComplete','syncHangup','newexten','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','isUndefined','type','outbound','format','voice:queue:%s','voice_queue:save','isEmpty','info','-----\x20Stats\x20Predictive\x20---','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','predictiveIntervalAvgHoldtime','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','merge','getSeconds','startProgressive','debug','name','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','inspect','checkContactLowerLimitOriginate','temp','contactsRescheduled','message','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contacts','statedesc','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','pick','Interval','NULL_INTERVAL','Intervals','\x20INTERVAL_IS_NULL','campaign:ivr:%s','campaign:save','sendMessageOneNotActive','originated','INACTIVE','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','DISACTIVED','is\x20disactive','[ifTime][Action]','Error','stringify','isTrunkReachable','active','status','reachable','SIP/%s','unmonitored','checkIsTrunkReachable','TrunkBackup','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTimeIvr','Failure','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','ifTime','\x20Intervals\x20is\x20empty\x20','UNKNOWN_TIMEZONE','isArray','length','Action','command','then','indexOf','true','catch','push','iftime\x20%s,%s','timezones','content','all','some','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','resetActiveCalls','syncCampaigns','undefined','isIVRCampaign','isIVRCampaignActive','resolve','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','launchHandleIvr','[syncCampaigns]','checkDialMethod','dialMethod','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','AMI\x20IfTime','queue','uniqueid','outboundAnswerCallsDay','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','ivr','updateOriginated','droptime','YYYY-MM-DD\x20HH:mm:ss','responsetime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','state','Drop','dropreason','TIMEOUT','countglobal','dialDropRetryFrequency','voiceQueue','additional','countdropretry','dialDropMaxRetry','queueCallerAbandonCreateState','minutes','ContactId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','endtime','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','predictiveIntervalDroppedCallsCallersExit','outboundDropCallsDayCallersExit','CALLEREXIT','countabandonedretry','dialAbandonedRetryFrequency','callAdditionalPhoneAfterMin','verifyAdditionalPhones','dialAbandonedMaxRetry','rescheduleContact','add','ListId','[rescheduleContact][Abandoned]','Abandoned','calleridname'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x59c3,0x133));var _0x359c=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0x59c3[_0x138f59];return _0x3d114d;};'use strict';var util=require(_0x359c('0x0'));var _=require(_0x359c('0x1'));var uuid=require(_0x359c('0x2'));var moment=require(_0x359c('0x3'));var rr=require('rr');var Redis=require(_0x359c('0x4'));var utils=require(_0x359c('0x5'));var hopperUtils=require('./utils/hopper');var ut=require(_0x359c('0x6'));var config=require(_0x359c('0x7'));var logger=require(_0x359c('0x8'))(_0x359c('0x9'));var loggerBooked=require(_0x359c('0x8'))(_0x359c('0xa'));var loggerPredictive=require('../../../config/logger')(_0x359c('0xb'));var loggerPredictiveCalls=require('../../../config/logger')(_0x359c('0xc'));var loggerSyncQueueSummary=require(_0x359c('0x8'))(_0x359c('0xd'));var ami=require(_0x359c('0xe'));config['redis']=_[_0x359c('0xf')](config['redis'],{'host':_0x359c('0x10'),'port':0x18eb});var io=require(_0x359c('0x11'))(new Redis(config[_0x359c('0x12')]));var cmHopper=require(_0x359c('0x13'));var voiceQueueRt=require(_0x359c('0x14'));var RpcSetting=require(_0x359c('0x15'));var Interval=require('../rpc/interval');var Action=require(_0x359c('0x16'));var History=require(_0x359c('0x17'));var Final=require(_0x359c('0x18'));var AgentComplete=require(_0x359c('0x19'));var QueueCallerAbandon=require(_0x359c('0x1a'));var Hangup=require(_0x359c('0x1b'));var ipAgi=process[_0x359c('0x1c')][_0x359c('0x1d')]||_0x359c('0x1e');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x359c('0x1f')][_0x359c('0x20')]=function(_0xd07946){this['tail']=this[_0x359c('0x21')]?this[_0x359c('0x21')]['finally'](_0xd07946):_0xd07946();};function Dialer(_0x80b8d8,_0x186e45){this[_0x359c('0x22')]=new Sequence();this[_0x359c('0x23')]=_0x186e45;this[_0x359c('0x24')]=_0x80b8d8[_0x359c('0x24')];this[_0x359c('0x25')]=_0x80b8d8[_0x359c('0x25')];this[_0x359c('0x26')]=_0x80b8d8[_0x359c('0x26')];this[_0x359c('0x27')]=_0x80b8d8[_0x359c('0x27')];this[_0x359c('0x28')]=config[_0x359c('0x28')]||0x2;this[_0x359c('0x29')]={};this[_0x359c('0x2a')]={};this[_0x359c('0x2b')]={};this[_0x359c('0x2c')]={};this['optionPredictive']={};this[_0x359c('0x2d')]={};this['startProgressive']={};this[_0x359c('0x2e')]={};this['queueBooked']={};this[_0x359c('0x2f')]={};this[_0x359c('0x30')]={};ami['on'](_0x359c('0x31'),this[_0x359c('0x32')][_0x359c('0x33')](this));ami['on'](_0x359c('0x34'),this[_0x359c('0x35')][_0x359c('0x33')](this));ami['on'](_0x359c('0x36'),this[_0x359c('0x37')][_0x359c('0x33')](this));ami['on'](_0x359c('0x38'),this[_0x359c('0x39')][_0x359c('0x33')](this));ami['on'](_0x359c('0x3a'),this[_0x359c('0xd')]['bind'](this));ami['on'](_0x359c('0x3b'),this[_0x359c('0x3c')][_0x359c('0x33')](this));ami['on']('hangup',this[_0x359c('0x3d')][_0x359c('0x33')](this));ami['on'](_0x359c('0x3e'),this['syncNewExten'][_0x359c('0x33')](this));ami['on']('varset',this[_0x359c('0x3f')][_0x359c('0x33')](this));ami['on'](_0x359c('0x40'),this[_0x359c('0x41')]['bind'](this));ami['on'](_0x359c('0x42'),this[_0x359c('0x43')][_0x359c('0x33')](this));this[_0x359c('0x44')]();this[_0x359c('0x45')]();RpcSetting[_0x359c('0x46')]()['then'](function(_0x49a517){previewRecallmeReminderInterval=_0x49a517['previewRecallmeReminderInterval'];});}function isNotNull(_0x1aec6c){return _0x1aec6c!==null&&!_[_0x359c('0x47')](_0x1aec6c);}function msgResponse(_0x575a51,_0x11b370,_0x3b4ad4){return{'action':_0x575a51,'response':_0x11b370,'message':_0x3b4ad4,'stack':_0x3b4ad4};}function emit(_0x6b6340,_0x36704b,_0x44e313){io['to'](_0x6b6340)['emit'](_0x36704b,_0x44e313);}function emitOutboundVoiceQueueSummary(_0x25934a){if(_0x25934a[_0x359c('0x48')]===_0x359c('0x49')){logger['debug']('[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:',util['inspect'](_0x25934a,{'showHidden':![],'depth':null}));emit(util[_0x359c('0x4a')](_0x359c('0x4b'),_0x25934a['name']),_0x359c('0x4c'),_0x25934a);}}function checkGetDataPredictive(_0x3a8ca7){if(isNotNull(_0x3a8ca7)&&!_[_0x359c('0x4d')](_0x3a8ca7)){loggerPredictive[_0x359c('0x4e')](_0x359c('0x4f'));loggerPredictive[_0x359c('0x4e')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3a8ca7[_0x359c('0x50')]);loggerPredictive[_0x359c('0x4e')](_0x359c('0x51'),_0x3a8ca7[_0x359c('0x52')]);loggerPredictive[_0x359c('0x4e')](_0x359c('0x53'),_0x3a8ca7['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0x359c('0x4e')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3a8ca7['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x359c('0x4e')](_0x359c('0x54'),_0x3a8ca7['predictiveIntervalAvgHoldtime']);loggerPredictive[_0x359c('0x4e')](_0x359c('0x55'),_0x3a8ca7[_0x359c('0x56')]);loggerPredictive[_0x359c('0x4e')]('---------------------------');if(_0x3a8ca7[_0x359c('0x50')]>0x0){if(!_[_0x359c('0x47')](_0x3a8ca7[_0x359c('0x56')])&&_0x3a8ca7['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0x359c('0x4e')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_[_0x359c('0x47')](_0x3a8ca7['predictiveIntervalAvgHoldtime'])&&_0x3a8ca7[_0x359c('0x57')]>0x0){return!![];}loggerPredictive[_0x359c('0x4e')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive['info'](_0x359c('0x58'));}}else{loggerPredictive[_0x359c('0x4e')](_0x359c('0x59'));}return![];}function mergeDataErlangB(_0x567c43){return function(_0x43b07d){loggerPredictive[_0x359c('0x4e')](_0x359c('0x5a'));loggerPredictive[_0x359c('0x4e')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x43b07d[_0x359c('0x5b')]);loggerPredictive[_0x359c('0x4e')](_0x359c('0x5c'),_0x43b07d[_0x359c('0x5d')]);loggerPredictive[_0x359c('0x4e')](_0x359c('0x5e'),_0x43b07d[_0x359c('0x5f')]);loggerPredictive[_0x359c('0x4e')](_0x359c('0x60'),_0x43b07d['erlangBusyFactor']);loggerPredictive[_0x359c('0x4e')](_0x359c('0x5e'),_0x43b07d[_0x359c('0x5f')]);loggerPredictive[_0x359c('0x4e')](_0x359c('0x61'));_[_0x359c('0x62')](_0x567c43,_0x43b07d);};}function ifInterval(_0x55f48a,_0x27301d){if(_['isUndefined'](_0x27301d)){return![];}return utils[_0x359c('0x63')](undefined,_0x27301d)<_0x55f48a*0x3c;}function clearPredictiveAttributes(_0x4aef1c){if(_0x4aef1c['startProgressive']){_0x4aef1c[_0x359c('0x64')]=undefined;loggerPredictive[_0x359c('0x65')](_0x4aef1c[_0x359c('0x66')],'startProgressive\x20value\x20cleared');}if(_0x4aef1c[_0x359c('0x2d')]){_0x4aef1c[_0x359c('0x2d')]=undefined;loggerPredictive[_0x359c('0x65')](_0x4aef1c['name'],_0x359c('0x67'));}if(_0x4aef1c[_0x359c('0x68')]){clearInterval(_0x4aef1c['handlePredictive']);_0x4aef1c[_0x359c('0x68')]=undefined;loggerPredictive[_0x359c('0x65')](_0x4aef1c['name'],_0x359c('0x69'));}}function loggerCatchPredictive(_0x2a6afb,_0x5ec033){return function(_0x5a0e76){loggerPredictive[_0x359c('0x6a')](_0x5ec033[_0x359c('0x66')],_0x2a6afb);loggerPredictive[_0x359c('0x6a')](_0x5a0e76[_0x359c('0x6b')]);clearPredictiveAttributes(_0x5ec033);};}function loggerCatch(_0x494cc9){return function(_0x58db2c){logger['error'](_0x494cc9,util[_0x359c('0x6c')](_0x58db2c,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x2a13b1,_0x12e055,_0x85e034){return function(_0x3d7ce1){utils[_0x359c('0x6d')](_0x12e055,_0x85e034,0x0);_0x12e055[_0x359c('0x6e')]=0x0;logger[_0x359c('0x6a')](_0x2a13b1,util[_0x359c('0x6c')](_0x3d7ce1,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x3e061e){return function(_0x5d332a){if(isNotNull(_0x5d332a)&&isNotNull(_0x5d332a[0x0])){if(_0x5d332a[0x0][_0x359c('0x6f')]>0x0){_0x3e061e[_0x359c('0x70')]=utils[_0x359c('0x71')][_0x359c('0x72')];logger[_0x359c('0x4e')](_0x359c('0x73')+_0x3e061e['name'],_0x5d332a[0x0]['contactsRescheduled'],_0x359c('0x74'));}else{_0x3e061e[_0x359c('0x70')]=utils[_0x359c('0x71')]['NO_AVAILABLE_CONTACTS'];logger[_0x359c('0x4e')]('[getContactDialer2][Empty]'+_0x3e061e['name']);}}};}function createObjHistory(_0x4490fc,_0x15f83f,_0x5df068,_0x1f7a7a,_0x1d2655){_0x4490fc['message']=_0x5df068;var _0x9ecd0a=new Action(_0x4490fc,_0x15f83f);var _0xc90ab9=new History(_0x9ecd0a);_0xc90ab9['state']=_0x1f7a7a;_0xc90ab9[_0x359c('0x75')]=_0x1d2655;_0xc90ab9['endtime']=_0x9ecd0a[_0x359c('0x76')];return _0xc90ab9;}function unlockQueueStatus(_0x11c5fd,_0x2a929f){setTimeout(function(){if(_['isUndefined'](_0x11c5fd[_0x359c('0x77')])){loggerBooked[_0x359c('0x6a')](_0x359c('0x78'),_0x2a929f);}_0x11c5fd[_0x359c('0x77')]=!![];loggerBooked[_0x359c('0x4e')](_0x359c('0x79'),_0x2a929f,JSON['stringify'](_[_0x359c('0x7a')](_0x11c5fd,[_0x359c('0x66'),'queueStatusComplete'])));},0x1f3);}function checkInterval(_0x215e6f){return function(){if(!isNotNull(_0x215e6f[_0x359c('0x7b')])){_0x215e6f[_0x359c('0x70')]=utils[_0x359c('0x71')][_0x359c('0x7c')];throw _0x215e6f[_0x359c('0x66')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x215e6f[_0x359c('0x7b')][_0x359c('0x7d')])){_0x215e6f[_0x359c('0x70')]=utils[_0x359c('0x71')]['NULL_INTERVAL'];throw _0x215e6f[_0x359c('0x66')]+_0x359c('0x7e');}if(!isNotNull(_['isEmpty'](_0x215e6f[_0x359c('0x7b')]['Intervals']))){_0x215e6f[_0x359c('0x70')]=utils['CAMPAIGN_STATUS']['NULL_INTERVAL'];throw _0x215e6f[_0x359c('0x66')]+_0x359c('0x7e');}};}function checkIsIVRCampaignActive(_0x4df8a0){return function(){if(!utils['isIVRCampaignActive'](_0x4df8a0)){_0x4df8a0[_0x359c('0x70')]=utils[_0x359c('0x71')]['INACTIVE'];throw _0x4df8a0[_0x359c('0x66')]+'\x20NOT\x20Active';}};}function emitCampaignSummary(_0x1d18d7){if(utils['isIVRCampaign'](_0x1d18d7)){emit(util['format'](_0x359c('0x7f'),_0x1d18d7[_0x359c('0x66')]),_0x359c('0x80'),_0x1d18d7);}}function loggerCatchQueueSummary(_0x3e6292,_0x4e129e){return function(_0x2e3f4e){clearPredictiveAttributes(_0x4e129e);emitCampaignSummary(_0x4e129e);loggerSyncQueueSummary[_0x359c('0x65')](_0x3e6292,util[_0x359c('0x6c')](_0x2e3f4e,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x58e3e2){if(_0x58e3e2[_0x359c('0x81')]){if(_0x58e3e2[_0x359c('0x82')]===0x0){_0x58e3e2[_0x359c('0x81')]=![];_0x58e3e2['message']=utils['CAMPAIGN_STATUS'][_0x359c('0x83')];loggerSyncQueueSummary[_0x359c('0x65')](_0x359c('0x84'),_0x58e3e2[_0x359c('0x66')],'is\x20not\x20active');}else{_0x58e3e2[_0x359c('0x70')]=utils[_0x359c('0x71')][_0x359c('0x85')];loggerSyncQueueSummary['debug'](_0x359c('0x84'),_0x58e3e2[_0x359c('0x66')],_0x359c('0x86'));}emitCampaignSummary(_0x58e3e2);}}function myreject(_0x32ae51){return function(_0xc950c7){return _0x32ae51(msgResponse(_0x359c('0x87'),_0x359c('0x88'),JSON[_0x359c('0x89')](_0xc950c7)));};}Dialer[_0x359c('0x1f')][_0x359c('0x8a')]=function(_0x450a04){return!_[_0x359c('0x47')](_0x450a04)&&_0x450a04&&!_['isUndefined'](_0x450a04[_0x359c('0x66')])&&!_[_0x359c('0x47')](_0x450a04[_0x359c('0x8b')])&&_0x450a04[_0x359c('0x8b')]&&(this['trunks'][util[_0x359c('0x4a')]('SIP/%s',_0x450a04['name'])][_0x359c('0x8c')]===_0x359c('0x8d')||this['trunks'][util['format'](_0x359c('0x8e'),_0x450a04[_0x359c('0x66')])][_0x359c('0x8c')]===_0x359c('0x8f'));};Dialer[_0x359c('0x1f')][_0x359c('0x90')]=function(_0x5d457a){var _0x13d0ab=this;return function(){if(!_0x13d0ab[_0x359c('0x8a')](_0x5d457a['Trunk'])){if(!_0x13d0ab[_0x359c('0x8a')](_0x5d457a[_0x359c('0x91')])){_0x5d457a[_0x359c('0x70')]=utils['CAMPAIGN_STATUS'][_0x359c('0x92')];throw _0x5d457a[_0x359c('0x66')]+_0x359c('0x93');}}};};Dialer[_0x359c('0x1f')][_0x359c('0x94')]=function(_0x466455,_0x1eeb45,_0x100980,_0x251eed){var _0x27c3f4=this;return function(){var _0x190ac9=!![];return _0x27c3f4[_0x359c('0x95')](_0x466455,_0x1eeb45,_0x100980,_0x251eed,_0x190ac9);};};Dialer[_0x359c('0x1f')]['checkIfTimeIntervals']=function(_0x14764d,_0x4c8a42,_0x10fab4,_0x9665b4){var _0x549ba6=this;return function(){var _0xbc2be2=![];return _0x549ba6[_0x359c('0x95')](_0x14764d[_0x359c('0x7d')],_0x4c8a42,_0x10fab4,_0x9665b4,_0xbc2be2);};};Dialer['prototype'][_0x359c('0x95')]=function(_0x19edf1,_0x5029f1,_0x16be8b,_0x11160b,_0x51f78a){var _0x54281f=[];return new Promise(function(_0x360193,_0x1f4ab2){if(!isNotNull(_0x19edf1)){_0x11160b['message']=utils[_0x359c('0x71')][_0x359c('0x7c')];return _0x1f4ab2(msgResponse('ifTime',_0x359c('0x96'),_0x16be8b+_0x359c('0x97')));}if(_[_0x359c('0x4d')](_0x19edf1)){_0x11160b[_0x359c('0x70')]=utils[_0x359c('0x71')][_0x359c('0x98')];return _0x1f4ab2(msgResponse(_0x359c('0x99'),_0x359c('0x96'),_0x16be8b+_0x359c('0x9a')));}if(_0x5029f1&&_[_0x359c('0x47')](config['timezones'][_0x5029f1])){_0x11160b[_0x359c('0x70')]=utils[_0x359c('0x71')][_0x359c('0x9b')];return _0x1f4ab2(msgResponse(_0x359c('0x99'),'Failure',_0x16be8b+'\x20Timezone\x20unknow\x20'+_0x5029f1));}if(_[_0x359c('0x9c')](_0x19edf1)){for(var _0x4748d6=0x0;_0x4748d6<_0x19edf1[_0x359c('0x9d')];_0x4748d6+=0x1){_0x54281f['push'](ami[_0x359c('0x9e')]({'action':_0x359c('0x9f'),'command':util[_0x359c('0x4a')]('iftime\x20%s,%s',_0x19edf1[_0x4748d6]['interval'],!_[_0x359c('0x47')](config['timezones'][_0x5029f1])?_0x5029f1:'')})[_0x359c('0xa0')](function(_0x4ae3be){return _0x4ae3be['content'][_0x359c('0xa1')](_0x359c('0xa2'))>=0x0;})[_0x359c('0xa3')](myreject(_0x1f4ab2)));}}else{_0x54281f[_0x359c('0xa4')](ami['Action']({'action':_0x359c('0x9f'),'command':util['format'](_0x359c('0xa5'),_0x19edf1,!_[_0x359c('0x47')](config[_0x359c('0xa6')][_0x5029f1])?_0x5029f1:'')})[_0x359c('0xa0')](function(_0x51f00f){return _0x51f00f[_0x359c('0xa7')][_0x359c('0xa1')](_0x359c('0xa2'))>=0x0;})[_0x359c('0xa3')](myreject(_0x1f4ab2)));}Promise[_0x359c('0xa8')](_0x54281f)[_0x359c('0xa0')](function(_0x308b5c){var _0x52c364=_[_0x359c('0xa9')](_0x308b5c);if(_0x52c364){return _0x360193(_0x52c364);}else{_0x11160b[_0x359c('0x70')]=_0x51f78a?utils[_0x359c('0x71')][_0x359c('0xaa')]:utils[_0x359c('0x71')][_0x359c('0xab')];return _0x1f4ab2(msgResponse('[ifTime][promiseAll]','Failure',_0x359c('0xac')+_0x51f78a+'\x20'+_0x16be8b+_0x359c('0xad')+util[_0x359c('0x6c')](_0x19edf1,{'showHidden':![],'depth':null})+_0x359c('0xae')+_0x5029f1));}})['catch'](function(_0xc15db3){return _0x1f4ab2(msgResponse('ifTime','Failure',JSON['stringify'](_0xc15db3)));});});};Dialer[_0x359c('0x1f')][_0x359c('0x44')]=function(){var _0x4670b1=this;return cmHopper[_0x359c('0xaf')]({'active':![]},{'where':{'active':!![]}})['then'](function(){setInterval(function(){_0x4670b1[_0x359c('0xb0')]();},0x3e8);});};Dialer['prototype'][_0x359c('0xb0')]=function(){var _0x2e9d85=this;var _0x4f8f7e;for(var _0x204e7c in this[_0x359c('0x25')]){if(typeof this[_0x359c('0x25')][_0x204e7c]!==_0x359c('0xb1')){_0x4f8f7e=this[_0x359c('0x25')][_0x204e7c];if(utils[_0x359c('0xb2')](_0x4f8f7e)&&utils[_0x359c('0xb3')](_0x4f8f7e)){_0x4f8f7e[_0x359c('0x81')]=!![];Promise[_0x359c('0xb4')]()['then'](checkIsIVRCampaignActive(_0x4f8f7e))[_0x359c('0xa0')](checkInterval(_0x4f8f7e))[_0x359c('0xa0')](_0x2e9d85[_0x359c('0x90')](_0x4f8f7e))[_0x359c('0xa0')](_0x2e9d85['checkIfTime'](_0x4f8f7e[_0x359c('0xb5')],_0x4f8f7e[_0x359c('0xb6')],_0x4f8f7e[_0x359c('0x66')],_0x4f8f7e))[_0x359c('0xa0')](_0x2e9d85[_0x359c('0xb7')](_0x4f8f7e[_0x359c('0x7b')],_0x4f8f7e[_0x359c('0xb6')],_0x4f8f7e['name'],_0x4f8f7e))[_0x359c('0xa0')](_0x2e9d85[_0x359c('0xb8')](_0x4f8f7e))[_0x359c('0xa3')](loggerCatchQueueSummary(_0x359c('0xb9'),_0x4f8f7e));}else{notSendMessagesCampaign(_0x4f8f7e);}}}};Dialer['prototype'][_0x359c('0xba')]=function(_0x1c2a75){if(_0x1c2a75['dialMethod']!==_0x359c('0xb')){clearPredictiveAttributes(_0x1c2a75);}switch(_0x1c2a75[_0x359c('0xbb')]){case'progressive':this[_0x359c('0xbc')](_0x1c2a75,0x1);break;case _0x359c('0xbd'):this[_0x359c('0xbc')](_0x1c2a75,_0x1c2a75[_0x359c('0xbe')]);break;case _0x359c('0xb'):this['predictive'](_0x1c2a75);break;case _0x359c('0xa'):this['handlePower'](_0x1c2a75,0x1);break;default:logger[_0x359c('0x6a')](_0x359c('0xbf'),_0x1c2a75['name'],_0x359c('0xc0'));}};Dialer['prototype'][_0x359c('0x99')]=function(_0x406457,_0x30207d){var _0x2149a2=_0x406457[_0x359c('0xb6')];var _0x381e12=_0x30207d?_0x406457[_0x359c('0xb5')]:_0x406457['Interval'][_0x359c('0x7d')];logger[_0x359c('0xc1')](_0x359c('0xc2'),_0x381e12,_0x2149a2,_0x406457['name'],util[_0x359c('0x4a')](_0x359c('0xc3'),_0x406457[_0x359c('0x66')],_0x406457['id']));var _0x54ed40=null;return Interval['intervalIftime'](_0x381e12,_0x2149a2)[_0x359c('0xa0')](function(_0x3c0a09){if(_0x3c0a09===!![]){return _0x3c0a09;}else{_0x406457[_0x359c('0x70')]=_0x30207d?utils[_0x359c('0x71')][_0x359c('0xaa')]:utils[_0x359c('0x71')]['OVERTIME_INTERVAL'];_0x54ed40=msgResponse('[ifTime][promiseAll]',_0x359c('0x96'),_0x359c('0xac')+_0x30207d+'\x20'+_0x406457[_0x359c('0x66')]+'\x20Interval\x20is\x20overtime:\x20'+util[_0x359c('0x6c')](_0x381e12,{'showHidden':![],'depth':null})+_0x359c('0xae')+_0x2149a2);}if(_0x54ed40!==null){logger[_0x359c('0xc1')](_0x359c('0xc4'),_0x54ed40);_0x54ed40['isGlobal']=_0x30207d;throw _0x54ed40;}})[_0x359c('0xa3')](function(_0x1be4c7){logger[_0x359c('0x6a')](_0x359c('0xc5'),_0x1be4c7);throw msgResponse('[ifTime][Action]','Error',util[_0x359c('0x6c')](_0x1be4c7,{'showHidden':![],'depth':null}));});};Dialer[_0x359c('0x1f')][_0x359c('0x32')]=function(_0x40cca3){if(this[_0x359c('0x24')][_0x40cca3[_0x359c('0xc6')]]){if(this[_0x359c('0x2c')][_0x40cca3['uniqueid']]&&this['uniqueId'][_0x40cca3[_0x359c('0xc7')]][_0x359c('0x48')]!=='ivr'){this['updateOriginated'](this[_0x359c('0x24')][_0x40cca3['queue']]);this[_0x359c('0x2c')][_0x40cca3[_0x359c('0xc7')]]['answertime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0x359c('0x1f')][_0x359c('0x39')]=function(_0x4e59d7){var _0x3af687=this[_0x359c('0x2c')][_0x4e59d7['uniqueid']];if(this[_0x359c('0x24')][_0x4e59d7[_0x359c('0xc6')]]){if(_0x3af687&&_0x3af687[_0x359c('0x48')]!=='ivr'){delete this[_0x359c('0x2c')][_0x4e59d7[_0x359c('0xc7')]];this['voiceQueues'][_0x4e59d7[_0x359c('0xc6')]][_0x359c('0xc8')]+=0x1;var _0xc47102=new AgentComplete(_0x3af687,_0x4e59d7);if(_0x4e59d7[_0x359c('0xc9')]===_0x359c('0xca')){_0xc47102[_0x359c('0xcb')]=this[_0x359c('0x24')][_0x4e59d7['queue']][_0x359c('0xcc')]&&this[_0x359c('0x24')][_0x4e59d7[_0x359c('0xc6')]][_0x359c('0xcd')]?moment()[_0x359c('0x4a')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}hopperUtils[_0x359c('0xce')](_0xc47102)[_0x359c('0xa3')](loggerCatch(_0x359c('0xcf')));hopperUtils[_0x359c('0xd0')](_0xc47102)[_0x359c('0xa3')](loggerCatch(_0x359c('0xd1')));}}};Dialer[_0x359c('0x1f')]['syncQueueCallerAbandon']=function(_0x5f1c46){var _0x3a27d7=this[_0x359c('0x2c')][_0x5f1c46[_0x359c('0xc7')]];var _0x43835d=this;var _0x252dbd=![];var _0x36972e;var _0x59db86;if(this[_0x359c('0x24')][_0x5f1c46[_0x359c('0xc6')]]){if(_0x3a27d7&&_0x3a27d7[_0x359c('0x48')]!==_0x359c('0xd2')){delete this[_0x359c('0x2c')][_0x5f1c46[_0x359c('0xc7')]];this[_0x359c('0xd3')](this['voiceQueues'][_0x5f1c46[_0x359c('0xc6')]]);_0x3a27d7[_0x359c('0xd4')]=moment()['format'](_0x359c('0xd5'));var _0x5e90a0=new QueueCallerAbandon(_0x3a27d7,_0x5f1c46);if(utils[_0x359c('0x63')](_0x3a27d7[_0x359c('0xd4')],_0x3a27d7[_0x359c('0xd6')])>=_0x3a27d7['dialQueueTimeout']){this[_0x359c('0x24')][_0x5f1c46[_0x359c('0xc6')]][_0x359c('0xd7')]+=0x1;this['voiceQueues'][_0x5f1c46[_0x359c('0xc6')]]['outboundDropCallsDayTimeout']+=0x1;this['voiceQueues'][_0x5f1c46[_0x359c('0xc6')]][_0x359c('0xd8')]+=0x1;_0x5e90a0[_0x359c('0xd9')]=0xa;_0x5e90a0[_0x359c('0x75')]=_0x359c('0xda');_0x5e90a0[_0x359c('0xdb')]=_0x359c('0xdc');_0x5e90a0[_0x359c('0xcb')]=this['voiceQueues'][_0x5f1c46[_0x359c('0xc6')]][_0x359c('0xcc')]?moment()[_0x359c('0x4a')](_0x359c('0xd5')):undefined;_0x5e90a0['countdropretry']+=0x1;_0x5e90a0[_0x359c('0xdd')]+=0x1;_0x36972e=this['voiceQueues'][_0x5f1c46[_0x359c('0xc6')]][_0x359c('0xde')];_0x59db86=this['voiceQueues'][_0x5f1c46[_0x359c('0xc6')]]['callAdditionalPhoneAfterMin'];hopperUtils['verifyAdditionalPhones'](_0x5e90a0,_0x5e90a0[_0x359c('0xd9')],_0x3a27d7[_0x359c('0xdf')])['then'](function(_0x1b1188){_0x252dbd=_0x1b1188[_0x359c('0xe0')]==0x1;if(_0x5e90a0[_0x359c('0xe1')]>=_0x43835d[_0x359c('0x24')][_0x5f1c46[_0x359c('0xc6')]][_0x359c('0xe2')]){_0x43835d[_0x359c('0xe3')](_0x5e90a0,_0x1b1188[_0x359c('0xe0')]);}else{hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x5e90a0['countdropretry'],'scheduledat':moment()['add'](_0x43835d['voiceQueues'][_0x5f1c46[_0x359c('0xc6')]][_0x359c('0xde')],_0x359c('0xe4'))['format'](_0x359c('0xd5')),'ContactId':_0x3a27d7[_0x359c('0xe5')],'ListId':_0x3a27d7['ListId'],'VoiceQueueId':_0x3a27d7[_0x359c('0xe6')]||undefined,'CampaignId':_0x3a27d7[_0x359c('0xe7')]||undefined})[_0x359c('0xa3')](loggerCatch(_0x359c('0xe8')));var _0x434f75=new History(_0x5e90a0);_0x434f75[_0x359c('0xd9')]=0xa;_0x434f75['statedesc']='Drop';_0x434f75[_0x359c('0x76')]=moment()[_0x359c('0x4a')](_0x359c('0xd5'));_0x434f75[_0x359c('0xe9')]=_0x434f75['starttime'];_0x434f75['calleridname']=_0x5e90a0['calleridname'];_0x434f75[_0x359c('0xea')]=_0x5e90a0['calleridnum'];hopperUtils['createHistory'](_0x434f75)[_0x359c('0xa3')](loggerCatch(_0x359c('0xeb')));}})[_0x359c('0xa0')](function(){if(_0x252dbd)hopperUtils[_0x359c('0xec')](_0x5e90a0,_0x36972e,_0x59db86)[_0x359c('0xa0')](function(){return 0x1;});});}else{this[_0x359c('0x24')][_0x5f1c46[_0x359c('0xc6')]][_0x359c('0xed')]+=0x1;this[_0x359c('0x24')][_0x5f1c46['queue']][_0x359c('0xee')]+=0x1;_0x5e90a0[_0x359c('0xd9')]=0xb;_0x5e90a0[_0x359c('0x75')]='Abandoned';_0x5e90a0['dropreason']=_0x359c('0xef');_0x5e90a0[_0x359c('0xf0')]+=0x1;_0x5e90a0['countglobal']+=0x1;_0x36972e=this[_0x359c('0x24')][_0x5f1c46[_0x359c('0xc6')]][_0x359c('0xf1')];_0x59db86=this[_0x359c('0x24')][_0x5f1c46[_0x359c('0xc6')]][_0x359c('0xf2')];hopperUtils[_0x359c('0xf3')](_0x5e90a0,_0x5e90a0['state'],_0x3a27d7['voiceQueue'])[_0x359c('0xa0')](function(_0x13e3e9){if(_0x5e90a0[_0x359c('0xf0')]>=_0x43835d[_0x359c('0x24')][_0x5f1c46['queue']][_0x359c('0xf4')]){_0x43835d['queueCallerAbandonCreateState'](_0x5e90a0,_0x13e3e9[_0x359c('0xe0')]);}else{hopperUtils[_0x359c('0xf5')]({'active':![],'countabandonedretry':_0x5e90a0[_0x359c('0xf0')],'scheduledat':moment()[_0x359c('0xf6')](_0x43835d[_0x359c('0x24')][_0x5f1c46['queue']][_0x359c('0xf1')],_0x359c('0xe4'))[_0x359c('0x4a')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3a27d7['ContactId'],'ListId':_0x3a27d7[_0x359c('0xf7')],'VoiceQueueId':_0x3a27d7[_0x359c('0xe6')]||undefined,'CampaignId':_0x3a27d7[_0x359c('0xe7')]||undefined})[_0x359c('0xa3')](loggerCatch(_0x359c('0xf8')));var _0x3a0332=new History(_0x5e90a0);_0x3a0332[_0x359c('0xd9')]=0xb;_0x3a0332[_0x359c('0x75')]=_0x359c('0xf9');_0x3a0332[_0x359c('0x76')]=moment()[_0x359c('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');_0x3a0332[_0x359c('0xe9')]=_0x3a0332['starttime'];_0x3a0332['calleridname']=_0x5e90a0[_0x359c('0xfa')];_0x3a0332[_0x359c('0xea')]=_0x5e90a0[_0x359c('0xea')];hopperUtils[_0x359c('0xce')](_0x3a0332)[_0x359c('0xa3')](loggerCatch(_0x359c('0xfb')));}})[_0x359c('0xa0')](function(){if(_0x252dbd)hopperUtils['swapAdditionalPhones'](_0x5e90a0,_0x36972e,_0x59db86)[_0x359c('0xa0')](function(){return 0x1;});});}}}};Dialer[_0x359c('0x1f')][_0x359c('0xfc')]=function(_0x31f38a){if(this['actions'][_0x31f38a[_0x359c('0xc7')]]){this[_0x359c('0x2a')][_0x31f38a['uniqueid']][_0x359c('0xfd')]=_0x31f38a[_0x359c('0xfd')];}if(this[_0x359c('0x2c')][_0x31f38a[_0x359c('0xc7')]]){this[_0x359c('0x2c')][_0x31f38a['uniqueid']][_0x359c('0xfd')]=_0x31f38a[_0x359c('0xfd')];}};Dialer[_0x359c('0x1f')][_0x359c('0x41')]=function(_0x2eca78){if(!this[_0x359c('0x2a')][_0x2eca78[_0x359c('0xfe')]]){return;}var _0xbf5959=this[_0x359c('0x24')][this[_0x359c('0x2a')][_0x2eca78[_0x359c('0xfe')]][_0x359c('0xc6')]][_0x359c('0xff')]||_0x359c('0x100');if(_0xbf5959==='roundrobin'){if(this[_0x359c('0x2a')][_0x2eca78[_0x359c('0xfe')]]&&_[_0x359c('0x101')](this[_0x359c('0x2a')][_0x2eca78['actionid']][_0x359c('0x102')])&&_0x2eca78[_0x359c('0x8c')]==='1'&&_0x2eca78[_0x359c('0x103')]==='0'){if(this[_0x359c('0x26')][_0x2eca78[_0x359c('0x104')]]){if(!this['agents'][_0x2eca78[_0x359c('0x104')]][_0x359c('0x102')]){this['agents'][_0x2eca78[_0x359c('0x104')]][_0x359c('0x102')]=!![];this[_0x359c('0x2a')][_0x2eca78[_0x359c('0xfe')]][_0x359c('0x102')]=!![];this[_0x359c('0x2a')][_0x2eca78[_0x359c('0xfe')]][_0x359c('0x104')]=_0x2eca78[_0x359c('0x104')];}}}}else if(_0xbf5959==='rrmemory'){if(this[_0x359c('0x2a')][_0x2eca78[_0x359c('0xfe')]]){if(this[_0x359c('0x26')][_0x2eca78['stateinterface']]){this[_0x359c('0x2a')][_0x2eca78[_0x359c('0xfe')]]['stateinterface']=_0x2eca78[_0x359c('0x104')];if(_[_0x359c('0x101')](this[_0x359c('0x105')][this[_0x359c('0x2a')][_0x2eca78[_0x359c('0xfe')]][_0x359c('0xc6')]])){this['queueBooked'][this[_0x359c('0x2a')][_0x2eca78[_0x359c('0xfe')]][_0x359c('0xc6')]]=[];}this['queueBooked'][this['actions'][_0x2eca78[_0x359c('0xfe')]][_0x359c('0xc6')]][_0x359c('0xa4')](_[_0x359c('0x62')](_[_0x359c('0x7a')](this['actions'][_0x2eca78['actionid']],['idHopper',_0x359c('0x104')]),{'status':_0x2eca78[_0x359c('0x8c')],'paused':_0x2eca78[_0x359c('0x103')]}));}}}};Dialer[_0x359c('0x1f')][_0x359c('0x43')]=function(_0x2cfac1){if(!this['actions'][_0x2cfac1['actionid']]){return;}var _0x57e9dd=this;var _0x220f7b=this['voiceQueues'][this[_0x359c('0x2a')][_0x2cfac1[_0x359c('0xfe')]][_0x359c('0xc6')]];var _0x2388dd=_0x220f7b['strategy']||'rrmemory';if(_0x2388dd===_0x359c('0x106')){if(this[_0x359c('0x2a')][_0x2cfac1['actionid']]&&this['actions'][_0x2cfac1[_0x359c('0xfe')]][_0x359c('0x104')]){this[_0x359c('0x23')]['run'](this[_0x359c('0x2a')][_0x2cfac1[_0x359c('0xfe')]][_0x359c('0x107')],this['actions'][_0x2cfac1['actionid']][_0x359c('0x104')])[_0x359c('0xa3')](function(_0x13a241){logger[_0x359c('0x6a')](_0x359c('0x108'),util[_0x359c('0x6c')](_0x13a241,{'showHidden':![],'depth':null}));})[_0x359c('0x109')](function(){_0x57e9dd[_0x359c('0xd3')](_0x57e9dd[_0x359c('0x24')][_0x57e9dd['actions'][_0x2cfac1['actionid']][_0x359c('0xc6')]]);_0x57e9dd[_0x359c('0x26')][_0x57e9dd['actions'][_0x2cfac1[_0x359c('0xfe')]][_0x359c('0x104')]][_0x359c('0x102')]=![];delete _0x57e9dd[_0x359c('0x2a')][_0x2cfac1[_0x359c('0xfe')]];unlockQueueStatus(_0x220f7b);});}else{this[_0x359c('0xd3')](this['voiceQueues'][this[_0x359c('0x2a')][_0x2cfac1[_0x359c('0xfe')]][_0x359c('0xc6')]]);hopperUtils[_0x359c('0xf5')]({'active':![],'ContactId':this[_0x359c('0x2a')][_0x2cfac1['actionid']][_0x359c('0xe5')],'ListId':this[_0x359c('0x2a')][_0x2cfac1[_0x359c('0xfe')]][_0x359c('0xf7')],'VoiceQueueId':this[_0x359c('0x2a')][_0x2cfac1[_0x359c('0xfe')]][_0x359c('0xe6')]||undefined,'CampaignId':this[_0x359c('0x2a')][_0x2cfac1['actionid']][_0x359c('0xe7')]||undefined})[_0x359c('0xa3')](loggerCatch(_0x359c('0x10a')));delete this['actions'][_0x2cfac1[_0x359c('0xfe')]];unlockQueueStatus(_0x220f7b);}}else if(_0x2388dd===_0x359c('0x100')){var _0x45902c;if(this['actions'][_0x2cfac1[_0x359c('0xfe')]]&&!_[_0x359c('0x4d')](this['queueBooked'][this[_0x359c('0x2a')][_0x2cfac1[_0x359c('0xfe')]][_0x359c('0xc6')]])){if(this[_0x359c('0x2f')][_0x57e9dd[_0x359c('0x2a')][_0x2cfac1[_0x359c('0xfe')]]['queue']]){this['queueBookedRR'][_0x57e9dd[_0x359c('0x2a')][_0x2cfac1[_0x359c('0xfe')]][_0x359c('0xc6')]]=this['queueBookedRR'][this[_0x359c('0x2a')][_0x2cfac1[_0x359c('0xfe')]][_0x359c('0xc6')]]?this[_0x359c('0x2f')][this[_0x359c('0x2a')][_0x2cfac1['actionid']][_0x359c('0xc6')]]:this[_0x359c('0x105')][this[_0x359c('0x2a')][_0x2cfac1[_0x359c('0xfe')]]['queue']]?this[_0x359c('0x105')][this[_0x359c('0x2a')][_0x2cfac1[_0x359c('0xfe')]]['queue']][_0x359c('0x10b')]||0x0:0x0;}this[_0x359c('0x105')][this['actions'][_0x2cfac1[_0x359c('0xfe')]][_0x359c('0xc6')]][_0x359c('0x10b')]=this[_0x359c('0x2f')][this['actions'][_0x2cfac1[_0x359c('0xfe')]][_0x359c('0xc6')]];for(var _0x97687b=0x0;_0x97687b<this[_0x359c('0x105')][this['actions'][_0x2cfac1[_0x359c('0xfe')]][_0x359c('0xc6')]]['length'];_0x97687b+=0x1){_0x45902c=rr(this[_0x359c('0x105')][this[_0x359c('0x2a')][_0x2cfac1[_0x359c('0xfe')]]['queue']]);this['queueBookedRR'][_0x57e9dd[_0x359c('0x2a')][_0x2cfac1['actionid']][_0x359c('0xc6')]]=this[_0x359c('0x105')][this[_0x359c('0x2a')][_0x2cfac1[_0x359c('0xfe')]]['queue']][_0x359c('0x10b')];if(_0x45902c[_0x359c('0x8c')]==='1'&&_0x45902c['paused']==='0'){break;}}if(!_['isNil'](_0x45902c)){this[_0x359c('0x26')][_0x45902c[_0x359c('0x104')]][_0x359c('0x10c')]=_[_0x359c('0x47')](this[_0x359c('0x26')][_0x45902c[_0x359c('0x104')]][_0x359c('0x10c')])?!![]:this[_0x359c('0x26')][_0x45902c[_0x359c('0x104')]][_0x359c('0x10c')];}loggerBooked[_0x359c('0x4e')](_0x359c('0x10d'),_0x2cfac1['actionid'],_0x359c('0x10e'),JSON[_0x359c('0x89')](_[_0x359c('0x7a')](this['agents'][_0x45902c['stateinterface']],['name',_0x359c('0x10c')])),_0x359c('0x10f'),JSON['stringify'](_0x45902c[_0x359c('0x107')]));if(!_[_0x359c('0x101')](_0x45902c)&&_0x45902c['status']==='1'&&_0x45902c[_0x359c('0x103')]==='0'&&this['agents'][_0x45902c[_0x359c('0x104')]][_0x359c('0x10c')]){this['agents'][_0x45902c['stateinterface']][_0x359c('0x10c')]=![];this['queueBooked'][_0x57e9dd[_0x359c('0x2a')][_0x2cfac1[_0x359c('0xfe')]][_0x359c('0xc6')]]=[];this[_0x359c('0x23')][_0x359c('0x110')](_0x45902c[_0x359c('0x107')],_0x45902c[_0x359c('0x104')])[_0x359c('0xa3')](function(_0x285406){logger[_0x359c('0x6a')](_0x359c('0x108'),util[_0x359c('0x6c')](_0x285406,{'showHidden':![],'depth':null}));})[_0x359c('0x109')](function(){_0x57e9dd[_0x359c('0xd3')](_0x57e9dd[_0x359c('0x24')][_0x57e9dd[_0x359c('0x2a')][_0x2cfac1[_0x359c('0xfe')]]['queue']]);setTimeout(function(){_0x57e9dd[_0x359c('0x26')][_0x45902c[_0x359c('0x104')]]['unlockRR']=!![];loggerBooked[_0x359c('0x4e')](_0x359c('0x111'),_0x2cfac1['actionid'],_0x359c('0x10e'),JSON[_0x359c('0x89')](_[_0x359c('0x7a')](_0x57e9dd[_0x359c('0x26')][_0x45902c[_0x359c('0x104')]],[_0x359c('0x66'),_0x359c('0x10c')])),_0x359c('0x10f'),JSON[_0x359c('0x89')](_0x45902c[_0x359c('0x107')]));},0xc7);delete _0x57e9dd['actions'][_0x2cfac1[_0x359c('0xfe')]];unlockQueueStatus(_0x220f7b,_0x2cfac1[_0x359c('0xfe')]);});}else{loggerBooked[_0x359c('0x4e')]('[booked][unlock]');this[_0x359c('0xd3')](this[_0x359c('0x24')][this['actions'][_0x2cfac1[_0x359c('0xfe')]]['queue']]);hopperUtils[_0x359c('0xf5')]({'active':![],'ContactId':this[_0x359c('0x2a')][_0x2cfac1[_0x359c('0xfe')]][_0x359c('0xe5')],'ListId':this[_0x359c('0x2a')][_0x2cfac1[_0x359c('0xfe')]][_0x359c('0xf7')],'VoiceQueueId':this['actions'][_0x2cfac1['actionid']][_0x359c('0xe6')]||undefined,'CampaignId':this[_0x359c('0x2a')][_0x2cfac1['actionid']][_0x359c('0xe7')]||undefined})['catch'](loggerCatch(_0x359c('0x10a')));delete this[_0x359c('0x2a')][_0x2cfac1['actionid']];unlockQueueStatus(_0x220f7b);}}else{loggerBooked[_0x359c('0x4e')](_0x359c('0x112'));this[_0x359c('0xd3')](this['voiceQueues'][this[_0x359c('0x2a')][_0x2cfac1['actionid']][_0x359c('0xc6')]]);hopperUtils['rescheduleContact']({'active':![],'ContactId':this['actions'][_0x2cfac1[_0x359c('0xfe')]][_0x359c('0xe5')],'ListId':this[_0x359c('0x2a')][_0x2cfac1['actionid']][_0x359c('0xf7')],'VoiceQueueId':this[_0x359c('0x2a')][_0x2cfac1[_0x359c('0xfe')]][_0x359c('0xe6')]||undefined,'CampaignId':this[_0x359c('0x2a')][_0x2cfac1[_0x359c('0xfe')]][_0x359c('0xe7')]||undefined})[_0x359c('0xa3')](loggerCatch(_0x359c('0x113')));delete this[_0x359c('0x2a')][_0x2cfac1[_0x359c('0xfe')]];unlockQueueStatus(_0x220f7b);}}else{loggerBooked[_0x359c('0x4e')](_0x359c('0x114'));this[_0x359c('0xd3')](this['voiceQueues'][this['actions'][_0x2cfac1[_0x359c('0xfe')]][_0x359c('0xc6')]]);hopperUtils[_0x359c('0xf5')]({'active':![],'ContactId':this[_0x359c('0x2a')][_0x2cfac1['actionid']][_0x359c('0xe5')],'ListId':this[_0x359c('0x2a')][_0x2cfac1[_0x359c('0xfe')]][_0x359c('0xf7')],'VoiceQueueId':this['actions'][_0x2cfac1[_0x359c('0xfe')]]['VoiceQueueId']||undefined,'CampaignId':this['actions'][_0x2cfac1[_0x359c('0xfe')]][_0x359c('0xe7')]||undefined})[_0x359c('0xa3')](loggerCatch('[unlock3][syncQueueStatusComplete]'));delete this['actions'][_0x2cfac1['actionid']];unlockQueueStatus(_0x220f7b);}};Dialer[_0x359c('0x1f')][_0x359c('0x37')]=function(_0x87febe){var _0x3d680b=this[_0x359c('0x2a')][_0x87febe[_0x359c('0xfe')]];if(_0x3d680b){delete this[_0x359c('0x2a')][_0x87febe[_0x359c('0xfe')]];_0x3d680b[_0x359c('0xd6')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x2ae433=_0x3d680b['type']===_0x359c('0xd2')?this[_0x359c('0x25')][_0x3d680b['queue']]:this[_0x359c('0x24')][_0x3d680b['getQueue']()];if(_0x87febe[_0x359c('0x115')]!==_0x359c('0x116')){this['updateOriginated'](_0x2ae433);return this[_0x359c('0x117')](_0x3d680b,_0x2ae433,_0x87febe)[_0x359c('0xa3')](loggerCatch(_0x359c('0x118')));}this['uniqueId'][_0x87febe[_0x359c('0xc7')]]=_0x3d680b;}};Dialer['prototype']['syncVarSet']=function(_0x21fed1){var _0x32d5f1=this;var _0x1d2d0f=this[_0x359c('0x2c')][_0x21fed1[_0x359c('0xc7')]];var _0x56de28;if(!_['isNil'](_0x21fed1)&&!_[_0x359c('0x101')](_0x21fed1[_0x359c('0x119')])&&!_[_0x359c('0x101')](_0x21fed1[_0x359c('0x119')][_0x359c('0x11a')])&&_0x21fed1[_0x359c('0x11b')]==='xcally-motion-dialer'&&_0x1d2d0f){if(_0x1d2d0f['type']!==_0x359c('0xd2')&&this[_0x359c('0x24')][_0x1d2d0f[_0x359c('0xc6')]][_0x359c('0x11c')]&&_0x21fed1['value']===_0x359c('0x11d')){delete this[_0x359c('0x2c')][_0x21fed1[_0x359c('0xc7')]];this[_0x359c('0xd3')](this['voiceQueues'][_0x1d2d0f[_0x359c('0xc6')]]);this[_0x359c('0x24')][_0x1d2d0f[_0x359c('0xc6')]][_0x359c('0xc8')]+=0x1;this[_0x359c('0x24')][_0x1d2d0f[_0x359c('0xc6')]][_0x359c('0x11e')]+=0x1;_0x56de28=new Hangup(_0x1d2d0f,_0x21fed1);_0x56de28['state']=0x12;_0x56de28[_0x359c('0x75')]=_0x359c('0x11f');_0x56de28['membername']='AMD';ami[_0x359c('0x120')](_0x359c('0x121'),ut['buildObj'](_0x56de28,_0x359c('0x122')));this[_0x359c('0x123')](_0x56de28,_0x359c('0x124'),_0x359c('0x125'));}if(_0x1d2d0f[_0x359c('0x48')]!=='ivr'&&this[_0x359c('0x24')][_0x1d2d0f[_0x359c('0xc6')]]['dialAMDActive']&&_0x21fed1[_0x359c('0x126')]===_0x359c('0x127')){return new Promise(function(_0x197086,_0x2bfd35){delete _0x32d5f1[_0x359c('0x2c')][_0x21fed1[_0x359c('0xc7')]];_0x32d5f1[_0x359c('0xd3')](_0x32d5f1[_0x359c('0x24')][_0x1d2d0f[_0x359c('0xc6')]]);_0x32d5f1[_0x359c('0x24')][_0x1d2d0f[_0x359c('0xc6')]][_0x359c('0xc8')]+=0x1;_0x32d5f1[_0x359c('0x24')][_0x1d2d0f['queue']][_0x359c('0x11e')]+=0x1;var _0x2790b8=_0x32d5f1[_0x359c('0x24')][_0x1d2d0f[_0x359c('0xc6')]];var _0x2c48b1=new Hangup(_0x1d2d0f,_0x21fed1);_0x2c48b1[_0x359c('0xd9')]=0x13;_0x2c48b1[_0x359c('0x75')]=_0x359c('0x128');_0x2c48b1[_0x359c('0x129')]=_0x359c('0x12a');_0x2c48b1['countmachineretry']+=0x1;_0x2c48b1[_0x359c('0xdd')]+=0x1;_0x2c48b1['amd']=!![];ami['emit']('custom:amd',ut[_0x359c('0x12b')](_0x2c48b1,_0x359c('0x122')));hopperUtils[_0x359c('0xce')](_0x2c48b1)[_0x359c('0xa3')](loggerCatch(_0x359c('0x12c')));if(_0x2c48b1[_0x359c('0x12d')]+_0x2c48b1[_0x359c('0x12e')]+_0x2c48b1[_0x359c('0x12f')]+_0x2c48b1['countnosuchnumberretry']+_0x2c48b1[_0x359c('0xe1')]+_0x2c48b1[_0x359c('0xf0')]+_0x2c48b1[_0x359c('0x130')]+_0x2c48b1[_0x359c('0x131')]>=_0x2790b8['dialGlobalMaxRetry']){_0x32d5f1[_0x359c('0x132')](_0x2c48b1,_0x197086,_0x2bfd35,_0x359c('0x133'));}else{if(_0x2c48b1[_0x359c('0x130')]>=_0x2790b8[_0x359c('0x134')]){_0x32d5f1[_0x359c('0x135')](_0x2c48b1,_0x197086,_0x2bfd35,_0x359c('0x136'));}else{hopperUtils[_0x359c('0xf5')]({'active':![],'countmachineretry':_0x2c48b1['countmachineretry'],'scheduledat':moment()[_0x359c('0xf6')](_0x2790b8[_0x359c('0x137')],'minutes')['format'](_0x359c('0xd5')),'ContactId':_0x2c48b1['ContactId'],'ListId':_0x2c48b1[_0x359c('0xf7')],'VoiceQueueId':_0x2c48b1[_0x359c('0xe6')]||undefined,'CampaignId':_0x2c48b1[_0x359c('0xe7')]||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));_0x197086({'reschedule':0x1});}}});}if(_0x1d2d0f['type']===_0x359c('0xd2')&&this[_0x359c('0x25')][_0x1d2d0f[_0x359c('0xc6')]][_0x359c('0x11c')]&&_0x21fed1['value']===_0x359c('0x11d')){delete this[_0x359c('0x2c')][_0x21fed1[_0x359c('0xc7')]];this[_0x359c('0xd3')](this[_0x359c('0x25')][_0x1d2d0f[_0x359c('0xc6')]]);_0x56de28=new Hangup(_0x1d2d0f,_0x21fed1);_0x56de28[_0x359c('0xd9')]=0x12;_0x56de28[_0x359c('0x75')]=_0x359c('0x11f');_0x56de28[_0x359c('0x129')]=_0x359c('0x12a');ami[_0x359c('0x120')]('custom:amd',ut[_0x359c('0x12b')](_0x56de28,'amd'));this['saveInDb'](_0x56de28,_0x359c('0x138'),_0x359c('0x139'));}if(_0x1d2d0f[_0x359c('0x48')]===_0x359c('0xd2')&&this['campaigns'][_0x1d2d0f[_0x359c('0xc6')]][_0x359c('0x11c')]&&_0x21fed1[_0x359c('0x126')]===_0x359c('0x127')){return new Promise(function(_0x1aed1c,_0x509f91){delete _0x32d5f1['uniqueId'][_0x21fed1['uniqueid']];_0x32d5f1[_0x359c('0xd3')](_0x32d5f1[_0x359c('0x25')][_0x1d2d0f[_0x359c('0xc6')]]);_0x32d5f1[_0x359c('0x25')][_0x1d2d0f[_0x359c('0xc6')]][_0x359c('0xc8')]+=0x1;_0x32d5f1[_0x359c('0x25')][_0x1d2d0f[_0x359c('0xc6')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x40b3f9=_0x32d5f1['campaigns'][_0x1d2d0f['queue']];var _0x2294f1=new Hangup(_0x1d2d0f,_0x21fed1);_0x2294f1[_0x359c('0xd9')]=0x13;_0x2294f1['statedesc']=_0x359c('0x128');_0x2294f1[_0x359c('0x129')]=_0x359c('0x12a');_0x2294f1[_0x359c('0x130')]+=0x1;_0x2294f1[_0x359c('0xdd')]+=0x1;_0x2294f1[_0x359c('0x122')]=!![];ami['emit'](_0x359c('0x121'),ut['buildObj'](_0x2294f1,_0x359c('0x122')));hopperUtils[_0x359c('0xce')](_0x2294f1)[_0x359c('0xa3')](loggerCatch(_0x359c('0x12c')));if(_0x2294f1[_0x359c('0x12d')]+_0x2294f1[_0x359c('0x12e')]+_0x2294f1['countnoanswerretry']+_0x2294f1[_0x359c('0x13a')]+_0x2294f1['countdropretry']+_0x2294f1['countabandonedretry']+_0x2294f1[_0x359c('0x130')]+_0x2294f1[_0x359c('0x131')]>=_0x40b3f9[_0x359c('0x13b')]){_0x32d5f1[_0x359c('0x132')](_0x2294f1,_0x1aed1c,_0x509f91,_0x359c('0x133'));}else{if(_0x2294f1[_0x359c('0x130')]>=_0x40b3f9[_0x359c('0x134')]){_0x32d5f1[_0x359c('0x135')](_0x2294f1,_0x1aed1c,_0x509f91,_0x359c('0x136'));}else{hopperUtils[_0x359c('0xf5')]({'active':![],'countmachineretry':_0x2294f1[_0x359c('0x130')],'scheduledat':moment()[_0x359c('0xf6')](_0x40b3f9['dialMachineRetryFrequency'],_0x359c('0xe4'))[_0x359c('0x4a')](_0x359c('0xd5')),'ContactId':_0x2294f1[_0x359c('0xe5')],'ListId':_0x2294f1['ListId'],'VoiceQueueId':_0x2294f1[_0x359c('0xe6')]||undefined,'CampaignId':_0x2294f1['CampaignId']||undefined})[_0x359c('0xa3')](loggerCatch(_0x359c('0x13c')));_0x1aed1c({'reschedule':0x1});}}});}}};Dialer[_0x359c('0x1f')][_0x359c('0x3d')]=function(_0x26e2dd){var _0x44a716=this[_0x359c('0x2c')][_0x26e2dd[_0x359c('0xc7')]];var _0x2c4d1a;if(_0x44a716&&_0x44a716[_0x359c('0x48')]===_0x359c('0xd2')){delete this[_0x359c('0x2c')][_0x26e2dd[_0x359c('0xc7')]];this[_0x359c('0xd3')](this[_0x359c('0x25')][_0x44a716[_0x359c('0xc6')]]);this['campaigns'][_0x44a716['queue']][_0x359c('0x13d')]+=0x1;_0x2c4d1a=new Hangup(_0x44a716,_0x26e2dd);hopperUtils[_0x359c('0xce')](_0x2c4d1a)[_0x359c('0xa3')](loggerCatch(_0x359c('0x13e')));hopperUtils[_0x359c('0xd0')](_0x2c4d1a)[_0x359c('0xa3')](loggerCatch(_0x359c('0x13f')));}if(_0x44a716&&_0x44a716[_0x359c('0x48')]!==_0x359c('0xd2')&&isNotNull(this[_0x359c('0x24')][_0x44a716['queue']][_0x359c('0x140')])){delete this['uniqueId'][_0x26e2dd['uniqueid']];this['updateOriginated'](this[_0x359c('0x24')][_0x44a716[_0x359c('0xc6')]]);this[_0x359c('0x24')][_0x44a716['queue']][_0x359c('0xc8')]+=0x1;this[_0x359c('0x24')][_0x44a716[_0x359c('0xc6')]][_0x359c('0x11e')]+=0x1;_0x2c4d1a=new Hangup(_0x44a716,_0x26e2dd);_0x2c4d1a[_0x359c('0xd9')]=0x10;_0x2c4d1a[_0x359c('0x75')]=_0x359c('0x141');_0x2c4d1a[_0x359c('0x129')]=_0x359c('0x142');hopperUtils[_0x359c('0xce')](_0x2c4d1a)[_0x359c('0xa3')](loggerCatch(_0x359c('0x13e')));hopperUtils[_0x359c('0xd0')](_0x2c4d1a)['catch'](loggerCatch(_0x359c('0x13f')));}if(_0x44a716&&_0x44a716[_0x359c('0x48')]!=='ivr'&&!isNotNull(this['voiceQueues'][_0x44a716[_0x359c('0xc6')]][_0x359c('0x140')])){if(_0x26e2dd[_0x359c('0x143')]==='Normal\x20Clearing'){delete this['uniqueId'][_0x26e2dd[_0x359c('0xc7')]];this[_0x359c('0x24')][_0x44a716[_0x359c('0xc6')]]['outboundAnswerCallsDay']+=0x1;const _0x340b80=new AgentComplete(_0x44a716,_0x26e2dd);_0x340b80[_0x359c('0xe7')]=this['voiceQueues'][_0x44a716['queue']]['id'];hopperUtils['createHistory'](_0x340b80)[_0x359c('0xa3')](loggerCatch(_0x359c('0xcf')));hopperUtils[_0x359c('0xd0')](_0x340b80)[_0x359c('0xa3')](loggerCatch(_0x359c('0xd1')));}else{delete this[_0x359c('0x2c')][_0x26e2dd['uniqueid']];this[_0x359c('0xd3')](this[_0x359c('0x24')][_0x44a716[_0x359c('0xc6')]]);this['voiceQueues'][_0x44a716[_0x359c('0xc6')]][_0x359c('0x144')]+=0x1;_0x2c4d1a=new Hangup(_0x44a716,_0x26e2dd);_0x2c4d1a[_0x359c('0xd9')]=0xc;_0x2c4d1a[_0x359c('0x75')]=_0x26e2dd['cause-txt'];_0x2c4d1a[_0x359c('0x129')]=_0x359c('0x145');hopperUtils['createHistory'](_0x2c4d1a)[_0x359c('0xa3')](loggerCatch(_0x359c('0x13e')));hopperUtils[_0x359c('0xd0')](_0x2c4d1a)[_0x359c('0xa3')](loggerCatch(_0x359c('0x13f')));}}};Dialer[_0x359c('0x1f')][_0x359c('0xd')]=function(_0x57cdc2){var _0x5654fc=this;if(!_0x5654fc['queuesSummary'][_0x57cdc2[_0x359c('0x66')]]){_0x5654fc['queuesSummary'][_0x57cdc2[_0x359c('0x66')]]={'running':![]};}else if(_0x5654fc[_0x359c('0x30')][_0x57cdc2[_0x359c('0x66')]]['running']===!![]){return;}else if(_0x5654fc[_0x359c('0x30')][_0x57cdc2['name']][_0x359c('0x146')]===![]){_0x5654fc[_0x359c('0x30')][_0x57cdc2[_0x359c('0x66')]]['running']=!![];}var _0x2a24e6=_0x5654fc[_0x359c('0x24')][_0x57cdc2[_0x359c('0x66')]];var _0x40d9c7=_0x2a24e6['message']!==utils[_0x359c('0x71')]['INACTIVE'];var _0x396ea8=utils[_0x359c('0x147')](_0x2a24e6);_0x2a24e6[_0x359c('0x148')]=utils[_0x359c('0x149')](_0x2a24e6,_0x5654fc[_0x359c('0x27')]);Promise['resolve']()[_0x359c('0xa0')](function(){if(_0x2a24e6[_0x359c('0x148')]===utils[_0x359c('0x71')][_0x359c('0x83')]){if(_0x40d9c7){clearPredictiveAttributes(_0x2a24e6);_0x57cdc2[_0x359c('0x2d')]=undefined;_0x57cdc2[_0x359c('0x64')]=undefined;}if(_0x2a24e6[_0x359c('0x148')]===utils['CAMPAIGN_STATUS'][_0x359c('0x83')]){_0x57cdc2[_0x359c('0x14a')]=0x0;_0x57cdc2[_0x359c('0x103')]=0x0;_0x57cdc2['inUse']=0x0;_0x57cdc2[_0x359c('0x14b')]=0x0;_0x57cdc2[_0x359c('0x14c')]=0x0;}}else if(_0x2a24e6['statusMessage']===utils[_0x359c('0x71')][_0x359c('0x14d')]&&!_0x396ea8){return _0x5654fc['ifTime'](_0x2a24e6,!![])[_0x359c('0xa0')](function(){return _0x5654fc[_0x359c('0x99')](_0x2a24e6,![]);})[_0x359c('0xa0')](function(){return _0x5654fc['checkDialMethod'](_0x2a24e6);})[_0x359c('0xa3')](function(_0x54bee3){loggerSyncQueueSummary[_0x359c('0x65')]('[syncQueueSummary]',util['inspect'](_0x54bee3,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x2a24e6);});}else{clearPredictiveAttributes(_0x2a24e6);}})['then'](function(){var _0x40753a=_0x57cdc2[_0x359c('0x14e')](_0x2a24e6);if(_0x40753a||_0x2a24e6['queueSummaryCountersUpdated']){_0x2a24e6[_0x359c('0x14f')]=![];_0x57cdc2[_0x359c('0x150')](_0x2a24e6);Object[_0x359c('0x151')](_0x2a24e6,_0x57cdc2);emitOutboundVoiceQueueSummary(_0x57cdc2);}_0x5654fc['queuesSummary'][_0x2a24e6['name']][_0x359c('0x146')]=![];})['catch'](function(_0x4f7566){logger[_0x359c('0x6a')](_0x359c('0x152'),util[_0x359c('0x6c')](_0x4f7566,{'showHidden':![],'depth':null}));_0x5654fc[_0x359c('0x30')][_0x2a24e6[_0x359c('0x66')]][_0x359c('0x146')]=![];});};Dialer[_0x359c('0x1f')][_0x359c('0x3c')]=_[_0x359c('0x153')](function(){var _0x3b9789=_[_0x359c('0x154')](this[_0x359c('0x24')],function(_0x1ff1b3){return _0x1ff1b3[_0x359c('0x155')];});var _0x1eb687=_[_0x359c('0x154')](this[_0x359c('0x26')],function(_0x3963ca){return _0x3963ca[_0x359c('0x156')]&&_0x3963ca['status']===_0x359c('0x8d');});if(_0x3b9789['length']>0x0&&_0x1eb687['length']>0x0){return Promise[_0x359c('0xb4')]()[_0x359c('0xa0')](cmHopper[_0x359c('0x157')](_[_0x359c('0x158')](_0x3b9789,'id'),previewRecallmeReminderInterval,_['map'](_0x1eb687,'id')))[_0x359c('0xa0')](function(_0x246226){for(var _0x46d9e4=0x0;_0x46d9e4<_0x246226['length'];_0x46d9e4++){var _0x458aeb=_0x246226[_0x46d9e4][_0x359c('0x159')][_0x359c('0x66')];if(_0x458aeb)io['to'](util[_0x359c('0x4a')](_0x359c('0x15a'),_0x458aeb))[_0x359c('0x120')]('user:dialPreviewRecallReminder',{'hopper':_0x246226[_0x46d9e4]});}})[_0x359c('0xa3')](function(_0x318fa3){logger[_0x359c('0x6a')](_0x359c('0x15b'),_0x318fa3);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x359c('0x1f')][_0x359c('0x45')]=function(){var _0x27b2d9=this;setInterval(function(){_0x27b2d9['clearZombieChannels'](_0x27b2d9[_0x359c('0x2c')],'[uniqueid]');_0x27b2d9[_0x359c('0x15c')](_0x27b2d9[_0x359c('0x2a')],'[actions]');},0x32c8);};Dialer[_0x359c('0x1f')][_0x359c('0x15c')]=function(_0x1b1e0b,_0x25df1c){var _0x1dad15=this;for(var _0x11704d in _0x1b1e0b){if(typeof _0x1b1e0b[_0x11704d]!==_0x359c('0xb1')){this[_0x359c('0x22')][_0x359c('0x20')](function(){if(!_['isNil'](_0x1b1e0b[_0x11704d])){return ami['Action']({'action':'status','channel':_0x1b1e0b[_0x11704d]['channel']})[_0x359c('0xa3')](function(_0x284356){if(_0x284356[_0x359c('0x70')]===_0x359c('0x15d')){setTimeout(function(){if(_0x1b1e0b[_0x11704d]&&_0x1b1e0b[_0x11704d][_0x359c('0x48')]!==_0x359c('0xd2')){_0x1dad15['updateOriginated'](_0x1dad15[_0x359c('0x24')][_0x1b1e0b[_0x11704d][_0x359c('0xc6')]]);logger[_0x359c('0x6a')](_0x359c('0x15e'),_0x25df1c,_0x11704d,_0x1b1e0b[_0x11704d][_0x359c('0xc6')]);delete _0x1b1e0b[_0x11704d];}if(_0x1b1e0b[_0x11704d]&&_0x1b1e0b[_0x11704d][_0x359c('0x48')]===_0x359c('0xd2')){_0x1dad15['updateOriginated'](_0x1dad15['campaigns'][_0x1b1e0b[_0x11704d]['queue']]);logger['error'](_0x359c('0x15f'),_0x25df1c,_0x11704d,_0x1b1e0b[_0x11704d][_0x359c('0xc6')]);delete _0x1b1e0b[_0x11704d];}},0x2328);}});}});}}};Dialer[_0x359c('0x1f')][_0x359c('0x160')]=function(_0x24d2d3){return Promise[_0x359c('0xb4')]()['then'](voiceQueueRt[_0x359c('0x160')](_0x24d2d3))['catch'](loggerCatch(_0x359c('0x161')));};Dialer[_0x359c('0x1f')]['updateOriginated']=function(_0x483612){if(!_['isUndefined'](_0x483612)&&_0x483612!==null){if(typeof _0x483612[_0x359c('0x82')]!==_0x359c('0xb1')){if(_0x483612[_0x359c('0x82')]>0x0){_0x483612[_0x359c('0x82')]-=0x1;}else{logger['error'](_0x359c('0x162'));}}}else{logger[_0x359c('0x6a')](_0x359c('0x163'));}};Dialer[_0x359c('0x1f')][_0x359c('0x164')]=function(_0x22ceb0,_0x26627d){var _0x3693a5=this;return function(_0x2774c5){_0x3693a5[_0x359c('0xd3')](_0x26627d);logger[_0x359c('0x6a')](_0x22ceb0,util['inspect'](_0x2774c5,{'showHidden':![],'depth':null}));};};Dialer['prototype']['emptyContact']=function(_0x3c85c7,_0x483f9d,_0x18c6c8){var _0x10da96={'state':0x19,'statedesc':'notFound'};this['updateOriginated'](_0x483f9d);this[_0x359c('0x123')](_['merge'](_0x10da96,_['pick'](_0x18c6c8,[_0x359c('0xe5'),_0x359c('0xf7'),_0x359c('0x165'),_0x359c('0xe6'),_0x359c('0xe7')])),_0x359c('0x166'),_0x359c('0x167'));logger[_0x359c('0x6a')](_0x3c85c7);};Dialer[_0x359c('0x1f')][_0x359c('0x123')]=function(_0x42eaea,_0x255d9b,_0x28024f){hopperUtils[_0x359c('0xce')](_0x42eaea)[_0x359c('0xa3')](loggerCatch(_0x255d9b));hopperUtils[_0x359c('0xd0')](_0x42eaea)[_0x359c('0xa3')](loggerCatch(_0x28024f));};Dialer[_0x359c('0x1f')]['queueCallerAbandonCreateState']=function(_0x5dbb2b,_0x2b6286){hopperUtils[_0x359c('0xce')](_0x5dbb2b)[_0x359c('0xa3')](loggerCatch(_0x359c('0xcf')));if(_0x2b6286==0x0){hopperUtils[_0x359c('0xd0')](_0x5dbb2b)['catch'](loggerCatch(_0x359c('0x168')));}};Dialer[_0x359c('0x1f')][_0x359c('0x15b')]=function(_0x28bb78){return Promise[_0x359c('0xb4')]()['then'](cmHopper[_0x359c('0x157')](_0x28bb78['id'],previewRecallmeReminderInterval))[_0x359c('0xa0')](function(_0x10d74d){for(var _0xe778f3=0x0;_0xe778f3<_0x10d74d[_0x359c('0x9d')];_0xe778f3++){var _0x2d91c2=_0x10d74d[_0xe778f3]['Agent'][_0x359c('0x66')];if(_0x2d91c2)io['to'](util[_0x359c('0x4a')](_0x359c('0x15a'),_0x2d91c2))[_0x359c('0x120')](_0x359c('0x169'),{'hopper':_0x10d74d[_0xe778f3]});}})[_0x359c('0xa3')](function(){});};Dialer[_0x359c('0x1f')][_0x359c('0xb8')]=function(_0x516654){var _0x44c55a=this;return function(){_0x44c55a[_0x359c('0x16a')](_0x516654);};};Dialer[_0x359c('0x1f')][_0x359c('0x16b')]=function(_0x29557f,_0x5f7a4c){var _0x2d5925=this;var _0x544ae9=uuid['v4']();this[_0x359c('0x2a')][_0x544ae9]=new Action(_0x29557f,_0x5f7a4c,_0x544ae9);return new Promise(function(_0x10fe4b,_0x7e1e15){if(_[_0x359c('0x47')](_0x29557f)&&typeof _0x29557f!==_0x359c('0x16c')){return _0x7e1e15(msgResponse(_0x359c('0x16d'),_0x359c('0x96'),'voiceQueue\x20is\x20undefine'));}if(_[_0x359c('0x47')](_0x5f7a4c['phone'])||_0x5f7a4c['phone']===null){return _0x7e1e15(msgResponse(_0x359c('0x16d'),_0x359c('0x96'),_0x359c('0x16e')));}var _0x50852a={'XMD-CALLERID':_0x2d5925['actions'][_0x544ae9][_0x359c('0x16f')](),'XMD-AGI':_0x29557f[_0x359c('0x140')]?util[_0x359c('0x4a')](_0x359c('0x170'),ipAgi,_0x29557f[_0x359c('0x140')]):'NONE','XMD-AGIAFTER':_0x29557f['dialQueueProject2']?util['format'](_0x359c('0x170'),ipAgi,_0x29557f['dialQueueProject2']):_0x359c('0x171'),'XMD-QUEUE':utils[_0x359c('0x172')](_0x29557f)?util[_0x359c('0x4a')]('\x22%s,%s%s,,,%s\x22',_0x29557f[_0x359c('0x66')],_0x29557f[_0x359c('0x173')]||'',_0x29557f[_0x359c('0xcd')]?'c':'',_0x29557f[_0x359c('0x174')]||0x3):'NONE','XMD-CONTACTID':_0x5f7a4c[_0x359c('0xe5')],'XMD-CDRTYPE':_0x359c('0x9'),'CALLERID(all)':_0x2d5925[_0x359c('0x2a')][_0x544ae9][_0x359c('0x16f')](),'XMD-AMD':_0x29557f[_0x359c('0x11c')]?'ACTIVE':_0x359c('0x171'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x29557f['dialAMDActive']){_0x50852a['XMD-AMDINITIALSILENCE']=_0x29557f[_0x359c('0x175')]||0x9c4;_0x50852a[_0x359c('0x176')]=_0x29557f['dialAMDGreeting']||0x5dc;_0x50852a[_0x359c('0x177')]=_0x29557f[_0x359c('0x178')]||0x320;_0x50852a['XMD-AMDTOTALANALYSISTIME']=_0x29557f['dialAMDTotalAnalysisTime']||0x1388;_0x50852a[_0x359c('0x179')]=_0x29557f[_0x359c('0x17a')]||0x64;_0x50852a[_0x359c('0x17b')]=_0x29557f[_0x359c('0x17c')]||0x32;_0x50852a[_0x359c('0x17d')]=_0x29557f[_0x359c('0x17e')]||0x3;_0x50852a[_0x359c('0x17f')]=_0x29557f[_0x359c('0x180')]||0x100;_0x50852a[_0x359c('0x181')]=_0x29557f['dialAMDMaximumWordLength']||0x1388;}if(utils['isOutboundQueue'](_0x29557f)){_0x50852a[_0x359c('0x182')]=_0x5f7a4c[_0x359c('0xe6')];}else{_0x50852a[_0x359c('0x183')]=_0x5f7a4c[_0x359c('0xe7')];}var _0x281cbf=utils[_0x359c('0x184')](_0x5f7a4c[_0x359c('0x185')]);Object[_0x359c('0x151')](_0x50852a,_0x281cbf);var _0x35bb64=_0x2d5925[_0x359c('0x8a')](_0x29557f['Trunk'])?utils[_0x359c('0x186')](_0x29557f[_0x359c('0x187')][_0x359c('0x188')],_0x29557f[_0x359c('0x189')],_0x29557f[_0x359c('0x18a')]>0x0?utils[_0x359c('0x18b')](_0x29557f['dialOriginateCallerIdNumber'],_0x29557f[_0x359c('0x18a')]):_0x29557f[_0x359c('0x18c')]):utils[_0x359c('0x186')](_[_0x359c('0x101')](_0x29557f[_0x359c('0x91')])?_0x29557f['Trunk'][_0x359c('0x188')]:_0x29557f[_0x359c('0x91')][_0x359c('0x188')],_0x29557f[_0x359c('0x189')],_0x29557f[_0x359c('0x18a')]>0x0?utils[_0x359c('0x18b')](_0x29557f[_0x359c('0x18c')],_0x29557f[_0x359c('0x18a')]):_0x29557f['dialOriginateCallerIdNumber']);if(_0x35bb64){_0x50852a['XMD-ORIGINATECALLERIDNAME']=_0x2d5925[_0x359c('0x2a')][_0x544ae9][_0x359c('0x18d')]=utils['extractCalleridName'](_0x35bb64);_0x50852a[_0x359c('0x18e')]=_0x5f7a4c[_0x359c('0x18f')];}_0x29557f[_0x359c('0x190')]=_0x50852a;return ami[_0x359c('0x9e')]({'actionid':_0x544ae9,'action':_0x359c('0x16d'),'channel':_0x2d5925[_0x359c('0x8a')](_0x29557f[_0x359c('0x187')])?util['format']('SIP/%s/%s%s',_0x29557f[_0x359c('0x187')]['name'],isNotNull(_0x29557f[_0x359c('0x191')])?_0x29557f['dialPrefix'][_0x359c('0x192')]()||'':'',_0x29557f[_0x359c('0x193')]>0x0?_0x5f7a4c['phone']['substring'](_0x29557f[_0x359c('0x193')]):_0x5f7a4c[_0x359c('0x18f')]):util[_0x359c('0x4a')](_0x359c('0x194'),_[_0x359c('0x101')](_0x29557f[_0x359c('0x91')])?_0x29557f[_0x359c('0x187')]['name']:_0x29557f[_0x359c('0x91')][_0x359c('0x66')],isNotNull(_0x29557f[_0x359c('0x191')])?_0x29557f[_0x359c('0x191')][_0x359c('0x192')]()||'':'',_0x29557f[_0x359c('0x193')]>0x0?_0x5f7a4c['phone']['substring'](_0x29557f['dialCutDigit']):_0x5f7a4c[_0x359c('0x18f')]),'callerid':_0x35bb64,'Exten':_0x359c('0x195'),'Context':_0x359c('0x196'),'Priority':'1','variable':_0x50852a,'timeout':(_0x29557f[_0x359c('0x197')]||0x1e)*0x3e8,'async':!![],'channelid':_0x544ae9})[_0x359c('0xa0')](function(_0x14ccd9){return _0x10fe4b(_0x14ccd9);})[_0x359c('0xa3')](function(_0x8d771d){_0x29557f['outboundOriginateFailureCallsDay']+=0x1;var _0x396259=new History(_0x2d5925[_0x359c('0x2a')][_0x544ae9]);logger[_0x359c('0x6a')](util['format']('[originateError]:\x20%s',JSON[_0x359c('0x89')](_0x8d771d)));_0x396259['state']=0xe;_0x396259[_0x359c('0x75')]=_0x359c('0x198');_0x396259[_0x359c('0x76')]=moment()[_0x359c('0x4a')](_0x359c('0xd5'));_0x396259['endtime']=_0x396259[_0x359c('0x76')];hopperUtils[_0x359c('0xce')](_0x396259)[_0x359c('0xa3')](loggerCatch(_0x359c('0x199')));_0x2d5925[_0x359c('0xd0')](_0x396259)['catch'](loggerCatch(_0x359c('0x199')))[_0x359c('0x109')](function(){delete _0x2d5925[_0x359c('0x2a')][_0x544ae9];return _0x7e1e15(msgResponse(_0x359c('0x16d'),'Error','originate\x20action\x20Error'));});});});};Dialer[_0x359c('0x1f')]['checkRetriveMax']=function(_0x5731b9,_0x4adecf,_0x41f966){var _0x502472=new History(_0x4adecf);if(_0x502472[_0x359c('0x12d')]+_0x502472[_0x359c('0x12e')]+_0x502472[_0x359c('0x12f')]+_0x502472[_0x359c('0x13a')]+_0x502472[_0x359c('0xe1')]+_0x502472[_0x359c('0xf0')]+_0x502472[_0x359c('0x130')]+_0x502472[_0x359c('0x131')]>=_0x41f966['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x5731b9){case 0x3:if(_0x502472[_0x359c('0x12f')]>=_0x41f966['dialNoAnswerMaxRetry']-0x1){return!![];}hopperUtils[_0x359c('0xf5')]({'active':![],'countnoanswerretry':_0x502472[_0x359c('0x12f')]+=0x1,'scheduledat':moment()[_0x359c('0xf6')](_0x41f966['dialNoAnswerRetryFrequency'],_0x359c('0xe4'))[_0x359c('0x4a')](_0x359c('0xd5')),'ContactId':_0x502472['ContactId'],'ListId':_0x502472['ListId'],'VoiceQueueId':_0x502472['VoiceQueueId']||undefined,'CampaignId':_0x502472[_0x359c('0xe7')]||undefined})[_0x359c('0xa3')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x502472[_0x359c('0x12d')]>=_0x41f966[_0x359c('0x19a')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countbusyretry':_0x502472['countbusyretry']+=0x1,'scheduledat':moment()['add'](_0x41f966[_0x359c('0x19b')],_0x359c('0xe4'))[_0x359c('0x4a')](_0x359c('0xd5')),'ContactId':_0x502472[_0x359c('0xe5')],'ListId':_0x502472[_0x359c('0xf7')],'VoiceQueueId':_0x502472[_0x359c('0xe6')]||undefined,'CampaignId':_0x502472['CampaignId']||undefined})[_0x359c('0xa3')](loggerCatch(_0x359c('0x19c')));break;case 0x8:if(_0x502472[_0x359c('0x12e')]>=_0x41f966[_0x359c('0x19d')]-0x1){return!![];}hopperUtils[_0x359c('0xf5')]({'active':![],'countcongestionretry':_0x502472[_0x359c('0x12e')]+=0x1,'scheduledat':moment()[_0x359c('0xf6')](_0x41f966['dialCongestionRetryFrequency'],_0x359c('0xe4'))[_0x359c('0x4a')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x502472[_0x359c('0xe5')],'ListId':_0x502472[_0x359c('0xf7')],'VoiceQueueId':_0x502472[_0x359c('0xe6')]||undefined,'CampaignId':_0x502472['CampaignId']||undefined})[_0x359c('0xa3')](loggerCatch(_0x359c('0x19e')));break;case 0x0:if(_0x502472[_0x359c('0x13a')]>=_0x41f966[_0x359c('0x19f')]-0x1){return!![];}else{hopperUtils[_0x359c('0xf5')]({'active':![],'countnosuchnumberretry':_0x502472['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0x359c('0xf6')](_0x41f966[_0x359c('0x1a0')],_0x359c('0xe4'))[_0x359c('0x4a')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x502472['ContactId'],'ListId':_0x502472[_0x359c('0xf7')],'VoiceQueueId':_0x502472[_0x359c('0xe6')]||undefined,'CampaignId':_0x502472[_0x359c('0xe7')]||undefined})[_0x359c('0xa3')](loggerCatch(_0x359c('0x1a1')));}break;case 0xa:if(_0x502472[_0x359c('0xe1')]>=_0x41f966[_0x359c('0xe2')]-0x1){return!![];}hopperUtils[_0x359c('0xf5')]({'active':![],'countdropretry':_0x502472[_0x359c('0xe1')]+=0x1,'scheduledat':moment()[_0x359c('0xf6')](_0x41f966['dialDropRetryFrequency'],_0x359c('0xe4'))[_0x359c('0x4a')](_0x359c('0xd5')),'ContactId':_0x502472['ContactId'],'ListId':_0x502472[_0x359c('0xf7')],'VoiceQueueId':_0x502472['VoiceQueueId']||undefined,'CampaignId':_0x502472['CampaignId']||undefined})[_0x359c('0xa3')](loggerCatch(_0x359c('0xe8')));break;case 0xb:if(_0x502472['countabandonedretry']>=_0x41f966['dialAbandonedMaxRetry']-0x1){return!![];}hopperUtils[_0x359c('0xf5')]({'active':![],'countabandonedretry':_0x502472['countabandonedretry']+=0x1,'scheduledat':moment()['add'](_0x41f966['dialAbandonedRetryFrequency'],_0x359c('0xe4'))['format'](_0x359c('0xd5')),'ContactId':_0x502472[_0x359c('0xe5')],'ListId':_0x502472[_0x359c('0xf7')],'VoiceQueueId':_0x502472['VoiceQueueId']||undefined,'CampaignId':_0x502472[_0x359c('0xe7')]||undefined})['catch'](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x502472[_0x359c('0x130')]>=_0x41f966['dialMachineMaxRetry']-0x1){return!![];}hopperUtils[_0x359c('0xf5')]({'active':![],'countmachineretry':_0x502472[_0x359c('0x130')]+=0x1,'scheduledat':moment()[_0x359c('0xf6')](_0x41f966[_0x359c('0x137')],_0x359c('0xe4'))['format'](_0x359c('0xd5')),'ContactId':_0x502472[_0x359c('0xe5')],'ListId':_0x502472['ListId'],'VoiceQueueId':_0x502472['VoiceQueueId']||undefined,'CampaignId':_0x502472[_0x359c('0xe7')]||undefined})[_0x359c('0xa3')](loggerCatch(_0x359c('0x13c')));break;case 0x14:if(_0x502472[_0x359c('0x131')]>=_0x41f966[_0x359c('0x1a2')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countagentrejectretry':_0x502472['countagentrejectretry']+=0x1,'scheduledat':moment()[_0x359c('0xf6')](_0x41f966[_0x359c('0x1a3')],_0x359c('0xe4'))[_0x359c('0x4a')](_0x359c('0xd5')),'ContactId':_0x502472[_0x359c('0xe5')],'ListId':_0x502472[_0x359c('0xf7')],'VoiceQueueId':_0x502472[_0x359c('0xe6')]||undefined,'CampaignId':_0x502472[_0x359c('0xe7')]||undefined})['catch'](loggerCatch(_0x359c('0x1a4')));break;default:return!![];}};Dialer[_0x359c('0x1f')][_0x359c('0x117')]=function(_0x5cc8ed,_0x188285,_0x4068d8){var _0x20c5cd=this;var _0x297e94=new History(_0x5cc8ed);var _0x11c0a7=![];var _0x47c9ef;var _0x584f90;return new Promise(function(_0x20e93d,_0x1f919b){if(_[_0x359c('0x47')](_0x188285)&&typeof _0x188285!==_0x359c('0x16c')){return _0x1f919b(msgResponse(_0x359c('0x1a5'),_0x359c('0x96'),_0x359c('0x1a6')));}if(_['isUndefined'](_0x4068d8)&&typeof _0x4068d8!==_0x359c('0x16c')){return _0x1f919b(msgResponse(_0x359c('0x1a5'),_0x359c('0x96'),_0x359c('0x1a7')));}hopperUtils[_0x359c('0xf3')](_0x297e94,_0x4068d8[_0x359c('0xc9')],_0x188285)['then'](function(_0x43c0bc){if(_0x43c0bc['additional']==0x1)_0x11c0a7=!![];switch(_0x4068d8[_0x359c('0xc9')]){case'0':_0x188285[_0x359c('0x1a8')]+=0x1;_0x297e94[_0x359c('0xd9')]=0x0;_0x297e94[_0x359c('0x75')]=_0x359c('0x1a9');_0x297e94[_0x359c('0x13a')]+=0x1;_0x297e94[_0x359c('0xdd')]+=0x1;ami[_0x359c('0x120')]('custom:agentnosuchnumber',ut[_0x359c('0x12b')](_0x5cc8ed,_0x359c('0x1aa')));_0x47c9ef=_0x188285[_0x359c('0x1a0')];_0x584f90=_0x188285[_0x359c('0xf2')];hopperUtils[_0x359c('0xce')](_0x297e94)['catch'](loggerCatch(_0x359c('0x12c')));if(_0x20c5cd[_0x359c('0x1ab')](0x0,_0x5cc8ed,_0x188285)&&!_0x11c0a7){if(_0x297e94[_0x359c('0x13a')]>=_0x188285[_0x359c('0x19f')]){_0x20c5cd[_0x359c('0x135')](_0x297e94,_0x20e93d,_0x1f919b,_0x359c('0x1ac'));}else{_0x20c5cd[_0x359c('0x132')](_0x297e94,_0x20e93d,_0x1f919b,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x188285[_0x359c('0x1ad')]+=0x1;_0x297e94[_0x359c('0xd9')]=0x3;_0x297e94[_0x359c('0x75')]='NoAnswer';_0x297e94['countnoanswerretry']+=0x1;_0x297e94[_0x359c('0xdd')]+=0x1;var _0x5f40fa=ut[_0x359c('0x1ae')](_0x5cc8ed,_0x188285);ami['emit'](_0x359c('0x1af'),_0x5f40fa);_0x47c9ef=_0x188285[_0x359c('0x1b0')];_0x584f90=_0x188285[_0x359c('0xf2')];hopperUtils[_0x359c('0xce')](_0x297e94)[_0x359c('0xa3')](loggerCatch(_0x359c('0x1b1')));if(_0x20c5cd[_0x359c('0x1ab')](0x3,_0x5cc8ed,_0x188285)&&!_0x11c0a7){if(_0x297e94[_0x359c('0x12f')]>=_0x188285['dialNoAnswerMaxRetry']){_0x20c5cd[_0x359c('0x135')](_0x297e94,_0x20e93d,_0x1f919b,_0x359c('0x1b2'));}else{_0x20c5cd[_0x359c('0x132')](_0x297e94,_0x20e93d,_0x1f919b,_0x359c('0x1b2'));}}break;case'5':_0x188285[_0x359c('0x1b3')]+=0x1;_0x297e94[_0x359c('0xd9')]=0x5;_0x297e94[_0x359c('0x75')]='Busy';_0x297e94['countbusyretry']+=0x1;_0x297e94['countglobal']+=0x1;ami['emit'](_0x359c('0x1b4'),ut[_0x359c('0x12b')](_0x5cc8ed,_0x359c('0x1b5')));_0x47c9ef=_0x188285[_0x359c('0x19b')];_0x584f90=_0x188285[_0x359c('0xf2')];hopperUtils[_0x359c('0xce')](_0x297e94)[_0x359c('0xa3')](loggerCatch(_0x359c('0x1b6')));if(_0x20c5cd[_0x359c('0x1ab')](0x5,_0x5cc8ed,_0x188285)&&!_0x11c0a7){if(_0x297e94[_0x359c('0x12d')]>=_0x188285[_0x359c('0x19a')]){_0x20c5cd[_0x359c('0x135')](_0x297e94,_0x20e93d,_0x1f919b,_0x359c('0x1b7'));}else{_0x20c5cd[_0x359c('0x132')](_0x297e94,_0x20e93d,_0x1f919b,'reason\x205\x20busy');}}break;case'8':_0x188285[_0x359c('0x1b8')]+=0x1;_0x297e94[_0x359c('0xd9')]=0x8;_0x297e94[_0x359c('0x75')]=_0x359c('0x1b9');_0x297e94[_0x359c('0x12e')]+=0x1;_0x297e94[_0x359c('0xdd')]+=0x1;_0x47c9ef=_0x188285[_0x359c('0x1ba')];_0x584f90=_0x188285[_0x359c('0xf2')];ami['emit'](_0x359c('0x1bb'),ut[_0x359c('0x12b')](_0x5cc8ed,_0x359c('0x1bc')));hopperUtils[_0x359c('0xce')](_0x297e94)['catch'](loggerCatch(_0x359c('0x1bd')));if(_0x20c5cd[_0x359c('0x1ab')](0x8,_0x5cc8ed,_0x188285)&&!_0x11c0a7){if(_0x297e94[_0x359c('0x12e')]>=_0x188285[_0x359c('0x19d')]){_0x20c5cd[_0x359c('0x135')](_0x297e94,_0x20e93d,_0x1f919b,_0x359c('0x1be'));}else{_0x20c5cd[_0x359c('0x132')](_0x297e94,_0x20e93d,_0x1f919b,_0x359c('0x1be'));}}break;case'11':_0x188285['outboundAbandonedCallsDay']+=0x1;_0x297e94[_0x359c('0xd9')]=0xb;_0x297e94[_0x359c('0x75')]=_0x359c('0xf9');_0x297e94[_0x359c('0xf0')]+=0x1;_0x297e94['countglobal']+=0x1;_0x47c9ef=_0x188285[_0x359c('0xf1')];_0x584f90=_0x188285[_0x359c('0xf2')];hopperUtils['createHistory'](_0x297e94)[_0x359c('0xa3')](loggerCatch(_0x359c('0xfb')));if(_0x20c5cd[_0x359c('0x1ab')](0xb,_0x5cc8ed,_0x188285)&&!_0x11c0a7){if(_0x297e94[_0x359c('0xf0')]>=_0x188285[_0x359c('0xf4')]){_0x20c5cd['createStateFinal'](_0x297e94,_0x20e93d,_0x1f919b,_0x359c('0x1bf'));}else{_0x20c5cd['stateGlobal'](_0x297e94,_0x20e93d,_0x1f919b,'reason\x2011\x20abandoned');}}break;case'20':_0x188285[_0x359c('0x1c0')]+=0x1;_0x297e94[_0x359c('0xd9')]=0x14;_0x297e94[_0x359c('0x75')]=_0x359c('0x1c1');_0x297e94[_0x359c('0x131')]+=0x1;_0x297e94[_0x359c('0xdd')]+=0x1;_0x47c9ef=_0x188285[_0x359c('0x1a3')];_0x584f90=_0x188285[_0x359c('0xf2')];ami[_0x359c('0x120')](_0x359c('0x1c2'),ut[_0x359c('0x12b')](_0x5cc8ed,_0x359c('0x1c3')));hopperUtils[_0x359c('0xce')](_0x297e94)[_0x359c('0xa3')](loggerCatch(_0x359c('0x1c4')));if(_0x20c5cd['checkRetriveMax'](0x14,_0x5cc8ed,_0x188285)&&!_0x11c0a7){if(_0x297e94[_0x359c('0x131')]>=_0x188285[_0x359c('0x1a2')]){_0x20c5cd['createStateFinal'](_0x297e94,_0x20e93d,_0x1f919b,_0x359c('0x1c5'));}else{_0x20c5cd['stateGlobal'](_0x297e94,_0x20e93d,_0x1f919b,_0x359c('0x1c5'));}}break;default:_0x188285[_0x359c('0x144')]+=0x1;_0x297e94[_0x359c('0xd9')]=0xc;_0x297e94[_0x359c('0x75')]=_0x4068d8['reason'];_0x47c9ef=_0x188285[_0x359c('0x1a3')];_0x584f90=_0x188285[_0x359c('0xf2')];hopperUtils[_0x359c('0xce')](_0x297e94)[_0x359c('0xa3')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x20c5cd[_0x359c('0x1ab')](_0x4068d8['reason'],_0x5cc8ed,_0x188285)&&!_0x11c0a7){if(_0x297e94['countbusyretry']+_0x297e94[_0x359c('0x12e')]+_0x297e94[_0x359c('0x12f')]+_0x297e94[_0x359c('0x13a')]+_0x297e94[_0x359c('0xe1')]+_0x297e94[_0x359c('0xf0')]+_0x297e94[_0x359c('0x130')]+_0x297e94[_0x359c('0x131')]>=_0x188285[_0x359c('0x13b')]){_0x20c5cd['stateGlobal'](_0x297e94,_0x20e93d,_0x1f919b,_0x4068d8['reason']);}else{_0x20c5cd[_0x359c('0x135')](_0x297e94,_0x20e93d,_0x1f919b,_0x4068d8[_0x359c('0xc9')]);}}}})[_0x359c('0xa0')](function(){if(_0x11c0a7){hopperUtils[_0x359c('0xec')](_0x297e94,_0x47c9ef,_0x584f90)[_0x359c('0xa0')](function(){return _0x20e93d(0x1);});}});});};Dialer[_0x359c('0x1f')][_0x359c('0x132')]=function(_0x50258f,_0x44ccc4,_0x33609d,_0x30acf5){var _0x3e0d21=new Final(_0x50258f);_0x3e0d21[_0x359c('0xd9')]=0xf;_0x3e0d21['statedesc']='Global';this[_0x359c('0x135')](_0x3e0d21,_0x44ccc4,_0x33609d,_0x30acf5);};Dialer['prototype'][_0x359c('0x135')]=function(_0x49c2eb,_0x35ddd1,_0x144e9b,_0x15c83f){hopperUtils[_0x359c('0xd0')](_0x49c2eb)[_0x359c('0xa0')](function(){return _0x35ddd1(msgResponse('[callProgressDetecting]',_0x359c('0x116'),_0x15c83f));})[_0x359c('0xa3')](function(){return _0x144e9b(msgResponse(_0x359c('0x1c6'),_0x359c('0x96'),_0x359c('0x1c7')));});};Dialer[_0x359c('0x1f')][_0x359c('0xb')]=function(_0x1ca1e0){var _0x275115=_0x1ca1e0[_0x359c('0x1c8')]/0x64;var _0xb0b502=_0x1ca1e0[_0x359c('0x1c9')]/(_0x1ca1e0[_0x359c('0x1c9')]+_0x1ca1e0['outboundAnswerCallsDay']);var _0x221995=Math['round'](_0x1ca1e0[_0x359c('0x1ca')]*(_0x1ca1e0[_0x359c('0x1cb')]/0x64));var _0x3b4020=Math[_0x359c('0x1cc')](_0x1ca1e0[_0x359c('0x1ca')]*(_0x1ca1e0[_0x359c('0x1cd')]/0x64));var _0x37b425=_0x1ca1e0[_0x359c('0x14a')]+_0x1ca1e0[_0x359c('0x14b')];var _0xf03b0c=Math[_0x359c('0x1ce')](_0x1ca1e0[_0x359c('0x5b')]*_0x1ca1e0[_0x359c('0x5f')]*_0x1ca1e0[_0x359c('0x1cf')]*_0x1ca1e0[_0x359c('0x1d0')]);if(_[_0x359c('0x47')](_0x1ca1e0[_0x359c('0x64')])){if(!_[_0x359c('0x47')](_0x1ca1e0['startPredictive'])){_0x1ca1e0[_0x359c('0x2d')]=undefined;loggerPredictive['error'](_0x359c('0x1d1'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0x359c('0x47')](_0x1ca1e0[_0x359c('0x68')])){loggerPredictive['error'](_0x359c('0x1d1'),_0x359c('0x1d2'));clearInterval(_0x1ca1e0[_0x359c('0x68')]);_0x1ca1e0[_0x359c('0x68')]=undefined;}_0x1ca1e0[_0x359c('0x64')]=moment()[_0x359c('0x4a')](_0x359c('0xd5'));loggerPredictive[_0x359c('0x4e')](_0x1ca1e0[_0x359c('0x66')],_0x359c('0x1d3'),_0x1ca1e0[_0x359c('0x64')]);this[_0x359c('0xbc')](_0x1ca1e0,0x1);}else if(ifInterval(_0x1ca1e0[_0x359c('0x1d4')],_0x1ca1e0[_0x359c('0x64')])){this[_0x359c('0xbc')](_0x1ca1e0,0x1);loggerPredictiveCalls[_0x359c('0x4e')](_0x359c('0x1d5'),_0x1ca1e0[_0x359c('0x64')],_0x1ca1e0[_0x359c('0x66')]);_0x1ca1e0[_0x359c('0x5b')]=0x0;_0x1ca1e0[_0x359c('0xd8')]=0x0;}else if(_0x275115<_0xb0b502&&_0x1ca1e0[_0x359c('0x1d6')]==='dropRate'){clearPredictiveAttributes(_0x1ca1e0);loggerPredictive[_0x359c('0x4e')](_0x359c('0x1d7'),_0x359c('0x1d8'),_0xb0b502,_0x359c('0x64'),_0x1ca1e0[_0x359c('0x66')]);}else if(_0xf03b0c<_0x1ca1e0['predictiveIntervalErlangCallsDroppedCalls']&&_0x1ca1e0[_0x359c('0x1d6')]===_0x359c('0x1d9')){clearPredictiveAttributes(_0x1ca1e0);loggerPredictive[_0x359c('0x4e')](_0x359c('0x1da'),_0x359c('0x1db'),_0xf03b0c,_0x359c('0x1dc'),_0x1ca1e0[_0x359c('0xd8')],_0x359c('0x64'),_0x1ca1e0[_0x359c('0x66')]);}else if(!ifInterval(_0x1ca1e0[_0x359c('0x1d4')],_0x1ca1e0['startProgressive'])&&_['isUndefined'](_0x1ca1e0[_0x359c('0x2d')])&&!_['isUndefined'](_0x1ca1e0['startProgressive'])){_0x1ca1e0[_0x359c('0x2d')]=moment()[_0x359c('0x4a')](_0x359c('0xd5'));loggerPredictive['info'](_0x1ca1e0[_0x359c('0x66')],'started\x20in\x20predictive\x20at',_0x1ca1e0['startPredictive']);hopperUtils[_0x359c('0x1dd')](_0x1ca1e0[_0x359c('0x1d4')])[_0x359c('0xa0')](this[_0x359c('0x1de')](_0x1ca1e0))[_0x359c('0xa0')](mergeDataErlangB(_0x1ca1e0))['then'](this[_0x359c('0x1df')](_0x1ca1e0))['catch'](loggerCatchPredictive(_0x359c('0x1e0'),_0x1ca1e0));}else if(!ifInterval(_0x1ca1e0['dialPredictiveInterval'],_0x1ca1e0[_0x359c('0x2d')])){_0x1ca1e0[_0x359c('0xd8')]=0x0;_0x1ca1e0[_0x359c('0x2d')]=moment()[_0x359c('0x4a')](_0x359c('0xd5'));loggerPredictive['info'](_0x1ca1e0[_0x359c('0x66')],_0x359c('0x1e1'),_0x1ca1e0[_0x359c('0x2d')]);clearInterval(_0x1ca1e0[_0x359c('0x68')]);_0x1ca1e0[_0x359c('0x68')]=undefined;hopperUtils['avgHandleTime'](_0x1ca1e0[_0x359c('0x1d4')])['then'](this['getDataPredictive'](_0x1ca1e0))[_0x359c('0xa0')](mergeDataErlangB(_0x1ca1e0))[_0x359c('0xa0')](this['startMethodPredictive'](_0x1ca1e0))[_0x359c('0xa3')](loggerCatchPredictive(_0x359c('0x1e2'),_0x1ca1e0));}else if(_0x1ca1e0[_0x359c('0x1ca')]&&_0x37b425<_0x1ca1e0[_0x359c('0x1ca')]-_0x3b4020){clearPredictiveAttributes(_0x1ca1e0);loggerPredictive['info'](_0x1ca1e0[_0x359c('0x66')],_0x359c('0x1e3'),_0x37b425,_0x359c('0x1e4'),_0x1ca1e0[_0x359c('0x1ca')],'-',_0x3b4020,'=',_0x1ca1e0[_0x359c('0x1ca')]-_0x3b4020,')');}else if(_0x1ca1e0['predictiveIntervalAvailable']&&_0x37b425>_0x1ca1e0[_0x359c('0x1ca')]+_0x221995){clearPredictiveAttributes(_0x1ca1e0);loggerPredictive['info'](_0x1ca1e0[_0x359c('0x66')],_0x359c('0x1e3'),_0x37b425,_0x359c('0x1e5'),_0x1ca1e0[_0x359c('0x1ca')],'+',_0x221995,'=',_0x1ca1e0[_0x359c('0x1ca')]+_0x221995,')');}};Dialer['prototype'][_0x359c('0x1de')]=function(_0xca2db4){var _0x52ac82=this;return function(_0xa01477){return new Promise(function(_0x47dd3b,_0x52287c){_[_0x359c('0x62')](_0xca2db4,_0xa01477[0x0]);if(checkGetDataPredictive(_0xa01477[0x0])){var _0x1d89b5=_0xca2db4[_0x359c('0x1ca')]=_0xca2db4[_0x359c('0x14b')]+_0xca2db4['available'];var _0x165665=_0xca2db4[_0x359c('0x1d4')]*0x3c;var _0x466ef4=_0xa01477[0x0][_0x359c('0x56')]+_0xa01477[0x0][_0x359c('0x57')];var _0x24172b=(_0xa01477[0x0]['predictiveIntervalAnsweredCalls']+_0xa01477[0x0][_0x359c('0xd7')]+_0xa01477[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0xa01477[0x0][_0x359c('0x50')];_0xca2db4['predictiveIntervalHitRate']=_0x24172b>0x0?_0x24172b:0x1;switch(_0xca2db4['dialPredictiveOptimization']){case _0x359c('0x1d9'):var _0x521922=_0xca2db4['dialPredictiveOptimizationPercentage']/0x64;return _0x52ac82['abandonmentRate'](_0x1d89b5,_0x165665,_0x466ef4,_0x24172b,_0x521922)[_0x359c('0xa0')](function(_0x4cc6c6){return _0x47dd3b(_0x4cc6c6);});case _0x359c('0x1e6'):var _0xc3c4d8=_0xca2db4['dialPredictiveOptimizationPercentage']/0x64;return _0x52ac82[_0x359c('0x1e7')](_0x1d89b5,_0x165665,_0x466ef4,_0x24172b,_0xc3c4d8)[_0x359c('0xa0')](function(_0x2e6a92){return _0x47dd3b(_0x2e6a92);});default:return _0x52287c(msgResponse(_0x359c('0x1e8'),'Failure','Unknown\x20Predictive'));}}else{return _0x52287c(msgResponse(_0x359c('0x1e8'),_0x359c('0x96'),'check\x20failure'));}});};};Dialer[_0x359c('0x1f')][_0x359c('0x1e9')]=function(_0x5283f3){var _0x10eb84=this;return function(_0xba7a53){return new Promise(function(_0x45d5da,_0x2959ac){_[_0x359c('0x62')](_0x5283f3,_0xba7a53[0x0]);if(checkGetDataPredictive(_0xba7a53[0x0])){loggerPredictive[_0x359c('0x4e')](JSON[_0x359c('0x89')](_0xba7a53[0x0]));if(_0x5283f3[_0x359c('0x1d6')]===_0x359c('0x1d9')){return _0x10eb84[_0x359c('0x160')](_0x5283f3['id'])[_0x359c('0xa0')](function(_0x1652b0){var _0x1d3cc1=_0x5283f3[_0x359c('0x1ea')]-_0x1652b0[0x0]['outboundQueuePauses'];var _0x5cdcbe=_0x5283f3[_0x359c('0x1d4')]*0x3c;var _0x38f131=_0xba7a53[0x0][_0x359c('0x56')]+_0xba7a53[0x0]['predictiveIntervalAvgHoldtime'];var _0x4853a1=(_0xba7a53[0x0]['predictiveIntervalAnsweredCalls']+_0xba7a53[0x0]['predictiveIntervalDroppedCallsTimeout']+_0xba7a53[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0xba7a53[0x0][_0x359c('0x50')];var _0x365c01=_0x5283f3[_0x359c('0x1c8')]/0x64;_0x5283f3[_0x359c('0x1eb')]=_0x1652b0[0x0][_0x359c('0x1ec')]||0x0;_0x5283f3[_0x359c('0x1cf')]=_0x4853a1>0x0?_0x4853a1:0x1;return _0x10eb84[_0x359c('0x1ed')](_0x1d3cc1,_0x5cdcbe,_0x38f131,_0x4853a1,_0x365c01);})[_0x359c('0xa0')](function(_0x1c64b9){return _0x45d5da(_0x1c64b9);})[_0x359c('0xa3')](function(_0x3390d3){return _0x2959ac(msgResponse(_0x359c('0x1ee'),_0x359c('0x96'),JSON[_0x359c('0x89')](_0x3390d3)));});}if(_0x5283f3[_0x359c('0x1d6')]===_0x359c('0x1e6')){return _0x10eb84['getVoiceQueueRtPauses'](_0x5283f3['id'])[_0x359c('0xa0')](function(_0x2adb03){var _0x383e41=_0x5283f3[_0x359c('0x1ea')]-_0x2adb03[0x0][_0x359c('0x1ec')];var _0x1a3389=_0x5283f3['dialPredictiveInterval']*0x3c;var _0x334526=_0xba7a53[0x0]['predictiveIntervalAvgTalktime']+_0xba7a53[0x0][_0x359c('0x57')];var _0x5a514a=(_0xba7a53[0x0][_0x359c('0x52')]+_0xba7a53[0x0]['predictiveIntervalDroppedCallsTimeout']+_0xba7a53[0x0][_0x359c('0xed')])/_0xba7a53[0x0][_0x359c('0x50')];var _0x47b280=_0x5283f3[_0x359c('0x1c8')]/0x64;_0x5283f3[_0x359c('0x1eb')]=_0x2adb03[0x0][_0x359c('0x1ec')]||0x0;_0x5283f3[_0x359c('0x1cf')]=_0x5a514a>0x0?_0x5a514a:0x1;return _0x10eb84[_0x359c('0x1e7')](_0x383e41,_0x1a3389,_0x334526,_0x5a514a,_0x47b280);})[_0x359c('0xa0')](function(_0x481e8f){return _0x45d5da(_0x481e8f);})[_0x359c('0xa3')](function(_0x42f618){return _0x2959ac(msgResponse(_0x359c('0x1ee'),_0x359c('0x96'),JSON[_0x359c('0x89')](_0x42f618)));});}}else{return _0x2959ac(msgResponse(_0x359c('0x1e8'),_0x359c('0x96'),_0x359c('0x1ef')));}});};};Dialer['prototype']['startMethodPredictive']=function(_0x2a19b0){var _0x3376b6=this;return function(){var _0x5d20c2=0x0;var _0x430e5e=Math['floor'](_0x2a19b0['erlangCallToSecond']*0x3e8);if(_0x430e5e>0x0){_0x430e5e=_0x430e5e<0x64?0x64:_0x430e5e;loggerPredictive[_0x359c('0x4e')](_0x2a19b0['name'],_0x359c('0x1f0'),_0x430e5e,'milliseconds');_0x2a19b0[_0x359c('0x68')]=setInterval(function(){_0x3376b6[_0x359c('0x68')](_0x2a19b0);loggerPredictiveCalls['info'](_0x359c('0x1f1'),_0x5d20c2+=0x1);},_0x430e5e);}else{loggerPredictive[_0x359c('0x4e')](_0x2a19b0['name'],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x359c('0x1f')][_0x359c('0x1f2')]=function(_0x23b64d,_0x455bc9){var _0x7adae8=this;return function(_0x890992){if(_[_0x359c('0x4d')](_0x890992)){if(_[_0x359c('0x101')](_0x455bc9[_0x359c('0x165')])||!_0x455bc9['recallme']){if(_0x23b64d[_0x359c('0xbb')]===_0x359c('0xa')){_0x23b64d[_0x359c('0x77')]=_[_0x359c('0x47')](_0x23b64d[_0x359c('0x77')])?!![]:_0x23b64d[_0x359c('0x77')];var _0x37e05e=uuid['v4']();_0x7adae8[_0x359c('0x2a')][_0x37e05e]=new Action(_0x23b64d,_0x455bc9,_0x37e05e);loggerBooked[_0x359c('0x4e')](_0x359c('0x1f3'),_0x37e05e,_0x359c('0x1f4'),JSON[_0x359c('0x89')](_0x23b64d[_0x359c('0x77')]),'Queue:\x20',_0x23b64d[_0x359c('0x66')]);if(_0x23b64d['queueStatusComplete']){_0x23b64d[_0x359c('0x77')]=![];_0x7adae8[_0x359c('0x105')][_0x7adae8[_0x359c('0x2a')][_0x37e05e][_0x359c('0xc6')]]=[];ami['Action']({'actionid':_0x37e05e,'action':_0x359c('0x1f5'),'queue':_0x23b64d[_0x359c('0x66')]})[_0x359c('0xa3')](function(){_0x7adae8['updateOriginated'](_0x23b64d);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x7adae8[_0x359c('0x2a')][_0x37e05e]['ContactId'],'ListId':_0x7adae8[_0x359c('0x2a')][_0x37e05e][_0x359c('0xf7')],'VoiceQueueId':_0x7adae8[_0x359c('0x2a')][_0x37e05e]['VoiceQueueId']||undefined,'CampaignId':_0x7adae8[_0x359c('0x2a')][_0x37e05e][_0x359c('0xe7')]||undefined})[_0x359c('0xa3')](loggerCatch(_0x359c('0x1f6')));delete _0x7adae8[_0x359c('0x2a')][_0x37e05e];});}else{loggerBooked[_0x359c('0x4e')](_0x359c('0x1f7'),JSON[_0x359c('0x89')](_0x23b64d[_0x359c('0x77')]),'Queue:\x20',_0x23b64d[_0x359c('0x66')]);_0x7adae8[_0x359c('0xd3')](_0x23b64d);hopperUtils[_0x359c('0xf5')]({'active':![],'ContactId':_0x7adae8[_0x359c('0x2a')][_0x37e05e][_0x359c('0xe5')],'ListId':_0x7adae8[_0x359c('0x2a')][_0x37e05e][_0x359c('0xf7')],'VoiceQueueId':_0x7adae8[_0x359c('0x2a')][_0x37e05e][_0x359c('0xe6')]||undefined,'CampaignId':_0x7adae8[_0x359c('0x2a')][_0x37e05e]['CampaignId']||undefined})['catch'](loggerCatch(_0x359c('0x1f6')));delete _0x7adae8[_0x359c('0x2a')][_0x37e05e];}}else{return _0x7adae8[_0x359c('0x16b')](_0x23b64d,_0x455bc9);}}else{if(utils[_0x359c('0x63')](undefined,_0x455bc9[_0x359c('0x1f8')])<_0x23b64d[_0x359c('0x1f9')]*0x3c){if(_0x455bc9[_0x359c('0x159')]&&!_0x455bc9['Agent'][_0x359c('0x1fa')]){_0x7adae8[_0x359c('0x23')][_0x359c('0x110')](_0x455bc9['id'])[_0x359c('0x109')](function(){_0x7adae8[_0x359c('0xd3')](_0x23b64d);});}else{hopperUtils[_0x359c('0x1fb')]({'active':![]},_0x455bc9['id'],0x1)[_0x359c('0x109')](function(){_0x7adae8[_0x359c('0xd3')](_0x23b64d);});}}else{_0x23b64d[_0x359c('0x1fc')]+=0x1;_0x7adae8[_0x359c('0xd3')](_0x23b64d);if(_0x23b64d[_0x359c('0x1fd')]){hopperUtils[_0x359c('0xf5')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x455bc9[_0x359c('0xe5')],'ListId':_0x455bc9[_0x359c('0xf7')],'VoiceQueueId':_0x455bc9[_0x359c('0xe6')]||undefined,'CampaignId':_0x455bc9['CampaignId']||undefined})[_0x359c('0xa3')](loggerCatch(_0x359c('0x1fe')));hopperUtils[_0x359c('0xce')](createObjHistory(_0x23b64d,_0x455bc9,utils[_0x359c('0x71')][_0x359c('0x1ff')],0x17,_0x359c('0x200')))['catch'](loggerCatch(_0x359c('0x201')));}else{_0x7adae8[_0x359c('0x123')](createObjHistory(_0x23b64d,_0x455bc9,utils[_0x359c('0x71')][_0x359c('0x202')],0x16,_0x359c('0x203')),_0x359c('0x204'),_0x359c('0x205'));}}}}else{_0x23b64d['outboundBlacklistCallsDay']+=0x1;_0x7adae8['saveInDb'](createObjHistory(_0x23b64d,_0x455bc9,utils[_0x359c('0x71')][_0x359c('0x206')],0xd,_0x359c('0x207')),'[Originate][historyBlacklist]','[Originate][MoveBlacklist]');throw _0x359c('0x208');}};};Dialer[_0x359c('0x1f')]['handleIvr']=function(_0x207550){var _0x277342=this;var _0x14eeee=_0x207550[_0x359c('0x209')]-_0x207550['originated'];emitCampaignSummary(_0x207550);if(_0x14eeee>0x0&&_0x207550[_0x359c('0x6e')]==0x0){if(_0x14eeee>this[_0x359c('0x28')]){_0x14eeee=this['maxNumberOriginate'];}_0x207550[_0x359c('0x6e')]=0x1;hopperUtils[_0x359c('0x20a')](_0x207550,_0x14eeee)[_0x359c('0xa0')](function(_0x5a7126){_0x207550['temp']=0x0;if(_0x5a7126){if(!utils[_0x359c('0x20b')](_0x5a7126)){_0x207550[_0x359c('0x70')]=utils[_0x359c('0x71')][_0x359c('0x20c')];logger[_0x359c('0x4e')](_0x359c('0x20d')+_0x207550[_0x359c('0x66')]);}else{_0x207550[_0x359c('0x82')]+=_0x5a7126[_0x359c('0x9d')];_0x207550[_0x359c('0x70')]=utils[_0x359c('0x71')]['RUNNING'];for(var _0x4dc3c6=0x0;_0x4dc3c6<_0x5a7126[_0x359c('0x9d')];_0x4dc3c6+=0x1){_0x207550[_0x359c('0x20e')]+=0x1;if(_[_0x359c('0x101')](_0x5a7126[_0x4dc3c6])||_['isNil'](_0x5a7126[_0x4dc3c6][_0x359c('0x185')])||_['isNil'](_0x5a7126[_0x4dc3c6]['phone'])){_0x277342[_0x359c('0x20f')]('[actionOriginate]\x20',_0x207550,_0x5a7126[_0x4dc3c6]);}else{hopperUtils[_0x359c('0x210')](_['pick'](_0x5a7126[_0x4dc3c6],[_0x359c('0xe7'),_0x359c('0x18f')]))[_0x359c('0xa0')](_0x277342[_0x359c('0x1f2')](_0x207550,_0x5a7126[_0x4dc3c6]))[_0x359c('0xa3')](_0x277342[_0x359c('0x164')](_0x359c('0x211'),_0x207550));}}}}})['catch'](loggerGetContactDialer(_0x359c('0x212'),_0x207550,_0x14eeee));}};Dialer[_0x359c('0x1f')][_0x359c('0xbc')]=function(_0x3ce7d6,_0x3f2a37){var _0x1a2623=this;var _0x5d6f6b=[];if(_0x3f2a37<0x1||_0x3ce7d6[_0x359c('0xbb')]===_0x359c('0xa')){_0x3f2a37=0x1;}var _0x3b0162=Math[_0x359c('0x1ce')](_0x3ce7d6[_0x359c('0x14a')]*_0x3f2a37)-_0x3ce7d6['originated'];if(_0x3ce7d6['dialLimitQueue']>0x0){var _0x259d88=_0x3ce7d6['dialLimitQueue']-_0x3ce7d6[_0x359c('0x82')]-_0x3ce7d6[_0x359c('0x14b')]-_0x3ce7d6[_0x359c('0x14c')];if(_0x3b0162>_0x259d88){_0x3b0162=_0x259d88;}}if(_0x3b0162>0x0&&_0x3ce7d6[_0x359c('0x6e')]==0x0){if(_0x3ce7d6[_0x359c('0xbb')]===_0x359c('0xa')){_0x3b0162=0x1;}if(_0x3b0162>this[_0x359c('0x28')]){_0x3b0162=this['maxNumberOriginate'];}for(var _0x51c0b1 in this[_0x359c('0x26')]){if(typeof this[_0x359c('0x26')][_0x51c0b1]!==_0x359c('0xb1')){if(this[_0x359c('0x26')][_0x51c0b1][_0x359c('0xd9')]===_0x359c('0x213')&&this[_0x359c('0x26')][_0x51c0b1][_0x359c('0x8c')]===_0x359c('0x8d')){_0x5d6f6b[_0x359c('0xa4')](this[_0x359c('0x26')][_0x51c0b1]['id']);}}}_0x3ce7d6['temp']=0x1;hopperUtils['getContactDialer'](_0x3ce7d6,_0x5d6f6b,_0x3b0162)[_0x359c('0xa0')](function(_0x83a3c5){_0x3ce7d6[_0x359c('0x6e')]=0x0;if(_0x83a3c5){if(!utils[_0x359c('0x20b')](_0x83a3c5)){hopperUtils['countReScheduled'](_0x3ce7d6)[_0x359c('0xa0')](sendMessageReschedule(_0x3ce7d6))[_0x359c('0xa3')](loggerCatch(_0x359c('0x214')));}else{_0x3ce7d6[_0x359c('0x82')]+=_0x83a3c5[_0x359c('0x9d')];_0x3ce7d6[_0x359c('0x70')]=_0x3ce7d6['dialMethod']===_0x359c('0xa')?utils[_0x359c('0x71')][_0x359c('0x14d')]:utils[_0x359c('0x71')][_0x359c('0x215')];for(var _0x1c390f=0x0;_0x1c390f<_0x83a3c5['length'];_0x1c390f+=0x1){if(_[_0x359c('0x101')](_0x83a3c5[_0x1c390f])||_['isNil'](_0x83a3c5[_0x1c390f]['Contact'])||_['isNil'](_0x83a3c5[_0x1c390f]['phone'])){_0x1a2623[_0x359c('0x20f')]('[actionOriginate]\x20',_0x3ce7d6,_0x83a3c5[_0x1c390f]);}else{hopperUtils[_0x359c('0x216')](_[_0x359c('0x7a')](_0x83a3c5[_0x1c390f],[_0x359c('0xe6'),_0x359c('0x18f')]))[_0x359c('0xa0')](_0x1a2623['checkContactBlack'](_0x3ce7d6,_0x83a3c5[_0x1c390f]))[_0x359c('0xa3')](_0x1a2623[_0x359c('0x164')]('[actionOriginate]\x20',_0x3ce7d6));}}}}})[_0x359c('0xa3')](loggerGetContactDialer('[getContactDialer2]',_0x3ce7d6,_0x3b0162));}};Dialer[_0x359c('0x1f')][_0x359c('0x68')]=function(_0x42564a){if(_0x42564a['dialLimitQueue']>0x0){var _0x32cefa=_0x42564a['dialLimitQueue']-_0x42564a['originated']-_0x42564a['talking'];if(_0x32cefa>0x0&&_0x42564a[_0x359c('0x6e')]==0x0){this[_0x359c('0x217')](_0x42564a);}else{loggerPredictiveCalls[_0x359c('0x4e')](_0x359c('0x218'));}}else{this[_0x359c('0x217')](_0x42564a);}};Dialer[_0x359c('0x1f')][_0x359c('0x217')]=function(_0x2d3174){var _0x352c30=this;var _0x494787=[];_0x2d3174['originated']+=0x1;for(var _0x465b9d in this['agents']){if(typeof this[_0x359c('0x26')][_0x465b9d]!==_0x359c('0xb1')){if(this['agents'][_0x465b9d][_0x359c('0xd9')]===_0x359c('0x213')&&this[_0x359c('0x26')][_0x465b9d][_0x359c('0x8c')]===_0x359c('0x8d')){_0x494787[_0x359c('0xa4')](this['agents'][_0x465b9d]['id']);}}}_0x2d3174[_0x359c('0x6e')]=0x1;return this[_0x359c('0x219')](_0x2d3174['id'],_0x494787,0x1,_0x2d3174['dialOrderByScheduledAt'],_0x2d3174)[_0x359c('0xa0')](function(_0x12f29a){_0x2d3174[_0x359c('0x6e')]=0x1;if(_0x12f29a){if(!utils[_0x359c('0x20b')](_0x12f29a)){utils[_0x359c('0x6d')](_0x2d3174,0x1,0x0);return hopperUtils[_0x359c('0x21a')](_0x2d3174)['then'](sendMessageReschedule(_0x2d3174))[_0x359c('0xa3')](loggerCatch(_0x359c('0x214')));}else{_0x2d3174[_0x359c('0x70')]=utils[_0x359c('0x71')][_0x359c('0x215')];if(_[_0x359c('0x101')](_0x12f29a[0x0])||_[_0x359c('0x101')](_0x12f29a[0x0][_0x359c('0x185')])||_[_0x359c('0x101')](_0x12f29a[0x0]['phone'])){_0x352c30[_0x359c('0x20f')](_0x359c('0x21b'),_0x2d3174,_0x12f29a[0x0]);}else{return hopperUtils[_0x359c('0x216')](_[_0x359c('0x7a')](_0x12f29a[0x0],[_0x359c('0xe6'),'phone']))[_0x359c('0xa0')](_0x352c30[_0x359c('0x1f2')](_0x2d3174,_0x12f29a[0x0]))[_0x359c('0xa3')](_0x352c30[_0x359c('0x164')](_0x359c('0x21c'),_0x2d3174));}}}})[_0x359c('0xa3')](loggerGetContactDialer(_0x359c('0x21d'),_0x2d3174,0x1));};Dialer[_0x359c('0x1f')][_0x359c('0x1ed')]=function(_0x5a4d7c,_0x3f9705,_0x265436,_0x3ba32d,_0x17f110,_0x396161){loggerPredictive[_0x359c('0x4e')](_0x359c('0x21e'));loggerPredictive['info'](_0x359c('0x21f'),_0x5a4d7c);loggerPredictive[_0x359c('0x4e')](_0x359c('0x220'),_0x3f9705);loggerPredictive[_0x359c('0x4e')](_0x359c('0x221'),_0x265436);loggerPredictive[_0x359c('0x4e')]('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',_0x3ba32d);loggerPredictive[_0x359c('0x4e')](_0x359c('0x222'),_0x17f110);loggerPredictive['info']('---------------------------');return new Promise(function(_0x9f306b,_0x17a54b){if(_0x5a4d7c<=0x0||isNaN(_0x5a4d7c)){return _0x17a54b(msgResponse('[abandonmentRate]',_0x359c('0x88'),_0x359c('0x223')+_0x5a4d7c));}if(_0x265436<=0x0||isNaN(_0x265436)){return _0x17a54b(msgResponse(_0x359c('0x224'),_0x359c('0x88'),_0x359c('0x225')+_0x265436));}if(_0x3ba32d<=0x0||isNaN(_0x3ba32d)){return _0x17a54b(msgResponse(_0x359c('0x224'),'Error','p\x20=\x20'+_0x3ba32d));}if(_0x3f9705<=0x0||isNaN(_0x3f9705)){return _0x17a54b(msgResponse(_0x359c('0x224'),_0x359c('0x88'),_0x359c('0x226')+_0x3f9705));}if(_0x17f110<=0x0||isNaN(_0x17f110)){return _0x17a54b(msgResponse(_0x359c('0x224'),_0x359c('0x88'),'Amax\x20=\x20'+_0x17f110));}_0x396161=_0x396161||0x0;var _0x46430b=0x1/_0x265436;var _0x554695=0x0;var _0x43625a=0x0;var _0x457c4f=0x0;var _0x2ec502=0x0;for(var _0x497e15=0x0;_0x457c4f<_0x17f110;_0x497e15+=0x1){_0x43625a=_0x497e15/_0x3f9705;_0x554695=(_0x3ba32d*_0x43625a+_0x396161)/_0x46430b;_0x457c4f=utils['erlangb'](_0x554695,_0x5a4d7c);_0x2ec502=_0x554695/_0x5a4d7c*(0x1-utils[_0x359c('0x227')](_0x554695,_0x5a4d7c));}return _0x9f306b({'erlangCalls':_0x497e15,'erlangCallToSecond':_0x3f9705/_0x497e15,'erlangAbandonmentRate':_0x457c4f,'erlangBusyFactor':_0x2ec502});});};Dialer[_0x359c('0x1f')][_0x359c('0x1e7')]=function(_0x3d3cab,_0x336cfa,_0x393fb6,_0x5e9f64,_0x46b4af,_0x1d1dd2){loggerPredictive[_0x359c('0x4e')](_0x359c('0x228'));loggerPredictive[_0x359c('0x4e')]('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',_0x3d3cab);loggerPredictive[_0x359c('0x4e')](_0x359c('0x220'),_0x336cfa);loggerPredictive[_0x359c('0x4e')](_0x359c('0x221'),_0x393fb6);loggerPredictive[_0x359c('0x4e')](_0x359c('0x229'),_0x5e9f64);loggerPredictive['info'](_0x359c('0x22a'),_0x46b4af);loggerPredictive[_0x359c('0x4e')]('---------------------------');return new Promise(function(_0x4fe9b2,_0x23a237){if(_0x3d3cab<=0x0||isNaN(_0x3d3cab)){return _0x23a237(msgResponse(_0x359c('0x22b'),_0x359c('0x88'),_0x359c('0x223')+_0x3d3cab));}if(_0x393fb6<=0x0||isNaN(_0x393fb6)){return _0x23a237(msgResponse(_0x359c('0x22b'),_0x359c('0x88'),_0x359c('0x225')+_0x393fb6));}if(_0x5e9f64<=0x0||isNaN(_0x5e9f64)){return _0x23a237(msgResponse('[busyFactor]',_0x359c('0x88'),_0x359c('0x22c')+_0x5e9f64));}if(_0x336cfa<=0x0||isNaN(_0x336cfa)){return _0x23a237(msgResponse('[busyFactor]',_0x359c('0x88'),_0x359c('0x226')+_0x336cfa));}if(_0x46b4af<=0x0||isNaN(_0x46b4af)){return _0x23a237(msgResponse('[busyFactor]',_0x359c('0x88'),'Umin\x20=\x20'+_0x46b4af));}_0x1d1dd2=_0x1d1dd2||0x0;var _0x265f3a=0x1/_0x393fb6;var _0x56b4de=0x0;var _0xce640=0x0;var _0x3d104a=0x0;var _0x97ef51=0x0;for(var _0x5f5dfa=0x0;_0x97ef51<_0x46b4af;_0x5f5dfa+=0x1){_0xce640=_0x5f5dfa/_0x336cfa;_0x56b4de=(_0x5e9f64*_0xce640+_0x1d1dd2)/_0x265f3a;_0x3d104a=utils[_0x359c('0x227')](_0x56b4de,_0x3d3cab);_0x97ef51=_0x56b4de/_0x3d3cab*(0x1-utils['erlangb'](_0x56b4de,_0x3d3cab));}return _0x4fe9b2({'erlangCalls':_0x5f5dfa,'erlangCallToSecond':_0x336cfa/_0x5f5dfa,'erlangAbandonmentRate':_0x3d104a,'erlangBusyFactor':_0x97ef51});});};module[_0x359c('0x22d')]=Dialer;
\ No newline at end of file
+var _0x45b9=['\x20Intervals\x20is\x20empty\x20','timezones','isArray','push','Action','command','iftime\x20%s,%s','interval','then','content','true','catch','indexOf','all','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','resetActiveCalls','syncCampaigns','undefined','resolve','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','launchHandleIvr','[syncCampaigns]','progressive','handlePower','booked','method\x20not\x20recognized','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','AMI\x20IfTime','uniqueid','uniqueId','ivr','updateOriginated','queue','answertime','syncAgentComplete','outboundAnswerCallsDay','reason','agent','agiafterat','dialAgiAfterHangupAgent','createHistory','[syncAgentComplete]','YYYY-MM-DD\x20HH:mm:ss','droptime','responsetime','dialQueueTimeout','predictiveIntervalErlangCallsDroppedCalls','state','Drop','dropreason','TIMEOUT','dialQueueProject2','countdropretry','countglobal','verifyAdditionalPhones','voiceQueue','additional','queueCallerAbandonCreateState','add','dialDropRetryFrequency','ContactId','CampaignId','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','countabandonedretry','dialAbandonedRetryFrequency','callAdditionalPhoneAfterMin','dialAbandonedMaxRetry','rescheduleContact','minutes','VoiceQueueId','[rescheduleContact][Abandoned]','swapAdditionalPhones','channel','actionid','strategy','rrmemory','isNil','locked','stateinterface','merge','paused','roundrobin','run','[Catch][Preview][syncQueueStatusComplete]','ListId','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','idHopper','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','getQueue','response','Success','callProgressDetecting','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','outboundAnswerAgiCallsDay','AMD','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','Machine','membername','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','dialMachineRetryFrequency','[rescheduleContact][Machine]','HangupInAMD','emit','saveInDb','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','reason\x2019\x20machine....','syncHangup','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','moveContactManagedDialer','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','cause-txt','Normal\x20Clearing','[syncAgentComplete][createHistory]','outboundUnknownCallsDay','Unknow','queuesSummary','running','INACTIVE','isPreviewCampaign','getQueueCampaignStatusMessage','statusMessage','available','inUse','pTalking','ACTIVE','checkDialMethod','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','syncQueueSummaryComplete','throttle','filter','dialPreviewRecallmeReminder','online','length','handlePreviewRecallNotifications','map','Agent','user:%s','checkPreviewRecallReminder','loopClearZombieChannels','clearZombieChannels','[uniqueid]','[actions]','enqueue','No\x20such\x20channel','[Dialer][checkChannel]','getVoiceQueueRtPauses','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','UserId','[emptyContact][createHistory]','[emptyContact]','[syncQueueCallerAbandon]\x20[Drop]','user:dialPreviewRecallReminder','handleIvr','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','isOutboundQueue','\x22%s,%s%s,,,%s\x22','dialQueueOptions','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','setXMDContactVariables','Contact','assign','Trunk','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','variables','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialDropMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','busy','dialBusyRetryFrequency','[syncAgentComplete][createHistory][5]','dialBusyMaxRetry','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','outboundDropCallsDayTimeout','round','predictiveIntervalMinThreshold','talking','predictiveIntervalHitRate','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','avgHandleTime','getDataPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','startMethodPredictive','Predictive\x20for\x20every\x20interval','predictiveIntervalAvailable','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','loggedIn','outboundQueuePauses','[CatchErlangB]','predictiveIntervalPauses','floor','one\x20call\x20every:','milliseconds','[handlePredictive]','fail\x20to\x20scheduled\x20calls','recallme','[booked][checkContactBlack]','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','Queue:\x20','scheduledat','dialRecallMeTimeout','voicePause','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RecallInQueue','RECALL_TIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','getContactDialerIvr','checkContactEmpty','[actionOriginate]\x20','[actionOriginateIvr]\x20','[getContactCampaign2]','dialMethod','dialLimitQueue','not_inuse','getContactDialer','countReScheduled','[countReScheduled]\x20','RUNNING','checkIsBlackList','checkContactBlack','[getContactDialer2]','tryOriginatePredictive','dialOrderByScheduledAt','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','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','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','erlangb','busyFactor','----\x20Agent\x20Busy\x20Factor\x20----','Interval:\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','m\x20=\x20','[busyFactor]','Umin\x20=\x20','exports','uuid','moment','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','../rpc/setting','../rpc/interval','./models/action','./models/history','./models/final','./models/agentComplete','./models/queueCallerAbandon','env','XCALLY_IP_AGI','prototype','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','optionPredictive','startPredictive','startProgressive','queueBooked','queueBookedRR','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','custom:queuesummary','newexten','syncNewExten','varset','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','getSettings','previewRecallmeReminderInterval','isUndefined','type','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','format','name','voice_queue:save','isEmpty','info','-----\x20Stats\x20Predictive\x20---','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','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','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','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\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','checkContactLowerLimitOriginate','temp','inspect','contactsRescheduled','message','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contacts','NO_AVAILABLE_CONTACTS','statedesc','endtime','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','pick','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Interval','Intervals','isIVRCampaignActive','\x20NOT\x20Active','isIVRCampaign','campaign:ivr:%s','campaign:save','sendMessageOneNotActive','originated','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','DISACTIVED','is\x20disactive','[ifTime][Action]','Error','active','status','reachable','unmonitored','isTrunkReachable','TrunkBackup','TRUNK_NOT_REACHABLE','checkIfTime','ifTimeIvr','ifTime','Failure','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x45b9,0x1a2));var _0x945b=function(_0x3c9920,_0x6abc8c){_0x3c9920=_0x3c9920-0x0;var _0x487e20=_0x45b9[_0x3c9920];return _0x487e20;};'use strict';var util=require('util');var _=require('lodash');var uuid=require(_0x945b('0x0'));var moment=require(_0x945b('0x1'));var rr=require('rr');var Redis=require('ioredis');var utils=require('./utils');var hopperUtils=require('./utils/hopper');var ut=require(_0x945b('0x2'));var config=require(_0x945b('0x3'));var logger=require(_0x945b('0x4'))(_0x945b('0x5'));var loggerBooked=require(_0x945b('0x4'))('booked');var loggerPredictive=require(_0x945b('0x4'))(_0x945b('0x6'));var loggerPredictiveCalls=require(_0x945b('0x4'))(_0x945b('0x7'));var loggerSyncQueueSummary=require(_0x945b('0x4'))(_0x945b('0x8'));var ami=require(_0x945b('0x9'));config[_0x945b('0xa')]=_[_0x945b('0xb')](config[_0x945b('0xa')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x945b('0xa')]));var cmHopper=require('../rpc/cmHopper');var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require(_0x945b('0xc'));var Interval=require(_0x945b('0xd'));var Action=require(_0x945b('0xe'));var History=require(_0x945b('0xf'));var Final=require(_0x945b('0x10'));var AgentComplete=require(_0x945b('0x11'));var QueueCallerAbandon=require(_0x945b('0x12'));var Hangup=require('./models/hangup');var ipAgi=process[_0x945b('0x13')][_0x945b('0x14')]||'127.0.0.1';var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x945b('0x15')]['enqueue']=function(_0x66fbc2){this[_0x945b('0x16')]=this[_0x945b('0x16')]?this[_0x945b('0x16')][_0x945b('0x17')](_0x66fbc2):_0x66fbc2();};function Dialer(_0x342737,_0x1d9ff9){this[_0x945b('0x18')]=new Sequence();this[_0x945b('0x19')]=_0x1d9ff9;this['voiceQueues']=_0x342737[_0x945b('0x1a')];this[_0x945b('0x1b')]=_0x342737[_0x945b('0x1b')];this[_0x945b('0x1c')]=_0x342737[_0x945b('0x1c')];this[_0x945b('0x1d')]=_0x342737[_0x945b('0x1d')];this[_0x945b('0x1e')]=config[_0x945b('0x1e')]||0x2;this[_0x945b('0x1f')]={};this[_0x945b('0x20')]={};this[_0x945b('0x21')]={};this['uniqueId']={};this[_0x945b('0x22')]={};this[_0x945b('0x23')]={};this[_0x945b('0x24')]={};this['ivrOriginated']={};this[_0x945b('0x25')]={};this[_0x945b('0x26')]={};this['queuesSummary']={};ami['on']('agentconnect',this[_0x945b('0x27')][_0x945b('0x28')](this));ami['on'](_0x945b('0x29'),this[_0x945b('0x2a')][_0x945b('0x28')](this));ami['on'](_0x945b('0x2b'),this[_0x945b('0x2c')][_0x945b('0x28')](this));ami['on'](_0x945b('0x2d'),this['syncAgentComplete']['bind'](this));ami['on'](_0x945b('0x2e'),this[_0x945b('0x8')][_0x945b('0x28')](this));ami['on']('custom:queuesummarycomplete',this['syncQueueSummaryComplete'][_0x945b('0x28')](this));ami['on']('hangup',this['syncHangup']['bind'](this));ami['on'](_0x945b('0x2f'),this[_0x945b('0x30')][_0x945b('0x28')](this));ami['on'](_0x945b('0x31'),this['syncVarSet'][_0x945b('0x28')](this));ami['on'](_0x945b('0x32'),this[_0x945b('0x33')]['bind'](this));ami['on'](_0x945b('0x34'),this[_0x945b('0x35')][_0x945b('0x28')](this));this[_0x945b('0x36')]();this['loopClearZombieChannels']();RpcSetting[_0x945b('0x37')]()['then'](function(_0x2a971c){previewRecallmeReminderInterval=_0x2a971c[_0x945b('0x38')];});}function isNotNull(_0xa11e86){return _0xa11e86!==null&&!_[_0x945b('0x39')](_0xa11e86);}function msgResponse(_0x365f7b,_0x182eab,_0x238145){return{'action':_0x365f7b,'response':_0x182eab,'message':_0x238145,'stack':_0x238145};}function emit(_0x4a2c44,_0x1640cf,_0x3fecca){io['to'](_0x4a2c44)['emit'](_0x1640cf,_0x3fecca);}function emitOutboundVoiceQueueSummary(_0x331dab){if(_0x331dab[_0x945b('0x3a')]==='outbound'){logger[_0x945b('0x3b')](_0x945b('0x3c'),util['inspect'](_0x331dab,{'showHidden':![],'depth':null}));emit(util[_0x945b('0x3d')]('voice:queue:%s',_0x331dab[_0x945b('0x3e')]),_0x945b('0x3f'),_0x331dab);}}function checkGetDataPredictive(_0x111d15){if(isNotNull(_0x111d15)&&!_[_0x945b('0x40')](_0x111d15)){loggerPredictive[_0x945b('0x41')](_0x945b('0x42'));loggerPredictive[_0x945b('0x41')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x111d15[_0x945b('0x43')]);loggerPredictive['info'](_0x945b('0x44'),_0x111d15[_0x945b('0x45')]);loggerPredictive[_0x945b('0x41')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x111d15[_0x945b('0x46')]);loggerPredictive[_0x945b('0x41')](_0x945b('0x47'),_0x111d15[_0x945b('0x48')]);loggerPredictive[_0x945b('0x41')](_0x945b('0x49'),_0x111d15[_0x945b('0x4a')]);loggerPredictive['info']('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x111d15[_0x945b('0x4b')]);loggerPredictive[_0x945b('0x41')](_0x945b('0x4c'));if(_0x111d15[_0x945b('0x43')]>0x0){if(!_[_0x945b('0x39')](_0x111d15[_0x945b('0x4b')])&&_0x111d15[_0x945b('0x4b')]>0x0){return!![];}loggerPredictive['info'](_0x945b('0x4d'));if(!_['isUndefined'](_0x111d15[_0x945b('0x4a')])&&_0x111d15[_0x945b('0x4a')]>0x0){return!![];}loggerPredictive['info'](_0x945b('0x4e'));}else{loggerPredictive[_0x945b('0x41')](_0x945b('0x4f'));}}else{loggerPredictive[_0x945b('0x41')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x374e43){return function(_0x52250a){loggerPredictive[_0x945b('0x41')](_0x945b('0x50'));loggerPredictive['info'](_0x945b('0x51'),_0x52250a[_0x945b('0x52')]);loggerPredictive[_0x945b('0x41')](_0x945b('0x53'),_0x52250a['erlangCallToSecond']);loggerPredictive['info'](_0x945b('0x54'),_0x52250a[_0x945b('0x55')]);loggerPredictive[_0x945b('0x41')](_0x945b('0x56'),_0x52250a[_0x945b('0x57')]);loggerPredictive[_0x945b('0x41')](_0x945b('0x54'),_0x52250a[_0x945b('0x55')]);loggerPredictive['info'](_0x945b('0x4c'));_['merge'](_0x374e43,_0x52250a);};}function ifInterval(_0x5b7d75,_0x1e05f0){if(_[_0x945b('0x39')](_0x1e05f0)){return![];}return utils[_0x945b('0x58')](undefined,_0x1e05f0)<_0x5b7d75*0x3c;}function clearPredictiveAttributes(_0xf855fa){if(_0xf855fa[_0x945b('0x24')]){_0xf855fa[_0x945b('0x24')]=undefined;loggerPredictive[_0x945b('0x3b')](_0xf855fa[_0x945b('0x3e')],_0x945b('0x59'));}if(_0xf855fa[_0x945b('0x23')]){_0xf855fa['startPredictive']=undefined;loggerPredictive[_0x945b('0x3b')](_0xf855fa[_0x945b('0x3e')],'startPredictive\x20value\x20cleared');}if(_0xf855fa['handlePredictive']){clearInterval(_0xf855fa[_0x945b('0x5a')]);_0xf855fa[_0x945b('0x5a')]=undefined;loggerPredictive['debug'](_0xf855fa[_0x945b('0x3e')],_0x945b('0x5b'));}}function loggerCatchPredictive(_0x4c63b0,_0x3ef4ca){return function(_0x20711f){loggerPredictive['error'](_0x3ef4ca[_0x945b('0x3e')],_0x4c63b0);loggerPredictive[_0x945b('0x5c')](_0x20711f['stack']);clearPredictiveAttributes(_0x3ef4ca);};}function loggerCatch(_0x907788){return function(_0x24f7fe){logger[_0x945b('0x5c')](_0x907788,util['inspect'](_0x24f7fe,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x17e1ef,_0x30d664,_0x50264c){return function(_0x1516cf){utils[_0x945b('0x5d')](_0x30d664,_0x50264c,0x0);_0x30d664[_0x945b('0x5e')]=0x0;logger[_0x945b('0x5c')](_0x17e1ef,util[_0x945b('0x5f')](_0x1516cf,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x3595d7){return function(_0x4d6806){if(isNotNull(_0x4d6806)&&isNotNull(_0x4d6806[0x0])){if(_0x4d6806[0x0][_0x945b('0x60')]>0x0){_0x3595d7[_0x945b('0x61')]=utils[_0x945b('0x62')][_0x945b('0x63')];logger[_0x945b('0x41')](_0x945b('0x64')+_0x3595d7[_0x945b('0x3e')],_0x4d6806[0x0][_0x945b('0x60')],_0x945b('0x65'));}else{_0x3595d7[_0x945b('0x61')]=utils[_0x945b('0x62')][_0x945b('0x66')];logger[_0x945b('0x41')]('[getContactDialer2][Empty]'+_0x3595d7['name']);}}};}function createObjHistory(_0x51437e,_0x2de240,_0x5d7c9b,_0x560fe6,_0x2dcb6e){_0x51437e[_0x945b('0x61')]=_0x5d7c9b;var _0x3e941a=new Action(_0x51437e,_0x2de240);var _0x565f83=new History(_0x3e941a);_0x565f83['state']=_0x560fe6;_0x565f83[_0x945b('0x67')]=_0x2dcb6e;_0x565f83[_0x945b('0x68')]=_0x3e941a[_0x945b('0x69')];return _0x565f83;}function unlockQueueStatus(_0x2fd3df,_0x4cbaa8){setTimeout(function(){if(_[_0x945b('0x39')](_0x2fd3df[_0x945b('0x6a')])){loggerBooked[_0x945b('0x5c')](_0x945b('0x6b'),_0x4cbaa8);}_0x2fd3df[_0x945b('0x6a')]=!![];loggerBooked[_0x945b('0x41')](_0x945b('0x6c'),_0x4cbaa8,JSON[_0x945b('0x6d')](_[_0x945b('0x6e')](_0x2fd3df,[_0x945b('0x3e'),'queueStatusComplete'])));},0x1f3);}function checkInterval(_0xc67dc){return function(){if(!isNotNull(_0xc67dc['Interval'])){_0xc67dc['message']=utils[_0x945b('0x62')][_0x945b('0x6f')];throw _0xc67dc[_0x945b('0x3e')]+_0x945b('0x70');}if(!isNotNull(_0xc67dc[_0x945b('0x71')]['Intervals'])){_0xc67dc[_0x945b('0x61')]=utils['CAMPAIGN_STATUS']['NULL_INTERVAL'];throw _0xc67dc[_0x945b('0x3e')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x945b('0x40')](_0xc67dc[_0x945b('0x71')][_0x945b('0x72')]))){_0xc67dc[_0x945b('0x61')]=utils['CAMPAIGN_STATUS'][_0x945b('0x6f')];throw _0xc67dc[_0x945b('0x3e')]+_0x945b('0x70');}};}function checkIsIVRCampaignActive(_0x34709a){return function(){if(!utils[_0x945b('0x73')](_0x34709a)){_0x34709a[_0x945b('0x61')]=utils[_0x945b('0x62')]['INACTIVE'];throw _0x34709a['name']+_0x945b('0x74');}};}function emitCampaignSummary(_0x2df401){if(utils[_0x945b('0x75')](_0x2df401)){emit(util['format'](_0x945b('0x76'),_0x2df401['name']),_0x945b('0x77'),_0x2df401);}}function loggerCatchQueueSummary(_0x54cdb7,_0x19c07b){return function(_0x3cb4c4){clearPredictiveAttributes(_0x19c07b);emitCampaignSummary(_0x19c07b);loggerSyncQueueSummary['debug'](_0x54cdb7,util[_0x945b('0x5f')](_0x3cb4c4,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x4aedda){if(_0x4aedda[_0x945b('0x78')]){if(_0x4aedda[_0x945b('0x79')]===0x0){_0x4aedda['sendMessageOneNotActive']=![];_0x4aedda[_0x945b('0x61')]=utils[_0x945b('0x62')]['INACTIVE'];loggerSyncQueueSummary[_0x945b('0x3b')](_0x945b('0x7a'),_0x4aedda['name'],_0x945b('0x7b'));}else{_0x4aedda[_0x945b('0x61')]=utils[_0x945b('0x62')][_0x945b('0x7c')];loggerSyncQueueSummary[_0x945b('0x3b')](_0x945b('0x7a'),_0x4aedda['name'],_0x945b('0x7d'));}emitCampaignSummary(_0x4aedda);}}function myreject(_0xeb92c5){return function(_0x3ad716){return _0xeb92c5(msgResponse(_0x945b('0x7e'),_0x945b('0x7f'),JSON[_0x945b('0x6d')](_0x3ad716)));};}Dialer[_0x945b('0x15')]['isTrunkReachable']=function(_0x4639d9){return!_[_0x945b('0x39')](_0x4639d9)&&_0x4639d9&&!_[_0x945b('0x39')](_0x4639d9['name'])&&!_['isUndefined'](_0x4639d9['active'])&&_0x4639d9[_0x945b('0x80')]&&(this['trunks'][util[_0x945b('0x3d')]('SIP/%s',_0x4639d9[_0x945b('0x3e')])][_0x945b('0x81')]===_0x945b('0x82')||this[_0x945b('0x1d')][util['format']('SIP/%s',_0x4639d9[_0x945b('0x3e')])]['status']===_0x945b('0x83'));};Dialer[_0x945b('0x15')]['checkIsTrunkReachable']=function(_0x4da953){var _0x355263=this;return function(){if(!_0x355263[_0x945b('0x84')](_0x4da953['Trunk'])){if(!_0x355263[_0x945b('0x84')](_0x4da953[_0x945b('0x85')])){_0x4da953[_0x945b('0x61')]=utils[_0x945b('0x62')][_0x945b('0x86')];throw _0x4da953[_0x945b('0x3e')]+'\x20trunk\x20is\x20not\x20reachable';}}};};Dialer[_0x945b('0x15')][_0x945b('0x87')]=function(_0x4cac6c,_0x1060e3,_0xc18f04,_0x2b4381){var _0x3dbec7=this;return function(){var _0x2e1a3b=!![];return _0x3dbec7[_0x945b('0x88')](_0x4cac6c,_0x1060e3,_0xc18f04,_0x2b4381,_0x2e1a3b);};};Dialer[_0x945b('0x15')]['checkIfTimeIntervals']=function(_0x5bbadd,_0x443cdd,_0x466836,_0x369ba3){var _0x59c0de=this;return function(){var _0x4b81c7=![];return _0x59c0de[_0x945b('0x88')](_0x5bbadd[_0x945b('0x72')],_0x443cdd,_0x466836,_0x369ba3,_0x4b81c7);};};Dialer[_0x945b('0x15')][_0x945b('0x88')]=function(_0x44c4ae,_0x96dfe9,_0x69333,_0x4e02d2,_0x3b509d){var _0x5cee80=[];return new Promise(function(_0xa631ad,_0x42bf0b){if(!isNotNull(_0x44c4ae)){_0x4e02d2[_0x945b('0x61')]=utils['CAMPAIGN_STATUS'][_0x945b('0x6f')];return _0x42bf0b(msgResponse(_0x945b('0x89'),_0x945b('0x8a'),_0x69333+_0x945b('0x8b')));}if(_['isEmpty'](_0x44c4ae)){_0x4e02d2[_0x945b('0x61')]=utils['CAMPAIGN_STATUS'][_0x945b('0x8c')];return _0x42bf0b(msgResponse(_0x945b('0x89'),_0x945b('0x8a'),_0x69333+_0x945b('0x8d')));}if(_0x96dfe9&&_[_0x945b('0x39')](config[_0x945b('0x8e')][_0x96dfe9])){_0x4e02d2[_0x945b('0x61')]=utils[_0x945b('0x62')]['UNKNOWN_TIMEZONE'];return _0x42bf0b(msgResponse(_0x945b('0x89'),_0x945b('0x8a'),_0x69333+'\x20Timezone\x20unknow\x20'+_0x96dfe9));}if(_[_0x945b('0x8f')](_0x44c4ae)){for(var _0xf2ea9=0x0;_0xf2ea9<_0x44c4ae['length'];_0xf2ea9+=0x1){_0x5cee80[_0x945b('0x90')](ami[_0x945b('0x91')]({'action':_0x945b('0x92'),'command':util[_0x945b('0x3d')](_0x945b('0x93'),_0x44c4ae[_0xf2ea9][_0x945b('0x94')],!_['isUndefined'](config[_0x945b('0x8e')][_0x96dfe9])?_0x96dfe9:'')})[_0x945b('0x95')](function(_0x2bee42){return _0x2bee42[_0x945b('0x96')]['indexOf'](_0x945b('0x97'))>=0x0;})[_0x945b('0x98')](myreject(_0x42bf0b)));}}else{_0x5cee80[_0x945b('0x90')](ami['Action']({'action':_0x945b('0x92'),'command':util[_0x945b('0x3d')](_0x945b('0x93'),_0x44c4ae,!_[_0x945b('0x39')](config['timezones'][_0x96dfe9])?_0x96dfe9:'')})['then'](function(_0x18fd03){return _0x18fd03[_0x945b('0x96')][_0x945b('0x99')](_0x945b('0x97'))>=0x0;})[_0x945b('0x98')](myreject(_0x42bf0b)));}Promise[_0x945b('0x9a')](_0x5cee80)[_0x945b('0x95')](function(_0x1072df){var _0x234c06=_['some'](_0x1072df);if(_0x234c06){return _0xa631ad(_0x234c06);}else{_0x4e02d2[_0x945b('0x61')]=_0x3b509d?utils[_0x945b('0x62')][_0x945b('0x9b')]:utils['CAMPAIGN_STATUS'][_0x945b('0x9c')];return _0x42bf0b(msgResponse(_0x945b('0x9d'),_0x945b('0x8a'),_0x945b('0x9e')+_0x3b509d+'\x20'+_0x69333+_0x945b('0x9f')+util[_0x945b('0x5f')](_0x44c4ae,{'showHidden':![],'depth':null})+_0x945b('0xa0')+_0x96dfe9));}})[_0x945b('0x98')](function(_0x1ae76e){return _0x42bf0b(msgResponse(_0x945b('0x89'),_0x945b('0x8a'),JSON[_0x945b('0x6d')](_0x1ae76e)));});});};Dialer[_0x945b('0x15')][_0x945b('0x36')]=function(){var _0x395521=this;return cmHopper[_0x945b('0xa1')]({'active':![]},{'where':{'active':!![]}})['then'](function(){setInterval(function(){_0x395521[_0x945b('0xa2')]();},0x3e8);});};Dialer['prototype'][_0x945b('0xa2')]=function(){var _0x20d954=this;var _0x2f4f16;for(var _0x369b26 in this[_0x945b('0x1b')]){if(typeof this[_0x945b('0x1b')][_0x369b26]!==_0x945b('0xa3')){_0x2f4f16=this['campaigns'][_0x369b26];if(utils[_0x945b('0x75')](_0x2f4f16)&&utils[_0x945b('0x73')](_0x2f4f16)){_0x2f4f16[_0x945b('0x78')]=!![];Promise[_0x945b('0xa4')]()[_0x945b('0x95')](checkIsIVRCampaignActive(_0x2f4f16))[_0x945b('0x95')](checkInterval(_0x2f4f16))[_0x945b('0x95')](_0x20d954[_0x945b('0xa5')](_0x2f4f16))[_0x945b('0x95')](_0x20d954[_0x945b('0x87')](_0x2f4f16[_0x945b('0xa6')],_0x2f4f16[_0x945b('0xa7')],_0x2f4f16[_0x945b('0x3e')],_0x2f4f16))[_0x945b('0x95')](_0x20d954['checkIfTimeIntervals'](_0x2f4f16[_0x945b('0x71')],_0x2f4f16['dialTimezone'],_0x2f4f16[_0x945b('0x3e')],_0x2f4f16))[_0x945b('0x95')](_0x20d954[_0x945b('0xa8')](_0x2f4f16))['catch'](loggerCatchQueueSummary(_0x945b('0xa9'),_0x2f4f16));}else{notSendMessagesCampaign(_0x2f4f16);}}}};Dialer[_0x945b('0x15')]['checkDialMethod']=function(_0x39984c){if(_0x39984c['dialMethod']!=='predictive'){clearPredictiveAttributes(_0x39984c);}switch(_0x39984c['dialMethod']){case _0x945b('0xaa'):this[_0x945b('0xab')](_0x39984c,0x1);break;case'power':this[_0x945b('0xab')](_0x39984c,_0x39984c['dialPowerLevel']);break;case _0x945b('0x6'):this[_0x945b('0x6')](_0x39984c);break;case _0x945b('0xac'):this['handlePower'](_0x39984c,0x1);break;default:logger[_0x945b('0x5c')]('Queue',_0x39984c[_0x945b('0x3e')],_0x945b('0xad'));}};Dialer[_0x945b('0x15')]['ifTime']=function(_0x1bbf23,_0x518c7b){var _0x3e134e=_0x1bbf23[_0x945b('0xa7')];var _0xbdd102=_0x518c7b?_0x1bbf23[_0x945b('0xa6')]:_0x1bbf23[_0x945b('0x71')]['Intervals'];logger[_0x945b('0xae')](_0x945b('0xaf'),_0xbdd102,_0x3e134e,_0x1bbf23[_0x945b('0x3e')],util[_0x945b('0x3d')](_0x945b('0xb0'),_0x1bbf23['name'],_0x1bbf23['id']));var _0x2f8475=null;return Interval[_0x945b('0xb1')](_0xbdd102,_0x3e134e)[_0x945b('0x95')](function(_0x5764de){if(_0x5764de===!![]){return _0x5764de;}else{_0x1bbf23[_0x945b('0x61')]=_0x518c7b?utils[_0x945b('0x62')][_0x945b('0x9b')]:utils[_0x945b('0x62')][_0x945b('0x9c')];_0x2f8475=msgResponse(_0x945b('0x9d'),_0x945b('0x8a'),_0x945b('0x9e')+_0x518c7b+'\x20'+_0x1bbf23[_0x945b('0x3e')]+_0x945b('0x9f')+util['inspect'](_0xbdd102,{'showHidden':![],'depth':null})+_0x945b('0xa0')+_0x3e134e);}if(_0x2f8475!==null){logger['silly'](_0x945b('0xb2'),_0x2f8475);_0x2f8475[_0x945b('0xb3')]=_0x518c7b;throw _0x2f8475;}})['catch'](function(_0x41d85a){logger[_0x945b('0x5c')](_0x945b('0xb4'),_0x41d85a);throw msgResponse(_0x945b('0x7e'),_0x945b('0x7f'),util['inspect'](_0x41d85a,{'showHidden':![],'depth':null}));});};Dialer['prototype'][_0x945b('0x27')]=function(_0x29d673){if(this[_0x945b('0x1a')][_0x29d673['queue']]){if(this['uniqueId'][_0x29d673[_0x945b('0xb5')]]&&this[_0x945b('0xb6')][_0x29d673[_0x945b('0xb5')]][_0x945b('0x3a')]!==_0x945b('0xb7')){this[_0x945b('0xb8')](this['voiceQueues'][_0x29d673[_0x945b('0xb9')]]);this['uniqueId'][_0x29d673[_0x945b('0xb5')]][_0x945b('0xba')]=moment()[_0x945b('0x3d')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0x945b('0x15')][_0x945b('0xbb')]=function(_0x18579e){var _0x5a1933=this['uniqueId'][_0x18579e['uniqueid']];if(this[_0x945b('0x1a')][_0x18579e[_0x945b('0xb9')]]){if(_0x5a1933&&_0x5a1933[_0x945b('0x3a')]!==_0x945b('0xb7')){delete this['uniqueId'][_0x18579e[_0x945b('0xb5')]];this[_0x945b('0x1a')][_0x18579e[_0x945b('0xb9')]][_0x945b('0xbc')]+=0x1;var _0x2fb0b4=new AgentComplete(_0x5a1933,_0x18579e);if(_0x18579e[_0x945b('0xbd')]===_0x945b('0xbe')){_0x2fb0b4[_0x945b('0xbf')]=this[_0x945b('0x1a')][_0x18579e[_0x945b('0xb9')]]['dialQueueProject2']&&this[_0x945b('0x1a')][_0x18579e['queue']][_0x945b('0xc0')]?moment()[_0x945b('0x3d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}hopperUtils[_0x945b('0xc1')](_0x2fb0b4)[_0x945b('0x98')](loggerCatch('[syncAgentComplete][createHistory]'));hopperUtils['moveContactManagedDialer'](_0x2fb0b4)['catch'](loggerCatch(_0x945b('0xc2')));}}};Dialer[_0x945b('0x15')][_0x945b('0x2a')]=function(_0x40dec2){var _0x1e51f5=this['uniqueId'][_0x40dec2[_0x945b('0xb5')]];var _0x1e8351=this;var _0xf81776=![];var _0x5188fe;var _0x120361;if(this['voiceQueues'][_0x40dec2[_0x945b('0xb9')]]){if(_0x1e51f5&&_0x1e51f5[_0x945b('0x3a')]!==_0x945b('0xb7')){delete this[_0x945b('0xb6')][_0x40dec2['uniqueid']];this[_0x945b('0xb8')](this[_0x945b('0x1a')][_0x40dec2[_0x945b('0xb9')]]);_0x1e51f5['droptime']=moment()[_0x945b('0x3d')](_0x945b('0xc3'));var _0x1cd02c=new QueueCallerAbandon(_0x1e51f5,_0x40dec2);if(utils[_0x945b('0x58')](_0x1e51f5[_0x945b('0xc4')],_0x1e51f5[_0x945b('0xc5')])>=_0x1e51f5[_0x945b('0xc6')]){this[_0x945b('0x1a')][_0x40dec2[_0x945b('0xb9')]][_0x945b('0x46')]+=0x1;this['voiceQueues'][_0x40dec2[_0x945b('0xb9')]]['outboundDropCallsDayTimeout']+=0x1;this[_0x945b('0x1a')][_0x40dec2[_0x945b('0xb9')]][_0x945b('0xc7')]+=0x1;_0x1cd02c[_0x945b('0xc8')]=0xa;_0x1cd02c[_0x945b('0x67')]=_0x945b('0xc9');_0x1cd02c[_0x945b('0xca')]=_0x945b('0xcb');_0x1cd02c['agiafterat']=this[_0x945b('0x1a')][_0x40dec2['queue']][_0x945b('0xcc')]?moment()[_0x945b('0x3d')](_0x945b('0xc3')):undefined;_0x1cd02c[_0x945b('0xcd')]+=0x1;_0x1cd02c[_0x945b('0xce')]+=0x1;_0x5188fe=this[_0x945b('0x1a')][_0x40dec2['queue']]['dialDropRetryFrequency'];_0x120361=this[_0x945b('0x1a')][_0x40dec2['queue']]['callAdditionalPhoneAfterMin'];hopperUtils[_0x945b('0xcf')](_0x1cd02c,_0x1cd02c['state'],_0x1e51f5[_0x945b('0xd0')])['then'](function(_0x5e0ffb){_0xf81776=_0x5e0ffb[_0x945b('0xd1')]==0x1;if(_0x1cd02c[_0x945b('0xcd')]>=_0x1e8351[_0x945b('0x1a')][_0x40dec2[_0x945b('0xb9')]]['dialDropMaxRetry']){_0x1e8351[_0x945b('0xd2')](_0x1cd02c,_0x5e0ffb[_0x945b('0xd1')]);}else{hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x1cd02c[_0x945b('0xcd')],'scheduledat':moment()[_0x945b('0xd3')](_0x1e8351['voiceQueues'][_0x40dec2[_0x945b('0xb9')]][_0x945b('0xd4')],'minutes')[_0x945b('0x3d')](_0x945b('0xc3')),'ContactId':_0x1e51f5[_0x945b('0xd5')],'ListId':_0x1e51f5['ListId'],'VoiceQueueId':_0x1e51f5['VoiceQueueId']||undefined,'CampaignId':_0x1e51f5[_0x945b('0xd6')]||undefined})['catch'](loggerCatch(_0x945b('0xd7')));var _0x2c98e8=new History(_0x1cd02c);_0x2c98e8['state']=0xa;_0x2c98e8[_0x945b('0x67')]=_0x945b('0xc9');_0x2c98e8[_0x945b('0x69')]=moment()[_0x945b('0x3d')](_0x945b('0xc3'));_0x2c98e8[_0x945b('0x68')]=_0x2c98e8['starttime'];_0x2c98e8['calleridname']=_0x1cd02c[_0x945b('0xd8')];_0x2c98e8[_0x945b('0xd9')]=_0x1cd02c['calleridnum'];hopperUtils[_0x945b('0xc1')](_0x2c98e8)[_0x945b('0x98')](loggerCatch(_0x945b('0xda')));}})[_0x945b('0x95')](function(){if(_0xf81776)hopperUtils['swapAdditionalPhones'](_0x1cd02c,_0x5188fe,_0x120361)[_0x945b('0x95')](function(){return 0x1;});});}else{this[_0x945b('0x1a')][_0x40dec2[_0x945b('0xb9')]][_0x945b('0x48')]+=0x1;this[_0x945b('0x1a')][_0x40dec2[_0x945b('0xb9')]][_0x945b('0xdb')]+=0x1;_0x1cd02c[_0x945b('0xc8')]=0xb;_0x1cd02c[_0x945b('0x67')]=_0x945b('0xdc');_0x1cd02c['dropreason']=_0x945b('0xdd');_0x1cd02c[_0x945b('0xde')]+=0x1;_0x1cd02c[_0x945b('0xce')]+=0x1;_0x5188fe=this[_0x945b('0x1a')][_0x40dec2[_0x945b('0xb9')]][_0x945b('0xdf')];_0x120361=this[_0x945b('0x1a')][_0x40dec2['queue']][_0x945b('0xe0')];hopperUtils[_0x945b('0xcf')](_0x1cd02c,_0x1cd02c['state'],_0x1e51f5[_0x945b('0xd0')])[_0x945b('0x95')](function(_0x1c9f03){if(_0x1cd02c[_0x945b('0xde')]>=_0x1e8351[_0x945b('0x1a')][_0x40dec2[_0x945b('0xb9')]][_0x945b('0xe1')]){_0x1e8351[_0x945b('0xd2')](_0x1cd02c,_0x1c9f03[_0x945b('0xd1')]);}else{hopperUtils[_0x945b('0xe2')]({'active':![],'countabandonedretry':_0x1cd02c[_0x945b('0xde')],'scheduledat':moment()[_0x945b('0xd3')](_0x1e8351['voiceQueues'][_0x40dec2['queue']]['dialAbandonedRetryFrequency'],_0x945b('0xe3'))[_0x945b('0x3d')](_0x945b('0xc3')),'ContactId':_0x1e51f5[_0x945b('0xd5')],'ListId':_0x1e51f5['ListId'],'VoiceQueueId':_0x1e51f5[_0x945b('0xe4')]||undefined,'CampaignId':_0x1e51f5[_0x945b('0xd6')]||undefined})[_0x945b('0x98')](loggerCatch(_0x945b('0xe5')));var _0x50f25c=new History(_0x1cd02c);_0x50f25c['state']=0xb;_0x50f25c[_0x945b('0x67')]=_0x945b('0xdc');_0x50f25c[_0x945b('0x69')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x50f25c[_0x945b('0x68')]=_0x50f25c[_0x945b('0x69')];_0x50f25c[_0x945b('0xd8')]=_0x1cd02c['calleridname'];_0x50f25c[_0x945b('0xd9')]=_0x1cd02c[_0x945b('0xd9')];hopperUtils[_0x945b('0xc1')](_0x50f25c)[_0x945b('0x98')](loggerCatch('[syncAgentComplete][createHistory][11]'));}})['then'](function(){if(_0xf81776)hopperUtils[_0x945b('0xe6')](_0x1cd02c,_0x5188fe,_0x120361)[_0x945b('0x95')](function(){return 0x1;});});}}}};Dialer[_0x945b('0x15')][_0x945b('0x30')]=function(_0x56067d){if(this[_0x945b('0x20')][_0x56067d[_0x945b('0xb5')]]){this['actions'][_0x56067d[_0x945b('0xb5')]]['channel']=_0x56067d[_0x945b('0xe7')];}if(this[_0x945b('0xb6')][_0x56067d[_0x945b('0xb5')]]){this[_0x945b('0xb6')][_0x56067d[_0x945b('0xb5')]]['channel']=_0x56067d[_0x945b('0xe7')];}};Dialer[_0x945b('0x15')][_0x945b('0x33')]=function(_0x179716){if(!this[_0x945b('0x20')][_0x179716['actionid']]){return;}var _0x531025=this['voiceQueues'][this['actions'][_0x179716[_0x945b('0xe8')]][_0x945b('0xb9')]][_0x945b('0xe9')]||_0x945b('0xea');if(_0x531025==='roundrobin'){if(this[_0x945b('0x20')][_0x179716['actionid']]&&_[_0x945b('0xeb')](this['actions'][_0x179716[_0x945b('0xe8')]][_0x945b('0xec')])&&_0x179716[_0x945b('0x81')]==='1'&&_0x179716['paused']==='0'){if(this[_0x945b('0x1c')][_0x179716['stateinterface']]){if(!this[_0x945b('0x1c')][_0x179716[_0x945b('0xed')]]['locked']){this['agents'][_0x179716['stateinterface']]['locked']=!![];this[_0x945b('0x20')][_0x179716[_0x945b('0xe8')]][_0x945b('0xec')]=!![];this[_0x945b('0x20')][_0x179716[_0x945b('0xe8')]]['stateinterface']=_0x179716[_0x945b('0xed')];}}}}else if(_0x531025===_0x945b('0xea')){if(this['actions'][_0x179716['actionid']]){if(this[_0x945b('0x1c')][_0x179716[_0x945b('0xed')]]){this['actions'][_0x179716['actionid']][_0x945b('0xed')]=_0x179716[_0x945b('0xed')];if(_['isNil'](this['queueBooked'][this[_0x945b('0x20')][_0x179716['actionid']][_0x945b('0xb9')]])){this[_0x945b('0x25')][this[_0x945b('0x20')][_0x179716['actionid']]['queue']]=[];}this[_0x945b('0x25')][this[_0x945b('0x20')][_0x179716['actionid']][_0x945b('0xb9')]][_0x945b('0x90')](_[_0x945b('0xee')](_[_0x945b('0x6e')](this['actions'][_0x179716['actionid']],['idHopper','stateinterface']),{'status':_0x179716[_0x945b('0x81')],'paused':_0x179716[_0x945b('0xef')]}));}}}};Dialer['prototype'][_0x945b('0x35')]=function(_0xfebd1f){if(!this[_0x945b('0x20')][_0xfebd1f[_0x945b('0xe8')]]){return;}var _0x48f336=this;var _0x51727e=this['voiceQueues'][this['actions'][_0xfebd1f[_0x945b('0xe8')]]['queue']];var _0x398e64=_0x51727e[_0x945b('0xe9')]||_0x945b('0xea');if(_0x398e64===_0x945b('0xf0')){if(this['actions'][_0xfebd1f[_0x945b('0xe8')]]&&this['actions'][_0xfebd1f[_0x945b('0xe8')]][_0x945b('0xed')]){this[_0x945b('0x19')][_0x945b('0xf1')](this['actions'][_0xfebd1f['actionid']]['idHopper'],this[_0x945b('0x20')][_0xfebd1f[_0x945b('0xe8')]][_0x945b('0xed')])[_0x945b('0x98')](function(_0x360dc9){logger[_0x945b('0x5c')](_0x945b('0xf2'),util[_0x945b('0x5f')](_0x360dc9,{'showHidden':![],'depth':null}));})['finally'](function(){_0x48f336['updateOriginated'](_0x48f336[_0x945b('0x1a')][_0x48f336[_0x945b('0x20')][_0xfebd1f[_0x945b('0xe8')]][_0x945b('0xb9')]]);_0x48f336[_0x945b('0x1c')][_0x48f336['actions'][_0xfebd1f[_0x945b('0xe8')]]['stateinterface']]['locked']=![];delete _0x48f336['actions'][_0xfebd1f[_0x945b('0xe8')]];unlockQueueStatus(_0x51727e);});}else{this[_0x945b('0xb8')](this['voiceQueues'][this[_0x945b('0x20')][_0xfebd1f[_0x945b('0xe8')]][_0x945b('0xb9')]]);hopperUtils[_0x945b('0xe2')]({'active':![],'ContactId':this['actions'][_0xfebd1f[_0x945b('0xe8')]][_0x945b('0xd5')],'ListId':this[_0x945b('0x20')][_0xfebd1f[_0x945b('0xe8')]][_0x945b('0xf3')],'VoiceQueueId':this[_0x945b('0x20')][_0xfebd1f[_0x945b('0xe8')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x945b('0x20')][_0xfebd1f['actionid']][_0x945b('0xd6')]||undefined})[_0x945b('0x98')](loggerCatch(_0x945b('0xf4')));delete this['actions'][_0xfebd1f[_0x945b('0xe8')]];unlockQueueStatus(_0x51727e);}}else if(_0x398e64===_0x945b('0xea')){var _0x3349ff;if(this[_0x945b('0x20')][_0xfebd1f[_0x945b('0xe8')]]&&!_[_0x945b('0x40')](this[_0x945b('0x25')][this[_0x945b('0x20')][_0xfebd1f[_0x945b('0xe8')]][_0x945b('0xb9')]])){if(this[_0x945b('0x26')][_0x48f336[_0x945b('0x20')][_0xfebd1f['actionid']][_0x945b('0xb9')]]){this[_0x945b('0x26')][_0x48f336[_0x945b('0x20')][_0xfebd1f[_0x945b('0xe8')]][_0x945b('0xb9')]]=this[_0x945b('0x26')][this['actions'][_0xfebd1f[_0x945b('0xe8')]][_0x945b('0xb9')]]?this['queueBookedRR'][this['actions'][_0xfebd1f[_0x945b('0xe8')]][_0x945b('0xb9')]]:this[_0x945b('0x25')][this[_0x945b('0x20')][_0xfebd1f[_0x945b('0xe8')]]['queue']]?this[_0x945b('0x25')][this['actions'][_0xfebd1f[_0x945b('0xe8')]][_0x945b('0xb9')]][_0x945b('0xf5')]||0x0:0x0;}this['queueBooked'][this[_0x945b('0x20')][_0xfebd1f['actionid']]['queue']][_0x945b('0xf5')]=this[_0x945b('0x26')][this[_0x945b('0x20')][_0xfebd1f[_0x945b('0xe8')]][_0x945b('0xb9')]];for(var _0x282d66=0x0;_0x282d66<this[_0x945b('0x25')][this[_0x945b('0x20')][_0xfebd1f[_0x945b('0xe8')]][_0x945b('0xb9')]]['length'];_0x282d66+=0x1){_0x3349ff=rr(this[_0x945b('0x25')][this[_0x945b('0x20')][_0xfebd1f[_0x945b('0xe8')]][_0x945b('0xb9')]]);this[_0x945b('0x26')][_0x48f336[_0x945b('0x20')][_0xfebd1f['actionid']][_0x945b('0xb9')]]=this[_0x945b('0x25')][this[_0x945b('0x20')][_0xfebd1f['actionid']]['queue']][_0x945b('0xf5')];if(_0x3349ff[_0x945b('0x81')]==='1'&&_0x3349ff[_0x945b('0xef')]==='0'){break;}}if(!_['isNil'](_0x3349ff)){this['agents'][_0x3349ff['stateinterface']][_0x945b('0xf6')]=_['isUndefined'](this['agents'][_0x3349ff[_0x945b('0xed')]]['unlockRR'])?!![]:this[_0x945b('0x1c')][_0x3349ff[_0x945b('0xed')]][_0x945b('0xf6')];}loggerBooked[_0x945b('0x41')](_0x945b('0xf7'),_0xfebd1f[_0x945b('0xe8')],_0x945b('0xf8'),JSON['stringify'](_[_0x945b('0x6e')](this['agents'][_0x3349ff[_0x945b('0xed')]],[_0x945b('0x3e'),_0x945b('0xf6')])),_0x945b('0xf9'),JSON['stringify'](_0x3349ff['idHopper']));if(!_[_0x945b('0xeb')](_0x3349ff)&&_0x3349ff[_0x945b('0x81')]==='1'&&_0x3349ff[_0x945b('0xef')]==='0'&&this[_0x945b('0x1c')][_0x3349ff[_0x945b('0xed')]][_0x945b('0xf6')]){this[_0x945b('0x1c')][_0x3349ff[_0x945b('0xed')]]['unlockRR']=![];this[_0x945b('0x25')][_0x48f336[_0x945b('0x20')][_0xfebd1f['actionid']][_0x945b('0xb9')]]=[];this[_0x945b('0x19')][_0x945b('0xf1')](_0x3349ff[_0x945b('0xfa')],_0x3349ff[_0x945b('0xed')])[_0x945b('0x98')](function(_0x331ae1){logger[_0x945b('0x5c')](_0x945b('0xf2'),util[_0x945b('0x5f')](_0x331ae1,{'showHidden':![],'depth':null}));})[_0x945b('0x17')](function(){_0x48f336[_0x945b('0xb8')](_0x48f336[_0x945b('0x1a')][_0x48f336[_0x945b('0x20')][_0xfebd1f[_0x945b('0xe8')]][_0x945b('0xb9')]]);setTimeout(function(){_0x48f336[_0x945b('0x1c')][_0x3349ff[_0x945b('0xed')]][_0x945b('0xf6')]=!![];loggerBooked[_0x945b('0x41')](_0x945b('0xfb'),_0xfebd1f['actionid'],'Agent:\x20',JSON[_0x945b('0x6d')](_[_0x945b('0x6e')](_0x48f336[_0x945b('0x1c')][_0x3349ff['stateinterface']],[_0x945b('0x3e'),_0x945b('0xf6')])),_0x945b('0xf9'),JSON[_0x945b('0x6d')](_0x3349ff[_0x945b('0xfa')]));},0xc7);delete _0x48f336['actions'][_0xfebd1f[_0x945b('0xe8')]];unlockQueueStatus(_0x51727e,_0xfebd1f['actionid']);});}else{loggerBooked[_0x945b('0x41')](_0x945b('0xfc'));this[_0x945b('0xb8')](this[_0x945b('0x1a')][this['actions'][_0xfebd1f[_0x945b('0xe8')]][_0x945b('0xb9')]]);hopperUtils[_0x945b('0xe2')]({'active':![],'ContactId':this[_0x945b('0x20')][_0xfebd1f[_0x945b('0xe8')]][_0x945b('0xd5')],'ListId':this[_0x945b('0x20')][_0xfebd1f[_0x945b('0xe8')]]['ListId'],'VoiceQueueId':this[_0x945b('0x20')][_0xfebd1f[_0x945b('0xe8')]][_0x945b('0xe4')]||undefined,'CampaignId':this[_0x945b('0x20')][_0xfebd1f[_0x945b('0xe8')]]['CampaignId']||undefined})[_0x945b('0x98')](loggerCatch(_0x945b('0xf4')));delete this[_0x945b('0x20')][_0xfebd1f[_0x945b('0xe8')]];unlockQueueStatus(_0x51727e);}}else{loggerBooked[_0x945b('0x41')](_0x945b('0xfd'));this['updateOriginated'](this[_0x945b('0x1a')][this[_0x945b('0x20')][_0xfebd1f['actionid']][_0x945b('0xb9')]]);hopperUtils[_0x945b('0xe2')]({'active':![],'ContactId':this[_0x945b('0x20')][_0xfebd1f['actionid']][_0x945b('0xd5')],'ListId':this[_0x945b('0x20')][_0xfebd1f['actionid']][_0x945b('0xf3')],'VoiceQueueId':this['actions'][_0xfebd1f[_0x945b('0xe8')]][_0x945b('0xe4')]||undefined,'CampaignId':this[_0x945b('0x20')][_0xfebd1f[_0x945b('0xe8')]][_0x945b('0xd6')]||undefined})['catch'](loggerCatch('[unlock2][syncQueueStatusComplete]'));delete this[_0x945b('0x20')][_0xfebd1f[_0x945b('0xe8')]];unlockQueueStatus(_0x51727e);}}else{loggerBooked[_0x945b('0x41')](_0x945b('0xfe'));this[_0x945b('0xb8')](this['voiceQueues'][this[_0x945b('0x20')][_0xfebd1f[_0x945b('0xe8')]]['queue']]);hopperUtils[_0x945b('0xe2')]({'active':![],'ContactId':this[_0x945b('0x20')][_0xfebd1f[_0x945b('0xe8')]][_0x945b('0xd5')],'ListId':this[_0x945b('0x20')][_0xfebd1f[_0x945b('0xe8')]][_0x945b('0xf3')],'VoiceQueueId':this['actions'][_0xfebd1f[_0x945b('0xe8')]][_0x945b('0xe4')]||undefined,'CampaignId':this[_0x945b('0x20')][_0xfebd1f[_0x945b('0xe8')]][_0x945b('0xd6')]||undefined})['catch'](loggerCatch(_0x945b('0xff')));delete this[_0x945b('0x20')][_0xfebd1f['actionid']];unlockQueueStatus(_0x51727e);}};Dialer['prototype']['syncOriginateResponse']=function(_0x452069){var _0x451136=this[_0x945b('0x20')][_0x452069[_0x945b('0xe8')]];if(_0x451136){delete this['actions'][_0x452069[_0x945b('0xe8')]];_0x451136[_0x945b('0xc5')]=moment()['format'](_0x945b('0xc3'));var _0x4715c7=_0x451136[_0x945b('0x3a')]===_0x945b('0xb7')?this[_0x945b('0x1b')][_0x451136[_0x945b('0xb9')]]:this[_0x945b('0x1a')][_0x451136[_0x945b('0x100')]()];if(_0x452069[_0x945b('0x101')]!==_0x945b('0x102')){this[_0x945b('0xb8')](_0x4715c7);return this[_0x945b('0x103')](_0x451136,_0x4715c7,_0x452069)[_0x945b('0x98')](loggerCatch('[callProgressDetecting]\x20'));}this['uniqueId'][_0x452069[_0x945b('0xb5')]]=_0x451136;}};Dialer[_0x945b('0x15')]['syncVarSet']=function(_0x48516c){var _0x4c1d82=this;var _0x37a866=this[_0x945b('0xb6')][_0x48516c[_0x945b('0xb5')]];var _0x52cbfb;if(!_[_0x945b('0xeb')](_0x48516c)&&!_[_0x945b('0xeb')](_0x48516c[_0x945b('0x104')])&&!_[_0x945b('0xeb')](_0x48516c[_0x945b('0x104')][_0x945b('0x105')])&&_0x48516c[_0x945b('0x106')]===_0x945b('0x107')&&_0x37a866){if(_0x37a866[_0x945b('0x3a')]!==_0x945b('0xb7')&&this[_0x945b('0x1a')][_0x37a866[_0x945b('0xb9')]][_0x945b('0x108')]&&_0x48516c[_0x945b('0x109')]===_0x945b('0x10a')){delete this[_0x945b('0xb6')][_0x48516c[_0x945b('0xb5')]];this[_0x945b('0xb8')](this['voiceQueues'][_0x37a866[_0x945b('0xb9')]]);this[_0x945b('0x1a')][_0x37a866['queue']][_0x945b('0xbc')]+=0x1;this[_0x945b('0x1a')][_0x37a866[_0x945b('0xb9')]][_0x945b('0x10b')]+=0x1;_0x52cbfb=new Hangup(_0x37a866,_0x48516c);_0x52cbfb[_0x945b('0xc8')]=0x12;_0x52cbfb[_0x945b('0x67')]='HangupInAMD';_0x52cbfb['membername']=_0x945b('0x10c');ami['emit'](_0x945b('0x10d'),ut[_0x945b('0x10e')](_0x52cbfb,_0x945b('0x10f')));this['saveInDb'](_0x52cbfb,_0x945b('0x110'),_0x945b('0x111'));}if(_0x37a866['type']!==_0x945b('0xb7')&&this[_0x945b('0x1a')][_0x37a866[_0x945b('0xb9')]][_0x945b('0x108')]&&_0x48516c[_0x945b('0x109')]==='MACHINE'){return new Promise(function(_0x209a86,_0x3a7b81){delete _0x4c1d82[_0x945b('0xb6')][_0x48516c[_0x945b('0xb5')]];_0x4c1d82[_0x945b('0xb8')](_0x4c1d82['voiceQueues'][_0x37a866['queue']]);_0x4c1d82[_0x945b('0x1a')][_0x37a866[_0x945b('0xb9')]][_0x945b('0xbc')]+=0x1;_0x4c1d82[_0x945b('0x1a')][_0x37a866['queue']][_0x945b('0x10b')]+=0x1;var _0x18aa36=_0x4c1d82[_0x945b('0x1a')][_0x37a866[_0x945b('0xb9')]];var _0x4178db=new Hangup(_0x37a866,_0x48516c);_0x4178db[_0x945b('0xc8')]=0x13;_0x4178db[_0x945b('0x67')]=_0x945b('0x112');_0x4178db[_0x945b('0x113')]='AMD';_0x4178db['countmachineretry']+=0x1;_0x4178db[_0x945b('0xce')]+=0x1;_0x4178db[_0x945b('0x10f')]=!![];ami['emit'](_0x945b('0x10d'),ut[_0x945b('0x10e')](_0x4178db,_0x945b('0x10f')));hopperUtils['createHistory'](_0x4178db)[_0x945b('0x98')](loggerCatch(_0x945b('0x114')));if(_0x4178db[_0x945b('0x115')]+_0x4178db[_0x945b('0x116')]+_0x4178db[_0x945b('0x117')]+_0x4178db[_0x945b('0x118')]+_0x4178db[_0x945b('0xcd')]+_0x4178db[_0x945b('0xde')]+_0x4178db[_0x945b('0x119')]+_0x4178db[_0x945b('0x11a')]>=_0x18aa36[_0x945b('0x11b')]){_0x4c1d82[_0x945b('0x11c')](_0x4178db,_0x209a86,_0x3a7b81,_0x945b('0x11d'));}else{if(_0x4178db['countmachineretry']>=_0x18aa36[_0x945b('0x11e')]){_0x4c1d82[_0x945b('0x11f')](_0x4178db,_0x209a86,_0x3a7b81,'reason\x2019\x20machine....');}else{hopperUtils[_0x945b('0xe2')]({'active':![],'countmachineretry':_0x4178db[_0x945b('0x119')],'scheduledat':moment()['add'](_0x18aa36[_0x945b('0x120')],'minutes')[_0x945b('0x3d')](_0x945b('0xc3')),'ContactId':_0x4178db[_0x945b('0xd5')],'ListId':_0x4178db[_0x945b('0xf3')],'VoiceQueueId':_0x4178db[_0x945b('0xe4')]||undefined,'CampaignId':_0x4178db[_0x945b('0xd6')]||undefined})[_0x945b('0x98')](loggerCatch(_0x945b('0x121')));_0x209a86({'reschedule':0x1});}}});}if(_0x37a866[_0x945b('0x3a')]===_0x945b('0xb7')&&this[_0x945b('0x1b')][_0x37a866['queue']][_0x945b('0x108')]&&_0x48516c[_0x945b('0x109')]==='HANGUP'){delete this[_0x945b('0xb6')][_0x48516c['uniqueid']];this['updateOriginated'](this[_0x945b('0x1b')][_0x37a866[_0x945b('0xb9')]]);_0x52cbfb=new Hangup(_0x37a866,_0x48516c);_0x52cbfb[_0x945b('0xc8')]=0x12;_0x52cbfb[_0x945b('0x67')]=_0x945b('0x122');_0x52cbfb[_0x945b('0x113')]=_0x945b('0x10c');ami[_0x945b('0x123')](_0x945b('0x10d'),ut[_0x945b('0x10e')](_0x52cbfb,'amd'));this[_0x945b('0x124')](_0x52cbfb,_0x945b('0x125'),_0x945b('0x126'));}if(_0x37a866[_0x945b('0x3a')]===_0x945b('0xb7')&&this[_0x945b('0x1b')][_0x37a866[_0x945b('0xb9')]][_0x945b('0x108')]&&_0x48516c[_0x945b('0x109')]===_0x945b('0x127')){return new Promise(function(_0x24e201,_0x440ce7){delete _0x4c1d82[_0x945b('0xb6')][_0x48516c[_0x945b('0xb5')]];_0x4c1d82['updateOriginated'](_0x4c1d82[_0x945b('0x1b')][_0x37a866[_0x945b('0xb9')]]);_0x4c1d82[_0x945b('0x1b')][_0x37a866[_0x945b('0xb9')]][_0x945b('0xbc')]+=0x1;_0x4c1d82['campaigns'][_0x37a866[_0x945b('0xb9')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x55f01b=_0x4c1d82['campaigns'][_0x37a866['queue']];var _0x2c582b=new Hangup(_0x37a866,_0x48516c);_0x2c582b[_0x945b('0xc8')]=0x13;_0x2c582b[_0x945b('0x67')]=_0x945b('0x112');_0x2c582b[_0x945b('0x113')]='AMD';_0x2c582b[_0x945b('0x119')]+=0x1;_0x2c582b['countglobal']+=0x1;_0x2c582b[_0x945b('0x10f')]=!![];ami[_0x945b('0x123')](_0x945b('0x10d'),ut[_0x945b('0x10e')](_0x2c582b,_0x945b('0x10f')));hopperUtils['createHistory'](_0x2c582b)[_0x945b('0x98')](loggerCatch(_0x945b('0x114')));if(_0x2c582b[_0x945b('0x115')]+_0x2c582b[_0x945b('0x116')]+_0x2c582b[_0x945b('0x117')]+_0x2c582b[_0x945b('0x118')]+_0x2c582b[_0x945b('0xcd')]+_0x2c582b[_0x945b('0xde')]+_0x2c582b['countmachineretry']+_0x2c582b['countagentrejectretry']>=_0x55f01b[_0x945b('0x11b')]){_0x4c1d82[_0x945b('0x11c')](_0x2c582b,_0x24e201,_0x440ce7,_0x945b('0x11d'));}else{if(_0x2c582b[_0x945b('0x119')]>=_0x55f01b[_0x945b('0x11e')]){_0x4c1d82[_0x945b('0x11f')](_0x2c582b,_0x24e201,_0x440ce7,_0x945b('0x128'));}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x2c582b[_0x945b('0x119')],'scheduledat':moment()['add'](_0x55f01b['dialMachineRetryFrequency'],_0x945b('0xe3'))['format'](_0x945b('0xc3')),'ContactId':_0x2c582b[_0x945b('0xd5')],'ListId':_0x2c582b[_0x945b('0xf3')],'VoiceQueueId':_0x2c582b['VoiceQueueId']||undefined,'CampaignId':_0x2c582b['CampaignId']||undefined})[_0x945b('0x98')](loggerCatch(_0x945b('0x121')));_0x24e201({'reschedule':0x1});}}});}}};Dialer[_0x945b('0x15')][_0x945b('0x129')]=function(_0x4a6f9b){var _0x45c419=this[_0x945b('0xb6')][_0x4a6f9b[_0x945b('0xb5')]];var _0x1f32a6;if(_0x45c419&&_0x45c419[_0x945b('0x3a')]===_0x945b('0xb7')){delete this[_0x945b('0xb6')][_0x4a6f9b[_0x945b('0xb5')]];this[_0x945b('0xb8')](this[_0x945b('0x1b')][_0x45c419[_0x945b('0xb9')]]);this[_0x945b('0x1b')][_0x45c419[_0x945b('0xb9')]][_0x945b('0x12a')]+=0x1;_0x1f32a6=new Hangup(_0x45c419,_0x4a6f9b);hopperUtils[_0x945b('0xc1')](_0x1f32a6)[_0x945b('0x98')](loggerCatch(_0x945b('0x12b')));hopperUtils[_0x945b('0x12c')](_0x1f32a6)[_0x945b('0x98')](loggerCatch(_0x945b('0x12d')));}if(_0x45c419&&_0x45c419[_0x945b('0x3a')]!==_0x945b('0xb7')&&isNotNull(this[_0x945b('0x1a')][_0x45c419[_0x945b('0xb9')]][_0x945b('0x12e')])){delete this[_0x945b('0xb6')][_0x4a6f9b[_0x945b('0xb5')]];this['updateOriginated'](this[_0x945b('0x1a')][_0x45c419[_0x945b('0xb9')]]);this['voiceQueues'][_0x45c419[_0x945b('0xb9')]][_0x945b('0xbc')]+=0x1;this[_0x945b('0x1a')][_0x45c419[_0x945b('0xb9')]][_0x945b('0x10b')]+=0x1;_0x1f32a6=new Hangup(_0x45c419,_0x4a6f9b);_0x1f32a6[_0x945b('0xc8')]=0x10;_0x1f32a6['statedesc']=_0x945b('0x12f');_0x1f32a6['membername']=_0x945b('0x130');hopperUtils[_0x945b('0xc1')](_0x1f32a6)['catch'](loggerCatch(_0x945b('0x12b')));hopperUtils[_0x945b('0x12c')](_0x1f32a6)[_0x945b('0x98')](loggerCatch(_0x945b('0x12d')));}if(_0x45c419&&_0x45c419[_0x945b('0x3a')]!==_0x945b('0xb7')&&!isNotNull(this[_0x945b('0x1a')][_0x45c419[_0x945b('0xb9')]][_0x945b('0x12e')])){if(_0x4a6f9b[_0x945b('0x131')]===_0x945b('0x132')){delete this[_0x945b('0xb6')][_0x4a6f9b[_0x945b('0xb5')]];this[_0x945b('0x1a')][_0x45c419[_0x945b('0xb9')]][_0x945b('0xbc')]+=0x1;const _0x35bc45=new AgentComplete(_0x45c419,_0x4a6f9b);_0x35bc45[_0x945b('0xd6')]=this[_0x945b('0x1a')][_0x45c419[_0x945b('0xb9')]]['id'];hopperUtils[_0x945b('0xc1')](_0x35bc45)['catch'](loggerCatch(_0x945b('0x133')));hopperUtils[_0x945b('0x12c')](_0x35bc45)['catch'](loggerCatch(_0x945b('0xc2')));}else{delete this[_0x945b('0xb6')][_0x4a6f9b[_0x945b('0xb5')]];this[_0x945b('0xb8')](this[_0x945b('0x1a')][_0x45c419[_0x945b('0xb9')]]);this['voiceQueues'][_0x45c419[_0x945b('0xb9')]][_0x945b('0x134')]+=0x1;_0x1f32a6=new Hangup(_0x45c419,_0x4a6f9b);_0x1f32a6[_0x945b('0xc8')]=0xc;_0x1f32a6['statedesc']=_0x4a6f9b['cause-txt'];_0x1f32a6[_0x945b('0x113')]=_0x945b('0x135');hopperUtils[_0x945b('0xc1')](_0x1f32a6)[_0x945b('0x98')](loggerCatch(_0x945b('0x12b')));hopperUtils['moveContactManagedDialer'](_0x1f32a6)[_0x945b('0x98')](loggerCatch(_0x945b('0x12d')));}}};Dialer[_0x945b('0x15')][_0x945b('0x8')]=function(_0x13b9ba){var _0x114e1a=this;if(!_0x114e1a[_0x945b('0x136')][_0x13b9ba[_0x945b('0x3e')]]){_0x114e1a['queuesSummary'][_0x13b9ba[_0x945b('0x3e')]]={'running':![]};}else if(_0x114e1a[_0x945b('0x136')][_0x13b9ba['name']][_0x945b('0x137')]===!![]){return;}else if(_0x114e1a[_0x945b('0x136')][_0x13b9ba[_0x945b('0x3e')]][_0x945b('0x137')]===![]){_0x114e1a[_0x945b('0x136')][_0x13b9ba[_0x945b('0x3e')]][_0x945b('0x137')]=!![];}var _0x42f8fa=_0x114e1a[_0x945b('0x1a')][_0x13b9ba[_0x945b('0x3e')]];var _0x3fac11=_0x42f8fa['message']!==utils[_0x945b('0x62')][_0x945b('0x138')];var _0x5b8a8c=utils[_0x945b('0x139')](_0x42f8fa);_0x42f8fa['statusMessage']=utils[_0x945b('0x13a')](_0x42f8fa,_0x114e1a['trunks']);Promise[_0x945b('0xa4')]()[_0x945b('0x95')](function(){if(_0x42f8fa[_0x945b('0x13b')]===utils[_0x945b('0x62')][_0x945b('0x138')]){if(_0x3fac11){clearPredictiveAttributes(_0x42f8fa);_0x13b9ba[_0x945b('0x23')]=undefined;_0x13b9ba[_0x945b('0x24')]=undefined;}if(_0x42f8fa[_0x945b('0x13b')]===utils[_0x945b('0x62')][_0x945b('0x138')]){_0x13b9ba[_0x945b('0x13c')]=0x0;_0x13b9ba[_0x945b('0xef')]=0x0;_0x13b9ba[_0x945b('0x13d')]=0x0;_0x13b9ba['talking']=0x0;_0x13b9ba[_0x945b('0x13e')]=0x0;}}else if(_0x42f8fa[_0x945b('0x13b')]===utils[_0x945b('0x62')][_0x945b('0x13f')]&&!_0x5b8a8c){return _0x114e1a[_0x945b('0x89')](_0x42f8fa,!![])[_0x945b('0x95')](function(){return _0x114e1a[_0x945b('0x89')](_0x42f8fa,![]);})[_0x945b('0x95')](function(){return _0x114e1a[_0x945b('0x140')](_0x42f8fa);})['catch'](function(_0x3b08da){loggerSyncQueueSummary[_0x945b('0x3b')](_0x945b('0x141'),util[_0x945b('0x5f')](_0x3b08da,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x42f8fa);});}else{clearPredictiveAttributes(_0x42f8fa);}})['then'](function(){var _0x391e4f=_0x13b9ba[_0x945b('0x142')](_0x42f8fa);if(_0x391e4f||_0x42f8fa[_0x945b('0x143')]){_0x42f8fa['queueSummaryCountersUpdated']=![];_0x13b9ba[_0x945b('0x144')](_0x42f8fa);Object['assign'](_0x42f8fa,_0x13b9ba);emitOutboundVoiceQueueSummary(_0x13b9ba);}_0x114e1a['queuesSummary'][_0x42f8fa[_0x945b('0x3e')]][_0x945b('0x137')]=![];})[_0x945b('0x98')](function(_0xe9a5cf){logger[_0x945b('0x5c')](_0x945b('0x141'),util[_0x945b('0x5f')](_0xe9a5cf,{'showHidden':![],'depth':null}));_0x114e1a[_0x945b('0x136')][_0x42f8fa[_0x945b('0x3e')]]['running']=![];});};Dialer[_0x945b('0x15')][_0x945b('0x145')]=_[_0x945b('0x146')](function(){var _0x4250ef=_[_0x945b('0x147')](this[_0x945b('0x1a')],function(_0x21aa02){return _0x21aa02[_0x945b('0x148')];});var _0x455406=_[_0x945b('0x147')](this[_0x945b('0x1c')],function(_0x2cb194){return _0x2cb194[_0x945b('0x149')]&&_0x2cb194[_0x945b('0x81')]===_0x945b('0x82');});if(_0x4250ef['length']>0x0&&_0x455406[_0x945b('0x14a')]>0x0){return Promise[_0x945b('0xa4')]()[_0x945b('0x95')](cmHopper[_0x945b('0x14b')](_[_0x945b('0x14c')](_0x4250ef,'id'),previewRecallmeReminderInterval,_[_0x945b('0x14c')](_0x455406,'id')))[_0x945b('0x95')](function(_0x41bf88){for(var _0x5b9f61=0x0;_0x5b9f61<_0x41bf88[_0x945b('0x14a')];_0x5b9f61++){var _0x36836f=_0x41bf88[_0x5b9f61][_0x945b('0x14d')][_0x945b('0x3e')];if(_0x36836f)io['to'](util[_0x945b('0x3d')](_0x945b('0x14e'),_0x36836f))['emit']('user:dialPreviewRecallReminder',{'hopper':_0x41bf88[_0x5b9f61]});}})['catch'](function(_0x4d0548){logger['error'](_0x945b('0x14f'),_0x4d0548);});}},0x3c*0x3e8,{'leading':!![]});Dialer['prototype'][_0x945b('0x150')]=function(){var _0xb98177=this;setInterval(function(){_0xb98177[_0x945b('0x151')](_0xb98177['uniqueId'],_0x945b('0x152'));_0xb98177['clearZombieChannels'](_0xb98177[_0x945b('0x20')],_0x945b('0x153'));},0x32c8);};Dialer[_0x945b('0x15')][_0x945b('0x151')]=function(_0x3ca5f,_0x910261){var _0x50dbe5=this;for(var _0x28b0d5 in _0x3ca5f){if(typeof _0x3ca5f[_0x28b0d5]!==_0x945b('0xa3')){this[_0x945b('0x18')][_0x945b('0x154')](function(){if(!_['isNil'](_0x3ca5f[_0x28b0d5])){return ami['Action']({'action':_0x945b('0x81'),'channel':_0x3ca5f[_0x28b0d5][_0x945b('0xe7')]})['catch'](function(_0x24b307){if(_0x24b307[_0x945b('0x61')]===_0x945b('0x155')){setTimeout(function(){if(_0x3ca5f[_0x28b0d5]&&_0x3ca5f[_0x28b0d5]['type']!==_0x945b('0xb7')){_0x50dbe5[_0x945b('0xb8')](_0x50dbe5['voiceQueues'][_0x3ca5f[_0x28b0d5]['queue']]);logger[_0x945b('0x5c')](_0x945b('0x156'),_0x910261,_0x28b0d5,_0x3ca5f[_0x28b0d5]['queue']);delete _0x3ca5f[_0x28b0d5];}if(_0x3ca5f[_0x28b0d5]&&_0x3ca5f[_0x28b0d5][_0x945b('0x3a')]===_0x945b('0xb7')){_0x50dbe5[_0x945b('0xb8')](_0x50dbe5[_0x945b('0x1b')][_0x3ca5f[_0x28b0d5][_0x945b('0xb9')]]);logger[_0x945b('0x5c')]('[Dialer][checkChannel][ivr]',_0x910261,_0x28b0d5,_0x3ca5f[_0x28b0d5][_0x945b('0xb9')]);delete _0x3ca5f[_0x28b0d5];}},0x2328);}});}});}}};Dialer[_0x945b('0x15')][_0x945b('0x157')]=function(_0x281a92){return Promise['resolve']()['then'](voiceQueueRt['getVoiceQueueRtPauses'](_0x281a92))[_0x945b('0x98')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0x945b('0x15')][_0x945b('0xb8')]=function(_0x1b212e){if(!_[_0x945b('0x39')](_0x1b212e)&&_0x1b212e!==null){if(typeof _0x1b212e[_0x945b('0x79')]!==_0x945b('0xa3')){if(_0x1b212e[_0x945b('0x79')]>0x0){_0x1b212e[_0x945b('0x79')]-=0x1;}else{logger[_0x945b('0x5c')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x945b('0x5c')](_0x945b('0x158'));}};Dialer[_0x945b('0x15')][_0x945b('0x159')]=function(_0x5bdd0d,_0x5334ce){var _0x249354=this;return function(_0x27d4c7){_0x249354[_0x945b('0xb8')](_0x5334ce);logger[_0x945b('0x5c')](_0x5bdd0d,util['inspect'](_0x27d4c7,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0x945b('0x15a')]=function(_0x2af643,_0x1c73d1,_0x35db0e){var _0x7a6cb6={'state':0x19,'statedesc':_0x945b('0x15b')};this[_0x945b('0xb8')](_0x1c73d1);this[_0x945b('0x124')](_['merge'](_0x7a6cb6,_['pick'](_0x35db0e,[_0x945b('0xd5'),_0x945b('0xf3'),_0x945b('0x15c'),'VoiceQueueId',_0x945b('0xd6')])),_0x945b('0x15d'),_0x945b('0x15e'));logger[_0x945b('0x5c')](_0x2af643);};Dialer[_0x945b('0x15')]['saveInDb']=function(_0x2481a3,_0x30a9ea,_0x4b9bf4){hopperUtils[_0x945b('0xc1')](_0x2481a3)[_0x945b('0x98')](loggerCatch(_0x30a9ea));hopperUtils[_0x945b('0x12c')](_0x2481a3)[_0x945b('0x98')](loggerCatch(_0x4b9bf4));};Dialer[_0x945b('0x15')][_0x945b('0xd2')]=function(_0x1185b8,_0x512d7b){hopperUtils['createHistory'](_0x1185b8)[_0x945b('0x98')](loggerCatch(_0x945b('0x133')));if(_0x512d7b==0x0){hopperUtils[_0x945b('0x12c')](_0x1185b8)[_0x945b('0x98')](loggerCatch(_0x945b('0x15f')));}};Dialer[_0x945b('0x15')][_0x945b('0x14f')]=function(_0x2415c3){return Promise[_0x945b('0xa4')]()['then'](cmHopper['handlePreviewRecallNotifications'](_0x2415c3['id'],previewRecallmeReminderInterval))['then'](function(_0x13870d){for(var _0x5df05e=0x0;_0x5df05e<_0x13870d['length'];_0x5df05e++){var _0x5158f5=_0x13870d[_0x5df05e][_0x945b('0x14d')]['name'];if(_0x5158f5)io['to'](util[_0x945b('0x3d')]('user:%s',_0x5158f5))[_0x945b('0x123')](_0x945b('0x160'),{'hopper':_0x13870d[_0x5df05e]});}})[_0x945b('0x98')](function(){});};Dialer['prototype'][_0x945b('0xa8')]=function(_0xdb592f){var _0x571687=this;return function(){_0x571687[_0x945b('0x161')](_0xdb592f);};};Dialer[_0x945b('0x15')][_0x945b('0x162')]=function(_0x1661b3,_0x522874){var _0x30cf4f=this;var _0x419491=uuid['v4']();this[_0x945b('0x20')][_0x419491]=new Action(_0x1661b3,_0x522874,_0x419491);return new Promise(function(_0x21a4c2,_0x8c361f){if(_['isUndefined'](_0x1661b3)&&typeof _0x1661b3!==_0x945b('0x163')){return _0x8c361f(msgResponse(_0x945b('0x164'),_0x945b('0x8a'),_0x945b('0x165')));}if(_[_0x945b('0x39')](_0x522874[_0x945b('0x166')])||_0x522874[_0x945b('0x166')]===null){return _0x8c361f(msgResponse(_0x945b('0x164'),_0x945b('0x8a'),_0x945b('0x167')));}var _0x6245f3={'XMD-CALLERID':_0x30cf4f[_0x945b('0x20')][_0x419491][_0x945b('0x168')](),'XMD-AGI':_0x1661b3['dialQueueProject']?util['format'](_0x945b('0x169'),ipAgi,_0x1661b3[_0x945b('0x12e')]):_0x945b('0x16a'),'XMD-AGIAFTER':_0x1661b3[_0x945b('0xcc')]?util[_0x945b('0x3d')](_0x945b('0x169'),ipAgi,_0x1661b3[_0x945b('0xcc')]):'NONE','XMD-QUEUE':utils[_0x945b('0x16b')](_0x1661b3)?util[_0x945b('0x3d')](_0x945b('0x16c'),_0x1661b3[_0x945b('0x3e')],_0x1661b3[_0x945b('0x16d')]||'',_0x1661b3['dialAgiAfterHangupAgent']?'c':'',_0x1661b3[_0x945b('0xc6')]||0x3):_0x945b('0x16a'),'XMD-CONTACTID':_0x522874['ContactId'],'XMD-CDRTYPE':_0x945b('0x5'),'CALLERID(all)':_0x30cf4f[_0x945b('0x20')][_0x419491]['getCaller'](),'XMD-AMD':_0x1661b3['dialAMDActive']?'ACTIVE':_0x945b('0x16a'),'XMD-DESTINATION':_0x945b('0x107')};if(_0x1661b3[_0x945b('0x108')]){_0x6245f3[_0x945b('0x16e')]=_0x1661b3[_0x945b('0x16f')]||0x9c4;_0x6245f3['XMD-AMDGREETING']=_0x1661b3[_0x945b('0x170')]||0x5dc;_0x6245f3[_0x945b('0x171')]=_0x1661b3[_0x945b('0x172')]||0x320;_0x6245f3[_0x945b('0x173')]=_0x1661b3[_0x945b('0x174')]||0x1388;_0x6245f3[_0x945b('0x175')]=_0x1661b3[_0x945b('0x176')]||0x64;_0x6245f3[_0x945b('0x177')]=_0x1661b3[_0x945b('0x178')]||0x32;_0x6245f3[_0x945b('0x179')]=_0x1661b3['dialAMDMaximumNumberOfWords']||0x3;_0x6245f3['XMD-AMDSILENCETHRESHOLD']=_0x1661b3[_0x945b('0x17a')]||0x100;_0x6245f3[_0x945b('0x17b')]=_0x1661b3[_0x945b('0x17c')]||0x1388;}if(utils[_0x945b('0x16b')](_0x1661b3)){_0x6245f3[_0x945b('0x17d')]=_0x522874[_0x945b('0xe4')];}else{_0x6245f3['XMD-CAMPAIGNID']=_0x522874['CampaignId'];}var _0x1f9ae3=utils[_0x945b('0x17e')](_0x522874[_0x945b('0x17f')]);Object[_0x945b('0x180')](_0x6245f3,_0x1f9ae3);var _0x198113=_0x30cf4f['isTrunkReachable'](_0x1661b3[_0x945b('0x181')])?utils[_0x945b('0x182')](_0x1661b3['Trunk'][_0x945b('0x183')],_0x1661b3[_0x945b('0x184')],_0x1661b3[_0x945b('0x185')]>0x0?utils[_0x945b('0x186')](_0x1661b3[_0x945b('0x187')],_0x1661b3[_0x945b('0x185')]):_0x1661b3[_0x945b('0x187')]):utils[_0x945b('0x182')](_[_0x945b('0xeb')](_0x1661b3[_0x945b('0x85')])?_0x1661b3[_0x945b('0x181')]['callerid']:_0x1661b3['TrunkBackup'][_0x945b('0x183')],_0x1661b3[_0x945b('0x184')],_0x1661b3[_0x945b('0x185')]>0x0?utils[_0x945b('0x186')](_0x1661b3[_0x945b('0x187')],_0x1661b3[_0x945b('0x185')]):_0x1661b3[_0x945b('0x187')]);if(_0x198113){_0x6245f3[_0x945b('0x188')]=_0x30cf4f[_0x945b('0x20')][_0x419491][_0x945b('0x189')]=utils['extractCalleridName'](_0x198113);_0x6245f3['XMD-ORIGINATECALLERIDNUM']=_0x522874[_0x945b('0x166')];}_0x1661b3[_0x945b('0x18a')]=_0x6245f3;return ami['Action']({'actionid':_0x419491,'action':_0x945b('0x164'),'channel':_0x30cf4f[_0x945b('0x84')](_0x1661b3['Trunk'])?util[_0x945b('0x3d')](_0x945b('0x18b'),_0x1661b3[_0x945b('0x181')][_0x945b('0x3e')],isNotNull(_0x1661b3['dialPrefix'])?_0x1661b3[_0x945b('0x18c')][_0x945b('0x18d')]()||'':'',_0x1661b3[_0x945b('0x18e')]>0x0?_0x522874[_0x945b('0x166')][_0x945b('0x18f')](_0x1661b3['dialCutDigit']):_0x522874[_0x945b('0x166')]):util['format'](_0x945b('0x18b'),_[_0x945b('0xeb')](_0x1661b3['TrunkBackup'])?_0x1661b3[_0x945b('0x181')][_0x945b('0x3e')]:_0x1661b3[_0x945b('0x85')][_0x945b('0x3e')],isNotNull(_0x1661b3['dialPrefix'])?_0x1661b3[_0x945b('0x18c')][_0x945b('0x18d')]()||'':'',_0x1661b3[_0x945b('0x18e')]>0x0?_0x522874[_0x945b('0x166')]['substring'](_0x1661b3[_0x945b('0x18e')]):_0x522874['phone']),'callerid':_0x198113,'Exten':_0x945b('0x107'),'Context':_0x945b('0x190'),'Priority':'1','variable':_0x6245f3,'timeout':(_0x1661b3[_0x945b('0x191')]||0x1e)*0x3e8,'async':!![],'channelid':_0x419491})['then'](function(_0x14a041){return _0x21a4c2(_0x14a041);})[_0x945b('0x98')](function(_0x2627f1){_0x1661b3[_0x945b('0x192')]+=0x1;var _0x94de19=new History(_0x30cf4f[_0x945b('0x20')][_0x419491]);logger[_0x945b('0x5c')](util[_0x945b('0x3d')](_0x945b('0x193'),JSON[_0x945b('0x6d')](_0x2627f1)));_0x94de19[_0x945b('0xc8')]=0xe;_0x94de19['statedesc']=_0x945b('0x194');_0x94de19[_0x945b('0x69')]=moment()[_0x945b('0x3d')](_0x945b('0xc3'));_0x94de19[_0x945b('0x68')]=_0x94de19['starttime'];hopperUtils[_0x945b('0xc1')](_0x94de19)[_0x945b('0x98')](loggerCatch(_0x945b('0x195')));_0x30cf4f[_0x945b('0x12c')](_0x94de19)[_0x945b('0x98')](loggerCatch(_0x945b('0x195')))[_0x945b('0x17')](function(){delete _0x30cf4f[_0x945b('0x20')][_0x419491];return _0x8c361f(msgResponse(_0x945b('0x164'),_0x945b('0x7f'),_0x945b('0x196')));});});});};Dialer['prototype'][_0x945b('0x197')]=function(_0x3a4873,_0x5137b8,_0x229fce){var _0x12c56e=new History(_0x5137b8);if(_0x12c56e[_0x945b('0x115')]+_0x12c56e[_0x945b('0x116')]+_0x12c56e[_0x945b('0x117')]+_0x12c56e['countnosuchnumberretry']+_0x12c56e[_0x945b('0xcd')]+_0x12c56e[_0x945b('0xde')]+_0x12c56e[_0x945b('0x119')]+_0x12c56e[_0x945b('0x11a')]>=_0x229fce[_0x945b('0x11b')]-0x1){return!![];}switch(_0x3a4873){case 0x3:if(_0x12c56e['countnoanswerretry']>=_0x229fce[_0x945b('0x198')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countnoanswerretry':_0x12c56e[_0x945b('0x117')]+=0x1,'scheduledat':moment()[_0x945b('0xd3')](_0x229fce[_0x945b('0x199')],_0x945b('0xe3'))[_0x945b('0x3d')](_0x945b('0xc3')),'ContactId':_0x12c56e['ContactId'],'ListId':_0x12c56e['ListId'],'VoiceQueueId':_0x12c56e[_0x945b('0xe4')]||undefined,'CampaignId':_0x12c56e[_0x945b('0xd6')]||undefined})[_0x945b('0x98')](loggerCatch(_0x945b('0x19a')));break;case 0x5:if(_0x12c56e[_0x945b('0x115')]>=_0x229fce['dialBusyMaxRetry']-0x1){return!![];}hopperUtils[_0x945b('0xe2')]({'active':![],'countbusyretry':_0x12c56e['countbusyretry']+=0x1,'scheduledat':moment()[_0x945b('0xd3')](_0x229fce['dialBusyRetryFrequency'],_0x945b('0xe3'))[_0x945b('0x3d')](_0x945b('0xc3')),'ContactId':_0x12c56e[_0x945b('0xd5')],'ListId':_0x12c56e[_0x945b('0xf3')],'VoiceQueueId':_0x12c56e[_0x945b('0xe4')]||undefined,'CampaignId':_0x12c56e[_0x945b('0xd6')]||undefined})[_0x945b('0x98')](loggerCatch(_0x945b('0x19b')));break;case 0x8:if(_0x12c56e[_0x945b('0x116')]>=_0x229fce[_0x945b('0x19c')]-0x1){return!![];}hopperUtils[_0x945b('0xe2')]({'active':![],'countcongestionretry':_0x12c56e[_0x945b('0x116')]+=0x1,'scheduledat':moment()[_0x945b('0xd3')](_0x229fce[_0x945b('0x19d')],'minutes')[_0x945b('0x3d')](_0x945b('0xc3')),'ContactId':_0x12c56e['ContactId'],'ListId':_0x12c56e[_0x945b('0xf3')],'VoiceQueueId':_0x12c56e[_0x945b('0xe4')]||undefined,'CampaignId':_0x12c56e[_0x945b('0xd6')]||undefined})[_0x945b('0x98')](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x12c56e[_0x945b('0x118')]>=_0x229fce[_0x945b('0x19e')]-0x1){return!![];}else{hopperUtils[_0x945b('0xe2')]({'active':![],'countnosuchnumberretry':_0x12c56e[_0x945b('0x118')]+=0x1,'scheduledat':moment()[_0x945b('0xd3')](_0x229fce[_0x945b('0x19f')],_0x945b('0xe3'))[_0x945b('0x3d')](_0x945b('0xc3')),'ContactId':_0x12c56e[_0x945b('0xd5')],'ListId':_0x12c56e['ListId'],'VoiceQueueId':_0x12c56e[_0x945b('0xe4')]||undefined,'CampaignId':_0x12c56e['CampaignId']||undefined})['catch'](loggerCatch(_0x945b('0x1a0')));}break;case 0xa:if(_0x12c56e[_0x945b('0xcd')]>=_0x229fce[_0x945b('0x1a1')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x12c56e[_0x945b('0xcd')]+=0x1,'scheduledat':moment()[_0x945b('0xd3')](_0x229fce[_0x945b('0xd4')],_0x945b('0xe3'))[_0x945b('0x3d')](_0x945b('0xc3')),'ContactId':_0x12c56e[_0x945b('0xd5')],'ListId':_0x12c56e[_0x945b('0xf3')],'VoiceQueueId':_0x12c56e[_0x945b('0xe4')]||undefined,'CampaignId':_0x12c56e[_0x945b('0xd6')]||undefined})[_0x945b('0x98')](loggerCatch(_0x945b('0xd7')));break;case 0xb:if(_0x12c56e[_0x945b('0xde')]>=_0x229fce[_0x945b('0xe1')]-0x1){return!![];}hopperUtils[_0x945b('0xe2')]({'active':![],'countabandonedretry':_0x12c56e['countabandonedretry']+=0x1,'scheduledat':moment()['add'](_0x229fce[_0x945b('0xdf')],_0x945b('0xe3'))['format'](_0x945b('0xc3')),'ContactId':_0x12c56e['ContactId'],'ListId':_0x12c56e[_0x945b('0xf3')],'VoiceQueueId':_0x12c56e[_0x945b('0xe4')]||undefined,'CampaignId':_0x12c56e[_0x945b('0xd6')]||undefined})[_0x945b('0x98')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x12c56e['countmachineretry']>=_0x229fce['dialMachineMaxRetry']-0x1){return!![];}hopperUtils[_0x945b('0xe2')]({'active':![],'countmachineretry':_0x12c56e[_0x945b('0x119')]+=0x1,'scheduledat':moment()[_0x945b('0xd3')](_0x229fce[_0x945b('0x120')],_0x945b('0xe3'))[_0x945b('0x3d')](_0x945b('0xc3')),'ContactId':_0x12c56e['ContactId'],'ListId':_0x12c56e[_0x945b('0xf3')],'VoiceQueueId':_0x12c56e['VoiceQueueId']||undefined,'CampaignId':_0x12c56e[_0x945b('0xd6')]||undefined})[_0x945b('0x98')](loggerCatch(_0x945b('0x121')));break;case 0x14:if(_0x12c56e[_0x945b('0x11a')]>=_0x229fce['dialAgentRejectMaxRetry']-0x1){return!![];}hopperUtils[_0x945b('0xe2')]({'active':![],'countagentrejectretry':_0x12c56e[_0x945b('0x11a')]+=0x1,'scheduledat':moment()[_0x945b('0xd3')](_0x229fce[_0x945b('0x1a2')],_0x945b('0xe3'))[_0x945b('0x3d')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x12c56e['ContactId'],'ListId':_0x12c56e[_0x945b('0xf3')],'VoiceQueueId':_0x12c56e[_0x945b('0xe4')]||undefined,'CampaignId':_0x12c56e[_0x945b('0xd6')]||undefined})[_0x945b('0x98')](loggerCatch(_0x945b('0x1a3')));break;default:return!![];}};Dialer['prototype']['callProgressDetecting']=function(_0x3235b3,_0x5d3754,_0x41d2cc){var _0x32842f=this;var _0x4ec26b=new History(_0x3235b3);var _0xec74f9=![];var _0x1f79c3;var _0x308f5a;return new Promise(function(_0x48af2a,_0x2aae8b){if(_['isUndefined'](_0x5d3754)&&typeof _0x5d3754!==_0x945b('0x163')){return _0x2aae8b(msgResponse(_0x945b('0x1a4'),_0x945b('0x8a'),_0x945b('0x1a5')));}if(_['isUndefined'](_0x41d2cc)&&typeof _0x41d2cc!==_0x945b('0x163')){return _0x2aae8b(msgResponse(_0x945b('0x1a4'),_0x945b('0x8a'),_0x945b('0x1a6')));}hopperUtils[_0x945b('0xcf')](_0x4ec26b,_0x41d2cc[_0x945b('0xbd')],_0x5d3754)['then'](function(_0x4dca80){if(_0x4dca80[_0x945b('0xd1')]==0x1)_0xec74f9=!![];switch(_0x41d2cc[_0x945b('0xbd')]){case'0':_0x5d3754[_0x945b('0x1a7')]+=0x1;_0x4ec26b[_0x945b('0xc8')]=0x0;_0x4ec26b[_0x945b('0x67')]=_0x945b('0x1a8');_0x4ec26b['countnosuchnumberretry']+=0x1;_0x4ec26b['countglobal']+=0x1;ami[_0x945b('0x123')](_0x945b('0x1a9'),ut[_0x945b('0x10e')](_0x3235b3,_0x945b('0x1aa')));_0x1f79c3=_0x5d3754[_0x945b('0x19f')];_0x308f5a=_0x5d3754['callAdditionalPhoneAfterMin'];hopperUtils[_0x945b('0xc1')](_0x4ec26b)[_0x945b('0x98')](loggerCatch(_0x945b('0x114')));if(_0x32842f[_0x945b('0x197')](0x0,_0x3235b3,_0x5d3754)&&!_0xec74f9){if(_0x4ec26b['countnosuchnumberretry']>=_0x5d3754[_0x945b('0x19e')]){_0x32842f['createStateFinal'](_0x4ec26b,_0x48af2a,_0x2aae8b,_0x945b('0x1ab'));}else{_0x32842f[_0x945b('0x11c')](_0x4ec26b,_0x48af2a,_0x2aae8b,_0x945b('0x1ab'));}}break;case'3':_0x5d3754['outboundNoAnswerCallsDay']+=0x1;_0x4ec26b['state']=0x3;_0x4ec26b[_0x945b('0x67')]=_0x945b('0x1ac');_0x4ec26b[_0x945b('0x117')]+=0x1;_0x4ec26b[_0x945b('0xce')]+=0x1;var _0x21f1c2=ut[_0x945b('0x1ad')](_0x3235b3,_0x5d3754);ami[_0x945b('0x123')](_0x945b('0x1ae'),_0x21f1c2);_0x1f79c3=_0x5d3754['dialNoAnswerRetryFrequency'];_0x308f5a=_0x5d3754[_0x945b('0xe0')];hopperUtils['createHistory'](_0x4ec26b)[_0x945b('0x98')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x32842f[_0x945b('0x197')](0x3,_0x3235b3,_0x5d3754)&&!_0xec74f9){if(_0x4ec26b[_0x945b('0x117')]>=_0x5d3754[_0x945b('0x198')]){_0x32842f['createStateFinal'](_0x4ec26b,_0x48af2a,_0x2aae8b,_0x945b('0x1af'));}else{_0x32842f[_0x945b('0x11c')](_0x4ec26b,_0x48af2a,_0x2aae8b,_0x945b('0x1af'));}}break;case'5':_0x5d3754[_0x945b('0x1b0')]+=0x1;_0x4ec26b[_0x945b('0xc8')]=0x5;_0x4ec26b[_0x945b('0x67')]=_0x945b('0x1b1');_0x4ec26b[_0x945b('0x115')]+=0x1;_0x4ec26b[_0x945b('0xce')]+=0x1;ami[_0x945b('0x123')](_0x945b('0x1b2'),ut['buildObj'](_0x3235b3,_0x945b('0x1b3')));_0x1f79c3=_0x5d3754[_0x945b('0x1b4')];_0x308f5a=_0x5d3754[_0x945b('0xe0')];hopperUtils[_0x945b('0xc1')](_0x4ec26b)[_0x945b('0x98')](loggerCatch(_0x945b('0x1b5')));if(_0x32842f[_0x945b('0x197')](0x5,_0x3235b3,_0x5d3754)&&!_0xec74f9){if(_0x4ec26b['countbusyretry']>=_0x5d3754[_0x945b('0x1b6')]){_0x32842f[_0x945b('0x11f')](_0x4ec26b,_0x48af2a,_0x2aae8b,_0x945b('0x1b7'));}else{_0x32842f[_0x945b('0x11c')](_0x4ec26b,_0x48af2a,_0x2aae8b,'reason\x205\x20busy');}}break;case'8':_0x5d3754['outboundCongestionCallsDay']+=0x1;_0x4ec26b['state']=0x8;_0x4ec26b['statedesc']=_0x945b('0x1b8');_0x4ec26b[_0x945b('0x116')]+=0x1;_0x4ec26b[_0x945b('0xce')]+=0x1;_0x1f79c3=_0x5d3754[_0x945b('0x19d')];_0x308f5a=_0x5d3754[_0x945b('0xe0')];ami[_0x945b('0x123')](_0x945b('0x1b9'),ut[_0x945b('0x10e')](_0x3235b3,_0x945b('0x1ba')));hopperUtils[_0x945b('0xc1')](_0x4ec26b)[_0x945b('0x98')](loggerCatch(_0x945b('0x1bb')));if(_0x32842f[_0x945b('0x197')](0x8,_0x3235b3,_0x5d3754)&&!_0xec74f9){if(_0x4ec26b[_0x945b('0x116')]>=_0x5d3754['dialCongestionMaxRetry']){_0x32842f[_0x945b('0x11f')](_0x4ec26b,_0x48af2a,_0x2aae8b,_0x945b('0x1bc'));}else{_0x32842f[_0x945b('0x11c')](_0x4ec26b,_0x48af2a,_0x2aae8b,_0x945b('0x1bc'));}}break;case'11':_0x5d3754['outboundAbandonedCallsDay']+=0x1;_0x4ec26b['state']=0xb;_0x4ec26b[_0x945b('0x67')]=_0x945b('0xdc');_0x4ec26b[_0x945b('0xde')]+=0x1;_0x4ec26b[_0x945b('0xce')]+=0x1;_0x1f79c3=_0x5d3754[_0x945b('0xdf')];_0x308f5a=_0x5d3754[_0x945b('0xe0')];hopperUtils['createHistory'](_0x4ec26b)['catch'](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x32842f[_0x945b('0x197')](0xb,_0x3235b3,_0x5d3754)&&!_0xec74f9){if(_0x4ec26b['countabandonedretry']>=_0x5d3754[_0x945b('0xe1')]){_0x32842f[_0x945b('0x11f')](_0x4ec26b,_0x48af2a,_0x2aae8b,_0x945b('0x1bd'));}else{_0x32842f[_0x945b('0x11c')](_0x4ec26b,_0x48af2a,_0x2aae8b,_0x945b('0x1bd'));}}break;case'20':_0x5d3754[_0x945b('0x1be')]+=0x1;_0x4ec26b[_0x945b('0xc8')]=0x14;_0x4ec26b[_0x945b('0x67')]=_0x945b('0x1bf');_0x4ec26b['countagentrejectretry']+=0x1;_0x4ec26b[_0x945b('0xce')]+=0x1;_0x1f79c3=_0x5d3754[_0x945b('0x1a2')];_0x308f5a=_0x5d3754['callAdditionalPhoneAfterMin'];ami[_0x945b('0x123')](_0x945b('0x1c0'),ut[_0x945b('0x10e')](_0x3235b3,_0x945b('0x1c1')));hopperUtils[_0x945b('0xc1')](_0x4ec26b)[_0x945b('0x98')](loggerCatch(_0x945b('0x1c2')));if(_0x32842f['checkRetriveMax'](0x14,_0x3235b3,_0x5d3754)&&!_0xec74f9){if(_0x4ec26b[_0x945b('0x11a')]>=_0x5d3754[_0x945b('0x1c3')]){_0x32842f[_0x945b('0x11f')](_0x4ec26b,_0x48af2a,_0x2aae8b,'reason\x2020\x20agentreject');}else{_0x32842f[_0x945b('0x11c')](_0x4ec26b,_0x48af2a,_0x2aae8b,_0x945b('0x1c4'));}}break;default:_0x5d3754[_0x945b('0x134')]+=0x1;_0x4ec26b[_0x945b('0xc8')]=0xc;_0x4ec26b[_0x945b('0x67')]=_0x41d2cc['reason'];_0x1f79c3=_0x5d3754[_0x945b('0x1a2')];_0x308f5a=_0x5d3754['callAdditionalPhoneAfterMin'];hopperUtils[_0x945b('0xc1')](_0x4ec26b)[_0x945b('0x98')](loggerCatch(_0x945b('0x1c5')));if(_0x32842f[_0x945b('0x197')](_0x41d2cc[_0x945b('0xbd')],_0x3235b3,_0x5d3754)&&!_0xec74f9){if(_0x4ec26b[_0x945b('0x115')]+_0x4ec26b[_0x945b('0x116')]+_0x4ec26b[_0x945b('0x117')]+_0x4ec26b['countnosuchnumberretry']+_0x4ec26b[_0x945b('0xcd')]+_0x4ec26b[_0x945b('0xde')]+_0x4ec26b['countmachineretry']+_0x4ec26b[_0x945b('0x11a')]>=_0x5d3754[_0x945b('0x11b')]){_0x32842f[_0x945b('0x11c')](_0x4ec26b,_0x48af2a,_0x2aae8b,_0x41d2cc[_0x945b('0xbd')]);}else{_0x32842f[_0x945b('0x11f')](_0x4ec26b,_0x48af2a,_0x2aae8b,_0x41d2cc[_0x945b('0xbd')]);}}}})['then'](function(){if(_0xec74f9){hopperUtils['swapAdditionalPhones'](_0x4ec26b,_0x1f79c3,_0x308f5a)[_0x945b('0x95')](function(){return _0x48af2a(0x1);});}});});};Dialer['prototype'][_0x945b('0x11c')]=function(_0xf59add,_0x5c19ff,_0x41489f,_0x1d5ee0){var _0x30f808=new Final(_0xf59add);_0x30f808[_0x945b('0xc8')]=0xf;_0x30f808[_0x945b('0x67')]=_0x945b('0x1c6');this[_0x945b('0x11f')](_0x30f808,_0x5c19ff,_0x41489f,_0x1d5ee0);};Dialer[_0x945b('0x15')][_0x945b('0x11f')]=function(_0x509984,_0x5d388c,_0x1cfa6f,_0xfe8b84){hopperUtils[_0x945b('0x12c')](_0x509984)[_0x945b('0x95')](function(){return _0x5d388c(msgResponse(_0x945b('0x1a4'),'Success',_0xfe8b84));})['catch'](function(){return _0x1cfa6f(msgResponse(_0x945b('0x1c7'),_0x945b('0x8a'),_0x945b('0x1c8')));});};Dialer[_0x945b('0x15')]['predictive']=function(_0x3d7813){var _0x2c9ec2=_0x3d7813[_0x945b('0x1c9')]/0x64;var _0x58570f=_0x3d7813[_0x945b('0x1ca')]/(_0x3d7813[_0x945b('0x1ca')]+_0x3d7813['outboundAnswerCallsDay']);var _0x58192f=Math[_0x945b('0x1cb')](_0x3d7813['predictiveIntervalAvailable']*(_0x3d7813['predictiveIntervalMaxThreshold']/0x64));var _0x57e1b8=Math[_0x945b('0x1cb')](_0x3d7813['predictiveIntervalAvailable']*(_0x3d7813[_0x945b('0x1cc')]/0x64));var _0xdc14d9=_0x3d7813[_0x945b('0x13c')]+_0x3d7813[_0x945b('0x1cd')];var _0x1777c7=Math['floor'](_0x3d7813[_0x945b('0x52')]*_0x3d7813[_0x945b('0x55')]*_0x3d7813[_0x945b('0x1ce')]*_0x3d7813['predictiveIntervalMultiplicativeFactor']);if(_['isUndefined'](_0x3d7813[_0x945b('0x24')])){if(!_[_0x945b('0x39')](_0x3d7813[_0x945b('0x23')])){_0x3d7813[_0x945b('0x23')]=undefined;loggerPredictive['error'](_0x945b('0x1cf'),_0x945b('0x1d0'));}if(!_[_0x945b('0x39')](_0x3d7813[_0x945b('0x5a')])){loggerPredictive[_0x945b('0x5c')]('[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x3d7813[_0x945b('0x5a')]);_0x3d7813[_0x945b('0x5a')]=undefined;}_0x3d7813[_0x945b('0x24')]=moment()[_0x945b('0x3d')](_0x945b('0xc3'));loggerPredictive[_0x945b('0x41')](_0x3d7813['name'],_0x945b('0x1d1'),_0x3d7813[_0x945b('0x24')]);this[_0x945b('0xab')](_0x3d7813,0x1);}else if(ifInterval(_0x3d7813[_0x945b('0x1d2')],_0x3d7813['startProgressive'])){this[_0x945b('0xab')](_0x3d7813,0x1);loggerPredictiveCalls['info'](_0x945b('0x1d3'),_0x3d7813[_0x945b('0x24')],_0x3d7813[_0x945b('0x3e')]);_0x3d7813[_0x945b('0x52')]=0x0;_0x3d7813[_0x945b('0xc7')]=0x0;}else if(_0x2c9ec2<_0x58570f&&_0x3d7813[_0x945b('0x1d4')]===_0x945b('0x1d5')){clearPredictiveAttributes(_0x3d7813);loggerPredictive[_0x945b('0x41')](_0x945b('0x1d6'),'Dropped\x20calls\x20day',_0x58570f,'startProgressive',_0x3d7813[_0x945b('0x3e')]);}else if(_0x1777c7<_0x3d7813['predictiveIntervalErlangCallsDroppedCalls']&&_0x3d7813['dialPredictiveOptimization']==='dropRate'){clearPredictiveAttributes(_0x3d7813);loggerPredictive['info'](_0x945b('0x1d7'),_0x945b('0x1d8'),_0x1777c7,_0x945b('0x1d9'),_0x3d7813[_0x945b('0xc7')],_0x945b('0x24'),_0x3d7813[_0x945b('0x3e')]);}else if(!ifInterval(_0x3d7813[_0x945b('0x1d2')],_0x3d7813['startProgressive'])&&_[_0x945b('0x39')](_0x3d7813[_0x945b('0x23')])&&!_['isUndefined'](_0x3d7813[_0x945b('0x24')])){_0x3d7813['startPredictive']=moment()[_0x945b('0x3d')](_0x945b('0xc3'));loggerPredictive[_0x945b('0x41')](_0x3d7813[_0x945b('0x3e')],_0x945b('0x1da'),_0x3d7813[_0x945b('0x23')]);hopperUtils[_0x945b('0x1db')](_0x3d7813[_0x945b('0x1d2')])[_0x945b('0x95')](this[_0x945b('0x1dc')](_0x3d7813))[_0x945b('0x95')](mergeDataErlangB(_0x3d7813))[_0x945b('0x95')](this['startMethodPredictive'](_0x3d7813))[_0x945b('0x98')](loggerCatchPredictive(_0x945b('0x1dd'),_0x3d7813));}else if(!ifInterval(_0x3d7813[_0x945b('0x1d2')],_0x3d7813[_0x945b('0x23')])){_0x3d7813[_0x945b('0xc7')]=0x0;_0x3d7813[_0x945b('0x23')]=moment()[_0x945b('0x3d')](_0x945b('0xc3'));loggerPredictive[_0x945b('0x41')](_0x3d7813[_0x945b('0x3e')],_0x945b('0x1de'),_0x3d7813[_0x945b('0x23')]);clearInterval(_0x3d7813[_0x945b('0x5a')]);_0x3d7813[_0x945b('0x5a')]=undefined;hopperUtils['avgHandleTime'](_0x3d7813[_0x945b('0x1d2')])[_0x945b('0x95')](this[_0x945b('0x1dc')](_0x3d7813))[_0x945b('0x95')](mergeDataErlangB(_0x3d7813))[_0x945b('0x95')](this[_0x945b('0x1df')](_0x3d7813))[_0x945b('0x98')](loggerCatchPredictive(_0x945b('0x1e0'),_0x3d7813));}else if(_0x3d7813[_0x945b('0x1e1')]&&_0xdc14d9<_0x3d7813[_0x945b('0x1e1')]-_0x57e1b8){clearPredictiveAttributes(_0x3d7813);loggerPredictive[_0x945b('0x41')](_0x3d7813[_0x945b('0x3e')],_0x945b('0x1e2'),_0xdc14d9,_0x945b('0x1e3'),_0x3d7813[_0x945b('0x1e1')],'-',_0x57e1b8,'=',_0x3d7813['predictiveIntervalAvailable']-_0x57e1b8,')');}else if(_0x3d7813[_0x945b('0x1e1')]&&_0xdc14d9>_0x3d7813[_0x945b('0x1e1')]+_0x58192f){clearPredictiveAttributes(_0x3d7813);loggerPredictive[_0x945b('0x41')](_0x3d7813[_0x945b('0x3e')],_0x945b('0x1e2'),_0xdc14d9,_0x945b('0x1e4'),_0x3d7813[_0x945b('0x1e1')],'+',_0x58192f,'=',_0x3d7813[_0x945b('0x1e1')]+_0x58192f,')');}};Dialer['prototype'][_0x945b('0x1dc')]=function(_0x170b18){var _0x529ccd=this;return function(_0x328f96){return new Promise(function(_0x51c372,_0x5d07f6){_[_0x945b('0xee')](_0x170b18,_0x328f96[0x0]);if(checkGetDataPredictive(_0x328f96[0x0])){var _0x355d08=_0x170b18[_0x945b('0x1e1')]=_0x170b18[_0x945b('0x1cd')]+_0x170b18[_0x945b('0x13c')];var _0x5f5677=_0x170b18[_0x945b('0x1d2')]*0x3c;var _0x146569=_0x328f96[0x0]['predictiveIntervalAvgTalktime']+_0x328f96[0x0][_0x945b('0x4a')];var _0x7f1058=(_0x328f96[0x0][_0x945b('0x45')]+_0x328f96[0x0][_0x945b('0x46')]+_0x328f96[0x0][_0x945b('0x48')])/_0x328f96[0x0]['predictiveIntervalTotalCalls'];_0x170b18[_0x945b('0x1ce')]=_0x7f1058>0x0?_0x7f1058:0x1;switch(_0x170b18['dialPredictiveOptimization']){case _0x945b('0x1d5'):var _0x329c51=_0x170b18[_0x945b('0x1c9')]/0x64;return _0x529ccd[_0x945b('0x1e5')](_0x355d08,_0x5f5677,_0x146569,_0x7f1058,_0x329c51)[_0x945b('0x95')](function(_0xb7395a){return _0x51c372(_0xb7395a);});case _0x945b('0x1e6'):var _0x1792b0=_0x170b18['dialPredictiveOptimizationPercentage']/0x64;return _0x529ccd['busyFactor'](_0x355d08,_0x5f5677,_0x146569,_0x7f1058,_0x1792b0)[_0x945b('0x95')](function(_0x520473){return _0x51c372(_0x520473);});default:return _0x5d07f6(msgResponse(_0x945b('0x1e7'),_0x945b('0x8a'),_0x945b('0x1e8')));}}else{return _0x5d07f6(msgResponse(_0x945b('0x1e7'),_0x945b('0x8a'),_0x945b('0x1e9')));}});};};Dialer[_0x945b('0x15')][_0x945b('0x1ea')]=function(_0x2740cd){var _0x8817c3=this;return function(_0x53815f){return new Promise(function(_0x158fcf,_0x56d772){_[_0x945b('0xee')](_0x2740cd,_0x53815f[0x0]);if(checkGetDataPredictive(_0x53815f[0x0])){loggerPredictive[_0x945b('0x41')](JSON[_0x945b('0x6d')](_0x53815f[0x0]));if(_0x2740cd[_0x945b('0x1d4')]==='dropRate'){return _0x8817c3['getVoiceQueueRtPauses'](_0x2740cd['id'])[_0x945b('0x95')](function(_0x3a933e){var _0x5424cd=_0x2740cd[_0x945b('0x1eb')]-_0x3a933e[0x0][_0x945b('0x1ec')];var _0x229572=_0x2740cd[_0x945b('0x1d2')]*0x3c;var _0x399da7=_0x53815f[0x0][_0x945b('0x4b')]+_0x53815f[0x0][_0x945b('0x4a')];var _0x23da13=(_0x53815f[0x0][_0x945b('0x45')]+_0x53815f[0x0][_0x945b('0x46')]+_0x53815f[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x53815f[0x0][_0x945b('0x43')];var _0x41e575=_0x2740cd[_0x945b('0x1c9')]/0x64;_0x2740cd['predictiveIntervalPauses']=_0x3a933e[0x0][_0x945b('0x1ec')]||0x0;_0x2740cd[_0x945b('0x1ce')]=_0x23da13>0x0?_0x23da13:0x1;return _0x8817c3[_0x945b('0x1e5')](_0x5424cd,_0x229572,_0x399da7,_0x23da13,_0x41e575);})[_0x945b('0x95')](function(_0x372d5d){return _0x158fcf(_0x372d5d);})[_0x945b('0x98')](function(_0x12d494){return _0x56d772(msgResponse(_0x945b('0x1ed'),_0x945b('0x8a'),JSON[_0x945b('0x6d')](_0x12d494)));});}if(_0x2740cd[_0x945b('0x1d4')]===_0x945b('0x1e6')){return _0x8817c3[_0x945b('0x157')](_0x2740cd['id'])['then'](function(_0x2ecd9c){var _0x28e138=_0x2740cd['loggedIn']-_0x2ecd9c[0x0]['outboundQueuePauses'];var _0x1c9c98=_0x2740cd[_0x945b('0x1d2')]*0x3c;var _0x391b63=_0x53815f[0x0][_0x945b('0x4b')]+_0x53815f[0x0]['predictiveIntervalAvgHoldtime'];var _0x53aadb=(_0x53815f[0x0][_0x945b('0x45')]+_0x53815f[0x0][_0x945b('0x46')]+_0x53815f[0x0][_0x945b('0x48')])/_0x53815f[0x0][_0x945b('0x43')];var _0x222cae=_0x2740cd[_0x945b('0x1c9')]/0x64;_0x2740cd[_0x945b('0x1ee')]=_0x2ecd9c[0x0]['outboundQueuePauses']||0x0;_0x2740cd[_0x945b('0x1ce')]=_0x53aadb>0x0?_0x53aadb:0x1;return _0x8817c3['busyFactor'](_0x28e138,_0x1c9c98,_0x391b63,_0x53aadb,_0x222cae);})[_0x945b('0x95')](function(_0xe0ca79){return _0x158fcf(_0xe0ca79);})[_0x945b('0x98')](function(_0x5cf988){return _0x56d772(msgResponse(_0x945b('0x1ed'),_0x945b('0x8a'),JSON['stringify'](_0x5cf988)));});}}else{return _0x56d772(msgResponse('[getDataPredictive]',_0x945b('0x8a'),_0x945b('0x1e9')));}});};};Dialer[_0x945b('0x15')][_0x945b('0x1df')]=function(_0x4de4b9){var _0x488c5e=this;return function(){var _0x4a29c4=0x0;var _0x5ae1db=Math[_0x945b('0x1ef')](_0x4de4b9['erlangCallToSecond']*0x3e8);if(_0x5ae1db>0x0){_0x5ae1db=_0x5ae1db<0x64?0x64:_0x5ae1db;loggerPredictive[_0x945b('0x41')](_0x4de4b9[_0x945b('0x3e')],_0x945b('0x1f0'),_0x5ae1db,_0x945b('0x1f1'));_0x4de4b9[_0x945b('0x5a')]=setInterval(function(){_0x488c5e[_0x945b('0x5a')](_0x4de4b9);loggerPredictiveCalls[_0x945b('0x41')](_0x945b('0x1f2'),_0x4a29c4+=0x1);},_0x5ae1db);}else{loggerPredictive[_0x945b('0x41')](_0x4de4b9['name'],_0x945b('0x1f3'));}};};Dialer['prototype']['checkContactBlack']=function(_0x13bad2,_0x4efddb){var _0x219829=this;return function(_0x2e9430){if(_[_0x945b('0x40')](_0x2e9430)){if(_[_0x945b('0xeb')](_0x4efddb[_0x945b('0x15c')])||!_0x4efddb[_0x945b('0x1f4')]){if(_0x13bad2['dialMethod']==='booked'){_0x13bad2[_0x945b('0x6a')]=_['isUndefined'](_0x13bad2['queueStatusComplete'])?!![]:_0x13bad2[_0x945b('0x6a')];var _0x8d73f1=uuid['v4']();_0x219829[_0x945b('0x20')][_0x8d73f1]=new Action(_0x13bad2,_0x4efddb,_0x8d73f1);loggerBooked[_0x945b('0x41')](_0x945b('0x1f5'),_0x8d73f1,'queueStatusComplete:\x20',JSON[_0x945b('0x6d')](_0x13bad2[_0x945b('0x6a')]),'Queue:\x20',_0x13bad2[_0x945b('0x3e')]);if(_0x13bad2[_0x945b('0x6a')]){_0x13bad2['queueStatusComplete']=![];_0x219829[_0x945b('0x25')][_0x219829[_0x945b('0x20')][_0x8d73f1][_0x945b('0xb9')]]=[];ami[_0x945b('0x91')]({'actionid':_0x8d73f1,'action':_0x945b('0x1f6'),'queue':_0x13bad2[_0x945b('0x3e')]})[_0x945b('0x98')](function(){_0x219829['updateOriginated'](_0x13bad2);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x219829[_0x945b('0x20')][_0x8d73f1][_0x945b('0xd5')],'ListId':_0x219829['actions'][_0x8d73f1][_0x945b('0xf3')],'VoiceQueueId':_0x219829['actions'][_0x8d73f1][_0x945b('0xe4')]||undefined,'CampaignId':_0x219829[_0x945b('0x20')][_0x8d73f1][_0x945b('0xd6')]||undefined})[_0x945b('0x98')](loggerCatch(_0x945b('0x1f7')));delete _0x219829[_0x945b('0x20')][_0x8d73f1];});}else{loggerBooked[_0x945b('0x41')](_0x945b('0x1f8'),JSON[_0x945b('0x6d')](_0x13bad2[_0x945b('0x6a')]),_0x945b('0x1f9'),_0x13bad2['name']);_0x219829['updateOriginated'](_0x13bad2);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x219829[_0x945b('0x20')][_0x8d73f1]['ContactId'],'ListId':_0x219829[_0x945b('0x20')][_0x8d73f1][_0x945b('0xf3')],'VoiceQueueId':_0x219829[_0x945b('0x20')][_0x8d73f1][_0x945b('0xe4')]||undefined,'CampaignId':_0x219829[_0x945b('0x20')][_0x8d73f1][_0x945b('0xd6')]||undefined})[_0x945b('0x98')](loggerCatch(_0x945b('0x1f7')));delete _0x219829['actions'][_0x8d73f1];}}else{return _0x219829['actionOriginate'](_0x13bad2,_0x4efddb);}}else{if(utils[_0x945b('0x58')](undefined,_0x4efddb[_0x945b('0x1fa')])<_0x13bad2[_0x945b('0x1fb')]*0x3c){if(_0x4efddb['Agent']&&!_0x4efddb[_0x945b('0x14d')][_0x945b('0x1fc')]){_0x219829[_0x945b('0x19')][_0x945b('0xf1')](_0x4efddb['id'])[_0x945b('0x17')](function(){_0x219829[_0x945b('0xb8')](_0x13bad2);});}else{hopperUtils['unlockContact']({'active':![]},_0x4efddb['id'],0x1)['finally'](function(){_0x219829[_0x945b('0xb8')](_0x13bad2);});}}else{_0x13bad2[_0x945b('0x1fd')]+=0x1;_0x219829['updateOriginated'](_0x13bad2);if(_0x13bad2[_0x945b('0x1fe')]){hopperUtils['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x4efddb[_0x945b('0xd5')],'ListId':_0x4efddb[_0x945b('0xf3')],'VoiceQueueId':_0x4efddb['VoiceQueueId']||undefined,'CampaignId':_0x4efddb[_0x945b('0xd6')]||undefined})[_0x945b('0x98')](loggerCatch(_0x945b('0x1ff')));hopperUtils[_0x945b('0xc1')](createObjHistory(_0x13bad2,_0x4efddb,utils['CAMPAIGN_STATUS']['QUEUE_RECALL'],0x17,_0x945b('0x200')))[_0x945b('0x98')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x219829[_0x945b('0x124')](createObjHistory(_0x13bad2,_0x4efddb,utils[_0x945b('0x62')][_0x945b('0x201')],0x16,_0x945b('0x202')),_0x945b('0x203'),_0x945b('0x204'));}}}}else{_0x13bad2['outboundBlacklistCallsDay']+=0x1;_0x219829[_0x945b('0x124')](createObjHistory(_0x13bad2,_0x4efddb,utils[_0x945b('0x62')][_0x945b('0x205')],0xd,_0x945b('0x206')),_0x945b('0x207'),_0x945b('0x208'));throw _0x945b('0x209');}};};Dialer[_0x945b('0x15')][_0x945b('0x161')]=function(_0x2545a3){var _0x3bc5c4=this;var _0x124553=_0x2545a3[_0x945b('0x20a')]-_0x2545a3[_0x945b('0x79')];emitCampaignSummary(_0x2545a3);if(_0x124553>0x0&&_0x2545a3[_0x945b('0x5e')]==0x0){if(_0x124553>this[_0x945b('0x1e')]){_0x124553=this[_0x945b('0x1e')];}_0x2545a3['temp']=0x1;hopperUtils[_0x945b('0x20b')](_0x2545a3,_0x124553)['then'](function(_0xa5af3d){_0x2545a3['temp']=0x0;if(_0xa5af3d){if(!utils[_0x945b('0x20c')](_0xa5af3d)){_0x2545a3[_0x945b('0x61')]=utils['CAMPAIGN_STATUS']['NO_AVAILABLE_CONTACTS'];logger[_0x945b('0x41')]('[getContactCampaign2][Empty]'+_0x2545a3[_0x945b('0x3e')]);}else{_0x2545a3[_0x945b('0x79')]+=_0xa5af3d[_0x945b('0x14a')];_0x2545a3[_0x945b('0x61')]=utils[_0x945b('0x62')]['RUNNING'];for(var _0x1e6650=0x0;_0x1e6650<_0xa5af3d[_0x945b('0x14a')];_0x1e6650+=0x1){_0x2545a3['ivrTotalCallsDays']+=0x1;if(_[_0x945b('0xeb')](_0xa5af3d[_0x1e6650])||_[_0x945b('0xeb')](_0xa5af3d[_0x1e6650][_0x945b('0x17f')])||_[_0x945b('0xeb')](_0xa5af3d[_0x1e6650][_0x945b('0x166')])){_0x3bc5c4[_0x945b('0x15a')](_0x945b('0x20d'),_0x2545a3,_0xa5af3d[_0x1e6650]);}else{hopperUtils['checkIsBlackListIvr'](_[_0x945b('0x6e')](_0xa5af3d[_0x1e6650],[_0x945b('0xd6'),_0x945b('0x166')]))[_0x945b('0x95')](_0x3bc5c4['checkContactBlack'](_0x2545a3,_0xa5af3d[_0x1e6650]))[_0x945b('0x98')](_0x3bc5c4[_0x945b('0x159')](_0x945b('0x20e'),_0x2545a3));}}}}})[_0x945b('0x98')](loggerGetContactDialer(_0x945b('0x20f'),_0x2545a3,_0x124553));}};Dialer[_0x945b('0x15')][_0x945b('0xab')]=function(_0xd65143,_0x1a8150){var _0x3a4f2d=this;var _0x9c22a5=[];if(_0x1a8150<0x1||_0xd65143[_0x945b('0x210')]==='booked'){_0x1a8150=0x1;}var _0x1e773c=Math[_0x945b('0x1ef')](_0xd65143[_0x945b('0x13c')]*_0x1a8150)-_0xd65143['originated'];if(_0xd65143[_0x945b('0x211')]>0x0){var _0x4f9cf6=_0xd65143[_0x945b('0x211')]-_0xd65143[_0x945b('0x79')]-_0xd65143[_0x945b('0x1cd')]-_0xd65143[_0x945b('0x13e')];if(_0x1e773c>_0x4f9cf6){_0x1e773c=_0x4f9cf6;}}if(_0x1e773c>0x0&&_0xd65143['temp']==0x0){if(_0xd65143[_0x945b('0x210')]==='booked'){_0x1e773c=0x1;}if(_0x1e773c>this[_0x945b('0x1e')]){_0x1e773c=this[_0x945b('0x1e')];}for(var _0x5ddfcc in this['agents']){if(typeof this[_0x945b('0x1c')][_0x5ddfcc]!==_0x945b('0xa3')){if(this[_0x945b('0x1c')][_0x5ddfcc][_0x945b('0xc8')]===_0x945b('0x212')&&this[_0x945b('0x1c')][_0x5ddfcc][_0x945b('0x81')]===_0x945b('0x82')){_0x9c22a5['push'](this[_0x945b('0x1c')][_0x5ddfcc]['id']);}}}_0xd65143[_0x945b('0x5e')]=0x1;hopperUtils[_0x945b('0x213')](_0xd65143,_0x9c22a5,_0x1e773c)[_0x945b('0x95')](function(_0x33272b){_0xd65143[_0x945b('0x5e')]=0x0;if(_0x33272b){if(!utils[_0x945b('0x20c')](_0x33272b)){hopperUtils[_0x945b('0x214')](_0xd65143)[_0x945b('0x95')](sendMessageReschedule(_0xd65143))['catch'](loggerCatch(_0x945b('0x215')));}else{_0xd65143['originated']+=_0x33272b[_0x945b('0x14a')];_0xd65143[_0x945b('0x61')]=_0xd65143[_0x945b('0x210')]==='booked'?utils['CAMPAIGN_STATUS'][_0x945b('0x13f')]:utils[_0x945b('0x62')][_0x945b('0x216')];for(var _0x1dba2f=0x0;_0x1dba2f<_0x33272b[_0x945b('0x14a')];_0x1dba2f+=0x1){if(_[_0x945b('0xeb')](_0x33272b[_0x1dba2f])||_['isNil'](_0x33272b[_0x1dba2f][_0x945b('0x17f')])||_['isNil'](_0x33272b[_0x1dba2f][_0x945b('0x166')])){_0x3a4f2d['emptyContact'](_0x945b('0x20d'),_0xd65143,_0x33272b[_0x1dba2f]);}else{hopperUtils[_0x945b('0x217')](_[_0x945b('0x6e')](_0x33272b[_0x1dba2f],['VoiceQueueId',_0x945b('0x166')]))[_0x945b('0x95')](_0x3a4f2d[_0x945b('0x218')](_0xd65143,_0x33272b[_0x1dba2f]))[_0x945b('0x98')](_0x3a4f2d[_0x945b('0x159')](_0x945b('0x20d'),_0xd65143));}}}}})[_0x945b('0x98')](loggerGetContactDialer(_0x945b('0x219'),_0xd65143,_0x1e773c));}};Dialer[_0x945b('0x15')]['handlePredictive']=function(_0xb9247b){if(_0xb9247b[_0x945b('0x211')]>0x0){var _0x2b9e68=_0xb9247b[_0x945b('0x211')]-_0xb9247b['originated']-_0xb9247b['talking'];if(_0x2b9e68>0x0&&_0xb9247b['temp']==0x0){this[_0x945b('0x21a')](_0xb9247b);}else{loggerPredictiveCalls[_0x945b('0x41')]('[handlePredictive][limitChannel]');}}else{this[_0x945b('0x21a')](_0xb9247b);}};Dialer[_0x945b('0x15')]['tryOriginatePredictive']=function(_0x71ad82){var _0x2234ca=this;var _0x27de33=[];_0x71ad82[_0x945b('0x79')]+=0x1;for(var _0x3e744a in this[_0x945b('0x1c')]){if(typeof this[_0x945b('0x1c')][_0x3e744a]!=='undefined'){if(this[_0x945b('0x1c')][_0x3e744a][_0x945b('0xc8')]==='not_inuse'&&this[_0x945b('0x1c')][_0x3e744a][_0x945b('0x81')]===_0x945b('0x82')){_0x27de33['push'](this[_0x945b('0x1c')][_0x3e744a]['id']);}}}_0x71ad82[_0x945b('0x5e')]=0x1;return this[_0x945b('0x213')](_0x71ad82['id'],_0x27de33,0x1,_0x71ad82[_0x945b('0x21b')],_0x71ad82)[_0x945b('0x95')](function(_0x432503){_0x71ad82['temp']=0x1;if(_0x432503){if(!utils[_0x945b('0x20c')](_0x432503)){utils[_0x945b('0x5d')](_0x71ad82,0x1,0x0);return hopperUtils[_0x945b('0x214')](_0x71ad82)[_0x945b('0x95')](sendMessageReschedule(_0x71ad82))[_0x945b('0x98')](loggerCatch(_0x945b('0x215')));}else{_0x71ad82[_0x945b('0x61')]=utils[_0x945b('0x62')][_0x945b('0x216')];if(_[_0x945b('0xeb')](_0x432503[0x0])||_['isNil'](_0x432503[0x0][_0x945b('0x17f')])||_['isNil'](_0x432503[0x0][_0x945b('0x166')])){_0x2234ca[_0x945b('0x15a')]('[actionOriginate]\x20',_0x71ad82,_0x432503[0x0]);}else{return hopperUtils[_0x945b('0x217')](_[_0x945b('0x6e')](_0x432503[0x0],['VoiceQueueId','phone']))[_0x945b('0x95')](_0x2234ca[_0x945b('0x218')](_0x71ad82,_0x432503[0x0]))[_0x945b('0x98')](_0x2234ca[_0x945b('0x159')](_0x945b('0x21c'),_0x71ad82));}}}})[_0x945b('0x98')](loggerGetContactDialer(_0x945b('0x21d'),_0x71ad82,0x1));};Dialer[_0x945b('0x15')][_0x945b('0x1e5')]=function(_0x4a531e,_0x1edda8,_0x30e47b,_0x5c9aec,_0x453c39,_0x21f4a9){loggerPredictive[_0x945b('0x41')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0x945b('0x41')](_0x945b('0x21e'),_0x4a531e);loggerPredictive[_0x945b('0x41')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1edda8);loggerPredictive[_0x945b('0x41')](_0x945b('0x21f'),_0x30e47b);loggerPredictive['info'](_0x945b('0x220'),_0x5c9aec);loggerPredictive[_0x945b('0x41')](_0x945b('0x221'),_0x453c39);loggerPredictive[_0x945b('0x41')](_0x945b('0x4c'));return new Promise(function(_0x3680fa,_0x13572d){if(_0x4a531e<=0x0||isNaN(_0x4a531e)){return _0x13572d(msgResponse(_0x945b('0x222'),_0x945b('0x7f'),'m\x20=\x20'+_0x4a531e));}if(_0x30e47b<=0x0||isNaN(_0x30e47b)){return _0x13572d(msgResponse(_0x945b('0x222'),'Error',_0x945b('0x223')+_0x30e47b));}if(_0x5c9aec<=0x0||isNaN(_0x5c9aec)){return _0x13572d(msgResponse(_0x945b('0x222'),_0x945b('0x7f'),_0x945b('0x224')+_0x5c9aec));}if(_0x1edda8<=0x0||isNaN(_0x1edda8)){return _0x13572d(msgResponse('[abandonmentRate]',_0x945b('0x7f'),_0x945b('0x225')+_0x1edda8));}if(_0x453c39<=0x0||isNaN(_0x453c39)){return _0x13572d(msgResponse(_0x945b('0x222'),_0x945b('0x7f'),'Amax\x20=\x20'+_0x453c39));}_0x21f4a9=_0x21f4a9||0x0;var _0x4a3571=0x1/_0x30e47b;var _0x20b42c=0x0;var _0x391397=0x0;var _0x231def=0x0;var _0x5a48cd=0x0;for(var _0x32a1a7=0x0;_0x231def<_0x453c39;_0x32a1a7+=0x1){_0x391397=_0x32a1a7/_0x1edda8;_0x20b42c=(_0x5c9aec*_0x391397+_0x21f4a9)/_0x4a3571;_0x231def=utils[_0x945b('0x226')](_0x20b42c,_0x4a531e);_0x5a48cd=_0x20b42c/_0x4a531e*(0x1-utils['erlangb'](_0x20b42c,_0x4a531e));}return _0x3680fa({'erlangCalls':_0x32a1a7,'erlangCallToSecond':_0x1edda8/_0x32a1a7,'erlangAbandonmentRate':_0x231def,'erlangBusyFactor':_0x5a48cd});});};Dialer[_0x945b('0x15')][_0x945b('0x227')]=function(_0x14a549,_0x28a615,_0x546b50,_0x4d8e42,_0x50a4c9,_0x3302b5){loggerPredictive[_0x945b('0x41')](_0x945b('0x228'));loggerPredictive['info'](_0x945b('0x21e'),_0x14a549);loggerPredictive[_0x945b('0x41')](_0x945b('0x229'),_0x28a615);loggerPredictive['info'](_0x945b('0x21f'),_0x546b50);loggerPredictive[_0x945b('0x41')](_0x945b('0x220'),_0x4d8e42);loggerPredictive[_0x945b('0x41')](_0x945b('0x22a'),_0x50a4c9);loggerPredictive[_0x945b('0x41')](_0x945b('0x4c'));return new Promise(function(_0x2d662a,_0x28a198){if(_0x14a549<=0x0||isNaN(_0x14a549)){return _0x28a198(msgResponse('[busyFactor]',_0x945b('0x7f'),_0x945b('0x22b')+_0x14a549));}if(_0x546b50<=0x0||isNaN(_0x546b50)){return _0x28a198(msgResponse(_0x945b('0x22c'),_0x945b('0x7f'),_0x945b('0x223')+_0x546b50));}if(_0x4d8e42<=0x0||isNaN(_0x4d8e42)){return _0x28a198(msgResponse(_0x945b('0x22c'),'Error',_0x945b('0x224')+_0x4d8e42));}if(_0x28a615<=0x0||isNaN(_0x28a615)){return _0x28a198(msgResponse('[busyFactor]','Error',_0x945b('0x225')+_0x28a615));}if(_0x50a4c9<=0x0||isNaN(_0x50a4c9)){return _0x28a198(msgResponse('[busyFactor]',_0x945b('0x7f'),_0x945b('0x22d')+_0x50a4c9));}_0x3302b5=_0x3302b5||0x0;var _0x26ae4b=0x1/_0x546b50;var _0x40b764=0x0;var _0x1f554f=0x0;var _0x15dc08=0x0;var _0x3c2512=0x0;for(var _0x121a98=0x0;_0x3c2512<_0x50a4c9;_0x121a98+=0x1){_0x1f554f=_0x121a98/_0x28a615;_0x40b764=(_0x4d8e42*_0x1f554f+_0x3302b5)/_0x26ae4b;_0x15dc08=utils[_0x945b('0x226')](_0x40b764,_0x14a549);_0x3c2512=_0x40b764/_0x14a549*(0x1-utils[_0x945b('0x226')](_0x40b764,_0x14a549));}return _0x2d662a({'erlangCalls':_0x121a98,'erlangCallToSecond':_0x28a615/_0x121a98,'erlangAbandonmentRate':_0x15dc08,'erlangBusyFactor':_0x3c2512});});};module[_0x945b('0x22e')]=Dialer;
\ No newline at end of file