Built motion from commit a679711e.|2.6.15
[motion2.git] / server / services / ami / dialer / index.js
index cbd65a7..f58299c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a1b=['ListId','UserId','VoiceQueueId','CampaignId','[emptyContact]','isSuccess','Success','isTrunkReachable','active','SIP/%s','unmonitored','uniqueid','amdstatus','exten','xcally-motion-dialer','HANGUP','outboundAnswerCallsDay','state','HangupInAMD','membername','AMD','custom:amd','amd','[syncHangupInAMD][createHistory]','value','MACHINE','buildObj','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','dialMachineMaxRetry','reason\x2019\x20machine....','add','dialMachineRetryFrequency','YYYY-MM-DD\x20HH:mm:ss','dialAMDActive','[syncHangupInAMDIvr]','outboundAnswerAgiCallsDay','countglobal','[syncAgentComplete][createHistory][0]','countbusyretry','countnosuchnumberretry','createStateFinal','minutes','[rescheduleContact][Machine]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','cause-txt','reason','agent','agiafterat','dialQueueProject2','[syncAgentComplete][createHistory]','[syncAgentComplete]','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','Drop','dropreason','TIMEOUT','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','actionid','paused','stateinterface','push','idHopper','queueStatusComplete','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','locked','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','loopCampaigns','syncCampaigns','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','interval','content','indexOf','true','all','some','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','checkPreviewRecallReminder','Agent','handleIvr','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','[syncQueueSummary]','dialPreviewRecallmeReminder','launchHandleIvr','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','object','voiceQueue\x20is\x20undefine','Contact','phone','originate','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialAgiAfterHangupAgent','dialer','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','createdAt','updatedAt','%s%s','toUpper','callerid','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','dialOriginateTimeout','[originateError]:\x20%s','[originate][error]','originate\x20action\x20Error','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','countcongestionretry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','Congestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','predictiveIntervalDroppedCallsCallersExit','dialPredictiveOptimization','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','loggedIn','outboundQueuePauses','[CatchErlangB]','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','actionOriginate','scheduledat','dialRecallMeTimeout','voicePause','unlockContact','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','dialOrderByScheduledAt','RUNNING','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','dialLimitQueue','booked','not_inuse','reachable','getContactDialer','loggerHandler','[getContactDialer2]','[handlePredictive][limitChannel]','tryOriginatePredictive','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\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','[busyFactor]','Umin\x20=\x20','exports','util','lodash','uuid','moment','md5','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','predictive','predictiveCalls','syncQueueSummary','../ami','redis','localhost','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/voiceQueueRt','../rpc/setting','./action','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','finally','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','startProgressive','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined','message','AGENTS_NOT_LOGGED','name','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','isEmpty','Intervals','Error','stringify','milliseconds','diff','seconds','emit','type','outbound','strategy','answered','available','pTalking','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\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','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','stack','inspect','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contactsRescheduled','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','is\x20not\x20active','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','statedesc','endtime','starttime','clearZombieChannels','[uniqueid]','[actions]','isNil','Action','status','channel','catch','No\x20such\x20channel','queue','[Dialer][checkChannel]','updateOriginated','countReScheduled','resolve','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20is\x20null\x20or\x20undefined','notFound','saveInDb','pick','ContactId'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x5a1b,0x151));var _0xb5a1=function(_0x16e941,_0x104a95){_0x16e941=_0x16e941-0x0;var _0x40c171=_0x5a1b[_0x16e941];return _0x40c171;};'use strict';var util=require(_0xb5a1('0x0'));var _=require(_0xb5a1('0x1'));var BPromise=require('bluebird');var uuid=require(_0xb5a1('0x2'));var moment=require(_0xb5a1('0x3'));var rr=require('rr');var md5=require(_0xb5a1('0x4'));var Redis=require(_0xb5a1('0x5'));var ut=require(_0xb5a1('0x6'));var config=require(_0xb5a1('0x7'));var logger=require(_0xb5a1('0x8'))('dialer');var loggerBooked=require(_0xb5a1('0x8'))('booked');var loggerPredictive=require('../../../config/logger')(_0xb5a1('0x9'));var loggerPredictiveCalls=require(_0xb5a1('0x8'))(_0xb5a1('0xa'));var loggerSyncQueueSummary=require(_0xb5a1('0x8'))(_0xb5a1('0xb'));var ami=require(_0xb5a1('0xc'));config[_0xb5a1('0xd')]=_['defaults'](config[_0xb5a1('0xd')],{'host':_0xb5a1('0xe'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb5a1('0xd')]));var cmHopper=require(_0xb5a1('0xf'));var cmHopperHistory=require(_0xb5a1('0x10'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0xb5a1('0x11'));var RpcSetting=require(_0xb5a1('0x12'));var Action=require(_0xb5a1('0x13'));var History=require(_0xb5a1('0x14'));var Final=require(_0xb5a1('0x15'));var AgentComplete=require(_0xb5a1('0x16'));var QueueCallerAbandon=require(_0xb5a1('0x17'));var Hangup=require(_0xb5a1('0x18'));var ipAgi=process['env'][_0xb5a1('0x19')]||_0xb5a1('0x1a');var strategy={'rrmemory':_0xb5a1('0x1b'),'roundrobin':_0xb5a1('0x1c')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0xb5a1('0x1d')][_0xb5a1('0x1e')]=function(_0x5a192e){this[_0xb5a1('0x1f')]=this[_0xb5a1('0x1f')]?this[_0xb5a1('0x1f')][_0xb5a1('0x20')](_0x5a192e):_0x5a192e();};function Dialer(_0x48a6dd,_0x100422){this['sequence']=new Sequence();this[_0xb5a1('0x21')]=_0x100422;this['voiceQueues']=_0x48a6dd[_0xb5a1('0x22')];this[_0xb5a1('0x23')]=_0x48a6dd[_0xb5a1('0x23')];this[_0xb5a1('0x24')]=_0x48a6dd['agents'];this[_0xb5a1('0x25')]=_0x48a6dd[_0xb5a1('0x25')];this[_0xb5a1('0x26')]=config['maxNumberOriginate']||0x2;this[_0xb5a1('0x27')]={};this[_0xb5a1('0x28')]={};this[_0xb5a1('0x29')]={};this[_0xb5a1('0x2a')]={};this['optionPredictive']={};this['startPredictive']={};this[_0xb5a1('0x2b')]={};this['ivrOriginated']={};this[_0xb5a1('0x2c')]={};this[_0xb5a1('0x2d')]={};ami['on'](_0xb5a1('0x2e'),this[_0xb5a1('0x2f')][_0xb5a1('0x30')](this));ami['on']('queuecallerabandon',this[_0xb5a1('0x31')][_0xb5a1('0x30')](this));ami['on'](_0xb5a1('0x32'),this[_0xb5a1('0x33')][_0xb5a1('0x30')](this));ami['on'](_0xb5a1('0x34'),this[_0xb5a1('0x35')]['bind'](this));ami['on'](_0xb5a1('0x36'),this['syncQueueSummary'][_0xb5a1('0x30')](this));ami['on'](_0xb5a1('0x37'),this[_0xb5a1('0x38')][_0xb5a1('0x30')](this));ami['on'](_0xb5a1('0x39'),this[_0xb5a1('0x3a')][_0xb5a1('0x30')](this));ami['on'](_0xb5a1('0x3b'),this[_0xb5a1('0x3c')]['bind'](this));ami['on']('queuemember',this[_0xb5a1('0x3d')]['bind'](this));ami['on'](_0xb5a1('0x3e'),this[_0xb5a1('0x3f')]['bind'](this));this['loopCampaigns']();this[_0xb5a1('0x40')]();RpcSetting[_0xb5a1('0x41')]()[_0xb5a1('0x42')](function(_0x45d31d){previewRecallmeReminderInterval=_0x45d31d[_0xb5a1('0x43')];});}function isNotNull(_0xa3c014){return _0xa3c014!==null&&!_[_0xb5a1('0x44')](_0xa3c014);}function checkIsLoggedIn(_0x17075f,_0x240a02){return function(){if(_0x240a02<=0x0){_0x17075f[_0xb5a1('0x45')]=_0xb5a1('0x46');throw _0x17075f[_0xb5a1('0x47')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x3226f3){return _0x3226f3;}function checkIsActive(_0x3aef4c,_0x2aa695){return function(){if(!isActive(_0x2aa695)){_0x3aef4c['message']=_0xb5a1('0x48');throw _0x3aef4c[_0xb5a1('0x47')]+_0xb5a1('0x49');}};}function checkInterval(_0x2b7a7f){return function(){if(!isNotNull(_0x2b7a7f[_0xb5a1('0x4a')])){_0x2b7a7f[_0xb5a1('0x45')]=_0xb5a1('0x4b');throw _0x2b7a7f[_0xb5a1('0x47')]+_0xb5a1('0x4c');}if(!isNotNull(_0x2b7a7f[_0xb5a1('0x4a')]['Intervals'])){_0x2b7a7f[_0xb5a1('0x45')]=_0xb5a1('0x4b');throw _0x2b7a7f[_0xb5a1('0x47')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0xb5a1('0x4d')](_0x2b7a7f[_0xb5a1('0x4a')][_0xb5a1('0x4e')]))){_0x2b7a7f['message']='INTERVAL_IS_NULL';throw _0x2b7a7f[_0xb5a1('0x47')]+_0xb5a1('0x4c');}};}function msgResponse(_0x1c5e61,_0x5b3bfc,_0x3a248a){return{'action':_0x1c5e61,'response':_0x5b3bfc,'message':_0x3a248a,'stack':_0x3a248a};}function myreject(_0x5ce96c){return function(_0x200dde){return _0x5ce96c(msgResponse('[ifTime][Action]',_0xb5a1('0x4f'),JSON[_0xb5a1('0x50')](_0x200dde)));};}function getSeconds(_0x57e918,_0x5955d8){var _0x1444b1=moment(_0x57e918)['milliseconds'](0x0);var _0xabd57f=moment(_0x5955d8)[_0xb5a1('0x51')](0x0);return _0x1444b1[_0xb5a1('0x52')](_0xabd57f,_0xb5a1('0x53'));}function emit(_0x236425,_0x1c1c54,_0x22b13e){io['to'](_0x236425)[_0xb5a1('0x54')](_0x1c1c54,_0x22b13e);}function emitVoiceQueueSummary(_0x428b40){if(_0x428b40[_0xb5a1('0x55')]===_0xb5a1('0x56')){var _0x2095d8={'id':_0x428b40['id'],'name':_0x428b40[_0xb5a1('0x47')],'strategy':_0x428b40[_0xb5a1('0x57')],'answered':_0x428b40[_0xb5a1('0x58')],'available':_0x428b40[_0xb5a1('0x59')],'loggedIn':_0x428b40['loggedIn'],'pTalking':_0x428b40[_0xb5a1('0x5a')],'sumBillable':_0x428b40['sumBillable'],'sumDuration':_0x428b40['sumDuration'],'sumHoldTime':_0x428b40[_0xb5a1('0x5b')]||0x0,'talking':_0x428b40[_0xb5a1('0x5c')],'total':_0x428b40[_0xb5a1('0x5d')],'type':_0x428b40[_0xb5a1('0x55')],'unmanaged':_0x428b40[_0xb5a1('0x5e')],'abandoned':_0x428b40[_0xb5a1('0x5f')],'waiting':_0x428b40[_0xb5a1('0x60')],'loggedInDb':_0x428b40[_0xb5a1('0x61')],'dialActive':_0x428b40[_0xb5a1('0x62')],'dialMethod':_0x428b40[_0xb5a1('0x63')],'dialOriginateCallerIdName':_0x428b40[_0xb5a1('0x64')],'dialOriginateCallerIdNumber':_0x428b40[_0xb5a1('0x65')],'dialOriginateTimeout':_0x428b40['dialOriginateTimeout'],'dialPrefix':_0x428b40[_0xb5a1('0x66')],'outboundAnswerAgiCallsDay':_0x428b40['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x428b40['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x428b40['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x428b40[_0xb5a1('0x67')],'outboundCongestionCallsDay':_0x428b40[_0xb5a1('0x68')],'outboundDropCallsDayACS':_0x428b40[_0xb5a1('0x69')],'outboundDropCallsDayCallersExit':_0x428b40['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x428b40[_0xb5a1('0x6a')],'outboundNoAnswerCallsDay':_0x428b40['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x428b40[_0xb5a1('0x6b')],'outboundOriginateFailureCallsDay':_0x428b40[_0xb5a1('0x6c')],'outboundReCallsDay':_0x428b40[_0xb5a1('0x6d')],'outboundRejectCallsDay':_0x428b40[_0xb5a1('0x6e')],'outboundUnknownCallsDay':_0x428b40[_0xb5a1('0x6f')],'predictiveIntervalAnsweredCalls':_0x428b40[_0xb5a1('0x70')],'predictiveIntervalAvgHoldtime':_0x428b40['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x428b40[_0xb5a1('0x71')],'predictiveIntervalDroppedCallsCallersExit':_0x428b40['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x428b40[_0xb5a1('0x72')],'predictiveIntervalErlangCalls':_0x428b40['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x428b40[_0xb5a1('0x73')],'predictiveIntervalHitRate':_0x428b40[_0xb5a1('0x74')],'predictiveIntervalMultiplicativeFactor':_0x428b40[_0xb5a1('0x75')],'predictiveIntervalPauses':_0x428b40[_0xb5a1('0x76')],'predictiveIntervalAvailable':_0x428b40['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x428b40[_0xb5a1('0x77')],'message':_0x428b40[_0xb5a1('0x45')],'originated':_0x428b40[_0xb5a1('0x78')],'erlangCalls':_0x428b40['erlangCalls'],'erlangCallToSecond':_0x428b40['erlangCallToSecond'],'erlangAbandonmentRate':_0x428b40[_0xb5a1('0x79')],'erlangBusyFactor':_0x428b40[_0xb5a1('0x7a')],'startPredictive':_0x428b40[_0xb5a1('0x7b')],'startProgressive':_0x428b40[_0xb5a1('0x2b')]};if(_0x428b40[_0xb5a1('0x7c')]){_0x2095d8[_0xb5a1('0x7c')]={'id':_0x428b40[_0xb5a1('0x7c')]['id'],'name':_0x428b40[_0xb5a1('0x7c')][_0xb5a1('0x47')],'active':_0x428b40['Trunk']['active'],'callerid':_0x428b40[_0xb5a1('0x7c')]['callerid']};}if(_0x428b40[_0xb5a1('0x4a')]){_0x2095d8[_0xb5a1('0x4a')]={'id':_0x428b40[_0xb5a1('0x4a')]['id'],'name':_0x428b40['Interval'][_0xb5a1('0x47')]};}var _0x38155d=md5(JSON[_0xb5a1('0x50')](_0x2095d8));if(_0x428b40[_0xb5a1('0x4')]!==_0x38155d){_0x428b40[_0xb5a1('0x4')]=_0x38155d;emit(util[_0xb5a1('0x7d')](_0xb5a1('0x7e'),_0x2095d8[_0xb5a1('0x47')]),_0xb5a1('0x7f'),_0x2095d8);}}}function emitCampaignSummary(_0x10d873){if(_0x10d873[_0xb5a1('0x55')]===_0xb5a1('0x80')){emit(util[_0xb5a1('0x7d')](_0xb5a1('0x81'),_0x10d873['name']),_0xb5a1('0x82'),_0x10d873);}}function checkGetDataPredictive(_0x1cb129){if(isNotNull(_0x1cb129)&&!_[_0xb5a1('0x4d')](_0x1cb129)){loggerPredictive[_0xb5a1('0x83')](_0xb5a1('0x84'));loggerPredictive[_0xb5a1('0x83')](_0xb5a1('0x85'),_0x1cb129[_0xb5a1('0x77')]);loggerPredictive['info']('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1cb129['predictiveIntervalAnsweredCalls']);loggerPredictive['info'](_0xb5a1('0x86'),_0x1cb129['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0xb5a1('0x83')](_0xb5a1('0x87'),_0x1cb129['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0xb5a1('0x83')](_0xb5a1('0x88'),_0x1cb129[_0xb5a1('0x89')]);loggerPredictive[_0xb5a1('0x83')](_0xb5a1('0x8a'),_0x1cb129['predictiveIntervalAvgTalktime']);loggerPredictive[_0xb5a1('0x83')](_0xb5a1('0x8b'));if(_0x1cb129[_0xb5a1('0x77')]>0x0){if(!_['isUndefined'](_0x1cb129[_0xb5a1('0x71')])&&_0x1cb129[_0xb5a1('0x71')]>0x0){return!![];}loggerPredictive[_0xb5a1('0x83')](_0xb5a1('0x8c'));if(!_[_0xb5a1('0x44')](_0x1cb129['predictiveIntervalAvgHoldtime'])&&_0x1cb129[_0xb5a1('0x89')]>0x0){return!![];}loggerPredictive[_0xb5a1('0x83')](_0xb5a1('0x8d'));}else{loggerPredictive[_0xb5a1('0x83')](_0xb5a1('0x8e'));}}else{loggerPredictive[_0xb5a1('0x83')](_0xb5a1('0x8f'));}return![];}function mergeDataErlangB(_0x58e815){return function(_0x41891d){loggerPredictive[_0xb5a1('0x83')]('---------\x20ErlangB\x20---------');loggerPredictive[_0xb5a1('0x83')](_0xb5a1('0x90'),_0x41891d[_0xb5a1('0x91')]);loggerPredictive[_0xb5a1('0x83')](_0xb5a1('0x92'),_0x41891d[_0xb5a1('0x93')]);loggerPredictive[_0xb5a1('0x83')](_0xb5a1('0x94'),_0x41891d[_0xb5a1('0x79')]);loggerPredictive['info']('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x41891d[_0xb5a1('0x7a')]);loggerPredictive[_0xb5a1('0x83')](_0xb5a1('0x94'),_0x41891d[_0xb5a1('0x79')]);loggerPredictive[_0xb5a1('0x83')]('---------------------------');_[_0xb5a1('0x95')](_0x58e815,_0x41891d);};}function getDiff(_0x36c341){var _0x2239e6=moment()[_0xb5a1('0x51')](0x0);var _0x33bbb4=moment(_0x36c341)['milliseconds'](0x0);return _0x2239e6['diff'](_0x33bbb4,_0xb5a1('0x53'));}function ifInterval(_0x3c0909,_0x884969){if(_['isUndefined'](_0x884969)){return![];}return getDiff(_0x884969)<_0x3c0909*0x3c;}function freeVariablesPredictive(_0xcccd5c){if(isNotNull(_0xcccd5c)){if(!_[_0xb5a1('0x44')](_0xcccd5c[_0xb5a1('0x2b')])){_0xcccd5c['startProgressive']=undefined;loggerPredictive[_0xb5a1('0x83')](_0xcccd5c[_0xb5a1('0x47')],_0xb5a1('0x96'));}if(!_[_0xb5a1('0x44')](_0xcccd5c[_0xb5a1('0x7b')])){_0xcccd5c[_0xb5a1('0x7b')]=undefined;loggerPredictive[_0xb5a1('0x83')](_0xcccd5c[_0xb5a1('0x47')],_0xb5a1('0x97'));}if(!_[_0xb5a1('0x44')](_0xcccd5c[_0xb5a1('0x98')])){clearInterval(_0xcccd5c[_0xb5a1('0x98')]);_0xcccd5c['handlePredictive']=undefined;loggerPredictive['info'](_0xcccd5c[_0xb5a1('0x47')],_0xb5a1('0x99'));}}}function erlangb(_0x18dd55,_0x1e70f4){if(_0x1e70f4===0x0){return 0x0;}var _0x114435=0x1;for(var _0x98aa10=0x1;_0x98aa10<=_0x1e70f4;_0x98aa10+=0x1){_0x114435=0x1+_0x114435*_0x98aa10/_0x18dd55;}return 0x1/_0x114435;}function isVoiceQueueOutbound(_0x4fa220){return _0x4fa220==='outbound';}function isNotPreview(_0x590f8c){return _0x590f8c!==_0xb5a1('0x21');}function isCampaignIvr(_0x355f27){return _0x355f27===_0xb5a1('0x80');}function getCallerId(_0x46d561,_0x3af118,_0x118485){if(!_[_0xb5a1('0x44')](_0x118485)&&typeof _0x118485===_0xb5a1('0x9a')&&!_[_0xb5a1('0x4d')](_0x118485)){if(!_[_0xb5a1('0x44')](_0x3af118)&&typeof _0x3af118==='string'&&!_[_0xb5a1('0x4d')](_0x3af118)){return util['format'](_0xb5a1('0x9b'),_0x3af118,_0x118485);}return util[_0xb5a1('0x7d')](_0xb5a1('0x9b'),_0x118485,_0x118485);}if(!_['isUndefined'](_0x46d561)&&typeof _0x46d561===_0xb5a1('0x9a')&&!_[_0xb5a1('0x4d')](_0x46d561)){return _0x46d561;}return _0xb5a1('0x9c');}function loggerCatchQueueSummary(_0x399700,_0x2b5c56){return function(_0x142993){freeVariablesPredictive(_0x2b5c56);emitVoiceQueueSummary(_0x2b5c56);emitCampaignSummary(_0x2b5c56);loggerSyncQueueSummary[_0xb5a1('0x9d')](_0x399700,util['inspect'](_0x142993,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x4a8f2b,_0x56bc6d){return function(_0x337763){loggerPredictive['error'](_0x56bc6d[_0xb5a1('0x47')],_0x4a8f2b);loggerPredictive[_0xb5a1('0x9d')](_0x337763[_0xb5a1('0x9e')]);freeVariablesPredictive(_0x56bc6d);};}function loggerCatch(_0x1948bc){return function(_0x1704a5){logger[_0xb5a1('0x9d')](_0x1948bc,util[_0xb5a1('0x9f')](_0x1704a5,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x1dff6b){return _0x1dff6b&&!_[_0xb5a1('0x44')](_0x1dff6b)&&_0x1dff6b[_0xb5a1('0xa0')]>0x0;}function decremetOriginate(_0x58f802){if(!_['isUndefined'](_0x58f802)&&_0x58f802!==null){if(typeof _0x58f802[_0xb5a1('0x78')]!==_0xb5a1('0xa1')){if(_0x58f802[_0xb5a1('0x78')]>0x0){_0x58f802['originated']-=0x1;}else{logger[_0xb5a1('0x9d')](_0xb5a1('0xa2'));}}}else{logger[_0xb5a1('0x9d')](_0xb5a1('0xa3'));}}function checkContactLowerLimitOriginate(_0x705e33,_0x16e056,_0x37fc8a){if(_0x16e056>_0x37fc8a){for(var _0x108ad6=0x0;_0x108ad6<_0x16e056-_0x37fc8a;_0x108ad6+=0x1){decremetOriginate(_0x705e33);}}}function loggerGetContactDialer(_0x579693,_0x54ecd8,_0x440320){return function(_0x310520){checkContactLowerLimitOriginate(_0x54ecd8,_0x440320,0x0);logger[_0xb5a1('0x9d')](_0x579693,util['inspect'](_0x310520,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x96e3f8){return function(_0x3de6c5){if(isNotNull(_0x3de6c5)&&isNotNull(_0x3de6c5[0x0])){if(_0x3de6c5[0x0]['contactsRescheduled']>0x0){_0x96e3f8['message']=_0xb5a1('0xa4');logger[_0xb5a1('0x83')](_0xb5a1('0xa5')+_0x96e3f8['name'],_0x3de6c5[0x0][_0xb5a1('0xa6')],_0xb5a1('0xa7'));}else{_0x96e3f8[_0xb5a1('0x45')]=_0xb5a1('0xa8');logger['info'](_0xb5a1('0xa9')+_0x96e3f8[_0xb5a1('0x47')]);}}};}function notSendMessagesQueue(_0x460d47){if(_0x460d47['sendMessageOneNotActive']){freeVariablesPredictive(_0x460d47);if(_0x460d47['originated']===0x0&&_0x460d47[_0xb5a1('0x5c')]===0x0&&_0x460d47[_0xb5a1('0x60')]===0x0&&(_0x460d47[_0xb5a1('0x5a')]||0x0)===0x0){_0x460d47[_0xb5a1('0xaa')]=![];_0x460d47[_0xb5a1('0x59')]=0x0;_0x460d47[_0xb5a1('0x45')]=_0xb5a1('0x48');loggerSyncQueueSummary[_0xb5a1('0x9d')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x460d47[_0xb5a1('0x47')],_0xb5a1('0xab'));}else{_0x460d47[_0xb5a1('0x45')]='IS_DISACTIVED';loggerSyncQueueSummary[_0xb5a1('0x9d')](_0xb5a1('0xac'),_0x460d47[_0xb5a1('0x47')],_0xb5a1('0xad'));}emitVoiceQueueSummary(_0x460d47);}}function notSendMessagesCampaign(_0x5d562a){if(_0x5d562a[_0xb5a1('0xaa')]){if(_0x5d562a[_0xb5a1('0x78')]===0x0){_0x5d562a['sendMessageOneNotActive']=![];_0x5d562a[_0xb5a1('0x45')]='NOT_ACTIVE';loggerSyncQueueSummary['error'](_0xb5a1('0xae'),_0x5d562a['name'],_0xb5a1('0xab'));}else{_0x5d562a[_0xb5a1('0x45')]='IS_DISACTIVED';loggerSyncQueueSummary[_0xb5a1('0x9d')](_0xb5a1('0xae'),_0x5d562a[_0xb5a1('0x47')],_0xb5a1('0xad'));}emitCampaignSummary(_0x5d562a);}}function createObjHistory(_0x2f964e,_0x18429a,_0x522cc0,_0x4aa6b0,_0x82ed37){_0x2f964e[_0xb5a1('0x45')]=_0x522cc0;var _0x4a9c48=new Action(_0x2f964e,_0x18429a);var _0x52f7cf=new History(_0x4a9c48);_0x52f7cf['state']=_0x4aa6b0;_0x52f7cf[_0xb5a1('0xaf')]=_0x82ed37;_0x52f7cf[_0xb5a1('0xb0')]=_0x4a9c48[_0xb5a1('0xb1')];return _0x52f7cf;}Dialer[_0xb5a1('0x1d')][_0xb5a1('0x40')]=function(){var _0x346c55=this;setInterval(function(){_0x346c55[_0xb5a1('0xb2')](_0x346c55[_0xb5a1('0x2a')],_0xb5a1('0xb3'));_0x346c55['clearZombieChannels'](_0x346c55[_0xb5a1('0x28')],_0xb5a1('0xb4'));},0x32c8);};Dialer[_0xb5a1('0x1d')][_0xb5a1('0xb2')]=function(_0x3802d0,_0x12bc29){var _0x1176c6=this;for(var _0x16f89f in _0x3802d0){if(typeof _0x3802d0[_0x16f89f]!==_0xb5a1('0xa1')){this['sequence'][_0xb5a1('0x1e')](function(){if(!_[_0xb5a1('0xb5')](_0x3802d0[_0x16f89f])){return ami[_0xb5a1('0xb6')]({'action':_0xb5a1('0xb7'),'channel':_0x3802d0[_0x16f89f][_0xb5a1('0xb8')]})[_0xb5a1('0xb9')](function(_0x39ac15){if(_0x39ac15[_0xb5a1('0x45')]===_0xb5a1('0xba')){setTimeout(function(){if(_0x3802d0[_0x16f89f]&&_0x3802d0[_0x16f89f][_0xb5a1('0x55')]!==_0xb5a1('0x80')){_0x1176c6['updateOriginated'](_0x1176c6[_0xb5a1('0x22')][_0x3802d0[_0x16f89f][_0xb5a1('0xbb')]]);logger[_0xb5a1('0x9d')](_0xb5a1('0xbc'),_0x12bc29,_0x16f89f,_0x3802d0[_0x16f89f][_0xb5a1('0xbb')]);delete _0x3802d0[_0x16f89f];}if(_0x3802d0[_0x16f89f]&&_0x3802d0[_0x16f89f][_0xb5a1('0x55')]===_0xb5a1('0x80')){_0x1176c6[_0xb5a1('0xbd')](_0x1176c6[_0xb5a1('0x23')][_0x3802d0[_0x16f89f][_0xb5a1('0xbb')]]);logger['error']('[Dialer][checkChannel][ivr]',_0x12bc29,_0x16f89f,_0x3802d0[_0x16f89f]['queue']);delete _0x3802d0[_0x16f89f];}},0x2328);}});}});}}};Dialer[_0xb5a1('0x1d')][_0xb5a1('0xbe')]=function(_0x75d4d8){return BPromise[_0xb5a1('0xbf')]()[_0xb5a1('0x42')](cmHopper[_0xb5a1('0xbe')](_0x75d4d8))[_0xb5a1('0xb9')](loggerCatch(_0xb5a1('0xc0')));};Dialer[_0xb5a1('0x1d')][_0xb5a1('0xc1')]=function(_0xc4a598){return BPromise[_0xb5a1('0xbf')]()[_0xb5a1('0x42')](cmHopperBlack[_0xb5a1('0xc1')](_0xc4a598))[_0xb5a1('0xb9')](loggerCatch(_0xb5a1('0xc2')));};Dialer[_0xb5a1('0x1d')][_0xb5a1('0xc3')]=function(_0x4d6b7e){return BPromise[_0xb5a1('0xbf')]()[_0xb5a1('0x42')](cmHopperBlack[_0xb5a1('0xc3')](_0x4d6b7e))['catch'](loggerCatch(_0xb5a1('0xc4')));};Dialer[_0xb5a1('0x1d')][_0xb5a1('0xc5')]=function(_0x174ab8){return BPromise['resolve']()[_0xb5a1('0x42')](cmHopperHistory[_0xb5a1('0xc6')](_0x174ab8))[_0xb5a1('0xb9')](loggerCatch(_0xb5a1('0xc7')));};Dialer[_0xb5a1('0x1d')][_0xb5a1('0xc8')]=function(_0x3d95a6){return BPromise[_0xb5a1('0xbf')]()[_0xb5a1('0x42')](cmHopper[_0xb5a1('0xc8')](_0x3d95a6))[_0xb5a1('0xb9')](loggerCatch(_0xb5a1('0xc9')));};Dialer[_0xb5a1('0x1d')]['unlockContact']=function(_0x7fc0a,_0x5ebb2b,_0x4d5a19){return BPromise['resolve']()[_0xb5a1('0x42')](cmHopper['unlockContact'](_0x7fc0a,_0x5ebb2b,_0x4d5a19))[_0xb5a1('0xb9')](loggerCatch('[unlockContact]\x20'));};Dialer[_0xb5a1('0x1d')]['getContactDialer']=function(_0x8186d7,_0x34d86e,_0x5719eb,_0x4b43e8,_0x3339bf){return BPromise[_0xb5a1('0xbf')]()[_0xb5a1('0x42')](cmHopper['getContactDialer'](_0x8186d7,_0x34d86e,_0x5719eb,_0x4b43e8))[_0xb5a1('0xb9')](function(_0x5bfbed){_0x3339bf[_0xb5a1('0xca')]-=_0x5719eb;_0x3339bf[_0xb5a1('0xca')]=_0x3339bf[_0xb5a1('0xca')]>0x0?_0x3339bf[_0xb5a1('0xca')]:0x0;loggerCatch(_0xb5a1('0xcb'))(_0x5bfbed);});};Dialer[_0xb5a1('0x1d')][_0xb5a1('0xcc')]=function(_0x3f60d4,_0x3b273d,_0x3d4131,_0x498461){return BPromise[_0xb5a1('0xbf')]()['then'](cmHopper[_0xb5a1('0xcc')](_0x3f60d4,_0x3b273d,_0x3d4131))['catch'](function(_0x5886e8){_0x498461[_0xb5a1('0xca')]-=_0x3b273d;_0x498461[_0xb5a1('0xca')]=_0x498461[_0xb5a1('0xca')]>0x0?_0x498461['temp']:0x0;loggerCatch(_0xb5a1('0xcd'))(_0x5886e8);});};Dialer[_0xb5a1('0x1d')][_0xb5a1('0xce')]=function(_0xed1efe){return BPromise[_0xb5a1('0xbf')]()[_0xb5a1('0x42')](voiceQueueRt['getVoiceQueueRtPauses'](_0xed1efe))['catch'](loggerCatch(_0xb5a1('0xcf')));};Dialer[_0xb5a1('0x1d')]['moveContactManagedDialer']=function(_0x4a0963){return BPromise[_0xb5a1('0xbf')]()[_0xb5a1('0x42')](cmHopper[_0xb5a1('0xd0')](_0x4a0963))[_0xb5a1('0xb9')](loggerCatch(_0xb5a1('0xd1')));};Dialer['prototype']['createHistory']=function(_0x171326){return BPromise[_0xb5a1('0xbf')]()[_0xb5a1('0x42')](cmHopperHistory[_0xb5a1('0xd2')](_0x171326))['catch'](loggerCatch(_0xb5a1('0xd3')));};Dialer[_0xb5a1('0x1d')][_0xb5a1('0xbd')]=function(_0x374e84){if(!_[_0xb5a1('0x44')](_0x374e84)&&_0x374e84!==null){if(typeof _0x374e84[_0xb5a1('0x78')]!==_0xb5a1('0xa1')){if(_0x374e84[_0xb5a1('0x78')]>0x0){_0x374e84['originated']-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0xb5a1('0x9d')](_0xb5a1('0xd4'));}};Dialer[_0xb5a1('0x1d')]['loggerHandler']=function(_0x16ba97,_0x27b3ae){var _0x31199d=this;return function(_0x4dcd75){_0x31199d[_0xb5a1('0xbd')](_0x27b3ae);logger[_0xb5a1('0x9d')](_0x16ba97,util[_0xb5a1('0x9f')](_0x4dcd75,{'showHidden':![],'depth':null}));};};Dialer[_0xb5a1('0x1d')]['emptyContact']=function(_0x188d7b,_0x1ce846,_0x47f332){var _0x2a49ce={'state':0x19,'statedesc':_0xb5a1('0xd5')};this[_0xb5a1('0xbd')](_0x1ce846);this[_0xb5a1('0xd6')](_['merge'](_0x2a49ce,_[_0xb5a1('0xd7')](_0x47f332,[_0xb5a1('0xd8'),_0xb5a1('0xd9'),_0xb5a1('0xda'),_0xb5a1('0xdb'),_0xb5a1('0xdc')])),'[emptyContact][createHistory]',_0xb5a1('0xdd'));logger[_0xb5a1('0x9d')](_0x188d7b);};Dialer[_0xb5a1('0x1d')][_0xb5a1('0xde')]=function(_0x161bd3){return _0x161bd3===_0xb5a1('0xdf');};Dialer['prototype'][_0xb5a1('0xe0')]=function(_0x430ee7){return!_[_0xb5a1('0x44')](_0x430ee7)&&_0x430ee7&&!_[_0xb5a1('0x44')](_0x430ee7['name'])&&!_[_0xb5a1('0x44')](_0x430ee7['active'])&&_0x430ee7[_0xb5a1('0xe1')]&&(this[_0xb5a1('0x25')][util[_0xb5a1('0x7d')](_0xb5a1('0xe2'),_0x430ee7[_0xb5a1('0x47')])]['status']==='reachable'||this['trunks'][util[_0xb5a1('0x7d')](_0xb5a1('0xe2'),_0x430ee7['name'])][_0xb5a1('0xb7')]===_0xb5a1('0xe3'));};Dialer[_0xb5a1('0x1d')][_0xb5a1('0xd6')]=function(_0x3edc35,_0x2cb740,_0x583c16){this['createHistory'](_0x3edc35)[_0xb5a1('0xb9')](loggerCatch(_0x2cb740));this[_0xb5a1('0xd0')](_0x3edc35)['catch'](loggerCatch(_0x583c16));};Dialer['prototype'][_0xb5a1('0x3c')]=function(_0x560820){var _0xb24805=this['uniqueId'][_0x560820[_0xb5a1('0xe4')]];var _0x45ee66;if(!_[_0xb5a1('0xb5')](_0x560820)&&!_[_0xb5a1('0xb5')](_0x560820['variable'])&&!_[_0xb5a1('0xb5')](_0x560820['variable'][_0xb5a1('0xe5')])&&_0x560820[_0xb5a1('0xe6')]===_0xb5a1('0xe7')&&_0xb24805){if(_0xb24805[_0xb5a1('0x55')]!==_0xb5a1('0x80')&&this[_0xb5a1('0x22')][_0xb24805[_0xb5a1('0xbb')]]['dialAMDActive']&&_0x560820['value']===_0xb5a1('0xe8')){delete this[_0xb5a1('0x2a')][_0x560820[_0xb5a1('0xe4')]];this['updateOriginated'](this[_0xb5a1('0x22')][_0xb24805[_0xb5a1('0xbb')]]);this[_0xb5a1('0x22')][_0xb24805['queue']][_0xb5a1('0xe9')]+=0x1;this['voiceQueues'][_0xb24805[_0xb5a1('0xbb')]]['outboundAnswerAgiCallsDay']+=0x1;_0x45ee66=new Hangup(_0xb24805,_0x560820);_0x45ee66[_0xb5a1('0xea')]=0x12;_0x45ee66[_0xb5a1('0xaf')]=_0xb5a1('0xeb');_0x45ee66[_0xb5a1('0xec')]=_0xb5a1('0xed');ami[_0xb5a1('0x54')](_0xb5a1('0xee'),ut['buildObj'](_0x45ee66,_0xb5a1('0xef')));this[_0xb5a1('0xd6')](_0x45ee66,_0xb5a1('0xf0'),'[syncHangupInAMD]');}if(_0xb24805['type']!=='ivr'&&this[_0xb5a1('0x22')][_0xb24805[_0xb5a1('0xbb')]]['dialAMDActive']&&_0x560820[_0xb5a1('0xf1')]===_0xb5a1('0xf2')){var _0x3e0935=this;return new BPromise(function(_0x3197c1,_0x4c4f93){delete _0x3e0935[_0xb5a1('0x2a')][_0x560820[_0xb5a1('0xe4')]];_0x3e0935[_0xb5a1('0xbd')](_0x3e0935[_0xb5a1('0x22')][_0xb24805[_0xb5a1('0xbb')]]);_0x3e0935[_0xb5a1('0x22')][_0xb24805[_0xb5a1('0xbb')]][_0xb5a1('0xe9')]+=0x1;_0x3e0935['voiceQueues'][_0xb24805['queue']]['outboundAnswerAgiCallsDay']+=0x1;var _0x387911=_0x3e0935['voiceQueues'][_0xb24805['queue']];var _0xaa950c=new Hangup(_0xb24805,_0x560820);_0xaa950c[_0xb5a1('0xea')]=0x13;_0xaa950c[_0xb5a1('0xaf')]='Machine';_0xaa950c['membername']=_0xb5a1('0xed');_0xaa950c['countmachineretry']+=0x1;_0xaa950c['countglobal']+=0x1;_0xaa950c[_0xb5a1('0xef')]=!![];ami[_0xb5a1('0x54')]('custom:amd',ut[_0xb5a1('0xf3')](_0xaa950c,_0xb5a1('0xef')));_0x3e0935[_0xb5a1('0xd2')](_0xaa950c)[_0xb5a1('0xb9')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0xaa950c['countbusyretry']+_0xaa950c['countcongestionretry']+_0xaa950c[_0xb5a1('0xf4')]+_0xaa950c['countnosuchnumberretry']+_0xaa950c[_0xb5a1('0xf5')]+_0xaa950c[_0xb5a1('0xf6')]+_0xaa950c[_0xb5a1('0xf7')]+_0xaa950c[_0xb5a1('0xf8')]>=_0x387911[_0xb5a1('0xf9')]){_0x3e0935[_0xb5a1('0xfa')](_0xaa950c,_0x3197c1,_0x4c4f93,'reason19\x20machine....');}else{if(_0xaa950c[_0xb5a1('0xf7')]>=_0x387911[_0xb5a1('0xfb')]){_0x3e0935['createStateFinal'](_0xaa950c,_0x3197c1,_0x4c4f93,_0xb5a1('0xfc'));}else{_0x3e0935['rescheduleContact']({'active':![],'countmachineretry':_0xaa950c['countmachineretry'],'scheduledat':moment()[_0xb5a1('0xfd')](_0x387911[_0xb5a1('0xfe')],'minutes')['format'](_0xb5a1('0xff')),'ContactId':_0xaa950c['ContactId'],'ListId':_0xaa950c[_0xb5a1('0xd9')],'VoiceQueueId':_0xaa950c[_0xb5a1('0xdb')]||undefined,'CampaignId':_0xaa950c[_0xb5a1('0xdc')]||undefined})[_0xb5a1('0xb9')](loggerCatch('[rescheduleContact][Machine]'));_0x3197c1({'reschedule':0x1});}}});}if(_0xb24805[_0xb5a1('0x55')]==='ivr'&&this['campaigns'][_0xb24805[_0xb5a1('0xbb')]][_0xb5a1('0x100')]&&_0x560820['value']==='HANGUP'){delete this['uniqueId'][_0x560820['uniqueid']];this[_0xb5a1('0xbd')](this['campaigns'][_0xb24805[_0xb5a1('0xbb')]]);_0x45ee66=new Hangup(_0xb24805,_0x560820);_0x45ee66['state']=0x12;_0x45ee66[_0xb5a1('0xaf')]='HangupInAMD';_0x45ee66[_0xb5a1('0xec')]=_0xb5a1('0xed');ami['emit'](_0xb5a1('0xee'),ut['buildObj'](_0x45ee66,_0xb5a1('0xef')));this[_0xb5a1('0xd6')](_0x45ee66,'[syncHangupInAMDIvr][createHistory]',_0xb5a1('0x101'));}if(_0xb24805[_0xb5a1('0x55')]===_0xb5a1('0x80')&&this[_0xb5a1('0x23')][_0xb24805['queue']]['dialAMDActive']&&_0x560820[_0xb5a1('0xf1')]===_0xb5a1('0xf2')){var _0x3e0935=this;return new BPromise(function(_0x73d7ea,_0x42a17a){delete _0x3e0935[_0xb5a1('0x2a')][_0x560820[_0xb5a1('0xe4')]];_0x3e0935['updateOriginated'](_0x3e0935[_0xb5a1('0x23')][_0xb24805[_0xb5a1('0xbb')]]);_0x3e0935[_0xb5a1('0x23')][_0xb24805[_0xb5a1('0xbb')]]['outboundAnswerCallsDay']+=0x1;_0x3e0935['campaigns'][_0xb24805['queue']][_0xb5a1('0x102')]+=0x1;var _0x868451=_0x3e0935[_0xb5a1('0x23')][_0xb24805[_0xb5a1('0xbb')]];var _0x2ec0fd=new Hangup(_0xb24805,_0x560820);_0x2ec0fd['state']=0x13;_0x2ec0fd[_0xb5a1('0xaf')]='Machine';_0x2ec0fd['membername']='AMD';_0x2ec0fd[_0xb5a1('0xf7')]+=0x1;_0x2ec0fd[_0xb5a1('0x103')]+=0x1;_0x2ec0fd['amd']=!![];ami[_0xb5a1('0x54')]('custom:amd',ut[_0xb5a1('0xf3')](_0x2ec0fd,_0xb5a1('0xef')));_0x3e0935['createHistory'](_0x2ec0fd)[_0xb5a1('0xb9')](loggerCatch(_0xb5a1('0x104')));if(_0x2ec0fd[_0xb5a1('0x105')]+_0x2ec0fd['countcongestionretry']+_0x2ec0fd[_0xb5a1('0xf4')]+_0x2ec0fd[_0xb5a1('0x106')]+_0x2ec0fd[_0xb5a1('0xf5')]+_0x2ec0fd[_0xb5a1('0xf6')]+_0x2ec0fd[_0xb5a1('0xf7')]+_0x2ec0fd[_0xb5a1('0xf8')]>=_0x868451[_0xb5a1('0xf9')]){_0x3e0935[_0xb5a1('0xfa')](_0x2ec0fd,_0x73d7ea,_0x42a17a,'reason19\x20machine....');}else{if(_0x2ec0fd[_0xb5a1('0xf7')]>=_0x868451['dialMachineMaxRetry']){_0x3e0935[_0xb5a1('0x107')](_0x2ec0fd,_0x73d7ea,_0x42a17a,_0xb5a1('0xfc'));}else{_0x3e0935[_0xb5a1('0xc8')]({'active':![],'countmachineretry':_0x2ec0fd[_0xb5a1('0xf7')],'scheduledat':moment()[_0xb5a1('0xfd')](_0x868451[_0xb5a1('0xfe')],_0xb5a1('0x108'))[_0xb5a1('0x7d')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2ec0fd['ContactId'],'ListId':_0x2ec0fd[_0xb5a1('0xd9')],'VoiceQueueId':_0x2ec0fd['VoiceQueueId']||undefined,'CampaignId':_0x2ec0fd[_0xb5a1('0xdc')]||undefined})[_0xb5a1('0xb9')](loggerCatch(_0xb5a1('0x109')));_0x73d7ea({'reschedule':0x1});}}});}}};Dialer[_0xb5a1('0x1d')][_0xb5a1('0x38')]=function(_0x108bcd){var _0x13e8a0=this['uniqueId'][_0x108bcd[_0xb5a1('0xe4')]];var _0xf380db=this;var _0x3b7413;if(_0x13e8a0&&_0x13e8a0[_0xb5a1('0x55')]===_0xb5a1('0x80')){delete this['uniqueId'][_0x108bcd[_0xb5a1('0xe4')]];this[_0xb5a1('0xbd')](this[_0xb5a1('0x23')][_0x13e8a0[_0xb5a1('0xbb')]]);this[_0xb5a1('0x23')][_0x13e8a0[_0xb5a1('0xbb')]][_0xb5a1('0x10a')]+=0x1;_0x3b7413=new Hangup(_0x13e8a0,_0x108bcd);this[_0xb5a1('0xd2')](_0x3b7413)[_0xb5a1('0xb9')](loggerCatch(_0xb5a1('0x10b')));this[_0xb5a1('0xd0')](_0x3b7413)[_0xb5a1('0xb9')](loggerCatch(_0xb5a1('0x10c')));}if(_0x13e8a0&&_0x13e8a0[_0xb5a1('0x55')]!=='ivr'&&isNotNull(this[_0xb5a1('0x22')][_0x13e8a0[_0xb5a1('0xbb')]][_0xb5a1('0x10d')])){delete this[_0xb5a1('0x2a')][_0x108bcd['uniqueid']];this['updateOriginated'](this[_0xb5a1('0x22')][_0x13e8a0[_0xb5a1('0xbb')]]);this['voiceQueues'][_0x13e8a0[_0xb5a1('0xbb')]][_0xb5a1('0xe9')]+=0x1;this[_0xb5a1('0x22')][_0x13e8a0['queue']]['outboundAnswerAgiCallsDay']+=0x1;_0x3b7413=new Hangup(_0x13e8a0,_0x108bcd);_0x3b7413[_0xb5a1('0xea')]=0x10;_0x3b7413[_0xb5a1('0xaf')]=_0xb5a1('0x10e');_0x3b7413[_0xb5a1('0xec')]='AGI';this[_0xb5a1('0xd2')](_0x3b7413)[_0xb5a1('0xb9')](loggerCatch(_0xb5a1('0x10b')));this[_0xb5a1('0xd0')](_0x3b7413)[_0xb5a1('0xb9')](loggerCatch('[syncHangupIvr]'));}if(_0x13e8a0&&_0x13e8a0['type']!==_0xb5a1('0x80')&&!isNotNull(this[_0xb5a1('0x22')][_0x13e8a0['queue']]['dialQueueProject'])){delete this[_0xb5a1('0x2a')][_0x108bcd[_0xb5a1('0xe4')]];this[_0xb5a1('0xbd')](this[_0xb5a1('0x22')][_0x13e8a0[_0xb5a1('0xbb')]]);this[_0xb5a1('0x22')][_0x13e8a0[_0xb5a1('0xbb')]][_0xb5a1('0x6f')]+=0x1;_0x3b7413=new Hangup(_0x13e8a0,_0x108bcd);_0x3b7413[_0xb5a1('0xea')]=0xc;_0x3b7413[_0xb5a1('0xaf')]=_0x108bcd[_0xb5a1('0x10f')];_0x3b7413['membername']='Unknow';this[_0xb5a1('0xd2')](_0x3b7413)[_0xb5a1('0xb9')](loggerCatch(_0xb5a1('0x10b')));this[_0xb5a1('0xd0')](_0x3b7413)['catch'](loggerCatch(_0xb5a1('0x10c')));}};Dialer[_0xb5a1('0x1d')][_0xb5a1('0x35')]=function(_0x3a0861){var _0x25ff50=this['uniqueId'][_0x3a0861[_0xb5a1('0xe4')]];var _0x4c8f66=this;if(this['voiceQueues'][_0x3a0861['queue']]){if(_0x25ff50&&_0x25ff50[_0xb5a1('0x55')]!==_0xb5a1('0x80')){delete this[_0xb5a1('0x2a')][_0x3a0861['uniqueid']];this[_0xb5a1('0x22')][_0x3a0861['queue']]['outboundAnswerCallsDay']+=0x1;var _0x356db8=new AgentComplete(_0x25ff50,_0x3a0861);if(_0x3a0861[_0xb5a1('0x110')]===_0xb5a1('0x111')){_0x356db8[_0xb5a1('0x112')]=this[_0xb5a1('0x22')][_0x3a0861[_0xb5a1('0xbb')]][_0xb5a1('0x113')]&&this[_0xb5a1('0x22')][_0x3a0861['queue']]['dialAgiAfterHangupAgent']?moment()[_0xb5a1('0x7d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this[_0xb5a1('0xd2')](_0x356db8)['catch'](loggerCatch(_0xb5a1('0x114')));this[_0xb5a1('0xd0')](_0x356db8)['catch'](loggerCatch(_0xb5a1('0x115')));}}};Dialer[_0xb5a1('0x1d')][_0xb5a1('0x2f')]=function(_0x3f3a77){if(this[_0xb5a1('0x22')][_0x3f3a77[_0xb5a1('0xbb')]]){if(this[_0xb5a1('0x2a')][_0x3f3a77[_0xb5a1('0xe4')]]&&this[_0xb5a1('0x2a')][_0x3f3a77[_0xb5a1('0xe4')]][_0xb5a1('0x55')]!==_0xb5a1('0x80')){this[_0xb5a1('0xbd')](this[_0xb5a1('0x22')][_0x3f3a77[_0xb5a1('0xbb')]]);this[_0xb5a1('0x2a')][_0x3f3a77[_0xb5a1('0xe4')]]['answertime']=moment()[_0xb5a1('0x7d')](_0xb5a1('0xff'));}}};Dialer['prototype'][_0xb5a1('0x116')]=function(_0x31e76d){this[_0xb5a1('0xd2')](_0x31e76d)['catch'](loggerCatch(_0xb5a1('0x114')));this['moveContactManagedDialer'](_0x31e76d)[_0xb5a1('0xb9')](loggerCatch(_0xb5a1('0x117')));};Dialer[_0xb5a1('0x1d')][_0xb5a1('0x31')]=function(_0x672c1d){var _0x4f3a63=this[_0xb5a1('0x2a')][_0x672c1d[_0xb5a1('0xe4')]];var _0x3d9feb=this;if(this[_0xb5a1('0x22')][_0x672c1d[_0xb5a1('0xbb')]]){if(_0x4f3a63&&_0x4f3a63[_0xb5a1('0x55')]!==_0xb5a1('0x80')){delete this[_0xb5a1('0x2a')][_0x672c1d[_0xb5a1('0xe4')]];this['updateOriginated'](this[_0xb5a1('0x22')][_0x672c1d[_0xb5a1('0xbb')]]);_0x4f3a63[_0xb5a1('0x118')]=moment()[_0xb5a1('0x7d')](_0xb5a1('0xff'));var _0x570f4e=new QueueCallerAbandon(_0x4f3a63,_0x672c1d);if(getSeconds(_0x4f3a63[_0xb5a1('0x118')],_0x4f3a63[_0xb5a1('0x119')])>=_0x4f3a63[_0xb5a1('0x11a')]){this[_0xb5a1('0x22')][_0x672c1d['queue']]['predictiveIntervalDroppedCallsTimeout']+=0x1;this['voiceQueues'][_0x672c1d[_0xb5a1('0xbb')]][_0xb5a1('0x6a')]+=0x1;this['voiceQueues'][_0x672c1d['queue']]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x570f4e['state']=0xa;_0x570f4e[_0xb5a1('0xaf')]=_0xb5a1('0x11b');_0x570f4e[_0xb5a1('0x11c')]=_0xb5a1('0x11d');_0x570f4e[_0xb5a1('0x112')]=this[_0xb5a1('0x22')][_0x672c1d[_0xb5a1('0xbb')]][_0xb5a1('0x113')]?moment()[_0xb5a1('0x7d')](_0xb5a1('0xff')):undefined;_0x570f4e[_0xb5a1('0xf5')]+=0x1;_0x570f4e[_0xb5a1('0x103')]+=0x1;if(_0x570f4e['countdropretry']>=this['voiceQueues'][_0x672c1d[_0xb5a1('0xbb')]][_0xb5a1('0x11e')]){this[_0xb5a1('0x116')](_0x570f4e);}else{this['rescheduleContact']({'active':![],'countdropretry':_0x570f4e[_0xb5a1('0xf5')],'scheduledat':moment()[_0xb5a1('0xfd')](this['voiceQueues'][_0x672c1d[_0xb5a1('0xbb')]][_0xb5a1('0x11f')],_0xb5a1('0x108'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4f3a63[_0xb5a1('0xd8')],'ListId':_0x4f3a63['ListId'],'VoiceQueueId':_0x4f3a63[_0xb5a1('0xdb')]||undefined,'CampaignId':_0x4f3a63[_0xb5a1('0xdc')]||undefined})[_0xb5a1('0xb9')](loggerCatch(_0xb5a1('0x120')));var _0x13cb19=new History(_0x570f4e);_0x13cb19[_0xb5a1('0xea')]=0xa;_0x13cb19[_0xb5a1('0xaf')]=_0xb5a1('0x11b');_0x13cb19[_0xb5a1('0xb1')]=moment()[_0xb5a1('0x7d')](_0xb5a1('0xff'));_0x13cb19[_0xb5a1('0xb0')]=_0x13cb19[_0xb5a1('0xb1')];_0x13cb19[_0xb5a1('0x121')]=_0x570f4e[_0xb5a1('0x121')];_0x13cb19[_0xb5a1('0x122')]=_0x570f4e[_0xb5a1('0x122')];this[_0xb5a1('0xd2')](_0x13cb19)['catch'](loggerCatch(_0xb5a1('0x123')));}}else{this[_0xb5a1('0x22')][_0x672c1d[_0xb5a1('0xbb')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0xb5a1('0x22')][_0x672c1d['queue']][_0xb5a1('0x124')]+=0x1;_0x570f4e[_0xb5a1('0xea')]=0xb;_0x570f4e['statedesc']=_0xb5a1('0x125');_0x570f4e[_0xb5a1('0x11c')]=_0xb5a1('0x126');_0x570f4e[_0xb5a1('0xf6')]+=0x1;_0x570f4e['countglobal']+=0x1;if(_0x570f4e['countabandonedretry']>=this[_0xb5a1('0x22')][_0x672c1d[_0xb5a1('0xbb')]][_0xb5a1('0x127')]){this[_0xb5a1('0x116')](_0x570f4e);}else{this['rescheduleContact']({'active':![],'countabandonedretry':_0x570f4e[_0xb5a1('0xf6')],'scheduledat':moment()[_0xb5a1('0xfd')](this['voiceQueues'][_0x672c1d['queue']][_0xb5a1('0x128')],_0xb5a1('0x108'))['format'](_0xb5a1('0xff')),'ContactId':_0x4f3a63[_0xb5a1('0xd8')],'ListId':_0x4f3a63[_0xb5a1('0xd9')],'VoiceQueueId':_0x4f3a63['VoiceQueueId']||undefined,'CampaignId':_0x4f3a63[_0xb5a1('0xdc')]||undefined})[_0xb5a1('0xb9')](loggerCatch(_0xb5a1('0x129')));var _0x13cb19=new History(_0x570f4e);_0x13cb19[_0xb5a1('0xea')]=0xb;_0x13cb19[_0xb5a1('0xaf')]='Abandoned';_0x13cb19['starttime']=moment()[_0xb5a1('0x7d')]('YYYY-MM-DD\x20HH:mm:ss');_0x13cb19[_0xb5a1('0xb0')]=_0x13cb19[_0xb5a1('0xb1')];_0x13cb19[_0xb5a1('0x121')]=_0x570f4e[_0xb5a1('0x121')];_0x13cb19['calleridnum']=_0x570f4e[_0xb5a1('0x122')];this[_0xb5a1('0xd2')](_0x13cb19)[_0xb5a1('0xb9')](loggerCatch(_0xb5a1('0x12a')));}}}}};Dialer[_0xb5a1('0x1d')][_0xb5a1('0x3a')]=function(_0x4a6a59){if(this[_0xb5a1('0x28')][_0x4a6a59[_0xb5a1('0xe4')]]){this['actions'][_0x4a6a59[_0xb5a1('0xe4')]][_0xb5a1('0xb8')]=_0x4a6a59[_0xb5a1('0xb8')];}if(this[_0xb5a1('0x2a')][_0x4a6a59[_0xb5a1('0xe4')]]){this[_0xb5a1('0x2a')][_0x4a6a59[_0xb5a1('0xe4')]]['channel']=_0x4a6a59[_0xb5a1('0xb8')];}};Dialer[_0xb5a1('0x1d')][_0xb5a1('0x3d')]=function(_0x421b03){if(strategy[this[_0xb5a1('0x22')][this[_0xb5a1('0x28')][_0x421b03[_0xb5a1('0x12b')]][_0xb5a1('0xbb')]][_0xb5a1('0x57')]]===_0xb5a1('0x1c')){if(this[_0xb5a1('0x28')][_0x421b03[_0xb5a1('0x12b')]]&&_[_0xb5a1('0xb5')](this[_0xb5a1('0x28')][_0x421b03[_0xb5a1('0x12b')]]['locked'])&&_0x421b03['status']==='1'&&_0x421b03[_0xb5a1('0x12c')]==='0'){if(this[_0xb5a1('0x24')][_0x421b03[_0xb5a1('0x12d')]]){if(!this['agents'][_0x421b03[_0xb5a1('0x12d')]]['locked']){this[_0xb5a1('0x24')][_0x421b03['stateinterface']]['locked']=!![];this[_0xb5a1('0x28')][_0x421b03[_0xb5a1('0x12b')]]['locked']=!![];this['actions'][_0x421b03[_0xb5a1('0x12b')]][_0xb5a1('0x12d')]=_0x421b03[_0xb5a1('0x12d')];}}}}else if((strategy[this[_0xb5a1('0x22')][this[_0xb5a1('0x28')][_0x421b03[_0xb5a1('0x12b')]]['queue']][_0xb5a1('0x57')]]||_0xb5a1('0x1b'))===_0xb5a1('0x1b')){if(this['actions'][_0x421b03[_0xb5a1('0x12b')]]){if(this[_0xb5a1('0x24')][_0x421b03['stateinterface']]){this[_0xb5a1('0x28')][_0x421b03[_0xb5a1('0x12b')]][_0xb5a1('0x12d')]=_0x421b03[_0xb5a1('0x12d')];if(_[_0xb5a1('0xb5')](this['queueBooked'][this[_0xb5a1('0x28')][_0x421b03[_0xb5a1('0x12b')]][_0xb5a1('0xbb')]])){this[_0xb5a1('0x2c')][this[_0xb5a1('0x28')][_0x421b03[_0xb5a1('0x12b')]][_0xb5a1('0xbb')]]=[];}this['queueBooked'][this[_0xb5a1('0x28')][_0x421b03[_0xb5a1('0x12b')]][_0xb5a1('0xbb')]][_0xb5a1('0x12e')](_[_0xb5a1('0x95')](_[_0xb5a1('0xd7')](this[_0xb5a1('0x28')][_0x421b03[_0xb5a1('0x12b')]],[_0xb5a1('0x12f'),_0xb5a1('0x12d')]),{'status':_0x421b03[_0xb5a1('0xb7')],'paused':_0x421b03[_0xb5a1('0x12c')]}));}}}};function unlockQueueStatus(_0x12c31f,_0x770f8f){setTimeout(function(){if(_[_0xb5a1('0x44')](_0x12c31f[_0xb5a1('0x130')])){loggerBooked[_0xb5a1('0x9d')]('[unlockQueueStatus][undefined]',_0x770f8f);}_0x12c31f['queueStatusComplete']=!![];loggerBooked[_0xb5a1('0x83')](_0xb5a1('0x131'),_0x770f8f,JSON[_0xb5a1('0x50')](_[_0xb5a1('0xd7')](_0x12c31f,[_0xb5a1('0x47'),_0xb5a1('0x130')])));},0x1f3);}Dialer[_0xb5a1('0x1d')][_0xb5a1('0x3f')]=function(_0x50c7e4){var _0x378b65=this;var _0x238f6c=_0x378b65[_0xb5a1('0x22')][_0x378b65[_0xb5a1('0x28')][_0x50c7e4['actionid']][_0xb5a1('0xbb')]];if(strategy[this[_0xb5a1('0x22')][this[_0xb5a1('0x28')][_0x50c7e4[_0xb5a1('0x12b')]][_0xb5a1('0xbb')]]['strategy']]===_0xb5a1('0x1c')){if(this[_0xb5a1('0x28')][_0x50c7e4[_0xb5a1('0x12b')]]&&this['actions'][_0x50c7e4[_0xb5a1('0x12b')]][_0xb5a1('0x12d')]){this[_0xb5a1('0x21')][_0xb5a1('0x132')](this[_0xb5a1('0x28')][_0x50c7e4[_0xb5a1('0x12b')]][_0xb5a1('0x12f')],this[_0xb5a1('0x28')][_0x50c7e4['actionid']][_0xb5a1('0x12d')])['catch'](function(_0xc77575){logger[_0xb5a1('0x9d')](_0xb5a1('0x133'),util[_0xb5a1('0x9f')](_0xc77575,{'showHidden':![],'depth':null}));})[_0xb5a1('0x20')](function(){_0x378b65['updateOriginated'](_0x378b65[_0xb5a1('0x22')][_0x378b65[_0xb5a1('0x28')][_0x50c7e4['actionid']]['queue']]);_0x378b65[_0xb5a1('0x24')][_0x378b65[_0xb5a1('0x28')][_0x50c7e4[_0xb5a1('0x12b')]][_0xb5a1('0x12d')]][_0xb5a1('0x134')]=![];delete _0x378b65[_0xb5a1('0x28')][_0x50c7e4[_0xb5a1('0x12b')]];unlockQueueStatus(_0x238f6c);});}else{this[_0xb5a1('0xbd')](this[_0xb5a1('0x22')][this['actions'][_0x50c7e4[_0xb5a1('0x12b')]]['queue']]);this[_0xb5a1('0xc8')]({'active':![],'ContactId':this['actions'][_0x50c7e4[_0xb5a1('0x12b')]][_0xb5a1('0xd8')],'ListId':this['actions'][_0x50c7e4[_0xb5a1('0x12b')]]['ListId'],'VoiceQueueId':this['actions'][_0x50c7e4['actionid']][_0xb5a1('0xdb')]||undefined,'CampaignId':this[_0xb5a1('0x28')][_0x50c7e4['actionid']]['CampaignId']||undefined})[_0xb5a1('0xb9')](loggerCatch(_0xb5a1('0x135')));delete this[_0xb5a1('0x28')][_0x50c7e4['actionid']];unlockQueueStatus(_0x238f6c);}}else if((strategy[this[_0xb5a1('0x22')][this[_0xb5a1('0x28')][_0x50c7e4[_0xb5a1('0x12b')]][_0xb5a1('0xbb')]][_0xb5a1('0x57')]]||_0xb5a1('0x1b'))===_0xb5a1('0x1b')){var _0x2a8aa4;if(this['actions'][_0x50c7e4[_0xb5a1('0x12b')]]&&!_['isEmpty'](this['queueBooked'][this[_0xb5a1('0x28')][_0x50c7e4[_0xb5a1('0x12b')]][_0xb5a1('0xbb')]])){if(this['queueBookedRR'][_0x378b65[_0xb5a1('0x28')][_0x50c7e4[_0xb5a1('0x12b')]][_0xb5a1('0xbb')]]){this['queueBookedRR'][_0x378b65[_0xb5a1('0x28')][_0x50c7e4['actionid']][_0xb5a1('0xbb')]]=this['queueBookedRR'][this[_0xb5a1('0x28')][_0x50c7e4[_0xb5a1('0x12b')]][_0xb5a1('0xbb')]]?this[_0xb5a1('0x2d')][this['actions'][_0x50c7e4['actionid']][_0xb5a1('0xbb')]]:this[_0xb5a1('0x2c')][this['actions'][_0x50c7e4['actionid']][_0xb5a1('0xbb')]]?this[_0xb5a1('0x2c')][this[_0xb5a1('0x28')][_0x50c7e4['actionid']][_0xb5a1('0xbb')]][_0xb5a1('0x136')]||0x0:0x0;}this[_0xb5a1('0x2c')][this['actions'][_0x50c7e4[_0xb5a1('0x12b')]]['queue']][_0xb5a1('0x136')]=this[_0xb5a1('0x2d')][this['actions'][_0x50c7e4['actionid']][_0xb5a1('0xbb')]];for(var _0x437c6a=0x0;_0x437c6a<this[_0xb5a1('0x2c')][this[_0xb5a1('0x28')][_0x50c7e4['actionid']][_0xb5a1('0xbb')]]['length'];_0x437c6a+=0x1){_0x2a8aa4=rr(this[_0xb5a1('0x2c')][this['actions'][_0x50c7e4['actionid']]['queue']]);this[_0xb5a1('0x2d')][_0x378b65[_0xb5a1('0x28')][_0x50c7e4['actionid']][_0xb5a1('0xbb')]]=this[_0xb5a1('0x2c')][this[_0xb5a1('0x28')][_0x50c7e4[_0xb5a1('0x12b')]]['queue']][_0xb5a1('0x136')];if(_0x2a8aa4[_0xb5a1('0xb7')]==='1'&&_0x2a8aa4[_0xb5a1('0x12c')]==='0'){break;}}if(!_[_0xb5a1('0xb5')](_0x2a8aa4)){this['agents'][_0x2a8aa4[_0xb5a1('0x12d')]][_0xb5a1('0x137')]=_[_0xb5a1('0x44')](this[_0xb5a1('0x24')][_0x2a8aa4[_0xb5a1('0x12d')]][_0xb5a1('0x137')])?!![]:this[_0xb5a1('0x24')][_0x2a8aa4[_0xb5a1('0x12d')]][_0xb5a1('0x137')];}loggerBooked[_0xb5a1('0x83')](_0xb5a1('0x138'),_0x50c7e4[_0xb5a1('0x12b')],_0xb5a1('0x139'),JSON['stringify'](_['pick'](this['agents'][_0x2a8aa4['stateinterface']],[_0xb5a1('0x47'),_0xb5a1('0x137')])),_0xb5a1('0x13a'),JSON[_0xb5a1('0x50')](_0x2a8aa4['idHopper']));if(!_[_0xb5a1('0xb5')](_0x2a8aa4)&&_0x2a8aa4[_0xb5a1('0xb7')]==='1'&&_0x2a8aa4['paused']==='0'&&this[_0xb5a1('0x24')][_0x2a8aa4[_0xb5a1('0x12d')]]['unlockRR']){this[_0xb5a1('0x24')][_0x2a8aa4[_0xb5a1('0x12d')]][_0xb5a1('0x137')]=![];this[_0xb5a1('0x2c')][_0x378b65[_0xb5a1('0x28')][_0x50c7e4['actionid']][_0xb5a1('0xbb')]]=[];this[_0xb5a1('0x21')][_0xb5a1('0x132')](_0x2a8aa4[_0xb5a1('0x12f')],_0x2a8aa4['stateinterface'])['catch'](function(_0x261dd8){logger[_0xb5a1('0x9d')](_0xb5a1('0x133'),util[_0xb5a1('0x9f')](_0x261dd8,{'showHidden':![],'depth':null}));})['finally'](function(){_0x378b65[_0xb5a1('0xbd')](_0x378b65[_0xb5a1('0x22')][_0x378b65['actions'][_0x50c7e4[_0xb5a1('0x12b')]][_0xb5a1('0xbb')]]);setTimeout(function(){_0x378b65[_0xb5a1('0x24')][_0x2a8aa4['stateinterface']][_0xb5a1('0x137')]=!![];loggerBooked[_0xb5a1('0x83')](_0xb5a1('0x13b'),_0x50c7e4[_0xb5a1('0x12b')],'Agent:\x20',JSON[_0xb5a1('0x50')](_[_0xb5a1('0xd7')](_0x378b65[_0xb5a1('0x24')][_0x2a8aa4['stateinterface']],['name',_0xb5a1('0x137')])),_0xb5a1('0x13a'),JSON[_0xb5a1('0x50')](_0x2a8aa4[_0xb5a1('0x12f')]));},0xc7);delete _0x378b65[_0xb5a1('0x28')][_0x50c7e4['actionid']];unlockQueueStatus(_0x238f6c,_0x50c7e4[_0xb5a1('0x12b')]);});}else{loggerBooked[_0xb5a1('0x83')](_0xb5a1('0x13c'));this['updateOriginated'](this[_0xb5a1('0x22')][this[_0xb5a1('0x28')][_0x50c7e4[_0xb5a1('0x12b')]]['queue']]);this[_0xb5a1('0xc8')]({'active':![],'ContactId':this['actions'][_0x50c7e4[_0xb5a1('0x12b')]][_0xb5a1('0xd8')],'ListId':this[_0xb5a1('0x28')][_0x50c7e4[_0xb5a1('0x12b')]][_0xb5a1('0xd9')],'VoiceQueueId':this[_0xb5a1('0x28')][_0x50c7e4[_0xb5a1('0x12b')]][_0xb5a1('0xdb')]||undefined,'CampaignId':this['actions'][_0x50c7e4[_0xb5a1('0x12b')]][_0xb5a1('0xdc')]||undefined})['catch'](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this['actions'][_0x50c7e4[_0xb5a1('0x12b')]];unlockQueueStatus(_0x238f6c);}}else{loggerBooked[_0xb5a1('0x83')](_0xb5a1('0x13d'));this[_0xb5a1('0xbd')](this['voiceQueues'][this[_0xb5a1('0x28')][_0x50c7e4[_0xb5a1('0x12b')]][_0xb5a1('0xbb')]]);this[_0xb5a1('0xc8')]({'active':![],'ContactId':this[_0xb5a1('0x28')][_0x50c7e4[_0xb5a1('0x12b')]][_0xb5a1('0xd8')],'ListId':this[_0xb5a1('0x28')][_0x50c7e4[_0xb5a1('0x12b')]]['ListId'],'VoiceQueueId':this[_0xb5a1('0x28')][_0x50c7e4['actionid']][_0xb5a1('0xdb')]||undefined,'CampaignId':this['actions'][_0x50c7e4[_0xb5a1('0x12b')]][_0xb5a1('0xdc')]||undefined})['catch'](loggerCatch('[unlock2][syncQueueStatusComplete]'));delete this[_0xb5a1('0x28')][_0x50c7e4[_0xb5a1('0x12b')]];unlockQueueStatus(_0x238f6c);}}else{loggerBooked[_0xb5a1('0x83')](_0xb5a1('0x13e'));this[_0xb5a1('0xbd')](this[_0xb5a1('0x22')][this[_0xb5a1('0x28')][_0x50c7e4['actionid']][_0xb5a1('0xbb')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0xb5a1('0x28')][_0x50c7e4[_0xb5a1('0x12b')]]['ContactId'],'ListId':this['actions'][_0x50c7e4['actionid']][_0xb5a1('0xd9')],'VoiceQueueId':this[_0xb5a1('0x28')][_0x50c7e4['actionid']][_0xb5a1('0xdb')]||undefined,'CampaignId':this['actions'][_0x50c7e4[_0xb5a1('0x12b')]][_0xb5a1('0xdc')]||undefined})[_0xb5a1('0xb9')](loggerCatch(_0xb5a1('0x13f')));delete this['actions'][_0x50c7e4[_0xb5a1('0x12b')]];unlockQueueStatus(_0x238f6c);}};Dialer['prototype'][_0xb5a1('0x140')]=function(){var _0x3f48ed=this;return BPromise[_0xb5a1('0xbf')]()['then'](cmHopper['resetActiveCalls']({}))[_0xb5a1('0x42')](function(){setInterval(function(){_0x3f48ed[_0xb5a1('0x141')]();},0x3e8);});};Dialer[_0xb5a1('0x1d')]['checkIsTrunkReachable']=function(_0x249875){var _0x5a9e2f=this;return function(){if(!_0x5a9e2f['isTrunkReachable'](_0x249875[_0xb5a1('0x7c')])){if(!_0x5a9e2f[_0xb5a1('0xe0')](_0x249875[_0xb5a1('0x142')])){_0x249875['message']=_0xb5a1('0x143');throw _0x249875['name']+_0xb5a1('0x144');}}};};Dialer[_0xb5a1('0x1d')][_0xb5a1('0x145')]=function(_0x1cac65,_0x3ba798,_0x3d5c2f,_0x338329){var _0x17b712=this;return function(){var _0x1d0b7f=!![];return _0x17b712[_0xb5a1('0x146')](_0x1cac65,_0x3ba798,_0x3d5c2f,_0x338329,_0x1d0b7f);};};Dialer[_0xb5a1('0x1d')][_0xb5a1('0x147')]=function(_0x1d7fc2,_0x4cbc28,_0x4dced6,_0xca823a){var _0x32cd2c=this;return function(){var _0x5a061b=![];return _0x32cd2c[_0xb5a1('0x146')](_0x1d7fc2['Intervals'],_0x4cbc28,_0x4dced6,_0xca823a,_0x5a061b);};};Dialer[_0xb5a1('0x1d')][_0xb5a1('0x146')]=function(_0x57ffbe,_0x1ec4fd,_0x241efd,_0x562681,_0x23f85a){var _0x34bbfa=[];return new BPromise(function(_0x2ea95c,_0x31e4ea){if(!isNotNull(_0x57ffbe)){_0x562681[_0xb5a1('0x45')]=_0xb5a1('0x4b');return _0x31e4ea(msgResponse('ifTime',_0xb5a1('0x148'),_0x241efd+_0xb5a1('0x149')));}if(_['isEmpty'](_0x57ffbe)){_0x562681[_0xb5a1('0x45')]='INTERVAL_IS_EMPTY';return _0x31e4ea(msgResponse('ifTime',_0xb5a1('0x148'),_0x241efd+_0xb5a1('0x14a')));}if(_0x1ec4fd&&_['isUndefined'](config[_0xb5a1('0x14b')][_0x1ec4fd])){_0x562681[_0xb5a1('0x45')]=_0xb5a1('0x14c');return _0x31e4ea(msgResponse(_0xb5a1('0x146'),'Failure',_0x241efd+_0xb5a1('0x14d')+_0x1ec4fd));}if(_[_0xb5a1('0x14e')](_0x57ffbe)){for(var _0x15b142=0x0;_0x15b142<_0x57ffbe[_0xb5a1('0xa0')];_0x15b142+=0x1){_0x34bbfa[_0xb5a1('0x12e')](ami[_0xb5a1('0xb6')]({'action':_0xb5a1('0x14f'),'command':util[_0xb5a1('0x7d')](_0xb5a1('0x150'),_0x57ffbe[_0x15b142][_0xb5a1('0x151')],!_[_0xb5a1('0x44')](config[_0xb5a1('0x14b')][_0x1ec4fd])?_0x1ec4fd:'')})[_0xb5a1('0x42')](function(_0x885f3d){return _0x885f3d[_0xb5a1('0x152')][_0xb5a1('0x153')](_0xb5a1('0x154'))>=0x0;})[_0xb5a1('0xb9')](myreject(_0x31e4ea)));}}else{_0x34bbfa[_0xb5a1('0x12e')](ami['Action']({'action':_0xb5a1('0x14f'),'command':util[_0xb5a1('0x7d')](_0xb5a1('0x150'),_0x57ffbe,!_[_0xb5a1('0x44')](config[_0xb5a1('0x14b')][_0x1ec4fd])?_0x1ec4fd:'')})[_0xb5a1('0x42')](function(_0x3bc1c5){return _0x3bc1c5[_0xb5a1('0x152')]['indexOf'](_0xb5a1('0x154'))>=0x0;})[_0xb5a1('0xb9')](myreject(_0x31e4ea)));}BPromise[_0xb5a1('0x155')](_0x34bbfa)[_0xb5a1('0x42')](function(_0x46e7ac){var _0x59714e=_[_0xb5a1('0x156')](_0x46e7ac);if(_0x59714e){return _0x2ea95c(_0x59714e);}else{_0x562681[_0xb5a1('0x45')]=_0x23f85a?'GLOBAL_INTERVAL_IS_OVERTIME':_0xb5a1('0x157');return _0x31e4ea(msgResponse(_0xb5a1('0x158'),'Failure','Global:\x20'+_0x23f85a+'\x20'+_0x241efd+_0xb5a1('0x159')+util[_0xb5a1('0x9f')](_0x57ffbe,{'showHidden':![],'depth':null})+_0xb5a1('0x15a')+_0x1ec4fd));}})[_0xb5a1('0xb9')](function(_0x12a7de){return _0x31e4ea(msgResponse(_0xb5a1('0x146'),_0xb5a1('0x148'),JSON[_0xb5a1('0x50')](_0x12a7de)));});});};Dialer[_0xb5a1('0x1d')][_0xb5a1('0x15b')]=function(_0x4d8c97){var _0x564fc1=this;return function(){switch(_0x4d8c97[_0xb5a1('0x63')]){case _0xb5a1('0x15c'):freeVariablesPredictive(_0x4d8c97);_0x564fc1[_0xb5a1('0x15d')](_0x4d8c97,0x1);break;case _0xb5a1('0x15e'):freeVariablesPredictive(_0x4d8c97);_0x564fc1[_0xb5a1('0x15d')](_0x4d8c97,_0x4d8c97[_0xb5a1('0x15f')]);break;case _0xb5a1('0x9'):_0x564fc1[_0xb5a1('0x9')](_0x4d8c97);break;case'booked':freeVariablesPredictive(_0x4d8c97);_0x564fc1['handlePower'](_0x4d8c97,0x1);break;default:freeVariablesPredictive(_0x4d8c97);logger[_0xb5a1('0x9d')](_0xb5a1('0x160'),_0x4d8c97['name'],_0xb5a1('0x161'));}};};Dialer['prototype'][_0xb5a1('0x162')]=function(_0x5f3eb5){return BPromise[_0xb5a1('0xbf')]()[_0xb5a1('0x42')](cmHopper['handlePreviewRecallNotifications'](_0x5f3eb5['id'],previewRecallmeReminderInterval))[_0xb5a1('0x42')](function(_0xb69dd1){for(var _0x21d4f2=0x0;_0x21d4f2<_0xb69dd1[_0xb5a1('0xa0')];_0x21d4f2++){var _0x196d20=_0xb69dd1[_0x21d4f2][_0xb5a1('0x163')]['name'];if(_0x196d20)io['to'](util['format']('user:%s',_0x196d20))['emit']('user:dialPreviewRecallReminder',{'hopper':_0xb69dd1[_0x21d4f2]});}})[_0xb5a1('0xb9')](function(_0x3bad8c){});};Dialer[_0xb5a1('0x1d')]['launchHandleIvr']=function(_0x52d329){var _0x12fa81=this;return function(){_0x12fa81[_0xb5a1('0x164')](_0x52d329);};};Dialer['prototype'][_0xb5a1('0xb')]=function(_0x4804f8){var _0x49eb3b=this;if(isNotPreview(_0x4804f8[_0xb5a1('0x63')])){if(isVoiceQueueOutbound(_0x4804f8['type'])&&isActive(_0x4804f8[_0xb5a1('0x62')])){_0x4804f8[_0xb5a1('0xaa')]=!![];BPromise[_0xb5a1('0xbf')]()['then'](checkIsLoggedIn(_0x4804f8,_0x4804f8['loggedIn']))[_0xb5a1('0x42')](checkIsActive(_0x4804f8,_0x4804f8[_0xb5a1('0x62')]))[_0xb5a1('0x42')](checkInterval(_0x4804f8))[_0xb5a1('0x42')](_0x49eb3b[_0xb5a1('0x165')](_0x4804f8))['then'](_0x49eb3b[_0xb5a1('0x145')](_0x4804f8[_0xb5a1('0x166')],_0x4804f8[_0xb5a1('0x167')],_0x4804f8[_0xb5a1('0x47')],_0x4804f8))[_0xb5a1('0x42')](_0x49eb3b[_0xb5a1('0x147')](_0x4804f8[_0xb5a1('0x4a')],_0x4804f8['dialTimezone'],_0x4804f8[_0xb5a1('0x47')],_0x4804f8))[_0xb5a1('0x42')](_0x49eb3b[_0xb5a1('0x15b')](_0x4804f8))['catch'](loggerCatchQueueSummary(_0xb5a1('0x168'),_0x4804f8));}else{notSendMessagesQueue(_0x4804f8);}}else{freeVariablesPredictive(_0x4804f8);if(_0x4804f8[_0xb5a1('0x169')]){_0x49eb3b[_0xb5a1('0x162')](_0x4804f8);}}};Dialer[_0xb5a1('0x1d')][_0xb5a1('0x141')]=function(){var _0x3b60fd=this;var _0x425b32;for(var _0x53a10a in this[_0xb5a1('0x23')]){if(typeof this['campaigns'][_0x53a10a]!=='undefined'){_0x425b32=this[_0xb5a1('0x23')][_0x53a10a];if(isCampaignIvr(_0x425b32[_0xb5a1('0x55')])&&isActive(_0x425b32['active'])){_0x425b32[_0xb5a1('0xaa')]=!![];BPromise[_0xb5a1('0xbf')]()[_0xb5a1('0x42')](checkIsActive(_0x425b32,_0x425b32['active']))['then'](checkInterval(_0x425b32))['then'](_0x3b60fd[_0xb5a1('0x165')](_0x425b32))[_0xb5a1('0x42')](_0x3b60fd[_0xb5a1('0x145')](_0x425b32[_0xb5a1('0x166')],_0x425b32[_0xb5a1('0x167')],_0x425b32[_0xb5a1('0x47')],_0x425b32))[_0xb5a1('0x42')](_0x3b60fd[_0xb5a1('0x147')](_0x425b32[_0xb5a1('0x4a')],_0x425b32[_0xb5a1('0x167')],_0x425b32['name'],_0x425b32))[_0xb5a1('0x42')](_0x3b60fd[_0xb5a1('0x16a')](_0x425b32))[_0xb5a1('0xb9')](loggerCatchQueueSummary(_0xb5a1('0x16b'),_0x425b32));}else{notSendMessagesCampaign(_0x425b32);}}}};function getCallerIdRandom(_0x3bb904,_0x1117bd){var _0x45a262;var _0x542534;var _0x50e32b;if(_0x1117bd<=0x0){_0x1117bd=0x1;}_0x45a262=new RegExp(_0xb5a1('0x16c')+_0x1117bd+'}$');_0x542534=Math[_0xb5a1('0x16d')](0xa,_0x1117bd-0x1);_0x50e32b=Math[_0xb5a1('0x16d')](0xa,_0x1117bd)-0x1;return util[_0xb5a1('0x7d')]('%s',_[_0xb5a1('0x16e')](_0x3bb904,_0x45a262,_[_0xb5a1('0x16f')](_0x542534,_0x50e32b)));}function extractCalleridName(_0x61dc3e){var _0x3595f9=_0x61dc3e[_0xb5a1('0x170')](/"(.*?)"/);return _0x3595f9?_0x3595f9[0x1]:_0x61dc3e;}function extractCalleridNumber(_0x3f68c5){var _0x2c3779=_0x3f68c5['match'](/<(.*?)>/);return _0x2c3779?_0x2c3779[0x1]:_0x3f68c5;}Dialer[_0xb5a1('0x1d')]['actionOriginate']=function(_0x31d455,_0x53e362){var _0x2b0895=this;var _0x76aed9=uuid['v4']();this[_0xb5a1('0x28')][_0x76aed9]=new Action(_0x31d455,_0x53e362,_0x76aed9);return new BPromise(function(_0x2b6a6f,_0x5365b0){if(_[_0xb5a1('0x44')](_0x31d455)&&typeof _0x31d455!==_0xb5a1('0x171')){return _0x5365b0(msgResponse('originate',_0xb5a1('0x148'),_0xb5a1('0x172')));}if(_[_0xb5a1('0x44')](_0x53e362[_0xb5a1('0x173')][_0xb5a1('0x174')])||_0x53e362[_0xb5a1('0x173')][_0xb5a1('0x174')]===null){return _0x5365b0(msgResponse(_0xb5a1('0x175'),_0xb5a1('0x148'),_0xb5a1('0x176')));}var _0x264087={'XMD-CALLERID':_0x2b0895[_0xb5a1('0x28')][_0x76aed9][_0xb5a1('0x177')](),'XMD-AGI':_0x31d455[_0xb5a1('0x10d')]?util['format'](_0xb5a1('0x178'),ipAgi,_0x31d455[_0xb5a1('0x10d')]):'NONE','XMD-AGIAFTER':_0x31d455[_0xb5a1('0x113')]?util[_0xb5a1('0x7d')](_0xb5a1('0x178'),ipAgi,_0x31d455[_0xb5a1('0x113')]):_0xb5a1('0x179'),'XMD-QUEUE':_0x31d455[_0xb5a1('0x55')]===_0xb5a1('0x56')?util['format'](_0xb5a1('0x17a'),_0x31d455[_0xb5a1('0x47')],_0x31d455['dialQueueOptions']||'',_0x31d455[_0xb5a1('0x17b')]?'c':'',_0x31d455[_0xb5a1('0x11a')]||0x3):_0xb5a1('0x179'),'XMD-CONTACTID':_0x53e362['ContactId'],'XMD-CDRTYPE':_0xb5a1('0x17c'),'CALLERID(all)':_0x2b0895[_0xb5a1('0x28')][_0x76aed9][_0xb5a1('0x177')](),'XMD-AMD':_0x31d455[_0xb5a1('0x100')]?_0xb5a1('0x17d'):'NONE','XMD-DESTINATION':_0xb5a1('0xe7')};if(_0x31d455[_0xb5a1('0x100')]){_0x264087[_0xb5a1('0x17e')]=_0x31d455[_0xb5a1('0x17f')]||0x9c4;_0x264087[_0xb5a1('0x180')]=_0x31d455['dialAMDGreeting']||0x5dc;_0x264087[_0xb5a1('0x181')]=_0x31d455[_0xb5a1('0x182')]||0x320;_0x264087[_0xb5a1('0x183')]=_0x31d455[_0xb5a1('0x184')]||0x1388;_0x264087['XMD-AMDMINWORDLENGTH']=_0x31d455[_0xb5a1('0x185')]||0x64;_0x264087[_0xb5a1('0x186')]=_0x31d455[_0xb5a1('0x187')]||0x32;_0x264087['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x31d455['dialAMDMaximumNumberOfWords']||0x3;_0x264087['XMD-AMDSILENCETHRESHOLD']=_0x31d455[_0xb5a1('0x188')]||0x100;_0x264087[_0xb5a1('0x189')]=_0x31d455['dialAMDMaximumWordLength']||0x1388;}if(_0x31d455[_0xb5a1('0x55')]==='outbound'){_0x264087[_0xb5a1('0x18a')]=_0x53e362['VoiceQueueId'];}else{_0x264087[_0xb5a1('0x18b')]=_0x53e362[_0xb5a1('0xdc')];}for(var _0x23c6cc in _0x53e362['Contact']){if(typeof _0x53e362['Contact'][_0x23c6cc]!==_0xb5a1('0xa1')){if(isNotNull(_0x53e362[_0xb5a1('0x173')][_0x23c6cc])&&_0x23c6cc!=='id'&&_0x23c6cc!=='tags'&&_0x23c6cc!==_0xb5a1('0x18c')&&_0x23c6cc!==_0xb5a1('0x18d')){_0x264087[util['format'](_0xb5a1('0x18e'),'XMD-',_[_0xb5a1('0x18f')](_0x23c6cc))]=_0x53e362[_0xb5a1('0x173')][_0x23c6cc];}}}var _0x21c04e=_0x2b0895[_0xb5a1('0xe0')](_0x31d455[_0xb5a1('0x7c')])?getCallerId(_0x31d455['Trunk'][_0xb5a1('0x190')],_0x31d455['dialOriginateCallerIdName'],_0x31d455[_0xb5a1('0x191')]>0x0?getCallerIdRandom(_0x31d455['dialOriginateCallerIdNumber'],_0x31d455[_0xb5a1('0x191')]):_0x31d455['dialOriginateCallerIdNumber']):getCallerId(_[_0xb5a1('0xb5')](_0x31d455['TrunkBackup'])?_0x31d455[_0xb5a1('0x7c')][_0xb5a1('0x190')]:_0x31d455[_0xb5a1('0x142')][_0xb5a1('0x190')],_0x31d455[_0xb5a1('0x64')],_0x31d455[_0xb5a1('0x191')]>0x0?getCallerIdRandom(_0x31d455[_0xb5a1('0x65')],_0x31d455[_0xb5a1('0x191')]):_0x31d455[_0xb5a1('0x65')]);if(_0x21c04e){_0x264087[_0xb5a1('0x192')]=_0x2b0895[_0xb5a1('0x28')][_0x76aed9][_0xb5a1('0x193')]=extractCalleridName(_0x21c04e);_0x264087[_0xb5a1('0x194')]=_0x2b0895[_0xb5a1('0x28')][_0x76aed9][_0xb5a1('0x195')]=extractCalleridNumber(_0x21c04e);}return ami[_0xb5a1('0xb6')]({'actionid':_0x76aed9,'action':_0xb5a1('0x175'),'channel':_0x2b0895[_0xb5a1('0xe0')](_0x31d455[_0xb5a1('0x7c')])?util[_0xb5a1('0x7d')](_0xb5a1('0x196'),_0x31d455[_0xb5a1('0x7c')][_0xb5a1('0x47')],isNotNull(_0x31d455[_0xb5a1('0x66')])?_0x31d455[_0xb5a1('0x66')][_0xb5a1('0x197')]()||'':'',_0x31d455[_0xb5a1('0x198')]>0x0?_0x53e362[_0xb5a1('0x173')][_0xb5a1('0x174')][_0xb5a1('0x199')](_0x31d455[_0xb5a1('0x198')]):_0x53e362[_0xb5a1('0x173')]['phone']):util[_0xb5a1('0x7d')]('SIP/%s/%s%s',_[_0xb5a1('0xb5')](_0x31d455['TrunkBackup'])?_0x31d455[_0xb5a1('0x7c')]['name']:_0x31d455[_0xb5a1('0x142')]['name'],isNotNull(_0x31d455[_0xb5a1('0x66')])?_0x31d455['dialPrefix']['trim']()||'':'',_0x31d455[_0xb5a1('0x198')]>0x0?_0x53e362['Contact'][_0xb5a1('0x174')][_0xb5a1('0x199')](_0x31d455['dialCutDigit']):_0x53e362[_0xb5a1('0x173')]['phone']),'callerid':_0x21c04e,'Exten':_0xb5a1('0xe7'),'Context':_0xb5a1('0x19a'),'Priority':'1','variable':_0x264087,'timeout':(_0x31d455[_0xb5a1('0x19b')]||0x1e)*0x3e8,'async':!![],'channelid':_0x76aed9})['then'](function(_0xb648a7){return _0x2b6a6f(_0xb648a7);})['catch'](function(_0x1731ca){_0x31d455[_0xb5a1('0x6c')]+=0x1;var _0x4e8bab=new History(_0x2b0895[_0xb5a1('0x28')][_0x76aed9]);logger[_0xb5a1('0x9d')](util[_0xb5a1('0x7d')](_0xb5a1('0x19c'),JSON[_0xb5a1('0x50')](_0x1731ca)));_0x4e8bab[_0xb5a1('0xea')]=0xe;_0x4e8bab['statedesc']='OriginateError';_0x4e8bab[_0xb5a1('0xb1')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x4e8bab[_0xb5a1('0xb0')]=_0x4e8bab[_0xb5a1('0xb1')];_0x2b0895['createHistory'](_0x4e8bab)['catch'](loggerCatch(_0xb5a1('0x19d')));_0x2b0895[_0xb5a1('0xd0')](_0x4e8bab)[_0xb5a1('0xb9')](loggerCatch(_0xb5a1('0x19d')))[_0xb5a1('0x20')](function(){delete _0x2b0895['actions'][_0x76aed9];return _0x5365b0(msgResponse(_0xb5a1('0x175'),_0xb5a1('0x4f'),_0xb5a1('0x19e')));});});});};Dialer[_0xb5a1('0x1d')]['syncOriginateResponse']=function(_0x2e3b1b){var _0x3b73c4=this[_0xb5a1('0x28')][_0x2e3b1b['actionid']];if(_0x3b73c4){delete this[_0xb5a1('0x28')][_0x2e3b1b[_0xb5a1('0x12b')]];_0x3b73c4[_0xb5a1('0x119')]=moment()[_0xb5a1('0x7d')](_0xb5a1('0xff'));var _0x104822=_0x3b73c4[_0xb5a1('0x55')]===_0xb5a1('0x80')?this[_0xb5a1('0x23')][_0x3b73c4[_0xb5a1('0xbb')]]:this[_0xb5a1('0x22')][_0x3b73c4[_0xb5a1('0x19f')]()];if(!this[_0xb5a1('0xde')](_0x2e3b1b[_0xb5a1('0x1a0')])){this[_0xb5a1('0xbd')](_0x104822);return this[_0xb5a1('0x1a1')](_0x3b73c4,_0x104822,_0x2e3b1b)[_0xb5a1('0xb9')](loggerCatch(_0xb5a1('0x1a2')));}this[_0xb5a1('0x2a')][_0x2e3b1b[_0xb5a1('0xe4')]]=_0x3b73c4;}};Dialer[_0xb5a1('0x1d')][_0xb5a1('0x1a3')]=function(_0x442b23,_0x398f1c,_0x267b05){var _0x47cc86=new History(_0x398f1c);if(_0x47cc86['countbusyretry']+_0x47cc86[_0xb5a1('0x1a4')]+_0x47cc86[_0xb5a1('0xf4')]+_0x47cc86['countnosuchnumberretry']+_0x47cc86[_0xb5a1('0xf5')]+_0x47cc86['countabandonedretry']+_0x47cc86[_0xb5a1('0xf7')]+_0x47cc86[_0xb5a1('0xf8')]>=_0x267b05['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x442b23){case 0x3:if(_0x47cc86['countnoanswerretry']>=_0x267b05[_0xb5a1('0x1a5')]-0x1){return!![];}this[_0xb5a1('0xc8')]({'active':![],'countnoanswerretry':_0x47cc86['countnoanswerretry']+=0x1,'scheduledat':moment()['add'](_0x267b05[_0xb5a1('0x1a6')],_0xb5a1('0x108'))[_0xb5a1('0x7d')](_0xb5a1('0xff')),'ContactId':_0x47cc86[_0xb5a1('0xd8')],'ListId':_0x47cc86['ListId'],'VoiceQueueId':_0x47cc86[_0xb5a1('0xdb')]||undefined,'CampaignId':_0x47cc86[_0xb5a1('0xdc')]||undefined})['catch'](loggerCatch(_0xb5a1('0x1a7')));break;case 0x5:if(_0x47cc86['countbusyretry']>=_0x267b05[_0xb5a1('0x1a8')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x47cc86[_0xb5a1('0x105')]+=0x1,'scheduledat':moment()[_0xb5a1('0xfd')](_0x267b05['dialBusyRetryFrequency'],_0xb5a1('0x108'))[_0xb5a1('0x7d')](_0xb5a1('0xff')),'ContactId':_0x47cc86[_0xb5a1('0xd8')],'ListId':_0x47cc86[_0xb5a1('0xd9')],'VoiceQueueId':_0x47cc86[_0xb5a1('0xdb')]||undefined,'CampaignId':_0x47cc86[_0xb5a1('0xdc')]||undefined})[_0xb5a1('0xb9')](loggerCatch(_0xb5a1('0x1a9')));break;case 0x8:if(_0x47cc86['countcongestionretry']>=_0x267b05[_0xb5a1('0x1aa')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0x47cc86['countcongestionretry']+=0x1,'scheduledat':moment()[_0xb5a1('0xfd')](_0x267b05[_0xb5a1('0x1ab')],_0xb5a1('0x108'))['format'](_0xb5a1('0xff')),'ContactId':_0x47cc86[_0xb5a1('0xd8')],'ListId':_0x47cc86[_0xb5a1('0xd9')],'VoiceQueueId':_0x47cc86[_0xb5a1('0xdb')]||undefined,'CampaignId':_0x47cc86['CampaignId']||undefined})['catch'](loggerCatch(_0xb5a1('0x1ac')));break;case 0x0:if(_0x47cc86[_0xb5a1('0x106')]>=_0x267b05['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this[_0xb5a1('0xc8')]({'active':![],'countnosuchnumberretry':_0x47cc86[_0xb5a1('0x106')]+=0x1,'scheduledat':moment()[_0xb5a1('0xfd')](_0x267b05[_0xb5a1('0x1ad')],_0xb5a1('0x108'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x47cc86[_0xb5a1('0xd8')],'ListId':_0x47cc86['ListId'],'VoiceQueueId':_0x47cc86[_0xb5a1('0xdb')]||undefined,'CampaignId':_0x47cc86[_0xb5a1('0xdc')]||undefined})['catch'](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x47cc86[_0xb5a1('0xf5')]>=_0x267b05[_0xb5a1('0x11e')]-0x1){return!![];}this[_0xb5a1('0xc8')]({'active':![],'countdropretry':_0x47cc86[_0xb5a1('0xf5')]+=0x1,'scheduledat':moment()[_0xb5a1('0xfd')](_0x267b05[_0xb5a1('0x11f')],_0xb5a1('0x108'))[_0xb5a1('0x7d')](_0xb5a1('0xff')),'ContactId':_0x47cc86[_0xb5a1('0xd8')],'ListId':_0x47cc86[_0xb5a1('0xd9')],'VoiceQueueId':_0x47cc86['VoiceQueueId']||undefined,'CampaignId':_0x47cc86[_0xb5a1('0xdc')]||undefined})[_0xb5a1('0xb9')](loggerCatch(_0xb5a1('0x120')));break;case 0xb:if(_0x47cc86[_0xb5a1('0xf6')]>=_0x267b05['dialAbandonedMaxRetry']-0x1){return!![];}this[_0xb5a1('0xc8')]({'active':![],'countabandonedretry':_0x47cc86[_0xb5a1('0xf6')]+=0x1,'scheduledat':moment()[_0xb5a1('0xfd')](_0x267b05[_0xb5a1('0x128')],_0xb5a1('0x108'))['format'](_0xb5a1('0xff')),'ContactId':_0x47cc86[_0xb5a1('0xd8')],'ListId':_0x47cc86[_0xb5a1('0xd9')],'VoiceQueueId':_0x47cc86[_0xb5a1('0xdb')]||undefined,'CampaignId':_0x47cc86[_0xb5a1('0xdc')]||undefined})[_0xb5a1('0xb9')](loggerCatch(_0xb5a1('0x129')));break;case 0x13:if(_0x47cc86[_0xb5a1('0xf7')]>=_0x267b05[_0xb5a1('0xfb')]-0x1){return!![];}this[_0xb5a1('0xc8')]({'active':![],'countmachineretry':_0x47cc86[_0xb5a1('0xf7')]+=0x1,'scheduledat':moment()[_0xb5a1('0xfd')](_0x267b05[_0xb5a1('0xfe')],_0xb5a1('0x108'))[_0xb5a1('0x7d')](_0xb5a1('0xff')),'ContactId':_0x47cc86[_0xb5a1('0xd8')],'ListId':_0x47cc86[_0xb5a1('0xd9')],'VoiceQueueId':_0x47cc86[_0xb5a1('0xdb')]||undefined,'CampaignId':_0x47cc86[_0xb5a1('0xdc')]||undefined})[_0xb5a1('0xb9')](loggerCatch(_0xb5a1('0x109')));break;case 0x14:if(_0x47cc86[_0xb5a1('0xf8')]>=_0x267b05['dialAgentRejectMaxRetry']-0x1){return!![];}this[_0xb5a1('0xc8')]({'active':![],'countagentrejectretry':_0x47cc86[_0xb5a1('0xf8')]+=0x1,'scheduledat':moment()['add'](_0x267b05[_0xb5a1('0x1ae')],_0xb5a1('0x108'))['format'](_0xb5a1('0xff')),'ContactId':_0x47cc86['ContactId'],'ListId':_0x47cc86[_0xb5a1('0xd9')],'VoiceQueueId':_0x47cc86[_0xb5a1('0xdb')]||undefined,'CampaignId':_0x47cc86[_0xb5a1('0xdc')]||undefined})[_0xb5a1('0xb9')](loggerCatch(_0xb5a1('0x1af')));break;default:return!![];}};Dialer[_0xb5a1('0x1d')]['callProgressDetecting']=function(_0x8a7962,_0x6d2af4,_0x498772){var _0x27208d=this;var _0x32613e=new History(_0x8a7962);return new BPromise(function(_0x1d5f0b,_0x4f7c66){if(_['isUndefined'](_0x6d2af4)&&typeof _0x6d2af4!==_0xb5a1('0x171')){return _0x4f7c66(msgResponse(_0xb5a1('0x1b0'),_0xb5a1('0x148'),_0xb5a1('0x1b1')));}if(_[_0xb5a1('0x44')](_0x498772)&&typeof _0x498772!==_0xb5a1('0x171')){return _0x4f7c66(msgResponse(_0xb5a1('0x1b0'),'Failure','evt\x20is\x20undefine'));}switch(_0x498772['reason']){case'0':_0x6d2af4[_0xb5a1('0x6b')]+=0x1;_0x32613e[_0xb5a1('0xea')]=0x0;_0x32613e[_0xb5a1('0xaf')]=_0xb5a1('0x1b2');_0x32613e[_0xb5a1('0x106')]+=0x1;_0x32613e[_0xb5a1('0x103')]+=0x1;ami['emit'](_0xb5a1('0x1b3'),ut[_0xb5a1('0xf3')](_0x8a7962,_0xb5a1('0x1b4')));_0x27208d[_0xb5a1('0xd2')](_0x32613e)[_0xb5a1('0xb9')](loggerCatch(_0xb5a1('0x104')));if(_0x27208d[_0xb5a1('0x1a3')](0x0,_0x8a7962,_0x6d2af4)){if(_0x32613e[_0xb5a1('0x106')]>=_0x6d2af4['dialNoSuchNumberMaxRetry']){_0x27208d[_0xb5a1('0x107')](_0x32613e,_0x1d5f0b,_0x4f7c66,_0xb5a1('0x1b5'));}else{_0x27208d['stateGlobal'](_0x32613e,_0x1d5f0b,_0x4f7c66,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x6d2af4['outboundNoAnswerCallsDay']+=0x1;_0x32613e[_0xb5a1('0xea')]=0x3;_0x32613e[_0xb5a1('0xaf')]=_0xb5a1('0x1b6');_0x32613e['countnoanswerretry']+=0x1;_0x32613e[_0xb5a1('0x103')]+=0x1;ami['emit'](_0xb5a1('0x1b7'),ut[_0xb5a1('0xf3')](_0x8a7962,_0xb5a1('0x1b8')));_0x27208d[_0xb5a1('0xd2')](_0x32613e)[_0xb5a1('0xb9')](loggerCatch(_0xb5a1('0x1b9')));if(_0x27208d[_0xb5a1('0x1a3')](0x3,_0x8a7962,_0x6d2af4)){if(_0x32613e[_0xb5a1('0xf4')]>=_0x6d2af4['dialNoAnswerMaxRetry']){_0x27208d[_0xb5a1('0x107')](_0x32613e,_0x1d5f0b,_0x4f7c66,_0xb5a1('0x1ba'));}else{_0x27208d['stateGlobal'](_0x32613e,_0x1d5f0b,_0x4f7c66,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x6d2af4[_0xb5a1('0x67')]+=0x1;_0x32613e['state']=0x5;_0x32613e['statedesc']=_0xb5a1('0x1bb');_0x32613e[_0xb5a1('0x105')]+=0x1;_0x32613e[_0xb5a1('0x103')]+=0x1;ami[_0xb5a1('0x54')](_0xb5a1('0x1bc'),ut['buildObj'](_0x8a7962,_0xb5a1('0x1bd')));_0x27208d['createHistory'](_0x32613e)['catch'](loggerCatch(_0xb5a1('0x1be')));if(_0x27208d['checkRetriveMax'](0x5,_0x8a7962,_0x6d2af4)){if(_0x32613e['countbusyretry']>=_0x6d2af4[_0xb5a1('0x1a8')]){_0x27208d[_0xb5a1('0x107')](_0x32613e,_0x1d5f0b,_0x4f7c66,'reason\x205\x20busy');}else{_0x27208d['stateGlobal'](_0x32613e,_0x1d5f0b,_0x4f7c66,'reason\x205\x20busy');}}break;case'8':_0x6d2af4['outboundCongestionCallsDay']+=0x1;_0x32613e['state']=0x8;_0x32613e[_0xb5a1('0xaf')]=_0xb5a1('0x1bf');_0x32613e[_0xb5a1('0x1a4')]+=0x1;_0x32613e['countglobal']+=0x1;ami[_0xb5a1('0x54')]('custom:agentcongestion',ut[_0xb5a1('0xf3')](_0x8a7962,_0xb5a1('0x1c0')));_0x27208d[_0xb5a1('0xd2')](_0x32613e)[_0xb5a1('0xb9')](loggerCatch(_0xb5a1('0x1c1')));if(_0x27208d[_0xb5a1('0x1a3')](0x8,_0x8a7962,_0x6d2af4)){if(_0x32613e['countcongestionretry']>=_0x6d2af4['dialCongestionMaxRetry']){_0x27208d[_0xb5a1('0x107')](_0x32613e,_0x1d5f0b,_0x4f7c66,_0xb5a1('0x1c2'));}else{_0x27208d[_0xb5a1('0xfa')](_0x32613e,_0x1d5f0b,_0x4f7c66,_0xb5a1('0x1c2'));}}break;case'11':_0x6d2af4[_0xb5a1('0x1c3')]+=0x1;_0x32613e['state']=0xb;_0x32613e[_0xb5a1('0xaf')]=_0xb5a1('0x125');_0x32613e[_0xb5a1('0xf6')]+=0x1;_0x32613e[_0xb5a1('0x103')]+=0x1;_0x27208d['createHistory'](_0x32613e)[_0xb5a1('0xb9')](loggerCatch(_0xb5a1('0x12a')));if(_0x27208d[_0xb5a1('0x1a3')](0xb,_0x8a7962,_0x6d2af4)){if(_0x32613e[_0xb5a1('0xf6')]>=_0x6d2af4[_0xb5a1('0x127')]){_0x27208d[_0xb5a1('0x107')](_0x32613e,_0x1d5f0b,_0x4f7c66,_0xb5a1('0x1c4'));}else{_0x27208d[_0xb5a1('0xfa')](_0x32613e,_0x1d5f0b,_0x4f7c66,_0xb5a1('0x1c4'));}}break;case'20':_0x6d2af4['outboundRejectCallsDay']+=0x1;_0x32613e[_0xb5a1('0xea')]=0x14;_0x32613e['statedesc']=_0xb5a1('0x1c5');_0x32613e[_0xb5a1('0xf8')]+=0x1;_0x32613e['countglobal']+=0x1;ami[_0xb5a1('0x54')](_0xb5a1('0x1c6'),ut[_0xb5a1('0xf3')](_0x8a7962,'agentreject'));_0x27208d[_0xb5a1('0xd2')](_0x32613e)[_0xb5a1('0xb9')](loggerCatch(_0xb5a1('0x1c7')));if(_0x27208d[_0xb5a1('0x1a3')](0x14,_0x8a7962,_0x6d2af4)){if(_0x32613e[_0xb5a1('0xf8')]>=_0x6d2af4[_0xb5a1('0x1c8')]){_0x27208d[_0xb5a1('0x107')](_0x32613e,_0x1d5f0b,_0x4f7c66,'reason\x2020\x20agentreject');}else{_0x27208d['stateGlobal'](_0x32613e,_0x1d5f0b,_0x4f7c66,'reason\x2020\x20agentreject');}}break;default:_0x6d2af4[_0xb5a1('0x6f')]+=0x1;_0x32613e[_0xb5a1('0xea')]=0xc;_0x32613e[_0xb5a1('0xaf')]=_0x498772[_0xb5a1('0x110')];_0x27208d[_0xb5a1('0xd2')](_0x32613e)[_0xb5a1('0xb9')](loggerCatch(_0xb5a1('0x1c9')));if(_0x27208d['checkRetriveMax'](_0x498772[_0xb5a1('0x110')],_0x8a7962,_0x6d2af4)){if(_0x32613e[_0xb5a1('0x105')]+_0x32613e[_0xb5a1('0x1a4')]+_0x32613e[_0xb5a1('0xf4')]+_0x32613e[_0xb5a1('0x106')]+_0x32613e[_0xb5a1('0xf5')]+_0x32613e['countabandonedretry']+_0x32613e[_0xb5a1('0xf7')]+_0x32613e[_0xb5a1('0xf8')]>=_0x6d2af4['dialGlobalMaxRetry']){_0x27208d[_0xb5a1('0xfa')](_0x32613e,_0x1d5f0b,_0x4f7c66,_0x498772['reason']);}else{_0x27208d['createStateFinal'](_0x32613e,_0x1d5f0b,_0x4f7c66,_0x498772[_0xb5a1('0x110')]);}}}});};Dialer[_0xb5a1('0x1d')][_0xb5a1('0xfa')]=function(_0x576b09,_0x5b4825,_0x574007,_0x4265ba){var _0xb177e=new Final(_0x576b09);_0xb177e[_0xb5a1('0xea')]=0xf;_0xb177e[_0xb5a1('0xaf')]=_0xb5a1('0x1ca');this[_0xb5a1('0x107')](_0xb177e,_0x5b4825,_0x574007,_0x4265ba);};Dialer[_0xb5a1('0x1d')][_0xb5a1('0x107')]=function(_0x9f2f2c,_0x41462c,_0x12d0cb,_0xa8534b){this['moveContactManagedDialer'](_0x9f2f2c)['then'](function(){return _0x41462c(msgResponse(_0xb5a1('0x1b0'),_0xb5a1('0xdf'),_0xa8534b));})['catch'](function(){return _0x12d0cb(msgResponse(_0xb5a1('0x1cb'),_0xb5a1('0x148'),_0xb5a1('0x1cc')));});};Dialer[_0xb5a1('0x1d')][_0xb5a1('0x9')]=function(_0x3b495f){var _0x6ca943=_0x3b495f[_0xb5a1('0x1cd')]/0x64;var _0xddc4dd=_0x3b495f[_0xb5a1('0x6a')]/(_0x3b495f[_0xb5a1('0x6a')]+_0x3b495f[_0xb5a1('0xe9')]);var _0x10db50=Math[_0xb5a1('0x1ce')](_0x3b495f[_0xb5a1('0x1cf')]*(_0x3b495f[_0xb5a1('0x1d0')]/0x64));var _0x1a0fef=Math[_0xb5a1('0x1ce')](_0x3b495f[_0xb5a1('0x1cf')]*(_0x3b495f[_0xb5a1('0x1d1')]/0x64));var _0x33d1a0=_0x3b495f[_0xb5a1('0x59')]+_0x3b495f[_0xb5a1('0x5c')];var _0x4509bd=Math[_0xb5a1('0x1d2')](_0x3b495f[_0xb5a1('0x91')]*_0x3b495f['erlangAbandonmentRate']*_0x3b495f['predictiveIntervalHitRate']*_0x3b495f[_0xb5a1('0x75')]);if(_[_0xb5a1('0x44')](_0x3b495f['startProgressive'])){if(!_[_0xb5a1('0x44')](_0x3b495f[_0xb5a1('0x7b')])){_0x3b495f[_0xb5a1('0x7b')]=undefined;loggerPredictive['error']('[startMethodPredictive][StartProgressive]',_0xb5a1('0x1d3'));}if(!_['isUndefined'](_0x3b495f['handlePredictive'])){loggerPredictive['error']('[startMethodPredictive][StartProgressive]',_0xb5a1('0x1d4'));clearInterval(_0x3b495f['handlePredictive']);_0x3b495f[_0xb5a1('0x98')]=undefined;}_0x3b495f[_0xb5a1('0x2b')]=moment()[_0xb5a1('0x7d')](_0xb5a1('0xff'));loggerPredictive[_0xb5a1('0x83')](_0x3b495f[_0xb5a1('0x47')],_0xb5a1('0x1d5'),_0x3b495f[_0xb5a1('0x2b')]);this[_0xb5a1('0x15d')](_0x3b495f,0x1);}else if(ifInterval(_0x3b495f[_0xb5a1('0x1d6')],_0x3b495f[_0xb5a1('0x2b')])){this['handlePower'](_0x3b495f,0x1);loggerPredictiveCalls['info'](_0xb5a1('0x1d7'),_0x3b495f[_0xb5a1('0x2b')],_0x3b495f[_0xb5a1('0x47')]);_0x3b495f[_0xb5a1('0x91')]=0x0;_0x3b495f[_0xb5a1('0x73')]=0x0;}else if(_0x6ca943<_0xddc4dd&&_0x3b495f['dialPredictiveOptimization']===_0xb5a1('0x1d8')){freeVariablesPredictive(_0x3b495f);loggerPredictive[_0xb5a1('0x83')](_0xb5a1('0x1d9'),_0xb5a1('0x1da'),_0xddc4dd,'startProgressive',_0x3b495f['name']);}else if(_0x4509bd<_0x3b495f[_0xb5a1('0x73')]&&_0x3b495f['dialPredictiveOptimization']===_0xb5a1('0x1d8')){freeVariablesPredictive(_0x3b495f);loggerPredictive[_0xb5a1('0x83')](_0xb5a1('0x1db'),_0xb5a1('0x1dc'),_0x4509bd,_0xb5a1('0x1dd'),_0x3b495f['predictiveIntervalErlangCallsDroppedCalls'],_0xb5a1('0x2b'),_0x3b495f[_0xb5a1('0x47')]);}else if(!ifInterval(_0x3b495f[_0xb5a1('0x1d6')],_0x3b495f['startProgressive'])&&_[_0xb5a1('0x44')](_0x3b495f[_0xb5a1('0x7b')])&&!_[_0xb5a1('0x44')](_0x3b495f[_0xb5a1('0x2b')])){_0x3b495f[_0xb5a1('0x7b')]=moment()['format'](_0xb5a1('0xff'));loggerPredictive['info'](_0x3b495f[_0xb5a1('0x47')],_0xb5a1('0x1de'),_0x3b495f[_0xb5a1('0x7b')]);this[_0xb5a1('0xc5')](_0x3b495f[_0xb5a1('0x1d6')])[_0xb5a1('0x42')](this[_0xb5a1('0x1df')](_0x3b495f))['then'](mergeDataErlangB(_0x3b495f))[_0xb5a1('0x42')](this['startMethodPredictive'](_0x3b495f))[_0xb5a1('0xb9')](loggerCatchPredictive(_0xb5a1('0x1e0'),_0x3b495f));}else if(!ifInterval(_0x3b495f[_0xb5a1('0x1d6')],_0x3b495f['startPredictive'])){_0x3b495f[_0xb5a1('0x73')]=0x0;_0x3b495f[_0xb5a1('0x7b')]=moment()['format'](_0xb5a1('0xff'));loggerPredictive[_0xb5a1('0x83')](_0x3b495f[_0xb5a1('0x47')],_0xb5a1('0x1e1'),_0x3b495f[_0xb5a1('0x7b')]);clearInterval(_0x3b495f['handlePredictive']);_0x3b495f[_0xb5a1('0x98')]=undefined;this[_0xb5a1('0xc5')](_0x3b495f[_0xb5a1('0x1d6')])[_0xb5a1('0x42')](this[_0xb5a1('0x1df')](_0x3b495f))['then'](mergeDataErlangB(_0x3b495f))[_0xb5a1('0x42')](this['startMethodPredictive'](_0x3b495f))[_0xb5a1('0xb9')](loggerCatchPredictive(_0xb5a1('0x1e2'),_0x3b495f));}else if(_0x3b495f[_0xb5a1('0x1cf')]&&_0x33d1a0<_0x3b495f[_0xb5a1('0x1cf')]-_0x1a0fef){freeVariablesPredictive(_0x3b495f);loggerPredictive[_0xb5a1('0x83')](_0x3b495f[_0xb5a1('0x47')],_0xb5a1('0x1e3'),_0x33d1a0,_0xb5a1('0x1e4'),_0x3b495f['predictiveIntervalAvailable'],'-',_0x1a0fef,'=',_0x3b495f[_0xb5a1('0x1cf')]-_0x1a0fef,')');}else if(_0x3b495f['predictiveIntervalAvailable']&&_0x33d1a0>_0x3b495f['predictiveIntervalAvailable']+_0x10db50){freeVariablesPredictive(_0x3b495f);loggerPredictive[_0xb5a1('0x83')](_0x3b495f[_0xb5a1('0x47')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x33d1a0,_0xb5a1('0x1e5'),_0x3b495f[_0xb5a1('0x1cf')],'+',_0x10db50,'=',_0x3b495f[_0xb5a1('0x1cf')]+_0x10db50,')');}};Dialer[_0xb5a1('0x1d')][_0xb5a1('0x1df')]=function(_0x26b050){var _0x4a97f6=this;return function(_0x49099d){return new BPromise(function(_0x52fd56,_0x202846){_['merge'](_0x26b050,_0x49099d[0x0]);if(checkGetDataPredictive(_0x49099d[0x0])){var _0x4763de=_0x26b050[_0xb5a1('0x1cf')]=_0x26b050['talking']+_0x26b050[_0xb5a1('0x59')];var _0x5bd0d9=_0x26b050[_0xb5a1('0x1d6')]*0x3c;var _0x39c8c6=_0x49099d[0x0][_0xb5a1('0x71')]+_0x49099d[0x0][_0xb5a1('0x89')];var _0x54f2c8=(_0x49099d[0x0][_0xb5a1('0x70')]+_0x49099d[0x0][_0xb5a1('0x72')]+_0x49099d[0x0][_0xb5a1('0x1e6')])/_0x49099d[0x0]['predictiveIntervalTotalCalls'];_0x26b050[_0xb5a1('0x74')]=_0x54f2c8>0x0?_0x54f2c8:0x1;switch(_0x26b050[_0xb5a1('0x1e7')]){case _0xb5a1('0x1d8'):var _0x8d1484=_0x26b050[_0xb5a1('0x1cd')]/0x64;return _0x4a97f6[_0xb5a1('0x1e8')](_0x4763de,_0x5bd0d9,_0x39c8c6,_0x54f2c8,_0x8d1484)[_0xb5a1('0x42')](function(_0x43b53f){return _0x52fd56(_0x43b53f);});case _0xb5a1('0x1e9'):var _0x370c6a=_0x26b050[_0xb5a1('0x1cd')]/0x64;return _0x4a97f6[_0xb5a1('0x1ea')](_0x4763de,_0x5bd0d9,_0x39c8c6,_0x54f2c8,_0x370c6a)[_0xb5a1('0x42')](function(_0x493a43){return _0x52fd56(_0x493a43);});default:return _0x202846(msgResponse(_0xb5a1('0x1eb'),_0xb5a1('0x148'),_0xb5a1('0x1ec')));}}else{return _0x202846(msgResponse(_0xb5a1('0x1eb'),_0xb5a1('0x148'),_0xb5a1('0x1ed')));}});};};Dialer['prototype'][_0xb5a1('0x1ee')]=function(_0x38d4c6){var _0x5c4c1d=this;return function(_0x3986d5){return new BPromise(function(_0x5ac0fe,_0x81b0c3){_[_0xb5a1('0x95')](_0x38d4c6,_0x3986d5[0x0]);if(checkGetDataPredictive(_0x3986d5[0x0])){loggerPredictive[_0xb5a1('0x83')](JSON[_0xb5a1('0x50')](_0x3986d5[0x0]));if(_0x38d4c6[_0xb5a1('0x1e7')]==='dropRate'){return _0x5c4c1d[_0xb5a1('0xce')](_0x38d4c6['id'])[_0xb5a1('0x42')](function(_0xe78ad1){var _0x4e1ead=_0x38d4c6[_0xb5a1('0x1ef')]-_0xe78ad1[0x0][_0xb5a1('0x1f0')];var _0x492f71=_0x38d4c6['dialPredictiveInterval']*0x3c;var _0x50c4bf=_0x3986d5[0x0][_0xb5a1('0x71')]+_0x3986d5[0x0]['predictiveIntervalAvgHoldtime'];var _0x480713=(_0x3986d5[0x0][_0xb5a1('0x70')]+_0x3986d5[0x0][_0xb5a1('0x72')]+_0x3986d5[0x0][_0xb5a1('0x1e6')])/_0x3986d5[0x0][_0xb5a1('0x77')];var _0x5ae365=_0x38d4c6[_0xb5a1('0x1cd')]/0x64;_0x38d4c6[_0xb5a1('0x76')]=_0xe78ad1[0x0][_0xb5a1('0x1f0')]||0x0;_0x38d4c6[_0xb5a1('0x74')]=_0x480713>0x0?_0x480713:0x1;return _0x5c4c1d[_0xb5a1('0x1e8')](_0x4e1ead,_0x492f71,_0x50c4bf,_0x480713,_0x5ae365);})[_0xb5a1('0x42')](function(_0x34f936){return _0x5ac0fe(_0x34f936);})[_0xb5a1('0xb9')](function(_0x212615){return _0x81b0c3(msgResponse(_0xb5a1('0x1f1'),_0xb5a1('0x148'),JSON['stringify'](_0x212615)));});}if(_0x38d4c6[_0xb5a1('0x1e7')]===_0xb5a1('0x1e9')){return _0x5c4c1d[_0xb5a1('0xce')](_0x38d4c6['id'])[_0xb5a1('0x42')](function(_0x22cbfa){var _0x141707=_0x38d4c6[_0xb5a1('0x1ef')]-_0x22cbfa[0x0][_0xb5a1('0x1f0')];var _0xab73be=_0x38d4c6[_0xb5a1('0x1d6')]*0x3c;var _0x1d31c8=_0x3986d5[0x0][_0xb5a1('0x71')]+_0x3986d5[0x0][_0xb5a1('0x89')];var _0x4e1e35=(_0x3986d5[0x0]['predictiveIntervalAnsweredCalls']+_0x3986d5[0x0][_0xb5a1('0x72')]+_0x3986d5[0x0][_0xb5a1('0x1e6')])/_0x3986d5[0x0][_0xb5a1('0x77')];var _0x43a279=_0x38d4c6[_0xb5a1('0x1cd')]/0x64;_0x38d4c6['predictiveIntervalPauses']=_0x22cbfa[0x0]['outboundQueuePauses']||0x0;_0x38d4c6['predictiveIntervalHitRate']=_0x4e1e35>0x0?_0x4e1e35:0x1;return _0x5c4c1d[_0xb5a1('0x1ea')](_0x141707,_0xab73be,_0x1d31c8,_0x4e1e35,_0x43a279);})[_0xb5a1('0x42')](function(_0x1d7acb){return _0x5ac0fe(_0x1d7acb);})[_0xb5a1('0xb9')](function(_0x2b0442){return _0x81b0c3(msgResponse('[CatchErlangB]',_0xb5a1('0x148'),JSON['stringify'](_0x2b0442)));});}}else{return _0x81b0c3(msgResponse(_0xb5a1('0x1eb'),_0xb5a1('0x148'),_0xb5a1('0x1ed')));}});};};Dialer[_0xb5a1('0x1d')]['startMethodPredictive']=function(_0x11bce3){var _0xb82cd8=this;return function(){var _0x2c4ae7=0x0;var _0x4d81a4=Math['floor'](_0x11bce3[_0xb5a1('0x93')]*0x3e8);if(_0x4d81a4>0x0){_0x4d81a4=_0x4d81a4<0x64?0x64:_0x4d81a4;loggerPredictive[_0xb5a1('0x83')](_0x11bce3[_0xb5a1('0x47')],'one\x20call\x20every:',_0x4d81a4,_0xb5a1('0x51'));_0x11bce3['handlePredictive']=setInterval(function(){_0xb82cd8[_0xb5a1('0x98')](_0x11bce3);loggerPredictiveCalls[_0xb5a1('0x83')](_0xb5a1('0x1f2'),_0x2c4ae7+=0x1);},_0x4d81a4);}else{loggerPredictive[_0xb5a1('0x83')](_0x11bce3['name'],_0xb5a1('0x1f3'));}};};Dialer[_0xb5a1('0x1d')][_0xb5a1('0x1f4')]=function(_0x2cdd71,_0x299b0c){var _0x558562=this;return function(_0x519a65){if(_['isEmpty'](_0x519a65)){if(_[_0xb5a1('0xb5')](_0x299b0c[_0xb5a1('0xda')])||!_0x299b0c[_0xb5a1('0x1f5')]){if(_0x2cdd71[_0xb5a1('0x63')]==='booked'){_0x2cdd71['queueStatusComplete']=_[_0xb5a1('0x44')](_0x2cdd71[_0xb5a1('0x130')])?!![]:_0x2cdd71[_0xb5a1('0x130')];var _0x330bae=uuid['v4']();_0x558562[_0xb5a1('0x28')][_0x330bae]=new Action(_0x2cdd71,_0x299b0c,_0x330bae);loggerBooked[_0xb5a1('0x83')]('[booked][checkContactBlack]',_0x330bae,_0xb5a1('0x1f6'),JSON[_0xb5a1('0x50')](_0x2cdd71[_0xb5a1('0x130')]),_0xb5a1('0x1f7'),_0x2cdd71[_0xb5a1('0x47')]);if(_0x2cdd71[_0xb5a1('0x130')]){_0x2cdd71['queueStatusComplete']=![];_0x558562[_0xb5a1('0x2c')][_0x558562['actions'][_0x330bae][_0xb5a1('0xbb')]]=[];ami['Action']({'actionid':_0x330bae,'action':_0xb5a1('0x1f8'),'queue':_0x2cdd71[_0xb5a1('0x47')]})['catch'](function(){_0x558562[_0xb5a1('0xbd')](_0x2cdd71);_0x558562[_0xb5a1('0xc8')]({'active':![],'ContactId':_0x558562[_0xb5a1('0x28')][_0x330bae][_0xb5a1('0xd8')],'ListId':_0x558562['actions'][_0x330bae][_0xb5a1('0xd9')],'VoiceQueueId':_0x558562[_0xb5a1('0x28')][_0x330bae]['VoiceQueueId']||undefined,'CampaignId':_0x558562[_0xb5a1('0x28')][_0x330bae][_0xb5a1('0xdc')]||undefined})[_0xb5a1('0xb9')](loggerCatch(_0xb5a1('0x1f9')));delete _0x558562[_0xb5a1('0x28')][_0x330bae];});}else{loggerBooked['info']('[booked][checkContactBlack][else]',JSON[_0xb5a1('0x50')](_0x2cdd71[_0xb5a1('0x130')]),_0xb5a1('0x1f7'),_0x2cdd71[_0xb5a1('0x47')]);_0x558562[_0xb5a1('0xbd')](_0x2cdd71);_0x558562[_0xb5a1('0xc8')]({'active':![],'ContactId':_0x558562[_0xb5a1('0x28')][_0x330bae]['ContactId'],'ListId':_0x558562['actions'][_0x330bae][_0xb5a1('0xd9')],'VoiceQueueId':_0x558562[_0xb5a1('0x28')][_0x330bae][_0xb5a1('0xdb')]||undefined,'CampaignId':_0x558562[_0xb5a1('0x28')][_0x330bae][_0xb5a1('0xdc')]||undefined})['catch'](loggerCatch(_0xb5a1('0x1f9')));delete _0x558562[_0xb5a1('0x28')][_0x330bae];}}else{return _0x558562[_0xb5a1('0x1fa')](_0x2cdd71,_0x299b0c);}}else{if(getDiff(_0x299b0c[_0xb5a1('0x1fb')])<_0x2cdd71[_0xb5a1('0x1fc')]*0x3c){if(_0x299b0c[_0xb5a1('0x163')]&&!_0x299b0c[_0xb5a1('0x163')][_0xb5a1('0x1fd')]){_0x558562[_0xb5a1('0x21')][_0xb5a1('0x132')](_0x299b0c['id'])[_0xb5a1('0x20')](function(){_0x558562[_0xb5a1('0xbd')](_0x2cdd71);});}else{_0x558562[_0xb5a1('0x1fe')]({'active':![]},_0x299b0c['id'],0x1)[_0xb5a1('0x20')](function(){_0x558562['updateOriginated'](_0x2cdd71);});}}else{_0x2cdd71[_0xb5a1('0x6d')]+=0x1;_0x558562[_0xb5a1('0xbd')](_0x2cdd71);if(_0x2cdd71[_0xb5a1('0x1ff')]){_0x558562[_0xb5a1('0xc8')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x299b0c['ContactId'],'ListId':_0x299b0c[_0xb5a1('0xd9')],'VoiceQueueId':_0x299b0c['VoiceQueueId']||undefined,'CampaignId':_0x299b0c[_0xb5a1('0xdc')]||undefined})[_0xb5a1('0xb9')](loggerCatch(_0xb5a1('0x200')));_0x558562['createHistory'](createObjHistory(_0x2cdd71,_0x299b0c,_0xb5a1('0x201'),0x17,_0xb5a1('0x202')))[_0xb5a1('0xb9')](loggerCatch(_0xb5a1('0x203')));}else{_0x558562[_0xb5a1('0xd6')](createObjHistory(_0x2cdd71,_0x299b0c,_0xb5a1('0x204'),0x16,_0xb5a1('0x205')),'[Originate][HistoryRecallClose][historyCatch]',_0xb5a1('0x206'));}}}}else{_0x2cdd71['outboundBlacklistCallsDay']+=0x1;_0x558562[_0xb5a1('0xd6')](createObjHistory(_0x2cdd71,_0x299b0c,_0xb5a1('0x207'),0xd,_0xb5a1('0x208')),_0xb5a1('0x209'),_0xb5a1('0x20a'));throw _0xb5a1('0x20b');}};};Dialer[_0xb5a1('0x1d')][_0xb5a1('0x164')]=function(_0x1c0e58){var _0x4a874a=this;var _0x5ba9a6=_0x1c0e58[_0xb5a1('0x20c')]-_0x1c0e58['originated']-_0x1c0e58[_0xb5a1('0xca')];emitCampaignSummary(_0x1c0e58);if(_0x5ba9a6>0x0){if(_0x5ba9a6>this[_0xb5a1('0x26')]){_0x5ba9a6=this[_0xb5a1('0x26')];}_0x1c0e58[_0xb5a1('0xca')]+=_0x5ba9a6;this['getContactDialerIvr'](_0x1c0e58['id'],_0x5ba9a6,_0x1c0e58[_0xb5a1('0x20d')],_0x1c0e58)[_0xb5a1('0x42')](function(_0x36920e){_0x1c0e58[_0xb5a1('0xca')]-=_0x5ba9a6;_0x1c0e58[_0xb5a1('0xca')]=_0x1c0e58[_0xb5a1('0xca')]>0x0?_0x1c0e58[_0xb5a1('0xca')]:0x0;if(!checkContactEmpty(_0x36920e)){_0x1c0e58['message']='AVAILABLE_CONTACTS_FINISHED';logger[_0xb5a1('0x83')]('[getContactCampaign2][Empty]'+_0x1c0e58[_0xb5a1('0x47')]);}else{_0x1c0e58[_0xb5a1('0x78')]+=_0x36920e[_0xb5a1('0xa0')];_0x1c0e58['message']=_0xb5a1('0x20e');for(var _0x354870=0x0;_0x354870<_0x36920e['length'];_0x354870+=0x1){_0x1c0e58['ivrTotalCallsDays']+=0x1;if(_['isNil'](_0x36920e[_0x354870])||_[_0xb5a1('0xb5')](_0x36920e[_0x354870]['Contact'])||_['isNil'](_0x36920e[_0x354870]['Contact'][_0xb5a1('0x174')])){_0x4a874a['emptyContact'](_0xb5a1('0x20f'),_0x1c0e58,_0x36920e[_0x354870]);}else{_0x4a874a[_0xb5a1('0xc3')](_[_0xb5a1('0xd7')](_0x36920e[_0x354870],[_0xb5a1('0xdc'),_0xb5a1('0x210')]))[_0xb5a1('0x42')](_0x4a874a[_0xb5a1('0x1f4')](_0x1c0e58,_0x36920e[_0x354870]))['catch'](_0x4a874a['loggerHandler'](_0xb5a1('0x211'),_0x1c0e58));}}}})[_0xb5a1('0xb9')](loggerGetContactDialer('[getContactCampaign2]',_0x1c0e58,_0x5ba9a6));}};Dialer[_0xb5a1('0x1d')]['handlePower']=function(_0xdea9f1,_0x20c9b8){var _0x52bca8=this;var _0x400cd9=[];var _0x37c1f6=_0x20c9b8>=0x1?_0x20c9b8:0x1;if(_0xdea9f1['dialMethod']==='booked'){_0x37c1f6=0x1;}var _0x5b0606=Math[_0xb5a1('0x1d2')](_0xdea9f1[_0xb5a1('0x59')]*_0x37c1f6)-_0xdea9f1[_0xb5a1('0x78')]-_0xdea9f1[_0xb5a1('0xca')];emitVoiceQueueSummary(_0xdea9f1);if(_0xdea9f1[_0xb5a1('0x212')]>0x0){var _0x1d3fcf=_0xdea9f1[_0xb5a1('0x212')]-_0xdea9f1['originated']-_0xdea9f1['talking']-_0xdea9f1['temp']-_0xdea9f1[_0xb5a1('0x5a')];if(_0x5b0606>_0x1d3fcf){_0x5b0606=_0x1d3fcf;}}if(_0x5b0606>0x0){if(_0xdea9f1[_0xb5a1('0x63')]===_0xb5a1('0x213')){_0x5b0606=0x1;}if(_0x5b0606>this['maxNumberOriginate']){_0x5b0606=this[_0xb5a1('0x26')];}_0xdea9f1[_0xb5a1('0xca')]+=_0x5b0606;for(var _0x158bb4 in this[_0xb5a1('0x24')]){if(typeof this['agents'][_0x158bb4]!==_0xb5a1('0xa1')){if(this[_0xb5a1('0x24')][_0x158bb4]['state']===_0xb5a1('0x214')&&this[_0xb5a1('0x24')][_0x158bb4]['status']===_0xb5a1('0x215')){_0x400cd9['push'](this[_0xb5a1('0x24')][_0x158bb4]['id']);}}}this[_0xb5a1('0x216')](_0xdea9f1['id'],_0x400cd9,_0x5b0606,_0xdea9f1['dialOrderByScheduledAt'],_0xdea9f1)[_0xb5a1('0x42')](function(_0x1ce3be){_0xdea9f1[_0xb5a1('0xca')]-=_0x5b0606;_0xdea9f1[_0xb5a1('0xca')]=_0xdea9f1['temp']>0x0?_0xdea9f1[_0xb5a1('0xca')]:0x0;if(!checkContactEmpty(_0x1ce3be)){_0x52bca8[_0xb5a1('0xbe')](_0xdea9f1)[_0xb5a1('0x42')](sendMessageReschedule(_0xdea9f1))[_0xb5a1('0xb9')](loggerCatch('[countReScheduled]\x20'));}else{_0xdea9f1[_0xb5a1('0x78')]+=_0x1ce3be[_0xb5a1('0xa0')];_0xdea9f1['message']=_0xdea9f1[_0xb5a1('0x63')]===_0xb5a1('0x213')?_0xb5a1('0x17d'):_0xb5a1('0x20e');for(var _0x6b72c4=0x0;_0x6b72c4<_0x1ce3be[_0xb5a1('0xa0')];_0x6b72c4+=0x1){if(_[_0xb5a1('0xb5')](_0x1ce3be[_0x6b72c4])||_[_0xb5a1('0xb5')](_0x1ce3be[_0x6b72c4][_0xb5a1('0x173')])||_[_0xb5a1('0xb5')](_0x1ce3be[_0x6b72c4][_0xb5a1('0x173')]['phone'])){_0x52bca8['emptyContact']('[actionOriginate]\x20',_0xdea9f1,_0x1ce3be[_0x6b72c4]);}else{_0x52bca8[_0xb5a1('0xc1')](_[_0xb5a1('0xd7')](_0x1ce3be[_0x6b72c4],[_0xb5a1('0xdb'),_0xb5a1('0x210')]))['then'](_0x52bca8[_0xb5a1('0x1f4')](_0xdea9f1,_0x1ce3be[_0x6b72c4]))[_0xb5a1('0xb9')](_0x52bca8[_0xb5a1('0x217')](_0xb5a1('0x20f'),_0xdea9f1));}}}})['catch'](loggerGetContactDialer(_0xb5a1('0x218'),_0xdea9f1,_0x5b0606));}};Dialer[_0xb5a1('0x1d')][_0xb5a1('0x98')]=function(_0x110a3e){if(_0x110a3e[_0xb5a1('0x212')]>0x0){var _0x344861=_0x110a3e[_0xb5a1('0x212')]-_0x110a3e[_0xb5a1('0x78')]-_0x110a3e[_0xb5a1('0x5c')];if(_0x344861>0x0){this['tryOriginatePredictive'](_0x110a3e);}else{loggerPredictiveCalls['info'](_0xb5a1('0x219'));}}else{this[_0xb5a1('0x21a')](_0x110a3e);}};Dialer[_0xb5a1('0x1d')][_0xb5a1('0x21a')]=function(_0x15b6b5){var _0x5c8710=this;var _0x151ffe=[];_0x15b6b5[_0xb5a1('0x78')]+=0x1;for(var _0x579075 in this[_0xb5a1('0x24')]){if(typeof this[_0xb5a1('0x24')][_0x579075]!==_0xb5a1('0xa1')){if(this[_0xb5a1('0x24')][_0x579075][_0xb5a1('0xea')]===_0xb5a1('0x214')&&this[_0xb5a1('0x24')][_0x579075][_0xb5a1('0xb7')]===_0xb5a1('0x215')){_0x151ffe['push'](this[_0xb5a1('0x24')][_0x579075]['id']);}}}this[_0xb5a1('0x216')](_0x15b6b5['id'],_0x151ffe,0x1,_0x15b6b5[_0xb5a1('0x20d')],_0x15b6b5)[_0xb5a1('0x42')](function(_0x4e93d9){if(!checkContactEmpty(_0x4e93d9)){checkContactLowerLimitOriginate(_0x15b6b5,0x1,0x0);_0x5c8710[_0xb5a1('0xbe')](_0x15b6b5)['then'](sendMessageReschedule(_0x15b6b5))[_0xb5a1('0xb9')](loggerCatch('[countReScheduled]\x20'));}else{_0x15b6b5['message']='RUNNING';if(_['isNil'](_0x4e93d9[0x0])||_[_0xb5a1('0xb5')](_0x4e93d9[0x0]['Contact'])||_[_0xb5a1('0xb5')](_0x4e93d9[0x0][_0xb5a1('0x173')][_0xb5a1('0x174')])){_0x5c8710['emptyContact'](_0xb5a1('0x20f'),_0x15b6b5,_0x4e93d9[0x0]);}else{_0x5c8710[_0xb5a1('0xc1')](_[_0xb5a1('0xd7')](_0x4e93d9[0x0],[_0xb5a1('0xdb'),_0xb5a1('0x210')]))['then'](_0x5c8710[_0xb5a1('0x1f4')](_0x15b6b5,_0x4e93d9[0x0]))['catch'](_0x5c8710[_0xb5a1('0x217')](_0xb5a1('0x21b'),_0x15b6b5));}}})[_0xb5a1('0xb9')](loggerGetContactDialer(_0xb5a1('0x21c'),_0x15b6b5,0x1));emitVoiceQueueSummary(_0x15b6b5);};Dialer[_0xb5a1('0x1d')][_0xb5a1('0x1e8')]=function(_0x5ca7a5,_0x3f4133,_0x7db0ed,_0x2107bc,_0x376f45,_0x29ff7f){loggerPredictive['info'](_0xb5a1('0x21d'));loggerPredictive[_0xb5a1('0x83')]('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',_0x5ca7a5);loggerPredictive['info']('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3f4133);loggerPredictive[_0xb5a1('0x83')]('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',_0x7db0ed);loggerPredictive['info']('P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2107bc);loggerPredictive[_0xb5a1('0x83')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x376f45);loggerPredictive[_0xb5a1('0x83')]('---------------------------');return new BPromise(function(_0x56f367,_0x3128be){if(_0x5ca7a5<=0x0||isNaN(_0x5ca7a5)){return _0x3128be(msgResponse(_0xb5a1('0x21e'),'Error',_0xb5a1('0x21f')+_0x5ca7a5));}if(_0x7db0ed<=0x0||isNaN(_0x7db0ed)){return _0x3128be(msgResponse(_0xb5a1('0x21e'),_0xb5a1('0x4f'),_0xb5a1('0x220')+_0x7db0ed));}if(_0x2107bc<=0x0||isNaN(_0x2107bc)){return _0x3128be(msgResponse(_0xb5a1('0x21e'),_0xb5a1('0x4f'),_0xb5a1('0x221')+_0x2107bc));}if(_0x3f4133<=0x0||isNaN(_0x3f4133)){return _0x3128be(msgResponse(_0xb5a1('0x21e'),_0xb5a1('0x4f'),_0xb5a1('0x222')+_0x3f4133));}if(_0x376f45<=0x0||isNaN(_0x376f45)){return _0x3128be(msgResponse('[abandonmentRate]',_0xb5a1('0x4f'),_0xb5a1('0x223')+_0x376f45));}_0x29ff7f=_0x29ff7f||0x0;var _0x4a6592=0x1/_0x7db0ed;var _0x260ed8=0x0;var _0x8caa35=0x0;var _0x1c478d=0x0;var _0x12ef23=0x0;for(var _0x57322e=0x0;_0x1c478d<_0x376f45;_0x57322e+=0x1){_0x8caa35=_0x57322e/_0x3f4133;_0x260ed8=(_0x2107bc*_0x8caa35+_0x29ff7f)/_0x4a6592;_0x1c478d=erlangb(_0x260ed8,_0x5ca7a5);_0x12ef23=_0x260ed8/_0x5ca7a5*(0x1-erlangb(_0x260ed8,_0x5ca7a5));}return _0x56f367({'erlangCalls':_0x57322e,'erlangCallToSecond':_0x3f4133/_0x57322e,'erlangAbandonmentRate':_0x1c478d,'erlangBusyFactor':_0x12ef23});});};Dialer[_0xb5a1('0x1d')][_0xb5a1('0x1ea')]=function(_0x3e5cf5,_0x14e6b1,_0x4655ed,_0x2f5dad,_0x421baf,_0x31769f){loggerPredictive[_0xb5a1('0x83')](_0xb5a1('0x224'));loggerPredictive[_0xb5a1('0x83')](_0xb5a1('0x225'),_0x3e5cf5);loggerPredictive[_0xb5a1('0x83')](_0xb5a1('0x226'),_0x14e6b1);loggerPredictive[_0xb5a1('0x83')]('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',_0x4655ed);loggerPredictive[_0xb5a1('0x83')]('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',_0x2f5dad);loggerPredictive[_0xb5a1('0x83')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x421baf);loggerPredictive[_0xb5a1('0x83')](_0xb5a1('0x8b'));return new BPromise(function(_0x549bda,_0x18bcd2){if(_0x3e5cf5<=0x0||isNaN(_0x3e5cf5)){return _0x18bcd2(msgResponse(_0xb5a1('0x227'),'Error',_0xb5a1('0x21f')+_0x3e5cf5));}if(_0x4655ed<=0x0||isNaN(_0x4655ed)){return _0x18bcd2(msgResponse(_0xb5a1('0x227'),_0xb5a1('0x4f'),'Ts\x20=\x20'+_0x4655ed));}if(_0x2f5dad<=0x0||isNaN(_0x2f5dad)){return _0x18bcd2(msgResponse(_0xb5a1('0x227'),_0xb5a1('0x4f'),'p\x20=\x20'+_0x2f5dad));}if(_0x14e6b1<=0x0||isNaN(_0x14e6b1)){return _0x18bcd2(msgResponse(_0xb5a1('0x227'),'Error',_0xb5a1('0x222')+_0x14e6b1));}if(_0x421baf<=0x0||isNaN(_0x421baf)){return _0x18bcd2(msgResponse(_0xb5a1('0x227'),_0xb5a1('0x4f'),_0xb5a1('0x228')+_0x421baf));}_0x31769f=_0x31769f||0x0;var _0x53e5de=0x1/_0x4655ed;var _0x4decf1=0x0;var _0xa52251=0x0;var _0x5f1f68=0x0;var _0x2d4b91=0x0;for(var _0x1e89ed=0x0;_0x2d4b91<_0x421baf;_0x1e89ed+=0x1){_0xa52251=_0x1e89ed/_0x14e6b1;_0x4decf1=(_0x2f5dad*_0xa52251+_0x31769f)/_0x53e5de;_0x5f1f68=erlangb(_0x4decf1,_0x3e5cf5);_0x2d4b91=_0x4decf1/_0x3e5cf5*(0x1-erlangb(_0x4decf1,_0x3e5cf5));}return _0x549bda({'erlangCalls':_0x1e89ed,'erlangCallToSecond':_0x14e6b1/_0x1e89ed,'erlangAbandonmentRate':_0x5f1f68,'erlangBusyFactor':_0x2d4b91});});};module[_0xb5a1('0x229')]=Dialer;
\ No newline at end of file
+var _0x7537=['AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','erlangCalls','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','erlangBusyFactor','merge','getSeconds','debug','name','startProgressive\x20value\x20cleared','startPredictive','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','inspect','contactsRescheduled','message','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contacts','NO_AVAILABLE_CONTACTS','state','statedesc','endtime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','pick','Interval','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Intervals','isIVRCampaignActive','INACTIVE','isIVRCampaign','campaign:save','sendMessageOneNotActive','originated','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','is\x20disactive','[ifTime][Action]','Error','isTrunkReachable','active','SIP/%s','status','reachable','unmonitored','prototype','checkIsTrunkReachable','Trunk','TrunkBackup','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTimeIvr','ifTime','Failure','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','\x20Intervals\x20is\x20empty\x20','timezones','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','push','Action','command','iftime\x20%s,%s','interval','content','indexOf','true','catch','all','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','resetActiveCalls','syncCampaigns','undefined','resolve','dialGlobalInterval','dialTimezone','[syncCampaigns]','checkDialMethod','dialMethod','predictive','progressive','handlePower','dialPowerLevel','Queue','method\x20not\x20recognized','silly','Voice\x20Queue\x20%s\x20$s','intervalIftime','isGlobal','AMI\x20IfTime','queue','uniqueid','ivr','updateOriginated','YYYY-MM-DD\x20HH:mm:ss','outboundAnswerCallsDay','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','moveContactManagedDialer','droptime','responsetime','dialQueueTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','TIMEOUT','dialDropRetryFrequency','callAdditionalPhoneAfterMin','verifyAdditionalPhones','voiceQueue','countdropretry','dialDropMaxRetry','queueCallerAbandonCreateState','additional','rescheduleContact','minutes','ContactId','VoiceQueueId','starttime','calleridname','calleridnum','swapAdditionalPhones','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','countabandonedretry','countglobal','dialAbandonedMaxRetry','add','dialAbandonedRetryFrequency','ListId','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','channel','syncQueueMember','actionid','strategy','rrmemory','roundrobin','isNil','locked','stateinterface','idHopper','run','CampaignId','_rr','length','paused','[booked][RR]','Agent:\x20','unlockRR','contactAgent-idHopper:\x20','[Catch][Preview][syncQueueStatusComplete]','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','syncVarSet','amdstatus','xcally-motion-dialer','dialAMDActive','value','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','buildObj','saveInDb','[syncHangupInAMD]','MACHINE','Machine','countmachineretry','amd','createHistory','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','[rescheduleContact][Machine]','custom:amd','[syncHangupInAMDIvr][createHistory]','countagentrejectretry','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','outboundUnknownCallsDay','cause-txt','queuesSummary','running','statusMessage','getQueueCampaignStatusMessage','available','inUse','talking','ACTIVE','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','[syncQueueSummary]','throttle','filter','dialPreviewRecallmeReminder','online','handlePreviewRecallNotifications','map','Agent','user:dialPreviewRecallReminder','checkPreviewRecallReminder','clearZombieChannels','[uniqueid]','[actions]','enqueue','[Dialer][checkChannel]','getVoiceQueueRtPauses','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','emptyContact','notFound','UserId','[emptyContact][createHistory]','launchHandleIvr','handleIvr','object','voiceQueue\x20is\x20undefine','phone','originate','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDAfterGreetingSilence','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','isOutboundQueue','setXMDContactVariables','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNAME','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','dialPrefix','trim','substring','SIP/%s/%s%s','dialCutDigit','from-sip','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','checkRetriveMax','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','[rescheduleContact][Drop]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','reason','outboundNoSuchCallsDay','NoSuchNumber','reason\x200\x20no\x20such\x20number....','buildNoAnswerEventPayload','custom:agentnoanswer','dialNoAnswerRetryFrequency','[syncAgentComplete][createHistory][3]','dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','reason\x2020\x20agentreject','Global','Success','[moveContactManagedDialer][0]','outboundDropCallsDayTimeout','round','predictiveIntervalAvailable','predictiveIntervalMinThreshold','floor','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','avgHandleTime','getDataPredictive','startMethodPredictive','recalculate\x20predictive\x20at','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','busyFactor','[getDataPredictive]','check\x20failure','outboundQueuePauses','dialPredictiveOptimizationPercentage','predictiveIntervalPauses','[CatchErlangB]','loggedIn','one\x20call\x20every:','milliseconds','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','unlockContact','outboundReCallsDay','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','getContactDialerIvr','checkContactEmpty','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','checkIsBlackListIvr','loggerHandler','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','temp','not_inuse','getContactDialer','countReScheduled','[countReScheduled]\x20','checkIsBlackList','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','checkContactLowerLimitOriginate','Contact','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','interval\x20=\x20','erlangb','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','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','p\x20=\x20','exports','util','lodash','moment','ioredis','./utils','./utils/hopper','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/voiceQueueRt','../rpc/interval','./models/action','./models/history','./models/final','./models/agentComplete','./models/queueCallerAbandon','./models/hangup','env','XCALLY_IP_AGI','127.0.0.1','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncHangup','newexten','syncNewExten','queuemember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined','emit','type','outbound','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','format','voice_queue:save','isEmpty','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime'];(function(_0x984ff7,_0x3b21ee){var _0x41942a=function(_0x2c95d9){while(--_0x2c95d9){_0x984ff7['push'](_0x984ff7['shift']());}};_0x41942a(++_0x3b21ee);}(_0x7537,0x1c0));var _0x7753=function(_0x54c9ae,_0x1dd556){_0x54c9ae=_0x54c9ae-0x0;var _0x103004=_0x7537[_0x54c9ae];return _0x103004;};'use strict';var util=require(_0x7753('0x0'));var _=require(_0x7753('0x1'));var uuid=require('uuid');var moment=require(_0x7753('0x2'));var rr=require('rr');var Redis=require(_0x7753('0x3'));var utils=require(_0x7753('0x4'));var hopperUtils=require(_0x7753('0x5'));var ut=require(_0x7753('0x6'));var config=require(_0x7753('0x7'));var logger=require(_0x7753('0x8'))(_0x7753('0x9'));var loggerBooked=require('../../../config/logger')(_0x7753('0xa'));var loggerPredictive=require('../../../config/logger')('predictive');var loggerPredictiveCalls=require(_0x7753('0x8'))('predictiveCalls');var loggerSyncQueueSummary=require(_0x7753('0x8'))(_0x7753('0xb'));var ami=require(_0x7753('0xc'));config[_0x7753('0xd')]=_[_0x7753('0xe')](config['redis'],{'host':_0x7753('0xf'),'port':0x18eb});var io=require(_0x7753('0x10'))(new Redis(config[_0x7753('0xd')]));var cmHopper=require('../rpc/cmHopper');var voiceQueueRt=require(_0x7753('0x11'));var RpcSetting=require('../rpc/setting');var Interval=require(_0x7753('0x12'));var Action=require(_0x7753('0x13'));var History=require(_0x7753('0x14'));var Final=require(_0x7753('0x15'));var AgentComplete=require(_0x7753('0x16'));var QueueCallerAbandon=require(_0x7753('0x17'));var Hangup=require(_0x7753('0x18'));var ipAgi=process[_0x7753('0x19')][_0x7753('0x1a')]||_0x7753('0x1b');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0x5ee92b){this[_0x7753('0x1c')]=this[_0x7753('0x1c')]?this[_0x7753('0x1c')][_0x7753('0x1d')](_0x5ee92b):_0x5ee92b();};function Dialer(_0x47b000,_0x1e7d7f){this[_0x7753('0x1e')]=new Sequence();this[_0x7753('0x1f')]=_0x1e7d7f;this[_0x7753('0x20')]=_0x47b000[_0x7753('0x20')];this[_0x7753('0x21')]=_0x47b000['campaigns'];this[_0x7753('0x22')]=_0x47b000['agents'];this[_0x7753('0x23')]=_0x47b000[_0x7753('0x23')];this['maxNumberOriginate']=config[_0x7753('0x24')]||0x2;this[_0x7753('0x25')]={};this[_0x7753('0x26')]={};this[_0x7753('0x27')]={};this[_0x7753('0x28')]={};this['optionPredictive']={};this['startPredictive']={};this[_0x7753('0x29')]={};this[_0x7753('0x2a')]={};this[_0x7753('0x2b')]={};this[_0x7753('0x2c')]={};this['queuesSummary']={};ami['on'](_0x7753('0x2d'),this[_0x7753('0x2e')][_0x7753('0x2f')](this));ami['on'](_0x7753('0x30'),this[_0x7753('0x31')][_0x7753('0x2f')](this));ami['on'](_0x7753('0x32'),this[_0x7753('0x33')][_0x7753('0x2f')](this));ami['on'](_0x7753('0x34'),this['syncAgentComplete'][_0x7753('0x2f')](this));ami['on']('custom:queuesummary',this[_0x7753('0xb')][_0x7753('0x2f')](this));ami['on'](_0x7753('0x35'),this[_0x7753('0x36')][_0x7753('0x2f')](this));ami['on'](_0x7753('0x37'),this[_0x7753('0x38')][_0x7753('0x2f')](this));ami['on'](_0x7753('0x39'),this[_0x7753('0x3a')]['bind'](this));ami['on']('varset',this['syncVarSet'][_0x7753('0x2f')](this));ami['on'](_0x7753('0x3b'),this['syncQueueMember'][_0x7753('0x2f')](this));ami['on'](_0x7753('0x3c'),this[_0x7753('0x3d')]['bind'](this));this[_0x7753('0x3e')]();this[_0x7753('0x3f')]();RpcSetting[_0x7753('0x40')]()[_0x7753('0x41')](function(_0x39ac27){previewRecallmeReminderInterval=_0x39ac27[_0x7753('0x42')];});}function isNotNull(_0x3772dd){return _0x3772dd!==null&&!_[_0x7753('0x43')](_0x3772dd);}function msgResponse(_0x40bd12,_0x27bd6d,_0x39f811){return{'action':_0x40bd12,'response':_0x27bd6d,'message':_0x39f811,'stack':_0x39f811};}function emit(_0x43ad11,_0x572c53,_0x36d777){io['to'](_0x43ad11)[_0x7753('0x44')](_0x572c53,_0x36d777);}function emitOutboundVoiceQueueSummary(_0x838e05){if(_0x838e05[_0x7753('0x45')]===_0x7753('0x46')){logger['debug'](_0x7753('0x47'),util['inspect'](_0x838e05,{'showHidden':![],'depth':null}));emit(util[_0x7753('0x48')]('voice:queue:%s',_0x838e05['name']),_0x7753('0x49'),_0x838e05);}}function checkGetDataPredictive(_0x3746d7){if(isNotNull(_0x3746d7)&&!_[_0x7753('0x4a')](_0x3746d7)){loggerPredictive[_0x7753('0x4b')](_0x7753('0x4c'));loggerPredictive[_0x7753('0x4b')](_0x7753('0x4d'),_0x3746d7[_0x7753('0x4e')]);loggerPredictive[_0x7753('0x4b')](_0x7753('0x4f'),_0x3746d7[_0x7753('0x50')]);loggerPredictive[_0x7753('0x4b')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3746d7[_0x7753('0x51')]);loggerPredictive['info']('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3746d7[_0x7753('0x52')]);loggerPredictive[_0x7753('0x4b')](_0x7753('0x53'),_0x3746d7[_0x7753('0x54')]);loggerPredictive[_0x7753('0x4b')](_0x7753('0x55'),_0x3746d7[_0x7753('0x56')]);loggerPredictive[_0x7753('0x4b')](_0x7753('0x57'));if(_0x3746d7[_0x7753('0x4e')]>0x0){if(!_['isUndefined'](_0x3746d7[_0x7753('0x56')])&&_0x3746d7[_0x7753('0x56')]>0x0){return!![];}loggerPredictive[_0x7753('0x4b')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_['isUndefined'](_0x3746d7['predictiveIntervalAvgHoldtime'])&&_0x3746d7['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0x7753('0x4b')](_0x7753('0x58'));}else{loggerPredictive[_0x7753('0x4b')](_0x7753('0x59'));}}else{loggerPredictive['info'](_0x7753('0x5a'));}return![];}function mergeDataErlangB(_0x2dfbaf){return function(_0x4e866c){loggerPredictive['info'](_0x7753('0x5b'));loggerPredictive['info']('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4e866c[_0x7753('0x5c')]);loggerPredictive[_0x7753('0x4b')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4e866c[_0x7753('0x5d')]);loggerPredictive[_0x7753('0x4b')](_0x7753('0x5e'),_0x4e866c[_0x7753('0x5f')]);loggerPredictive['info']('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4e866c[_0x7753('0x60')]);loggerPredictive[_0x7753('0x4b')](_0x7753('0x5e'),_0x4e866c[_0x7753('0x5f')]);loggerPredictive[_0x7753('0x4b')](_0x7753('0x57'));_[_0x7753('0x61')](_0x2dfbaf,_0x4e866c);};}function ifInterval(_0x53ef2f,_0x32ce2e){if(_[_0x7753('0x43')](_0x32ce2e)){return![];}return utils[_0x7753('0x62')](undefined,_0x32ce2e)<_0x53ef2f*0x3c;}function clearPredictiveAttributes(_0x3c8aea){if(_0x3c8aea[_0x7753('0x29')]){_0x3c8aea[_0x7753('0x29')]=undefined;loggerPredictive[_0x7753('0x63')](_0x3c8aea[_0x7753('0x64')],_0x7753('0x65'));}if(_0x3c8aea[_0x7753('0x66')]){_0x3c8aea[_0x7753('0x66')]=undefined;loggerPredictive[_0x7753('0x63')](_0x3c8aea[_0x7753('0x64')],'startPredictive\x20value\x20cleared');}if(_0x3c8aea[_0x7753('0x67')]){clearInterval(_0x3c8aea[_0x7753('0x67')]);_0x3c8aea['handlePredictive']=undefined;loggerPredictive[_0x7753('0x63')](_0x3c8aea['name'],_0x7753('0x68'));}}function loggerCatchPredictive(_0x472a62,_0x14f0f9){return function(_0x27f8dc){loggerPredictive[_0x7753('0x69')](_0x14f0f9[_0x7753('0x64')],_0x472a62);loggerPredictive[_0x7753('0x69')](_0x27f8dc[_0x7753('0x6a')]);clearPredictiveAttributes(_0x14f0f9);};}function loggerCatch(_0x4f9284){return function(_0x2ea058){logger[_0x7753('0x69')](_0x4f9284,util[_0x7753('0x6b')](_0x2ea058,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x48c62b,_0x36ade6,_0x49edc3){return function(_0x585dd6){utils['checkContactLowerLimitOriginate'](_0x36ade6,_0x49edc3,0x0);logger['error'](_0x48c62b,util[_0x7753('0x6b')](_0x585dd6,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x24d9e3){return function(_0x2a3443){if(isNotNull(_0x2a3443)&&isNotNull(_0x2a3443[0x0])){if(_0x2a3443[0x0][_0x7753('0x6c')]>0x0){_0x24d9e3[_0x7753('0x6d')]=utils[_0x7753('0x6e')][_0x7753('0x6f')];logger[_0x7753('0x4b')](_0x7753('0x70')+_0x24d9e3['name'],_0x2a3443[0x0][_0x7753('0x6c')],_0x7753('0x71'));}else{_0x24d9e3[_0x7753('0x6d')]=utils['CAMPAIGN_STATUS'][_0x7753('0x72')];logger[_0x7753('0x4b')]('[getContactDialer2][Empty]'+_0x24d9e3[_0x7753('0x64')]);}}};}function createObjHistory(_0x335c71,_0x39e16f,_0x5506ee,_0x481aea,_0x2a8fc0){_0x335c71[_0x7753('0x6d')]=_0x5506ee;var _0x4ae735=new Action(_0x335c71,_0x39e16f);var _0x1690e1=new History(_0x4ae735);_0x1690e1[_0x7753('0x73')]=_0x481aea;_0x1690e1[_0x7753('0x74')]=_0x2a8fc0;_0x1690e1[_0x7753('0x75')]=_0x4ae735['starttime'];return _0x1690e1;}function unlockQueueStatus(_0x1b9c1a,_0x1f9825){setTimeout(function(){if(_[_0x7753('0x43')](_0x1b9c1a[_0x7753('0x76')])){loggerBooked[_0x7753('0x69')](_0x7753('0x77'),_0x1f9825);}_0x1b9c1a[_0x7753('0x76')]=!![];loggerBooked[_0x7753('0x4b')](_0x7753('0x78'),_0x1f9825,JSON[_0x7753('0x79')](_[_0x7753('0x7a')](_0x1b9c1a,[_0x7753('0x64'),_0x7753('0x76')])));},0x1f3);}function checkInterval(_0x134f99){return function(){if(!isNotNull(_0x134f99[_0x7753('0x7b')])){_0x134f99[_0x7753('0x6d')]=utils[_0x7753('0x6e')][_0x7753('0x7c')];throw _0x134f99['name']+_0x7753('0x7d');}if(!isNotNull(_0x134f99['Interval'][_0x7753('0x7e')])){_0x134f99[_0x7753('0x6d')]=utils['CAMPAIGN_STATUS'][_0x7753('0x7c')];throw _0x134f99['name']+_0x7753('0x7d');}if(!isNotNull(_['isEmpty'](_0x134f99[_0x7753('0x7b')][_0x7753('0x7e')]))){_0x134f99[_0x7753('0x6d')]=utils[_0x7753('0x6e')]['NULL_INTERVAL'];throw _0x134f99[_0x7753('0x64')]+'\x20INTERVAL_IS_NULL';}};}function checkIsIVRCampaignActive(_0xd4d088){return function(){if(!utils[_0x7753('0x7f')](_0xd4d088)){_0xd4d088[_0x7753('0x6d')]=utils[_0x7753('0x6e')][_0x7753('0x80')];throw _0xd4d088['name']+'\x20NOT\x20Active';}};}function emitCampaignSummary(_0x3ba7c2){if(utils[_0x7753('0x81')](_0x3ba7c2)){emit(util[_0x7753('0x48')]('campaign:ivr:%s',_0x3ba7c2['name']),_0x7753('0x82'),_0x3ba7c2);}}function loggerCatchQueueSummary(_0x29cca1,_0xe61899){return function(_0x3911ed){clearPredictiveAttributes(_0xe61899);emitCampaignSummary(_0xe61899);loggerSyncQueueSummary[_0x7753('0x63')](_0x29cca1,util[_0x7753('0x6b')](_0x3911ed,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x266b8b){if(_0x266b8b[_0x7753('0x83')]){if(_0x266b8b[_0x7753('0x84')]===0x0){_0x266b8b[_0x7753('0x83')]=![];_0x266b8b[_0x7753('0x6d')]=utils['CAMPAIGN_STATUS']['INACTIVE'];loggerSyncQueueSummary[_0x7753('0x63')](_0x7753('0x85'),_0x266b8b[_0x7753('0x64')],_0x7753('0x86'));}else{_0x266b8b[_0x7753('0x6d')]=utils[_0x7753('0x6e')]['DISACTIVED'];loggerSyncQueueSummary[_0x7753('0x63')](_0x7753('0x85'),_0x266b8b[_0x7753('0x64')],_0x7753('0x87'));}emitCampaignSummary(_0x266b8b);}}function myreject(_0x489a8c){return function(_0x2b3031){return _0x489a8c(msgResponse(_0x7753('0x88'),_0x7753('0x89'),JSON[_0x7753('0x79')](_0x2b3031)));};}Dialer['prototype'][_0x7753('0x8a')]=function(_0x9abf45){return!_['isUndefined'](_0x9abf45)&&_0x9abf45&&!_['isUndefined'](_0x9abf45[_0x7753('0x64')])&&!_[_0x7753('0x43')](_0x9abf45['active'])&&_0x9abf45[_0x7753('0x8b')]&&(this[_0x7753('0x23')][util['format'](_0x7753('0x8c'),_0x9abf45['name'])][_0x7753('0x8d')]===_0x7753('0x8e')||this[_0x7753('0x23')][util[_0x7753('0x48')](_0x7753('0x8c'),_0x9abf45[_0x7753('0x64')])][_0x7753('0x8d')]===_0x7753('0x8f'));};Dialer[_0x7753('0x90')][_0x7753('0x91')]=function(_0x5a6f2d){var _0x3dddc6=this;return function(){if(!_0x3dddc6[_0x7753('0x8a')](_0x5a6f2d[_0x7753('0x92')])){if(!_0x3dddc6[_0x7753('0x8a')](_0x5a6f2d[_0x7753('0x93')])){_0x5a6f2d['message']=utils['CAMPAIGN_STATUS'][_0x7753('0x94')];throw _0x5a6f2d['name']+_0x7753('0x95');}}};};Dialer[_0x7753('0x90')][_0x7753('0x96')]=function(_0x36c50d,_0x1e37ec,_0x29529f,_0x33830b){var _0x49c13f=this;return function(){var _0x350658=!![];return _0x49c13f['ifTimeIvr'](_0x36c50d,_0x1e37ec,_0x29529f,_0x33830b,_0x350658);};};Dialer[_0x7753('0x90')]['checkIfTimeIntervals']=function(_0x18ba95,_0x37eba1,_0x11d305,_0x589fa1){var _0xfef30a=this;return function(){var _0x51ba09=![];return _0xfef30a['ifTimeIvr'](_0x18ba95[_0x7753('0x7e')],_0x37eba1,_0x11d305,_0x589fa1,_0x51ba09);};};Dialer[_0x7753('0x90')][_0x7753('0x97')]=function(_0x32515a,_0x47066d,_0x3989e3,_0xf0092b,_0x19f9e4){var _0xc16310=[];return new Promise(function(_0x1e37e0,_0x396fc0){if(!isNotNull(_0x32515a)){_0xf0092b['message']=utils[_0x7753('0x6e')]['NULL_INTERVAL'];return _0x396fc0(msgResponse(_0x7753('0x98'),_0x7753('0x99'),_0x3989e3+_0x7753('0x9a')));}if(_[_0x7753('0x4a')](_0x32515a)){_0xf0092b[_0x7753('0x6d')]=utils[_0x7753('0x6e')][_0x7753('0x9b')];return _0x396fc0(msgResponse(_0x7753('0x98'),_0x7753('0x99'),_0x3989e3+_0x7753('0x9c')));}if(_0x47066d&&_['isUndefined'](config[_0x7753('0x9d')][_0x47066d])){_0xf0092b[_0x7753('0x6d')]=utils[_0x7753('0x6e')][_0x7753('0x9e')];return _0x396fc0(msgResponse(_0x7753('0x98'),_0x7753('0x99'),_0x3989e3+_0x7753('0x9f')+_0x47066d));}if(_['isArray'](_0x32515a)){for(var _0x574e1e=0x0;_0x574e1e<_0x32515a['length'];_0x574e1e+=0x1){_0xc16310[_0x7753('0xa0')](ami[_0x7753('0xa1')]({'action':_0x7753('0xa2'),'command':util[_0x7753('0x48')](_0x7753('0xa3'),_0x32515a[_0x574e1e][_0x7753('0xa4')],!_['isUndefined'](config['timezones'][_0x47066d])?_0x47066d:'')})[_0x7753('0x41')](function(_0x43ab70){return _0x43ab70[_0x7753('0xa5')][_0x7753('0xa6')](_0x7753('0xa7'))>=0x0;})[_0x7753('0xa8')](myreject(_0x396fc0)));}}else{_0xc16310[_0x7753('0xa0')](ami[_0x7753('0xa1')]({'action':_0x7753('0xa2'),'command':util[_0x7753('0x48')](_0x7753('0xa3'),_0x32515a,!_[_0x7753('0x43')](config['timezones'][_0x47066d])?_0x47066d:'')})[_0x7753('0x41')](function(_0x4a510c){return _0x4a510c[_0x7753('0xa5')][_0x7753('0xa6')](_0x7753('0xa7'))>=0x0;})['catch'](myreject(_0x396fc0)));}Promise[_0x7753('0xa9')](_0xc16310)['then'](function(_0x410b65){var _0x3b58f8=_['some'](_0x410b65);if(_0x3b58f8){return _0x1e37e0(_0x3b58f8);}else{_0xf0092b['message']=_0x19f9e4?utils['CAMPAIGN_STATUS'][_0x7753('0xaa')]:utils[_0x7753('0x6e')][_0x7753('0xab')];return _0x396fc0(msgResponse(_0x7753('0xac'),_0x7753('0x99'),_0x7753('0xad')+_0x19f9e4+'\x20'+_0x3989e3+_0x7753('0xae')+util[_0x7753('0x6b')](_0x32515a,{'showHidden':![],'depth':null})+_0x7753('0xaf')+_0x47066d));}})[_0x7753('0xa8')](function(_0x54ddb5){return _0x396fc0(msgResponse(_0x7753('0x98'),'Failure',JSON['stringify'](_0x54ddb5)));});});};Dialer[_0x7753('0x90')]['loopCampaigns']=function(){var _0x18866f=this;return cmHopper[_0x7753('0xb0')]({'active':![]},{'where':{'active':!![]}})[_0x7753('0x41')](function(){setInterval(function(){_0x18866f[_0x7753('0xb1')]();},0x3e8);});};Dialer[_0x7753('0x90')][_0x7753('0xb1')]=function(){var _0x27ab94=this;var _0x3e31a9;for(var _0x18ab20 in this[_0x7753('0x21')]){if(typeof this['campaigns'][_0x18ab20]!==_0x7753('0xb2')){_0x3e31a9=this[_0x7753('0x21')][_0x18ab20];if(utils[_0x7753('0x81')](_0x3e31a9)&&utils[_0x7753('0x7f')](_0x3e31a9)){_0x3e31a9[_0x7753('0x83')]=!![];Promise[_0x7753('0xb3')]()[_0x7753('0x41')](checkIsIVRCampaignActive(_0x3e31a9))['then'](checkInterval(_0x3e31a9))['then'](_0x27ab94[_0x7753('0x91')](_0x3e31a9))[_0x7753('0x41')](_0x27ab94['checkIfTime'](_0x3e31a9[_0x7753('0xb4')],_0x3e31a9[_0x7753('0xb5')],_0x3e31a9[_0x7753('0x64')],_0x3e31a9))[_0x7753('0x41')](_0x27ab94['checkIfTimeIntervals'](_0x3e31a9[_0x7753('0x7b')],_0x3e31a9[_0x7753('0xb5')],_0x3e31a9['name'],_0x3e31a9))[_0x7753('0x41')](_0x27ab94['launchHandleIvr'](_0x3e31a9))[_0x7753('0xa8')](loggerCatchQueueSummary(_0x7753('0xb6'),_0x3e31a9));}else{notSendMessagesCampaign(_0x3e31a9);}}}};Dialer[_0x7753('0x90')][_0x7753('0xb7')]=function(_0x261a94){if(_0x261a94[_0x7753('0xb8')]!==_0x7753('0xb9')){clearPredictiveAttributes(_0x261a94);}switch(_0x261a94[_0x7753('0xb8')]){case _0x7753('0xba'):this[_0x7753('0xbb')](_0x261a94,0x1);break;case'power':this[_0x7753('0xbb')](_0x261a94,_0x261a94[_0x7753('0xbc')]);break;case _0x7753('0xb9'):this[_0x7753('0xb9')](_0x261a94);break;case'booked':this[_0x7753('0xbb')](_0x261a94,0x1);break;default:logger[_0x7753('0x69')](_0x7753('0xbd'),_0x261a94[_0x7753('0x64')],_0x7753('0xbe'));}};Dialer[_0x7753('0x90')]['ifTime']=function(_0x49a03f,_0x1ff093){var _0x300ae3=_0x49a03f[_0x7753('0xb5')];var _0x521a08=_0x1ff093?_0x49a03f[_0x7753('0xb4')]:_0x49a03f[_0x7753('0x7b')][_0x7753('0x7e')];logger[_0x7753('0xbf')]('Dialer::ifTime()',_0x521a08,_0x300ae3,_0x49a03f[_0x7753('0x64')],util['format'](_0x7753('0xc0'),_0x49a03f['name'],_0x49a03f['id']));var _0x23b7d7=null;return Interval[_0x7753('0xc1')](_0x521a08,_0x300ae3)[_0x7753('0x41')](function(_0x4d9a7b){if(_0x4d9a7b===!![]){return _0x4d9a7b;}else{_0x49a03f[_0x7753('0x6d')]=_0x1ff093?utils[_0x7753('0x6e')]['OVERTIME_GLOBAL_INTERVAL']:utils[_0x7753('0x6e')][_0x7753('0xab')];_0x23b7d7=msgResponse(_0x7753('0xac'),_0x7753('0x99'),_0x7753('0xad')+_0x1ff093+'\x20'+_0x49a03f['name']+_0x7753('0xae')+util[_0x7753('0x6b')](_0x521a08,{'showHidden':![],'depth':null})+_0x7753('0xaf')+_0x300ae3);}if(_0x23b7d7!==null){logger[_0x7753('0xbf')]('Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:',_0x23b7d7);_0x23b7d7[_0x7753('0xc2')]=_0x1ff093;throw _0x23b7d7;}})['catch'](function(_0x35b821){logger['error'](_0x7753('0xc3'),_0x35b821);throw msgResponse(_0x7753('0x88'),_0x7753('0x89'),util[_0x7753('0x6b')](_0x35b821,{'showHidden':![],'depth':null}));});};Dialer[_0x7753('0x90')][_0x7753('0x2e')]=function(_0x9ecedf){if(this['voiceQueues'][_0x9ecedf[_0x7753('0xc4')]]){if(this[_0x7753('0x28')][_0x9ecedf['uniqueid']]&&this[_0x7753('0x28')][_0x9ecedf[_0x7753('0xc5')]][_0x7753('0x45')]!==_0x7753('0xc6')){this[_0x7753('0xc7')](this[_0x7753('0x20')][_0x9ecedf[_0x7753('0xc4')]]);this[_0x7753('0x28')][_0x9ecedf[_0x7753('0xc5')]]['answertime']=moment()['format'](_0x7753('0xc8'));}}};Dialer[_0x7753('0x90')]['syncAgentComplete']=function(_0x4fc0ba){var _0x4d640a=this[_0x7753('0x28')][_0x4fc0ba['uniqueid']];if(this[_0x7753('0x20')][_0x4fc0ba[_0x7753('0xc4')]]){if(_0x4d640a&&_0x4d640a[_0x7753('0x45')]!==_0x7753('0xc6')){delete this[_0x7753('0x28')][_0x4fc0ba[_0x7753('0xc5')]];this[_0x7753('0x20')][_0x4fc0ba[_0x7753('0xc4')]][_0x7753('0xc9')]+=0x1;var _0x4eea51=new AgentComplete(_0x4d640a,_0x4fc0ba);if(_0x4fc0ba['reason']===_0x7753('0xca')){_0x4eea51[_0x7753('0xcb')]=this[_0x7753('0x20')][_0x4fc0ba['queue']][_0x7753('0xcc')]&&this[_0x7753('0x20')][_0x4fc0ba[_0x7753('0xc4')]][_0x7753('0xcd')]?moment()[_0x7753('0x48')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}hopperUtils['createHistory'](_0x4eea51)[_0x7753('0xa8')](loggerCatch(_0x7753('0xce')));hopperUtils[_0x7753('0xcf')](_0x4eea51)[_0x7753('0xa8')](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0x7753('0x90')][_0x7753('0x31')]=function(_0x4a3a7f){var _0x104fcf=this['uniqueId'][_0x4a3a7f['uniqueid']];var _0xf2c375=this;var _0xa5eb8a=![];var _0x565118;var _0x4630dd;if(this[_0x7753('0x20')][_0x4a3a7f['queue']]){if(_0x104fcf&&_0x104fcf[_0x7753('0x45')]!=='ivr'){delete this['uniqueId'][_0x4a3a7f['uniqueid']];this[_0x7753('0xc7')](this[_0x7753('0x20')][_0x4a3a7f[_0x7753('0xc4')]]);_0x104fcf[_0x7753('0xd0')]=moment()[_0x7753('0x48')]('YYYY-MM-DD\x20HH:mm:ss');var _0x3de8bc=new QueueCallerAbandon(_0x104fcf,_0x4a3a7f);if(utils[_0x7753('0x62')](_0x104fcf[_0x7753('0xd0')],_0x104fcf[_0x7753('0xd1')])>=_0x104fcf[_0x7753('0xd2')]){this[_0x7753('0x20')][_0x4a3a7f[_0x7753('0xc4')]][_0x7753('0x51')]+=0x1;this['voiceQueues'][_0x4a3a7f['queue']]['outboundDropCallsDayTimeout']+=0x1;this[_0x7753('0x20')][_0x4a3a7f[_0x7753('0xc4')]][_0x7753('0xd3')]+=0x1;_0x3de8bc[_0x7753('0x73')]=0xa;_0x3de8bc[_0x7753('0x74')]=_0x7753('0xd4');_0x3de8bc['dropreason']=_0x7753('0xd5');_0x3de8bc[_0x7753('0xcb')]=this['voiceQueues'][_0x4a3a7f[_0x7753('0xc4')]][_0x7753('0xcc')]?moment()[_0x7753('0x48')](_0x7753('0xc8')):undefined;_0x3de8bc['countdropretry']+=0x1;_0x3de8bc['countglobal']+=0x1;_0x565118=this['voiceQueues'][_0x4a3a7f[_0x7753('0xc4')]][_0x7753('0xd6')];_0x4630dd=this['voiceQueues'][_0x4a3a7f[_0x7753('0xc4')]][_0x7753('0xd7')];hopperUtils[_0x7753('0xd8')](_0x3de8bc,_0x3de8bc[_0x7753('0x73')],_0x104fcf[_0x7753('0xd9')])[_0x7753('0x41')](function(_0x17e58c){_0xa5eb8a=_0x17e58c['additional']==0x1;if(_0x3de8bc[_0x7753('0xda')]>=_0xf2c375[_0x7753('0x20')][_0x4a3a7f[_0x7753('0xc4')]][_0x7753('0xdb')]){_0xf2c375[_0x7753('0xdc')](_0x3de8bc,_0x17e58c[_0x7753('0xdd')]);}else{hopperUtils[_0x7753('0xde')]({'active':![],'countdropretry':_0x3de8bc[_0x7753('0xda')],'scheduledat':moment()['add'](_0xf2c375[_0x7753('0x20')][_0x4a3a7f[_0x7753('0xc4')]][_0x7753('0xd6')],_0x7753('0xdf'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x104fcf[_0x7753('0xe0')],'ListId':_0x104fcf['ListId'],'VoiceQueueId':_0x104fcf[_0x7753('0xe1')]||undefined,'CampaignId':_0x104fcf['CampaignId']||undefined})[_0x7753('0xa8')](loggerCatch('[rescheduleContact][Drop]'));var _0xd8a0cd=new History(_0x3de8bc);_0xd8a0cd[_0x7753('0x73')]=0xa;_0xd8a0cd['statedesc']=_0x7753('0xd4');_0xd8a0cd[_0x7753('0xe2')]=moment()[_0x7753('0x48')](_0x7753('0xc8'));_0xd8a0cd[_0x7753('0x75')]=_0xd8a0cd[_0x7753('0xe2')];_0xd8a0cd[_0x7753('0xe3')]=_0x3de8bc[_0x7753('0xe3')];_0xd8a0cd[_0x7753('0xe4')]=_0x3de8bc[_0x7753('0xe4')];hopperUtils['createHistory'](_0xd8a0cd)[_0x7753('0xa8')](loggerCatch('[syncAgentComplete][createHistory][10]'));}})[_0x7753('0x41')](function(){if(_0xa5eb8a)hopperUtils[_0x7753('0xe5')](_0x3de8bc,_0x565118,_0x4630dd)[_0x7753('0x41')](function(){return 0x1;});});}else{this['voiceQueues'][_0x4a3a7f['queue']]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0x7753('0x20')][_0x4a3a7f['queue']][_0x7753('0xe6')]+=0x1;_0x3de8bc[_0x7753('0x73')]=0xb;_0x3de8bc[_0x7753('0x74')]=_0x7753('0xe7');_0x3de8bc['dropreason']=_0x7753('0xe8');_0x3de8bc[_0x7753('0xe9')]+=0x1;_0x3de8bc[_0x7753('0xea')]+=0x1;_0x565118=this[_0x7753('0x20')][_0x4a3a7f['queue']]['dialAbandonedRetryFrequency'];_0x4630dd=this[_0x7753('0x20')][_0x4a3a7f[_0x7753('0xc4')]][_0x7753('0xd7')];hopperUtils[_0x7753('0xd8')](_0x3de8bc,_0x3de8bc[_0x7753('0x73')],_0x104fcf[_0x7753('0xd9')])[_0x7753('0x41')](function(_0x1e7eac){if(_0x3de8bc[_0x7753('0xe9')]>=_0xf2c375[_0x7753('0x20')][_0x4a3a7f[_0x7753('0xc4')]][_0x7753('0xeb')]){_0xf2c375[_0x7753('0xdc')](_0x3de8bc,_0x1e7eac['additional']);}else{hopperUtils[_0x7753('0xde')]({'active':![],'countabandonedretry':_0x3de8bc[_0x7753('0xe9')],'scheduledat':moment()[_0x7753('0xec')](_0xf2c375[_0x7753('0x20')][_0x4a3a7f[_0x7753('0xc4')]][_0x7753('0xed')],_0x7753('0xdf'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x104fcf[_0x7753('0xe0')],'ListId':_0x104fcf[_0x7753('0xee')],'VoiceQueueId':_0x104fcf[_0x7753('0xe1')]||undefined,'CampaignId':_0x104fcf['CampaignId']||undefined})[_0x7753('0xa8')](loggerCatch(_0x7753('0xef')));var _0x74ef6a=new History(_0x3de8bc);_0x74ef6a[_0x7753('0x73')]=0xb;_0x74ef6a['statedesc']=_0x7753('0xe7');_0x74ef6a[_0x7753('0xe2')]=moment()['format'](_0x7753('0xc8'));_0x74ef6a['endtime']=_0x74ef6a[_0x7753('0xe2')];_0x74ef6a['calleridname']=_0x3de8bc[_0x7753('0xe3')];_0x74ef6a['calleridnum']=_0x3de8bc['calleridnum'];hopperUtils['createHistory'](_0x74ef6a)[_0x7753('0xa8')](loggerCatch(_0x7753('0xf0')));}})[_0x7753('0x41')](function(){if(_0xa5eb8a)hopperUtils['swapAdditionalPhones'](_0x3de8bc,_0x565118,_0x4630dd)[_0x7753('0x41')](function(){return 0x1;});});}}}};Dialer[_0x7753('0x90')][_0x7753('0x3a')]=function(_0x4054f6){if(this[_0x7753('0x26')][_0x4054f6[_0x7753('0xc5')]]){this[_0x7753('0x26')][_0x4054f6[_0x7753('0xc5')]][_0x7753('0xf1')]=_0x4054f6['channel'];}if(this[_0x7753('0x28')][_0x4054f6[_0x7753('0xc5')]]){this[_0x7753('0x28')][_0x4054f6[_0x7753('0xc5')]]['channel']=_0x4054f6[_0x7753('0xf1')];}};Dialer[_0x7753('0x90')][_0x7753('0xf2')]=function(_0x2decbb){if(!this[_0x7753('0x26')][_0x2decbb[_0x7753('0xf3')]]){return;}var _0x8e830b=this[_0x7753('0x20')][this['actions'][_0x2decbb[_0x7753('0xf3')]][_0x7753('0xc4')]][_0x7753('0xf4')]||_0x7753('0xf5');if(_0x8e830b===_0x7753('0xf6')){if(this[_0x7753('0x26')][_0x2decbb[_0x7753('0xf3')]]&&_[_0x7753('0xf7')](this[_0x7753('0x26')][_0x2decbb['actionid']][_0x7753('0xf8')])&&_0x2decbb[_0x7753('0x8d')]==='1'&&_0x2decbb['paused']==='0'){if(this[_0x7753('0x22')][_0x2decbb[_0x7753('0xf9')]]){if(!this[_0x7753('0x22')][_0x2decbb[_0x7753('0xf9')]]['locked']){this[_0x7753('0x22')][_0x2decbb[_0x7753('0xf9')]][_0x7753('0xf8')]=!![];this[_0x7753('0x26')][_0x2decbb[_0x7753('0xf3')]][_0x7753('0xf8')]=!![];this[_0x7753('0x26')][_0x2decbb[_0x7753('0xf3')]][_0x7753('0xf9')]=_0x2decbb[_0x7753('0xf9')];}}}}else if(_0x8e830b==='rrmemory'){if(this[_0x7753('0x26')][_0x2decbb[_0x7753('0xf3')]]){if(this[_0x7753('0x22')][_0x2decbb[_0x7753('0xf9')]]){this[_0x7753('0x26')][_0x2decbb[_0x7753('0xf3')]][_0x7753('0xf9')]=_0x2decbb[_0x7753('0xf9')];if(_[_0x7753('0xf7')](this['queueBooked'][this[_0x7753('0x26')][_0x2decbb['actionid']][_0x7753('0xc4')]])){this[_0x7753('0x2b')][this[_0x7753('0x26')][_0x2decbb['actionid']][_0x7753('0xc4')]]=[];}this[_0x7753('0x2b')][this[_0x7753('0x26')][_0x2decbb['actionid']]['queue']][_0x7753('0xa0')](_[_0x7753('0x61')](_[_0x7753('0x7a')](this['actions'][_0x2decbb[_0x7753('0xf3')]],[_0x7753('0xfa'),_0x7753('0xf9')]),{'status':_0x2decbb[_0x7753('0x8d')],'paused':_0x2decbb['paused']}));}}}};Dialer[_0x7753('0x90')][_0x7753('0x3d')]=function(_0x507c1c){if(!this[_0x7753('0x26')][_0x507c1c['actionid']]){return;}var _0xa433d5=this;var _0x168fca=this[_0x7753('0x20')][this[_0x7753('0x26')][_0x507c1c['actionid']][_0x7753('0xc4')]];var _0x236055=_0x168fca['strategy']||'rrmemory';if(_0x236055===_0x7753('0xf6')){if(this[_0x7753('0x26')][_0x507c1c[_0x7753('0xf3')]]&&this[_0x7753('0x26')][_0x507c1c[_0x7753('0xf3')]]['stateinterface']){this['preview'][_0x7753('0xfb')](this[_0x7753('0x26')][_0x507c1c[_0x7753('0xf3')]][_0x7753('0xfa')],this[_0x7753('0x26')][_0x507c1c[_0x7753('0xf3')]]['stateinterface'])[_0x7753('0xa8')](function(_0x135af0){logger['error']('[Catch][Preview][syncQueueStatusComplete]',util['inspect'](_0x135af0,{'showHidden':![],'depth':null}));})[_0x7753('0x1d')](function(){_0xa433d5[_0x7753('0xc7')](_0xa433d5[_0x7753('0x20')][_0xa433d5[_0x7753('0x26')][_0x507c1c[_0x7753('0xf3')]][_0x7753('0xc4')]]);_0xa433d5[_0x7753('0x22')][_0xa433d5[_0x7753('0x26')][_0x507c1c['actionid']][_0x7753('0xf9')]][_0x7753('0xf8')]=![];delete _0xa433d5[_0x7753('0x26')][_0x507c1c['actionid']];unlockQueueStatus(_0x168fca);});}else{this[_0x7753('0xc7')](this[_0x7753('0x20')][this[_0x7753('0x26')][_0x507c1c['actionid']][_0x7753('0xc4')]]);hopperUtils[_0x7753('0xde')]({'active':![],'ContactId':this[_0x7753('0x26')][_0x507c1c['actionid']][_0x7753('0xe0')],'ListId':this[_0x7753('0x26')][_0x507c1c['actionid']][_0x7753('0xee')],'VoiceQueueId':this[_0x7753('0x26')][_0x507c1c['actionid']][_0x7753('0xe1')]||undefined,'CampaignId':this[_0x7753('0x26')][_0x507c1c['actionid']][_0x7753('0xfc')]||undefined})[_0x7753('0xa8')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0x7753('0x26')][_0x507c1c[_0x7753('0xf3')]];unlockQueueStatus(_0x168fca);}}else if(_0x236055===_0x7753('0xf5')){var _0x5a8bff;if(this[_0x7753('0x26')][_0x507c1c[_0x7753('0xf3')]]&&!_[_0x7753('0x4a')](this[_0x7753('0x2b')][this[_0x7753('0x26')][_0x507c1c['actionid']][_0x7753('0xc4')]])){if(this[_0x7753('0x2c')][_0xa433d5[_0x7753('0x26')][_0x507c1c[_0x7753('0xf3')]][_0x7753('0xc4')]]){this['queueBookedRR'][_0xa433d5[_0x7753('0x26')][_0x507c1c[_0x7753('0xf3')]][_0x7753('0xc4')]]=this[_0x7753('0x2c')][this[_0x7753('0x26')][_0x507c1c['actionid']][_0x7753('0xc4')]]?this['queueBookedRR'][this['actions'][_0x507c1c['actionid']][_0x7753('0xc4')]]:this[_0x7753('0x2b')][this[_0x7753('0x26')][_0x507c1c[_0x7753('0xf3')]][_0x7753('0xc4')]]?this[_0x7753('0x2b')][this['actions'][_0x507c1c[_0x7753('0xf3')]][_0x7753('0xc4')]][_0x7753('0xfd')]||0x0:0x0;}this[_0x7753('0x2b')][this[_0x7753('0x26')][_0x507c1c[_0x7753('0xf3')]][_0x7753('0xc4')]]['_rr']=this[_0x7753('0x2c')][this[_0x7753('0x26')][_0x507c1c[_0x7753('0xf3')]][_0x7753('0xc4')]];for(var _0x3d3a87=0x0;_0x3d3a87<this[_0x7753('0x2b')][this['actions'][_0x507c1c[_0x7753('0xf3')]][_0x7753('0xc4')]][_0x7753('0xfe')];_0x3d3a87+=0x1){_0x5a8bff=rr(this[_0x7753('0x2b')][this[_0x7753('0x26')][_0x507c1c[_0x7753('0xf3')]][_0x7753('0xc4')]]);this[_0x7753('0x2c')][_0xa433d5[_0x7753('0x26')][_0x507c1c[_0x7753('0xf3')]]['queue']]=this[_0x7753('0x2b')][this[_0x7753('0x26')][_0x507c1c[_0x7753('0xf3')]][_0x7753('0xc4')]][_0x7753('0xfd')];if(_0x5a8bff['status']==='1'&&_0x5a8bff[_0x7753('0xff')]==='0'){break;}}if(!_[_0x7753('0xf7')](_0x5a8bff)){this['agents'][_0x5a8bff[_0x7753('0xf9')]]['unlockRR']=_[_0x7753('0x43')](this['agents'][_0x5a8bff[_0x7753('0xf9')]]['unlockRR'])?!![]:this[_0x7753('0x22')][_0x5a8bff[_0x7753('0xf9')]]['unlockRR'];}loggerBooked['info'](_0x7753('0x100'),_0x507c1c[_0x7753('0xf3')],_0x7753('0x101'),JSON['stringify'](_[_0x7753('0x7a')](this[_0x7753('0x22')][_0x5a8bff[_0x7753('0xf9')]],[_0x7753('0x64'),_0x7753('0x102')])),_0x7753('0x103'),JSON['stringify'](_0x5a8bff[_0x7753('0xfa')]));if(!_[_0x7753('0xf7')](_0x5a8bff)&&_0x5a8bff[_0x7753('0x8d')]==='1'&&_0x5a8bff[_0x7753('0xff')]==='0'&&this[_0x7753('0x22')][_0x5a8bff['stateinterface']][_0x7753('0x102')]){this['agents'][_0x5a8bff[_0x7753('0xf9')]][_0x7753('0x102')]=![];this['queueBooked'][_0xa433d5['actions'][_0x507c1c[_0x7753('0xf3')]]['queue']]=[];this['preview'][_0x7753('0xfb')](_0x5a8bff[_0x7753('0xfa')],_0x5a8bff[_0x7753('0xf9')])[_0x7753('0xa8')](function(_0x3d00ea){logger[_0x7753('0x69')](_0x7753('0x104'),util[_0x7753('0x6b')](_0x3d00ea,{'showHidden':![],'depth':null}));})[_0x7753('0x1d')](function(){_0xa433d5[_0x7753('0xc7')](_0xa433d5[_0x7753('0x20')][_0xa433d5[_0x7753('0x26')][_0x507c1c[_0x7753('0xf3')]][_0x7753('0xc4')]]);setTimeout(function(){_0xa433d5[_0x7753('0x22')][_0x5a8bff[_0x7753('0xf9')]][_0x7753('0x102')]=!![];loggerBooked[_0x7753('0x4b')](_0x7753('0x105'),_0x507c1c[_0x7753('0xf3')],_0x7753('0x101'),JSON[_0x7753('0x79')](_['pick'](_0xa433d5[_0x7753('0x22')][_0x5a8bff[_0x7753('0xf9')]],['name',_0x7753('0x102')])),'contactAgent-idHopper:\x20',JSON['stringify'](_0x5a8bff[_0x7753('0xfa')]));},0xc7);delete _0xa433d5['actions'][_0x507c1c[_0x7753('0xf3')]];unlockQueueStatus(_0x168fca,_0x507c1c[_0x7753('0xf3')]);});}else{loggerBooked['info'](_0x7753('0x106'));this['updateOriginated'](this[_0x7753('0x20')][this[_0x7753('0x26')][_0x507c1c[_0x7753('0xf3')]][_0x7753('0xc4')]]);hopperUtils[_0x7753('0xde')]({'active':![],'ContactId':this[_0x7753('0x26')][_0x507c1c['actionid']][_0x7753('0xe0')],'ListId':this[_0x7753('0x26')][_0x507c1c[_0x7753('0xf3')]][_0x7753('0xee')],'VoiceQueueId':this[_0x7753('0x26')][_0x507c1c[_0x7753('0xf3')]][_0x7753('0xe1')]||undefined,'CampaignId':this['actions'][_0x507c1c[_0x7753('0xf3')]][_0x7753('0xfc')]||undefined})[_0x7753('0xa8')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0x7753('0x26')][_0x507c1c['actionid']];unlockQueueStatus(_0x168fca);}}else{loggerBooked['info'](_0x7753('0x107'));this[_0x7753('0xc7')](this[_0x7753('0x20')][this[_0x7753('0x26')][_0x507c1c[_0x7753('0xf3')]][_0x7753('0xc4')]]);hopperUtils[_0x7753('0xde')]({'active':![],'ContactId':this[_0x7753('0x26')][_0x507c1c['actionid']]['ContactId'],'ListId':this[_0x7753('0x26')][_0x507c1c[_0x7753('0xf3')]][_0x7753('0xee')],'VoiceQueueId':this['actions'][_0x507c1c[_0x7753('0xf3')]][_0x7753('0xe1')]||undefined,'CampaignId':this['actions'][_0x507c1c[_0x7753('0xf3')]]['CampaignId']||undefined})[_0x7753('0xa8')](loggerCatch('[unlock2][syncQueueStatusComplete]'));delete this[_0x7753('0x26')][_0x507c1c[_0x7753('0xf3')]];unlockQueueStatus(_0x168fca);}}else{loggerBooked[_0x7753('0x4b')](_0x7753('0x108'));this[_0x7753('0xc7')](this[_0x7753('0x20')][this['actions'][_0x507c1c[_0x7753('0xf3')]][_0x7753('0xc4')]]);hopperUtils[_0x7753('0xde')]({'active':![],'ContactId':this[_0x7753('0x26')][_0x507c1c[_0x7753('0xf3')]][_0x7753('0xe0')],'ListId':this['actions'][_0x507c1c[_0x7753('0xf3')]][_0x7753('0xee')],'VoiceQueueId':this['actions'][_0x507c1c[_0x7753('0xf3')]][_0x7753('0xe1')]||undefined,'CampaignId':this[_0x7753('0x26')][_0x507c1c['actionid']][_0x7753('0xfc')]||undefined})['catch'](loggerCatch(_0x7753('0x109')));delete this[_0x7753('0x26')][_0x507c1c['actionid']];unlockQueueStatus(_0x168fca);}};Dialer[_0x7753('0x90')][_0x7753('0x33')]=function(_0x56d2dd){var _0x334bda=this['actions'][_0x56d2dd[_0x7753('0xf3')]];if(_0x334bda){delete this[_0x7753('0x26')][_0x56d2dd['actionid']];_0x334bda[_0x7753('0xd1')]=moment()[_0x7753('0x48')](_0x7753('0xc8'));var _0x840cfe=_0x334bda[_0x7753('0x45')]===_0x7753('0xc6')?this['campaigns'][_0x334bda[_0x7753('0xc4')]]:this[_0x7753('0x20')][_0x334bda[_0x7753('0x10a')]()];if(_0x56d2dd[_0x7753('0x10b')]!=='Success'){this[_0x7753('0xc7')](_0x840cfe);return this[_0x7753('0x10c')](_0x334bda,_0x840cfe,_0x56d2dd)[_0x7753('0xa8')](loggerCatch(_0x7753('0x10d')));}this[_0x7753('0x28')][_0x56d2dd[_0x7753('0xc5')]]=_0x334bda;}};Dialer[_0x7753('0x90')][_0x7753('0x10e')]=function(_0x21a1eb){var _0x50ecc6=this;var _0x214881=this[_0x7753('0x28')][_0x21a1eb[_0x7753('0xc5')]];var _0x5582cc;if(!_[_0x7753('0xf7')](_0x21a1eb)&&!_[_0x7753('0xf7')](_0x21a1eb['variable'])&&!_['isNil'](_0x21a1eb['variable'][_0x7753('0x10f')])&&_0x21a1eb['exten']===_0x7753('0x110')&&_0x214881){if(_0x214881[_0x7753('0x45')]!==_0x7753('0xc6')&&this[_0x7753('0x20')][_0x214881[_0x7753('0xc4')]][_0x7753('0x111')]&&_0x21a1eb[_0x7753('0x112')]===_0x7753('0x113')){delete this[_0x7753('0x28')][_0x21a1eb[_0x7753('0xc5')]];this[_0x7753('0xc7')](this[_0x7753('0x20')][_0x214881['queue']]);this['voiceQueues'][_0x214881[_0x7753('0xc4')]][_0x7753('0xc9')]+=0x1;this[_0x7753('0x20')][_0x214881[_0x7753('0xc4')]][_0x7753('0x114')]+=0x1;_0x5582cc=new Hangup(_0x214881,_0x21a1eb);_0x5582cc[_0x7753('0x73')]=0x12;_0x5582cc[_0x7753('0x74')]=_0x7753('0x115');_0x5582cc[_0x7753('0x116')]=_0x7753('0x117');ami[_0x7753('0x44')]('custom:amd',ut[_0x7753('0x118')](_0x5582cc,'amd'));this[_0x7753('0x119')](_0x5582cc,'[syncHangupInAMD][createHistory]',_0x7753('0x11a'));}if(_0x214881[_0x7753('0x45')]!==_0x7753('0xc6')&&this[_0x7753('0x20')][_0x214881[_0x7753('0xc4')]]['dialAMDActive']&&_0x21a1eb[_0x7753('0x112')]===_0x7753('0x11b')){return new Promise(function(_0x5d0481,_0x1930e7){delete _0x50ecc6['uniqueId'][_0x21a1eb[_0x7753('0xc5')]];_0x50ecc6['updateOriginated'](_0x50ecc6[_0x7753('0x20')][_0x214881[_0x7753('0xc4')]]);_0x50ecc6['voiceQueues'][_0x214881[_0x7753('0xc4')]][_0x7753('0xc9')]+=0x1;_0x50ecc6[_0x7753('0x20')][_0x214881['queue']][_0x7753('0x114')]+=0x1;var _0x4eb6e2=_0x50ecc6[_0x7753('0x20')][_0x214881[_0x7753('0xc4')]];var _0x40a90d=new Hangup(_0x214881,_0x21a1eb);_0x40a90d['state']=0x13;_0x40a90d[_0x7753('0x74')]=_0x7753('0x11c');_0x40a90d['membername']='AMD';_0x40a90d[_0x7753('0x11d')]+=0x1;_0x40a90d[_0x7753('0xea')]+=0x1;_0x40a90d['amd']=!![];ami[_0x7753('0x44')]('custom:amd',ut[_0x7753('0x118')](_0x40a90d,_0x7753('0x11e')));hopperUtils[_0x7753('0x11f')](_0x40a90d)[_0x7753('0xa8')](loggerCatch(_0x7753('0x120')));if(_0x40a90d[_0x7753('0x121')]+_0x40a90d[_0x7753('0x122')]+_0x40a90d[_0x7753('0x123')]+_0x40a90d[_0x7753('0x124')]+_0x40a90d[_0x7753('0xda')]+_0x40a90d[_0x7753('0xe9')]+_0x40a90d[_0x7753('0x11d')]+_0x40a90d['countagentrejectretry']>=_0x4eb6e2[_0x7753('0x125')]){_0x50ecc6[_0x7753('0x126')](_0x40a90d,_0x5d0481,_0x1930e7,_0x7753('0x127'));}else{if(_0x40a90d[_0x7753('0x11d')]>=_0x4eb6e2[_0x7753('0x128')]){_0x50ecc6[_0x7753('0x129')](_0x40a90d,_0x5d0481,_0x1930e7,_0x7753('0x12a'));}else{hopperUtils[_0x7753('0xde')]({'active':![],'countmachineretry':_0x40a90d[_0x7753('0x11d')],'scheduledat':moment()[_0x7753('0xec')](_0x4eb6e2[_0x7753('0x12b')],_0x7753('0xdf'))[_0x7753('0x48')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x40a90d[_0x7753('0xe0')],'ListId':_0x40a90d['ListId'],'VoiceQueueId':_0x40a90d['VoiceQueueId']||undefined,'CampaignId':_0x40a90d[_0x7753('0xfc')]||undefined})[_0x7753('0xa8')](loggerCatch(_0x7753('0x12c')));_0x5d0481({'reschedule':0x1});}}});}if(_0x214881[_0x7753('0x45')]==='ivr'&&this[_0x7753('0x21')][_0x214881[_0x7753('0xc4')]][_0x7753('0x111')]&&_0x21a1eb[_0x7753('0x112')]==='HANGUP'){delete this[_0x7753('0x28')][_0x21a1eb[_0x7753('0xc5')]];this[_0x7753('0xc7')](this[_0x7753('0x21')][_0x214881[_0x7753('0xc4')]]);_0x5582cc=new Hangup(_0x214881,_0x21a1eb);_0x5582cc[_0x7753('0x73')]=0x12;_0x5582cc[_0x7753('0x74')]=_0x7753('0x115');_0x5582cc['membername']=_0x7753('0x117');ami[_0x7753('0x44')](_0x7753('0x12d'),ut[_0x7753('0x118')](_0x5582cc,_0x7753('0x11e')));this[_0x7753('0x119')](_0x5582cc,_0x7753('0x12e'),'[syncHangupInAMDIvr]');}if(_0x214881[_0x7753('0x45')]===_0x7753('0xc6')&&this[_0x7753('0x21')][_0x214881[_0x7753('0xc4')]][_0x7753('0x111')]&&_0x21a1eb['value']===_0x7753('0x11b')){return new Promise(function(_0x304c51,_0x4fe865){delete _0x50ecc6[_0x7753('0x28')][_0x21a1eb['uniqueid']];_0x50ecc6['updateOriginated'](_0x50ecc6[_0x7753('0x21')][_0x214881[_0x7753('0xc4')]]);_0x50ecc6[_0x7753('0x21')][_0x214881[_0x7753('0xc4')]][_0x7753('0xc9')]+=0x1;_0x50ecc6[_0x7753('0x21')][_0x214881[_0x7753('0xc4')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x4b47ab=_0x50ecc6[_0x7753('0x21')][_0x214881[_0x7753('0xc4')]];var _0x25a225=new Hangup(_0x214881,_0x21a1eb);_0x25a225[_0x7753('0x73')]=0x13;_0x25a225[_0x7753('0x74')]='Machine';_0x25a225['membername']=_0x7753('0x117');_0x25a225['countmachineretry']+=0x1;_0x25a225[_0x7753('0xea')]+=0x1;_0x25a225[_0x7753('0x11e')]=!![];ami[_0x7753('0x44')]('custom:amd',ut[_0x7753('0x118')](_0x25a225,_0x7753('0x11e')));hopperUtils[_0x7753('0x11f')](_0x25a225)[_0x7753('0xa8')](loggerCatch(_0x7753('0x120')));if(_0x25a225['countbusyretry']+_0x25a225[_0x7753('0x122')]+_0x25a225[_0x7753('0x123')]+_0x25a225[_0x7753('0x124')]+_0x25a225[_0x7753('0xda')]+_0x25a225[_0x7753('0xe9')]+_0x25a225[_0x7753('0x11d')]+_0x25a225[_0x7753('0x12f')]>=_0x4b47ab[_0x7753('0x125')]){_0x50ecc6[_0x7753('0x126')](_0x25a225,_0x304c51,_0x4fe865,_0x7753('0x127'));}else{if(_0x25a225['countmachineretry']>=_0x4b47ab[_0x7753('0x128')]){_0x50ecc6[_0x7753('0x129')](_0x25a225,_0x304c51,_0x4fe865,_0x7753('0x12a'));}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x25a225[_0x7753('0x11d')],'scheduledat':moment()[_0x7753('0xec')](_0x4b47ab[_0x7753('0x12b')],_0x7753('0xdf'))[_0x7753('0x48')](_0x7753('0xc8')),'ContactId':_0x25a225[_0x7753('0xe0')],'ListId':_0x25a225['ListId'],'VoiceQueueId':_0x25a225[_0x7753('0xe1')]||undefined,'CampaignId':_0x25a225[_0x7753('0xfc')]||undefined})[_0x7753('0xa8')](loggerCatch('[rescheduleContact][Machine]'));_0x304c51({'reschedule':0x1});}}});}}};Dialer[_0x7753('0x90')][_0x7753('0x38')]=function(_0x3fad26){var _0x37dbab=this['uniqueId'][_0x3fad26[_0x7753('0xc5')]];var _0x5ea8be;if(_0x37dbab&&_0x37dbab[_0x7753('0x45')]==='ivr'){delete this[_0x7753('0x28')][_0x3fad26['uniqueid']];this[_0x7753('0xc7')](this[_0x7753('0x21')][_0x37dbab[_0x7753('0xc4')]]);this[_0x7753('0x21')][_0x37dbab[_0x7753('0xc4')]][_0x7753('0x130')]+=0x1;_0x5ea8be=new Hangup(_0x37dbab,_0x3fad26);hopperUtils['createHistory'](_0x5ea8be)['catch'](loggerCatch(_0x7753('0x131')));hopperUtils[_0x7753('0xcf')](_0x5ea8be)[_0x7753('0xa8')](loggerCatch(_0x7753('0x132')));}if(_0x37dbab&&_0x37dbab[_0x7753('0x45')]!==_0x7753('0xc6')&&isNotNull(this[_0x7753('0x20')][_0x37dbab[_0x7753('0xc4')]][_0x7753('0x133')])){delete this['uniqueId'][_0x3fad26['uniqueid']];this[_0x7753('0xc7')](this[_0x7753('0x20')][_0x37dbab[_0x7753('0xc4')]]);this[_0x7753('0x20')][_0x37dbab[_0x7753('0xc4')]][_0x7753('0xc9')]+=0x1;this[_0x7753('0x20')][_0x37dbab[_0x7753('0xc4')]][_0x7753('0x114')]+=0x1;_0x5ea8be=new Hangup(_0x37dbab,_0x3fad26);_0x5ea8be['state']=0x10;_0x5ea8be[_0x7753('0x74')]=_0x7753('0x134');_0x5ea8be[_0x7753('0x116')]=_0x7753('0x135');hopperUtils[_0x7753('0x11f')](_0x5ea8be)[_0x7753('0xa8')](loggerCatch(_0x7753('0x131')));hopperUtils[_0x7753('0xcf')](_0x5ea8be)['catch'](loggerCatch(_0x7753('0x132')));}if(_0x37dbab&&_0x37dbab[_0x7753('0x45')]!=='ivr'&&!isNotNull(this[_0x7753('0x20')][_0x37dbab[_0x7753('0xc4')]][_0x7753('0x133')])){delete this[_0x7753('0x28')][_0x3fad26['uniqueid']];this[_0x7753('0xc7')](this[_0x7753('0x20')][_0x37dbab[_0x7753('0xc4')]]);this[_0x7753('0x20')][_0x37dbab[_0x7753('0xc4')]][_0x7753('0x136')]+=0x1;_0x5ea8be=new Hangup(_0x37dbab,_0x3fad26);_0x5ea8be[_0x7753('0x73')]=0xc;_0x5ea8be[_0x7753('0x74')]=_0x3fad26[_0x7753('0x137')];_0x5ea8be[_0x7753('0x116')]='Unknow';hopperUtils[_0x7753('0x11f')](_0x5ea8be)[_0x7753('0xa8')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0x7753('0xcf')](_0x5ea8be)[_0x7753('0xa8')](loggerCatch(_0x7753('0x132')));}};Dialer[_0x7753('0x90')][_0x7753('0xb')]=function(_0x5e7d53){var _0x342c7d=this;if(!_0x342c7d[_0x7753('0x138')][_0x5e7d53[_0x7753('0x64')]]){_0x342c7d[_0x7753('0x138')][_0x5e7d53[_0x7753('0x64')]]={'running':![]};}else if(_0x342c7d[_0x7753('0x138')][_0x5e7d53[_0x7753('0x64')]][_0x7753('0x139')]===!![]){return;}else if(_0x342c7d[_0x7753('0x138')][_0x5e7d53['name']][_0x7753('0x139')]===![]){_0x342c7d[_0x7753('0x138')][_0x5e7d53['name']][_0x7753('0x139')]=!![];}var _0x1df937=_0x342c7d[_0x7753('0x20')][_0x5e7d53['name']];var _0x3d8081=_0x1df937['message']!==utils[_0x7753('0x6e')]['INACTIVE'];var _0x5de821=utils['isPreviewCampaign'](_0x1df937);_0x1df937[_0x7753('0x13a')]=utils[_0x7753('0x13b')](_0x1df937,_0x342c7d['trunks']);Promise[_0x7753('0xb3')]()[_0x7753('0x41')](function(){if(_0x1df937[_0x7753('0x13a')]===utils[_0x7753('0x6e')][_0x7753('0x80')]){if(_0x3d8081){clearPredictiveAttributes(_0x1df937);_0x5e7d53[_0x7753('0x66')]=undefined;_0x5e7d53['startProgressive']=undefined;}if(_0x1df937['statusMessage']===utils['CAMPAIGN_STATUS']['INACTIVE']){_0x5e7d53[_0x7753('0x13c')]=0x0;_0x5e7d53[_0x7753('0xff')]=0x0;_0x5e7d53[_0x7753('0x13d')]=0x0;_0x5e7d53[_0x7753('0x13e')]=0x0;_0x5e7d53['pTalking']=0x0;}}else if(_0x1df937[_0x7753('0x13a')]===utils[_0x7753('0x6e')][_0x7753('0x13f')]&&!_0x5de821){return _0x342c7d[_0x7753('0x98')](_0x1df937,!![])[_0x7753('0x41')](function(){return _0x342c7d[_0x7753('0x98')](_0x1df937,![]);})[_0x7753('0x41')](function(){return _0x342c7d[_0x7753('0xb7')](_0x1df937);})[_0x7753('0xa8')](function(_0x4de41f){loggerSyncQueueSummary[_0x7753('0x63')]('[syncQueueSummary]',util[_0x7753('0x6b')](_0x4de41f,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x1df937);});}else{clearPredictiveAttributes(_0x1df937);}})['then'](function(){var _0x108ba7=_0x5e7d53['compareToOutboundQueue'](_0x1df937);if(_0x108ba7||_0x1df937[_0x7753('0x140')]){_0x1df937[_0x7753('0x140')]=![];_0x5e7d53[_0x7753('0x141')](_0x1df937);Object[_0x7753('0x142')](_0x1df937,_0x5e7d53);emitOutboundVoiceQueueSummary(_0x5e7d53);}_0x342c7d[_0x7753('0x138')][_0x1df937[_0x7753('0x64')]][_0x7753('0x139')]=![];})['catch'](function(_0x4518b8){logger['error'](_0x7753('0x143'),util[_0x7753('0x6b')](_0x4518b8,{'showHidden':![],'depth':null}));_0x342c7d[_0x7753('0x138')][_0x1df937[_0x7753('0x64')]][_0x7753('0x139')]=![];});};Dialer[_0x7753('0x90')][_0x7753('0x36')]=_[_0x7753('0x144')](function(){var _0x374f9d=_[_0x7753('0x145')](this['voiceQueues'],function(_0x5f5b2a){return _0x5f5b2a[_0x7753('0x146')];});var _0x22760c=_[_0x7753('0x145')](this[_0x7753('0x22')],function(_0x5613f9){return _0x5613f9[_0x7753('0x147')]&&_0x5613f9['status']===_0x7753('0x8e');});if(_0x374f9d[_0x7753('0xfe')]>0x0&&_0x22760c['length']>0x0){return Promise[_0x7753('0xb3')]()['then'](cmHopper[_0x7753('0x148')](_[_0x7753('0x149')](_0x374f9d,'id'),previewRecallmeReminderInterval,_[_0x7753('0x149')](_0x22760c,'id')))['then'](function(_0x5ab250){for(var _0x1dcbb4=0x0;_0x1dcbb4<_0x5ab250[_0x7753('0xfe')];_0x1dcbb4++){var _0xa63683=_0x5ab250[_0x1dcbb4][_0x7753('0x14a')][_0x7753('0x64')];if(_0xa63683)io['to'](util[_0x7753('0x48')]('user:%s',_0xa63683))['emit'](_0x7753('0x14b'),{'hopper':_0x5ab250[_0x1dcbb4]});}})['catch'](function(_0x284d9c){logger[_0x7753('0x69')](_0x7753('0x14c'),_0x284d9c);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x7753('0x90')]['loopClearZombieChannels']=function(){var _0x257a6b=this;setInterval(function(){_0x257a6b[_0x7753('0x14d')](_0x257a6b['uniqueId'],_0x7753('0x14e'));_0x257a6b[_0x7753('0x14d')](_0x257a6b['actions'],_0x7753('0x14f'));},0x32c8);};Dialer[_0x7753('0x90')][_0x7753('0x14d')]=function(_0x28ed43,_0x54566a){var _0x23816b=this;for(var _0x535b54 in _0x28ed43){if(typeof _0x28ed43[_0x535b54]!==_0x7753('0xb2')){this[_0x7753('0x1e')][_0x7753('0x150')](function(){if(!_['isNil'](_0x28ed43[_0x535b54])){return ami[_0x7753('0xa1')]({'action':_0x7753('0x8d'),'channel':_0x28ed43[_0x535b54][_0x7753('0xf1')]})['catch'](function(_0x5b3a02){if(_0x5b3a02[_0x7753('0x6d')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x28ed43[_0x535b54]&&_0x28ed43[_0x535b54]['type']!==_0x7753('0xc6')){_0x23816b[_0x7753('0xc7')](_0x23816b[_0x7753('0x20')][_0x28ed43[_0x535b54][_0x7753('0xc4')]]);logger['error'](_0x7753('0x151'),_0x54566a,_0x535b54,_0x28ed43[_0x535b54][_0x7753('0xc4')]);delete _0x28ed43[_0x535b54];}if(_0x28ed43[_0x535b54]&&_0x28ed43[_0x535b54]['type']===_0x7753('0xc6')){_0x23816b[_0x7753('0xc7')](_0x23816b[_0x7753('0x21')][_0x28ed43[_0x535b54]['queue']]);logger[_0x7753('0x69')]('[Dialer][checkChannel][ivr]',_0x54566a,_0x535b54,_0x28ed43[_0x535b54][_0x7753('0xc4')]);delete _0x28ed43[_0x535b54];}},0x2328);}});}});}}};Dialer[_0x7753('0x90')][_0x7753('0x152')]=function(_0x56aa2f){return Promise[_0x7753('0xb3')]()[_0x7753('0x41')](voiceQueueRt[_0x7753('0x152')](_0x56aa2f))[_0x7753('0xa8')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0x7753('0x90')]['updateOriginated']=function(_0x1c2c19){if(!_[_0x7753('0x43')](_0x1c2c19)&&_0x1c2c19!==null){if(typeof _0x1c2c19['originated']!=='undefined'){if(_0x1c2c19[_0x7753('0x84')]>0x0){_0x1c2c19[_0x7753('0x84')]-=0x1;}else{logger[_0x7753('0x69')](_0x7753('0x153'));}}}else{logger[_0x7753('0x69')](_0x7753('0x154'));}};Dialer[_0x7753('0x90')]['loggerHandler']=function(_0x502e86,_0x3ea466){var _0x3b95f1=this;return function(_0x24ac3f){_0x3b95f1['updateOriginated'](_0x3ea466);logger['error'](_0x502e86,util['inspect'](_0x24ac3f,{'showHidden':![],'depth':null}));};};Dialer[_0x7753('0x90')][_0x7753('0x155')]=function(_0x475d6f,_0x11fcc0,_0x879545){var _0x5130ef={'state':0x19,'statedesc':_0x7753('0x156')};this['updateOriginated'](_0x11fcc0);this[_0x7753('0x119')](_[_0x7753('0x61')](_0x5130ef,_[_0x7753('0x7a')](_0x879545,[_0x7753('0xe0'),_0x7753('0xee'),_0x7753('0x157'),_0x7753('0xe1'),_0x7753('0xfc')])),_0x7753('0x158'),'[emptyContact]');logger[_0x7753('0x69')](_0x475d6f);};Dialer['prototype'][_0x7753('0x119')]=function(_0x3fa1fa,_0x11cf73,_0x3cf0f7){hopperUtils[_0x7753('0x11f')](_0x3fa1fa)[_0x7753('0xa8')](loggerCatch(_0x11cf73));hopperUtils[_0x7753('0xcf')](_0x3fa1fa)[_0x7753('0xa8')](loggerCatch(_0x3cf0f7));};Dialer[_0x7753('0x90')][_0x7753('0xdc')]=function(_0x3afcff,_0x1ca155){hopperUtils[_0x7753('0x11f')](_0x3afcff)['catch'](loggerCatch(_0x7753('0xce')));if(_0x1ca155==0x0){hopperUtils[_0x7753('0xcf')](_0x3afcff)[_0x7753('0xa8')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));}};Dialer[_0x7753('0x90')][_0x7753('0x14c')]=function(_0x20b5a8){return Promise[_0x7753('0xb3')]()[_0x7753('0x41')](cmHopper[_0x7753('0x148')](_0x20b5a8['id'],previewRecallmeReminderInterval))['then'](function(_0x5b7007){for(var _0x3835b5=0x0;_0x3835b5<_0x5b7007[_0x7753('0xfe')];_0x3835b5++){var _0x424255=_0x5b7007[_0x3835b5][_0x7753('0x14a')]['name'];if(_0x424255)io['to'](util['format']('user:%s',_0x424255))['emit'](_0x7753('0x14b'),{'hopper':_0x5b7007[_0x3835b5]});}})[_0x7753('0xa8')](function(){});};Dialer['prototype'][_0x7753('0x159')]=function(_0x319657){var _0x6c343=this;return function(){_0x6c343[_0x7753('0x15a')](_0x319657);};};Dialer[_0x7753('0x90')]['actionOriginate']=function(_0x2f4ee1,_0x3195e5){var _0x2c46d8=this;var _0x45d722=uuid['v4']();this[_0x7753('0x26')][_0x45d722]=new Action(_0x2f4ee1,_0x3195e5,_0x45d722);return new Promise(function(_0x45c1de,_0x2ba012){if(_['isUndefined'](_0x2f4ee1)&&typeof _0x2f4ee1!==_0x7753('0x15b')){return _0x2ba012(msgResponse('originate','Failure',_0x7753('0x15c')));}if(_[_0x7753('0x43')](_0x3195e5[_0x7753('0x15d')])||_0x3195e5[_0x7753('0x15d')]===null){return _0x2ba012(msgResponse(_0x7753('0x15e'),_0x7753('0x99'),_0x7753('0x15f')));}var _0x183116={'XMD-CALLERID':_0x2c46d8[_0x7753('0x26')][_0x45d722][_0x7753('0x160')](),'XMD-AGI':_0x2f4ee1[_0x7753('0x133')]?util['format'](_0x7753('0x161'),ipAgi,_0x2f4ee1[_0x7753('0x133')]):_0x7753('0x162'),'XMD-AGIAFTER':_0x2f4ee1[_0x7753('0xcc')]?util[_0x7753('0x48')]('\x22agi://%s/square,%s\x22',ipAgi,_0x2f4ee1[_0x7753('0xcc')]):_0x7753('0x162'),'XMD-QUEUE':utils['isOutboundQueue'](_0x2f4ee1)?util[_0x7753('0x48')](_0x7753('0x163'),_0x2f4ee1[_0x7753('0x64')],_0x2f4ee1[_0x7753('0x164')]||'',_0x2f4ee1['dialAgiAfterHangupAgent']?'c':'',_0x2f4ee1[_0x7753('0xd2')]||0x3):_0x7753('0x162'),'XMD-CONTACTID':_0x3195e5[_0x7753('0xe0')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x2c46d8[_0x7753('0x26')][_0x45d722][_0x7753('0x160')](),'XMD-AMD':_0x2f4ee1[_0x7753('0x111')]?'ACTIVE':_0x7753('0x162'),'XMD-DESTINATION':_0x7753('0x110')};if(_0x2f4ee1[_0x7753('0x111')]){_0x183116[_0x7753('0x165')]=_0x2f4ee1[_0x7753('0x166')]||0x9c4;_0x183116[_0x7753('0x167')]=_0x2f4ee1['dialAMDGreeting']||0x5dc;_0x183116['XMD-AMDAFTERGREETINGSILENCE']=_0x2f4ee1[_0x7753('0x168')]||0x320;_0x183116['XMD-AMDTOTALANALYSISTIME']=_0x2f4ee1['dialAMDTotalAnalysisTime']||0x1388;_0x183116[_0x7753('0x169')]=_0x2f4ee1['dialAMDMinWordLength']||0x64;_0x183116[_0x7753('0x16a')]=_0x2f4ee1[_0x7753('0x16b')]||0x32;_0x183116['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x2f4ee1[_0x7753('0x16c')]||0x3;_0x183116[_0x7753('0x16d')]=_0x2f4ee1['dialAMDSilenceThreshold']||0x100;_0x183116[_0x7753('0x16e')]=_0x2f4ee1[_0x7753('0x16f')]||0x1388;}if(utils[_0x7753('0x170')](_0x2f4ee1)){_0x183116['XMD-VOICEQUEUEID']=_0x3195e5['VoiceQueueId'];}else{_0x183116['XMD-CAMPAIGNID']=_0x3195e5[_0x7753('0xfc')];}var _0x395412=utils[_0x7753('0x171')](_0x3195e5['Contact']);Object[_0x7753('0x142')](_0x183116,_0x395412);var _0x3a9095=_0x2c46d8['isTrunkReachable'](_0x2f4ee1['Trunk'])?utils[_0x7753('0x172')](_0x2f4ee1[_0x7753('0x92')][_0x7753('0x173')],_0x2f4ee1[_0x7753('0x174')],_0x2f4ee1[_0x7753('0x175')]>0x0?utils[_0x7753('0x176')](_0x2f4ee1['dialOriginateCallerIdNumber'],_0x2f4ee1[_0x7753('0x175')]):_0x2f4ee1[_0x7753('0x177')]):utils[_0x7753('0x172')](_[_0x7753('0xf7')](_0x2f4ee1[_0x7753('0x93')])?_0x2f4ee1[_0x7753('0x92')][_0x7753('0x173')]:_0x2f4ee1[_0x7753('0x93')][_0x7753('0x173')],_0x2f4ee1[_0x7753('0x174')],_0x2f4ee1[_0x7753('0x175')]>0x0?utils[_0x7753('0x176')](_0x2f4ee1[_0x7753('0x177')],_0x2f4ee1['dialRandomLastDigitCallerIdNumber']):_0x2f4ee1[_0x7753('0x177')]);if(_0x3a9095){_0x183116[_0x7753('0x178')]=_0x2c46d8[_0x7753('0x26')][_0x45d722]['originatecalleridname']=utils[_0x7753('0x179')](_0x3a9095);_0x183116[_0x7753('0x17a')]=_0x3195e5['phone'];}_0x2f4ee1[_0x7753('0x17b')]=_0x183116;return ami[_0x7753('0xa1')]({'actionid':_0x45d722,'action':'originate','channel':_0x2c46d8[_0x7753('0x8a')](_0x2f4ee1[_0x7753('0x92')])?util[_0x7753('0x48')]('SIP/%s/%s%s',_0x2f4ee1[_0x7753('0x92')][_0x7753('0x64')],isNotNull(_0x2f4ee1[_0x7753('0x17c')])?_0x2f4ee1[_0x7753('0x17c')][_0x7753('0x17d')]()||'':'',_0x2f4ee1['dialCutDigit']>0x0?_0x3195e5[_0x7753('0x15d')][_0x7753('0x17e')](_0x2f4ee1['dialCutDigit']):_0x3195e5['phone']):util[_0x7753('0x48')](_0x7753('0x17f'),_[_0x7753('0xf7')](_0x2f4ee1[_0x7753('0x93')])?_0x2f4ee1['Trunk']['name']:_0x2f4ee1[_0x7753('0x93')][_0x7753('0x64')],isNotNull(_0x2f4ee1[_0x7753('0x17c')])?_0x2f4ee1[_0x7753('0x17c')][_0x7753('0x17d')]()||'':'',_0x2f4ee1[_0x7753('0x180')]>0x0?_0x3195e5[_0x7753('0x15d')]['substring'](_0x2f4ee1[_0x7753('0x180')]):_0x3195e5[_0x7753('0x15d')]),'callerid':_0x3a9095,'Exten':_0x7753('0x110'),'Context':_0x7753('0x181'),'Priority':'1','variable':_0x183116,'timeout':(_0x2f4ee1['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x45d722})['then'](function(_0x31b590){return _0x45c1de(_0x31b590);})[_0x7753('0xa8')](function(_0x5e730a){_0x2f4ee1[_0x7753('0x182')]+=0x1;var _0x85bbc9=new History(_0x2c46d8[_0x7753('0x26')][_0x45d722]);logger[_0x7753('0x69')](util[_0x7753('0x48')](_0x7753('0x183'),JSON[_0x7753('0x79')](_0x5e730a)));_0x85bbc9[_0x7753('0x73')]=0xe;_0x85bbc9[_0x7753('0x74')]=_0x7753('0x184');_0x85bbc9[_0x7753('0xe2')]=moment()[_0x7753('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x85bbc9[_0x7753('0x75')]=_0x85bbc9[_0x7753('0xe2')];hopperUtils[_0x7753('0x11f')](_0x85bbc9)['catch'](loggerCatch(_0x7753('0x185')));_0x2c46d8[_0x7753('0xcf')](_0x85bbc9)[_0x7753('0xa8')](loggerCatch(_0x7753('0x185')))[_0x7753('0x1d')](function(){delete _0x2c46d8[_0x7753('0x26')][_0x45d722];return _0x2ba012(msgResponse(_0x7753('0x15e'),'Error',_0x7753('0x186')));});});});};Dialer[_0x7753('0x90')][_0x7753('0x187')]=function(_0x116d95,_0x5d3e29,_0x2756ef){var _0x1c500e=new History(_0x5d3e29);if(_0x1c500e[_0x7753('0x121')]+_0x1c500e['countcongestionretry']+_0x1c500e[_0x7753('0x123')]+_0x1c500e[_0x7753('0x124')]+_0x1c500e[_0x7753('0xda')]+_0x1c500e['countabandonedretry']+_0x1c500e[_0x7753('0x11d')]+_0x1c500e[_0x7753('0x12f')]>=_0x2756ef['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x116d95){case 0x3:if(_0x1c500e[_0x7753('0x123')]>=_0x2756ef['dialNoAnswerMaxRetry']-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countnoanswerretry':_0x1c500e[_0x7753('0x123')]+=0x1,'scheduledat':moment()['add'](_0x2756ef['dialNoAnswerRetryFrequency'],_0x7753('0xdf'))['format'](_0x7753('0xc8')),'ContactId':_0x1c500e[_0x7753('0xe0')],'ListId':_0x1c500e[_0x7753('0xee')],'VoiceQueueId':_0x1c500e[_0x7753('0xe1')]||undefined,'CampaignId':_0x1c500e[_0x7753('0xfc')]||undefined})['catch'](loggerCatch(_0x7753('0x188')));break;case 0x5:if(_0x1c500e[_0x7753('0x121')]>=_0x2756ef[_0x7753('0x189')]-0x1){return!![];}hopperUtils[_0x7753('0xde')]({'active':![],'countbusyretry':_0x1c500e[_0x7753('0x121')]+=0x1,'scheduledat':moment()[_0x7753('0xec')](_0x2756ef[_0x7753('0x18a')],_0x7753('0xdf'))[_0x7753('0x48')](_0x7753('0xc8')),'ContactId':_0x1c500e['ContactId'],'ListId':_0x1c500e[_0x7753('0xee')],'VoiceQueueId':_0x1c500e['VoiceQueueId']||undefined,'CampaignId':_0x1c500e['CampaignId']||undefined})[_0x7753('0xa8')](loggerCatch(_0x7753('0x18b')));break;case 0x8:if(_0x1c500e[_0x7753('0x122')]>=_0x2756ef[_0x7753('0x18c')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countcongestionretry':_0x1c500e[_0x7753('0x122')]+=0x1,'scheduledat':moment()[_0x7753('0xec')](_0x2756ef[_0x7753('0x18d')],_0x7753('0xdf'))[_0x7753('0x48')](_0x7753('0xc8')),'ContactId':_0x1c500e['ContactId'],'ListId':_0x1c500e[_0x7753('0xee')],'VoiceQueueId':_0x1c500e['VoiceQueueId']||undefined,'CampaignId':_0x1c500e['CampaignId']||undefined})[_0x7753('0xa8')](loggerCatch(_0x7753('0x18e')));break;case 0x0:if(_0x1c500e[_0x7753('0x124')]>=_0x2756ef[_0x7753('0x18f')]-0x1){return!![];}else{hopperUtils[_0x7753('0xde')]({'active':![],'countnosuchnumberretry':_0x1c500e[_0x7753('0x124')]+=0x1,'scheduledat':moment()[_0x7753('0xec')](_0x2756ef['dialNoSuchNumberRetryFrequency'],'minutes')[_0x7753('0x48')](_0x7753('0xc8')),'ContactId':_0x1c500e[_0x7753('0xe0')],'ListId':_0x1c500e[_0x7753('0xee')],'VoiceQueueId':_0x1c500e[_0x7753('0xe1')]||undefined,'CampaignId':_0x1c500e[_0x7753('0xfc')]||undefined})['catch'](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x1c500e['countdropretry']>=_0x2756ef[_0x7753('0xdb')]-0x1){return!![];}hopperUtils[_0x7753('0xde')]({'active':![],'countdropretry':_0x1c500e[_0x7753('0xda')]+=0x1,'scheduledat':moment()[_0x7753('0xec')](_0x2756ef[_0x7753('0xd6')],_0x7753('0xdf'))[_0x7753('0x48')](_0x7753('0xc8')),'ContactId':_0x1c500e[_0x7753('0xe0')],'ListId':_0x1c500e[_0x7753('0xee')],'VoiceQueueId':_0x1c500e[_0x7753('0xe1')]||undefined,'CampaignId':_0x1c500e[_0x7753('0xfc')]||undefined})['catch'](loggerCatch(_0x7753('0x190')));break;case 0xb:if(_0x1c500e[_0x7753('0xe9')]>=_0x2756ef[_0x7753('0xeb')]-0x1){return!![];}hopperUtils[_0x7753('0xde')]({'active':![],'countabandonedretry':_0x1c500e[_0x7753('0xe9')]+=0x1,'scheduledat':moment()[_0x7753('0xec')](_0x2756ef[_0x7753('0xed')],'minutes')[_0x7753('0x48')](_0x7753('0xc8')),'ContactId':_0x1c500e[_0x7753('0xe0')],'ListId':_0x1c500e['ListId'],'VoiceQueueId':_0x1c500e[_0x7753('0xe1')]||undefined,'CampaignId':_0x1c500e[_0x7753('0xfc')]||undefined})[_0x7753('0xa8')](loggerCatch(_0x7753('0xef')));break;case 0x13:if(_0x1c500e[_0x7753('0x11d')]>=_0x2756ef[_0x7753('0x128')]-0x1){return!![];}hopperUtils[_0x7753('0xde')]({'active':![],'countmachineretry':_0x1c500e[_0x7753('0x11d')]+=0x1,'scheduledat':moment()[_0x7753('0xec')](_0x2756ef[_0x7753('0x12b')],_0x7753('0xdf'))['format'](_0x7753('0xc8')),'ContactId':_0x1c500e[_0x7753('0xe0')],'ListId':_0x1c500e[_0x7753('0xee')],'VoiceQueueId':_0x1c500e[_0x7753('0xe1')]||undefined,'CampaignId':_0x1c500e[_0x7753('0xfc')]||undefined})[_0x7753('0xa8')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x1c500e[_0x7753('0x12f')]>=_0x2756ef[_0x7753('0x191')]-0x1){return!![];}hopperUtils[_0x7753('0xde')]({'active':![],'countagentrejectretry':_0x1c500e[_0x7753('0x12f')]+=0x1,'scheduledat':moment()['add'](_0x2756ef[_0x7753('0x192')],_0x7753('0xdf'))[_0x7753('0x48')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1c500e['ContactId'],'ListId':_0x1c500e[_0x7753('0xee')],'VoiceQueueId':_0x1c500e['VoiceQueueId']||undefined,'CampaignId':_0x1c500e[_0x7753('0xfc')]||undefined})['catch'](loggerCatch(_0x7753('0x193')));break;default:return!![];}};Dialer[_0x7753('0x90')][_0x7753('0x10c')]=function(_0x23c024,_0x5098a5,_0x4dc686){var _0x9220cf=this;var _0xa52616=new History(_0x23c024);var _0x3fc778=![];var _0x53cb6b;var _0x5c32ac;return new Promise(function(_0x286e71,_0x410e11){if(_['isUndefined'](_0x5098a5)&&typeof _0x5098a5!=='object'){return _0x410e11(msgResponse(_0x7753('0x194'),_0x7753('0x99'),_0x7753('0x195')));}if(_[_0x7753('0x43')](_0x4dc686)&&typeof _0x4dc686!==_0x7753('0x15b')){return _0x410e11(msgResponse('[callProgressDetecting]','Failure',_0x7753('0x196')));}hopperUtils[_0x7753('0xd8')](_0xa52616,_0x4dc686[_0x7753('0x197')],_0x5098a5)[_0x7753('0x41')](function(_0x4302e2){if(_0x4302e2['additional']==0x1)_0x3fc778=!![];switch(_0x4dc686[_0x7753('0x197')]){case'0':_0x5098a5[_0x7753('0x198')]+=0x1;_0xa52616[_0x7753('0x73')]=0x0;_0xa52616['statedesc']=_0x7753('0x199');_0xa52616[_0x7753('0x124')]+=0x1;_0xa52616[_0x7753('0xea')]+=0x1;ami[_0x7753('0x44')]('custom:agentnosuchnumber',ut[_0x7753('0x118')](_0x23c024,'nosuchnumber'));_0x53cb6b=_0x5098a5['dialNoSuchNumberRetryFrequency'];_0x5c32ac=_0x5098a5[_0x7753('0xd7')];hopperUtils[_0x7753('0x11f')](_0xa52616)[_0x7753('0xa8')](loggerCatch(_0x7753('0x120')));if(_0x9220cf['checkRetriveMax'](0x0,_0x23c024,_0x5098a5)&&!_0x3fc778){if(_0xa52616['countnosuchnumberretry']>=_0x5098a5['dialNoSuchNumberMaxRetry']){_0x9220cf['createStateFinal'](_0xa52616,_0x286e71,_0x410e11,_0x7753('0x19a'));}else{_0x9220cf[_0x7753('0x126')](_0xa52616,_0x286e71,_0x410e11,_0x7753('0x19a'));}}break;case'3':_0x5098a5['outboundNoAnswerCallsDay']+=0x1;_0xa52616['state']=0x3;_0xa52616[_0x7753('0x74')]='NoAnswer';_0xa52616[_0x7753('0x123')]+=0x1;_0xa52616['countglobal']+=0x1;var _0x3f7b46=ut[_0x7753('0x19b')](_0x23c024,_0x5098a5);ami['emit'](_0x7753('0x19c'),_0x3f7b46);_0x53cb6b=_0x5098a5[_0x7753('0x19d')];_0x5c32ac=_0x5098a5[_0x7753('0xd7')];hopperUtils[_0x7753('0x11f')](_0xa52616)[_0x7753('0xa8')](loggerCatch(_0x7753('0x19e')));if(_0x9220cf['checkRetriveMax'](0x3,_0x23c024,_0x5098a5)&&!_0x3fc778){if(_0xa52616[_0x7753('0x123')]>=_0x5098a5[_0x7753('0x19f')]){_0x9220cf[_0x7753('0x129')](_0xa52616,_0x286e71,_0x410e11,_0x7753('0x1a0'));}else{_0x9220cf['stateGlobal'](_0xa52616,_0x286e71,_0x410e11,_0x7753('0x1a0'));}}break;case'5':_0x5098a5[_0x7753('0x1a1')]+=0x1;_0xa52616[_0x7753('0x73')]=0x5;_0xa52616['statedesc']=_0x7753('0x1a2');_0xa52616[_0x7753('0x121')]+=0x1;_0xa52616[_0x7753('0xea')]+=0x1;ami[_0x7753('0x44')](_0x7753('0x1a3'),ut[_0x7753('0x118')](_0x23c024,'busy'));_0x53cb6b=_0x5098a5[_0x7753('0x18a')];_0x5c32ac=_0x5098a5[_0x7753('0xd7')];hopperUtils[_0x7753('0x11f')](_0xa52616)[_0x7753('0xa8')](loggerCatch(_0x7753('0x1a4')));if(_0x9220cf[_0x7753('0x187')](0x5,_0x23c024,_0x5098a5)&&!_0x3fc778){if(_0xa52616[_0x7753('0x121')]>=_0x5098a5[_0x7753('0x189')]){_0x9220cf[_0x7753('0x129')](_0xa52616,_0x286e71,_0x410e11,_0x7753('0x1a5'));}else{_0x9220cf[_0x7753('0x126')](_0xa52616,_0x286e71,_0x410e11,'reason\x205\x20busy');}}break;case'8':_0x5098a5[_0x7753('0x1a6')]+=0x1;_0xa52616[_0x7753('0x73')]=0x8;_0xa52616[_0x7753('0x74')]=_0x7753('0x1a7');_0xa52616[_0x7753('0x122')]+=0x1;_0xa52616[_0x7753('0xea')]+=0x1;_0x53cb6b=_0x5098a5['dialCongestionRetryFrequency'];_0x5c32ac=_0x5098a5[_0x7753('0xd7')];ami[_0x7753('0x44')](_0x7753('0x1a8'),ut[_0x7753('0x118')](_0x23c024,_0x7753('0x1a9')));hopperUtils[_0x7753('0x11f')](_0xa52616)[_0x7753('0xa8')](loggerCatch(_0x7753('0x1aa')));if(_0x9220cf[_0x7753('0x187')](0x8,_0x23c024,_0x5098a5)&&!_0x3fc778){if(_0xa52616['countcongestionretry']>=_0x5098a5['dialCongestionMaxRetry']){_0x9220cf[_0x7753('0x129')](_0xa52616,_0x286e71,_0x410e11,'reason\x208\x20congestion');}else{_0x9220cf[_0x7753('0x126')](_0xa52616,_0x286e71,_0x410e11,_0x7753('0x1ab'));}}break;case'11':_0x5098a5[_0x7753('0x1ac')]+=0x1;_0xa52616['state']=0xb;_0xa52616[_0x7753('0x74')]=_0x7753('0xe7');_0xa52616['countabandonedretry']+=0x1;_0xa52616[_0x7753('0xea')]+=0x1;_0x53cb6b=_0x5098a5[_0x7753('0xed')];_0x5c32ac=_0x5098a5[_0x7753('0xd7')];hopperUtils[_0x7753('0x11f')](_0xa52616)['catch'](loggerCatch(_0x7753('0xf0')));if(_0x9220cf[_0x7753('0x187')](0xb,_0x23c024,_0x5098a5)&&!_0x3fc778){if(_0xa52616['countabandonedretry']>=_0x5098a5[_0x7753('0xeb')]){_0x9220cf['createStateFinal'](_0xa52616,_0x286e71,_0x410e11,_0x7753('0x1ad'));}else{_0x9220cf[_0x7753('0x126')](_0xa52616,_0x286e71,_0x410e11,_0x7753('0x1ad'));}}break;case'20':_0x5098a5['outboundRejectCallsDay']+=0x1;_0xa52616[_0x7753('0x73')]=0x14;_0xa52616[_0x7753('0x74')]=_0x7753('0x1ae');_0xa52616[_0x7753('0x12f')]+=0x1;_0xa52616[_0x7753('0xea')]+=0x1;_0x53cb6b=_0x5098a5['dialAgentRejectRetryFrequency'];_0x5c32ac=_0x5098a5['callAdditionalPhoneAfterMin'];ami[_0x7753('0x44')](_0x7753('0x1af'),ut[_0x7753('0x118')](_0x23c024,'agentreject'));hopperUtils['createHistory'](_0xa52616)[_0x7753('0xa8')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x9220cf['checkRetriveMax'](0x14,_0x23c024,_0x5098a5)&&!_0x3fc778){if(_0xa52616['countagentrejectretry']>=_0x5098a5[_0x7753('0x191')]){_0x9220cf[_0x7753('0x129')](_0xa52616,_0x286e71,_0x410e11,_0x7753('0x1b0'));}else{_0x9220cf[_0x7753('0x126')](_0xa52616,_0x286e71,_0x410e11,'reason\x2020\x20agentreject');}}break;default:_0x5098a5[_0x7753('0x136')]+=0x1;_0xa52616[_0x7753('0x73')]=0xc;_0xa52616['statedesc']=_0x4dc686[_0x7753('0x197')];_0x53cb6b=_0x5098a5['dialAgentRejectRetryFrequency'];_0x5c32ac=_0x5098a5['callAdditionalPhoneAfterMin'];hopperUtils[_0x7753('0x11f')](_0xa52616)[_0x7753('0xa8')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x9220cf[_0x7753('0x187')](_0x4dc686[_0x7753('0x197')],_0x23c024,_0x5098a5)&&!_0x3fc778){if(_0xa52616['countbusyretry']+_0xa52616['countcongestionretry']+_0xa52616['countnoanswerretry']+_0xa52616[_0x7753('0x124')]+_0xa52616[_0x7753('0xda')]+_0xa52616[_0x7753('0xe9')]+_0xa52616[_0x7753('0x11d')]+_0xa52616[_0x7753('0x12f')]>=_0x5098a5[_0x7753('0x125')]){_0x9220cf[_0x7753('0x126')](_0xa52616,_0x286e71,_0x410e11,_0x4dc686[_0x7753('0x197')]);}else{_0x9220cf[_0x7753('0x129')](_0xa52616,_0x286e71,_0x410e11,_0x4dc686['reason']);}}}})['then'](function(){if(_0x3fc778){hopperUtils['swapAdditionalPhones'](_0xa52616,_0x53cb6b,_0x5c32ac)[_0x7753('0x41')](function(){return _0x286e71(0x1);});}});});};Dialer[_0x7753('0x90')][_0x7753('0x126')]=function(_0x3860a1,_0x5d4b6b,_0x2e91f5,_0x58877f){var _0x2ee966=new Final(_0x3860a1);_0x2ee966[_0x7753('0x73')]=0xf;_0x2ee966[_0x7753('0x74')]=_0x7753('0x1b1');this['createStateFinal'](_0x2ee966,_0x5d4b6b,_0x2e91f5,_0x58877f);};Dialer[_0x7753('0x90')][_0x7753('0x129')]=function(_0x5ed6ab,_0x2108a7,_0xf8e141,_0x13c489){hopperUtils[_0x7753('0xcf')](_0x5ed6ab)[_0x7753('0x41')](function(){return _0x2108a7(msgResponse(_0x7753('0x194'),_0x7753('0x1b2'),_0x13c489));})[_0x7753('0xa8')](function(){return _0xf8e141(msgResponse(_0x7753('0x1b3'),_0x7753('0x99'),'contact\x20not\x20moved'));});};Dialer[_0x7753('0x90')]['predictive']=function(_0x5cdbc6){var _0x3820f5=_0x5cdbc6['dialPredictiveOptimizationPercentage']/0x64;var _0x54eee0=_0x5cdbc6['outboundDropCallsDayTimeout']/(_0x5cdbc6[_0x7753('0x1b4')]+_0x5cdbc6['outboundAnswerCallsDay']);var _0x3f8007=Math[_0x7753('0x1b5')](_0x5cdbc6[_0x7753('0x1b6')]*(_0x5cdbc6['predictiveIntervalMaxThreshold']/0x64));var _0x546f3f=Math[_0x7753('0x1b5')](_0x5cdbc6[_0x7753('0x1b6')]*(_0x5cdbc6[_0x7753('0x1b7')]/0x64));var _0x2e9cf6=_0x5cdbc6[_0x7753('0x13c')]+_0x5cdbc6['talking'];var _0x2a7b82=Math[_0x7753('0x1b8')](_0x5cdbc6[_0x7753('0x5c')]*_0x5cdbc6[_0x7753('0x5f')]*_0x5cdbc6[_0x7753('0x1b9')]*_0x5cdbc6[_0x7753('0x1ba')]);if(_[_0x7753('0x43')](_0x5cdbc6['startProgressive'])){if(!_['isUndefined'](_0x5cdbc6[_0x7753('0x66')])){_0x5cdbc6['startPredictive']=undefined;loggerPredictive[_0x7753('0x69')](_0x7753('0x1bb'),_0x7753('0x1bc'));}if(!_['isUndefined'](_0x5cdbc6[_0x7753('0x67')])){loggerPredictive[_0x7753('0x69')]('[startMethodPredictive][StartProgressive]',_0x7753('0x1bd'));clearInterval(_0x5cdbc6['handlePredictive']);_0x5cdbc6[_0x7753('0x67')]=undefined;}_0x5cdbc6['startProgressive']=moment()[_0x7753('0x48')](_0x7753('0xc8'));loggerPredictive[_0x7753('0x4b')](_0x5cdbc6[_0x7753('0x64')],'collection\x20data\x20in\x20progressive\x20at',_0x5cdbc6[_0x7753('0x29')]);this[_0x7753('0xbb')](_0x5cdbc6,0x1);}else if(ifInterval(_0x5cdbc6[_0x7753('0x1be')],_0x5cdbc6['startProgressive'])){this['handlePower'](_0x5cdbc6,0x1);loggerPredictiveCalls[_0x7753('0x4b')](_0x7753('0x1bf'),_0x5cdbc6[_0x7753('0x29')],_0x5cdbc6[_0x7753('0x64')]);_0x5cdbc6[_0x7753('0x5c')]=0x0;_0x5cdbc6['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x3820f5<_0x54eee0&&_0x5cdbc6['dialPredictiveOptimization']===_0x7753('0x1c0')){clearPredictiveAttributes(_0x5cdbc6);loggerPredictive[_0x7753('0x4b')](_0x7753('0x1c1'),_0x7753('0x1c2'),_0x54eee0,_0x7753('0x29'),_0x5cdbc6[_0x7753('0x64')]);}else if(_0x2a7b82<_0x5cdbc6[_0x7753('0xd3')]&&_0x5cdbc6[_0x7753('0x1c3')]===_0x7753('0x1c0')){clearPredictiveAttributes(_0x5cdbc6);loggerPredictive[_0x7753('0x4b')](_0x7753('0x1c4'),_0x7753('0x1c5'),_0x2a7b82,_0x7753('0x1c6'),_0x5cdbc6['predictiveIntervalErlangCallsDroppedCalls'],'startProgressive',_0x5cdbc6[_0x7753('0x64')]);}else if(!ifInterval(_0x5cdbc6[_0x7753('0x1be')],_0x5cdbc6['startProgressive'])&&_['isUndefined'](_0x5cdbc6[_0x7753('0x66')])&&!_[_0x7753('0x43')](_0x5cdbc6['startProgressive'])){_0x5cdbc6[_0x7753('0x66')]=moment()[_0x7753('0x48')](_0x7753('0xc8'));loggerPredictive[_0x7753('0x4b')](_0x5cdbc6[_0x7753('0x64')],'started\x20in\x20predictive\x20at',_0x5cdbc6[_0x7753('0x66')]);hopperUtils[_0x7753('0x1c7')](_0x5cdbc6[_0x7753('0x1be')])['then'](this[_0x7753('0x1c8')](_0x5cdbc6))[_0x7753('0x41')](mergeDataErlangB(_0x5cdbc6))[_0x7753('0x41')](this[_0x7753('0x1c9')](_0x5cdbc6))[_0x7753('0xa8')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x5cdbc6));}else if(!ifInterval(_0x5cdbc6[_0x7753('0x1be')],_0x5cdbc6['startPredictive'])){_0x5cdbc6['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x5cdbc6[_0x7753('0x66')]=moment()[_0x7753('0x48')](_0x7753('0xc8'));loggerPredictive[_0x7753('0x4b')](_0x5cdbc6[_0x7753('0x64')],_0x7753('0x1ca'),_0x5cdbc6[_0x7753('0x66')]);clearInterval(_0x5cdbc6[_0x7753('0x67')]);_0x5cdbc6['handlePredictive']=undefined;hopperUtils[_0x7753('0x1c7')](_0x5cdbc6['dialPredictiveInterval'])['then'](this[_0x7753('0x1c8')](_0x5cdbc6))['then'](mergeDataErlangB(_0x5cdbc6))[_0x7753('0x41')](this['startMethodPredictive'](_0x5cdbc6))[_0x7753('0xa8')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x5cdbc6));}else if(_0x5cdbc6[_0x7753('0x1b6')]&&_0x2e9cf6<_0x5cdbc6[_0x7753('0x1b6')]-_0x546f3f){clearPredictiveAttributes(_0x5cdbc6);loggerPredictive[_0x7753('0x4b')](_0x5cdbc6[_0x7753('0x64')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x2e9cf6,')\x20are\x20less\x20than\x20threshold\x20(',_0x5cdbc6[_0x7753('0x1b6')],'-',_0x546f3f,'=',_0x5cdbc6[_0x7753('0x1b6')]-_0x546f3f,')');}else if(_0x5cdbc6['predictiveIntervalAvailable']&&_0x2e9cf6>_0x5cdbc6['predictiveIntervalAvailable']+_0x3f8007){clearPredictiveAttributes(_0x5cdbc6);loggerPredictive[_0x7753('0x4b')](_0x5cdbc6[_0x7753('0x64')],_0x7753('0x1cb'),_0x2e9cf6,_0x7753('0x1cc'),_0x5cdbc6[_0x7753('0x1b6')],'+',_0x3f8007,'=',_0x5cdbc6[_0x7753('0x1b6')]+_0x3f8007,')');}};Dialer[_0x7753('0x90')][_0x7753('0x1c8')]=function(_0x5e73d8){var _0xa45a6a=this;return function(_0x3e4a42){return new Promise(function(_0x1d8db4,_0x1126fe){_['merge'](_0x5e73d8,_0x3e4a42[0x0]);if(checkGetDataPredictive(_0x3e4a42[0x0])){var _0x275710=_0x5e73d8[_0x7753('0x1b6')]=_0x5e73d8[_0x7753('0x13e')]+_0x5e73d8[_0x7753('0x13c')];var _0x19b296=_0x5e73d8[_0x7753('0x1be')]*0x3c;var _0x45e799=_0x3e4a42[0x0][_0x7753('0x56')]+_0x3e4a42[0x0]['predictiveIntervalAvgHoldtime'];var _0x53d043=(_0x3e4a42[0x0][_0x7753('0x50')]+_0x3e4a42[0x0][_0x7753('0x51')]+_0x3e4a42[0x0][_0x7753('0x52')])/_0x3e4a42[0x0]['predictiveIntervalTotalCalls'];_0x5e73d8['predictiveIntervalHitRate']=_0x53d043>0x0?_0x53d043:0x1;switch(_0x5e73d8[_0x7753('0x1c3')]){case _0x7753('0x1c0'):var _0xbe9c9=_0x5e73d8['dialPredictiveOptimizationPercentage']/0x64;return _0xa45a6a[_0x7753('0x1cd')](_0x275710,_0x19b296,_0x45e799,_0x53d043,_0xbe9c9)[_0x7753('0x41')](function(_0x5a60e7){return _0x1d8db4(_0x5a60e7);});case'agentBusyFactor':var _0x565cb3=_0x5e73d8['dialPredictiveOptimizationPercentage']/0x64;return _0xa45a6a[_0x7753('0x1ce')](_0x275710,_0x19b296,_0x45e799,_0x53d043,_0x565cb3)[_0x7753('0x41')](function(_0x4ab785){return _0x1d8db4(_0x4ab785);});default:return _0x1126fe(msgResponse(_0x7753('0x1cf'),_0x7753('0x99'),'Unknown\x20Predictive'));}}else{return _0x1126fe(msgResponse('[getDataPredictive]',_0x7753('0x99'),_0x7753('0x1d0')));}});};};Dialer[_0x7753('0x90')]['getDataPredictiveOld']=function(_0x4a1ff0){var _0x362d06=this;return function(_0x8091f1){return new Promise(function(_0x318d6e,_0x25a45e){_[_0x7753('0x61')](_0x4a1ff0,_0x8091f1[0x0]);if(checkGetDataPredictive(_0x8091f1[0x0])){loggerPredictive[_0x7753('0x4b')](JSON[_0x7753('0x79')](_0x8091f1[0x0]));if(_0x4a1ff0[_0x7753('0x1c3')]===_0x7753('0x1c0')){return _0x362d06[_0x7753('0x152')](_0x4a1ff0['id'])[_0x7753('0x41')](function(_0x53b6ab){var _0x4b8681=_0x4a1ff0['loggedIn']-_0x53b6ab[0x0][_0x7753('0x1d1')];var _0x1ee4b9=_0x4a1ff0['dialPredictiveInterval']*0x3c;var _0x543952=_0x8091f1[0x0][_0x7753('0x56')]+_0x8091f1[0x0][_0x7753('0x54')];var _0x32a964=(_0x8091f1[0x0][_0x7753('0x50')]+_0x8091f1[0x0][_0x7753('0x51')]+_0x8091f1[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x8091f1[0x0][_0x7753('0x4e')];var _0x18b3e3=_0x4a1ff0[_0x7753('0x1d2')]/0x64;_0x4a1ff0[_0x7753('0x1d3')]=_0x53b6ab[0x0][_0x7753('0x1d1')]||0x0;_0x4a1ff0[_0x7753('0x1b9')]=_0x32a964>0x0?_0x32a964:0x1;return _0x362d06[_0x7753('0x1cd')](_0x4b8681,_0x1ee4b9,_0x543952,_0x32a964,_0x18b3e3);})['then'](function(_0x493c15){return _0x318d6e(_0x493c15);})[_0x7753('0xa8')](function(_0x3b8ac9){return _0x25a45e(msgResponse(_0x7753('0x1d4'),_0x7753('0x99'),JSON[_0x7753('0x79')](_0x3b8ac9)));});}if(_0x4a1ff0[_0x7753('0x1c3')]==='agentBusyFactor'){return _0x362d06[_0x7753('0x152')](_0x4a1ff0['id'])[_0x7753('0x41')](function(_0x3d47dd){var _0x2b20de=_0x4a1ff0[_0x7753('0x1d5')]-_0x3d47dd[0x0]['outboundQueuePauses'];var _0x237f0e=_0x4a1ff0['dialPredictiveInterval']*0x3c;var _0x2cd493=_0x8091f1[0x0][_0x7753('0x56')]+_0x8091f1[0x0]['predictiveIntervalAvgHoldtime'];var _0x4a283c=(_0x8091f1[0x0][_0x7753('0x50')]+_0x8091f1[0x0][_0x7753('0x51')]+_0x8091f1[0x0][_0x7753('0x52')])/_0x8091f1[0x0][_0x7753('0x4e')];var _0x3b268a=_0x4a1ff0[_0x7753('0x1d2')]/0x64;_0x4a1ff0[_0x7753('0x1d3')]=_0x3d47dd[0x0][_0x7753('0x1d1')]||0x0;_0x4a1ff0[_0x7753('0x1b9')]=_0x4a283c>0x0?_0x4a283c:0x1;return _0x362d06['busyFactor'](_0x2b20de,_0x237f0e,_0x2cd493,_0x4a283c,_0x3b268a);})[_0x7753('0x41')](function(_0x3f0b13){return _0x318d6e(_0x3f0b13);})['catch'](function(_0x1e28ca){return _0x25a45e(msgResponse(_0x7753('0x1d4'),_0x7753('0x99'),JSON['stringify'](_0x1e28ca)));});}}else{return _0x25a45e(msgResponse(_0x7753('0x1cf'),'Failure',_0x7753('0x1d0')));}});};};Dialer[_0x7753('0x90')][_0x7753('0x1c9')]=function(_0x6c1c99){var _0x351e1e=this;return function(){var _0x98c9ee=0x0;var _0x5d6194=Math['floor'](_0x6c1c99[_0x7753('0x5d')]*0x3e8);if(_0x5d6194>0x0){_0x5d6194=_0x5d6194<0x64?0x64:_0x5d6194;loggerPredictive['info'](_0x6c1c99[_0x7753('0x64')],_0x7753('0x1d6'),_0x5d6194,_0x7753('0x1d7'));_0x6c1c99[_0x7753('0x67')]=setInterval(function(){_0x351e1e[_0x7753('0x67')](_0x6c1c99);loggerPredictiveCalls[_0x7753('0x4b')](_0x7753('0x1d8'),_0x98c9ee+=0x1);},_0x5d6194);}else{loggerPredictive[_0x7753('0x4b')](_0x6c1c99['name'],_0x7753('0x1d9'));}};};Dialer[_0x7753('0x90')][_0x7753('0x1da')]=function(_0x636f37,_0x1b232a){var _0x2667bb=this;return function(_0x2a218c){if(_[_0x7753('0x4a')](_0x2a218c)){if(_[_0x7753('0xf7')](_0x1b232a[_0x7753('0x157')])||!_0x1b232a[_0x7753('0x1db')]){if(_0x636f37['dialMethod']==='booked'){_0x636f37[_0x7753('0x76')]=_['isUndefined'](_0x636f37[_0x7753('0x76')])?!![]:_0x636f37['queueStatusComplete'];var _0x605d6a=uuid['v4']();_0x2667bb[_0x7753('0x26')][_0x605d6a]=new Action(_0x636f37,_0x1b232a,_0x605d6a);loggerBooked[_0x7753('0x4b')]('[booked][checkContactBlack]',_0x605d6a,_0x7753('0x1dc'),JSON[_0x7753('0x79')](_0x636f37[_0x7753('0x76')]),_0x7753('0x1dd'),_0x636f37['name']);if(_0x636f37[_0x7753('0x76')]){_0x636f37[_0x7753('0x76')]=![];_0x2667bb['queueBooked'][_0x2667bb[_0x7753('0x26')][_0x605d6a][_0x7753('0xc4')]]=[];ami['Action']({'actionid':_0x605d6a,'action':_0x7753('0x1de'),'queue':_0x636f37[_0x7753('0x64')]})[_0x7753('0xa8')](function(){_0x2667bb[_0x7753('0xc7')](_0x636f37);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x2667bb[_0x7753('0x26')][_0x605d6a][_0x7753('0xe0')],'ListId':_0x2667bb[_0x7753('0x26')][_0x605d6a][_0x7753('0xee')],'VoiceQueueId':_0x2667bb[_0x7753('0x26')][_0x605d6a]['VoiceQueueId']||undefined,'CampaignId':_0x2667bb[_0x7753('0x26')][_0x605d6a][_0x7753('0xfc')]||undefined})[_0x7753('0xa8')](loggerCatch(_0x7753('0x1df')));delete _0x2667bb[_0x7753('0x26')][_0x605d6a];});}else{loggerBooked[_0x7753('0x4b')](_0x7753('0x1e0'),JSON[_0x7753('0x79')](_0x636f37['queueStatusComplete']),_0x7753('0x1dd'),_0x636f37[_0x7753('0x64')]);_0x2667bb[_0x7753('0xc7')](_0x636f37);hopperUtils[_0x7753('0xde')]({'active':![],'ContactId':_0x2667bb['actions'][_0x605d6a][_0x7753('0xe0')],'ListId':_0x2667bb[_0x7753('0x26')][_0x605d6a][_0x7753('0xee')],'VoiceQueueId':_0x2667bb['actions'][_0x605d6a][_0x7753('0xe1')]||undefined,'CampaignId':_0x2667bb[_0x7753('0x26')][_0x605d6a][_0x7753('0xfc')]||undefined})['catch'](loggerCatch(_0x7753('0x1df')));delete _0x2667bb[_0x7753('0x26')][_0x605d6a];}}else{return _0x2667bb['actionOriginate'](_0x636f37,_0x1b232a);}}else{if(utils[_0x7753('0x62')](undefined,_0x1b232a[_0x7753('0x1e1')])<_0x636f37[_0x7753('0x1e2')]*0x3c){if(_0x1b232a[_0x7753('0x14a')]&&!_0x1b232a[_0x7753('0x14a')]['voicePause']){_0x2667bb['preview']['run'](_0x1b232a['id'])['finally'](function(){_0x2667bb['updateOriginated'](_0x636f37);});}else{hopperUtils[_0x7753('0x1e3')]({'active':![]},_0x1b232a['id'],0x1)[_0x7753('0x1d')](function(){_0x2667bb[_0x7753('0xc7')](_0x636f37);});}}else{_0x636f37[_0x7753('0x1e4')]+=0x1;_0x2667bb[_0x7753('0xc7')](_0x636f37);if(_0x636f37['dialRecallInQueue']){hopperUtils[_0x7753('0xde')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x1b232a[_0x7753('0xe0')],'ListId':_0x1b232a[_0x7753('0xee')],'VoiceQueueId':_0x1b232a[_0x7753('0xe1')]||undefined,'CampaignId':_0x1b232a[_0x7753('0xfc')]||undefined})['catch'](loggerCatch(_0x7753('0x1e5')));hopperUtils['createHistory'](createObjHistory(_0x636f37,_0x1b232a,utils[_0x7753('0x6e')][_0x7753('0x1e6')],0x17,_0x7753('0x1e7')))['catch'](loggerCatch(_0x7753('0x1e8')));}else{_0x2667bb['saveInDb'](createObjHistory(_0x636f37,_0x1b232a,utils['CAMPAIGN_STATUS']['RECALL_TIMEOUT'],0x16,_0x7753('0x1e9')),_0x7753('0x1ea'),_0x7753('0x1eb'));}}}}else{_0x636f37[_0x7753('0x1ec')]+=0x1;_0x2667bb[_0x7753('0x119')](createObjHistory(_0x636f37,_0x1b232a,utils['CAMPAIGN_STATUS']['BLACKLIST'],0xd,'Blacklist'),_0x7753('0x1ed'),_0x7753('0x1ee'));throw _0x7753('0x1ef');}};};Dialer['prototype'][_0x7753('0x15a')]=function(_0x24c782){var _0x2ce434=this;var _0x5464cc=_0x24c782[_0x7753('0x1f0')]-_0x24c782[_0x7753('0x84')];emitCampaignSummary(_0x24c782);if(_0x5464cc>0x0&&_0x24c782['temp']==0x0){if(_0x5464cc>this['maxNumberOriginate']){_0x5464cc=this[_0x7753('0x24')];}_0x24c782['temp']=0x1;hopperUtils[_0x7753('0x1f1')](_0x24c782,_0x5464cc)[_0x7753('0x41')](function(_0xb89539){_0x24c782['temp']=0x0;if(_0xb89539){if(!utils[_0x7753('0x1f2')](_0xb89539)){_0x24c782['message']=utils['CAMPAIGN_STATUS']['NO_AVAILABLE_CONTACTS'];logger[_0x7753('0x4b')]('[getContactCampaign2][Empty]'+_0x24c782['name']);}else{_0x24c782[_0x7753('0x84')]+=_0xb89539[_0x7753('0xfe')];_0x24c782[_0x7753('0x6d')]=utils[_0x7753('0x6e')][_0x7753('0x1f3')];for(var _0x4829e6=0x0;_0x4829e6<_0xb89539[_0x7753('0xfe')];_0x4829e6+=0x1){_0x24c782[_0x7753('0x1f4')]+=0x1;if(_[_0x7753('0xf7')](_0xb89539[_0x4829e6])||_[_0x7753('0xf7')](_0xb89539[_0x4829e6]['Contact'])||_['isNil'](_0xb89539[_0x4829e6][_0x7753('0x15d')])){_0x2ce434['emptyContact'](_0x7753('0x1f5'),_0x24c782,_0xb89539[_0x4829e6]);}else{hopperUtils[_0x7753('0x1f6')](_[_0x7753('0x7a')](_0xb89539[_0x4829e6],[_0x7753('0xfc'),_0x7753('0x15d')]))['then'](_0x2ce434[_0x7753('0x1da')](_0x24c782,_0xb89539[_0x4829e6]))[_0x7753('0xa8')](_0x2ce434[_0x7753('0x1f7')](_0x7753('0x1f8'),_0x24c782));}}}}})[_0x7753('0xa8')](loggerGetContactDialer(_0x7753('0x1f9'),_0x24c782,_0x5464cc));}};Dialer[_0x7753('0x90')]['handlePower']=function(_0x7b9be3,_0x4fa25c){var _0x48061f=this;var _0x5d1b61=[];if(_0x4fa25c<0x1||_0x7b9be3['dialMethod']===_0x7753('0xa')){_0x4fa25c=0x1;}var _0xc1f210=Math[_0x7753('0x1b8')](_0x7b9be3['available']*_0x4fa25c)-_0x7b9be3[_0x7753('0x84')];if(_0x7b9be3['dialLimitQueue']>0x0){var _0x211d3d=_0x7b9be3[_0x7753('0x1fa')]-_0x7b9be3[_0x7753('0x84')]-_0x7b9be3[_0x7753('0x13e')]-_0x7b9be3['pTalking'];if(_0xc1f210>_0x211d3d){_0xc1f210=_0x211d3d;}}if(_0xc1f210>0x0&&_0x7b9be3[_0x7753('0x1fb')]==0x0){if(_0x7b9be3[_0x7753('0xb8')]==='booked'){_0xc1f210=0x1;}if(_0xc1f210>this[_0x7753('0x24')]){_0xc1f210=this[_0x7753('0x24')];}for(var _0x54939f in this[_0x7753('0x22')]){if(typeof this[_0x7753('0x22')][_0x54939f]!==_0x7753('0xb2')){if(this[_0x7753('0x22')][_0x54939f][_0x7753('0x73')]===_0x7753('0x1fc')&&this[_0x7753('0x22')][_0x54939f][_0x7753('0x8d')]===_0x7753('0x8e')){_0x5d1b61['push'](this['agents'][_0x54939f]['id']);}}}_0x7b9be3[_0x7753('0x1fb')]=0x1;hopperUtils[_0x7753('0x1fd')](_0x7b9be3,_0x5d1b61,_0xc1f210)[_0x7753('0x41')](function(_0x5e30d2){_0x7b9be3[_0x7753('0x1fb')]=0x0;if(_0x5e30d2){if(!utils[_0x7753('0x1f2')](_0x5e30d2)){hopperUtils[_0x7753('0x1fe')](_0x7b9be3)[_0x7753('0x41')](sendMessageReschedule(_0x7b9be3))[_0x7753('0xa8')](loggerCatch(_0x7753('0x1ff')));}else{_0x7b9be3[_0x7753('0x84')]+=_0x5e30d2[_0x7753('0xfe')];_0x7b9be3[_0x7753('0x6d')]=_0x7b9be3[_0x7753('0xb8')]===_0x7753('0xa')?utils[_0x7753('0x6e')][_0x7753('0x13f')]:utils[_0x7753('0x6e')][_0x7753('0x1f3')];for(var _0x40c3e2=0x0;_0x40c3e2<_0x5e30d2['length'];_0x40c3e2+=0x1){if(_[_0x7753('0xf7')](_0x5e30d2[_0x40c3e2])||_[_0x7753('0xf7')](_0x5e30d2[_0x40c3e2]['Contact'])||_[_0x7753('0xf7')](_0x5e30d2[_0x40c3e2][_0x7753('0x15d')])){_0x48061f['emptyContact'](_0x7753('0x1f5'),_0x7b9be3,_0x5e30d2[_0x40c3e2]);}else{hopperUtils[_0x7753('0x200')](_[_0x7753('0x7a')](_0x5e30d2[_0x40c3e2],['VoiceQueueId',_0x7753('0x15d')]))[_0x7753('0x41')](_0x48061f[_0x7753('0x1da')](_0x7b9be3,_0x5e30d2[_0x40c3e2]))['catch'](_0x48061f[_0x7753('0x1f7')]('[actionOriginate]\x20',_0x7b9be3));}}}}})[_0x7753('0xa8')](loggerGetContactDialer(_0x7753('0x201'),_0x7b9be3,_0xc1f210));}};Dialer[_0x7753('0x90')][_0x7753('0x67')]=function(_0x2f40c6){if(_0x2f40c6[_0x7753('0x1fa')]>0x0){var _0x2093fb=_0x2f40c6[_0x7753('0x1fa')]-_0x2f40c6[_0x7753('0x84')]-_0x2f40c6['talking'];if(_0x2093fb>0x0&&_0x2f40c6['temp']==0x0){this[_0x7753('0x202')](_0x2f40c6);}else{loggerPredictiveCalls[_0x7753('0x4b')](_0x7753('0x203'));}}else{this['tryOriginatePredictive'](_0x2f40c6);}};Dialer['prototype'][_0x7753('0x202')]=function(_0x83243d){var _0x349143=this;var _0x287903=[];_0x83243d['originated']+=0x1;for(var _0x4a7425 in this[_0x7753('0x22')]){if(typeof this['agents'][_0x4a7425]!==_0x7753('0xb2')){if(this[_0x7753('0x22')][_0x4a7425][_0x7753('0x73')]===_0x7753('0x1fc')&&this[_0x7753('0x22')][_0x4a7425]['status']===_0x7753('0x8e')){_0x287903[_0x7753('0xa0')](this['agents'][_0x4a7425]['id']);}}}_0x83243d[_0x7753('0x1fb')]=0x1;return this[_0x7753('0x1fd')](_0x83243d['id'],_0x287903,0x1,_0x83243d['dialOrderByScheduledAt'],_0x83243d)['then'](function(_0x39d3ae){_0x83243d[_0x7753('0x1fb')]=0x1;if(_0x39d3ae){if(!utils[_0x7753('0x1f2')](_0x39d3ae)){utils[_0x7753('0x204')](_0x83243d,0x1,0x0);return hopperUtils[_0x7753('0x1fe')](_0x83243d)['then'](sendMessageReschedule(_0x83243d))[_0x7753('0xa8')](loggerCatch('[countReScheduled]\x20'));}else{_0x83243d[_0x7753('0x6d')]=utils['CAMPAIGN_STATUS']['RUNNING'];if(_[_0x7753('0xf7')](_0x39d3ae[0x0])||_['isNil'](_0x39d3ae[0x0][_0x7753('0x205')])||_[_0x7753('0xf7')](_0x39d3ae[0x0][_0x7753('0x15d')])){_0x349143[_0x7753('0x155')](_0x7753('0x1f5'),_0x83243d,_0x39d3ae[0x0]);}else{return hopperUtils[_0x7753('0x200')](_[_0x7753('0x7a')](_0x39d3ae[0x0],[_0x7753('0xe1'),_0x7753('0x15d')]))[_0x7753('0x41')](_0x349143['checkContactBlack'](_0x83243d,_0x39d3ae[0x0]))[_0x7753('0xa8')](_0x349143[_0x7753('0x1f7')](_0x7753('0x206'),_0x83243d));}}}})[_0x7753('0xa8')](loggerGetContactDialer(_0x7753('0x207'),_0x83243d,0x1));};Dialer['prototype'][_0x7753('0x1cd')]=function(_0x351647,_0x6a48f8,_0x53e55e,_0x12e111,_0x5447ef,_0x847433){loggerPredictive[_0x7753('0x4b')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive['info']('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',_0x351647);loggerPredictive[_0x7753('0x4b')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x6a48f8);loggerPredictive[_0x7753('0x4b')]('Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x53e55e);loggerPredictive[_0x7753('0x4b')](_0x7753('0x208'),_0x12e111);loggerPredictive[_0x7753('0x4b')](_0x7753('0x209'),_0x5447ef);loggerPredictive[_0x7753('0x4b')]('---------------------------');return new Promise(function(_0xc2fa06,_0x31029a){if(_0x351647<=0x0||isNaN(_0x351647)){return _0x31029a(msgResponse(_0x7753('0x20a'),_0x7753('0x89'),_0x7753('0x20b')+_0x351647));}if(_0x53e55e<=0x0||isNaN(_0x53e55e)){return _0x31029a(msgResponse(_0x7753('0x20a'),'Error','Ts\x20=\x20'+_0x53e55e));}if(_0x12e111<=0x0||isNaN(_0x12e111)){return _0x31029a(msgResponse('[abandonmentRate]',_0x7753('0x89'),'p\x20=\x20'+_0x12e111));}if(_0x6a48f8<=0x0||isNaN(_0x6a48f8)){return _0x31029a(msgResponse(_0x7753('0x20a'),_0x7753('0x89'),_0x7753('0x20c')+_0x6a48f8));}if(_0x5447ef<=0x0||isNaN(_0x5447ef)){return _0x31029a(msgResponse(_0x7753('0x20a'),_0x7753('0x89'),'Amax\x20=\x20'+_0x5447ef));}_0x847433=_0x847433||0x0;var _0x4b786d=0x1/_0x53e55e;var _0x3c3c54=0x0;var _0x48ddd1=0x0;var _0x5e9be2=0x0;var _0x506f53=0x0;for(var _0xa91dd1=0x0;_0x5e9be2<_0x5447ef;_0xa91dd1+=0x1){_0x48ddd1=_0xa91dd1/_0x6a48f8;_0x3c3c54=(_0x12e111*_0x48ddd1+_0x847433)/_0x4b786d;_0x5e9be2=utils['erlangb'](_0x3c3c54,_0x351647);_0x506f53=_0x3c3c54/_0x351647*(0x1-utils[_0x7753('0x20d')](_0x3c3c54,_0x351647));}return _0xc2fa06({'erlangCalls':_0xa91dd1,'erlangCallToSecond':_0x6a48f8/_0xa91dd1,'erlangAbandonmentRate':_0x5e9be2,'erlangBusyFactor':_0x506f53});});};Dialer[_0x7753('0x90')][_0x7753('0x1ce')]=function(_0x450388,_0x1bdcda,_0x5ab13a,_0x5b6cb8,_0x480ad7,_0x196a9d){loggerPredictive['info']('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x7753('0x4b')](_0x7753('0x20e'),_0x450388);loggerPredictive['info'](_0x7753('0x20f'),_0x1bdcda);loggerPredictive[_0x7753('0x4b')](_0x7753('0x210'),_0x5ab13a);loggerPredictive['info'](_0x7753('0x208'),_0x5b6cb8);loggerPredictive[_0x7753('0x4b')](_0x7753('0x211'),_0x480ad7);loggerPredictive[_0x7753('0x4b')](_0x7753('0x57'));return new Promise(function(_0x49d729,_0x595f43){if(_0x450388<=0x0||isNaN(_0x450388)){return _0x595f43(msgResponse(_0x7753('0x212'),'Error',_0x7753('0x20b')+_0x450388));}if(_0x5ab13a<=0x0||isNaN(_0x5ab13a)){return _0x595f43(msgResponse(_0x7753('0x212'),_0x7753('0x89'),'Ts\x20=\x20'+_0x5ab13a));}if(_0x5b6cb8<=0x0||isNaN(_0x5b6cb8)){return _0x595f43(msgResponse('[busyFactor]','Error',_0x7753('0x213')+_0x5b6cb8));}if(_0x1bdcda<=0x0||isNaN(_0x1bdcda)){return _0x595f43(msgResponse(_0x7753('0x212'),_0x7753('0x89'),_0x7753('0x20c')+_0x1bdcda));}if(_0x480ad7<=0x0||isNaN(_0x480ad7)){return _0x595f43(msgResponse(_0x7753('0x212'),_0x7753('0x89'),'Umin\x20=\x20'+_0x480ad7));}_0x196a9d=_0x196a9d||0x0;var _0x26e153=0x1/_0x5ab13a;var _0xd2927b=0x0;var _0x3342e3=0x0;var _0x508910=0x0;var _0x3d8844=0x0;for(var _0x157fc7=0x0;_0x3d8844<_0x480ad7;_0x157fc7+=0x1){_0x3342e3=_0x157fc7/_0x1bdcda;_0xd2927b=(_0x5b6cb8*_0x3342e3+_0x196a9d)/_0x26e153;_0x508910=utils['erlangb'](_0xd2927b,_0x450388);_0x3d8844=_0xd2927b/_0x450388*(0x1-utils[_0x7753('0x20d')](_0xd2927b,_0x450388));}return _0x49d729({'erlangCalls':_0x157fc7,'erlangCallToSecond':_0x1bdcda/_0x157fc7,'erlangAbandonmentRate':_0x508910,'erlangBusyFactor':_0x3d8844});});};module[_0x7753('0x214')]=Dialer;
\ No newline at end of file