Built motion from commit 6a09e18b.|2.6.11
[motion2.git] / server / services / ami / dialer / index.js
index f002c40..14f56e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd05=['[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','busy','dialBusyRetryFrequency','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','dialPredictiveOptimization','dropRate','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','averageHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','agentBusyFactor','busyFactor','[getDataPredictive]','check\x20failure','outboundQueuePauses','abandonmentRate','[CatchErlangB]','predictiveIntervalPauses','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','recallme','[booked][checkContactBlack]','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','voicePause','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','dialOrderByScheduledAt','RUNNING','ivrTotalCallsDays','emptyContact','checkContactBlack','loggerHandler','[actionOriginateIvr]\x20','dialLimitQueue','not_inuse','[actionOriginate]\x20','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','--------\x20Drop\x20Rate\x20--------','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Error','p\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Ts\x20=\x20','interval\x20=\x20','Umin\x20=\x20','exports','util','lodash','uuid','md5','../preview/util/util','../../../config/environment/','../../../config/logger','booked','predictiveCalls','syncQueueSummary','../ami','redis','defaults','socket.io-emitter','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/setting','./action','./final','./agentComplete','./queueCallerAbandon','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','tail','finally','sequence','voiceQueues','campaigns','agents','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','then','isUndefined','message','AGENTS_NOT_LOGGED','\x20AGENTS\x20NOT\x20LOGGED','name','\x20NOT\x20Active','INTERVAL_IS_NULL','Interval','Intervals','isEmpty','\x20INTERVAL_IS_NULL','[ifTime][Action]','stringify','milliseconds','diff','seconds','emit','type','outbound','available','loggedIn','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','format','voice:queue:%s','voice_queue:save','ivr','info','-----\x20Stats\x20Predictive\x20---','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','preview','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','inspect','stack','error','length','[decremetOriginate]\x20object\x20originated\x20is\x20negative','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','pTalking','NOT_ACTIVE','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','debug','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','IS_DISACTIVED','state','starttime','clearZombieChannels','[actions]','undefined','enqueue','isNil','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel][ivr]','countReScheduled','[countReScheduled]\x20','checkIsBlackList','resolve','verifyAdditionalPhones','[verifyAdditionalPhone]\x20','swapAdditionalPhones','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','moveContactManagedDialer','[moveContactManagedDialer]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','notFound','saveInDb','merge','pick','ContactId','UserId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','SIP/%s','trunks','unmonitored','createHistory','uniqueid','variable','amdstatus','xcally-motion-dialer','HANGUP','statedesc','membername','AMD','custom:amd','[syncHangupInAMD][createHistory]','dialAMDActive','value','countmachineretry','amd','buildObj','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countagentrejectretry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','VoiceQueueId','[rescheduleContact][Machine]','HangupInAMD','[syncHangupInAMDIvr][createHistory]','MACHINE','Machine','countglobal','countnosuchnumberretry','dialGlobalMaxRetry','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','dialQueueProject','AGI','[syncHangupIvr]','Unknow','reason','agent','agiafterat','dialQueueProject2','[syncAgentComplete][createHistory]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','predictiveIntervalErlangCallsDroppedCalls','dropreason','TIMEOUT','dialDropRetryFrequency','callAdditionalPhoneAfterMin','voiceQueue','additional','dialDropMaxRetry','ListId','[rescheduleContact][Drop]','Drop','endtime','calleridname','calleridnum','outboundDropCallsDayCallersExit','CALLEREXIT','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','Abandoned','[syncAgentComplete][createHistory][11]','actionid','strategy','locked','paused','stateinterface','queueBooked','idHopper','queueStatusComplete','[booked][unlockQueueStatus]','run','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[Catch][Preview][syncQueueStatusComplete]','[booked][RR][finaly]','[booked][unlock]','[unlock][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','resetActiveCalls','checkIsTrunkReachable','TrunkBackup','checkIfTime','ifTime','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','indexOf','push','content','all','some','GLOBAL_INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','Timezone:\x20','checkDialMethod','progressive','power','dialPowerLevel','predictive','handlePower','Queue','checkPreviewRecallReminder','Agent','user:%s','launchHandleIvr','handleIvr','dialGlobalInterval','dialTimezone','throttle','filter','online','reachable','map','user:dialPreviewRecallReminder','syncCampaigns','checkIfTimeIntervals','[syncCampaigns]','\x5cw{0,','pow','replace','random','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialer','ACTIVE','XMD-AMDINITIALSILENCE','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-CAMPAIGNID','Contact','tags','createdAt','toUpper','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','trim','substring','dialCutDigit','outboundOriginateFailureCallsDay','[originateError]:\x20%s','[originate][error]','originate\x20action\x20Error','getQueue','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xdd05,0x6f));var _0x5dd0=function(_0x33e613,_0x2e55f0){_0x33e613=_0x33e613-0x0;var _0x421c4b=_0xdd05[_0x33e613];return _0x421c4b;};'use strict';var util=require(_0x5dd0('0x0'));var _=require(_0x5dd0('0x1'));var uuid=require(_0x5dd0('0x2'));var moment=require('moment');var rr=require('rr');var md5=require(_0x5dd0('0x3'));var Redis=require('ioredis');var ut=require(_0x5dd0('0x4'));var config=require(_0x5dd0('0x5'));var logger=require('../../../config/logger')('dialer');var loggerBooked=require(_0x5dd0('0x6'))(_0x5dd0('0x7'));var loggerPredictive=require('../../../config/logger')('predictive');var loggerPredictiveCalls=require(_0x5dd0('0x6'))(_0x5dd0('0x8'));var loggerSyncQueueSummary=require(_0x5dd0('0x6'))(_0x5dd0('0x9'));var ami=require(_0x5dd0('0xa'));config[_0x5dd0('0xb')]=_[_0x5dd0('0xc')](config[_0x5dd0('0xb')],{'host':'localhost','port':0x18eb});var io=require(_0x5dd0('0xd'))(new Redis(config[_0x5dd0('0xb')]));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0x5dd0('0xe'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require(_0x5dd0('0xf'));var voiceQueueRt=require(_0x5dd0('0x10'));var RpcSetting=require(_0x5dd0('0x11'));var Action=require(_0x5dd0('0x12'));var History=require('./history');var Final=require(_0x5dd0('0x13'));var AgentComplete=require(_0x5dd0('0x14'));var QueueCallerAbandon=require(_0x5dd0('0x15'));var Hangup=require('./hangup');var ipAgi=process[_0x5dd0('0x16')][_0x5dd0('0x17')]||_0x5dd0('0x18');var strategy={'rrmemory':_0x5dd0('0x19'),'roundrobin':_0x5dd0('0x1a')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x5dd0('0x1b')]['enqueue']=function(_0x326d16){this[_0x5dd0('0x1c')]=this['tail']?this['tail'][_0x5dd0('0x1d')](_0x326d16):_0x326d16();};function Dialer(_0x38385d,_0x122488){this[_0x5dd0('0x1e')]=new Sequence();this['preview']=_0x122488;this[_0x5dd0('0x1f')]=_0x38385d['voiceQueues'];this['campaigns']=_0x38385d[_0x5dd0('0x20')];this['agents']=_0x38385d[_0x5dd0('0x21')];this['trunks']=_0x38385d['trunks'];this[_0x5dd0('0x22')]=config[_0x5dd0('0x22')]||0x2;this[_0x5dd0('0x23')]={};this[_0x5dd0('0x24')]={};this[_0x5dd0('0x25')]={};this[_0x5dd0('0x26')]={};this[_0x5dd0('0x27')]={};this[_0x5dd0('0x28')]={};this[_0x5dd0('0x29')]={};this['ivrOriginated']={};this['queueBooked']={};this[_0x5dd0('0x2a')]={};ami['on'](_0x5dd0('0x2b'),this[_0x5dd0('0x2c')][_0x5dd0('0x2d')](this));ami['on'](_0x5dd0('0x2e'),this[_0x5dd0('0x2f')][_0x5dd0('0x2d')](this));ami['on']('originateresponse',this[_0x5dd0('0x30')][_0x5dd0('0x2d')](this));ami['on'](_0x5dd0('0x31'),this[_0x5dd0('0x32')][_0x5dd0('0x2d')](this));ami['on'](_0x5dd0('0x33'),this[_0x5dd0('0x9')][_0x5dd0('0x2d')](this));ami['on'](_0x5dd0('0x34'),this[_0x5dd0('0x35')][_0x5dd0('0x2d')](this));ami['on'](_0x5dd0('0x36'),this[_0x5dd0('0x37')][_0x5dd0('0x2d')](this));ami['on'](_0x5dd0('0x38'),this[_0x5dd0('0x39')][_0x5dd0('0x2d')](this));ami['on'](_0x5dd0('0x3a'),this[_0x5dd0('0x3b')][_0x5dd0('0x2d')](this));ami['on'](_0x5dd0('0x3c'),this[_0x5dd0('0x3d')][_0x5dd0('0x2d')](this));ami['on'](_0x5dd0('0x3e'),this[_0x5dd0('0x3f')][_0x5dd0('0x2d')](this));this[_0x5dd0('0x40')]();this[_0x5dd0('0x41')]();RpcSetting[_0x5dd0('0x42')]()[_0x5dd0('0x43')](function(_0x8c4e12){previewRecallmeReminderInterval=_0x8c4e12['previewRecallmeReminderInterval'];});}function isNotNull(_0x385e3f){return _0x385e3f!==null&&!_[_0x5dd0('0x44')](_0x385e3f);}function checkIsLoggedIn(_0x5bd95e,_0x510005){return function(){if(_0x510005<=0x0){_0x5bd95e[_0x5dd0('0x45')]=_0x5dd0('0x46');throw _0x5bd95e['name']+_0x5dd0('0x47');}};}function isActive(_0x395acb){return _0x395acb;}function checkIsActive(_0x107eb1,_0x1aa8d6){return function(){if(!isActive(_0x1aa8d6)){_0x107eb1['message']='NOT_ACTIVE';throw _0x107eb1[_0x5dd0('0x48')]+_0x5dd0('0x49');}};}function checkInterval(_0x3ad1ab){return function(){if(!isNotNull(_0x3ad1ab['Interval'])){_0x3ad1ab[_0x5dd0('0x45')]=_0x5dd0('0x4a');throw _0x3ad1ab[_0x5dd0('0x48')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x3ad1ab[_0x5dd0('0x4b')][_0x5dd0('0x4c')])){_0x3ad1ab['message']=_0x5dd0('0x4a');throw _0x3ad1ab[_0x5dd0('0x48')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x5dd0('0x4d')](_0x3ad1ab[_0x5dd0('0x4b')][_0x5dd0('0x4c')]))){_0x3ad1ab['message']=_0x5dd0('0x4a');throw _0x3ad1ab[_0x5dd0('0x48')]+_0x5dd0('0x4e');}};}function msgResponse(_0x200423,_0x338edf,_0x3f6aaf){return{'action':_0x200423,'response':_0x338edf,'message':_0x3f6aaf,'stack':_0x3f6aaf};}function myreject(_0x143e84){return function(_0x23b426){return _0x143e84(msgResponse(_0x5dd0('0x4f'),'Error',JSON[_0x5dd0('0x50')](_0x23b426)));};}function getSeconds(_0x56a633,_0x48697b){var _0x57615c=moment(_0x56a633)['milliseconds'](0x0);var _0x12a606=moment(_0x48697b)[_0x5dd0('0x51')](0x0);return _0x57615c[_0x5dd0('0x52')](_0x12a606,_0x5dd0('0x53'));}function emit(_0x521f15,_0x32e499,_0x2415b1){io['to'](_0x521f15)[_0x5dd0('0x54')](_0x32e499,_0x2415b1);}function emitVoiceQueueSummary(_0x3ff722){if(_0x3ff722[_0x5dd0('0x55')]===_0x5dd0('0x56')){var _0x1f3002={'id':_0x3ff722['id'],'name':_0x3ff722[_0x5dd0('0x48')],'strategy':_0x3ff722['strategy'],'answered':_0x3ff722['answered'],'available':_0x3ff722[_0x5dd0('0x57')],'loggedIn':_0x3ff722[_0x5dd0('0x58')],'pTalking':_0x3ff722['pTalking'],'sumBillable':_0x3ff722['sumBillable'],'sumDuration':_0x3ff722[_0x5dd0('0x59')],'sumHoldTime':_0x3ff722[_0x5dd0('0x5a')]||0x0,'talking':_0x3ff722[_0x5dd0('0x5b')],'total':_0x3ff722[_0x5dd0('0x5c')],'type':_0x3ff722[_0x5dd0('0x55')],'unmanaged':_0x3ff722[_0x5dd0('0x5d')],'abandoned':_0x3ff722[_0x5dd0('0x5e')],'waiting':_0x3ff722[_0x5dd0('0x5f')],'loggedInDb':_0x3ff722[_0x5dd0('0x60')],'dialActive':_0x3ff722[_0x5dd0('0x61')],'dialMethod':_0x3ff722[_0x5dd0('0x62')],'dialOriginateCallerIdName':_0x3ff722[_0x5dd0('0x63')],'dialOriginateCallerIdNumber':_0x3ff722[_0x5dd0('0x64')],'dialOriginateTimeout':_0x3ff722[_0x5dd0('0x65')],'dialPrefix':_0x3ff722[_0x5dd0('0x66')],'outboundAnswerAgiCallsDay':_0x3ff722[_0x5dd0('0x67')],'outboundAnswerCallsDay':_0x3ff722[_0x5dd0('0x68')],'outboundBlacklistCallsDay':_0x3ff722[_0x5dd0('0x69')],'outboundBusyCallsDay':_0x3ff722['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x3ff722[_0x5dd0('0x6a')],'outboundDropCallsDayACS':_0x3ff722[_0x5dd0('0x6b')],'outboundDropCallsDayCallersExit':_0x3ff722['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x3ff722[_0x5dd0('0x6c')],'outboundNoAnswerCallsDay':_0x3ff722[_0x5dd0('0x6d')],'outboundNoSuchCallsDay':_0x3ff722['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x3ff722['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x3ff722['outboundReCallsDay'],'outboundRejectCallsDay':_0x3ff722[_0x5dd0('0x6e')],'outboundUnknownCallsDay':_0x3ff722[_0x5dd0('0x6f')],'predictiveIntervalAnsweredCalls':_0x3ff722[_0x5dd0('0x70')],'predictiveIntervalAvgHoldtime':_0x3ff722[_0x5dd0('0x71')],'predictiveIntervalAvgTalktime':_0x3ff722[_0x5dd0('0x72')],'predictiveIntervalDroppedCallsCallersExit':_0x3ff722[_0x5dd0('0x73')],'predictiveIntervalDroppedCallsTimeout':_0x3ff722[_0x5dd0('0x74')],'predictiveIntervalErlangCalls':_0x3ff722[_0x5dd0('0x75')],'predictiveIntervalErlangCallsDroppedCalls':_0x3ff722['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x3ff722[_0x5dd0('0x76')],'predictiveIntervalMultiplicativeFactor':_0x3ff722[_0x5dd0('0x77')],'predictiveIntervalPauses':_0x3ff722['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x3ff722[_0x5dd0('0x78')],'predictiveIntervalTotalCalls':_0x3ff722[_0x5dd0('0x79')],'message':_0x3ff722[_0x5dd0('0x45')],'originated':_0x3ff722[_0x5dd0('0x7a')],'erlangCalls':_0x3ff722[_0x5dd0('0x7b')],'erlangCallToSecond':_0x3ff722[_0x5dd0('0x7c')],'erlangAbandonmentRate':_0x3ff722[_0x5dd0('0x7d')],'erlangBusyFactor':_0x3ff722[_0x5dd0('0x7e')],'startPredictive':_0x3ff722[_0x5dd0('0x28')],'startProgressive':_0x3ff722['startProgressive']};if(_0x3ff722['Trunk']){_0x1f3002[_0x5dd0('0x7f')]={'id':_0x3ff722[_0x5dd0('0x7f')]['id'],'name':_0x3ff722[_0x5dd0('0x7f')][_0x5dd0('0x48')],'active':_0x3ff722[_0x5dd0('0x7f')][_0x5dd0('0x80')],'callerid':_0x3ff722[_0x5dd0('0x7f')][_0x5dd0('0x81')]};}if(_0x3ff722[_0x5dd0('0x4b')]){_0x1f3002[_0x5dd0('0x4b')]={'id':_0x3ff722['Interval']['id'],'name':_0x3ff722['Interval']['name']};}var _0x5c460b=md5(JSON[_0x5dd0('0x50')](_0x1f3002));if(_0x3ff722[_0x5dd0('0x3')]!==_0x5c460b){_0x3ff722[_0x5dd0('0x3')]=_0x5c460b;emit(util[_0x5dd0('0x82')](_0x5dd0('0x83'),_0x1f3002['name']),_0x5dd0('0x84'),_0x1f3002);}}}function emitCampaignSummary(_0x23a9dc){if(_0x23a9dc['type']===_0x5dd0('0x85')){emit(util[_0x5dd0('0x82')]('campaign:ivr:%s',_0x23a9dc[_0x5dd0('0x48')]),'campaign:save',_0x23a9dc);}}function checkGetDataPredictive(_0x390aeb){if(isNotNull(_0x390aeb)&&!_[_0x5dd0('0x4d')](_0x390aeb)){loggerPredictive[_0x5dd0('0x86')](_0x5dd0('0x87'));loggerPredictive[_0x5dd0('0x86')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x390aeb[_0x5dd0('0x79')]);loggerPredictive[_0x5dd0('0x86')](_0x5dd0('0x88'),_0x390aeb['predictiveIntervalAnsweredCalls']);loggerPredictive[_0x5dd0('0x86')](_0x5dd0('0x89'),_0x390aeb['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0x5dd0('0x86')](_0x5dd0('0x8a'),_0x390aeb[_0x5dd0('0x73')]);loggerPredictive[_0x5dd0('0x86')](_0x5dd0('0x8b'),_0x390aeb[_0x5dd0('0x71')]);loggerPredictive[_0x5dd0('0x86')](_0x5dd0('0x8c'),_0x390aeb[_0x5dd0('0x72')]);loggerPredictive[_0x5dd0('0x86')](_0x5dd0('0x8d'));if(_0x390aeb[_0x5dd0('0x79')]>0x0){if(!_[_0x5dd0('0x44')](_0x390aeb[_0x5dd0('0x72')])&&_0x390aeb['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0x5dd0('0x86')](_0x5dd0('0x8e'));if(!_[_0x5dd0('0x44')](_0x390aeb[_0x5dd0('0x71')])&&_0x390aeb['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive['info']('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0x5dd0('0x86')](_0x5dd0('0x8f'));}}else{loggerPredictive[_0x5dd0('0x86')](_0x5dd0('0x90'));}return![];}function mergeDataErlangB(_0x5b7de2){return function(_0x380681){loggerPredictive[_0x5dd0('0x86')](_0x5dd0('0x91'));loggerPredictive[_0x5dd0('0x86')](_0x5dd0('0x92'),_0x380681[_0x5dd0('0x7b')]);loggerPredictive[_0x5dd0('0x86')](_0x5dd0('0x93'),_0x380681[_0x5dd0('0x7c')]);loggerPredictive[_0x5dd0('0x86')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x380681[_0x5dd0('0x7d')]);loggerPredictive[_0x5dd0('0x86')](_0x5dd0('0x94'),_0x380681['erlangBusyFactor']);loggerPredictive['info']('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x380681[_0x5dd0('0x7d')]);loggerPredictive['info'](_0x5dd0('0x8d'));_['merge'](_0x5b7de2,_0x380681);};}function getDiff(_0x5d00da){var _0x40a078=moment()[_0x5dd0('0x51')](0x0);var _0x55d1d8=moment(_0x5d00da)[_0x5dd0('0x51')](0x0);return _0x40a078[_0x5dd0('0x52')](_0x55d1d8,'seconds');}function ifInterval(_0x1813d5,_0x42b29b){if(_[_0x5dd0('0x44')](_0x42b29b)){return![];}return getDiff(_0x42b29b)<_0x1813d5*0x3c;}function freeVariablesPredictive(_0x35aca0){if(isNotNull(_0x35aca0)){if(!_[_0x5dd0('0x44')](_0x35aca0[_0x5dd0('0x29')])){_0x35aca0[_0x5dd0('0x29')]=undefined;loggerPredictive[_0x5dd0('0x86')](_0x35aca0[_0x5dd0('0x48')],_0x5dd0('0x95'));}if(!_[_0x5dd0('0x44')](_0x35aca0[_0x5dd0('0x28')])){_0x35aca0[_0x5dd0('0x28')]=undefined;loggerPredictive[_0x5dd0('0x86')](_0x35aca0[_0x5dd0('0x48')],_0x5dd0('0x96'));}if(!_[_0x5dd0('0x44')](_0x35aca0['handlePredictive'])){clearInterval(_0x35aca0[_0x5dd0('0x97')]);_0x35aca0[_0x5dd0('0x97')]=undefined;loggerPredictive[_0x5dd0('0x86')](_0x35aca0[_0x5dd0('0x48')],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0x36154b,_0x3f35ac){if(_0x3f35ac===0x0){return 0x0;}var _0x1ec0b4=0x1;for(var _0x97add0=0x1;_0x97add0<=_0x3f35ac;_0x97add0+=0x1){_0x1ec0b4=0x1+_0x1ec0b4*_0x97add0/_0x36154b;}return 0x1/_0x1ec0b4;}function isVoiceQueueOutbound(_0x1b350b){return _0x1b350b===_0x5dd0('0x56');}function isNotPreview(_0x4150b6){return _0x4150b6!==_0x5dd0('0x98');}function isCampaignIvr(_0x3347a4){return _0x3347a4==='ivr';}function getCallerId(_0x1a3537,_0x4d5123,_0x3ac945){if(!_[_0x5dd0('0x44')](_0x3ac945)&&typeof _0x3ac945===_0x5dd0('0x99')&&!_['isEmpty'](_0x3ac945)){if(!_[_0x5dd0('0x44')](_0x4d5123)&&typeof _0x4d5123===_0x5dd0('0x99')&&!_['isEmpty'](_0x4d5123)){return util['format'](_0x5dd0('0x9a'),_0x4d5123,_0x3ac945);}return util[_0x5dd0('0x82')](_0x5dd0('0x9a'),_0x3ac945,_0x3ac945);}if(!_['isUndefined'](_0x1a3537)&&typeof _0x1a3537===_0x5dd0('0x99')&&!_['isEmpty'](_0x1a3537)){return _0x1a3537;}return _0x5dd0('0x9b');}function loggerCatchQueueSummary(_0x558852,_0xfb81ed){return function(_0x5df10e){freeVariablesPredictive(_0xfb81ed);emitVoiceQueueSummary(_0xfb81ed);emitCampaignSummary(_0xfb81ed);loggerSyncQueueSummary['debug'](_0x558852,util[_0x5dd0('0x9c')](_0x5df10e,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x228175,_0x2c83ce){return function(_0x3f127b){loggerPredictive['error'](_0x2c83ce[_0x5dd0('0x48')],_0x228175);loggerPredictive['error'](_0x3f127b[_0x5dd0('0x9d')]);freeVariablesPredictive(_0x2c83ce);};}function loggerCatch(_0x295788){return function(_0x1f5229){logger[_0x5dd0('0x9e')](_0x295788,util[_0x5dd0('0x9c')](_0x1f5229,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x2638a3){return _0x2638a3&&!_['isUndefined'](_0x2638a3)&&_0x2638a3[_0x5dd0('0x9f')]>0x0;}function decremetOriginate(_0x2ae672){if(!_[_0x5dd0('0x44')](_0x2ae672)&&_0x2ae672!==null){if(typeof _0x2ae672[_0x5dd0('0x7a')]!=='undefined'){if(_0x2ae672['originated']>0x0){_0x2ae672['originated']-=0x1;}else{logger[_0x5dd0('0x9e')](_0x5dd0('0xa0'));}}}else{logger[_0x5dd0('0x9e')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x17f30f,_0x109a84,_0x372769){if(_0x109a84>_0x372769){for(var _0x2848f0=0x0;_0x2848f0<_0x109a84-_0x372769;_0x2848f0+=0x1){decremetOriginate(_0x17f30f);}}}function loggerGetContactDialer(_0x4bcb5c,_0x1e7e81,_0x17b1b6){return function(_0x2235b4){checkContactLowerLimitOriginate(_0x1e7e81,_0x17b1b6,0x0);logger['error'](_0x4bcb5c,util[_0x5dd0('0x9c')](_0x2235b4,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x77109f){return function(_0x222c87){if(isNotNull(_0x222c87)&&isNotNull(_0x222c87[0x0])){if(_0x222c87[0x0][_0x5dd0('0xa1')]>0x0){_0x77109f[_0x5dd0('0x45')]=_0x5dd0('0xa2');logger[_0x5dd0('0x86')](_0x5dd0('0xa3')+_0x77109f[_0x5dd0('0x48')],_0x222c87[0x0]['contactsRescheduled'],'contacts');}else{_0x77109f[_0x5dd0('0x45')]=_0x5dd0('0xa4');logger[_0x5dd0('0x86')](_0x5dd0('0xa5')+_0x77109f[_0x5dd0('0x48')]);}}};}function notSendMessagesQueue(_0x43f434){if(_0x43f434[_0x5dd0('0xa6')]){freeVariablesPredictive(_0x43f434);if(_0x43f434['originated']===0x0&&_0x43f434[_0x5dd0('0x5b')]===0x0&&_0x43f434['waiting']===0x0&&(_0x43f434[_0x5dd0('0xa7')]||0x0)===0x0){_0x43f434[_0x5dd0('0xa6')]=![];_0x43f434['available']=0x0;_0x43f434[_0x5dd0('0x45')]=_0x5dd0('0xa8');loggerSyncQueueSummary['debug'](_0x5dd0('0xa9'),_0x43f434[_0x5dd0('0x48')],_0x5dd0('0xaa'));}else{_0x43f434[_0x5dd0('0x45')]='IS_DISACTIVED';loggerSyncQueueSummary[_0x5dd0('0xab')](_0x5dd0('0xa9'),_0x43f434[_0x5dd0('0x48')],_0x5dd0('0xac'));}emitVoiceQueueSummary(_0x43f434);}}function notSendMessagesCampaign(_0x3700ef){if(_0x3700ef[_0x5dd0('0xa6')]){if(_0x3700ef['originated']===0x0){_0x3700ef[_0x5dd0('0xa6')]=![];_0x3700ef[_0x5dd0('0x45')]='NOT_ACTIVE';loggerSyncQueueSummary['debug'](_0x5dd0('0xad'),_0x3700ef[_0x5dd0('0x48')],'is\x20not\x20active');}else{_0x3700ef[_0x5dd0('0x45')]=_0x5dd0('0xae');loggerSyncQueueSummary['debug'](_0x5dd0('0xad'),_0x3700ef[_0x5dd0('0x48')],_0x5dd0('0xac'));}emitCampaignSummary(_0x3700ef);}}function createObjHistory(_0x3f5e93,_0x153c58,_0x4388b7,_0x363103,_0x3689a8){_0x3f5e93[_0x5dd0('0x45')]=_0x4388b7;var _0x2ee2db=new Action(_0x3f5e93,_0x153c58);var _0x4ec784=new History(_0x2ee2db);_0x4ec784[_0x5dd0('0xaf')]=_0x363103;_0x4ec784['statedesc']=_0x3689a8;_0x4ec784['endtime']=_0x2ee2db[_0x5dd0('0xb0')];return _0x4ec784;}Dialer['prototype']['loopClearZombieChannels']=function(){var _0x47b392=this;setInterval(function(){_0x47b392[_0x5dd0('0xb1')](_0x47b392[_0x5dd0('0x26')],'[uniqueid]');_0x47b392[_0x5dd0('0xb1')](_0x47b392[_0x5dd0('0x24')],_0x5dd0('0xb2'));},0x32c8);};Dialer[_0x5dd0('0x1b')][_0x5dd0('0xb1')]=function(_0x34f8c9,_0x47e520){var _0x10aa25=this;for(var _0x5be262 in _0x34f8c9){if(typeof _0x34f8c9[_0x5be262]!==_0x5dd0('0xb3')){this['sequence'][_0x5dd0('0xb4')](function(){if(!_[_0x5dd0('0xb5')](_0x34f8c9[_0x5be262])){return ami[_0x5dd0('0xb6')]({'action':_0x5dd0('0xb7'),'channel':_0x34f8c9[_0x5be262][_0x5dd0('0xb8')]})[_0x5dd0('0xb9')](function(_0x3945be){if(_0x3945be[_0x5dd0('0x45')]===_0x5dd0('0xba')){setTimeout(function(){if(_0x34f8c9[_0x5be262]&&_0x34f8c9[_0x5be262]['type']!==_0x5dd0('0x85')){_0x10aa25[_0x5dd0('0xbb')](_0x10aa25[_0x5dd0('0x1f')][_0x34f8c9[_0x5be262][_0x5dd0('0xbc')]]);logger[_0x5dd0('0x9e')]('[Dialer][checkChannel]',_0x47e520,_0x5be262,_0x34f8c9[_0x5be262][_0x5dd0('0xbc')]);delete _0x34f8c9[_0x5be262];}if(_0x34f8c9[_0x5be262]&&_0x34f8c9[_0x5be262]['type']===_0x5dd0('0x85')){_0x10aa25['updateOriginated'](_0x10aa25[_0x5dd0('0x20')][_0x34f8c9[_0x5be262][_0x5dd0('0xbc')]]);logger[_0x5dd0('0x9e')](_0x5dd0('0xbd'),_0x47e520,_0x5be262,_0x34f8c9[_0x5be262]['queue']);delete _0x34f8c9[_0x5be262];}},0x2328);}});}});}}};Dialer['prototype'][_0x5dd0('0xbe')]=function(_0x54a2ad){return Promise['resolve']()[_0x5dd0('0x43')](cmHopper['countReScheduled'](_0x54a2ad))[_0x5dd0('0xb9')](loggerCatch(_0x5dd0('0xbf')));};Dialer[_0x5dd0('0x1b')][_0x5dd0('0xc0')]=function(_0x1b105b){return Promise[_0x5dd0('0xc1')]()[_0x5dd0('0x43')](cmHopperBlack[_0x5dd0('0xc0')](_0x1b105b))[_0x5dd0('0xb9')](loggerCatch('[checkIsBlackList]\x20'));};Dialer[_0x5dd0('0x1b')][_0x5dd0('0xc2')]=function(_0x3e09da,_0x2d6289,_0x2bf78b){return Promise['resolve']()[_0x5dd0('0x43')](cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x3e09da,_0x2d6289,_0x2bf78b))[_0x5dd0('0xb9')](loggerCatch(_0x5dd0('0xc3')));};Dialer[_0x5dd0('0x1b')][_0x5dd0('0xc4')]=function(_0x575ea1,_0x4043cb,_0x269fe1){return Promise[_0x5dd0('0xc1')]()[_0x5dd0('0x43')](cmHopperAdditionalPhone[_0x5dd0('0xc4')](_0x575ea1,_0x4043cb,_0x269fe1))['catch'](loggerCatch('[swapAdditionalPhone]\x20'));};Dialer[_0x5dd0('0x1b')][_0x5dd0('0xc5')]=function(_0x371c3b){return Promise[_0x5dd0('0xc1')]()[_0x5dd0('0x43')](cmHopperBlack[_0x5dd0('0xc5')](_0x371c3b))[_0x5dd0('0xb9')](loggerCatch(_0x5dd0('0xc6')));};Dialer['prototype']['averageHandleTime']=function(_0x1dbdb4){return Promise['resolve']()['then'](cmHopperHistory[_0x5dd0('0xc7')](_0x1dbdb4))['catch'](loggerCatch(_0x5dd0('0xc8')));};Dialer[_0x5dd0('0x1b')][_0x5dd0('0xc9')]=function(_0x282dee){return Promise[_0x5dd0('0xc1')]()[_0x5dd0('0x43')](cmHopper[_0x5dd0('0xc9')](_0x282dee))[_0x5dd0('0xb9')](loggerCatch('[rescheduleContact]\x20'));};Dialer[_0x5dd0('0x1b')][_0x5dd0('0xca')]=function(_0x37f1e4,_0x1593e3,_0x37139d){return Promise['resolve']()[_0x5dd0('0x43')](cmHopper['unlockContact'](_0x37f1e4,_0x1593e3,_0x37139d))['catch'](loggerCatch(_0x5dd0('0xcb')));};Dialer[_0x5dd0('0x1b')][_0x5dd0('0xcc')]=function(_0xa31d00,_0x44103d,_0x435b18,_0x2dcfc8,_0x411058){return Promise[_0x5dd0('0xc1')]()[_0x5dd0('0x43')](cmHopper[_0x5dd0('0xcc')](_0xa31d00,_0x44103d,_0x435b18,_0x2dcfc8))['catch'](function(_0x598466){_0x411058[_0x5dd0('0xcd')]-=_0x435b18;_0x411058[_0x5dd0('0xcd')]=_0x411058[_0x5dd0('0xcd')]>0x0?_0x411058[_0x5dd0('0xcd')]:0x0;loggerCatch(_0x5dd0('0xce'))(_0x598466);});};Dialer['prototype'][_0x5dd0('0xcf')]=function(_0x2d43e1,_0x3d3998,_0x1a3cf5,_0x3d8424){return Promise[_0x5dd0('0xc1')]()[_0x5dd0('0x43')](cmHopper[_0x5dd0('0xcf')](_0x2d43e1,_0x3d3998,_0x1a3cf5))[_0x5dd0('0xb9')](function(_0x45bc26){_0x3d8424['temp']-=_0x3d3998;_0x3d8424[_0x5dd0('0xcd')]=_0x3d8424[_0x5dd0('0xcd')]>0x0?_0x3d8424[_0x5dd0('0xcd')]:0x0;loggerCatch(_0x5dd0('0xd0'))(_0x45bc26);});};Dialer[_0x5dd0('0x1b')][_0x5dd0('0xd1')]=function(_0x4bae27){return Promise[_0x5dd0('0xc1')]()['then'](voiceQueueRt[_0x5dd0('0xd1')](_0x4bae27))[_0x5dd0('0xb9')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0x5dd0('0x1b')][_0x5dd0('0xd2')]=function(_0x3484a0){return Promise[_0x5dd0('0xc1')]()[_0x5dd0('0x43')](cmHopper[_0x5dd0('0xd2')](_0x3484a0))['catch'](loggerCatch(_0x5dd0('0xd3')));};Dialer['prototype']['createHistory']=function(_0x76e226){return Promise['resolve']()['then'](cmHopperHistory['createHistory'](_0x76e226))[_0x5dd0('0xb9')](loggerCatch('[createHistory]\x20'));};Dialer[_0x5dd0('0x1b')]['updateOriginated']=function(_0x450c12){if(!_['isUndefined'](_0x450c12)&&_0x450c12!==null){if(typeof _0x450c12[_0x5dd0('0x7a')]!==_0x5dd0('0xb3')){if(_0x450c12[_0x5dd0('0x7a')]>0x0){_0x450c12['originated']-=0x1;}else{logger[_0x5dd0('0x9e')](_0x5dd0('0xd4'));}}}else{logger[_0x5dd0('0x9e')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0x5dd0('0x1b')]['loggerHandler']=function(_0x45281c,_0x151b89){var _0x1123aa=this;return function(_0x2b22e0){_0x1123aa[_0x5dd0('0xbb')](_0x151b89);logger['error'](_0x45281c,util[_0x5dd0('0x9c')](_0x2b22e0,{'showHidden':![],'depth':null}));};};Dialer[_0x5dd0('0x1b')]['emptyContact']=function(_0x111ffe,_0x15a7e4,_0x3ec251){var _0x91660c={'state':0x19,'statedesc':_0x5dd0('0xd5')};this[_0x5dd0('0xbb')](_0x15a7e4);this[_0x5dd0('0xd6')](_[_0x5dd0('0xd7')](_0x91660c,_[_0x5dd0('0xd8')](_0x3ec251,[_0x5dd0('0xd9'),'ListId',_0x5dd0('0xda'),'VoiceQueueId',_0x5dd0('0xdb')])),_0x5dd0('0xdc'),_0x5dd0('0xdd'));logger[_0x5dd0('0x9e')](_0x111ffe);};Dialer[_0x5dd0('0x1b')][_0x5dd0('0xde')]=function(_0x2ac467){return _0x2ac467===_0x5dd0('0xdf');};Dialer[_0x5dd0('0x1b')][_0x5dd0('0xe0')]=function(_0x18208a){return!_['isUndefined'](_0x18208a)&&_0x18208a&&!_['isUndefined'](_0x18208a['name'])&&!_['isUndefined'](_0x18208a['active'])&&_0x18208a[_0x5dd0('0x80')]&&(this['trunks'][util[_0x5dd0('0x82')](_0x5dd0('0xe1'),_0x18208a['name'])]['status']==='reachable'||this[_0x5dd0('0xe2')][util[_0x5dd0('0x82')]('SIP/%s',_0x18208a[_0x5dd0('0x48')])][_0x5dd0('0xb7')]===_0x5dd0('0xe3'));};Dialer[_0x5dd0('0x1b')]['saveInDb']=function(_0x1a65ce,_0x95a555,_0x192d6e){this[_0x5dd0('0xe4')](_0x1a65ce)[_0x5dd0('0xb9')](loggerCatch(_0x95a555));this[_0x5dd0('0xd2')](_0x1a65ce)[_0x5dd0('0xb9')](loggerCatch(_0x192d6e));};Dialer[_0x5dd0('0x1b')][_0x5dd0('0x3b')]=function(_0x140186){var _0x539543=this;var _0x2763e6=this['uniqueId'][_0x140186[_0x5dd0('0xe5')]];var _0x57f6e7;if(!_[_0x5dd0('0xb5')](_0x140186)&&!_[_0x5dd0('0xb5')](_0x140186[_0x5dd0('0xe6')])&&!_[_0x5dd0('0xb5')](_0x140186[_0x5dd0('0xe6')][_0x5dd0('0xe7')])&&_0x140186['exten']===_0x5dd0('0xe8')&&_0x2763e6){if(_0x2763e6[_0x5dd0('0x55')]!=='ivr'&&this[_0x5dd0('0x1f')][_0x2763e6['queue']]['dialAMDActive']&&_0x140186['value']===_0x5dd0('0xe9')){delete this[_0x5dd0('0x26')][_0x140186['uniqueid']];this[_0x5dd0('0xbb')](this['voiceQueues'][_0x2763e6[_0x5dd0('0xbc')]]);this['voiceQueues'][_0x2763e6[_0x5dd0('0xbc')]]['outboundAnswerCallsDay']+=0x1;this[_0x5dd0('0x1f')][_0x2763e6[_0x5dd0('0xbc')]][_0x5dd0('0x67')]+=0x1;_0x57f6e7=new Hangup(_0x2763e6,_0x140186);_0x57f6e7['state']=0x12;_0x57f6e7[_0x5dd0('0xea')]='HangupInAMD';_0x57f6e7[_0x5dd0('0xeb')]=_0x5dd0('0xec');ami['emit'](_0x5dd0('0xed'),ut['buildObj'](_0x57f6e7,'amd'));this[_0x5dd0('0xd6')](_0x57f6e7,_0x5dd0('0xee'),'[syncHangupInAMD]');}if(_0x2763e6[_0x5dd0('0x55')]!==_0x5dd0('0x85')&&this[_0x5dd0('0x1f')][_0x2763e6[_0x5dd0('0xbc')]][_0x5dd0('0xef')]&&_0x140186[_0x5dd0('0xf0')]==='MACHINE'){return new Promise(function(_0xac5b00,_0x25abb3){delete _0x539543['uniqueId'][_0x140186['uniqueid']];_0x539543[_0x5dd0('0xbb')](_0x539543[_0x5dd0('0x1f')][_0x2763e6[_0x5dd0('0xbc')]]);_0x539543[_0x5dd0('0x1f')][_0x2763e6['queue']][_0x5dd0('0x68')]+=0x1;_0x539543[_0x5dd0('0x1f')][_0x2763e6['queue']][_0x5dd0('0x67')]+=0x1;var _0x22db6f=_0x539543[_0x5dd0('0x1f')][_0x2763e6[_0x5dd0('0xbc')]];var _0x210a86=new Hangup(_0x2763e6,_0x140186);_0x210a86['state']=0x13;_0x210a86[_0x5dd0('0xea')]='Machine';_0x210a86[_0x5dd0('0xeb')]=_0x5dd0('0xec');_0x210a86[_0x5dd0('0xf1')]+=0x1;_0x210a86['countglobal']+=0x1;_0x210a86[_0x5dd0('0xf2')]=!![];ami[_0x5dd0('0x54')](_0x5dd0('0xed'),ut[_0x5dd0('0xf3')](_0x210a86,_0x5dd0('0xf2')));_0x539543[_0x5dd0('0xe4')](_0x210a86)[_0x5dd0('0xb9')](loggerCatch(_0x5dd0('0xf4')));if(_0x210a86[_0x5dd0('0xf5')]+_0x210a86[_0x5dd0('0xf6')]+_0x210a86[_0x5dd0('0xf7')]+_0x210a86['countnosuchnumberretry']+_0x210a86[_0x5dd0('0xf8')]+_0x210a86[_0x5dd0('0xf9')]+_0x210a86[_0x5dd0('0xf1')]+_0x210a86[_0x5dd0('0xfa')]>=_0x22db6f['dialGlobalMaxRetry']){_0x539543[_0x5dd0('0xfb')](_0x210a86,_0xac5b00,_0x25abb3,_0x5dd0('0xfc'));}else{if(_0x210a86['countmachineretry']>=_0x22db6f[_0x5dd0('0xfd')]){_0x539543[_0x5dd0('0xfe')](_0x210a86,_0xac5b00,_0x25abb3,_0x5dd0('0xff'));}else{_0x539543['rescheduleContact']({'active':![],'countmachineretry':_0x210a86[_0x5dd0('0xf1')],'scheduledat':moment()[_0x5dd0('0x100')](_0x22db6f[_0x5dd0('0x101')],_0x5dd0('0x102'))[_0x5dd0('0x82')](_0x5dd0('0x103')),'ContactId':_0x210a86[_0x5dd0('0xd9')],'ListId':_0x210a86['ListId'],'VoiceQueueId':_0x210a86[_0x5dd0('0x104')]||undefined,'CampaignId':_0x210a86[_0x5dd0('0xdb')]||undefined})[_0x5dd0('0xb9')](loggerCatch(_0x5dd0('0x105')));_0xac5b00({'reschedule':0x1});}}});}if(_0x2763e6[_0x5dd0('0x55')]===_0x5dd0('0x85')&&this[_0x5dd0('0x20')][_0x2763e6['queue']][_0x5dd0('0xef')]&&_0x140186[_0x5dd0('0xf0')]===_0x5dd0('0xe9')){delete this[_0x5dd0('0x26')][_0x140186[_0x5dd0('0xe5')]];this[_0x5dd0('0xbb')](this[_0x5dd0('0x20')][_0x2763e6[_0x5dd0('0xbc')]]);_0x57f6e7=new Hangup(_0x2763e6,_0x140186);_0x57f6e7[_0x5dd0('0xaf')]=0x12;_0x57f6e7[_0x5dd0('0xea')]=_0x5dd0('0x106');_0x57f6e7['membername']=_0x5dd0('0xec');ami['emit'](_0x5dd0('0xed'),ut[_0x5dd0('0xf3')](_0x57f6e7,_0x5dd0('0xf2')));this['saveInDb'](_0x57f6e7,_0x5dd0('0x107'),'[syncHangupInAMDIvr]');}if(_0x2763e6['type']===_0x5dd0('0x85')&&this[_0x5dd0('0x20')][_0x2763e6[_0x5dd0('0xbc')]][_0x5dd0('0xef')]&&_0x140186[_0x5dd0('0xf0')]===_0x5dd0('0x108')){return new Promise(function(_0x5ebe38,_0x36c8d1){delete _0x539543[_0x5dd0('0x26')][_0x140186[_0x5dd0('0xe5')]];_0x539543[_0x5dd0('0xbb')](_0x539543[_0x5dd0('0x20')][_0x2763e6[_0x5dd0('0xbc')]]);_0x539543[_0x5dd0('0x20')][_0x2763e6[_0x5dd0('0xbc')]][_0x5dd0('0x68')]+=0x1;_0x539543['campaigns'][_0x2763e6[_0x5dd0('0xbc')]][_0x5dd0('0x67')]+=0x1;var _0x1691b9=_0x539543[_0x5dd0('0x20')][_0x2763e6[_0x5dd0('0xbc')]];var _0x43ddc9=new Hangup(_0x2763e6,_0x140186);_0x43ddc9[_0x5dd0('0xaf')]=0x13;_0x43ddc9['statedesc']=_0x5dd0('0x109');_0x43ddc9[_0x5dd0('0xeb')]=_0x5dd0('0xec');_0x43ddc9[_0x5dd0('0xf1')]+=0x1;_0x43ddc9[_0x5dd0('0x10a')]+=0x1;_0x43ddc9[_0x5dd0('0xf2')]=!![];ami['emit'](_0x5dd0('0xed'),ut['buildObj'](_0x43ddc9,_0x5dd0('0xf2')));_0x539543[_0x5dd0('0xe4')](_0x43ddc9)['catch'](loggerCatch(_0x5dd0('0xf4')));if(_0x43ddc9[_0x5dd0('0xf5')]+_0x43ddc9['countcongestionretry']+_0x43ddc9[_0x5dd0('0xf7')]+_0x43ddc9[_0x5dd0('0x10b')]+_0x43ddc9[_0x5dd0('0xf8')]+_0x43ddc9[_0x5dd0('0xf9')]+_0x43ddc9[_0x5dd0('0xf1')]+_0x43ddc9[_0x5dd0('0xfa')]>=_0x1691b9[_0x5dd0('0x10c')]){_0x539543[_0x5dd0('0xfb')](_0x43ddc9,_0x5ebe38,_0x36c8d1,_0x5dd0('0xfc'));}else{if(_0x43ddc9[_0x5dd0('0xf1')]>=_0x1691b9[_0x5dd0('0xfd')]){_0x539543[_0x5dd0('0xfe')](_0x43ddc9,_0x5ebe38,_0x36c8d1,_0x5dd0('0xff'));}else{_0x539543[_0x5dd0('0xc9')]({'active':![],'countmachineretry':_0x43ddc9[_0x5dd0('0xf1')],'scheduledat':moment()[_0x5dd0('0x100')](_0x1691b9['dialMachineRetryFrequency'],'minutes')['format'](_0x5dd0('0x103')),'ContactId':_0x43ddc9[_0x5dd0('0xd9')],'ListId':_0x43ddc9['ListId'],'VoiceQueueId':_0x43ddc9[_0x5dd0('0x104')]||undefined,'CampaignId':_0x43ddc9['CampaignId']||undefined})[_0x5dd0('0xb9')](loggerCatch(_0x5dd0('0x105')));_0x5ebe38({'reschedule':0x1});}}});}}};Dialer[_0x5dd0('0x1b')][_0x5dd0('0x37')]=function(_0xf9f7fb){var _0x58c586=this[_0x5dd0('0x26')][_0xf9f7fb['uniqueid']];var _0x31e602;if(_0x58c586&&_0x58c586[_0x5dd0('0x55')]===_0x5dd0('0x85')){delete this[_0x5dd0('0x26')][_0xf9f7fb[_0x5dd0('0xe5')]];this[_0x5dd0('0xbb')](this[_0x5dd0('0x20')][_0x58c586[_0x5dd0('0xbc')]]);this['campaigns'][_0x58c586[_0x5dd0('0xbc')]][_0x5dd0('0x10d')]+=0x1;_0x31e602=new Hangup(_0x58c586,_0xf9f7fb);this['createHistory'](_0x31e602)[_0x5dd0('0xb9')](loggerCatch(_0x5dd0('0x10e')));this[_0x5dd0('0xd2')](_0x31e602)[_0x5dd0('0xb9')](loggerCatch('[syncHangupIvr]'));}if(_0x58c586&&_0x58c586[_0x5dd0('0x55')]!==_0x5dd0('0x85')&&isNotNull(this['voiceQueues'][_0x58c586['queue']][_0x5dd0('0x10f')])){delete this[_0x5dd0('0x26')][_0xf9f7fb['uniqueid']];this[_0x5dd0('0xbb')](this[_0x5dd0('0x1f')][_0x58c586[_0x5dd0('0xbc')]]);this['voiceQueues'][_0x58c586['queue']][_0x5dd0('0x68')]+=0x1;this[_0x5dd0('0x1f')][_0x58c586['queue']][_0x5dd0('0x67')]+=0x1;_0x31e602=new Hangup(_0x58c586,_0xf9f7fb);_0x31e602[_0x5dd0('0xaf')]=0x10;_0x31e602[_0x5dd0('0xea')]='AnswerAGI';_0x31e602[_0x5dd0('0xeb')]=_0x5dd0('0x110');this[_0x5dd0('0xe4')](_0x31e602)[_0x5dd0('0xb9')](loggerCatch('[syncHangupIvr][createHistory]'));this['moveContactManagedDialer'](_0x31e602)[_0x5dd0('0xb9')](loggerCatch(_0x5dd0('0x111')));}if(_0x58c586&&_0x58c586[_0x5dd0('0x55')]!=='ivr'&&!isNotNull(this['voiceQueues'][_0x58c586[_0x5dd0('0xbc')]][_0x5dd0('0x10f')])){delete this['uniqueId'][_0xf9f7fb[_0x5dd0('0xe5')]];this['updateOriginated'](this[_0x5dd0('0x1f')][_0x58c586[_0x5dd0('0xbc')]]);this[_0x5dd0('0x1f')][_0x58c586[_0x5dd0('0xbc')]]['outboundUnknownCallsDay']+=0x1;_0x31e602=new Hangup(_0x58c586,_0xf9f7fb);_0x31e602[_0x5dd0('0xaf')]=0xc;_0x31e602[_0x5dd0('0xea')]=_0xf9f7fb['cause-txt'];_0x31e602['membername']=_0x5dd0('0x112');this['createHistory'](_0x31e602)[_0x5dd0('0xb9')](loggerCatch(_0x5dd0('0x10e')));this['moveContactManagedDialer'](_0x31e602)['catch'](loggerCatch(_0x5dd0('0x111')));}};Dialer['prototype'][_0x5dd0('0x32')]=function(_0x556ed3){var _0x49880d=this['uniqueId'][_0x556ed3[_0x5dd0('0xe5')]];if(this['voiceQueues'][_0x556ed3[_0x5dd0('0xbc')]]){if(_0x49880d&&_0x49880d[_0x5dd0('0x55')]!=='ivr'){delete this[_0x5dd0('0x26')][_0x556ed3[_0x5dd0('0xe5')]];this[_0x5dd0('0x1f')][_0x556ed3[_0x5dd0('0xbc')]][_0x5dd0('0x68')]+=0x1;var _0x4bc319=new AgentComplete(_0x49880d,_0x556ed3);if(_0x556ed3[_0x5dd0('0x113')]===_0x5dd0('0x114')){_0x4bc319[_0x5dd0('0x115')]=this[_0x5dd0('0x1f')][_0x556ed3['queue']][_0x5dd0('0x116')]&&this[_0x5dd0('0x1f')][_0x556ed3[_0x5dd0('0xbc')]]['dialAgiAfterHangupAgent']?moment()[_0x5dd0('0x82')](_0x5dd0('0x103')):undefined;}this[_0x5dd0('0xe4')](_0x4bc319)[_0x5dd0('0xb9')](loggerCatch(_0x5dd0('0x117')));this['moveContactManagedDialer'](_0x4bc319)[_0x5dd0('0xb9')](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0x5dd0('0x1b')][_0x5dd0('0x2c')]=function(_0x5e1048){if(this['voiceQueues'][_0x5e1048[_0x5dd0('0xbc')]]){if(this['uniqueId'][_0x5e1048[_0x5dd0('0xe5')]]&&this[_0x5dd0('0x26')][_0x5e1048[_0x5dd0('0xe5')]][_0x5dd0('0x55')]!==_0x5dd0('0x85')){this[_0x5dd0('0xbb')](this[_0x5dd0('0x1f')][_0x5e1048[_0x5dd0('0xbc')]]);this[_0x5dd0('0x26')][_0x5e1048['uniqueid']][_0x5dd0('0x118')]=moment()['format'](_0x5dd0('0x103'));}}};Dialer[_0x5dd0('0x1b')][_0x5dd0('0x119')]=function(_0x53e708,_0x4befa7){this[_0x5dd0('0xe4')](_0x53e708)[_0x5dd0('0xb9')](loggerCatch(_0x5dd0('0x117')));if(_0x4befa7==0x0){this[_0x5dd0('0xd2')](_0x53e708)[_0x5dd0('0xb9')](loggerCatch(_0x5dd0('0x11a')));}};Dialer[_0x5dd0('0x1b')][_0x5dd0('0x2f')]=function(_0x296565){var _0x1f3ab6=this['uniqueId'][_0x296565[_0x5dd0('0xe5')]];var _0xe92fd2=this;var _0x187a5b=![];var _0x1470b2;var _0x5b79de;if(this['voiceQueues'][_0x296565['queue']]){if(_0x1f3ab6&&_0x1f3ab6[_0x5dd0('0x55')]!==_0x5dd0('0x85')){delete this[_0x5dd0('0x26')][_0x296565['uniqueid']];this['updateOriginated'](this[_0x5dd0('0x1f')][_0x296565[_0x5dd0('0xbc')]]);_0x1f3ab6[_0x5dd0('0x11b')]=moment()[_0x5dd0('0x82')](_0x5dd0('0x103'));var _0x130df9=new QueueCallerAbandon(_0x1f3ab6,_0x296565);if(getSeconds(_0x1f3ab6[_0x5dd0('0x11b')],_0x1f3ab6[_0x5dd0('0x11c')])>=_0x1f3ab6[_0x5dd0('0x11d')]){this[_0x5dd0('0x1f')][_0x296565[_0x5dd0('0xbc')]][_0x5dd0('0x74')]+=0x1;this[_0x5dd0('0x1f')][_0x296565[_0x5dd0('0xbc')]][_0x5dd0('0x6c')]+=0x1;this[_0x5dd0('0x1f')][_0x296565[_0x5dd0('0xbc')]][_0x5dd0('0x11e')]+=0x1;_0x130df9[_0x5dd0('0xaf')]=0xa;_0x130df9[_0x5dd0('0xea')]='Drop';_0x130df9[_0x5dd0('0x11f')]=_0x5dd0('0x120');_0x130df9[_0x5dd0('0x115')]=this[_0x5dd0('0x1f')][_0x296565[_0x5dd0('0xbc')]]['dialQueueProject2']?moment()[_0x5dd0('0x82')](_0x5dd0('0x103')):undefined;_0x130df9[_0x5dd0('0xf8')]+=0x1;_0x130df9['countglobal']+=0x1;_0x1470b2=this[_0x5dd0('0x1f')][_0x296565[_0x5dd0('0xbc')]][_0x5dd0('0x121')];_0x5b79de=this[_0x5dd0('0x1f')][_0x296565[_0x5dd0('0xbc')]][_0x5dd0('0x122')];_0xe92fd2[_0x5dd0('0xc2')](_0x130df9,_0x130df9['state'],_0x1f3ab6[_0x5dd0('0x123')])['then'](function(_0x2f9721){_0x187a5b=_0x2f9721[_0x5dd0('0x124')]==0x1;if(_0x130df9[_0x5dd0('0xf8')]>=_0xe92fd2[_0x5dd0('0x1f')][_0x296565[_0x5dd0('0xbc')]][_0x5dd0('0x125')]){_0xe92fd2[_0x5dd0('0x119')](_0x130df9,_0x2f9721['additional']);}else{_0xe92fd2[_0x5dd0('0xc9')]({'active':![],'countdropretry':_0x130df9[_0x5dd0('0xf8')],'scheduledat':moment()[_0x5dd0('0x100')](_0xe92fd2[_0x5dd0('0x1f')][_0x296565[_0x5dd0('0xbc')]][_0x5dd0('0x121')],_0x5dd0('0x102'))[_0x5dd0('0x82')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1f3ab6['ContactId'],'ListId':_0x1f3ab6[_0x5dd0('0x126')],'VoiceQueueId':_0x1f3ab6['VoiceQueueId']||undefined,'CampaignId':_0x1f3ab6[_0x5dd0('0xdb')]||undefined})[_0x5dd0('0xb9')](loggerCatch(_0x5dd0('0x127')));var _0x5554c7=new History(_0x130df9);_0x5554c7[_0x5dd0('0xaf')]=0xa;_0x5554c7[_0x5dd0('0xea')]=_0x5dd0('0x128');_0x5554c7[_0x5dd0('0xb0')]=moment()[_0x5dd0('0x82')](_0x5dd0('0x103'));_0x5554c7[_0x5dd0('0x129')]=_0x5554c7[_0x5dd0('0xb0')];_0x5554c7[_0x5dd0('0x12a')]=_0x130df9['calleridname'];_0x5554c7[_0x5dd0('0x12b')]=_0x130df9['calleridnum'];_0xe92fd2[_0x5dd0('0xe4')](_0x5554c7)['catch'](loggerCatch('[syncAgentComplete][createHistory][10]'));}})['then'](function(){if(_0x187a5b)_0xe92fd2[_0x5dd0('0xc4')](_0x130df9,_0x1470b2,_0x5b79de)[_0x5dd0('0x43')](function(){return 0x1;});});}else{this[_0x5dd0('0x1f')][_0x296565['queue']][_0x5dd0('0x73')]+=0x1;this[_0x5dd0('0x1f')][_0x296565['queue']][_0x5dd0('0x12c')]+=0x1;_0x130df9[_0x5dd0('0xaf')]=0xb;_0x130df9[_0x5dd0('0xea')]='Abandoned';_0x130df9['dropreason']=_0x5dd0('0x12d');_0x130df9['countabandonedretry']+=0x1;_0x130df9[_0x5dd0('0x10a')]+=0x1;_0x1470b2=this[_0x5dd0('0x1f')][_0x296565[_0x5dd0('0xbc')]][_0x5dd0('0x12e')];_0x5b79de=this[_0x5dd0('0x1f')][_0x296565[_0x5dd0('0xbc')]]['callAdditionalPhoneAfterMin'];_0xe92fd2[_0x5dd0('0xc2')](_0x130df9,_0x130df9[_0x5dd0('0xaf')],_0x1f3ab6['voiceQueue'])['then'](function(_0x37ed08){if(_0x130df9[_0x5dd0('0xf9')]>=_0xe92fd2[_0x5dd0('0x1f')][_0x296565[_0x5dd0('0xbc')]][_0x5dd0('0x12f')]){_0xe92fd2['queueCallerAbandonCreateState'](_0x130df9,_0x37ed08['additional']);}else{_0xe92fd2[_0x5dd0('0xc9')]({'active':![],'countabandonedretry':_0x130df9[_0x5dd0('0xf9')],'scheduledat':moment()[_0x5dd0('0x100')](_0xe92fd2[_0x5dd0('0x1f')][_0x296565['queue']][_0x5dd0('0x12e')],_0x5dd0('0x102'))[_0x5dd0('0x82')](_0x5dd0('0x103')),'ContactId':_0x1f3ab6[_0x5dd0('0xd9')],'ListId':_0x1f3ab6['ListId'],'VoiceQueueId':_0x1f3ab6[_0x5dd0('0x104')]||undefined,'CampaignId':_0x1f3ab6[_0x5dd0('0xdb')]||undefined})[_0x5dd0('0xb9')](loggerCatch(_0x5dd0('0x130')));var _0x56ba97=new History(_0x130df9);_0x56ba97['state']=0xb;_0x56ba97['statedesc']=_0x5dd0('0x131');_0x56ba97['starttime']=moment()[_0x5dd0('0x82')](_0x5dd0('0x103'));_0x56ba97[_0x5dd0('0x129')]=_0x56ba97['starttime'];_0x56ba97[_0x5dd0('0x12a')]=_0x130df9[_0x5dd0('0x12a')];_0x56ba97[_0x5dd0('0x12b')]=_0x130df9[_0x5dd0('0x12b')];_0xe92fd2[_0x5dd0('0xe4')](_0x56ba97)[_0x5dd0('0xb9')](loggerCatch(_0x5dd0('0x132')));}})[_0x5dd0('0x43')](function(){if(_0x187a5b)_0xe92fd2[_0x5dd0('0xc4')](_0x130df9,_0x1470b2,_0x5b79de)[_0x5dd0('0x43')](function(){return 0x1;});});}}}};Dialer['prototype']['syncNewExten']=function(_0x288a5a){if(this[_0x5dd0('0x24')][_0x288a5a[_0x5dd0('0xe5')]]){this[_0x5dd0('0x24')][_0x288a5a[_0x5dd0('0xe5')]][_0x5dd0('0xb8')]=_0x288a5a[_0x5dd0('0xb8')];}if(this['uniqueId'][_0x288a5a[_0x5dd0('0xe5')]]){this['uniqueId'][_0x288a5a[_0x5dd0('0xe5')]][_0x5dd0('0xb8')]=_0x288a5a['channel'];}};Dialer[_0x5dd0('0x1b')]['syncQueueMember']=function(_0x2d303a){if(strategy[this['voiceQueues'][this[_0x5dd0('0x24')][_0x2d303a[_0x5dd0('0x133')]][_0x5dd0('0xbc')]][_0x5dd0('0x134')]]==='roundrobin'){if(this[_0x5dd0('0x24')][_0x2d303a[_0x5dd0('0x133')]]&&_[_0x5dd0('0xb5')](this[_0x5dd0('0x24')][_0x2d303a[_0x5dd0('0x133')]][_0x5dd0('0x135')])&&_0x2d303a[_0x5dd0('0xb7')]==='1'&&_0x2d303a[_0x5dd0('0x136')]==='0'){if(this[_0x5dd0('0x21')][_0x2d303a[_0x5dd0('0x137')]]){if(!this[_0x5dd0('0x21')][_0x2d303a[_0x5dd0('0x137')]][_0x5dd0('0x135')]){this['agents'][_0x2d303a['stateinterface']]['locked']=!![];this[_0x5dd0('0x24')][_0x2d303a[_0x5dd0('0x133')]][_0x5dd0('0x135')]=!![];this['actions'][_0x2d303a['actionid']][_0x5dd0('0x137')]=_0x2d303a[_0x5dd0('0x137')];}}}}else if((strategy[this[_0x5dd0('0x1f')][this[_0x5dd0('0x24')][_0x2d303a[_0x5dd0('0x133')]][_0x5dd0('0xbc')]][_0x5dd0('0x134')]]||'rrmemory')===_0x5dd0('0x19')){if(this[_0x5dd0('0x24')][_0x2d303a[_0x5dd0('0x133')]]){if(this[_0x5dd0('0x21')][_0x2d303a[_0x5dd0('0x137')]]){this[_0x5dd0('0x24')][_0x2d303a[_0x5dd0('0x133')]]['stateinterface']=_0x2d303a[_0x5dd0('0x137')];if(_[_0x5dd0('0xb5')](this[_0x5dd0('0x138')][this[_0x5dd0('0x24')][_0x2d303a[_0x5dd0('0x133')]][_0x5dd0('0xbc')]])){this[_0x5dd0('0x138')][this[_0x5dd0('0x24')][_0x2d303a[_0x5dd0('0x133')]]['queue']]=[];}this[_0x5dd0('0x138')][this[_0x5dd0('0x24')][_0x2d303a[_0x5dd0('0x133')]][_0x5dd0('0xbc')]]['push'](_['merge'](_[_0x5dd0('0xd8')](this[_0x5dd0('0x24')][_0x2d303a[_0x5dd0('0x133')]],[_0x5dd0('0x139'),_0x5dd0('0x137')]),{'status':_0x2d303a[_0x5dd0('0xb7')],'paused':_0x2d303a[_0x5dd0('0x136')]}));}}}};function unlockQueueStatus(_0x502dc8,_0xf676b3){setTimeout(function(){if(_[_0x5dd0('0x44')](_0x502dc8[_0x5dd0('0x13a')])){loggerBooked[_0x5dd0('0x9e')]('[unlockQueueStatus][undefined]',_0xf676b3);}_0x502dc8[_0x5dd0('0x13a')]=!![];loggerBooked[_0x5dd0('0x86')](_0x5dd0('0x13b'),_0xf676b3,JSON[_0x5dd0('0x50')](_[_0x5dd0('0xd8')](_0x502dc8,[_0x5dd0('0x48'),_0x5dd0('0x13a')])));},0x1f3);}Dialer[_0x5dd0('0x1b')][_0x5dd0('0x3f')]=function(_0x20ab24){var _0x314d9f=this;var _0x2966e8=_0x314d9f['voiceQueues'][_0x314d9f['actions'][_0x20ab24['actionid']]['queue']];if(strategy[this[_0x5dd0('0x1f')][this[_0x5dd0('0x24')][_0x20ab24['actionid']][_0x5dd0('0xbc')]][_0x5dd0('0x134')]]===_0x5dd0('0x1a')){if(this[_0x5dd0('0x24')][_0x20ab24['actionid']]&&this[_0x5dd0('0x24')][_0x20ab24[_0x5dd0('0x133')]][_0x5dd0('0x137')]){this['preview'][_0x5dd0('0x13c')](this[_0x5dd0('0x24')][_0x20ab24[_0x5dd0('0x133')]]['idHopper'],this[_0x5dd0('0x24')][_0x20ab24[_0x5dd0('0x133')]][_0x5dd0('0x137')])[_0x5dd0('0xb9')](function(_0x3013e7){logger['error']('[Catch][Preview][syncQueueStatusComplete]',util[_0x5dd0('0x9c')](_0x3013e7,{'showHidden':![],'depth':null}));})[_0x5dd0('0x1d')](function(){_0x314d9f[_0x5dd0('0xbb')](_0x314d9f[_0x5dd0('0x1f')][_0x314d9f[_0x5dd0('0x24')][_0x20ab24[_0x5dd0('0x133')]][_0x5dd0('0xbc')]]);_0x314d9f[_0x5dd0('0x21')][_0x314d9f[_0x5dd0('0x24')][_0x20ab24[_0x5dd0('0x133')]][_0x5dd0('0x137')]][_0x5dd0('0x135')]=![];delete _0x314d9f[_0x5dd0('0x24')][_0x20ab24[_0x5dd0('0x133')]];unlockQueueStatus(_0x2966e8);});}else{this[_0x5dd0('0xbb')](this['voiceQueues'][this[_0x5dd0('0x24')][_0x20ab24[_0x5dd0('0x133')]][_0x5dd0('0xbc')]]);this[_0x5dd0('0xc9')]({'active':![],'ContactId':this[_0x5dd0('0x24')][_0x20ab24[_0x5dd0('0x133')]][_0x5dd0('0xd9')],'ListId':this[_0x5dd0('0x24')][_0x20ab24[_0x5dd0('0x133')]][_0x5dd0('0x126')],'VoiceQueueId':this['actions'][_0x20ab24[_0x5dd0('0x133')]][_0x5dd0('0x104')]||undefined,'CampaignId':this[_0x5dd0('0x24')][_0x20ab24['actionid']][_0x5dd0('0xdb')]||undefined})[_0x5dd0('0xb9')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this['actions'][_0x20ab24[_0x5dd0('0x133')]];unlockQueueStatus(_0x2966e8);}}else if((strategy[this['voiceQueues'][this[_0x5dd0('0x24')][_0x20ab24[_0x5dd0('0x133')]]['queue']][_0x5dd0('0x134')]]||_0x5dd0('0x19'))===_0x5dd0('0x19')){var _0xe29855;if(this[_0x5dd0('0x24')][_0x20ab24['actionid']]&&!_[_0x5dd0('0x4d')](this[_0x5dd0('0x138')][this[_0x5dd0('0x24')][_0x20ab24[_0x5dd0('0x133')]]['queue']])){if(this[_0x5dd0('0x2a')][_0x314d9f[_0x5dd0('0x24')][_0x20ab24[_0x5dd0('0x133')]][_0x5dd0('0xbc')]]){this[_0x5dd0('0x2a')][_0x314d9f['actions'][_0x20ab24[_0x5dd0('0x133')]][_0x5dd0('0xbc')]]=this[_0x5dd0('0x2a')][this[_0x5dd0('0x24')][_0x20ab24[_0x5dd0('0x133')]][_0x5dd0('0xbc')]]?this[_0x5dd0('0x2a')][this['actions'][_0x20ab24[_0x5dd0('0x133')]][_0x5dd0('0xbc')]]:this['queueBooked'][this[_0x5dd0('0x24')][_0x20ab24[_0x5dd0('0x133')]]['queue']]?this[_0x5dd0('0x138')][this[_0x5dd0('0x24')][_0x20ab24[_0x5dd0('0x133')]][_0x5dd0('0xbc')]][_0x5dd0('0x13d')]||0x0:0x0;}this['queueBooked'][this[_0x5dd0('0x24')][_0x20ab24[_0x5dd0('0x133')]][_0x5dd0('0xbc')]]['_rr']=this[_0x5dd0('0x2a')][this[_0x5dd0('0x24')][_0x20ab24[_0x5dd0('0x133')]][_0x5dd0('0xbc')]];for(var _0x5088d9=0x0;_0x5088d9<this['queueBooked'][this[_0x5dd0('0x24')][_0x20ab24['actionid']][_0x5dd0('0xbc')]][_0x5dd0('0x9f')];_0x5088d9+=0x1){_0xe29855=rr(this[_0x5dd0('0x138')][this[_0x5dd0('0x24')][_0x20ab24[_0x5dd0('0x133')]][_0x5dd0('0xbc')]]);this['queueBookedRR'][_0x314d9f['actions'][_0x20ab24[_0x5dd0('0x133')]][_0x5dd0('0xbc')]]=this[_0x5dd0('0x138')][this[_0x5dd0('0x24')][_0x20ab24[_0x5dd0('0x133')]][_0x5dd0('0xbc')]][_0x5dd0('0x13d')];if(_0xe29855[_0x5dd0('0xb7')]==='1'&&_0xe29855[_0x5dd0('0x136')]==='0'){break;}}if(!_[_0x5dd0('0xb5')](_0xe29855)){this['agents'][_0xe29855[_0x5dd0('0x137')]][_0x5dd0('0x13e')]=_[_0x5dd0('0x44')](this[_0x5dd0('0x21')][_0xe29855[_0x5dd0('0x137')]][_0x5dd0('0x13e')])?!![]:this['agents'][_0xe29855['stateinterface']][_0x5dd0('0x13e')];}loggerBooked[_0x5dd0('0x86')](_0x5dd0('0x13f'),_0x20ab24['actionid'],_0x5dd0('0x140'),JSON['stringify'](_[_0x5dd0('0xd8')](this[_0x5dd0('0x21')][_0xe29855['stateinterface']],[_0x5dd0('0x48'),'unlockRR'])),_0x5dd0('0x141'),JSON[_0x5dd0('0x50')](_0xe29855[_0x5dd0('0x139')]));if(!_['isNil'](_0xe29855)&&_0xe29855[_0x5dd0('0xb7')]==='1'&&_0xe29855[_0x5dd0('0x136')]==='0'&&this[_0x5dd0('0x21')][_0xe29855[_0x5dd0('0x137')]]['unlockRR']){this[_0x5dd0('0x21')][_0xe29855[_0x5dd0('0x137')]][_0x5dd0('0x13e')]=![];this[_0x5dd0('0x138')][_0x314d9f[_0x5dd0('0x24')][_0x20ab24['actionid']]['queue']]=[];this['preview'][_0x5dd0('0x13c')](_0xe29855[_0x5dd0('0x139')],_0xe29855[_0x5dd0('0x137')])['catch'](function(_0x595f32){logger['error'](_0x5dd0('0x142'),util[_0x5dd0('0x9c')](_0x595f32,{'showHidden':![],'depth':null}));})[_0x5dd0('0x1d')](function(){_0x314d9f[_0x5dd0('0xbb')](_0x314d9f['voiceQueues'][_0x314d9f[_0x5dd0('0x24')][_0x20ab24['actionid']][_0x5dd0('0xbc')]]);setTimeout(function(){_0x314d9f[_0x5dd0('0x21')][_0xe29855[_0x5dd0('0x137')]][_0x5dd0('0x13e')]=!![];loggerBooked[_0x5dd0('0x86')](_0x5dd0('0x143'),_0x20ab24[_0x5dd0('0x133')],_0x5dd0('0x140'),JSON[_0x5dd0('0x50')](_[_0x5dd0('0xd8')](_0x314d9f[_0x5dd0('0x21')][_0xe29855[_0x5dd0('0x137')]],['name','unlockRR'])),_0x5dd0('0x141'),JSON[_0x5dd0('0x50')](_0xe29855[_0x5dd0('0x139')]));},0xc7);delete _0x314d9f[_0x5dd0('0x24')][_0x20ab24[_0x5dd0('0x133')]];unlockQueueStatus(_0x2966e8,_0x20ab24[_0x5dd0('0x133')]);});}else{loggerBooked[_0x5dd0('0x86')](_0x5dd0('0x144'));this[_0x5dd0('0xbb')](this[_0x5dd0('0x1f')][this['actions'][_0x20ab24[_0x5dd0('0x133')]][_0x5dd0('0xbc')]]);this[_0x5dd0('0xc9')]({'active':![],'ContactId':this[_0x5dd0('0x24')][_0x20ab24[_0x5dd0('0x133')]][_0x5dd0('0xd9')],'ListId':this['actions'][_0x20ab24[_0x5dd0('0x133')]][_0x5dd0('0x126')],'VoiceQueueId':this[_0x5dd0('0x24')][_0x20ab24['actionid']][_0x5dd0('0x104')]||undefined,'CampaignId':this['actions'][_0x20ab24['actionid']][_0x5dd0('0xdb')]||undefined})[_0x5dd0('0xb9')](loggerCatch(_0x5dd0('0x145')));delete this[_0x5dd0('0x24')][_0x20ab24['actionid']];unlockQueueStatus(_0x2966e8);}}else{loggerBooked['info']('[booked][unlock2]');this[_0x5dd0('0xbb')](this[_0x5dd0('0x1f')][this[_0x5dd0('0x24')][_0x20ab24[_0x5dd0('0x133')]]['queue']]);this[_0x5dd0('0xc9')]({'active':![],'ContactId':this[_0x5dd0('0x24')][_0x20ab24[_0x5dd0('0x133')]][_0x5dd0('0xd9')],'ListId':this['actions'][_0x20ab24['actionid']][_0x5dd0('0x126')],'VoiceQueueId':this['actions'][_0x20ab24[_0x5dd0('0x133')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x5dd0('0x24')][_0x20ab24[_0x5dd0('0x133')]]['CampaignId']||undefined})[_0x5dd0('0xb9')](loggerCatch('[unlock2][syncQueueStatusComplete]'));delete this[_0x5dd0('0x24')][_0x20ab24['actionid']];unlockQueueStatus(_0x2966e8);}}else{loggerBooked['info'](_0x5dd0('0x146'));this['updateOriginated'](this['voiceQueues'][this[_0x5dd0('0x24')][_0x20ab24['actionid']][_0x5dd0('0xbc')]]);this[_0x5dd0('0xc9')]({'active':![],'ContactId':this['actions'][_0x20ab24['actionid']][_0x5dd0('0xd9')],'ListId':this[_0x5dd0('0x24')][_0x20ab24['actionid']][_0x5dd0('0x126')],'VoiceQueueId':this['actions'][_0x20ab24[_0x5dd0('0x133')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x5dd0('0x24')][_0x20ab24[_0x5dd0('0x133')]][_0x5dd0('0xdb')]||undefined})[_0x5dd0('0xb9')](loggerCatch(_0x5dd0('0x147')));delete this[_0x5dd0('0x24')][_0x20ab24[_0x5dd0('0x133')]];unlockQueueStatus(_0x2966e8);}};Dialer[_0x5dd0('0x1b')]['loopCampaigns']=function(){var _0x408937=this;return cmHopper[_0x5dd0('0x148')]({'active':![]},{'where':{'active':!![]}})[_0x5dd0('0x43')](function(){setInterval(function(){_0x408937['syncCampaigns']();},0x3e8);});};Dialer['prototype'][_0x5dd0('0x149')]=function(_0x540878){var _0x1f7d82=this;return function(){if(!_0x1f7d82[_0x5dd0('0xe0')](_0x540878['Trunk'])){if(!_0x1f7d82['isTrunkReachable'](_0x540878[_0x5dd0('0x14a')])){_0x540878[_0x5dd0('0x45')]='TRUNK_IS_NOT_REACHABLE';throw _0x540878[_0x5dd0('0x48')]+'\x20trunk\x20is\x20not\x20reachable';}}};};Dialer['prototype'][_0x5dd0('0x14b')]=function(_0x2e4a9d,_0x4a942a,_0x2fa8b1,_0x56c93f){var _0x34ba55=this;return function(){var _0x439959=!![];return _0x34ba55['ifTime'](_0x2e4a9d,_0x4a942a,_0x2fa8b1,_0x56c93f,_0x439959);};};Dialer[_0x5dd0('0x1b')]['checkIfTimeIntervals']=function(_0x2c6dac,_0x4f55f4,_0x757f4b,_0x45acfe){var _0xc26ccf=this;return function(){var _0x1c5562=![];return _0xc26ccf[_0x5dd0('0x14c')](_0x2c6dac['Intervals'],_0x4f55f4,_0x757f4b,_0x45acfe,_0x1c5562);};};Dialer[_0x5dd0('0x1b')][_0x5dd0('0x14c')]=function(_0xa2f54,_0x53d71b,_0x437251,_0x1a19fa,_0x2870a9){var _0x5a9f86=[];return new Promise(function(_0xc36905,_0x1a07a4){if(!isNotNull(_0xa2f54)){_0x1a19fa[_0x5dd0('0x45')]=_0x5dd0('0x4a');return _0x1a07a4(msgResponse(_0x5dd0('0x14c'),_0x5dd0('0x14d'),_0x437251+_0x5dd0('0x14e')));}if(_['isEmpty'](_0xa2f54)){_0x1a19fa['message']=_0x5dd0('0x14f');return _0x1a07a4(msgResponse(_0x5dd0('0x14c'),'Failure',_0x437251+_0x5dd0('0x150')));}if(_0x53d71b&&_[_0x5dd0('0x44')](config[_0x5dd0('0x151')][_0x53d71b])){_0x1a19fa['message']='TIMEZONE_UNKNOW';return _0x1a07a4(msgResponse('ifTime','Failure',_0x437251+_0x5dd0('0x152')+_0x53d71b));}if(_[_0x5dd0('0x153')](_0xa2f54)){for(var _0x24fb9a=0x0;_0x24fb9a<_0xa2f54[_0x5dd0('0x9f')];_0x24fb9a+=0x1){_0x5a9f86['push'](ami['Action']({'action':_0x5dd0('0x154'),'command':util[_0x5dd0('0x82')](_0x5dd0('0x155'),_0xa2f54[_0x24fb9a]['interval'],!_[_0x5dd0('0x44')](config['timezones'][_0x53d71b])?_0x53d71b:'')})[_0x5dd0('0x43')](function(_0x3d5dd3){return _0x3d5dd3['content'][_0x5dd0('0x156')]('true')>=0x0;})[_0x5dd0('0xb9')](myreject(_0x1a07a4)));}}else{_0x5a9f86[_0x5dd0('0x157')](ami[_0x5dd0('0xb6')]({'action':'command','command':util[_0x5dd0('0x82')](_0x5dd0('0x155'),_0xa2f54,!_[_0x5dd0('0x44')](config['timezones'][_0x53d71b])?_0x53d71b:'')})[_0x5dd0('0x43')](function(_0x2c5122){return _0x2c5122[_0x5dd0('0x158')][_0x5dd0('0x156')]('true')>=0x0;})['catch'](myreject(_0x1a07a4)));}Promise[_0x5dd0('0x159')](_0x5a9f86)[_0x5dd0('0x43')](function(_0x59de7b){var _0x4e7613=_[_0x5dd0('0x15a')](_0x59de7b);if(_0x4e7613){return _0xc36905(_0x4e7613);}else{_0x1a19fa['message']=_0x2870a9?_0x5dd0('0x15b'):'INTERVAL_IS_OVERTIME';return _0x1a07a4(msgResponse(_0x5dd0('0x15c'),_0x5dd0('0x14d'),_0x5dd0('0x15d')+_0x2870a9+'\x20'+_0x437251+'\x20Interval\x20is\x20overtime:\x20'+util['inspect'](_0xa2f54,{'showHidden':![],'depth':null})+_0x5dd0('0x15e')+_0x53d71b));}})['catch'](function(_0x16cb0c){return _0x1a07a4(msgResponse(_0x5dd0('0x14c'),_0x5dd0('0x14d'),JSON[_0x5dd0('0x50')](_0x16cb0c)));});});};Dialer['prototype'][_0x5dd0('0x15f')]=function(_0x1cf0e3){var _0x2f9f2b=this;return function(){switch(_0x1cf0e3['dialMethod']){case _0x5dd0('0x160'):freeVariablesPredictive(_0x1cf0e3);_0x2f9f2b['handlePower'](_0x1cf0e3,0x1);break;case _0x5dd0('0x161'):freeVariablesPredictive(_0x1cf0e3);_0x2f9f2b['handlePower'](_0x1cf0e3,_0x1cf0e3[_0x5dd0('0x162')]);break;case _0x5dd0('0x163'):_0x2f9f2b[_0x5dd0('0x163')](_0x1cf0e3);break;case _0x5dd0('0x7'):freeVariablesPredictive(_0x1cf0e3);_0x2f9f2b[_0x5dd0('0x164')](_0x1cf0e3,0x1);break;default:freeVariablesPredictive(_0x1cf0e3);logger['error'](_0x5dd0('0x165'),_0x1cf0e3[_0x5dd0('0x48')],'method\x20not\x20recognized');}};};Dialer['prototype'][_0x5dd0('0x166')]=function(_0x4673f4){return Promise[_0x5dd0('0xc1')]()[_0x5dd0('0x43')](cmHopper['handlePreviewRecallNotifications'](_0x4673f4['id'],previewRecallmeReminderInterval))[_0x5dd0('0x43')](function(_0xf7e28f){for(var _0x579351=0x0;_0x579351<_0xf7e28f[_0x5dd0('0x9f')];_0x579351++){var _0xd56cc7=_0xf7e28f[_0x579351][_0x5dd0('0x167')][_0x5dd0('0x48')];if(_0xd56cc7)io['to'](util['format'](_0x5dd0('0x168'),_0xd56cc7))['emit']('user:dialPreviewRecallReminder',{'hopper':_0xf7e28f[_0x579351]});}})[_0x5dd0('0xb9')](function(){});};Dialer[_0x5dd0('0x1b')][_0x5dd0('0x169')]=function(_0x4a3258){var _0x11e765=this;return function(){_0x11e765[_0x5dd0('0x16a')](_0x4a3258);};};Dialer[_0x5dd0('0x1b')][_0x5dd0('0x9')]=function(_0x113e10){var _0x254dc2=this;if(isNotPreview(_0x113e10[_0x5dd0('0x62')])){if(isVoiceQueueOutbound(_0x113e10[_0x5dd0('0x55')])&&isActive(_0x113e10[_0x5dd0('0x61')])){_0x113e10[_0x5dd0('0xa6')]=!![];Promise[_0x5dd0('0xc1')]()[_0x5dd0('0x43')](checkIsLoggedIn(_0x113e10,_0x113e10[_0x5dd0('0x58')]))['then'](checkIsActive(_0x113e10,_0x113e10[_0x5dd0('0x61')]))[_0x5dd0('0x43')](checkInterval(_0x113e10))[_0x5dd0('0x43')](_0x254dc2['checkIsTrunkReachable'](_0x113e10))['then'](_0x254dc2['checkIfTime'](_0x113e10[_0x5dd0('0x16b')],_0x113e10['dialTimezone'],_0x113e10[_0x5dd0('0x48')],_0x113e10))[_0x5dd0('0x43')](_0x254dc2['checkIfTimeIntervals'](_0x113e10[_0x5dd0('0x4b')],_0x113e10[_0x5dd0('0x16c')],_0x113e10[_0x5dd0('0x48')],_0x113e10))['then'](_0x254dc2['checkDialMethod'](_0x113e10))[_0x5dd0('0xb9')](loggerCatchQueueSummary('[syncQueueSummary]',_0x113e10));}else{notSendMessagesQueue(_0x113e10);}}else{freeVariablesPredictive(_0x113e10);}};Dialer[_0x5dd0('0x1b')]['syncQueueSummaryComplete']=_[_0x5dd0('0x16d')](function(){var _0x521ef0=_[_0x5dd0('0x16e')](this[_0x5dd0('0x1f')],function(_0x3f7f8d){return _0x3f7f8d['dialPreviewRecallmeReminder'];});var _0x1b42ac=_[_0x5dd0('0x16e')](this[_0x5dd0('0x21')],function(_0x36a5d7){return _0x36a5d7[_0x5dd0('0x16f')]&&_0x36a5d7[_0x5dd0('0xb7')]===_0x5dd0('0x170');});if(_0x521ef0[_0x5dd0('0x9f')]>0x0&&_0x1b42ac[_0x5dd0('0x9f')]>0x0){return Promise[_0x5dd0('0xc1')]()[_0x5dd0('0x43')](cmHopper['handlePreviewRecallNotifications'](_[_0x5dd0('0x171')](_0x521ef0,'id'),previewRecallmeReminderInterval,_[_0x5dd0('0x171')](_0x1b42ac,'id')))['then'](function(_0x535d47){for(var _0x37e990=0x0;_0x37e990<_0x535d47[_0x5dd0('0x9f')];_0x37e990++){var _0x221f2a=_0x535d47[_0x37e990]['Agent'][_0x5dd0('0x48')];if(_0x221f2a)io['to'](util['format'](_0x5dd0('0x168'),_0x221f2a))['emit'](_0x5dd0('0x172'),{'hopper':_0x535d47[_0x37e990]});}})[_0x5dd0('0xb9')](function(_0x407c79){logger[_0x5dd0('0x9e')](_0x5dd0('0x166'),_0x407c79);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x5dd0('0x1b')][_0x5dd0('0x173')]=function(){var _0xaf1c1a=this;var _0x375eaa;for(var _0x21ff4a in this[_0x5dd0('0x20')]){if(typeof this[_0x5dd0('0x20')][_0x21ff4a]!==_0x5dd0('0xb3')){_0x375eaa=this[_0x5dd0('0x20')][_0x21ff4a];if(isCampaignIvr(_0x375eaa['type'])&&isActive(_0x375eaa[_0x5dd0('0x80')])){_0x375eaa['sendMessageOneNotActive']=!![];Promise[_0x5dd0('0xc1')]()['then'](checkIsActive(_0x375eaa,_0x375eaa[_0x5dd0('0x80')]))[_0x5dd0('0x43')](checkInterval(_0x375eaa))[_0x5dd0('0x43')](_0xaf1c1a[_0x5dd0('0x149')](_0x375eaa))[_0x5dd0('0x43')](_0xaf1c1a[_0x5dd0('0x14b')](_0x375eaa['dialGlobalInterval'],_0x375eaa['dialTimezone'],_0x375eaa['name'],_0x375eaa))[_0x5dd0('0x43')](_0xaf1c1a[_0x5dd0('0x174')](_0x375eaa[_0x5dd0('0x4b')],_0x375eaa['dialTimezone'],_0x375eaa['name'],_0x375eaa))[_0x5dd0('0x43')](_0xaf1c1a[_0x5dd0('0x169')](_0x375eaa))[_0x5dd0('0xb9')](loggerCatchQueueSummary(_0x5dd0('0x175'),_0x375eaa));}else{notSendMessagesCampaign(_0x375eaa);}}}};function getCallerIdRandom(_0x428c98,_0x290c4e){var _0x2dd691;var _0x35563c;var _0xc8851a;if(_0x290c4e<=0x0){_0x290c4e=0x1;}_0x2dd691=new RegExp(_0x5dd0('0x176')+_0x290c4e+'}$');_0x35563c=Math[_0x5dd0('0x177')](0xa,_0x290c4e-0x1);_0xc8851a=Math[_0x5dd0('0x177')](0xa,_0x290c4e)-0x1;return util['format']('%s',_[_0x5dd0('0x178')](_0x428c98,_0x2dd691,_[_0x5dd0('0x179')](_0x35563c,_0xc8851a)));}function extractCalleridName(_0x1f2dd1){var _0x595257=_0x1f2dd1['match'](/"(.*?)"/);return _0x595257?_0x595257[0x1]:_0x1f2dd1;}Dialer[_0x5dd0('0x1b')][_0x5dd0('0x17a')]=function(_0xa20eb8,_0x3799be){var _0x47c0bc=this;var _0x32839d=uuid['v4']();this[_0x5dd0('0x24')][_0x32839d]=new Action(_0xa20eb8,_0x3799be,_0x32839d);return new Promise(function(_0x1a01e3,_0x2219ff){if(_[_0x5dd0('0x44')](_0xa20eb8)&&typeof _0xa20eb8!==_0x5dd0('0x17b')){return _0x2219ff(msgResponse(_0x5dd0('0x17c'),_0x5dd0('0x14d'),_0x5dd0('0x17d')));}if(_['isUndefined'](_0x3799be['phone'])||_0x3799be[_0x5dd0('0x17e')]===null){return _0x2219ff(msgResponse(_0x5dd0('0x17c'),_0x5dd0('0x14d'),_0x5dd0('0x17f')));}var _0x542cf2={'XMD-CALLERID':_0x47c0bc[_0x5dd0('0x24')][_0x32839d][_0x5dd0('0x180')](),'XMD-AGI':_0xa20eb8['dialQueueProject']?util['format'](_0x5dd0('0x181'),ipAgi,_0xa20eb8['dialQueueProject']):_0x5dd0('0x182'),'XMD-AGIAFTER':_0xa20eb8[_0x5dd0('0x116')]?util[_0x5dd0('0x82')](_0x5dd0('0x181'),ipAgi,_0xa20eb8[_0x5dd0('0x116')]):_0x5dd0('0x182'),'XMD-QUEUE':_0xa20eb8[_0x5dd0('0x55')]===_0x5dd0('0x56')?util[_0x5dd0('0x82')](_0x5dd0('0x183'),_0xa20eb8[_0x5dd0('0x48')],_0xa20eb8[_0x5dd0('0x184')]||'',_0xa20eb8['dialAgiAfterHangupAgent']?'c':'',_0xa20eb8[_0x5dd0('0x11d')]||0x3):_0x5dd0('0x182'),'XMD-CONTACTID':_0x3799be[_0x5dd0('0xd9')],'XMD-CDRTYPE':_0x5dd0('0x185'),'CALLERID(all)':_0x47c0bc[_0x5dd0('0x24')][_0x32839d][_0x5dd0('0x180')](),'XMD-AMD':_0xa20eb8[_0x5dd0('0xef')]?_0x5dd0('0x186'):'NONE','XMD-DESTINATION':'xcally-motion-dialer'};if(_0xa20eb8[_0x5dd0('0xef')]){_0x542cf2[_0x5dd0('0x187')]=_0xa20eb8['dialAMDInitialSilence']||0x9c4;_0x542cf2[_0x5dd0('0x188')]=_0xa20eb8[_0x5dd0('0x189')]||0x5dc;_0x542cf2[_0x5dd0('0x18a')]=_0xa20eb8[_0x5dd0('0x18b')]||0x320;_0x542cf2[_0x5dd0('0x18c')]=_0xa20eb8[_0x5dd0('0x18d')]||0x1388;_0x542cf2['XMD-AMDMINWORDLENGTH']=_0xa20eb8['dialAMDMinWordLength']||0x64;_0x542cf2[_0x5dd0('0x18e')]=_0xa20eb8[_0x5dd0('0x18f')]||0x32;_0x542cf2[_0x5dd0('0x190')]=_0xa20eb8['dialAMDMaximumNumberOfWords']||0x3;_0x542cf2[_0x5dd0('0x191')]=_0xa20eb8[_0x5dd0('0x192')]||0x100;_0x542cf2[_0x5dd0('0x193')]=_0xa20eb8[_0x5dd0('0x194')]||0x1388;}if(_0xa20eb8[_0x5dd0('0x55')]===_0x5dd0('0x56')){_0x542cf2['XMD-VOICEQUEUEID']=_0x3799be[_0x5dd0('0x104')];}else{_0x542cf2[_0x5dd0('0x195')]=_0x3799be[_0x5dd0('0xdb')];}for(var _0x13e287 in _0x3799be[_0x5dd0('0x196')]){if(typeof _0x3799be[_0x5dd0('0x196')][_0x13e287]!==_0x5dd0('0xb3')){if(isNotNull(_0x3799be[_0x5dd0('0x196')][_0x13e287])&&_0x13e287!=='id'&&_0x13e287!==_0x5dd0('0x197')&&_0x13e287!==_0x5dd0('0x198')&&_0x13e287!=='updatedAt'){_0x542cf2[util['format']('%s%s','XMD-',_[_0x5dd0('0x199')](_0x13e287))]=_0x3799be[_0x5dd0('0x196')][_0x13e287];}}}var _0x4c9987=_0x47c0bc[_0x5dd0('0xe0')](_0xa20eb8[_0x5dd0('0x7f')])?getCallerId(_0xa20eb8[_0x5dd0('0x7f')][_0x5dd0('0x81')],_0xa20eb8['dialOriginateCallerIdName'],_0xa20eb8['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0xa20eb8[_0x5dd0('0x64')],_0xa20eb8[_0x5dd0('0x19a')]):_0xa20eb8[_0x5dd0('0x64')]):getCallerId(_['isNil'](_0xa20eb8[_0x5dd0('0x14a')])?_0xa20eb8[_0x5dd0('0x7f')]['callerid']:_0xa20eb8['TrunkBackup']['callerid'],_0xa20eb8['dialOriginateCallerIdName'],_0xa20eb8[_0x5dd0('0x19a')]>0x0?getCallerIdRandom(_0xa20eb8[_0x5dd0('0x64')],_0xa20eb8[_0x5dd0('0x19a')]):_0xa20eb8[_0x5dd0('0x64')]);if(_0x4c9987){_0x542cf2[_0x5dd0('0x19b')]=_0x47c0bc[_0x5dd0('0x24')][_0x32839d]['originatecalleridname']=extractCalleridName(_0x4c9987);_0x542cf2[_0x5dd0('0x19c')]=_0x3799be[_0x5dd0('0x17e')];}_0xa20eb8[_0x5dd0('0x19d')]=_0x542cf2;return ami['Action']({'actionid':_0x32839d,'action':'originate','channel':_0x47c0bc[_0x5dd0('0xe0')](_0xa20eb8[_0x5dd0('0x7f')])?util[_0x5dd0('0x82')](_0x5dd0('0x19e'),_0xa20eb8['Trunk']['name'],isNotNull(_0xa20eb8[_0x5dd0('0x66')])?_0xa20eb8[_0x5dd0('0x66')][_0x5dd0('0x19f')]()||'':'',_0xa20eb8['dialCutDigit']>0x0?_0x3799be[_0x5dd0('0x17e')][_0x5dd0('0x1a0')](_0xa20eb8[_0x5dd0('0x1a1')]):_0x3799be['phone']):util[_0x5dd0('0x82')](_0x5dd0('0x19e'),_[_0x5dd0('0xb5')](_0xa20eb8['TrunkBackup'])?_0xa20eb8[_0x5dd0('0x7f')][_0x5dd0('0x48')]:_0xa20eb8['TrunkBackup'][_0x5dd0('0x48')],isNotNull(_0xa20eb8[_0x5dd0('0x66')])?_0xa20eb8[_0x5dd0('0x66')][_0x5dd0('0x19f')]()||'':'',_0xa20eb8[_0x5dd0('0x1a1')]>0x0?_0x3799be['phone'][_0x5dd0('0x1a0')](_0xa20eb8['dialCutDigit']):_0x3799be['phone']),'callerid':_0x4c9987,'Exten':_0x5dd0('0xe8'),'Context':'from-sip','Priority':'1','variable':_0x542cf2,'timeout':(_0xa20eb8[_0x5dd0('0x65')]||0x1e)*0x3e8,'async':!![],'channelid':_0x32839d})['then'](function(_0x1b846a){return _0x1a01e3(_0x1b846a);})[_0x5dd0('0xb9')](function(_0xa0010e){_0xa20eb8[_0x5dd0('0x1a2')]+=0x1;var _0x25d79d=new History(_0x47c0bc[_0x5dd0('0x24')][_0x32839d]);logger[_0x5dd0('0x9e')](util[_0x5dd0('0x82')](_0x5dd0('0x1a3'),JSON[_0x5dd0('0x50')](_0xa0010e)));_0x25d79d[_0x5dd0('0xaf')]=0xe;_0x25d79d[_0x5dd0('0xea')]='OriginateError';_0x25d79d[_0x5dd0('0xb0')]=moment()['format'](_0x5dd0('0x103'));_0x25d79d['endtime']=_0x25d79d[_0x5dd0('0xb0')];_0x47c0bc[_0x5dd0('0xe4')](_0x25d79d)[_0x5dd0('0xb9')](loggerCatch(_0x5dd0('0x1a4')));_0x47c0bc['moveContactManagedDialer'](_0x25d79d)[_0x5dd0('0xb9')](loggerCatch(_0x5dd0('0x1a4')))['finally'](function(){delete _0x47c0bc[_0x5dd0('0x24')][_0x32839d];return _0x2219ff(msgResponse(_0x5dd0('0x17c'),'Error',_0x5dd0('0x1a5')));});});});};Dialer[_0x5dd0('0x1b')][_0x5dd0('0x30')]=function(_0x17fcf3){var _0x483c8d=this[_0x5dd0('0x24')][_0x17fcf3[_0x5dd0('0x133')]];if(_0x483c8d){delete this[_0x5dd0('0x24')][_0x17fcf3[_0x5dd0('0x133')]];_0x483c8d['responsetime']=moment()[_0x5dd0('0x82')]('YYYY-MM-DD\x20HH:mm:ss');var _0x1fc230=_0x483c8d['type']===_0x5dd0('0x85')?this[_0x5dd0('0x20')][_0x483c8d[_0x5dd0('0xbc')]]:this[_0x5dd0('0x1f')][_0x483c8d[_0x5dd0('0x1a6')]()];if(!this['isSuccess'](_0x17fcf3['response'])){this[_0x5dd0('0xbb')](_0x1fc230);return this[_0x5dd0('0x1a7')](_0x483c8d,_0x1fc230,_0x17fcf3)['catch'](loggerCatch(_0x5dd0('0x1a8')));}this[_0x5dd0('0x26')][_0x17fcf3[_0x5dd0('0xe5')]]=_0x483c8d;}};Dialer[_0x5dd0('0x1b')][_0x5dd0('0x1a9')]=function(_0x25a9b9,_0x5c4134,_0x50862b){var _0x158e27=new History(_0x5c4134);if(_0x158e27[_0x5dd0('0xf5')]+_0x158e27[_0x5dd0('0xf6')]+_0x158e27[_0x5dd0('0xf7')]+_0x158e27['countnosuchnumberretry']+_0x158e27[_0x5dd0('0xf8')]+_0x158e27[_0x5dd0('0xf9')]+_0x158e27[_0x5dd0('0xf1')]+_0x158e27['countagentrejectretry']>=_0x50862b[_0x5dd0('0x10c')]-0x1){return!![];}switch(_0x25a9b9){case 0x3:if(_0x158e27[_0x5dd0('0xf7')]>=_0x50862b[_0x5dd0('0x1aa')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x158e27[_0x5dd0('0xf7')]+=0x1,'scheduledat':moment()['add'](_0x50862b[_0x5dd0('0x1ab')],_0x5dd0('0x102'))[_0x5dd0('0x82')](_0x5dd0('0x103')),'ContactId':_0x158e27[_0x5dd0('0xd9')],'ListId':_0x158e27['ListId'],'VoiceQueueId':_0x158e27[_0x5dd0('0x104')]||undefined,'CampaignId':_0x158e27[_0x5dd0('0xdb')]||undefined})[_0x5dd0('0xb9')](loggerCatch(_0x5dd0('0x1ac')));break;case 0x5:if(_0x158e27[_0x5dd0('0xf5')]>=_0x50862b['dialBusyMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x158e27[_0x5dd0('0xf5')]+=0x1,'scheduledat':moment()[_0x5dd0('0x100')](_0x50862b['dialBusyRetryFrequency'],'minutes')[_0x5dd0('0x82')](_0x5dd0('0x103')),'ContactId':_0x158e27[_0x5dd0('0xd9')],'ListId':_0x158e27[_0x5dd0('0x126')],'VoiceQueueId':_0x158e27[_0x5dd0('0x104')]||undefined,'CampaignId':_0x158e27[_0x5dd0('0xdb')]||undefined})[_0x5dd0('0xb9')](loggerCatch(_0x5dd0('0x1ad')));break;case 0x8:if(_0x158e27['countcongestionretry']>=_0x50862b[_0x5dd0('0x1ae')]-0x1){return!![];}this[_0x5dd0('0xc9')]({'active':![],'countcongestionretry':_0x158e27[_0x5dd0('0xf6')]+=0x1,'scheduledat':moment()['add'](_0x50862b['dialCongestionRetryFrequency'],_0x5dd0('0x102'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x158e27[_0x5dd0('0xd9')],'ListId':_0x158e27[_0x5dd0('0x126')],'VoiceQueueId':_0x158e27[_0x5dd0('0x104')]||undefined,'CampaignId':_0x158e27['CampaignId']||undefined})['catch'](loggerCatch(_0x5dd0('0x1af')));break;case 0x0:if(_0x158e27[_0x5dd0('0x10b')]>=_0x50862b[_0x5dd0('0x1b0')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x158e27[_0x5dd0('0x10b')]+=0x1,'scheduledat':moment()[_0x5dd0('0x100')](_0x50862b[_0x5dd0('0x1b1')],_0x5dd0('0x102'))['format'](_0x5dd0('0x103')),'ContactId':_0x158e27[_0x5dd0('0xd9')],'ListId':_0x158e27['ListId'],'VoiceQueueId':_0x158e27[_0x5dd0('0x104')]||undefined,'CampaignId':_0x158e27[_0x5dd0('0xdb')]||undefined})[_0x5dd0('0xb9')](loggerCatch(_0x5dd0('0x1b2')));}break;case 0xa:if(_0x158e27[_0x5dd0('0xf8')]>=_0x50862b['dialDropMaxRetry']-0x1){return!![];}this[_0x5dd0('0xc9')]({'active':![],'countdropretry':_0x158e27[_0x5dd0('0xf8')]+=0x1,'scheduledat':moment()[_0x5dd0('0x100')](_0x50862b[_0x5dd0('0x121')],_0x5dd0('0x102'))[_0x5dd0('0x82')](_0x5dd0('0x103')),'ContactId':_0x158e27['ContactId'],'ListId':_0x158e27[_0x5dd0('0x126')],'VoiceQueueId':_0x158e27[_0x5dd0('0x104')]||undefined,'CampaignId':_0x158e27[_0x5dd0('0xdb')]||undefined})['catch'](loggerCatch(_0x5dd0('0x127')));break;case 0xb:if(_0x158e27[_0x5dd0('0xf9')]>=_0x50862b[_0x5dd0('0x12f')]-0x1){return!![];}this[_0x5dd0('0xc9')]({'active':![],'countabandonedretry':_0x158e27[_0x5dd0('0xf9')]+=0x1,'scheduledat':moment()['add'](_0x50862b['dialAbandonedRetryFrequency'],_0x5dd0('0x102'))[_0x5dd0('0x82')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x158e27[_0x5dd0('0xd9')],'ListId':_0x158e27[_0x5dd0('0x126')],'VoiceQueueId':_0x158e27[_0x5dd0('0x104')]||undefined,'CampaignId':_0x158e27['CampaignId']||undefined})[_0x5dd0('0xb9')](loggerCatch(_0x5dd0('0x130')));break;case 0x13:if(_0x158e27[_0x5dd0('0xf1')]>=_0x50862b[_0x5dd0('0xfd')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countmachineretry':_0x158e27[_0x5dd0('0xf1')]+=0x1,'scheduledat':moment()[_0x5dd0('0x100')](_0x50862b[_0x5dd0('0x101')],_0x5dd0('0x102'))[_0x5dd0('0x82')](_0x5dd0('0x103')),'ContactId':_0x158e27[_0x5dd0('0xd9')],'ListId':_0x158e27[_0x5dd0('0x126')],'VoiceQueueId':_0x158e27['VoiceQueueId']||undefined,'CampaignId':_0x158e27['CampaignId']||undefined})['catch'](loggerCatch(_0x5dd0('0x105')));break;case 0x14:if(_0x158e27['countagentrejectretry']>=_0x50862b[_0x5dd0('0x1b3')]-0x1){return!![];}this[_0x5dd0('0xc9')]({'active':![],'countagentrejectretry':_0x158e27[_0x5dd0('0xfa')]+=0x1,'scheduledat':moment()[_0x5dd0('0x100')](_0x50862b[_0x5dd0('0x1b4')],'minutes')[_0x5dd0('0x82')](_0x5dd0('0x103')),'ContactId':_0x158e27['ContactId'],'ListId':_0x158e27[_0x5dd0('0x126')],'VoiceQueueId':_0x158e27[_0x5dd0('0x104')]||undefined,'CampaignId':_0x158e27[_0x5dd0('0xdb')]||undefined})['catch'](loggerCatch(_0x5dd0('0x1b5')));break;default:return!![];}};Dialer[_0x5dd0('0x1b')][_0x5dd0('0x1a7')]=function(_0x199d33,_0x40843e,_0x319503){var _0x59745a=this;var _0x551840=new History(_0x199d33);var _0x5820ac=![];var _0x170879;var _0x35cb37;return new Promise(function(_0x457342,_0x394a92){if(_[_0x5dd0('0x44')](_0x40843e)&&typeof _0x40843e!==_0x5dd0('0x17b')){return _0x394a92(msgResponse(_0x5dd0('0x1b6'),'Failure','entity\x20is\x20undefine'));}if(_[_0x5dd0('0x44')](_0x319503)&&typeof _0x319503!=='object'){return _0x394a92(msgResponse(_0x5dd0('0x1b6'),_0x5dd0('0x14d'),_0x5dd0('0x1b7')));}_0x59745a[_0x5dd0('0xc2')](_0x551840,_0x319503['reason'],_0x40843e)[_0x5dd0('0x43')](function(_0x4c7176){if(_0x4c7176[_0x5dd0('0x124')]==0x1)_0x5820ac=!![];switch(_0x319503[_0x5dd0('0x113')]){case'0':_0x40843e[_0x5dd0('0x1b8')]+=0x1;_0x551840['state']=0x0;_0x551840[_0x5dd0('0xea')]=_0x5dd0('0x1b9');_0x551840[_0x5dd0('0x10b')]+=0x1;_0x551840['countglobal']+=0x1;ami[_0x5dd0('0x54')]('custom:agentnosuchnumber',ut[_0x5dd0('0xf3')](_0x199d33,_0x5dd0('0x1ba')));_0x170879=_0x40843e[_0x5dd0('0x1b1')];_0x35cb37=_0x40843e[_0x5dd0('0x122')];_0x59745a[_0x5dd0('0xe4')](_0x551840)[_0x5dd0('0xb9')](loggerCatch(_0x5dd0('0xf4')));if(_0x59745a[_0x5dd0('0x1a9')](0x0,_0x199d33,_0x40843e)&&!_0x5820ac){if(_0x551840['countnosuchnumberretry']>=_0x40843e[_0x5dd0('0x1b0')]){_0x59745a[_0x5dd0('0xfe')](_0x551840,_0x457342,_0x394a92,'reason\x200\x20no\x20such\x20number....');}else{_0x59745a[_0x5dd0('0xfb')](_0x551840,_0x457342,_0x394a92,_0x5dd0('0x1bb'));}}break;case'3':_0x40843e['outboundNoAnswerCallsDay']+=0x1;_0x551840[_0x5dd0('0xaf')]=0x3;_0x551840[_0x5dd0('0xea')]=_0x5dd0('0x1bc');_0x551840[_0x5dd0('0xf7')]+=0x1;_0x551840[_0x5dd0('0x10a')]+=0x1;var _0x2879d7=ut[_0x5dd0('0x1bd')](_0x199d33,_0x40843e);ami[_0x5dd0('0x54')](_0x5dd0('0x1be'),_0x2879d7);_0x170879=_0x40843e[_0x5dd0('0x1ab')];_0x35cb37=_0x40843e[_0x5dd0('0x122')];_0x59745a[_0x5dd0('0xe4')](_0x551840)[_0x5dd0('0xb9')](loggerCatch(_0x5dd0('0x1bf')));if(_0x59745a[_0x5dd0('0x1a9')](0x3,_0x199d33,_0x40843e)&&!_0x5820ac){if(_0x551840[_0x5dd0('0xf7')]>=_0x40843e[_0x5dd0('0x1aa')]){_0x59745a[_0x5dd0('0xfe')](_0x551840,_0x457342,_0x394a92,_0x5dd0('0x1c0'));}else{_0x59745a[_0x5dd0('0xfb')](_0x551840,_0x457342,_0x394a92,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x40843e['outboundBusyCallsDay']+=0x1;_0x551840['state']=0x5;_0x551840[_0x5dd0('0xea')]=_0x5dd0('0x1c1');_0x551840[_0x5dd0('0xf5')]+=0x1;_0x551840[_0x5dd0('0x10a')]+=0x1;ami[_0x5dd0('0x54')]('custom:agentbusy',ut[_0x5dd0('0xf3')](_0x199d33,_0x5dd0('0x1c2')));_0x170879=_0x40843e[_0x5dd0('0x1c3')];_0x35cb37=_0x40843e['callAdditionalPhoneAfterMin'];_0x59745a[_0x5dd0('0xe4')](_0x551840)[_0x5dd0('0xb9')](loggerCatch(_0x5dd0('0x1c4')));if(_0x59745a['checkRetriveMax'](0x5,_0x199d33,_0x40843e)&&!_0x5820ac){if(_0x551840[_0x5dd0('0xf5')]>=_0x40843e['dialBusyMaxRetry']){_0x59745a[_0x5dd0('0xfe')](_0x551840,_0x457342,_0x394a92,_0x5dd0('0x1c5'));}else{_0x59745a['stateGlobal'](_0x551840,_0x457342,_0x394a92,_0x5dd0('0x1c5'));}}break;case'8':_0x40843e[_0x5dd0('0x6a')]+=0x1;_0x551840['state']=0x8;_0x551840[_0x5dd0('0xea')]=_0x5dd0('0x1c6');_0x551840['countcongestionretry']+=0x1;_0x551840[_0x5dd0('0x10a')]+=0x1;_0x170879=_0x40843e[_0x5dd0('0x1c7')];_0x35cb37=_0x40843e[_0x5dd0('0x122')];ami[_0x5dd0('0x54')](_0x5dd0('0x1c8'),ut[_0x5dd0('0xf3')](_0x199d33,_0x5dd0('0x1c9')));_0x59745a['createHistory'](_0x551840)[_0x5dd0('0xb9')](loggerCatch(_0x5dd0('0x1ca')));if(_0x59745a[_0x5dd0('0x1a9')](0x8,_0x199d33,_0x40843e)&&!_0x5820ac){if(_0x551840[_0x5dd0('0xf6')]>=_0x40843e[_0x5dd0('0x1ae')]){_0x59745a[_0x5dd0('0xfe')](_0x551840,_0x457342,_0x394a92,_0x5dd0('0x1cb'));}else{_0x59745a['stateGlobal'](_0x551840,_0x457342,_0x394a92,_0x5dd0('0x1cb'));}}break;case'11':_0x40843e['outboundAbandonedCallsDay']+=0x1;_0x551840[_0x5dd0('0xaf')]=0xb;_0x551840[_0x5dd0('0xea')]=_0x5dd0('0x131');_0x551840[_0x5dd0('0xf9')]+=0x1;_0x551840['countglobal']+=0x1;_0x170879=_0x40843e['dialAbandonedRetryFrequency'];_0x35cb37=_0x40843e[_0x5dd0('0x122')];_0x59745a['createHistory'](_0x551840)[_0x5dd0('0xb9')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x59745a[_0x5dd0('0x1a9')](0xb,_0x199d33,_0x40843e)&&!_0x5820ac){if(_0x551840['countabandonedretry']>=_0x40843e[_0x5dd0('0x12f')]){_0x59745a[_0x5dd0('0xfe')](_0x551840,_0x457342,_0x394a92,_0x5dd0('0x1cc'));}else{_0x59745a['stateGlobal'](_0x551840,_0x457342,_0x394a92,_0x5dd0('0x1cc'));}}break;case'20':_0x40843e['outboundRejectCallsDay']+=0x1;_0x551840['state']=0x14;_0x551840[_0x5dd0('0xea')]=_0x5dd0('0x1cd');_0x551840[_0x5dd0('0xfa')]+=0x1;_0x551840[_0x5dd0('0x10a')]+=0x1;_0x170879=_0x40843e[_0x5dd0('0x1b4')];_0x35cb37=_0x40843e['callAdditionalPhoneAfterMin'];ami[_0x5dd0('0x54')](_0x5dd0('0x1ce'),ut[_0x5dd0('0xf3')](_0x199d33,_0x5dd0('0x1cf')));_0x59745a[_0x5dd0('0xe4')](_0x551840)['catch'](loggerCatch(_0x5dd0('0x1d0')));if(_0x59745a[_0x5dd0('0x1a9')](0x14,_0x199d33,_0x40843e)&&!_0x5820ac){if(_0x551840['countagentrejectretry']>=_0x40843e[_0x5dd0('0x1b3')]){_0x59745a[_0x5dd0('0xfe')](_0x551840,_0x457342,_0x394a92,'reason\x2020\x20agentreject');}else{_0x59745a['stateGlobal'](_0x551840,_0x457342,_0x394a92,_0x5dd0('0x1d1'));}}break;default:_0x40843e['outboundUnknownCallsDay']+=0x1;_0x551840[_0x5dd0('0xaf')]=0xc;_0x551840[_0x5dd0('0xea')]=_0x319503['reason'];_0x170879=_0x40843e['dialAgentRejectRetryFrequency'];_0x35cb37=_0x40843e[_0x5dd0('0x122')];_0x59745a[_0x5dd0('0xe4')](_0x551840)[_0x5dd0('0xb9')](loggerCatch(_0x5dd0('0x1d2')));if(_0x59745a[_0x5dd0('0x1a9')](_0x319503[_0x5dd0('0x113')],_0x199d33,_0x40843e)&&!_0x5820ac){if(_0x551840[_0x5dd0('0xf5')]+_0x551840[_0x5dd0('0xf6')]+_0x551840[_0x5dd0('0xf7')]+_0x551840[_0x5dd0('0x10b')]+_0x551840[_0x5dd0('0xf8')]+_0x551840[_0x5dd0('0xf9')]+_0x551840[_0x5dd0('0xf1')]+_0x551840['countagentrejectretry']>=_0x40843e[_0x5dd0('0x10c')]){_0x59745a['stateGlobal'](_0x551840,_0x457342,_0x394a92,_0x319503[_0x5dd0('0x113')]);}else{_0x59745a[_0x5dd0('0xfe')](_0x551840,_0x457342,_0x394a92,_0x319503['reason']);}}}})[_0x5dd0('0x43')](function(){if(_0x5820ac){_0x59745a[_0x5dd0('0xc4')](_0x551840,_0x170879,_0x35cb37)['then'](function(){return _0x457342(0x1);});}});});};Dialer[_0x5dd0('0x1b')][_0x5dd0('0xfb')]=function(_0x41a2de,_0x7d25c5,_0x5dd859,_0x5eba12){var _0x128ab7=new Final(_0x41a2de);_0x128ab7['state']=0xf;_0x128ab7[_0x5dd0('0xea')]=_0x5dd0('0x1d3');this[_0x5dd0('0xfe')](_0x128ab7,_0x7d25c5,_0x5dd859,_0x5eba12);};Dialer[_0x5dd0('0x1b')]['createStateFinal']=function(_0x2548cb,_0x595d9e,_0x5a480f,_0x528fc9){this[_0x5dd0('0xd2')](_0x2548cb)[_0x5dd0('0x43')](function(){return _0x595d9e(msgResponse(_0x5dd0('0x1b6'),_0x5dd0('0xdf'),_0x528fc9));})[_0x5dd0('0xb9')](function(){return _0x5a480f(msgResponse('[moveContactManagedDialer][0]','Failure',_0x5dd0('0x1d4')));});};Dialer[_0x5dd0('0x1b')][_0x5dd0('0x163')]=function(_0x37d0c1){var _0x47d088=_0x37d0c1[_0x5dd0('0x1d5')]/0x64;var _0xd6c0f3=_0x37d0c1[_0x5dd0('0x6c')]/(_0x37d0c1[_0x5dd0('0x6c')]+_0x37d0c1[_0x5dd0('0x68')]);var _0x57bf75=Math[_0x5dd0('0x1d6')](_0x37d0c1[_0x5dd0('0x78')]*(_0x37d0c1[_0x5dd0('0x1d7')]/0x64));var _0xbb9676=Math[_0x5dd0('0x1d6')](_0x37d0c1[_0x5dd0('0x78')]*(_0x37d0c1[_0x5dd0('0x1d8')]/0x64));var _0x4f00c3=_0x37d0c1[_0x5dd0('0x57')]+_0x37d0c1[_0x5dd0('0x5b')];var _0x1c68ce=Math[_0x5dd0('0x1d9')](_0x37d0c1['erlangCalls']*_0x37d0c1[_0x5dd0('0x7d')]*_0x37d0c1['predictiveIntervalHitRate']*_0x37d0c1[_0x5dd0('0x77')]);if(_['isUndefined'](_0x37d0c1[_0x5dd0('0x29')])){if(!_[_0x5dd0('0x44')](_0x37d0c1[_0x5dd0('0x28')])){_0x37d0c1[_0x5dd0('0x28')]=undefined;loggerPredictive['error'](_0x5dd0('0x1da'),_0x5dd0('0x1db'));}if(!_[_0x5dd0('0x44')](_0x37d0c1[_0x5dd0('0x97')])){loggerPredictive[_0x5dd0('0x9e')](_0x5dd0('0x1da'),_0x5dd0('0x1dc'));clearInterval(_0x37d0c1[_0x5dd0('0x97')]);_0x37d0c1[_0x5dd0('0x97')]=undefined;}_0x37d0c1['startProgressive']=moment()[_0x5dd0('0x82')](_0x5dd0('0x103'));loggerPredictive['info'](_0x37d0c1['name'],_0x5dd0('0x1dd'),_0x37d0c1[_0x5dd0('0x29')]);this[_0x5dd0('0x164')](_0x37d0c1,0x1);}else if(ifInterval(_0x37d0c1[_0x5dd0('0x1de')],_0x37d0c1[_0x5dd0('0x29')])){this[_0x5dd0('0x164')](_0x37d0c1,0x1);loggerPredictiveCalls[_0x5dd0('0x86')]('[startMethodPredictive][StartProgressive][Loop]',_0x37d0c1['startProgressive'],_0x37d0c1[_0x5dd0('0x48')]);_0x37d0c1[_0x5dd0('0x7b')]=0x0;_0x37d0c1[_0x5dd0('0x11e')]=0x0;}else if(_0x47d088<_0xd6c0f3&&_0x37d0c1[_0x5dd0('0x1df')]===_0x5dd0('0x1e0')){freeVariablesPredictive(_0x37d0c1);loggerPredictive['info']('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0x5dd0('0x1e1'),_0xd6c0f3,_0x5dd0('0x29'),_0x37d0c1[_0x5dd0('0x48')]);}else if(_0x1c68ce<_0x37d0c1[_0x5dd0('0x11e')]&&_0x37d0c1[_0x5dd0('0x1df')]===_0x5dd0('0x1e0')){freeVariablesPredictive(_0x37d0c1);loggerPredictive[_0x5dd0('0x86')](_0x5dd0('0x1e2'),'Max\x20Drop\x20',_0x1c68ce,_0x5dd0('0x1e3'),_0x37d0c1[_0x5dd0('0x11e')],_0x5dd0('0x29'),_0x37d0c1['name']);}else if(!ifInterval(_0x37d0c1[_0x5dd0('0x1de')],_0x37d0c1[_0x5dd0('0x29')])&&_[_0x5dd0('0x44')](_0x37d0c1[_0x5dd0('0x28')])&&!_['isUndefined'](_0x37d0c1['startProgressive'])){_0x37d0c1[_0x5dd0('0x28')]=moment()[_0x5dd0('0x82')](_0x5dd0('0x103'));loggerPredictive[_0x5dd0('0x86')](_0x37d0c1[_0x5dd0('0x48')],_0x5dd0('0x1e4'),_0x37d0c1['startPredictive']);this[_0x5dd0('0x1e5')](_0x37d0c1[_0x5dd0('0x1de')])[_0x5dd0('0x43')](this[_0x5dd0('0x1e6')](_0x37d0c1))[_0x5dd0('0x43')](mergeDataErlangB(_0x37d0c1))[_0x5dd0('0x43')](this[_0x5dd0('0x1e7')](_0x37d0c1))['catch'](loggerCatchPredictive(_0x5dd0('0x1e8'),_0x37d0c1));}else if(!ifInterval(_0x37d0c1[_0x5dd0('0x1de')],_0x37d0c1[_0x5dd0('0x28')])){_0x37d0c1[_0x5dd0('0x11e')]=0x0;_0x37d0c1[_0x5dd0('0x28')]=moment()[_0x5dd0('0x82')](_0x5dd0('0x103'));loggerPredictive[_0x5dd0('0x86')](_0x37d0c1[_0x5dd0('0x48')],'recalculate\x20predictive\x20at',_0x37d0c1[_0x5dd0('0x28')]);clearInterval(_0x37d0c1[_0x5dd0('0x97')]);_0x37d0c1[_0x5dd0('0x97')]=undefined;this[_0x5dd0('0x1e5')](_0x37d0c1[_0x5dd0('0x1de')])[_0x5dd0('0x43')](this[_0x5dd0('0x1e6')](_0x37d0c1))[_0x5dd0('0x43')](mergeDataErlangB(_0x37d0c1))['then'](this[_0x5dd0('0x1e7')](_0x37d0c1))[_0x5dd0('0xb9')](loggerCatchPredictive(_0x5dd0('0x1e9'),_0x37d0c1));}else if(_0x37d0c1[_0x5dd0('0x78')]&&_0x4f00c3<_0x37d0c1[_0x5dd0('0x78')]-_0xbb9676){freeVariablesPredictive(_0x37d0c1);loggerPredictive[_0x5dd0('0x86')](_0x37d0c1['name'],_0x5dd0('0x1ea'),_0x4f00c3,_0x5dd0('0x1eb'),_0x37d0c1[_0x5dd0('0x78')],'-',_0xbb9676,'=',_0x37d0c1[_0x5dd0('0x78')]-_0xbb9676,')');}else if(_0x37d0c1[_0x5dd0('0x78')]&&_0x4f00c3>_0x37d0c1[_0x5dd0('0x78')]+_0x57bf75){freeVariablesPredictive(_0x37d0c1);loggerPredictive[_0x5dd0('0x86')](_0x37d0c1[_0x5dd0('0x48')],_0x5dd0('0x1ea'),_0x4f00c3,_0x5dd0('0x1ec'),_0x37d0c1[_0x5dd0('0x78')],'+',_0x57bf75,'=',_0x37d0c1[_0x5dd0('0x78')]+_0x57bf75,')');}};Dialer[_0x5dd0('0x1b')][_0x5dd0('0x1e6')]=function(_0x5b85e2){var _0x3f6caa=this;return function(_0x4d3381){return new Promise(function(_0x281b4f,_0x1b5113){_[_0x5dd0('0xd7')](_0x5b85e2,_0x4d3381[0x0]);if(checkGetDataPredictive(_0x4d3381[0x0])){var _0x4f57af=_0x5b85e2['predictiveIntervalAvailable']=_0x5b85e2[_0x5dd0('0x5b')]+_0x5b85e2['available'];var _0x1d0c12=_0x5b85e2['dialPredictiveInterval']*0x3c;var _0x7a8d9d=_0x4d3381[0x0][_0x5dd0('0x72')]+_0x4d3381[0x0]['predictiveIntervalAvgHoldtime'];var _0x1cab85=(_0x4d3381[0x0]['predictiveIntervalAnsweredCalls']+_0x4d3381[0x0][_0x5dd0('0x74')]+_0x4d3381[0x0][_0x5dd0('0x73')])/_0x4d3381[0x0][_0x5dd0('0x79')];_0x5b85e2[_0x5dd0('0x76')]=_0x1cab85>0x0?_0x1cab85:0x1;switch(_0x5b85e2[_0x5dd0('0x1df')]){case _0x5dd0('0x1e0'):var _0x5365e2=_0x5b85e2[_0x5dd0('0x1d5')]/0x64;return _0x3f6caa['abandonmentRate'](_0x4f57af,_0x1d0c12,_0x7a8d9d,_0x1cab85,_0x5365e2)[_0x5dd0('0x43')](function(_0x4f8254){return _0x281b4f(_0x4f8254);});case _0x5dd0('0x1ed'):var _0x18caca=_0x5b85e2[_0x5dd0('0x1d5')]/0x64;return _0x3f6caa[_0x5dd0('0x1ee')](_0x4f57af,_0x1d0c12,_0x7a8d9d,_0x1cab85,_0x18caca)['then'](function(_0x380dc1){return _0x281b4f(_0x380dc1);});default:return _0x1b5113(msgResponse(_0x5dd0('0x1ef'),_0x5dd0('0x14d'),'Unknown\x20Predictive'));}}else{return _0x1b5113(msgResponse(_0x5dd0('0x1ef'),_0x5dd0('0x14d'),_0x5dd0('0x1f0')));}});};};Dialer['prototype']['getDataPredictiveOld']=function(_0x1e5a3f){var _0x84a7c7=this;return function(_0xc943bf){return new Promise(function(_0x208867,_0x5e67fa){_[_0x5dd0('0xd7')](_0x1e5a3f,_0xc943bf[0x0]);if(checkGetDataPredictive(_0xc943bf[0x0])){loggerPredictive[_0x5dd0('0x86')](JSON[_0x5dd0('0x50')](_0xc943bf[0x0]));if(_0x1e5a3f['dialPredictiveOptimization']===_0x5dd0('0x1e0')){return _0x84a7c7['getVoiceQueueRtPauses'](_0x1e5a3f['id'])[_0x5dd0('0x43')](function(_0x5a43b3){var _0x571558=_0x1e5a3f[_0x5dd0('0x58')]-_0x5a43b3[0x0][_0x5dd0('0x1f1')];var _0xcf9f2d=_0x1e5a3f['dialPredictiveInterval']*0x3c;var _0x583604=_0xc943bf[0x0][_0x5dd0('0x72')]+_0xc943bf[0x0]['predictiveIntervalAvgHoldtime'];var _0x3c0b69=(_0xc943bf[0x0][_0x5dd0('0x70')]+_0xc943bf[0x0][_0x5dd0('0x74')]+_0xc943bf[0x0][_0x5dd0('0x73')])/_0xc943bf[0x0][_0x5dd0('0x79')];var _0x12d57d=_0x1e5a3f[_0x5dd0('0x1d5')]/0x64;_0x1e5a3f['predictiveIntervalPauses']=_0x5a43b3[0x0][_0x5dd0('0x1f1')]||0x0;_0x1e5a3f[_0x5dd0('0x76')]=_0x3c0b69>0x0?_0x3c0b69:0x1;return _0x84a7c7[_0x5dd0('0x1f2')](_0x571558,_0xcf9f2d,_0x583604,_0x3c0b69,_0x12d57d);})[_0x5dd0('0x43')](function(_0x14866b){return _0x208867(_0x14866b);})[_0x5dd0('0xb9')](function(_0x17134e){return _0x5e67fa(msgResponse(_0x5dd0('0x1f3'),_0x5dd0('0x14d'),JSON[_0x5dd0('0x50')](_0x17134e)));});}if(_0x1e5a3f[_0x5dd0('0x1df')]==='agentBusyFactor'){return _0x84a7c7['getVoiceQueueRtPauses'](_0x1e5a3f['id'])[_0x5dd0('0x43')](function(_0x2b7682){var _0xa034dd=_0x1e5a3f['loggedIn']-_0x2b7682[0x0][_0x5dd0('0x1f1')];var _0x3bce1d=_0x1e5a3f[_0x5dd0('0x1de')]*0x3c;var _0x11b0f8=_0xc943bf[0x0][_0x5dd0('0x72')]+_0xc943bf[0x0][_0x5dd0('0x71')];var _0x42da34=(_0xc943bf[0x0][_0x5dd0('0x70')]+_0xc943bf[0x0][_0x5dd0('0x74')]+_0xc943bf[0x0][_0x5dd0('0x73')])/_0xc943bf[0x0]['predictiveIntervalTotalCalls'];var _0xfb7fca=_0x1e5a3f[_0x5dd0('0x1d5')]/0x64;_0x1e5a3f[_0x5dd0('0x1f4')]=_0x2b7682[0x0]['outboundQueuePauses']||0x0;_0x1e5a3f['predictiveIntervalHitRate']=_0x42da34>0x0?_0x42da34:0x1;return _0x84a7c7[_0x5dd0('0x1ee')](_0xa034dd,_0x3bce1d,_0x11b0f8,_0x42da34,_0xfb7fca);})['then'](function(_0x3edb5b){return _0x208867(_0x3edb5b);})['catch'](function(_0x3cefe3){return _0x5e67fa(msgResponse('[CatchErlangB]','Failure',JSON[_0x5dd0('0x50')](_0x3cefe3)));});}}else{return _0x5e67fa(msgResponse(_0x5dd0('0x1ef'),_0x5dd0('0x14d'),_0x5dd0('0x1f0')));}});};};Dialer[_0x5dd0('0x1b')][_0x5dd0('0x1e7')]=function(_0x247d7){var _0x6d8fbe=this;return function(){var _0x58da21=0x0;var _0x1ea927=Math[_0x5dd0('0x1d9')](_0x247d7[_0x5dd0('0x7c')]*0x3e8);if(_0x1ea927>0x0){_0x1ea927=_0x1ea927<0x64?0x64:_0x1ea927;loggerPredictive['info'](_0x247d7[_0x5dd0('0x48')],_0x5dd0('0x1f5'),_0x1ea927,_0x5dd0('0x51'));_0x247d7[_0x5dd0('0x97')]=setInterval(function(){_0x6d8fbe[_0x5dd0('0x97')](_0x247d7);loggerPredictiveCalls[_0x5dd0('0x86')](_0x5dd0('0x1f6'),_0x58da21+=0x1);},_0x1ea927);}else{loggerPredictive[_0x5dd0('0x86')](_0x247d7['name'],_0x5dd0('0x1f7'));}};};Dialer[_0x5dd0('0x1b')]['checkContactBlack']=function(_0x2dca1f,_0x1306d2){var _0x221872=this;return function(_0x3b8ce5){if(_[_0x5dd0('0x4d')](_0x3b8ce5)){if(_[_0x5dd0('0xb5')](_0x1306d2['UserId'])||!_0x1306d2[_0x5dd0('0x1f8')]){if(_0x2dca1f['dialMethod']===_0x5dd0('0x7')){_0x2dca1f['queueStatusComplete']=_[_0x5dd0('0x44')](_0x2dca1f[_0x5dd0('0x13a')])?!![]:_0x2dca1f[_0x5dd0('0x13a')];var _0x4da3a9=uuid['v4']();_0x221872[_0x5dd0('0x24')][_0x4da3a9]=new Action(_0x2dca1f,_0x1306d2,_0x4da3a9);loggerBooked['info'](_0x5dd0('0x1f9'),_0x4da3a9,'queueStatusComplete:\x20',JSON[_0x5dd0('0x50')](_0x2dca1f[_0x5dd0('0x13a')]),_0x5dd0('0x1fa'),_0x2dca1f['name']);if(_0x2dca1f['queueStatusComplete']){_0x2dca1f[_0x5dd0('0x13a')]=![];_0x221872[_0x5dd0('0x138')][_0x221872[_0x5dd0('0x24')][_0x4da3a9][_0x5dd0('0xbc')]]=[];ami[_0x5dd0('0xb6')]({'actionid':_0x4da3a9,'action':_0x5dd0('0x1fb'),'queue':_0x2dca1f[_0x5dd0('0x48')]})['catch'](function(){_0x221872['updateOriginated'](_0x2dca1f);_0x221872[_0x5dd0('0xc9')]({'active':![],'ContactId':_0x221872[_0x5dd0('0x24')][_0x4da3a9][_0x5dd0('0xd9')],'ListId':_0x221872[_0x5dd0('0x24')][_0x4da3a9][_0x5dd0('0x126')],'VoiceQueueId':_0x221872[_0x5dd0('0x24')][_0x4da3a9][_0x5dd0('0x104')]||undefined,'CampaignId':_0x221872['actions'][_0x4da3a9][_0x5dd0('0xdb')]||undefined})[_0x5dd0('0xb9')](loggerCatch(_0x5dd0('0x1fc')));delete _0x221872[_0x5dd0('0x24')][_0x4da3a9];});}else{loggerBooked['info'](_0x5dd0('0x1fd'),JSON['stringify'](_0x2dca1f[_0x5dd0('0x13a')]),_0x5dd0('0x1fa'),_0x2dca1f[_0x5dd0('0x48')]);_0x221872['updateOriginated'](_0x2dca1f);_0x221872[_0x5dd0('0xc9')]({'active':![],'ContactId':_0x221872[_0x5dd0('0x24')][_0x4da3a9]['ContactId'],'ListId':_0x221872[_0x5dd0('0x24')][_0x4da3a9][_0x5dd0('0x126')],'VoiceQueueId':_0x221872[_0x5dd0('0x24')][_0x4da3a9][_0x5dd0('0x104')]||undefined,'CampaignId':_0x221872[_0x5dd0('0x24')][_0x4da3a9][_0x5dd0('0xdb')]||undefined})[_0x5dd0('0xb9')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x221872[_0x5dd0('0x24')][_0x4da3a9];}}else{return _0x221872[_0x5dd0('0x17a')](_0x2dca1f,_0x1306d2);}}else{if(getDiff(_0x1306d2[_0x5dd0('0x1fe')])<_0x2dca1f['dialRecallMeTimeout']*0x3c){if(_0x1306d2[_0x5dd0('0x167')]&&!_0x1306d2[_0x5dd0('0x167')][_0x5dd0('0x1ff')]){_0x221872['preview']['run'](_0x1306d2['id'])['finally'](function(){_0x221872[_0x5dd0('0xbb')](_0x2dca1f);});}else{_0x221872[_0x5dd0('0xca')]({'active':![]},_0x1306d2['id'],0x1)[_0x5dd0('0x1d')](function(){_0x221872['updateOriginated'](_0x2dca1f);});}}else{_0x2dca1f[_0x5dd0('0x200')]+=0x1;_0x221872[_0x5dd0('0xbb')](_0x2dca1f);if(_0x2dca1f[_0x5dd0('0x201')]){_0x221872['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x1306d2[_0x5dd0('0xd9')],'ListId':_0x1306d2[_0x5dd0('0x126')],'VoiceQueueId':_0x1306d2['VoiceQueueId']||undefined,'CampaignId':_0x1306d2['CampaignId']||undefined})[_0x5dd0('0xb9')](loggerCatch(_0x5dd0('0x202')));_0x221872[_0x5dd0('0xe4')](createObjHistory(_0x2dca1f,_0x1306d2,_0x5dd0('0x203'),0x17,_0x5dd0('0x204')))[_0x5dd0('0xb9')](loggerCatch(_0x5dd0('0x205')));}else{_0x221872[_0x5dd0('0xd6')](createObjHistory(_0x2dca1f,_0x1306d2,_0x5dd0('0x206'),0x16,_0x5dd0('0x207')),_0x5dd0('0x208'),_0x5dd0('0x209'));}}}}else{_0x2dca1f[_0x5dd0('0x69')]+=0x1;_0x221872[_0x5dd0('0xd6')](createObjHistory(_0x2dca1f,_0x1306d2,_0x5dd0('0x20a'),0xd,_0x5dd0('0x20b')),_0x5dd0('0x20c'),_0x5dd0('0x20d'));throw _0x5dd0('0x20e');}};};Dialer[_0x5dd0('0x1b')][_0x5dd0('0x16a')]=function(_0x452505){var _0x17b78c=this;var _0x299e0c=_0x452505['limitCalls']-_0x452505['originated']-_0x452505[_0x5dd0('0xcd')];emitCampaignSummary(_0x452505);if(_0x299e0c>0x0){if(_0x299e0c>this[_0x5dd0('0x22')]){_0x299e0c=this[_0x5dd0('0x22')];}_0x452505[_0x5dd0('0xcd')]+=_0x299e0c;this[_0x5dd0('0xcf')](_0x452505['id'],_0x299e0c,_0x452505[_0x5dd0('0x20f')],_0x452505)[_0x5dd0('0x43')](function(_0x174ea0){_0x452505[_0x5dd0('0xcd')]-=_0x299e0c;_0x452505[_0x5dd0('0xcd')]=_0x452505[_0x5dd0('0xcd')]>0x0?_0x452505[_0x5dd0('0xcd')]:0x0;if(!checkContactEmpty(_0x174ea0)){_0x452505[_0x5dd0('0x45')]=_0x5dd0('0xa4');logger[_0x5dd0('0x86')]('[getContactCampaign2][Empty]'+_0x452505[_0x5dd0('0x48')]);}else{_0x452505['originated']+=_0x174ea0['length'];_0x452505[_0x5dd0('0x45')]=_0x5dd0('0x210');for(var _0x24b9fb=0x0;_0x24b9fb<_0x174ea0[_0x5dd0('0x9f')];_0x24b9fb+=0x1){_0x452505[_0x5dd0('0x211')]+=0x1;if(_[_0x5dd0('0xb5')](_0x174ea0[_0x24b9fb])||_[_0x5dd0('0xb5')](_0x174ea0[_0x24b9fb][_0x5dd0('0x196')])||_[_0x5dd0('0xb5')](_0x174ea0[_0x24b9fb][_0x5dd0('0x17e')])){_0x17b78c[_0x5dd0('0x212')]('[actionOriginate]\x20',_0x452505,_0x174ea0[_0x24b9fb]);}else{_0x17b78c[_0x5dd0('0xc5')](_[_0x5dd0('0xd8')](_0x174ea0[_0x24b9fb],['CampaignId',_0x5dd0('0x17e')]))[_0x5dd0('0x43')](_0x17b78c[_0x5dd0('0x213')](_0x452505,_0x174ea0[_0x24b9fb]))[_0x5dd0('0xb9')](_0x17b78c[_0x5dd0('0x214')](_0x5dd0('0x215'),_0x452505));}}}})[_0x5dd0('0xb9')](loggerGetContactDialer('[getContactCampaign2]',_0x452505,_0x299e0c));}};Dialer['prototype'][_0x5dd0('0x164')]=function(_0x35a0d4,_0x2f9304){var _0x8e73b4=this;var _0x3b933f=[];var _0x3b4944=_0x2f9304>=0x1?_0x2f9304:0x1;if(_0x35a0d4[_0x5dd0('0x62')]===_0x5dd0('0x7')){_0x3b4944=0x1;}var _0x494cc1=Math[_0x5dd0('0x1d9')](_0x35a0d4[_0x5dd0('0x57')]*_0x3b4944)-_0x35a0d4['originated']-_0x35a0d4['temp'];emitVoiceQueueSummary(_0x35a0d4);if(_0x35a0d4['dialLimitQueue']>0x0){var _0x5cce4f=_0x35a0d4[_0x5dd0('0x216')]-_0x35a0d4[_0x5dd0('0x7a')]-_0x35a0d4[_0x5dd0('0x5b')]-_0x35a0d4['temp']-_0x35a0d4[_0x5dd0('0xa7')];if(_0x494cc1>_0x5cce4f){_0x494cc1=_0x5cce4f;}}if(_0x494cc1>0x0){if(_0x35a0d4[_0x5dd0('0x62')]===_0x5dd0('0x7')){_0x494cc1=0x1;}if(_0x494cc1>this[_0x5dd0('0x22')]){_0x494cc1=this[_0x5dd0('0x22')];}_0x35a0d4[_0x5dd0('0xcd')]+=_0x494cc1;for(var _0xbf4180 in this[_0x5dd0('0x21')]){if(typeof this[_0x5dd0('0x21')][_0xbf4180]!==_0x5dd0('0xb3')){if(this[_0x5dd0('0x21')][_0xbf4180]['state']===_0x5dd0('0x217')&&this[_0x5dd0('0x21')][_0xbf4180][_0x5dd0('0xb7')]===_0x5dd0('0x170')){_0x3b933f[_0x5dd0('0x157')](this[_0x5dd0('0x21')][_0xbf4180]['id']);}}}this[_0x5dd0('0xcc')](_0x35a0d4['id'],_0x3b933f,_0x494cc1,_0x35a0d4['dialOrderByScheduledAt'],_0x35a0d4)[_0x5dd0('0x43')](function(_0x3a52be){_0x35a0d4[_0x5dd0('0xcd')]-=_0x494cc1;_0x35a0d4['temp']=_0x35a0d4[_0x5dd0('0xcd')]>0x0?_0x35a0d4[_0x5dd0('0xcd')]:0x0;if(!checkContactEmpty(_0x3a52be)){_0x8e73b4[_0x5dd0('0xbe')](_0x35a0d4)['then'](sendMessageReschedule(_0x35a0d4))[_0x5dd0('0xb9')](loggerCatch(_0x5dd0('0xbf')));}else{_0x35a0d4[_0x5dd0('0x7a')]+=_0x3a52be[_0x5dd0('0x9f')];_0x35a0d4['message']=_0x35a0d4[_0x5dd0('0x62')]===_0x5dd0('0x7')?_0x5dd0('0x186'):_0x5dd0('0x210');for(var _0x59cd7a=0x0;_0x59cd7a<_0x3a52be['length'];_0x59cd7a+=0x1){if(_['isNil'](_0x3a52be[_0x59cd7a])||_[_0x5dd0('0xb5')](_0x3a52be[_0x59cd7a]['Contact'])||_[_0x5dd0('0xb5')](_0x3a52be[_0x59cd7a][_0x5dd0('0x17e')])){_0x8e73b4[_0x5dd0('0x212')]('[actionOriginate]\x20',_0x35a0d4,_0x3a52be[_0x59cd7a]);}else{_0x8e73b4[_0x5dd0('0xc0')](_['pick'](_0x3a52be[_0x59cd7a],['VoiceQueueId',_0x5dd0('0x17e')]))[_0x5dd0('0x43')](_0x8e73b4[_0x5dd0('0x213')](_0x35a0d4,_0x3a52be[_0x59cd7a]))[_0x5dd0('0xb9')](_0x8e73b4['loggerHandler'](_0x5dd0('0x218'),_0x35a0d4));}}}})[_0x5dd0('0xb9')](loggerGetContactDialer(_0x5dd0('0x219'),_0x35a0d4,_0x494cc1));}};Dialer[_0x5dd0('0x1b')]['handlePredictive']=function(_0x399a9d){if(_0x399a9d[_0x5dd0('0x216')]>0x0){var _0x567a3e=_0x399a9d[_0x5dd0('0x216')]-_0x399a9d[_0x5dd0('0x7a')]-_0x399a9d[_0x5dd0('0x5b')];if(_0x567a3e>0x0){this[_0x5dd0('0x21a')](_0x399a9d);}else{loggerPredictiveCalls[_0x5dd0('0x86')](_0x5dd0('0x21b'));}}else{this[_0x5dd0('0x21a')](_0x399a9d);}};Dialer[_0x5dd0('0x1b')][_0x5dd0('0x21a')]=function(_0x491dc4){var _0x1a690c=this;var _0x462b15=[];_0x491dc4['originated']+=0x1;for(var _0x31ef9a in this[_0x5dd0('0x21')]){if(typeof this['agents'][_0x31ef9a]!==_0x5dd0('0xb3')){if(this[_0x5dd0('0x21')][_0x31ef9a][_0x5dd0('0xaf')]===_0x5dd0('0x217')&&this['agents'][_0x31ef9a][_0x5dd0('0xb7')]===_0x5dd0('0x170')){_0x462b15[_0x5dd0('0x157')](this[_0x5dd0('0x21')][_0x31ef9a]['id']);}}}this[_0x5dd0('0xcc')](_0x491dc4['id'],_0x462b15,0x1,_0x491dc4[_0x5dd0('0x20f')],_0x491dc4)['then'](function(_0x3036c5){if(!checkContactEmpty(_0x3036c5)){checkContactLowerLimitOriginate(_0x491dc4,0x1,0x0);_0x1a690c[_0x5dd0('0xbe')](_0x491dc4)[_0x5dd0('0x43')](sendMessageReschedule(_0x491dc4))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x491dc4[_0x5dd0('0x45')]=_0x5dd0('0x210');if(_['isNil'](_0x3036c5[0x0])||_[_0x5dd0('0xb5')](_0x3036c5[0x0][_0x5dd0('0x196')])||_[_0x5dd0('0xb5')](_0x3036c5[0x0]['phone'])){_0x1a690c[_0x5dd0('0x212')]('[actionOriginate]\x20',_0x491dc4,_0x3036c5[0x0]);}else{_0x1a690c['checkIsBlackList'](_['pick'](_0x3036c5[0x0],['VoiceQueueId',_0x5dd0('0x17e')]))[_0x5dd0('0x43')](_0x1a690c['checkContactBlack'](_0x491dc4,_0x3036c5[0x0]))[_0x5dd0('0xb9')](_0x1a690c[_0x5dd0('0x214')](_0x5dd0('0x21c'),_0x491dc4));}}})[_0x5dd0('0xb9')](loggerGetContactDialer('[getContactDialerPredictive]',_0x491dc4,0x1));emitVoiceQueueSummary(_0x491dc4);};Dialer[_0x5dd0('0x1b')]['abandonmentRate']=function(_0x530eb1,_0x23ca99,_0x2c2c70,_0x32cd19,_0x1948b0,_0x77398a){loggerPredictive[_0x5dd0('0x86')](_0x5dd0('0x21d'));loggerPredictive[_0x5dd0('0x86')]('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',_0x530eb1);loggerPredictive[_0x5dd0('0x86')](_0x5dd0('0x21e'),_0x23ca99);loggerPredictive[_0x5dd0('0x86')]('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',_0x2c2c70);loggerPredictive[_0x5dd0('0x86')]('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',_0x32cd19);loggerPredictive[_0x5dd0('0x86')](_0x5dd0('0x21f'),_0x1948b0);loggerPredictive['info']('---------------------------');return new Promise(function(_0x44bb1d,_0x541382){if(_0x530eb1<=0x0||isNaN(_0x530eb1)){return _0x541382(msgResponse(_0x5dd0('0x220'),'Error',_0x5dd0('0x221')+_0x530eb1));}if(_0x2c2c70<=0x0||isNaN(_0x2c2c70)){return _0x541382(msgResponse(_0x5dd0('0x220'),_0x5dd0('0x222'),'Ts\x20=\x20'+_0x2c2c70));}if(_0x32cd19<=0x0||isNaN(_0x32cd19)){return _0x541382(msgResponse(_0x5dd0('0x220'),_0x5dd0('0x222'),_0x5dd0('0x223')+_0x32cd19));}if(_0x23ca99<=0x0||isNaN(_0x23ca99)){return _0x541382(msgResponse(_0x5dd0('0x220'),_0x5dd0('0x222'),'interval\x20=\x20'+_0x23ca99));}if(_0x1948b0<=0x0||isNaN(_0x1948b0)){return _0x541382(msgResponse('[abandonmentRate]',_0x5dd0('0x222'),_0x5dd0('0x224')+_0x1948b0));}_0x77398a=_0x77398a||0x0;var _0x1c66d2=0x1/_0x2c2c70;var _0x3bf586=0x0;var _0x17c2a8=0x0;var _0x3b043f=0x0;var _0x7c198d=0x0;for(var _0x5ebcee=0x0;_0x3b043f<_0x1948b0;_0x5ebcee+=0x1){_0x17c2a8=_0x5ebcee/_0x23ca99;_0x3bf586=(_0x32cd19*_0x17c2a8+_0x77398a)/_0x1c66d2;_0x3b043f=erlangb(_0x3bf586,_0x530eb1);_0x7c198d=_0x3bf586/_0x530eb1*(0x1-erlangb(_0x3bf586,_0x530eb1));}return _0x44bb1d({'erlangCalls':_0x5ebcee,'erlangCallToSecond':_0x23ca99/_0x5ebcee,'erlangAbandonmentRate':_0x3b043f,'erlangBusyFactor':_0x7c198d});});};Dialer[_0x5dd0('0x1b')][_0x5dd0('0x1ee')]=function(_0xb265bb,_0x3feb1c,_0x5288d6,_0x347c2d,_0x27b2fd,_0x3e814f){loggerPredictive[_0x5dd0('0x86')](_0x5dd0('0x225'));loggerPredictive[_0x5dd0('0x86')]('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',_0xb265bb);loggerPredictive[_0x5dd0('0x86')](_0x5dd0('0x21e'),_0x3feb1c);loggerPredictive['info'](_0x5dd0('0x226'),_0x5288d6);loggerPredictive[_0x5dd0('0x86')](_0x5dd0('0x227'),_0x347c2d);loggerPredictive[_0x5dd0('0x86')](_0x5dd0('0x228'),_0x27b2fd);loggerPredictive[_0x5dd0('0x86')](_0x5dd0('0x8d'));return new Promise(function(_0x227f4d,_0x284e18){if(_0xb265bb<=0x0||isNaN(_0xb265bb)){return _0x284e18(msgResponse(_0x5dd0('0x229'),_0x5dd0('0x222'),'m\x20=\x20'+_0xb265bb));}if(_0x5288d6<=0x0||isNaN(_0x5288d6)){return _0x284e18(msgResponse(_0x5dd0('0x229'),'Error',_0x5dd0('0x22a')+_0x5288d6));}if(_0x347c2d<=0x0||isNaN(_0x347c2d)){return _0x284e18(msgResponse('[busyFactor]',_0x5dd0('0x222'),_0x5dd0('0x223')+_0x347c2d));}if(_0x3feb1c<=0x0||isNaN(_0x3feb1c)){return _0x284e18(msgResponse(_0x5dd0('0x229'),_0x5dd0('0x222'),_0x5dd0('0x22b')+_0x3feb1c));}if(_0x27b2fd<=0x0||isNaN(_0x27b2fd)){return _0x284e18(msgResponse(_0x5dd0('0x229'),_0x5dd0('0x222'),_0x5dd0('0x22c')+_0x27b2fd));}_0x3e814f=_0x3e814f||0x0;var _0x241fbb=0x1/_0x5288d6;var _0xd016bf=0x0;var _0x121f50=0x0;var _0x4221f2=0x0;var _0x3b867a=0x0;for(var _0x57d596=0x0;_0x3b867a<_0x27b2fd;_0x57d596+=0x1){_0x121f50=_0x57d596/_0x3feb1c;_0xd016bf=(_0x347c2d*_0x121f50+_0x3e814f)/_0x241fbb;_0x4221f2=erlangb(_0xd016bf,_0xb265bb);_0x3b867a=_0xd016bf/_0xb265bb*(0x1-erlangb(_0xd016bf,_0xb265bb));}return _0x227f4d({'erlangCalls':_0x57d596,'erlangCallToSecond':_0x3feb1c/_0x57d596,'erlangAbandonmentRate':_0x4221f2,'erlangBusyFactor':_0x3b867a});});};module[_0x5dd0('0x22d')]=Dialer;
\ No newline at end of file
+var _0x9a61=['object','originate','voiceQueue\x20is\x20undefine','phone','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialQueueTimeout','XMD-AMDGREETING','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','isOutboundQueue','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','getCallerId','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialDropMaxRetry','[rescheduleContact][Abandoned]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','checkRetriveMax','dialNoSuchNumberMaxRetry','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','buildNoAnswerEventPayload','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','custom:agentbusy','busy','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','Success','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','predictiveIntervalHitRate','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','recalculate\x20predictive\x20at','avgHandleTime','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','predictiveIntervalAnsweredCalls','predictiveIntervalTotalCalls','abandonmentRate','agentBusyFactor','busyFactor','Unknown\x20Predictive','[getDataPredictive]','check\x20failure','loggedIn','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','one\x20call\x20every:','milliseconds','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','voicePause','unlockContact','outboundReCallsDay','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','Blacklist','limitCalls','temp','getContactDialerIvr','dialOrderByScheduledAt','checkContactEmpty','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','emptyContact','[actionOriginate]\x20','checkIsBlackListIvr','loggerHandler','[actionOriginateIvr]\x20','dialLimitQueue','not_inuse','[countReScheduled]\x20','checkIsBlackList','[getContactDialer2]','[handlePredictive][limitChannel]','tryOriginatePredictive','countReScheduled','[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','m\x20=\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\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]','exports','util','lodash','uuid','moment','ioredis','./utils/hopper','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','predictive','syncQueueSummary','redis','defaults','localhost','socket.io-emitter','../rpc/voiceQueueRt','../rpc/setting','../rpc/interval','./models/action','./models/final','./models/agentComplete','./models/hangup','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','ivrOriginated','queueBookedRR','queuesSummary','bind','queuecallerabandon','agentcomplete','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','syncQueueSummaryComplete','syncHangup','syncNewExten','varset','syncQueueMember','queuestatuscomplete','loopCampaigns','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','emit','type','outbound','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','format','voice:queue:%s','-----\x20Stats\x20Predictive\x20---','info','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','isUndefined','predictiveIntervalAvgTalktime','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','getSeconds','startProgressive','debug','name','startProgressive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','checkContactLowerLimitOriginate','contactsRescheduled','message','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','Interval','NULL_INTERVAL','\x20INTERVAL_IS_NULL','isEmpty','isIVRCampaignActive','INACTIVE','campaign:ivr:%s','sendMessageOneNotActive','originated','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','DISACTIVED','is\x20disactive','[ifTime][Action]','prototype','isTrunkReachable','active','SIP/%s','status','reachable','unmonitored','checkIsTrunkReachable','Trunk','TrunkBackup','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','ifTimeIvr','checkIfTimeIntervals','Intervals','ifTime','Failure','\x20Intervals\x20is\x20empty\x20','timezones','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','isArray','length','push','Action','command','interval','content','indexOf','true','catch','iftime\x20%s,%s','all','some','OVERTIME_GLOBAL_INTERVAL','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','resetActiveCalls','syncCampaigns','undefined','isIVRCampaign','dialGlobalInterval','dialTimezone','launchHandleIvr','[syncCampaigns]','checkDialMethod','dialMethod','progressive','handlePower','dialPowerLevel','booked','method\x20not\x20recognized','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','Global:\x20','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','AMI\x20IfTime','Error','syncAgentConnect','queue','uniqueid','ivr','updateOriginated','YYYY-MM-DD\x20HH:mm:ss','reason','agent','agiafterat','dialAgiAfterHangupAgent','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','droptime','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','statedesc','Drop','dropreason','TIMEOUT','callAdditionalPhoneAfterMin','voiceQueue','additional','queueCallerAbandonCreateState','rescheduleContact','countdropretry','dialDropRetryFrequency','minutes','ContactId','ListId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','starttime','endtime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','countabandonedretry','dialAbandonedRetryFrequency','verifyAdditionalPhones','dialAbandonedMaxRetry','add','channel','actionid','strategy','rrmemory','roundrobin','isNil','stateinterface','locked','queueBooked','pick','paused','syncQueueStatusComplete','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','contactAgent-idHopper:\x20','[booked][RR][finaly]','Agent:\x20','[booked][unlock]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','responsetime','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','AMD','custom:amd','buildObj','saveInDb','[syncHangupInAMD][createHistory]','Machine','countmachineretry','countglobal','amd','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','dialGlobalMaxRetry','stateGlobal','dialMachineMaxRetry','dialMachineRetryFrequency','[rescheduleContact][Machine]','HangupInAMD','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','membername','countagentrejectretry','reason19\x20machine....','createStateFinal','reason\x2019\x20machine....','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','dialQueueProject','AnswerAGI','[syncHangupIvr]','outboundUnknownCallsDay','Unknow','running','isPreviewCampaign','statusMessage','getQueueCampaignStatusMessage','resolve','available','inUse','talking','pTalking','ACTIVE','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','throttle','dialPreviewRecallmeReminder','filter','online','handlePreviewRecallNotifications','map','Agent','user:dialPreviewRecallReminder','checkPreviewRecallReminder','clearZombieChannels','[uniqueid]','No\x20such\x20channel','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[updateOriginated]\x20is\x20null\x20or\x20undefined','notFound','UserId','[emptyContact][createHistory]','[emptyContact]','[syncQueueCallerAbandon]\x20[Drop]','user:%s','handleIvr','actionOriginate'];(function(_0x137eef,_0x83dd71){var _0x454be4=function(_0xd2e319){while(--_0xd2e319){_0x137eef['push'](_0x137eef['shift']());}};_0x454be4(++_0x83dd71);}(_0x9a61,0xc5));var _0x19a6=function(_0x390f16,_0x58ca29){_0x390f16=_0x390f16-0x0;var _0x212532=_0x9a61[_0x390f16];return _0x212532;};'use strict';var util=require(_0x19a6('0x0'));var _=require(_0x19a6('0x1'));var uuid=require(_0x19a6('0x2'));var moment=require(_0x19a6('0x3'));var rr=require('rr');var Redis=require(_0x19a6('0x4'));var utils=require('./utils');var hopperUtils=require(_0x19a6('0x5'));var ut=require(_0x19a6('0x6'));var config=require(_0x19a6('0x7'));var logger=require(_0x19a6('0x8'))(_0x19a6('0x9'));var loggerBooked=require(_0x19a6('0x8'))('booked');var loggerPredictive=require(_0x19a6('0x8'))(_0x19a6('0xa'));var loggerPredictiveCalls=require('../../../config/logger')('predictiveCalls');var loggerSyncQueueSummary=require(_0x19a6('0x8'))(_0x19a6('0xb'));var ami=require('../ami');config[_0x19a6('0xc')]=_[_0x19a6('0xd')](config['redis'],{'host':_0x19a6('0xe'),'port':0x18eb});var io=require(_0x19a6('0xf'))(new Redis(config[_0x19a6('0xc')]));var cmHopper=require('../rpc/cmHopper');var voiceQueueRt=require(_0x19a6('0x10'));var RpcSetting=require(_0x19a6('0x11'));var Interval=require(_0x19a6('0x12'));var Action=require(_0x19a6('0x13'));var History=require('./models/history');var Final=require(_0x19a6('0x14'));var AgentComplete=require(_0x19a6('0x15'));var QueueCallerAbandon=require('./models/queueCallerAbandon');var Hangup=require(_0x19a6('0x16'));var ipAgi=process['env']['XCALLY_IP_AGI']||'127.0.0.1';var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence['prototype'][_0x19a6('0x17')]=function(_0x3ab990){this[_0x19a6('0x18')]=this['tail']?this[_0x19a6('0x18')][_0x19a6('0x19')](_0x3ab990):_0x3ab990();};function Dialer(_0x1023a1,_0x38ca5c){this[_0x19a6('0x1a')]=new Sequence();this[_0x19a6('0x1b')]=_0x38ca5c;this[_0x19a6('0x1c')]=_0x1023a1[_0x19a6('0x1c')];this['campaigns']=_0x1023a1[_0x19a6('0x1d')];this[_0x19a6('0x1e')]=_0x1023a1['agents'];this[_0x19a6('0x1f')]=_0x1023a1[_0x19a6('0x1f')];this[_0x19a6('0x20')]=config[_0x19a6('0x20')]||0x2;this[_0x19a6('0x21')]={};this[_0x19a6('0x22')]={};this[_0x19a6('0x23')]={};this[_0x19a6('0x24')]={};this[_0x19a6('0x25')]={};this[_0x19a6('0x26')]={};this['startProgressive']={};this[_0x19a6('0x27')]={};this['queueBooked']={};this[_0x19a6('0x28')]={};this[_0x19a6('0x29')]={};ami['on']('agentconnect',this['syncAgentConnect'][_0x19a6('0x2a')](this));ami['on'](_0x19a6('0x2b'),this['syncQueueCallerAbandon'][_0x19a6('0x2a')](this));ami['on']('originateresponse',this['syncOriginateResponse'][_0x19a6('0x2a')](this));ami['on'](_0x19a6('0x2c'),this[_0x19a6('0x2d')]['bind'](this));ami['on'](_0x19a6('0x2e'),this[_0x19a6('0xb')][_0x19a6('0x2a')](this));ami['on'](_0x19a6('0x2f'),this[_0x19a6('0x30')][_0x19a6('0x2a')](this));ami['on']('hangup',this[_0x19a6('0x31')][_0x19a6('0x2a')](this));ami['on']('newexten',this[_0x19a6('0x32')][_0x19a6('0x2a')](this));ami['on'](_0x19a6('0x33'),this['syncVarSet']['bind'](this));ami['on']('queuemember',this[_0x19a6('0x34')][_0x19a6('0x2a')](this));ami['on'](_0x19a6('0x35'),this['syncQueueStatusComplete']['bind'](this));this[_0x19a6('0x36')]();this[_0x19a6('0x37')]();RpcSetting[_0x19a6('0x38')]()[_0x19a6('0x39')](function(_0x48887b){previewRecallmeReminderInterval=_0x48887b[_0x19a6('0x3a')];});}function isNotNull(_0x2a141d){return _0x2a141d!==null&&!_['isUndefined'](_0x2a141d);}function msgResponse(_0x404ebf,_0x46f54c,_0x2f04bb){return{'action':_0x404ebf,'response':_0x46f54c,'message':_0x2f04bb,'stack':_0x2f04bb};}function emit(_0x5a4a0a,_0x468caa,_0x213b45){io['to'](_0x5a4a0a)[_0x19a6('0x3b')](_0x468caa,_0x213b45);}function emitOutboundVoiceQueueSummary(_0x4e5ec6){if(_0x4e5ec6[_0x19a6('0x3c')]===_0x19a6('0x3d')){logger['debug'](_0x19a6('0x3e'),util[_0x19a6('0x3f')](_0x4e5ec6,{'showHidden':![],'depth':null}));emit(util[_0x19a6('0x40')](_0x19a6('0x41'),_0x4e5ec6['name']),'voice_queue:save',_0x4e5ec6);}}function checkGetDataPredictive(_0x14e83a){if(isNotNull(_0x14e83a)&&!_['isEmpty'](_0x14e83a)){loggerPredictive['info'](_0x19a6('0x42'));loggerPredictive[_0x19a6('0x43')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x14e83a['predictiveIntervalTotalCalls']);loggerPredictive[_0x19a6('0x43')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x14e83a['predictiveIntervalAnsweredCalls']);loggerPredictive['info'](_0x19a6('0x44'),_0x14e83a[_0x19a6('0x45')]);loggerPredictive[_0x19a6('0x43')](_0x19a6('0x46'),_0x14e83a[_0x19a6('0x47')]);loggerPredictive[_0x19a6('0x43')](_0x19a6('0x48'),_0x14e83a[_0x19a6('0x49')]);loggerPredictive[_0x19a6('0x43')](_0x19a6('0x4a'),_0x14e83a['predictiveIntervalAvgTalktime']);loggerPredictive[_0x19a6('0x43')](_0x19a6('0x4b'));if(_0x14e83a['predictiveIntervalTotalCalls']>0x0){if(!_[_0x19a6('0x4c')](_0x14e83a[_0x19a6('0x4d')])&&_0x14e83a[_0x19a6('0x4d')]>0x0){return!![];}loggerPredictive['info'](_0x19a6('0x4e'));if(!_[_0x19a6('0x4c')](_0x14e83a[_0x19a6('0x49')])&&_0x14e83a[_0x19a6('0x49')]>0x0){return!![];}loggerPredictive[_0x19a6('0x43')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0x19a6('0x43')](_0x19a6('0x4f'));}}else{loggerPredictive[_0x19a6('0x43')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x444d06){return function(_0x7218d){loggerPredictive[_0x19a6('0x43')](_0x19a6('0x50'));loggerPredictive[_0x19a6('0x43')](_0x19a6('0x51'),_0x7218d[_0x19a6('0x52')]);loggerPredictive[_0x19a6('0x43')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x7218d[_0x19a6('0x53')]);loggerPredictive[_0x19a6('0x43')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x7218d[_0x19a6('0x54')]);loggerPredictive['info'](_0x19a6('0x55'),_0x7218d[_0x19a6('0x56')]);loggerPredictive[_0x19a6('0x43')](_0x19a6('0x57'),_0x7218d['erlangAbandonmentRate']);loggerPredictive[_0x19a6('0x43')](_0x19a6('0x4b'));_[_0x19a6('0x58')](_0x444d06,_0x7218d);};}function ifInterval(_0x4137b4,_0x3afe43){if(_[_0x19a6('0x4c')](_0x3afe43)){return![];}return utils[_0x19a6('0x59')](undefined,_0x3afe43)<_0x4137b4*0x3c;}function clearPredictiveAttributes(_0xc1fda){if(_0xc1fda[_0x19a6('0x5a')]){_0xc1fda[_0x19a6('0x5a')]=undefined;loggerPredictive[_0x19a6('0x5b')](_0xc1fda[_0x19a6('0x5c')],_0x19a6('0x5d'));}if(_0xc1fda[_0x19a6('0x26')]){_0xc1fda['startPredictive']=undefined;loggerPredictive['debug'](_0xc1fda[_0x19a6('0x5c')],'startPredictive\x20value\x20cleared');}if(_0xc1fda[_0x19a6('0x5e')]){clearInterval(_0xc1fda['handlePredictive']);_0xc1fda[_0x19a6('0x5e')]=undefined;loggerPredictive[_0x19a6('0x5b')](_0xc1fda[_0x19a6('0x5c')],_0x19a6('0x5f'));}}function loggerCatchPredictive(_0x4ca2a9,_0x1f40e7){return function(_0x4ad996){loggerPredictive['error'](_0x1f40e7['name'],_0x4ca2a9);loggerPredictive[_0x19a6('0x60')](_0x4ad996[_0x19a6('0x61')]);clearPredictiveAttributes(_0x1f40e7);};}function loggerCatch(_0x2c6636){return function(_0x1d8427){logger['error'](_0x2c6636,util[_0x19a6('0x3f')](_0x1d8427,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x35a50b,_0x2f03ff,_0x134125){return function(_0x37b7e5){utils[_0x19a6('0x62')](_0x2f03ff,_0x134125,0x0);logger[_0x19a6('0x60')](_0x35a50b,util[_0x19a6('0x3f')](_0x37b7e5,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0xcc8352){return function(_0x298be4){if(isNotNull(_0x298be4)&&isNotNull(_0x298be4[0x0])){if(_0x298be4[0x0][_0x19a6('0x63')]>0x0){_0xcc8352[_0x19a6('0x64')]=utils[_0x19a6('0x65')][_0x19a6('0x66')];logger[_0x19a6('0x43')](_0x19a6('0x67')+_0xcc8352['name'],_0x298be4[0x0]['contactsRescheduled'],'contacts');}else{_0xcc8352[_0x19a6('0x64')]=utils[_0x19a6('0x65')][_0x19a6('0x68')];logger[_0x19a6('0x43')](_0x19a6('0x69')+_0xcc8352[_0x19a6('0x5c')]);}}};}function createObjHistory(_0x53e97e,_0x151377,_0x240dd1,_0x2c92f0,_0x10fd01){_0x53e97e[_0x19a6('0x64')]=_0x240dd1;var _0x322bb5=new Action(_0x53e97e,_0x151377);var _0x2f2602=new History(_0x322bb5);_0x2f2602[_0x19a6('0x6a')]=_0x2c92f0;_0x2f2602['statedesc']=_0x10fd01;_0x2f2602['endtime']=_0x322bb5['starttime'];return _0x2f2602;}function unlockQueueStatus(_0x124138,_0xb55294){setTimeout(function(){if(_['isUndefined'](_0x124138[_0x19a6('0x6b')])){loggerBooked[_0x19a6('0x60')](_0x19a6('0x6c'),_0xb55294);}_0x124138[_0x19a6('0x6b')]=!![];loggerBooked[_0x19a6('0x43')](_0x19a6('0x6d'),_0xb55294,JSON[_0x19a6('0x6e')](_['pick'](_0x124138,[_0x19a6('0x5c'),_0x19a6('0x6b')])));},0x1f3);}function checkInterval(_0xa9336a){return function(){if(!isNotNull(_0xa9336a[_0x19a6('0x6f')])){_0xa9336a[_0x19a6('0x64')]=utils[_0x19a6('0x65')][_0x19a6('0x70')];throw _0xa9336a['name']+_0x19a6('0x71');}if(!isNotNull(_0xa9336a['Interval']['Intervals'])){_0xa9336a[_0x19a6('0x64')]=utils[_0x19a6('0x65')][_0x19a6('0x70')];throw _0xa9336a[_0x19a6('0x5c')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x19a6('0x72')](_0xa9336a['Interval']['Intervals']))){_0xa9336a['message']=utils[_0x19a6('0x65')][_0x19a6('0x70')];throw _0xa9336a[_0x19a6('0x5c')]+_0x19a6('0x71');}};}function checkIsIVRCampaignActive(_0x1bc8ce){return function(){if(!utils[_0x19a6('0x73')](_0x1bc8ce)){_0x1bc8ce['message']=utils[_0x19a6('0x65')][_0x19a6('0x74')];throw _0x1bc8ce['name']+'\x20NOT\x20Active';}};}function emitCampaignSummary(_0x307983){if(utils['isIVRCampaign'](_0x307983)){emit(util[_0x19a6('0x40')](_0x19a6('0x75'),_0x307983['name']),'campaign:save',_0x307983);}}function loggerCatchQueueSummary(_0x34e59c,_0x158f5a){return function(_0x16cefe){clearPredictiveAttributes(_0x158f5a);emitCampaignSummary(_0x158f5a);loggerSyncQueueSummary['debug'](_0x34e59c,util[_0x19a6('0x3f')](_0x16cefe,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x45480a){if(_0x45480a[_0x19a6('0x76')]){if(_0x45480a[_0x19a6('0x77')]===0x0){_0x45480a[_0x19a6('0x76')]=![];_0x45480a[_0x19a6('0x64')]=utils[_0x19a6('0x65')]['INACTIVE'];loggerSyncQueueSummary[_0x19a6('0x5b')](_0x19a6('0x78'),_0x45480a[_0x19a6('0x5c')],'is\x20not\x20active');}else{_0x45480a[_0x19a6('0x64')]=utils[_0x19a6('0x65')][_0x19a6('0x79')];loggerSyncQueueSummary[_0x19a6('0x5b')](_0x19a6('0x78'),_0x45480a['name'],_0x19a6('0x7a'));}emitCampaignSummary(_0x45480a);}}function myreject(_0x27152d){return function(_0x2b3d1e){return _0x27152d(msgResponse(_0x19a6('0x7b'),'Error',JSON['stringify'](_0x2b3d1e)));};}Dialer[_0x19a6('0x7c')][_0x19a6('0x7d')]=function(_0x36d958){return!_[_0x19a6('0x4c')](_0x36d958)&&_0x36d958&&!_['isUndefined'](_0x36d958[_0x19a6('0x5c')])&&!_[_0x19a6('0x4c')](_0x36d958[_0x19a6('0x7e')])&&_0x36d958[_0x19a6('0x7e')]&&(this[_0x19a6('0x1f')][util['format'](_0x19a6('0x7f'),_0x36d958[_0x19a6('0x5c')])][_0x19a6('0x80')]===_0x19a6('0x81')||this[_0x19a6('0x1f')][util['format']('SIP/%s',_0x36d958[_0x19a6('0x5c')])][_0x19a6('0x80')]===_0x19a6('0x82'));};Dialer['prototype'][_0x19a6('0x83')]=function(_0x5c26c4){var _0xdf59f1=this;return function(){if(!_0xdf59f1[_0x19a6('0x7d')](_0x5c26c4[_0x19a6('0x84')])){if(!_0xdf59f1[_0x19a6('0x7d')](_0x5c26c4[_0x19a6('0x85')])){_0x5c26c4['message']=utils[_0x19a6('0x65')][_0x19a6('0x86')];throw _0x5c26c4[_0x19a6('0x5c')]+_0x19a6('0x87');}}};};Dialer['prototype']['checkIfTime']=function(_0x133593,_0xd2fdf5,_0x18f1bc,_0x14e574){var _0x1f55e4=this;return function(){var _0x5d8993=!![];return _0x1f55e4[_0x19a6('0x88')](_0x133593,_0xd2fdf5,_0x18f1bc,_0x14e574,_0x5d8993);};};Dialer[_0x19a6('0x7c')][_0x19a6('0x89')]=function(_0x44b86f,_0x21bb3b,_0x2d8ccb,_0x2e6f95){var _0x4f0319=this;return function(){var _0x47ecde=![];return _0x4f0319[_0x19a6('0x88')](_0x44b86f[_0x19a6('0x8a')],_0x21bb3b,_0x2d8ccb,_0x2e6f95,_0x47ecde);};};Dialer['prototype'][_0x19a6('0x88')]=function(_0x3e8706,_0x340dc1,_0x43326d,_0x26a802,_0x1ef95b){var _0x3ac2ea=[];return new Promise(function(_0x4ee307,_0x33586c){if(!isNotNull(_0x3e8706)){_0x26a802[_0x19a6('0x64')]=utils['CAMPAIGN_STATUS']['NULL_INTERVAL'];return _0x33586c(msgResponse(_0x19a6('0x8b'),_0x19a6('0x8c'),_0x43326d+'\x20Intervals\x20is\x20null\x20'));}if(_[_0x19a6('0x72')](_0x3e8706)){_0x26a802[_0x19a6('0x64')]=utils[_0x19a6('0x65')]['EMPTY_INTERVAL'];return _0x33586c(msgResponse('ifTime',_0x19a6('0x8c'),_0x43326d+_0x19a6('0x8d')));}if(_0x340dc1&&_['isUndefined'](config[_0x19a6('0x8e')][_0x340dc1])){_0x26a802['message']=utils[_0x19a6('0x65')][_0x19a6('0x8f')];return _0x33586c(msgResponse(_0x19a6('0x8b'),_0x19a6('0x8c'),_0x43326d+_0x19a6('0x90')+_0x340dc1));}if(_[_0x19a6('0x91')](_0x3e8706)){for(var _0x5b3bac=0x0;_0x5b3bac<_0x3e8706[_0x19a6('0x92')];_0x5b3bac+=0x1){_0x3ac2ea[_0x19a6('0x93')](ami[_0x19a6('0x94')]({'action':_0x19a6('0x95'),'command':util['format']('iftime\x20%s,%s',_0x3e8706[_0x5b3bac][_0x19a6('0x96')],!_[_0x19a6('0x4c')](config[_0x19a6('0x8e')][_0x340dc1])?_0x340dc1:'')})[_0x19a6('0x39')](function(_0x9286dd){return _0x9286dd[_0x19a6('0x97')][_0x19a6('0x98')](_0x19a6('0x99'))>=0x0;})[_0x19a6('0x9a')](myreject(_0x33586c)));}}else{_0x3ac2ea[_0x19a6('0x93')](ami[_0x19a6('0x94')]({'action':_0x19a6('0x95'),'command':util[_0x19a6('0x40')](_0x19a6('0x9b'),_0x3e8706,!_[_0x19a6('0x4c')](config[_0x19a6('0x8e')][_0x340dc1])?_0x340dc1:'')})['then'](function(_0x50f232){return _0x50f232[_0x19a6('0x97')][_0x19a6('0x98')]('true')>=0x0;})['catch'](myreject(_0x33586c)));}Promise[_0x19a6('0x9c')](_0x3ac2ea)[_0x19a6('0x39')](function(_0x430a5b){var _0xe1d8d5=_[_0x19a6('0x9d')](_0x430a5b);if(_0xe1d8d5){return _0x4ee307(_0xe1d8d5);}else{_0x26a802[_0x19a6('0x64')]=_0x1ef95b?utils[_0x19a6('0x65')][_0x19a6('0x9e')]:utils[_0x19a6('0x65')]['OVERTIME_INTERVAL'];return _0x33586c(msgResponse('[ifTime][promiseAll]',_0x19a6('0x8c'),'Global:\x20'+_0x1ef95b+'\x20'+_0x43326d+_0x19a6('0x9f')+util[_0x19a6('0x3f')](_0x3e8706,{'showHidden':![],'depth':null})+_0x19a6('0xa0')+_0x340dc1));}})[_0x19a6('0x9a')](function(_0x347e64){return _0x33586c(msgResponse(_0x19a6('0x8b'),_0x19a6('0x8c'),JSON[_0x19a6('0x6e')](_0x347e64)));});});};Dialer[_0x19a6('0x7c')][_0x19a6('0x36')]=function(){var _0xe15d7=this;return cmHopper[_0x19a6('0xa1')]({'active':![]},{'where':{'active':!![]}})[_0x19a6('0x39')](function(){setInterval(function(){_0xe15d7[_0x19a6('0xa2')]();},0x3e8);});};Dialer[_0x19a6('0x7c')][_0x19a6('0xa2')]=function(){var _0x395777=this;var _0x3eb55b;for(var _0x4fc16d in this['campaigns']){if(typeof this[_0x19a6('0x1d')][_0x4fc16d]!==_0x19a6('0xa3')){_0x3eb55b=this['campaigns'][_0x4fc16d];if(utils[_0x19a6('0xa4')](_0x3eb55b)&&utils['isIVRCampaignActive'](_0x3eb55b)){_0x3eb55b[_0x19a6('0x76')]=!![];Promise['resolve']()[_0x19a6('0x39')](checkIsIVRCampaignActive(_0x3eb55b))['then'](checkInterval(_0x3eb55b))['then'](_0x395777[_0x19a6('0x83')](_0x3eb55b))[_0x19a6('0x39')](_0x395777['checkIfTime'](_0x3eb55b[_0x19a6('0xa5')],_0x3eb55b['dialTimezone'],_0x3eb55b[_0x19a6('0x5c')],_0x3eb55b))[_0x19a6('0x39')](_0x395777['checkIfTimeIntervals'](_0x3eb55b[_0x19a6('0x6f')],_0x3eb55b[_0x19a6('0xa6')],_0x3eb55b[_0x19a6('0x5c')],_0x3eb55b))[_0x19a6('0x39')](_0x395777[_0x19a6('0xa7')](_0x3eb55b))['catch'](loggerCatchQueueSummary(_0x19a6('0xa8'),_0x3eb55b));}else{notSendMessagesCampaign(_0x3eb55b);}}}};Dialer[_0x19a6('0x7c')][_0x19a6('0xa9')]=function(_0x2adba4){if(_0x2adba4[_0x19a6('0xaa')]!==_0x19a6('0xa')){clearPredictiveAttributes(_0x2adba4);}switch(_0x2adba4[_0x19a6('0xaa')]){case _0x19a6('0xab'):this[_0x19a6('0xac')](_0x2adba4,0x1);break;case'power':this[_0x19a6('0xac')](_0x2adba4,_0x2adba4[_0x19a6('0xad')]);break;case'predictive':this[_0x19a6('0xa')](_0x2adba4);break;case _0x19a6('0xae'):this[_0x19a6('0xac')](_0x2adba4,0x1);break;default:logger['error']('Queue',_0x2adba4[_0x19a6('0x5c')],_0x19a6('0xaf'));}};Dialer[_0x19a6('0x7c')][_0x19a6('0x8b')]=function(_0x1282f1,_0x36bb47){var _0x1ccaf8=_0x1282f1[_0x19a6('0xa6')];var _0x4b00c1=_0x36bb47?_0x1282f1['dialGlobalInterval']:_0x1282f1[_0x19a6('0x6f')]['Intervals'];logger[_0x19a6('0xb0')](_0x19a6('0xb1'),_0x4b00c1,_0x1ccaf8,_0x1282f1['name'],util[_0x19a6('0x40')](_0x19a6('0xb2'),_0x1282f1[_0x19a6('0x5c')],_0x1282f1['id']));var _0x2ce3fa=null;return Interval[_0x19a6('0xb3')](_0x4b00c1,_0x1ccaf8)[_0x19a6('0x39')](function(_0x454a88){if(_0x454a88===!![]){return _0x454a88;}else{_0x1282f1[_0x19a6('0x64')]=_0x36bb47?utils[_0x19a6('0x65')][_0x19a6('0x9e')]:utils[_0x19a6('0x65')]['OVERTIME_INTERVAL'];_0x2ce3fa=msgResponse('[ifTime][promiseAll]',_0x19a6('0x8c'),_0x19a6('0xb4')+_0x36bb47+'\x20'+_0x1282f1[_0x19a6('0x5c')]+_0x19a6('0x9f')+util['inspect'](_0x4b00c1,{'showHidden':![],'depth':null})+_0x19a6('0xa0')+_0x1ccaf8);}if(_0x2ce3fa!==null){logger[_0x19a6('0xb0')](_0x19a6('0xb5'),_0x2ce3fa);_0x2ce3fa[_0x19a6('0xb6')]=_0x36bb47;throw _0x2ce3fa;}})[_0x19a6('0x9a')](function(_0x31d376){logger[_0x19a6('0x60')](_0x19a6('0xb7'),_0x31d376);throw msgResponse(_0x19a6('0x7b'),_0x19a6('0xb8'),util[_0x19a6('0x3f')](_0x31d376,{'showHidden':![],'depth':null}));});};Dialer['prototype'][_0x19a6('0xb9')]=function(_0x36c6db){if(this['voiceQueues'][_0x36c6db[_0x19a6('0xba')]]){if(this[_0x19a6('0x24')][_0x36c6db[_0x19a6('0xbb')]]&&this[_0x19a6('0x24')][_0x36c6db['uniqueid']][_0x19a6('0x3c')]!==_0x19a6('0xbc')){this[_0x19a6('0xbd')](this[_0x19a6('0x1c')][_0x36c6db[_0x19a6('0xba')]]);this[_0x19a6('0x24')][_0x36c6db[_0x19a6('0xbb')]]['answertime']=moment()[_0x19a6('0x40')](_0x19a6('0xbe'));}}};Dialer['prototype'][_0x19a6('0x2d')]=function(_0x242bad){var _0x52a687=this[_0x19a6('0x24')][_0x242bad[_0x19a6('0xbb')]];if(this[_0x19a6('0x1c')][_0x242bad['queue']]){if(_0x52a687&&_0x52a687[_0x19a6('0x3c')]!==_0x19a6('0xbc')){delete this[_0x19a6('0x24')][_0x242bad[_0x19a6('0xbb')]];this['voiceQueues'][_0x242bad[_0x19a6('0xba')]]['outboundAnswerCallsDay']+=0x1;var _0x4082a5=new AgentComplete(_0x52a687,_0x242bad);if(_0x242bad[_0x19a6('0xbf')]===_0x19a6('0xc0')){_0x4082a5[_0x19a6('0xc1')]=this['voiceQueues'][_0x242bad[_0x19a6('0xba')]]['dialQueueProject2']&&this[_0x19a6('0x1c')][_0x242bad[_0x19a6('0xba')]][_0x19a6('0xc2')]?moment()[_0x19a6('0x40')](_0x19a6('0xbe')):undefined;}hopperUtils[_0x19a6('0xc3')](_0x4082a5)[_0x19a6('0x9a')](loggerCatch(_0x19a6('0xc4')));hopperUtils[_0x19a6('0xc5')](_0x4082a5)[_0x19a6('0x9a')](loggerCatch(_0x19a6('0xc6')));}}};Dialer[_0x19a6('0x7c')]['syncQueueCallerAbandon']=function(_0x2e6638){var _0x277c97=this[_0x19a6('0x24')][_0x2e6638[_0x19a6('0xbb')]];var _0x3e5b3a=this;var _0x8e4b20=![];var _0x543eda;var _0x285919;if(this[_0x19a6('0x1c')][_0x2e6638[_0x19a6('0xba')]]){if(_0x277c97&&_0x277c97[_0x19a6('0x3c')]!=='ivr'){delete this[_0x19a6('0x24')][_0x2e6638[_0x19a6('0xbb')]];this[_0x19a6('0xbd')](this[_0x19a6('0x1c')][_0x2e6638['queue']]);_0x277c97[_0x19a6('0xc7')]=moment()[_0x19a6('0x40')](_0x19a6('0xbe'));var _0x4864b4=new QueueCallerAbandon(_0x277c97,_0x2e6638);if(utils[_0x19a6('0x59')](_0x277c97['droptime'],_0x277c97['responsetime'])>=_0x277c97['dialQueueTimeout']){this[_0x19a6('0x1c')][_0x2e6638['queue']][_0x19a6('0x45')]+=0x1;this['voiceQueues'][_0x2e6638[_0x19a6('0xba')]][_0x19a6('0xc8')]+=0x1;this[_0x19a6('0x1c')][_0x2e6638[_0x19a6('0xba')]][_0x19a6('0xc9')]+=0x1;_0x4864b4[_0x19a6('0x6a')]=0xa;_0x4864b4[_0x19a6('0xca')]=_0x19a6('0xcb');_0x4864b4[_0x19a6('0xcc')]=_0x19a6('0xcd');_0x4864b4['agiafterat']=this['voiceQueues'][_0x2e6638['queue']]['dialQueueProject2']?moment()['format'](_0x19a6('0xbe')):undefined;_0x4864b4['countdropretry']+=0x1;_0x4864b4['countglobal']+=0x1;_0x543eda=this[_0x19a6('0x1c')][_0x2e6638[_0x19a6('0xba')]]['dialDropRetryFrequency'];_0x285919=this['voiceQueues'][_0x2e6638[_0x19a6('0xba')]][_0x19a6('0xce')];hopperUtils['verifyAdditionalPhones'](_0x4864b4,_0x4864b4['state'],_0x277c97[_0x19a6('0xcf')])[_0x19a6('0x39')](function(_0x1f9ca1){_0x8e4b20=_0x1f9ca1[_0x19a6('0xd0')]==0x1;if(_0x4864b4['countdropretry']>=_0x3e5b3a[_0x19a6('0x1c')][_0x2e6638[_0x19a6('0xba')]]['dialDropMaxRetry']){_0x3e5b3a[_0x19a6('0xd1')](_0x4864b4,_0x1f9ca1['additional']);}else{hopperUtils[_0x19a6('0xd2')]({'active':![],'countdropretry':_0x4864b4[_0x19a6('0xd3')],'scheduledat':moment()['add'](_0x3e5b3a[_0x19a6('0x1c')][_0x2e6638[_0x19a6('0xba')]][_0x19a6('0xd4')],_0x19a6('0xd5'))['format'](_0x19a6('0xbe')),'ContactId':_0x277c97[_0x19a6('0xd6')],'ListId':_0x277c97[_0x19a6('0xd7')],'VoiceQueueId':_0x277c97[_0x19a6('0xd8')]||undefined,'CampaignId':_0x277c97[_0x19a6('0xd9')]||undefined})['catch'](loggerCatch(_0x19a6('0xda')));var _0x1298fc=new History(_0x4864b4);_0x1298fc[_0x19a6('0x6a')]=0xa;_0x1298fc[_0x19a6('0xca')]=_0x19a6('0xcb');_0x1298fc[_0x19a6('0xdb')]=moment()[_0x19a6('0x40')](_0x19a6('0xbe'));_0x1298fc[_0x19a6('0xdc')]=_0x1298fc[_0x19a6('0xdb')];_0x1298fc[_0x19a6('0xdd')]=_0x4864b4[_0x19a6('0xdd')];_0x1298fc[_0x19a6('0xde')]=_0x4864b4[_0x19a6('0xde')];hopperUtils[_0x19a6('0xc3')](_0x1298fc)['catch'](loggerCatch(_0x19a6('0xdf')));}})['then'](function(){if(_0x8e4b20)hopperUtils[_0x19a6('0xe0')](_0x4864b4,_0x543eda,_0x285919)[_0x19a6('0x39')](function(){return 0x1;});});}else{this[_0x19a6('0x1c')][_0x2e6638['queue']][_0x19a6('0x47')]+=0x1;this['voiceQueues'][_0x2e6638[_0x19a6('0xba')]][_0x19a6('0xe1')]+=0x1;_0x4864b4[_0x19a6('0x6a')]=0xb;_0x4864b4[_0x19a6('0xca')]=_0x19a6('0xe2');_0x4864b4[_0x19a6('0xcc')]=_0x19a6('0xe3');_0x4864b4[_0x19a6('0xe4')]+=0x1;_0x4864b4['countglobal']+=0x1;_0x543eda=this[_0x19a6('0x1c')][_0x2e6638[_0x19a6('0xba')]][_0x19a6('0xe5')];_0x285919=this[_0x19a6('0x1c')][_0x2e6638[_0x19a6('0xba')]][_0x19a6('0xce')];hopperUtils[_0x19a6('0xe6')](_0x4864b4,_0x4864b4[_0x19a6('0x6a')],_0x277c97['voiceQueue'])[_0x19a6('0x39')](function(_0xf2acbf){if(_0x4864b4[_0x19a6('0xe4')]>=_0x3e5b3a[_0x19a6('0x1c')][_0x2e6638[_0x19a6('0xba')]][_0x19a6('0xe7')]){_0x3e5b3a[_0x19a6('0xd1')](_0x4864b4,_0xf2acbf[_0x19a6('0xd0')]);}else{hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x4864b4[_0x19a6('0xe4')],'scheduledat':moment()[_0x19a6('0xe8')](_0x3e5b3a[_0x19a6('0x1c')][_0x2e6638['queue']]['dialAbandonedRetryFrequency'],_0x19a6('0xd5'))[_0x19a6('0x40')](_0x19a6('0xbe')),'ContactId':_0x277c97[_0x19a6('0xd6')],'ListId':_0x277c97[_0x19a6('0xd7')],'VoiceQueueId':_0x277c97['VoiceQueueId']||undefined,'CampaignId':_0x277c97[_0x19a6('0xd9')]||undefined})[_0x19a6('0x9a')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x2f0e9e=new History(_0x4864b4);_0x2f0e9e[_0x19a6('0x6a')]=0xb;_0x2f0e9e[_0x19a6('0xca')]=_0x19a6('0xe2');_0x2f0e9e[_0x19a6('0xdb')]=moment()['format'](_0x19a6('0xbe'));_0x2f0e9e['endtime']=_0x2f0e9e[_0x19a6('0xdb')];_0x2f0e9e[_0x19a6('0xdd')]=_0x4864b4[_0x19a6('0xdd')];_0x2f0e9e['calleridnum']=_0x4864b4[_0x19a6('0xde')];hopperUtils[_0x19a6('0xc3')](_0x2f0e9e)['catch'](loggerCatch('[syncAgentComplete][createHistory][11]'));}})[_0x19a6('0x39')](function(){if(_0x8e4b20)hopperUtils['swapAdditionalPhones'](_0x4864b4,_0x543eda,_0x285919)[_0x19a6('0x39')](function(){return 0x1;});});}}}};Dialer[_0x19a6('0x7c')][_0x19a6('0x32')]=function(_0x350f7e){if(this[_0x19a6('0x22')][_0x350f7e['uniqueid']]){this[_0x19a6('0x22')][_0x350f7e[_0x19a6('0xbb')]][_0x19a6('0xe9')]=_0x350f7e['channel'];}if(this[_0x19a6('0x24')][_0x350f7e['uniqueid']]){this[_0x19a6('0x24')][_0x350f7e[_0x19a6('0xbb')]][_0x19a6('0xe9')]=_0x350f7e['channel'];}};Dialer['prototype'][_0x19a6('0x34')]=function(_0x583353){if(!this[_0x19a6('0x22')][_0x583353[_0x19a6('0xea')]]){return;}var _0xdca4d9=this[_0x19a6('0x1c')][this['actions'][_0x583353['actionid']]['queue']][_0x19a6('0xeb')]||_0x19a6('0xec');if(_0xdca4d9===_0x19a6('0xed')){if(this[_0x19a6('0x22')][_0x583353[_0x19a6('0xea')]]&&_[_0x19a6('0xee')](this[_0x19a6('0x22')][_0x583353[_0x19a6('0xea')]]['locked'])&&_0x583353[_0x19a6('0x80')]==='1'&&_0x583353['paused']==='0'){if(this[_0x19a6('0x1e')][_0x583353[_0x19a6('0xef')]]){if(!this[_0x19a6('0x1e')][_0x583353[_0x19a6('0xef')]]['locked']){this[_0x19a6('0x1e')][_0x583353[_0x19a6('0xef')]][_0x19a6('0xf0')]=!![];this['actions'][_0x583353[_0x19a6('0xea')]][_0x19a6('0xf0')]=!![];this[_0x19a6('0x22')][_0x583353[_0x19a6('0xea')]][_0x19a6('0xef')]=_0x583353[_0x19a6('0xef')];}}}}else if(_0xdca4d9==='rrmemory'){if(this[_0x19a6('0x22')][_0x583353['actionid']]){if(this['agents'][_0x583353[_0x19a6('0xef')]]){this[_0x19a6('0x22')][_0x583353[_0x19a6('0xea')]][_0x19a6('0xef')]=_0x583353[_0x19a6('0xef')];if(_[_0x19a6('0xee')](this[_0x19a6('0xf1')][this[_0x19a6('0x22')][_0x583353['actionid']][_0x19a6('0xba')]])){this['queueBooked'][this[_0x19a6('0x22')][_0x583353[_0x19a6('0xea')]][_0x19a6('0xba')]]=[];}this[_0x19a6('0xf1')][this[_0x19a6('0x22')][_0x583353[_0x19a6('0xea')]][_0x19a6('0xba')]]['push'](_[_0x19a6('0x58')](_[_0x19a6('0xf2')](this['actions'][_0x583353[_0x19a6('0xea')]],['idHopper',_0x19a6('0xef')]),{'status':_0x583353[_0x19a6('0x80')],'paused':_0x583353[_0x19a6('0xf3')]}));}}}};Dialer[_0x19a6('0x7c')][_0x19a6('0xf4')]=function(_0x14228a){if(!this[_0x19a6('0x22')][_0x14228a[_0x19a6('0xea')]]){return;}var _0x52fa81=this;var _0x881141=this[_0x19a6('0x1c')][this[_0x19a6('0x22')][_0x14228a[_0x19a6('0xea')]][_0x19a6('0xba')]];var _0x440596=_0x881141[_0x19a6('0xeb')]||_0x19a6('0xec');if(_0x440596==='roundrobin'){if(this['actions'][_0x14228a[_0x19a6('0xea')]]&&this[_0x19a6('0x22')][_0x14228a[_0x19a6('0xea')]]['stateinterface']){this[_0x19a6('0x1b')][_0x19a6('0xf5')](this[_0x19a6('0x22')][_0x14228a['actionid']][_0x19a6('0xf6')],this[_0x19a6('0x22')][_0x14228a[_0x19a6('0xea')]]['stateinterface'])[_0x19a6('0x9a')](function(_0x131671){logger['error'](_0x19a6('0xf7'),util[_0x19a6('0x3f')](_0x131671,{'showHidden':![],'depth':null}));})[_0x19a6('0x19')](function(){_0x52fa81[_0x19a6('0xbd')](_0x52fa81[_0x19a6('0x1c')][_0x52fa81[_0x19a6('0x22')][_0x14228a[_0x19a6('0xea')]]['queue']]);_0x52fa81[_0x19a6('0x1e')][_0x52fa81[_0x19a6('0x22')][_0x14228a[_0x19a6('0xea')]][_0x19a6('0xef')]][_0x19a6('0xf0')]=![];delete _0x52fa81['actions'][_0x14228a[_0x19a6('0xea')]];unlockQueueStatus(_0x881141);});}else{this[_0x19a6('0xbd')](this['voiceQueues'][this[_0x19a6('0x22')][_0x14228a['actionid']][_0x19a6('0xba')]]);hopperUtils[_0x19a6('0xd2')]({'active':![],'ContactId':this[_0x19a6('0x22')][_0x14228a[_0x19a6('0xea')]][_0x19a6('0xd6')],'ListId':this[_0x19a6('0x22')][_0x14228a[_0x19a6('0xea')]]['ListId'],'VoiceQueueId':this[_0x19a6('0x22')][_0x14228a['actionid']][_0x19a6('0xd8')]||undefined,'CampaignId':this['actions'][_0x14228a[_0x19a6('0xea')]]['CampaignId']||undefined})[_0x19a6('0x9a')](loggerCatch(_0x19a6('0xf8')));delete this[_0x19a6('0x22')][_0x14228a[_0x19a6('0xea')]];unlockQueueStatus(_0x881141);}}else if(_0x440596===_0x19a6('0xec')){var _0x2f6431;if(this[_0x19a6('0x22')][_0x14228a[_0x19a6('0xea')]]&&!_[_0x19a6('0x72')](this[_0x19a6('0xf1')][this[_0x19a6('0x22')][_0x14228a[_0x19a6('0xea')]][_0x19a6('0xba')]])){if(this[_0x19a6('0x28')][_0x52fa81[_0x19a6('0x22')][_0x14228a[_0x19a6('0xea')]][_0x19a6('0xba')]]){this[_0x19a6('0x28')][_0x52fa81[_0x19a6('0x22')][_0x14228a['actionid']][_0x19a6('0xba')]]=this[_0x19a6('0x28')][this['actions'][_0x14228a[_0x19a6('0xea')]][_0x19a6('0xba')]]?this[_0x19a6('0x28')][this[_0x19a6('0x22')][_0x14228a[_0x19a6('0xea')]][_0x19a6('0xba')]]:this['queueBooked'][this[_0x19a6('0x22')][_0x14228a[_0x19a6('0xea')]][_0x19a6('0xba')]]?this[_0x19a6('0xf1')][this[_0x19a6('0x22')][_0x14228a[_0x19a6('0xea')]][_0x19a6('0xba')]][_0x19a6('0xf9')]||0x0:0x0;}this['queueBooked'][this[_0x19a6('0x22')][_0x14228a[_0x19a6('0xea')]][_0x19a6('0xba')]]['_rr']=this[_0x19a6('0x28')][this[_0x19a6('0x22')][_0x14228a[_0x19a6('0xea')]]['queue']];for(var _0x9c6c9b=0x0;_0x9c6c9b<this[_0x19a6('0xf1')][this[_0x19a6('0x22')][_0x14228a[_0x19a6('0xea')]]['queue']][_0x19a6('0x92')];_0x9c6c9b+=0x1){_0x2f6431=rr(this[_0x19a6('0xf1')][this[_0x19a6('0x22')][_0x14228a[_0x19a6('0xea')]][_0x19a6('0xba')]]);this['queueBookedRR'][_0x52fa81[_0x19a6('0x22')][_0x14228a['actionid']][_0x19a6('0xba')]]=this[_0x19a6('0xf1')][this[_0x19a6('0x22')][_0x14228a[_0x19a6('0xea')]]['queue']]['_rr'];if(_0x2f6431[_0x19a6('0x80')]==='1'&&_0x2f6431[_0x19a6('0xf3')]==='0'){break;}}if(!_[_0x19a6('0xee')](_0x2f6431)){this[_0x19a6('0x1e')][_0x2f6431[_0x19a6('0xef')]][_0x19a6('0xfa')]=_[_0x19a6('0x4c')](this[_0x19a6('0x1e')][_0x2f6431[_0x19a6('0xef')]][_0x19a6('0xfa')])?!![]:this[_0x19a6('0x1e')][_0x2f6431['stateinterface']][_0x19a6('0xfa')];}loggerBooked[_0x19a6('0x43')]('[booked][RR]',_0x14228a['actionid'],'Agent:\x20',JSON['stringify'](_['pick'](this[_0x19a6('0x1e')][_0x2f6431['stateinterface']],[_0x19a6('0x5c'),_0x19a6('0xfa')])),_0x19a6('0xfb'),JSON['stringify'](_0x2f6431[_0x19a6('0xf6')]));if(!_[_0x19a6('0xee')](_0x2f6431)&&_0x2f6431['status']==='1'&&_0x2f6431[_0x19a6('0xf3')]==='0'&&this[_0x19a6('0x1e')][_0x2f6431[_0x19a6('0xef')]][_0x19a6('0xfa')]){this[_0x19a6('0x1e')][_0x2f6431['stateinterface']][_0x19a6('0xfa')]=![];this[_0x19a6('0xf1')][_0x52fa81[_0x19a6('0x22')][_0x14228a['actionid']][_0x19a6('0xba')]]=[];this[_0x19a6('0x1b')][_0x19a6('0xf5')](_0x2f6431[_0x19a6('0xf6')],_0x2f6431['stateinterface'])[_0x19a6('0x9a')](function(_0x4c1989){logger[_0x19a6('0x60')](_0x19a6('0xf7'),util[_0x19a6('0x3f')](_0x4c1989,{'showHidden':![],'depth':null}));})['finally'](function(){_0x52fa81[_0x19a6('0xbd')](_0x52fa81[_0x19a6('0x1c')][_0x52fa81[_0x19a6('0x22')][_0x14228a[_0x19a6('0xea')]]['queue']]);setTimeout(function(){_0x52fa81[_0x19a6('0x1e')][_0x2f6431[_0x19a6('0xef')]][_0x19a6('0xfa')]=!![];loggerBooked['info'](_0x19a6('0xfc'),_0x14228a[_0x19a6('0xea')],_0x19a6('0xfd'),JSON['stringify'](_['pick'](_0x52fa81[_0x19a6('0x1e')][_0x2f6431[_0x19a6('0xef')]],[_0x19a6('0x5c'),_0x19a6('0xfa')])),_0x19a6('0xfb'),JSON[_0x19a6('0x6e')](_0x2f6431[_0x19a6('0xf6')]));},0xc7);delete _0x52fa81[_0x19a6('0x22')][_0x14228a[_0x19a6('0xea')]];unlockQueueStatus(_0x881141,_0x14228a['actionid']);});}else{loggerBooked[_0x19a6('0x43')](_0x19a6('0xfe'));this['updateOriginated'](this[_0x19a6('0x1c')][this[_0x19a6('0x22')][_0x14228a[_0x19a6('0xea')]][_0x19a6('0xba')]]);hopperUtils[_0x19a6('0xd2')]({'active':![],'ContactId':this['actions'][_0x14228a[_0x19a6('0xea')]][_0x19a6('0xd6')],'ListId':this['actions'][_0x14228a[_0x19a6('0xea')]][_0x19a6('0xd7')],'VoiceQueueId':this['actions'][_0x14228a[_0x19a6('0xea')]][_0x19a6('0xd8')]||undefined,'CampaignId':this[_0x19a6('0x22')][_0x14228a[_0x19a6('0xea')]]['CampaignId']||undefined})['catch'](loggerCatch(_0x19a6('0xf8')));delete this['actions'][_0x14228a[_0x19a6('0xea')]];unlockQueueStatus(_0x881141);}}else{loggerBooked[_0x19a6('0x43')]('[booked][unlock2]');this[_0x19a6('0xbd')](this[_0x19a6('0x1c')][this[_0x19a6('0x22')][_0x14228a[_0x19a6('0xea')]][_0x19a6('0xba')]]);hopperUtils[_0x19a6('0xd2')]({'active':![],'ContactId':this['actions'][_0x14228a['actionid']][_0x19a6('0xd6')],'ListId':this[_0x19a6('0x22')][_0x14228a['actionid']][_0x19a6('0xd7')],'VoiceQueueId':this['actions'][_0x14228a[_0x19a6('0xea')]][_0x19a6('0xd8')]||undefined,'CampaignId':this[_0x19a6('0x22')][_0x14228a[_0x19a6('0xea')]][_0x19a6('0xd9')]||undefined})[_0x19a6('0x9a')](loggerCatch(_0x19a6('0xff')));delete this[_0x19a6('0x22')][_0x14228a['actionid']];unlockQueueStatus(_0x881141);}}else{loggerBooked[_0x19a6('0x43')](_0x19a6('0x100'));this[_0x19a6('0xbd')](this[_0x19a6('0x1c')][this[_0x19a6('0x22')][_0x14228a[_0x19a6('0xea')]][_0x19a6('0xba')]]);hopperUtils[_0x19a6('0xd2')]({'active':![],'ContactId':this[_0x19a6('0x22')][_0x14228a[_0x19a6('0xea')]]['ContactId'],'ListId':this[_0x19a6('0x22')][_0x14228a['actionid']][_0x19a6('0xd7')],'VoiceQueueId':this[_0x19a6('0x22')][_0x14228a[_0x19a6('0xea')]][_0x19a6('0xd8')]||undefined,'CampaignId':this[_0x19a6('0x22')][_0x14228a[_0x19a6('0xea')]][_0x19a6('0xd9')]||undefined})[_0x19a6('0x9a')](loggerCatch(_0x19a6('0x101')));delete this[_0x19a6('0x22')][_0x14228a[_0x19a6('0xea')]];unlockQueueStatus(_0x881141);}};Dialer[_0x19a6('0x7c')]['syncOriginateResponse']=function(_0x12c2a8){var _0x3b01d9=this['actions'][_0x12c2a8[_0x19a6('0xea')]];if(_0x3b01d9){delete this[_0x19a6('0x22')][_0x12c2a8[_0x19a6('0xea')]];_0x3b01d9[_0x19a6('0x102')]=moment()[_0x19a6('0x40')](_0x19a6('0xbe'));var _0x371102=_0x3b01d9[_0x19a6('0x3c')]===_0x19a6('0xbc')?this['campaigns'][_0x3b01d9[_0x19a6('0xba')]]:this[_0x19a6('0x1c')][_0x3b01d9[_0x19a6('0x103')]()];if(_0x12c2a8[_0x19a6('0x104')]!=='Success'){this[_0x19a6('0xbd')](_0x371102);return this[_0x19a6('0x105')](_0x3b01d9,_0x371102,_0x12c2a8)[_0x19a6('0x9a')](loggerCatch(_0x19a6('0x106')));}this[_0x19a6('0x24')][_0x12c2a8[_0x19a6('0xbb')]]=_0x3b01d9;}};Dialer['prototype']['syncVarSet']=function(_0x3289bc){var _0x3bfd2b=this;var _0x46def0=this[_0x19a6('0x24')][_0x3289bc[_0x19a6('0xbb')]];var _0x23bcee;if(!_['isNil'](_0x3289bc)&&!_[_0x19a6('0xee')](_0x3289bc[_0x19a6('0x107')])&&!_[_0x19a6('0xee')](_0x3289bc[_0x19a6('0x107')][_0x19a6('0x108')])&&_0x3289bc[_0x19a6('0x109')]===_0x19a6('0x10a')&&_0x46def0){if(_0x46def0[_0x19a6('0x3c')]!=='ivr'&&this['voiceQueues'][_0x46def0[_0x19a6('0xba')]][_0x19a6('0x10b')]&&_0x3289bc[_0x19a6('0x10c')]==='HANGUP'){delete this['uniqueId'][_0x3289bc[_0x19a6('0xbb')]];this['updateOriginated'](this[_0x19a6('0x1c')][_0x46def0[_0x19a6('0xba')]]);this[_0x19a6('0x1c')][_0x46def0[_0x19a6('0xba')]][_0x19a6('0x10d')]+=0x1;this['voiceQueues'][_0x46def0['queue']][_0x19a6('0x10e')]+=0x1;_0x23bcee=new Hangup(_0x46def0,_0x3289bc);_0x23bcee[_0x19a6('0x6a')]=0x12;_0x23bcee['statedesc']='HangupInAMD';_0x23bcee['membername']=_0x19a6('0x10f');ami[_0x19a6('0x3b')](_0x19a6('0x110'),ut[_0x19a6('0x111')](_0x23bcee,'amd'));this[_0x19a6('0x112')](_0x23bcee,_0x19a6('0x113'),'[syncHangupInAMD]');}if(_0x46def0['type']!==_0x19a6('0xbc')&&this[_0x19a6('0x1c')][_0x46def0[_0x19a6('0xba')]][_0x19a6('0x10b')]&&_0x3289bc[_0x19a6('0x10c')]==='MACHINE'){return new Promise(function(_0x42a18b,_0x464488){delete _0x3bfd2b[_0x19a6('0x24')][_0x3289bc['uniqueid']];_0x3bfd2b[_0x19a6('0xbd')](_0x3bfd2b['voiceQueues'][_0x46def0['queue']]);_0x3bfd2b[_0x19a6('0x1c')][_0x46def0[_0x19a6('0xba')]][_0x19a6('0x10d')]+=0x1;_0x3bfd2b[_0x19a6('0x1c')][_0x46def0[_0x19a6('0xba')]][_0x19a6('0x10e')]+=0x1;var _0x140fcb=_0x3bfd2b[_0x19a6('0x1c')][_0x46def0[_0x19a6('0xba')]];var _0x19d3b2=new Hangup(_0x46def0,_0x3289bc);_0x19d3b2[_0x19a6('0x6a')]=0x13;_0x19d3b2[_0x19a6('0xca')]=_0x19a6('0x114');_0x19d3b2['membername']=_0x19a6('0x10f');_0x19d3b2[_0x19a6('0x115')]+=0x1;_0x19d3b2[_0x19a6('0x116')]+=0x1;_0x19d3b2[_0x19a6('0x117')]=!![];ami[_0x19a6('0x3b')]('custom:amd',ut[_0x19a6('0x111')](_0x19d3b2,'amd'));hopperUtils[_0x19a6('0xc3')](_0x19d3b2)['catch'](loggerCatch(_0x19a6('0x118')));if(_0x19d3b2[_0x19a6('0x119')]+_0x19d3b2[_0x19a6('0x11a')]+_0x19d3b2[_0x19a6('0x11b')]+_0x19d3b2[_0x19a6('0x11c')]+_0x19d3b2[_0x19a6('0xd3')]+_0x19d3b2[_0x19a6('0xe4')]+_0x19d3b2['countmachineretry']+_0x19d3b2['countagentrejectretry']>=_0x140fcb[_0x19a6('0x11d')]){_0x3bfd2b[_0x19a6('0x11e')](_0x19d3b2,_0x42a18b,_0x464488,'reason19\x20machine....');}else{if(_0x19d3b2[_0x19a6('0x115')]>=_0x140fcb[_0x19a6('0x11f')]){_0x3bfd2b['createStateFinal'](_0x19d3b2,_0x42a18b,_0x464488,'reason\x2019\x20machine....');}else{hopperUtils[_0x19a6('0xd2')]({'active':![],'countmachineretry':_0x19d3b2[_0x19a6('0x115')],'scheduledat':moment()[_0x19a6('0xe8')](_0x140fcb[_0x19a6('0x120')],'minutes')[_0x19a6('0x40')](_0x19a6('0xbe')),'ContactId':_0x19d3b2['ContactId'],'ListId':_0x19d3b2[_0x19a6('0xd7')],'VoiceQueueId':_0x19d3b2[_0x19a6('0xd8')]||undefined,'CampaignId':_0x19d3b2[_0x19a6('0xd9')]||undefined})[_0x19a6('0x9a')](loggerCatch(_0x19a6('0x121')));_0x42a18b({'reschedule':0x1});}}});}if(_0x46def0[_0x19a6('0x3c')]===_0x19a6('0xbc')&&this[_0x19a6('0x1d')][_0x46def0[_0x19a6('0xba')]][_0x19a6('0x10b')]&&_0x3289bc[_0x19a6('0x10c')]==='HANGUP'){delete this[_0x19a6('0x24')][_0x3289bc['uniqueid']];this['updateOriginated'](this[_0x19a6('0x1d')][_0x46def0['queue']]);_0x23bcee=new Hangup(_0x46def0,_0x3289bc);_0x23bcee['state']=0x12;_0x23bcee[_0x19a6('0xca')]=_0x19a6('0x122');_0x23bcee['membername']='AMD';ami[_0x19a6('0x3b')]('custom:amd',ut['buildObj'](_0x23bcee,_0x19a6('0x117')));this[_0x19a6('0x112')](_0x23bcee,_0x19a6('0x123'),_0x19a6('0x124'));}if(_0x46def0['type']===_0x19a6('0xbc')&&this[_0x19a6('0x1d')][_0x46def0[_0x19a6('0xba')]][_0x19a6('0x10b')]&&_0x3289bc[_0x19a6('0x10c')]===_0x19a6('0x125')){return new Promise(function(_0x3a4fdc,_0x249187){delete _0x3bfd2b[_0x19a6('0x24')][_0x3289bc[_0x19a6('0xbb')]];_0x3bfd2b['updateOriginated'](_0x3bfd2b['campaigns'][_0x46def0['queue']]);_0x3bfd2b[_0x19a6('0x1d')][_0x46def0[_0x19a6('0xba')]][_0x19a6('0x10d')]+=0x1;_0x3bfd2b[_0x19a6('0x1d')][_0x46def0[_0x19a6('0xba')]][_0x19a6('0x10e')]+=0x1;var _0x2c299b=_0x3bfd2b[_0x19a6('0x1d')][_0x46def0[_0x19a6('0xba')]];var _0x44c3e7=new Hangup(_0x46def0,_0x3289bc);_0x44c3e7[_0x19a6('0x6a')]=0x13;_0x44c3e7['statedesc']=_0x19a6('0x114');_0x44c3e7[_0x19a6('0x126')]=_0x19a6('0x10f');_0x44c3e7[_0x19a6('0x115')]+=0x1;_0x44c3e7['countglobal']+=0x1;_0x44c3e7[_0x19a6('0x117')]=!![];ami[_0x19a6('0x3b')](_0x19a6('0x110'),ut[_0x19a6('0x111')](_0x44c3e7,_0x19a6('0x117')));hopperUtils['createHistory'](_0x44c3e7)[_0x19a6('0x9a')](loggerCatch(_0x19a6('0x118')));if(_0x44c3e7[_0x19a6('0x119')]+_0x44c3e7[_0x19a6('0x11a')]+_0x44c3e7['countnoanswerretry']+_0x44c3e7[_0x19a6('0x11c')]+_0x44c3e7[_0x19a6('0xd3')]+_0x44c3e7[_0x19a6('0xe4')]+_0x44c3e7['countmachineretry']+_0x44c3e7[_0x19a6('0x127')]>=_0x2c299b['dialGlobalMaxRetry']){_0x3bfd2b[_0x19a6('0x11e')](_0x44c3e7,_0x3a4fdc,_0x249187,_0x19a6('0x128'));}else{if(_0x44c3e7[_0x19a6('0x115')]>=_0x2c299b[_0x19a6('0x11f')]){_0x3bfd2b[_0x19a6('0x129')](_0x44c3e7,_0x3a4fdc,_0x249187,_0x19a6('0x12a'));}else{hopperUtils[_0x19a6('0xd2')]({'active':![],'countmachineretry':_0x44c3e7[_0x19a6('0x115')],'scheduledat':moment()[_0x19a6('0xe8')](_0x2c299b[_0x19a6('0x120')],_0x19a6('0xd5'))['format'](_0x19a6('0xbe')),'ContactId':_0x44c3e7['ContactId'],'ListId':_0x44c3e7['ListId'],'VoiceQueueId':_0x44c3e7['VoiceQueueId']||undefined,'CampaignId':_0x44c3e7['CampaignId']||undefined})[_0x19a6('0x9a')](loggerCatch(_0x19a6('0x121')));_0x3a4fdc({'reschedule':0x1});}}});}}};Dialer[_0x19a6('0x7c')][_0x19a6('0x31')]=function(_0x45255f){var _0x24d895=this['uniqueId'][_0x45255f['uniqueid']];var _0x5af359;if(_0x24d895&&_0x24d895['type']===_0x19a6('0xbc')){delete this[_0x19a6('0x24')][_0x45255f['uniqueid']];this['updateOriginated'](this[_0x19a6('0x1d')][_0x24d895[_0x19a6('0xba')]]);this['campaigns'][_0x24d895[_0x19a6('0xba')]][_0x19a6('0x12b')]+=0x1;_0x5af359=new Hangup(_0x24d895,_0x45255f);hopperUtils[_0x19a6('0xc3')](_0x5af359)[_0x19a6('0x9a')](loggerCatch(_0x19a6('0x12c')));hopperUtils[_0x19a6('0xc5')](_0x5af359)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0x24d895&&_0x24d895[_0x19a6('0x3c')]!=='ivr'&&isNotNull(this[_0x19a6('0x1c')][_0x24d895[_0x19a6('0xba')]][_0x19a6('0x12d')])){delete this['uniqueId'][_0x45255f['uniqueid']];this[_0x19a6('0xbd')](this[_0x19a6('0x1c')][_0x24d895['queue']]);this[_0x19a6('0x1c')][_0x24d895[_0x19a6('0xba')]][_0x19a6('0x10d')]+=0x1;this[_0x19a6('0x1c')][_0x24d895[_0x19a6('0xba')]][_0x19a6('0x10e')]+=0x1;_0x5af359=new Hangup(_0x24d895,_0x45255f);_0x5af359[_0x19a6('0x6a')]=0x10;_0x5af359[_0x19a6('0xca')]=_0x19a6('0x12e');_0x5af359[_0x19a6('0x126')]='AGI';hopperUtils['createHistory'](_0x5af359)[_0x19a6('0x9a')](loggerCatch(_0x19a6('0x12c')));hopperUtils[_0x19a6('0xc5')](_0x5af359)['catch'](loggerCatch(_0x19a6('0x12f')));}if(_0x24d895&&_0x24d895[_0x19a6('0x3c')]!==_0x19a6('0xbc')&&!isNotNull(this['voiceQueues'][_0x24d895[_0x19a6('0xba')]][_0x19a6('0x12d')])){delete this[_0x19a6('0x24')][_0x45255f['uniqueid']];this['updateOriginated'](this[_0x19a6('0x1c')][_0x24d895[_0x19a6('0xba')]]);this[_0x19a6('0x1c')][_0x24d895[_0x19a6('0xba')]][_0x19a6('0x130')]+=0x1;_0x5af359=new Hangup(_0x24d895,_0x45255f);_0x5af359['state']=0xc;_0x5af359[_0x19a6('0xca')]=_0x45255f['cause-txt'];_0x5af359['membername']=_0x19a6('0x131');hopperUtils[_0x19a6('0xc3')](_0x5af359)[_0x19a6('0x9a')](loggerCatch(_0x19a6('0x12c')));hopperUtils['moveContactManagedDialer'](_0x5af359)[_0x19a6('0x9a')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0x19a6('0x7c')][_0x19a6('0xb')]=function(_0xd754b5){var _0x842384=this;if(!_0x842384[_0x19a6('0x29')][_0xd754b5[_0x19a6('0x5c')]]){_0x842384[_0x19a6('0x29')][_0xd754b5[_0x19a6('0x5c')]]={'running':![]};}else if(_0x842384[_0x19a6('0x29')][_0xd754b5['name']]['running']===!![]){return;}else if(_0x842384['queuesSummary'][_0xd754b5[_0x19a6('0x5c')]][_0x19a6('0x132')]===![]){_0x842384[_0x19a6('0x29')][_0xd754b5['name']][_0x19a6('0x132')]=!![];}var _0x3e31d5=_0x842384[_0x19a6('0x1c')][_0xd754b5[_0x19a6('0x5c')]];var _0x2848a4=_0x3e31d5[_0x19a6('0x64')]!==utils[_0x19a6('0x65')]['INACTIVE'];var _0x120e5a=utils[_0x19a6('0x133')](_0x3e31d5);_0x3e31d5[_0x19a6('0x134')]=utils[_0x19a6('0x135')](_0x3e31d5,_0x842384[_0x19a6('0x1f')]);Promise[_0x19a6('0x136')]()[_0x19a6('0x39')](function(){if(_0x3e31d5['statusMessage']===utils['CAMPAIGN_STATUS'][_0x19a6('0x74')]){if(_0x2848a4){clearPredictiveAttributes(_0x3e31d5);_0xd754b5['startPredictive']=undefined;_0xd754b5[_0x19a6('0x5a')]=undefined;}if(_0x3e31d5[_0x19a6('0x134')]===utils[_0x19a6('0x65')][_0x19a6('0x74')]){_0xd754b5[_0x19a6('0x137')]=0x0;_0xd754b5[_0x19a6('0xf3')]=0x0;_0xd754b5[_0x19a6('0x138')]=0x0;_0xd754b5[_0x19a6('0x139')]=0x0;_0xd754b5[_0x19a6('0x13a')]=0x0;}}else if(_0x3e31d5[_0x19a6('0x134')]===utils[_0x19a6('0x65')][_0x19a6('0x13b')]&&!_0x120e5a){return _0x842384[_0x19a6('0x8b')](_0x3e31d5,!![])[_0x19a6('0x39')](function(){return _0x842384[_0x19a6('0x8b')](_0x3e31d5,![]);})['then'](function(){return _0x842384[_0x19a6('0xa9')](_0x3e31d5);})[_0x19a6('0x9a')](function(_0x4f5db0){loggerSyncQueueSummary['debug'](_0x19a6('0x13c'),util[_0x19a6('0x3f')](_0x4f5db0,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x3e31d5);});}else{clearPredictiveAttributes(_0x3e31d5);}})[_0x19a6('0x39')](function(){var _0x79b124=_0xd754b5[_0x19a6('0x13d')](_0x3e31d5);if(_0x79b124||_0x3e31d5[_0x19a6('0x13e')]){_0x3e31d5[_0x19a6('0x13e')]=![];_0xd754b5[_0x19a6('0x13f')](_0x3e31d5);Object[_0x19a6('0x140')](_0x3e31d5,_0xd754b5);emitOutboundVoiceQueueSummary(_0xd754b5);}_0x842384[_0x19a6('0x29')][_0x3e31d5[_0x19a6('0x5c')]][_0x19a6('0x132')]=![];})[_0x19a6('0x9a')](function(_0x20f7ad){logger[_0x19a6('0x60')]('[syncQueueSummary]',util[_0x19a6('0x3f')](_0x20f7ad,{'showHidden':![],'depth':null}));_0x842384['queuesSummary'][_0x3e31d5['name']][_0x19a6('0x132')]=![];});};Dialer[_0x19a6('0x7c')][_0x19a6('0x30')]=_[_0x19a6('0x141')](function(){var _0x562a29=_['filter'](this[_0x19a6('0x1c')],function(_0x34b3dc){return _0x34b3dc[_0x19a6('0x142')];});var _0x419fa0=_[_0x19a6('0x143')](this['agents'],function(_0x2f05f9){return _0x2f05f9[_0x19a6('0x144')]&&_0x2f05f9['status']===_0x19a6('0x81');});if(_0x562a29[_0x19a6('0x92')]>0x0&&_0x419fa0[_0x19a6('0x92')]>0x0){return Promise[_0x19a6('0x136')]()[_0x19a6('0x39')](cmHopper[_0x19a6('0x145')](_[_0x19a6('0x146')](_0x562a29,'id'),previewRecallmeReminderInterval,_[_0x19a6('0x146')](_0x419fa0,'id')))[_0x19a6('0x39')](function(_0x40eae9){for(var _0x3eb013=0x0;_0x3eb013<_0x40eae9['length'];_0x3eb013++){var _0xd61502=_0x40eae9[_0x3eb013][_0x19a6('0x147')]['name'];if(_0xd61502)io['to'](util[_0x19a6('0x40')]('user:%s',_0xd61502))[_0x19a6('0x3b')](_0x19a6('0x148'),{'hopper':_0x40eae9[_0x3eb013]});}})[_0x19a6('0x9a')](function(_0x23a90e){logger[_0x19a6('0x60')](_0x19a6('0x149'),_0x23a90e);});}},0x3c*0x3e8,{'leading':!![]});Dialer['prototype'][_0x19a6('0x37')]=function(){var _0x3d79c2=this;setInterval(function(){_0x3d79c2[_0x19a6('0x14a')](_0x3d79c2['uniqueId'],_0x19a6('0x14b'));_0x3d79c2[_0x19a6('0x14a')](_0x3d79c2[_0x19a6('0x22')],'[actions]');},0x32c8);};Dialer[_0x19a6('0x7c')]['clearZombieChannels']=function(_0x1c9f3d,_0xb52245){var _0x3e86a5=this;for(var _0x8742a1 in _0x1c9f3d){if(typeof _0x1c9f3d[_0x8742a1]!==_0x19a6('0xa3')){this[_0x19a6('0x1a')][_0x19a6('0x17')](function(){if(!_[_0x19a6('0xee')](_0x1c9f3d[_0x8742a1])){return ami[_0x19a6('0x94')]({'action':_0x19a6('0x80'),'channel':_0x1c9f3d[_0x8742a1]['channel']})['catch'](function(_0x23f3b7){if(_0x23f3b7['message']===_0x19a6('0x14c')){setTimeout(function(){if(_0x1c9f3d[_0x8742a1]&&_0x1c9f3d[_0x8742a1][_0x19a6('0x3c')]!==_0x19a6('0xbc')){_0x3e86a5['updateOriginated'](_0x3e86a5[_0x19a6('0x1c')][_0x1c9f3d[_0x8742a1]['queue']]);logger[_0x19a6('0x60')](_0x19a6('0x14d'),_0xb52245,_0x8742a1,_0x1c9f3d[_0x8742a1][_0x19a6('0xba')]);delete _0x1c9f3d[_0x8742a1];}if(_0x1c9f3d[_0x8742a1]&&_0x1c9f3d[_0x8742a1]['type']===_0x19a6('0xbc')){_0x3e86a5[_0x19a6('0xbd')](_0x3e86a5[_0x19a6('0x1d')][_0x1c9f3d[_0x8742a1][_0x19a6('0xba')]]);logger[_0x19a6('0x60')](_0x19a6('0x14e'),_0xb52245,_0x8742a1,_0x1c9f3d[_0x8742a1]['queue']);delete _0x1c9f3d[_0x8742a1];}},0x2328);}});}});}}};Dialer[_0x19a6('0x7c')][_0x19a6('0x14f')]=function(_0x410e1d){return Promise[_0x19a6('0x136')]()[_0x19a6('0x39')](voiceQueueRt[_0x19a6('0x14f')](_0x410e1d))[_0x19a6('0x9a')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0x19a6('0x7c')][_0x19a6('0xbd')]=function(_0x59bebd){if(!_[_0x19a6('0x4c')](_0x59bebd)&&_0x59bebd!==null){if(typeof _0x59bebd[_0x19a6('0x77')]!=='undefined'){if(_0x59bebd[_0x19a6('0x77')]>0x0){_0x59bebd[_0x19a6('0x77')]-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x19a6('0x60')](_0x19a6('0x150'));}};Dialer[_0x19a6('0x7c')]['loggerHandler']=function(_0x4eb40d,_0x3ffd25){var _0x1fe722=this;return function(_0x30ec3b){_0x1fe722[_0x19a6('0xbd')](_0x3ffd25);logger[_0x19a6('0x60')](_0x4eb40d,util[_0x19a6('0x3f')](_0x30ec3b,{'showHidden':![],'depth':null}));};};Dialer['prototype']['emptyContact']=function(_0xa548e4,_0x1af51d,_0x3feca0){var _0xd2022e={'state':0x19,'statedesc':_0x19a6('0x151')};this[_0x19a6('0xbd')](_0x1af51d);this[_0x19a6('0x112')](_[_0x19a6('0x58')](_0xd2022e,_[_0x19a6('0xf2')](_0x3feca0,[_0x19a6('0xd6'),'ListId',_0x19a6('0x152'),'VoiceQueueId','CampaignId'])),_0x19a6('0x153'),_0x19a6('0x154'));logger[_0x19a6('0x60')](_0xa548e4);};Dialer[_0x19a6('0x7c')]['saveInDb']=function(_0x11ee90,_0x3f60fc,_0x575249){hopperUtils['createHistory'](_0x11ee90)[_0x19a6('0x9a')](loggerCatch(_0x3f60fc));hopperUtils[_0x19a6('0xc5')](_0x11ee90)[_0x19a6('0x9a')](loggerCatch(_0x575249));};Dialer[_0x19a6('0x7c')]['queueCallerAbandonCreateState']=function(_0x3aff2a,_0x3813f7){hopperUtils[_0x19a6('0xc3')](_0x3aff2a)['catch'](loggerCatch(_0x19a6('0xc4')));if(_0x3813f7==0x0){hopperUtils[_0x19a6('0xc5')](_0x3aff2a)[_0x19a6('0x9a')](loggerCatch(_0x19a6('0x155')));}};Dialer[_0x19a6('0x7c')]['checkPreviewRecallReminder']=function(_0x229fac){return Promise[_0x19a6('0x136')]()[_0x19a6('0x39')](cmHopper[_0x19a6('0x145')](_0x229fac['id'],previewRecallmeReminderInterval))[_0x19a6('0x39')](function(_0x2424fb){for(var _0x56ecd2=0x0;_0x56ecd2<_0x2424fb['length'];_0x56ecd2++){var _0x416d30=_0x2424fb[_0x56ecd2][_0x19a6('0x147')][_0x19a6('0x5c')];if(_0x416d30)io['to'](util[_0x19a6('0x40')](_0x19a6('0x156'),_0x416d30))[_0x19a6('0x3b')](_0x19a6('0x148'),{'hopper':_0x2424fb[_0x56ecd2]});}})['catch'](function(){});};Dialer[_0x19a6('0x7c')][_0x19a6('0xa7')]=function(_0x4fb553){var _0x273ac4=this;return function(){_0x273ac4[_0x19a6('0x157')](_0x4fb553);};};Dialer[_0x19a6('0x7c')][_0x19a6('0x158')]=function(_0x5be7a6,_0x2bcca1){var _0x570643=this;var _0xcb5b3f=uuid['v4']();this[_0x19a6('0x22')][_0xcb5b3f]=new Action(_0x5be7a6,_0x2bcca1,_0xcb5b3f);return new Promise(function(_0x2db49d,_0x415649){if(_[_0x19a6('0x4c')](_0x5be7a6)&&typeof _0x5be7a6!==_0x19a6('0x159')){return _0x415649(msgResponse(_0x19a6('0x15a'),_0x19a6('0x8c'),_0x19a6('0x15b')));}if(_[_0x19a6('0x4c')](_0x2bcca1[_0x19a6('0x15c')])||_0x2bcca1['phone']===null){return _0x415649(msgResponse(_0x19a6('0x15a'),'Failure','contact\x20is\x20undefine'));}var _0x8f9e98={'XMD-CALLERID':_0x570643[_0x19a6('0x22')][_0xcb5b3f]['getCaller'](),'XMD-AGI':_0x5be7a6['dialQueueProject']?util[_0x19a6('0x40')](_0x19a6('0x15d'),ipAgi,_0x5be7a6[_0x19a6('0x12d')]):_0x19a6('0x15e'),'XMD-AGIAFTER':_0x5be7a6[_0x19a6('0x15f')]?util[_0x19a6('0x40')](_0x19a6('0x15d'),ipAgi,_0x5be7a6[_0x19a6('0x15f')]):_0x19a6('0x15e'),'XMD-QUEUE':utils['isOutboundQueue'](_0x5be7a6)?util[_0x19a6('0x40')](_0x19a6('0x160'),_0x5be7a6[_0x19a6('0x5c')],_0x5be7a6[_0x19a6('0x161')]||'',_0x5be7a6['dialAgiAfterHangupAgent']?'c':'',_0x5be7a6[_0x19a6('0x162')]||0x3):_0x19a6('0x15e'),'XMD-CONTACTID':_0x2bcca1[_0x19a6('0xd6')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x570643[_0x19a6('0x22')][_0xcb5b3f]['getCaller'](),'XMD-AMD':_0x5be7a6[_0x19a6('0x10b')]?_0x19a6('0x13b'):'NONE','XMD-DESTINATION':_0x19a6('0x10a')};if(_0x5be7a6[_0x19a6('0x10b')]){_0x8f9e98['XMD-AMDINITIALSILENCE']=_0x5be7a6['dialAMDInitialSilence']||0x9c4;_0x8f9e98[_0x19a6('0x163')]=_0x5be7a6['dialAMDGreeting']||0x5dc;_0x8f9e98[_0x19a6('0x164')]=_0x5be7a6[_0x19a6('0x165')]||0x320;_0x8f9e98['XMD-AMDTOTALANALYSISTIME']=_0x5be7a6[_0x19a6('0x166')]||0x1388;_0x8f9e98[_0x19a6('0x167')]=_0x5be7a6[_0x19a6('0x168')]||0x64;_0x8f9e98['XMD-AMDBETWEENWORDSSILENCE']=_0x5be7a6['dialAMDBetweenWordsSilence']||0x32;_0x8f9e98[_0x19a6('0x169')]=_0x5be7a6[_0x19a6('0x16a')]||0x3;_0x8f9e98['XMD-AMDSILENCETHRESHOLD']=_0x5be7a6[_0x19a6('0x16b')]||0x100;_0x8f9e98[_0x19a6('0x16c')]=_0x5be7a6[_0x19a6('0x16d')]||0x1388;}if(utils[_0x19a6('0x16e')](_0x5be7a6)){_0x8f9e98[_0x19a6('0x16f')]=_0x2bcca1[_0x19a6('0xd8')];}else{_0x8f9e98[_0x19a6('0x170')]=_0x2bcca1[_0x19a6('0xd9')];}for(var _0x115ee9 in _0x2bcca1[_0x19a6('0x171')]){if(typeof _0x2bcca1['Contact'][_0x115ee9]!==_0x19a6('0xa3')){if(isNotNull(_0x2bcca1[_0x19a6('0x171')][_0x115ee9])&&_0x115ee9!=='id'&&_0x115ee9!==_0x19a6('0x172')&&_0x115ee9!==_0x19a6('0x173')&&_0x115ee9!==_0x19a6('0x174')){_0x8f9e98[util[_0x19a6('0x40')](_0x19a6('0x175'),_0x19a6('0x176'),_[_0x19a6('0x177')](_0x115ee9))]=_0x2bcca1['Contact'][_0x115ee9];}}}var _0x6306ba=_0x570643[_0x19a6('0x7d')](_0x5be7a6[_0x19a6('0x84')])?utils['getCallerId'](_0x5be7a6['Trunk'][_0x19a6('0x178')],_0x5be7a6[_0x19a6('0x179')],_0x5be7a6[_0x19a6('0x17a')]>0x0?utils[_0x19a6('0x17b')](_0x5be7a6[_0x19a6('0x17c')],_0x5be7a6[_0x19a6('0x17a')]):_0x5be7a6[_0x19a6('0x17c')]):utils[_0x19a6('0x17d')](_[_0x19a6('0xee')](_0x5be7a6[_0x19a6('0x85')])?_0x5be7a6[_0x19a6('0x84')][_0x19a6('0x178')]:_0x5be7a6[_0x19a6('0x85')][_0x19a6('0x178')],_0x5be7a6[_0x19a6('0x179')],_0x5be7a6[_0x19a6('0x17a')]>0x0?utils['getCallerIdRandom'](_0x5be7a6['dialOriginateCallerIdNumber'],_0x5be7a6[_0x19a6('0x17a')]):_0x5be7a6[_0x19a6('0x17c')]);if(_0x6306ba){_0x8f9e98[_0x19a6('0x17e')]=_0x570643[_0x19a6('0x22')][_0xcb5b3f][_0x19a6('0x17f')]=utils[_0x19a6('0x180')](_0x6306ba);_0x8f9e98[_0x19a6('0x181')]=_0x2bcca1[_0x19a6('0x15c')];}_0x5be7a6['variables']=_0x8f9e98;return ami['Action']({'actionid':_0xcb5b3f,'action':_0x19a6('0x15a'),'channel':_0x570643['isTrunkReachable'](_0x5be7a6[_0x19a6('0x84')])?util[_0x19a6('0x40')](_0x19a6('0x182'),_0x5be7a6[_0x19a6('0x84')][_0x19a6('0x5c')],isNotNull(_0x5be7a6[_0x19a6('0x183')])?_0x5be7a6['dialPrefix'][_0x19a6('0x184')]()||'':'',_0x5be7a6[_0x19a6('0x185')]>0x0?_0x2bcca1[_0x19a6('0x15c')]['substring'](_0x5be7a6['dialCutDigit']):_0x2bcca1[_0x19a6('0x15c')]):util[_0x19a6('0x40')](_0x19a6('0x182'),_[_0x19a6('0xee')](_0x5be7a6[_0x19a6('0x85')])?_0x5be7a6[_0x19a6('0x84')][_0x19a6('0x5c')]:_0x5be7a6[_0x19a6('0x85')][_0x19a6('0x5c')],isNotNull(_0x5be7a6['dialPrefix'])?_0x5be7a6[_0x19a6('0x183')]['trim']()||'':'',_0x5be7a6['dialCutDigit']>0x0?_0x2bcca1[_0x19a6('0x15c')]['substring'](_0x5be7a6[_0x19a6('0x185')]):_0x2bcca1['phone']),'callerid':_0x6306ba,'Exten':_0x19a6('0x10a'),'Context':_0x19a6('0x186'),'Priority':'1','variable':_0x8f9e98,'timeout':(_0x5be7a6[_0x19a6('0x187')]||0x1e)*0x3e8,'async':!![],'channelid':_0xcb5b3f})[_0x19a6('0x39')](function(_0x11fb4f){return _0x2db49d(_0x11fb4f);})[_0x19a6('0x9a')](function(_0x233e16){_0x5be7a6[_0x19a6('0x188')]+=0x1;var _0xa33748=new History(_0x570643['actions'][_0xcb5b3f]);logger['error'](util['format'](_0x19a6('0x189'),JSON[_0x19a6('0x6e')](_0x233e16)));_0xa33748[_0x19a6('0x6a')]=0xe;_0xa33748['statedesc']=_0x19a6('0x18a');_0xa33748[_0x19a6('0xdb')]=moment()[_0x19a6('0x40')]('YYYY-MM-DD\x20HH:mm:ss');_0xa33748[_0x19a6('0xdc')]=_0xa33748[_0x19a6('0xdb')];hopperUtils[_0x19a6('0xc3')](_0xa33748)[_0x19a6('0x9a')](loggerCatch(_0x19a6('0x18b')));_0x570643[_0x19a6('0xc5')](_0xa33748)['catch'](loggerCatch(_0x19a6('0x18b')))['finally'](function(){delete _0x570643[_0x19a6('0x22')][_0xcb5b3f];return _0x415649(msgResponse(_0x19a6('0x15a'),'Error',_0x19a6('0x18c')));});});});};Dialer['prototype']['checkRetriveMax']=function(_0x5675d6,_0x7f9d52,_0x10da11){var _0x4e6d68=new History(_0x7f9d52);if(_0x4e6d68[_0x19a6('0x119')]+_0x4e6d68[_0x19a6('0x11a')]+_0x4e6d68['countnoanswerretry']+_0x4e6d68[_0x19a6('0x11c')]+_0x4e6d68[_0x19a6('0xd3')]+_0x4e6d68['countabandonedretry']+_0x4e6d68[_0x19a6('0x115')]+_0x4e6d68[_0x19a6('0x127')]>=_0x10da11[_0x19a6('0x11d')]-0x1){return!![];}switch(_0x5675d6){case 0x3:if(_0x4e6d68[_0x19a6('0x11b')]>=_0x10da11[_0x19a6('0x18d')]-0x1){return!![];}hopperUtils[_0x19a6('0xd2')]({'active':![],'countnoanswerretry':_0x4e6d68[_0x19a6('0x11b')]+=0x1,'scheduledat':moment()['add'](_0x10da11[_0x19a6('0x18e')],_0x19a6('0xd5'))[_0x19a6('0x40')](_0x19a6('0xbe')),'ContactId':_0x4e6d68['ContactId'],'ListId':_0x4e6d68[_0x19a6('0xd7')],'VoiceQueueId':_0x4e6d68[_0x19a6('0xd8')]||undefined,'CampaignId':_0x4e6d68[_0x19a6('0xd9')]||undefined})[_0x19a6('0x9a')](loggerCatch(_0x19a6('0x18f')));break;case 0x5:if(_0x4e6d68['countbusyretry']>=_0x10da11[_0x19a6('0x190')]-0x1){return!![];}hopperUtils[_0x19a6('0xd2')]({'active':![],'countbusyretry':_0x4e6d68[_0x19a6('0x119')]+=0x1,'scheduledat':moment()[_0x19a6('0xe8')](_0x10da11[_0x19a6('0x191')],_0x19a6('0xd5'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4e6d68[_0x19a6('0xd6')],'ListId':_0x4e6d68['ListId'],'VoiceQueueId':_0x4e6d68[_0x19a6('0xd8')]||undefined,'CampaignId':_0x4e6d68[_0x19a6('0xd9')]||undefined})[_0x19a6('0x9a')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x4e6d68[_0x19a6('0x11a')]>=_0x10da11[_0x19a6('0x192')]-0x1){return!![];}hopperUtils[_0x19a6('0xd2')]({'active':![],'countcongestionretry':_0x4e6d68['countcongestionretry']+=0x1,'scheduledat':moment()[_0x19a6('0xe8')](_0x10da11[_0x19a6('0x193')],_0x19a6('0xd5'))['format'](_0x19a6('0xbe')),'ContactId':_0x4e6d68[_0x19a6('0xd6')],'ListId':_0x4e6d68['ListId'],'VoiceQueueId':_0x4e6d68[_0x19a6('0xd8')]||undefined,'CampaignId':_0x4e6d68['CampaignId']||undefined})[_0x19a6('0x9a')](loggerCatch(_0x19a6('0x194')));break;case 0x0:if(_0x4e6d68[_0x19a6('0x11c')]>=_0x10da11['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{hopperUtils[_0x19a6('0xd2')]({'active':![],'countnosuchnumberretry':_0x4e6d68[_0x19a6('0x11c')]+=0x1,'scheduledat':moment()[_0x19a6('0xe8')](_0x10da11[_0x19a6('0x195')],_0x19a6('0xd5'))[_0x19a6('0x40')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4e6d68[_0x19a6('0xd6')],'ListId':_0x4e6d68['ListId'],'VoiceQueueId':_0x4e6d68[_0x19a6('0xd8')]||undefined,'CampaignId':_0x4e6d68[_0x19a6('0xd9')]||undefined})[_0x19a6('0x9a')](loggerCatch(_0x19a6('0x196')));}break;case 0xa:if(_0x4e6d68[_0x19a6('0xd3')]>=_0x10da11[_0x19a6('0x197')]-0x1){return!![];}hopperUtils[_0x19a6('0xd2')]({'active':![],'countdropretry':_0x4e6d68['countdropretry']+=0x1,'scheduledat':moment()[_0x19a6('0xe8')](_0x10da11[_0x19a6('0xd4')],_0x19a6('0xd5'))[_0x19a6('0x40')](_0x19a6('0xbe')),'ContactId':_0x4e6d68[_0x19a6('0xd6')],'ListId':_0x4e6d68[_0x19a6('0xd7')],'VoiceQueueId':_0x4e6d68[_0x19a6('0xd8')]||undefined,'CampaignId':_0x4e6d68[_0x19a6('0xd9')]||undefined})[_0x19a6('0x9a')](loggerCatch(_0x19a6('0xda')));break;case 0xb:if(_0x4e6d68[_0x19a6('0xe4')]>=_0x10da11['dialAbandonedMaxRetry']-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x4e6d68[_0x19a6('0xe4')]+=0x1,'scheduledat':moment()[_0x19a6('0xe8')](_0x10da11['dialAbandonedRetryFrequency'],'minutes')[_0x19a6('0x40')](_0x19a6('0xbe')),'ContactId':_0x4e6d68[_0x19a6('0xd6')],'ListId':_0x4e6d68[_0x19a6('0xd7')],'VoiceQueueId':_0x4e6d68['VoiceQueueId']||undefined,'CampaignId':_0x4e6d68[_0x19a6('0xd9')]||undefined})['catch'](loggerCatch(_0x19a6('0x198')));break;case 0x13:if(_0x4e6d68[_0x19a6('0x115')]>=_0x10da11[_0x19a6('0x11f')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x4e6d68[_0x19a6('0x115')]+=0x1,'scheduledat':moment()[_0x19a6('0xe8')](_0x10da11[_0x19a6('0x120')],_0x19a6('0xd5'))['format'](_0x19a6('0xbe')),'ContactId':_0x4e6d68[_0x19a6('0xd6')],'ListId':_0x4e6d68['ListId'],'VoiceQueueId':_0x4e6d68[_0x19a6('0xd8')]||undefined,'CampaignId':_0x4e6d68[_0x19a6('0xd9')]||undefined})[_0x19a6('0x9a')](loggerCatch(_0x19a6('0x121')));break;case 0x14:if(_0x4e6d68[_0x19a6('0x127')]>=_0x10da11[_0x19a6('0x199')]-0x1){return!![];}hopperUtils[_0x19a6('0xd2')]({'active':![],'countagentrejectretry':_0x4e6d68[_0x19a6('0x127')]+=0x1,'scheduledat':moment()[_0x19a6('0xe8')](_0x10da11[_0x19a6('0x19a')],_0x19a6('0xd5'))[_0x19a6('0x40')](_0x19a6('0xbe')),'ContactId':_0x4e6d68['ContactId'],'ListId':_0x4e6d68[_0x19a6('0xd7')],'VoiceQueueId':_0x4e6d68[_0x19a6('0xd8')]||undefined,'CampaignId':_0x4e6d68[_0x19a6('0xd9')]||undefined})[_0x19a6('0x9a')](loggerCatch(_0x19a6('0x19b')));break;default:return!![];}};Dialer['prototype'][_0x19a6('0x105')]=function(_0x5c948f,_0x2c004d,_0xdac8f8){var _0x3057a0=this;var _0x32d236=new History(_0x5c948f);var _0x15a625=![];var _0x31b25e;var _0x51b8e1;return new Promise(function(_0x5f0b68,_0x20e296){if(_[_0x19a6('0x4c')](_0x2c004d)&&typeof _0x2c004d!==_0x19a6('0x159')){return _0x20e296(msgResponse(_0x19a6('0x19c'),_0x19a6('0x8c'),'entity\x20is\x20undefine'));}if(_[_0x19a6('0x4c')](_0xdac8f8)&&typeof _0xdac8f8!=='object'){return _0x20e296(msgResponse('[callProgressDetecting]',_0x19a6('0x8c'),_0x19a6('0x19d')));}hopperUtils['verifyAdditionalPhones'](_0x32d236,_0xdac8f8[_0x19a6('0xbf')],_0x2c004d)[_0x19a6('0x39')](function(_0x2b8aef){if(_0x2b8aef[_0x19a6('0xd0')]==0x1)_0x15a625=!![];switch(_0xdac8f8[_0x19a6('0xbf')]){case'0':_0x2c004d[_0x19a6('0x19e')]+=0x1;_0x32d236[_0x19a6('0x6a')]=0x0;_0x32d236[_0x19a6('0xca')]=_0x19a6('0x19f');_0x32d236[_0x19a6('0x11c')]+=0x1;_0x32d236[_0x19a6('0x116')]+=0x1;ami[_0x19a6('0x3b')](_0x19a6('0x1a0'),ut[_0x19a6('0x111')](_0x5c948f,_0x19a6('0x1a1')));_0x31b25e=_0x2c004d[_0x19a6('0x195')];_0x51b8e1=_0x2c004d[_0x19a6('0xce')];hopperUtils[_0x19a6('0xc3')](_0x32d236)['catch'](loggerCatch(_0x19a6('0x118')));if(_0x3057a0[_0x19a6('0x1a2')](0x0,_0x5c948f,_0x2c004d)&&!_0x15a625){if(_0x32d236[_0x19a6('0x11c')]>=_0x2c004d[_0x19a6('0x1a3')]){_0x3057a0[_0x19a6('0x129')](_0x32d236,_0x5f0b68,_0x20e296,_0x19a6('0x1a4'));}else{_0x3057a0[_0x19a6('0x11e')](_0x32d236,_0x5f0b68,_0x20e296,_0x19a6('0x1a4'));}}break;case'3':_0x2c004d[_0x19a6('0x1a5')]+=0x1;_0x32d236['state']=0x3;_0x32d236[_0x19a6('0xca')]='NoAnswer';_0x32d236[_0x19a6('0x11b')]+=0x1;_0x32d236[_0x19a6('0x116')]+=0x1;var _0x169570=ut[_0x19a6('0x1a6')](_0x5c948f,_0x2c004d);ami['emit']('custom:agentnoanswer',_0x169570);_0x31b25e=_0x2c004d[_0x19a6('0x18e')];_0x51b8e1=_0x2c004d['callAdditionalPhoneAfterMin'];hopperUtils['createHistory'](_0x32d236)['catch'](loggerCatch(_0x19a6('0x1a7')));if(_0x3057a0[_0x19a6('0x1a2')](0x3,_0x5c948f,_0x2c004d)&&!_0x15a625){if(_0x32d236[_0x19a6('0x11b')]>=_0x2c004d[_0x19a6('0x18d')]){_0x3057a0['createStateFinal'](_0x32d236,_0x5f0b68,_0x20e296,_0x19a6('0x1a8'));}else{_0x3057a0['stateGlobal'](_0x32d236,_0x5f0b68,_0x20e296,_0x19a6('0x1a8'));}}break;case'5':_0x2c004d[_0x19a6('0x1a9')]+=0x1;_0x32d236[_0x19a6('0x6a')]=0x5;_0x32d236['statedesc']='Busy';_0x32d236[_0x19a6('0x119')]+=0x1;_0x32d236['countglobal']+=0x1;ami[_0x19a6('0x3b')](_0x19a6('0x1aa'),ut['buildObj'](_0x5c948f,_0x19a6('0x1ab')));_0x31b25e=_0x2c004d['dialBusyRetryFrequency'];_0x51b8e1=_0x2c004d['callAdditionalPhoneAfterMin'];hopperUtils[_0x19a6('0xc3')](_0x32d236)[_0x19a6('0x9a')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x3057a0[_0x19a6('0x1a2')](0x5,_0x5c948f,_0x2c004d)&&!_0x15a625){if(_0x32d236[_0x19a6('0x119')]>=_0x2c004d['dialBusyMaxRetry']){_0x3057a0['createStateFinal'](_0x32d236,_0x5f0b68,_0x20e296,_0x19a6('0x1ac'));}else{_0x3057a0['stateGlobal'](_0x32d236,_0x5f0b68,_0x20e296,_0x19a6('0x1ac'));}}break;case'8':_0x2c004d['outboundCongestionCallsDay']+=0x1;_0x32d236[_0x19a6('0x6a')]=0x8;_0x32d236[_0x19a6('0xca')]=_0x19a6('0x1ad');_0x32d236[_0x19a6('0x11a')]+=0x1;_0x32d236[_0x19a6('0x116')]+=0x1;_0x31b25e=_0x2c004d['dialCongestionRetryFrequency'];_0x51b8e1=_0x2c004d[_0x19a6('0xce')];ami[_0x19a6('0x3b')](_0x19a6('0x1ae'),ut['buildObj'](_0x5c948f,_0x19a6('0x1af')));hopperUtils[_0x19a6('0xc3')](_0x32d236)[_0x19a6('0x9a')](loggerCatch(_0x19a6('0x1b0')));if(_0x3057a0[_0x19a6('0x1a2')](0x8,_0x5c948f,_0x2c004d)&&!_0x15a625){if(_0x32d236[_0x19a6('0x11a')]>=_0x2c004d[_0x19a6('0x192')]){_0x3057a0[_0x19a6('0x129')](_0x32d236,_0x5f0b68,_0x20e296,'reason\x208\x20congestion');}else{_0x3057a0['stateGlobal'](_0x32d236,_0x5f0b68,_0x20e296,_0x19a6('0x1b1'));}}break;case'11':_0x2c004d[_0x19a6('0x1b2')]+=0x1;_0x32d236[_0x19a6('0x6a')]=0xb;_0x32d236['statedesc']=_0x19a6('0xe2');_0x32d236[_0x19a6('0xe4')]+=0x1;_0x32d236[_0x19a6('0x116')]+=0x1;_0x31b25e=_0x2c004d[_0x19a6('0xe5')];_0x51b8e1=_0x2c004d[_0x19a6('0xce')];hopperUtils[_0x19a6('0xc3')](_0x32d236)[_0x19a6('0x9a')](loggerCatch(_0x19a6('0x1b3')));if(_0x3057a0[_0x19a6('0x1a2')](0xb,_0x5c948f,_0x2c004d)&&!_0x15a625){if(_0x32d236['countabandonedretry']>=_0x2c004d[_0x19a6('0xe7')]){_0x3057a0[_0x19a6('0x129')](_0x32d236,_0x5f0b68,_0x20e296,_0x19a6('0x1b4'));}else{_0x3057a0[_0x19a6('0x11e')](_0x32d236,_0x5f0b68,_0x20e296,_0x19a6('0x1b4'));}}break;case'20':_0x2c004d[_0x19a6('0x1b5')]+=0x1;_0x32d236[_0x19a6('0x6a')]=0x14;_0x32d236[_0x19a6('0xca')]=_0x19a6('0x1b6');_0x32d236[_0x19a6('0x127')]+=0x1;_0x32d236[_0x19a6('0x116')]+=0x1;_0x31b25e=_0x2c004d[_0x19a6('0x19a')];_0x51b8e1=_0x2c004d['callAdditionalPhoneAfterMin'];ami[_0x19a6('0x3b')]('custom:agentreject',ut[_0x19a6('0x111')](_0x5c948f,_0x19a6('0x1b7')));hopperUtils[_0x19a6('0xc3')](_0x32d236)[_0x19a6('0x9a')](loggerCatch(_0x19a6('0x1b8')));if(_0x3057a0[_0x19a6('0x1a2')](0x14,_0x5c948f,_0x2c004d)&&!_0x15a625){if(_0x32d236[_0x19a6('0x127')]>=_0x2c004d[_0x19a6('0x199')]){_0x3057a0[_0x19a6('0x129')](_0x32d236,_0x5f0b68,_0x20e296,_0x19a6('0x1b9'));}else{_0x3057a0['stateGlobal'](_0x32d236,_0x5f0b68,_0x20e296,_0x19a6('0x1b9'));}}break;default:_0x2c004d['outboundUnknownCallsDay']+=0x1;_0x32d236[_0x19a6('0x6a')]=0xc;_0x32d236['statedesc']=_0xdac8f8[_0x19a6('0xbf')];_0x31b25e=_0x2c004d[_0x19a6('0x19a')];_0x51b8e1=_0x2c004d[_0x19a6('0xce')];hopperUtils[_0x19a6('0xc3')](_0x32d236)[_0x19a6('0x9a')](loggerCatch(_0x19a6('0x1ba')));if(_0x3057a0[_0x19a6('0x1a2')](_0xdac8f8['reason'],_0x5c948f,_0x2c004d)&&!_0x15a625){if(_0x32d236[_0x19a6('0x119')]+_0x32d236[_0x19a6('0x11a')]+_0x32d236[_0x19a6('0x11b')]+_0x32d236['countnosuchnumberretry']+_0x32d236[_0x19a6('0xd3')]+_0x32d236[_0x19a6('0xe4')]+_0x32d236['countmachineretry']+_0x32d236[_0x19a6('0x127')]>=_0x2c004d[_0x19a6('0x11d')]){_0x3057a0[_0x19a6('0x11e')](_0x32d236,_0x5f0b68,_0x20e296,_0xdac8f8['reason']);}else{_0x3057a0[_0x19a6('0x129')](_0x32d236,_0x5f0b68,_0x20e296,_0xdac8f8[_0x19a6('0xbf')]);}}}})['then'](function(){if(_0x15a625){hopperUtils[_0x19a6('0xe0')](_0x32d236,_0x31b25e,_0x51b8e1)[_0x19a6('0x39')](function(){return _0x5f0b68(0x1);});}});});};Dialer['prototype'][_0x19a6('0x11e')]=function(_0x27817a,_0x28b9e9,_0x475f55,_0x5a2777){var _0x5ef07a=new Final(_0x27817a);_0x5ef07a['state']=0xf;_0x5ef07a[_0x19a6('0xca')]=_0x19a6('0x1bb');this[_0x19a6('0x129')](_0x5ef07a,_0x28b9e9,_0x475f55,_0x5a2777);};Dialer[_0x19a6('0x7c')][_0x19a6('0x129')]=function(_0x3eef37,_0x15e0ca,_0x49b025,_0x3177f9){hopperUtils[_0x19a6('0xc5')](_0x3eef37)[_0x19a6('0x39')](function(){return _0x15e0ca(msgResponse(_0x19a6('0x19c'),_0x19a6('0x1bc'),_0x3177f9));})['catch'](function(){return _0x49b025(msgResponse(_0x19a6('0x1bd'),'Failure','contact\x20not\x20moved'));});};Dialer[_0x19a6('0x7c')][_0x19a6('0xa')]=function(_0x2b9801){var _0x20a6d3=_0x2b9801[_0x19a6('0x1be')]/0x64;var _0x16526b=_0x2b9801[_0x19a6('0xc8')]/(_0x2b9801[_0x19a6('0xc8')]+_0x2b9801[_0x19a6('0x10d')]);var _0x377990=Math['round'](_0x2b9801[_0x19a6('0x1bf')]*(_0x2b9801[_0x19a6('0x1c0')]/0x64));var _0x53e544=Math['round'](_0x2b9801[_0x19a6('0x1bf')]*(_0x2b9801[_0x19a6('0x1c1')]/0x64));var _0x246e40=_0x2b9801[_0x19a6('0x137')]+_0x2b9801[_0x19a6('0x139')];var _0x4853a2=Math[_0x19a6('0x1c2')](_0x2b9801[_0x19a6('0x52')]*_0x2b9801['erlangAbandonmentRate']*_0x2b9801[_0x19a6('0x1c3')]*_0x2b9801['predictiveIntervalMultiplicativeFactor']);if(_[_0x19a6('0x4c')](_0x2b9801[_0x19a6('0x5a')])){if(!_[_0x19a6('0x4c')](_0x2b9801[_0x19a6('0x26')])){_0x2b9801[_0x19a6('0x26')]=undefined;loggerPredictive[_0x19a6('0x60')](_0x19a6('0x1c4'),_0x19a6('0x1c5'));}if(!_[_0x19a6('0x4c')](_0x2b9801[_0x19a6('0x5e')])){loggerPredictive[_0x19a6('0x60')](_0x19a6('0x1c4'),_0x19a6('0x1c6'));clearInterval(_0x2b9801[_0x19a6('0x5e')]);_0x2b9801[_0x19a6('0x5e')]=undefined;}_0x2b9801[_0x19a6('0x5a')]=moment()[_0x19a6('0x40')](_0x19a6('0xbe'));loggerPredictive[_0x19a6('0x43')](_0x2b9801[_0x19a6('0x5c')],_0x19a6('0x1c7'),_0x2b9801[_0x19a6('0x5a')]);this['handlePower'](_0x2b9801,0x1);}else if(ifInterval(_0x2b9801[_0x19a6('0x1c8')],_0x2b9801[_0x19a6('0x5a')])){this[_0x19a6('0xac')](_0x2b9801,0x1);loggerPredictiveCalls[_0x19a6('0x43')]('[startMethodPredictive][StartProgressive][Loop]',_0x2b9801[_0x19a6('0x5a')],_0x2b9801['name']);_0x2b9801[_0x19a6('0x52')]=0x0;_0x2b9801[_0x19a6('0xc9')]=0x0;}else if(_0x20a6d3<_0x16526b&&_0x2b9801[_0x19a6('0x1c9')]===_0x19a6('0x1ca')){clearPredictiveAttributes(_0x2b9801);loggerPredictive['info'](_0x19a6('0x1cb'),_0x19a6('0x1cc'),_0x16526b,'startProgressive',_0x2b9801[_0x19a6('0x5c')]);}else if(_0x4853a2<_0x2b9801[_0x19a6('0xc9')]&&_0x2b9801['dialPredictiveOptimization']===_0x19a6('0x1ca')){clearPredictiveAttributes(_0x2b9801);loggerPredictive[_0x19a6('0x43')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0x19a6('0x1cd'),_0x4853a2,_0x19a6('0x1ce'),_0x2b9801['predictiveIntervalErlangCallsDroppedCalls'],_0x19a6('0x5a'),_0x2b9801['name']);}else if(!ifInterval(_0x2b9801[_0x19a6('0x1c8')],_0x2b9801['startProgressive'])&&_[_0x19a6('0x4c')](_0x2b9801[_0x19a6('0x26')])&&!_[_0x19a6('0x4c')](_0x2b9801['startProgressive'])){_0x2b9801['startPredictive']=moment()['format'](_0x19a6('0xbe'));loggerPredictive[_0x19a6('0x43')](_0x2b9801['name'],_0x19a6('0x1cf'),_0x2b9801[_0x19a6('0x26')]);hopperUtils['avgHandleTime'](_0x2b9801[_0x19a6('0x1c8')])[_0x19a6('0x39')](this[_0x19a6('0x1d0')](_0x2b9801))[_0x19a6('0x39')](mergeDataErlangB(_0x2b9801))[_0x19a6('0x39')](this[_0x19a6('0x1d1')](_0x2b9801))['catch'](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x2b9801));}else if(!ifInterval(_0x2b9801[_0x19a6('0x1c8')],_0x2b9801[_0x19a6('0x26')])){_0x2b9801[_0x19a6('0xc9')]=0x0;_0x2b9801[_0x19a6('0x26')]=moment()['format'](_0x19a6('0xbe'));loggerPredictive[_0x19a6('0x43')](_0x2b9801[_0x19a6('0x5c')],_0x19a6('0x1d2'),_0x2b9801[_0x19a6('0x26')]);clearInterval(_0x2b9801[_0x19a6('0x5e')]);_0x2b9801[_0x19a6('0x5e')]=undefined;hopperUtils[_0x19a6('0x1d3')](_0x2b9801[_0x19a6('0x1c8')])[_0x19a6('0x39')](this[_0x19a6('0x1d0')](_0x2b9801))['then'](mergeDataErlangB(_0x2b9801))[_0x19a6('0x39')](this[_0x19a6('0x1d1')](_0x2b9801))[_0x19a6('0x9a')](loggerCatchPredictive(_0x19a6('0x1d4'),_0x2b9801));}else if(_0x2b9801[_0x19a6('0x1bf')]&&_0x246e40<_0x2b9801[_0x19a6('0x1bf')]-_0x53e544){clearPredictiveAttributes(_0x2b9801);loggerPredictive[_0x19a6('0x43')](_0x2b9801['name'],_0x19a6('0x1d5'),_0x246e40,')\x20are\x20less\x20than\x20threshold\x20(',_0x2b9801[_0x19a6('0x1bf')],'-',_0x53e544,'=',_0x2b9801[_0x19a6('0x1bf')]-_0x53e544,')');}else if(_0x2b9801[_0x19a6('0x1bf')]&&_0x246e40>_0x2b9801[_0x19a6('0x1bf')]+_0x377990){clearPredictiveAttributes(_0x2b9801);loggerPredictive[_0x19a6('0x43')](_0x2b9801[_0x19a6('0x5c')],_0x19a6('0x1d5'),_0x246e40,_0x19a6('0x1d6'),_0x2b9801[_0x19a6('0x1bf')],'+',_0x377990,'=',_0x2b9801[_0x19a6('0x1bf')]+_0x377990,')');}};Dialer[_0x19a6('0x7c')]['getDataPredictive']=function(_0x11d68d){var _0x48efd9=this;return function(_0x643ae6){return new Promise(function(_0x2b845a,_0x80f44e){_['merge'](_0x11d68d,_0x643ae6[0x0]);if(checkGetDataPredictive(_0x643ae6[0x0])){var _0x18ad52=_0x11d68d[_0x19a6('0x1bf')]=_0x11d68d[_0x19a6('0x139')]+_0x11d68d['available'];var _0x153385=_0x11d68d[_0x19a6('0x1c8')]*0x3c;var _0xc40dbf=_0x643ae6[0x0]['predictiveIntervalAvgTalktime']+_0x643ae6[0x0][_0x19a6('0x49')];var _0x6b5211=(_0x643ae6[0x0][_0x19a6('0x1d7')]+_0x643ae6[0x0][_0x19a6('0x45')]+_0x643ae6[0x0][_0x19a6('0x47')])/_0x643ae6[0x0][_0x19a6('0x1d8')];_0x11d68d['predictiveIntervalHitRate']=_0x6b5211>0x0?_0x6b5211:0x1;switch(_0x11d68d[_0x19a6('0x1c9')]){case _0x19a6('0x1ca'):var _0x1089bb=_0x11d68d[_0x19a6('0x1be')]/0x64;return _0x48efd9[_0x19a6('0x1d9')](_0x18ad52,_0x153385,_0xc40dbf,_0x6b5211,_0x1089bb)[_0x19a6('0x39')](function(_0x4ffa2b){return _0x2b845a(_0x4ffa2b);});case _0x19a6('0x1da'):var _0x3cbab7=_0x11d68d[_0x19a6('0x1be')]/0x64;return _0x48efd9[_0x19a6('0x1db')](_0x18ad52,_0x153385,_0xc40dbf,_0x6b5211,_0x3cbab7)['then'](function(_0x4a464c){return _0x2b845a(_0x4a464c);});default:return _0x80f44e(msgResponse('[getDataPredictive]','Failure',_0x19a6('0x1dc')));}}else{return _0x80f44e(msgResponse(_0x19a6('0x1dd'),_0x19a6('0x8c'),_0x19a6('0x1de')));}});};};Dialer[_0x19a6('0x7c')]['getDataPredictiveOld']=function(_0x29109e){var _0x223993=this;return function(_0x4f86a3){return new Promise(function(_0x5c5e3e,_0x37992a){_[_0x19a6('0x58')](_0x29109e,_0x4f86a3[0x0]);if(checkGetDataPredictive(_0x4f86a3[0x0])){loggerPredictive[_0x19a6('0x43')](JSON[_0x19a6('0x6e')](_0x4f86a3[0x0]));if(_0x29109e[_0x19a6('0x1c9')]===_0x19a6('0x1ca')){return _0x223993['getVoiceQueueRtPauses'](_0x29109e['id'])[_0x19a6('0x39')](function(_0x244aea){var _0x530c74=_0x29109e[_0x19a6('0x1df')]-_0x244aea[0x0][_0x19a6('0x1e0')];var _0x300fd7=_0x29109e[_0x19a6('0x1c8')]*0x3c;var _0x1cc382=_0x4f86a3[0x0][_0x19a6('0x4d')]+_0x4f86a3[0x0][_0x19a6('0x49')];var _0x352a60=(_0x4f86a3[0x0][_0x19a6('0x1d7')]+_0x4f86a3[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x4f86a3[0x0][_0x19a6('0x47')])/_0x4f86a3[0x0][_0x19a6('0x1d8')];var _0x1551ca=_0x29109e[_0x19a6('0x1be')]/0x64;_0x29109e[_0x19a6('0x1e1')]=_0x244aea[0x0]['outboundQueuePauses']||0x0;_0x29109e['predictiveIntervalHitRate']=_0x352a60>0x0?_0x352a60:0x1;return _0x223993['abandonmentRate'](_0x530c74,_0x300fd7,_0x1cc382,_0x352a60,_0x1551ca);})[_0x19a6('0x39')](function(_0x5ac5b6){return _0x5c5e3e(_0x5ac5b6);})[_0x19a6('0x9a')](function(_0x2abc2f){return _0x37992a(msgResponse('[CatchErlangB]',_0x19a6('0x8c'),JSON[_0x19a6('0x6e')](_0x2abc2f)));});}if(_0x29109e[_0x19a6('0x1c9')]===_0x19a6('0x1da')){return _0x223993['getVoiceQueueRtPauses'](_0x29109e['id'])[_0x19a6('0x39')](function(_0xee85ee){var _0x1f79dc=_0x29109e[_0x19a6('0x1df')]-_0xee85ee[0x0]['outboundQueuePauses'];var _0x778c5b=_0x29109e[_0x19a6('0x1c8')]*0x3c;var _0x277941=_0x4f86a3[0x0][_0x19a6('0x4d')]+_0x4f86a3[0x0][_0x19a6('0x49')];var _0x592e2a=(_0x4f86a3[0x0]['predictiveIntervalAnsweredCalls']+_0x4f86a3[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x4f86a3[0x0][_0x19a6('0x47')])/_0x4f86a3[0x0][_0x19a6('0x1d8')];var _0x5c08a1=_0x29109e[_0x19a6('0x1be')]/0x64;_0x29109e['predictiveIntervalPauses']=_0xee85ee[0x0][_0x19a6('0x1e0')]||0x0;_0x29109e[_0x19a6('0x1c3')]=_0x592e2a>0x0?_0x592e2a:0x1;return _0x223993[_0x19a6('0x1db')](_0x1f79dc,_0x778c5b,_0x277941,_0x592e2a,_0x5c08a1);})[_0x19a6('0x39')](function(_0xa42a20){return _0x5c5e3e(_0xa42a20);})['catch'](function(_0x4d9198){return _0x37992a(msgResponse(_0x19a6('0x1e2'),'Failure',JSON['stringify'](_0x4d9198)));});}}else{return _0x37992a(msgResponse(_0x19a6('0x1dd'),_0x19a6('0x8c'),_0x19a6('0x1de')));}});};};Dialer['prototype']['startMethodPredictive']=function(_0x47b5ed){var _0x434de7=this;return function(){var _0x442248=0x0;var _0x57b8cf=Math[_0x19a6('0x1c2')](_0x47b5ed[_0x19a6('0x53')]*0x3e8);if(_0x57b8cf>0x0){_0x57b8cf=_0x57b8cf<0x64?0x64:_0x57b8cf;loggerPredictive['info'](_0x47b5ed['name'],_0x19a6('0x1e3'),_0x57b8cf,_0x19a6('0x1e4'));_0x47b5ed['handlePredictive']=setInterval(function(){_0x434de7[_0x19a6('0x5e')](_0x47b5ed);loggerPredictiveCalls[_0x19a6('0x43')](_0x19a6('0x1e5'),_0x442248+=0x1);},_0x57b8cf);}else{loggerPredictive[_0x19a6('0x43')](_0x47b5ed[_0x19a6('0x5c')],_0x19a6('0x1e6'));}};};Dialer[_0x19a6('0x7c')][_0x19a6('0x1e7')]=function(_0x58d0cd,_0x3bfe75){var _0x3f134e=this;return function(_0x2e1d06){if(_['isEmpty'](_0x2e1d06)){if(_['isNil'](_0x3bfe75[_0x19a6('0x152')])||!_0x3bfe75[_0x19a6('0x1e8')]){if(_0x58d0cd[_0x19a6('0xaa')]===_0x19a6('0xae')){_0x58d0cd[_0x19a6('0x6b')]=_['isUndefined'](_0x58d0cd['queueStatusComplete'])?!![]:_0x58d0cd[_0x19a6('0x6b')];var _0x2c15cc=uuid['v4']();_0x3f134e[_0x19a6('0x22')][_0x2c15cc]=new Action(_0x58d0cd,_0x3bfe75,_0x2c15cc);loggerBooked['info'](_0x19a6('0x1e9'),_0x2c15cc,'queueStatusComplete:\x20',JSON[_0x19a6('0x6e')](_0x58d0cd[_0x19a6('0x6b')]),_0x19a6('0x1ea'),_0x58d0cd['name']);if(_0x58d0cd[_0x19a6('0x6b')]){_0x58d0cd[_0x19a6('0x6b')]=![];_0x3f134e[_0x19a6('0xf1')][_0x3f134e[_0x19a6('0x22')][_0x2c15cc][_0x19a6('0xba')]]=[];ami[_0x19a6('0x94')]({'actionid':_0x2c15cc,'action':_0x19a6('0x1eb'),'queue':_0x58d0cd[_0x19a6('0x5c')]})[_0x19a6('0x9a')](function(){_0x3f134e[_0x19a6('0xbd')](_0x58d0cd);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x3f134e['actions'][_0x2c15cc][_0x19a6('0xd6')],'ListId':_0x3f134e[_0x19a6('0x22')][_0x2c15cc][_0x19a6('0xd7')],'VoiceQueueId':_0x3f134e[_0x19a6('0x22')][_0x2c15cc][_0x19a6('0xd8')]||undefined,'CampaignId':_0x3f134e[_0x19a6('0x22')][_0x2c15cc]['CampaignId']||undefined})[_0x19a6('0x9a')](loggerCatch(_0x19a6('0x1ec')));delete _0x3f134e[_0x19a6('0x22')][_0x2c15cc];});}else{loggerBooked['info'](_0x19a6('0x1ed'),JSON[_0x19a6('0x6e')](_0x58d0cd[_0x19a6('0x6b')]),_0x19a6('0x1ea'),_0x58d0cd[_0x19a6('0x5c')]);_0x3f134e['updateOriginated'](_0x58d0cd);hopperUtils[_0x19a6('0xd2')]({'active':![],'ContactId':_0x3f134e['actions'][_0x2c15cc][_0x19a6('0xd6')],'ListId':_0x3f134e['actions'][_0x2c15cc]['ListId'],'VoiceQueueId':_0x3f134e[_0x19a6('0x22')][_0x2c15cc][_0x19a6('0xd8')]||undefined,'CampaignId':_0x3f134e[_0x19a6('0x22')][_0x2c15cc][_0x19a6('0xd9')]||undefined})[_0x19a6('0x9a')](loggerCatch(_0x19a6('0x1ec')));delete _0x3f134e[_0x19a6('0x22')][_0x2c15cc];}}else{return _0x3f134e[_0x19a6('0x158')](_0x58d0cd,_0x3bfe75);}}else{if(utils[_0x19a6('0x59')](undefined,_0x3bfe75[_0x19a6('0x1ee')])<_0x58d0cd[_0x19a6('0x1ef')]*0x3c){if(_0x3bfe75[_0x19a6('0x147')]&&!_0x3bfe75['Agent'][_0x19a6('0x1f0')]){_0x3f134e[_0x19a6('0x1b')][_0x19a6('0xf5')](_0x3bfe75['id'])[_0x19a6('0x19')](function(){_0x3f134e['updateOriginated'](_0x58d0cd);});}else{hopperUtils[_0x19a6('0x1f1')]({'active':![]},_0x3bfe75['id'],0x1)[_0x19a6('0x19')](function(){_0x3f134e[_0x19a6('0xbd')](_0x58d0cd);});}}else{_0x58d0cd[_0x19a6('0x1f2')]+=0x1;_0x3f134e[_0x19a6('0xbd')](_0x58d0cd);if(_0x58d0cd['dialRecallInQueue']){hopperUtils[_0x19a6('0xd2')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x3bfe75[_0x19a6('0xd6')],'ListId':_0x3bfe75[_0x19a6('0xd7')],'VoiceQueueId':_0x3bfe75[_0x19a6('0xd8')]||undefined,'CampaignId':_0x3bfe75[_0x19a6('0xd9')]||undefined})[_0x19a6('0x9a')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));hopperUtils[_0x19a6('0xc3')](createObjHistory(_0x58d0cd,_0x3bfe75,utils[_0x19a6('0x65')]['QUEUE_RECALL'],0x17,'RecallInQueue'))['catch'](loggerCatch(_0x19a6('0x1f3')));}else{_0x3f134e['saveInDb'](createObjHistory(_0x58d0cd,_0x3bfe75,utils[_0x19a6('0x65')][_0x19a6('0x1f4')],0x16,'RecallFailedTimeout'),'[Originate][HistoryRecallClose][historyCatch]',_0x19a6('0x1f5'));}}}}else{_0x58d0cd[_0x19a6('0x1f6')]+=0x1;_0x3f134e[_0x19a6('0x112')](createObjHistory(_0x58d0cd,_0x3bfe75,utils[_0x19a6('0x65')]['BLACKLIST'],0xd,_0x19a6('0x1f7')),'[Originate][historyBlacklist]','[Originate][MoveBlacklist]');throw'inBlackList';}};};Dialer[_0x19a6('0x7c')][_0x19a6('0x157')]=function(_0x2de136){var _0x128c5d=this;var _0x13cd3f=_0x2de136[_0x19a6('0x1f8')]-_0x2de136['originated']-_0x2de136[_0x19a6('0x1f9')];emitCampaignSummary(_0x2de136);if(_0x13cd3f>0x0){if(_0x13cd3f>this['maxNumberOriginate']){_0x13cd3f=this[_0x19a6('0x20')];}_0x2de136[_0x19a6('0x1f9')]+=_0x13cd3f;hopperUtils[_0x19a6('0x1fa')](_0x2de136['id'],_0x13cd3f,_0x2de136[_0x19a6('0x1fb')],_0x2de136)[_0x19a6('0x39')](function(_0x4f65f7){_0x2de136[_0x19a6('0x1f9')]-=_0x13cd3f;_0x2de136['temp']=_0x2de136[_0x19a6('0x1f9')]>0x0?_0x2de136['temp']:0x0;if(!utils[_0x19a6('0x1fc')](_0x4f65f7)){_0x2de136[_0x19a6('0x64')]=utils[_0x19a6('0x65')][_0x19a6('0x68')];logger['info'](_0x19a6('0x1fd')+_0x2de136[_0x19a6('0x5c')]);}else{_0x2de136[_0x19a6('0x77')]+=_0x4f65f7[_0x19a6('0x92')];_0x2de136[_0x19a6('0x64')]=utils['CAMPAIGN_STATUS'][_0x19a6('0x1fe')];for(var _0x55ac19=0x0;_0x55ac19<_0x4f65f7[_0x19a6('0x92')];_0x55ac19+=0x1){_0x2de136[_0x19a6('0x1ff')]+=0x1;if(_[_0x19a6('0xee')](_0x4f65f7[_0x55ac19])||_[_0x19a6('0xee')](_0x4f65f7[_0x55ac19][_0x19a6('0x171')])||_[_0x19a6('0xee')](_0x4f65f7[_0x55ac19][_0x19a6('0x15c')])){_0x128c5d[_0x19a6('0x200')](_0x19a6('0x201'),_0x2de136,_0x4f65f7[_0x55ac19]);}else{hopperUtils[_0x19a6('0x202')](_[_0x19a6('0xf2')](_0x4f65f7[_0x55ac19],[_0x19a6('0xd9'),'phone']))[_0x19a6('0x39')](_0x128c5d[_0x19a6('0x1e7')](_0x2de136,_0x4f65f7[_0x55ac19]))[_0x19a6('0x9a')](_0x128c5d[_0x19a6('0x203')](_0x19a6('0x204'),_0x2de136));}}}})[_0x19a6('0x9a')](loggerGetContactDialer('[getContactCampaign2]',_0x2de136,_0x13cd3f));}};Dialer['prototype'][_0x19a6('0xac')]=function(_0x15166e,_0x144e73){var _0x46ea73=this;var _0x3acd2f=[];if(_0x144e73<0x1||_0x15166e['dialMethod']===_0x19a6('0xae')){_0x144e73=0x1;}var _0x517231=Math['floor'](_0x15166e['available']*_0x144e73)-_0x15166e['originated']-_0x15166e[_0x19a6('0x1f9')];if(_0x15166e[_0x19a6('0x205')]>0x0){var _0x3b1d8d=_0x15166e[_0x19a6('0x205')]-_0x15166e['originated']-_0x15166e[_0x19a6('0x139')]-_0x15166e['temp']-_0x15166e[_0x19a6('0x13a')];if(_0x517231>_0x3b1d8d){_0x517231=_0x3b1d8d;}}if(_0x517231>0x0){if(_0x15166e[_0x19a6('0xaa')]===_0x19a6('0xae')){_0x517231=0x1;}if(_0x517231>this[_0x19a6('0x20')]){_0x517231=this[_0x19a6('0x20')];}_0x15166e[_0x19a6('0x1f9')]+=_0x517231;for(var _0x449871 in this[_0x19a6('0x1e')]){if(typeof this[_0x19a6('0x1e')][_0x449871]!==_0x19a6('0xa3')){if(this[_0x19a6('0x1e')][_0x449871][_0x19a6('0x6a')]===_0x19a6('0x206')&&this[_0x19a6('0x1e')][_0x449871][_0x19a6('0x80')]===_0x19a6('0x81')){_0x3acd2f[_0x19a6('0x93')](this[_0x19a6('0x1e')][_0x449871]['id']);}}}hopperUtils['getContactDialer'](_0x15166e,_0x3acd2f,_0x517231)['then'](function(_0x262950){_0x15166e[_0x19a6('0x1f9')]-=_0x517231;_0x15166e['temp']=_0x15166e['temp']>0x0?_0x15166e[_0x19a6('0x1f9')]:0x0;if(!utils[_0x19a6('0x1fc')](_0x262950)){hopperUtils['countReScheduled'](_0x15166e)['then'](sendMessageReschedule(_0x15166e))[_0x19a6('0x9a')](loggerCatch(_0x19a6('0x207')));}else{_0x15166e['originated']+=_0x262950[_0x19a6('0x92')];_0x15166e[_0x19a6('0x64')]=_0x15166e[_0x19a6('0xaa')]===_0x19a6('0xae')?utils[_0x19a6('0x65')][_0x19a6('0x13b')]:utils['CAMPAIGN_STATUS']['RUNNING'];for(var _0x424341=0x0;_0x424341<_0x262950['length'];_0x424341+=0x1){if(_[_0x19a6('0xee')](_0x262950[_0x424341])||_['isNil'](_0x262950[_0x424341][_0x19a6('0x171')])||_[_0x19a6('0xee')](_0x262950[_0x424341]['phone'])){_0x46ea73[_0x19a6('0x200')](_0x19a6('0x201'),_0x15166e,_0x262950[_0x424341]);}else{hopperUtils[_0x19a6('0x208')](_[_0x19a6('0xf2')](_0x262950[_0x424341],['VoiceQueueId','phone']))[_0x19a6('0x39')](_0x46ea73['checkContactBlack'](_0x15166e,_0x262950[_0x424341]))[_0x19a6('0x9a')](_0x46ea73[_0x19a6('0x203')](_0x19a6('0x201'),_0x15166e));}}}})[_0x19a6('0x9a')](loggerGetContactDialer(_0x19a6('0x209'),_0x15166e,_0x517231));}};Dialer[_0x19a6('0x7c')][_0x19a6('0x5e')]=function(_0x311702){if(_0x311702[_0x19a6('0x205')]>0x0){var _0x54613d=_0x311702['dialLimitQueue']-_0x311702[_0x19a6('0x77')]-_0x311702[_0x19a6('0x139')];if(_0x54613d>0x0){this['tryOriginatePredictive'](_0x311702);}else{loggerPredictiveCalls[_0x19a6('0x43')](_0x19a6('0x20a'));}}else{this[_0x19a6('0x20b')](_0x311702);}};Dialer['prototype'][_0x19a6('0x20b')]=function(_0x363d77){var _0x5ae405=this;var _0x15d3c3=[];_0x363d77[_0x19a6('0x77')]+=0x1;for(var _0x2cb294 in this[_0x19a6('0x1e')]){if(typeof this[_0x19a6('0x1e')][_0x2cb294]!==_0x19a6('0xa3')){if(this[_0x19a6('0x1e')][_0x2cb294]['state']===_0x19a6('0x206')&&this[_0x19a6('0x1e')][_0x2cb294][_0x19a6('0x80')]===_0x19a6('0x81')){_0x15d3c3[_0x19a6('0x93')](this[_0x19a6('0x1e')][_0x2cb294]['id']);}}}return this['getContactDialer'](_0x363d77['id'],_0x15d3c3,0x1,_0x363d77[_0x19a6('0x1fb')],_0x363d77)[_0x19a6('0x39')](function(_0x2fd150){if(!utils['checkContactEmpty'](_0x2fd150)){utils[_0x19a6('0x62')](_0x363d77,0x1,0x0);return hopperUtils[_0x19a6('0x20c')](_0x363d77)[_0x19a6('0x39')](sendMessageReschedule(_0x363d77))[_0x19a6('0x9a')](loggerCatch(_0x19a6('0x207')));}else{_0x363d77['message']=utils['CAMPAIGN_STATUS'][_0x19a6('0x1fe')];if(_['isNil'](_0x2fd150[0x0])||_['isNil'](_0x2fd150[0x0][_0x19a6('0x171')])||_[_0x19a6('0xee')](_0x2fd150[0x0][_0x19a6('0x15c')])){_0x5ae405[_0x19a6('0x200')](_0x19a6('0x201'),_0x363d77,_0x2fd150[0x0]);}else{return hopperUtils[_0x19a6('0x208')](_[_0x19a6('0xf2')](_0x2fd150[0x0],['VoiceQueueId',_0x19a6('0x15c')]))[_0x19a6('0x39')](_0x5ae405['checkContactBlack'](_0x363d77,_0x2fd150[0x0]))[_0x19a6('0x9a')](_0x5ae405[_0x19a6('0x203')]('[actionOriginatePredictive]\x20',_0x363d77));}}})[_0x19a6('0x9a')](loggerGetContactDialer(_0x19a6('0x20d'),_0x363d77,0x1));};Dialer[_0x19a6('0x7c')][_0x19a6('0x1d9')]=function(_0x27bc11,_0x2c2b9e,_0x3e8331,_0x1be03,_0x4118ec,_0x40384a){loggerPredictive[_0x19a6('0x43')](_0x19a6('0x20e'));loggerPredictive[_0x19a6('0x43')](_0x19a6('0x20f'),_0x27bc11);loggerPredictive[_0x19a6('0x43')](_0x19a6('0x210'),_0x2c2b9e);loggerPredictive[_0x19a6('0x43')](_0x19a6('0x211'),_0x3e8331);loggerPredictive[_0x19a6('0x43')]('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',_0x1be03);loggerPredictive[_0x19a6('0x43')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4118ec);loggerPredictive[_0x19a6('0x43')](_0x19a6('0x4b'));return new Promise(function(_0x3509db,_0x2dd0c8){if(_0x27bc11<=0x0||isNaN(_0x27bc11)){return _0x2dd0c8(msgResponse('[abandonmentRate]',_0x19a6('0xb8'),_0x19a6('0x212')+_0x27bc11));}if(_0x3e8331<=0x0||isNaN(_0x3e8331)){return _0x2dd0c8(msgResponse(_0x19a6('0x213'),'Error',_0x19a6('0x214')+_0x3e8331));}if(_0x1be03<=0x0||isNaN(_0x1be03)){return _0x2dd0c8(msgResponse('[abandonmentRate]',_0x19a6('0xb8'),_0x19a6('0x215')+_0x1be03));}if(_0x2c2b9e<=0x0||isNaN(_0x2c2b9e)){return _0x2dd0c8(msgResponse(_0x19a6('0x213'),_0x19a6('0xb8'),_0x19a6('0x216')+_0x2c2b9e));}if(_0x4118ec<=0x0||isNaN(_0x4118ec)){return _0x2dd0c8(msgResponse(_0x19a6('0x213'),_0x19a6('0xb8'),_0x19a6('0x217')+_0x4118ec));}_0x40384a=_0x40384a||0x0;var _0x499c83=0x1/_0x3e8331;var _0x4ffff6=0x0;var _0x2e62cb=0x0;var _0x3f8bcc=0x0;var _0x2fde3b=0x0;for(var _0xf59f4b=0x0;_0x3f8bcc<_0x4118ec;_0xf59f4b+=0x1){_0x2e62cb=_0xf59f4b/_0x2c2b9e;_0x4ffff6=(_0x1be03*_0x2e62cb+_0x40384a)/_0x499c83;_0x3f8bcc=utils[_0x19a6('0x218')](_0x4ffff6,_0x27bc11);_0x2fde3b=_0x4ffff6/_0x27bc11*(0x1-utils[_0x19a6('0x218')](_0x4ffff6,_0x27bc11));}return _0x3509db({'erlangCalls':_0xf59f4b,'erlangCallToSecond':_0x2c2b9e/_0xf59f4b,'erlangAbandonmentRate':_0x3f8bcc,'erlangBusyFactor':_0x2fde3b});});};Dialer['prototype']['busyFactor']=function(_0x38d9ba,_0x2223e3,_0x54d18b,_0x3f64cb,_0x54293e,_0x19121f){loggerPredictive[_0x19a6('0x43')](_0x19a6('0x219'));loggerPredictive[_0x19a6('0x43')](_0x19a6('0x20f'),_0x38d9ba);loggerPredictive[_0x19a6('0x43')](_0x19a6('0x210'),_0x2223e3);loggerPredictive[_0x19a6('0x43')](_0x19a6('0x211'),_0x54d18b);loggerPredictive[_0x19a6('0x43')](_0x19a6('0x21a'),_0x3f64cb);loggerPredictive['info'](_0x19a6('0x21b'),_0x54293e);loggerPredictive['info'](_0x19a6('0x4b'));return new Promise(function(_0x274bee,_0x3aa9d4){if(_0x38d9ba<=0x0||isNaN(_0x38d9ba)){return _0x3aa9d4(msgResponse(_0x19a6('0x21c'),_0x19a6('0xb8'),_0x19a6('0x212')+_0x38d9ba));}if(_0x54d18b<=0x0||isNaN(_0x54d18b)){return _0x3aa9d4(msgResponse(_0x19a6('0x21c'),_0x19a6('0xb8'),_0x19a6('0x214')+_0x54d18b));}if(_0x3f64cb<=0x0||isNaN(_0x3f64cb)){return _0x3aa9d4(msgResponse(_0x19a6('0x21c'),_0x19a6('0xb8'),_0x19a6('0x215')+_0x3f64cb));}if(_0x2223e3<=0x0||isNaN(_0x2223e3)){return _0x3aa9d4(msgResponse(_0x19a6('0x21c'),_0x19a6('0xb8'),_0x19a6('0x216')+_0x2223e3));}if(_0x54293e<=0x0||isNaN(_0x54293e)){return _0x3aa9d4(msgResponse(_0x19a6('0x21c'),'Error','Umin\x20=\x20'+_0x54293e));}_0x19121f=_0x19121f||0x0;var _0x5cb004=0x1/_0x54d18b;var _0x3a78e8=0x0;var _0x335e31=0x0;var _0x54348c=0x0;var _0x1585b2=0x0;for(var _0xc4692=0x0;_0x1585b2<_0x54293e;_0xc4692+=0x1){_0x335e31=_0xc4692/_0x2223e3;_0x3a78e8=(_0x3f64cb*_0x335e31+_0x19121f)/_0x5cb004;_0x54348c=utils[_0x19a6('0x218')](_0x3a78e8,_0x38d9ba);_0x1585b2=_0x3a78e8/_0x38d9ba*(0x1-utils[_0x19a6('0x218')](_0x3a78e8,_0x38d9ba));}return _0x274bee({'erlangCalls':_0xc4692,'erlangCallToSecond':_0x2223e3/_0xc4692,'erlangAbandonmentRate':_0x54348c,'erlangBusyFactor':_0x1585b2});});};module[_0x19a6('0x21d')]=Dialer;
\ No newline at end of file