236a375e4130a4c1219f26654196169e5e916099
[motion2.git] / server / services / ami / dialer / index.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x53fb=['dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoSuchCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','callerid','stringify','format','voice:queue:%s','voice_queue:save','ivr','campaign:save','info','-----\x20Stats\x20Predictive\x20---','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','clearing\x20variable\x20start\x20progressive','handlePredictive','clearing\x20variable\x20handle\x20predictive','preview','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','contactsRescheduled','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','pTalking','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','starttime','clearZombieChannels','[uniqueid]','[actions]','sequence','enqueue','isNil','status','channel','updateOriginated','[Dialer][checkChannel]','queue','[Dialer][checkChannel][ivr]','resolve','catch','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','[averageHandleTime]\x20','rescheduleContact','unlockContact','[unlockContact]\x20','getContactDialer','temp','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','emptyContact','notFound','saveInDb','merge','pick','ListId','UserId','[emptyContact]','Success','active','SIP/%s','reachable','unmonitored','uniqueid','variable','exten','xcally-motion-dialer','dialAMDActive','value','HangupInAMD','membername','AMD','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','countglobal','custom:amd','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','dialGlobalMaxRetry','stateGlobal','dialMachineMaxRetry','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','VoiceQueueId','CampaignId','HANGUP','[syncHangupInAMDIvr]','countagentrejectretry','reason19\x20machine....','createStateFinal','ContactId','[rescheduleContact][Machine]','ivrAnswerCallsDay','[syncHangupIvr]','AGI','dialQueueProject','Unknow','[syncHangupIvr][createHistory]','reason','agent','agiafterat','dialQueueProject2','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','outboundDropCallsDayTimeout','Drop','dropreason','TIMEOUT','dialDropMaxRetry','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','syncNewExten','actionid','locked','paused','stateinterface','rrmemory','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','loopCampaigns','resetActiveCalls','syncCampaigns','checkIsTrunkReachable','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','Action','command','iftime\x20%s,%s','content','indexOf','true','push','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','progressive','handlePower','power','dialPowerLevel','predictive','Queue','method\x20not\x20recognized','checkPreviewRecallReminder','handlePreviewRecallNotifications','Agent','user:%s','user:dialPreviewRecallReminder','launchHandleIvr','handleIvr','dialGlobalInterval','dialTimezone','[syncQueueSummary]','dialPreviewRecallmeReminder','[syncCampaigns]','pow','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialAgiAfterHangupAgent','dialer','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','tags','createdAt','updatedAt','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','from-sip','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','getQueue','isSuccess','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAbandonedRetryFrequency','dialAgentRejectMaxRetry','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','dialBusyMaxRetry','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','getDataPredictive','Predictive\x20after\x20first\x20interval','startMethodPredictive','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(','busyFactor','Unknown\x20Predictive','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','abandonmentRate','[CatchErlangB]','agentBusyFactor','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','queuestatus','[booked][checkContactBlack][else]','scheduledat','voicePause','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','RUNNING','[actionOriginate]\x20','Contact.phone','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','not_inuse','countReScheduled','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','[busyFactor]','Umin\x20=\x20','exports','util','lodash','bluebird','md5','ioredis','../preview/util/util','../../../config/environment/','booked','../../../config/logger','predictiveCalls','../ami','redis','defaults','localhost','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/setting','./final','./hangup','env','XCALLY_IP_AGI','roundrobin','prototype','tail','finally','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncQueueSummary','hangup','newexten','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopClearZombieChannels','getSettings','then','isUndefined','message','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','name','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','[ifTime][Action]','Error','milliseconds','seconds','emit','type','outbound','strategy','answered','available','loggedIn','sumHoldTime','talking','unmanaged','abandoned','waiting','dialActive','dialMethod'];(function(_0x28ba9e,_0x1e8204){var _0x18c3cb=function(_0x2cf51b){while(--_0x2cf51b){_0x28ba9e['push'](_0x28ba9e['shift']());}};_0x18c3cb(++_0x1e8204);}(_0x53fb,0x1cb));var _0xb53f=function(_0x1d678d,_0x247444){_0x1d678d=_0x1d678d-0x0;var _0x245c22=_0x53fb[_0x1d678d];return _0x245c22;};'use strict';var util=require(_0xb53f('0x0'));var _=require(_0xb53f('0x1'));var BPromise=require(_0xb53f('0x2'));var uuid=require('uuid');var moment=require('moment');var rr=require('rr');var md5=require(_0xb53f('0x3'));var Redis=require(_0xb53f('0x4'));var ut=require(_0xb53f('0x5'));var config=require(_0xb53f('0x6'));var logger=require('../../../config/logger')('dialer');var loggerBooked=require('../../../config/logger')(_0xb53f('0x7'));var loggerPredictive=require(_0xb53f('0x8'))('predictive');var loggerPredictiveCalls=require(_0xb53f('0x8'))(_0xb53f('0x9'));var loggerSyncQueueSummary=require(_0xb53f('0x8'))('syncQueueSummary');var ami=require(_0xb53f('0xa'));config[_0xb53f('0xb')]=_[_0xb53f('0xc')](config['redis'],{'host':_0xb53f('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb53f('0xb')]));var cmHopper=require(_0xb53f('0xe'));var cmHopperHistory=require(_0xb53f('0xf'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require(_0xb53f('0x10'));var Action=require('./action');var History=require('./history');var Final=require(_0xb53f('0x11'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require(_0xb53f('0x12'));var ipAgi=process[_0xb53f('0x13')][_0xb53f('0x14')]||'127.0.0.1';var strategy={'rrmemory':'rrmemory','roundrobin':_0xb53f('0x15')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0xb53f('0x16')]['enqueue']=function(_0x11a317){this[_0xb53f('0x17')]=this['tail']?this[_0xb53f('0x17')][_0xb53f('0x18')](_0x11a317):_0x11a317();};function Dialer(_0x13f4a4,_0x2d20af){this['sequence']=new Sequence();this['preview']=_0x2d20af;this['voiceQueues']=_0x13f4a4[_0xb53f('0x19')];this[_0xb53f('0x1a')]=_0x13f4a4[_0xb53f('0x1a')];this[_0xb53f('0x1b')]=_0x13f4a4[_0xb53f('0x1b')];this[_0xb53f('0x1c')]=_0x13f4a4['trunks'];this[_0xb53f('0x1d')]=config[_0xb53f('0x1d')]||0x2;this[_0xb53f('0x1e')]={};this[_0xb53f('0x1f')]={};this[_0xb53f('0x20')]={};this[_0xb53f('0x21')]={};this[_0xb53f('0x22')]={};this['startPredictive']={};this[_0xb53f('0x23')]={};this[_0xb53f('0x24')]={};this[_0xb53f('0x25')]={};this[_0xb53f('0x26')]={};ami['on'](_0xb53f('0x27'),this[_0xb53f('0x28')][_0xb53f('0x29')](this));ami['on']('queuecallerabandon',this[_0xb53f('0x2a')]['bind'](this));ami['on'](_0xb53f('0x2b'),this[_0xb53f('0x2c')]['bind'](this));ami['on'](_0xb53f('0x2d'),this[_0xb53f('0x2e')][_0xb53f('0x29')](this));ami['on'](_0xb53f('0x2f'),this[_0xb53f('0x30')][_0xb53f('0x29')](this));ami['on'](_0xb53f('0x31'),this['syncHangup'][_0xb53f('0x29')](this));ami['on'](_0xb53f('0x32'),this['syncNewExten']['bind'](this));ami['on']('varset',this[_0xb53f('0x33')][_0xb53f('0x29')](this));ami['on'](_0xb53f('0x34'),this[_0xb53f('0x35')]['bind'](this));ami['on'](_0xb53f('0x36'),this[_0xb53f('0x37')][_0xb53f('0x29')](this));this['loopCampaigns']();this[_0xb53f('0x38')]();RpcSetting[_0xb53f('0x39')]()[_0xb53f('0x3a')](function(_0xa728af){previewRecallmeReminderInterval=_0xa728af['previewRecallmeReminderInterval'];});}function isNotNull(_0x4515d9){return _0x4515d9!==null&&!_[_0xb53f('0x3b')](_0x4515d9);}function checkIsLoggedIn(_0x2fa7f1,_0x237de1){return function(){if(_0x237de1<=0x0){_0x2fa7f1[_0xb53f('0x3c')]='AGENTS_NOT_LOGGED';throw _0x2fa7f1['name']+_0xb53f('0x3d');}};}function isActive(_0x246086){return _0x246086;}function checkIsActive(_0x48d49f,_0x449db7){return function(){if(!isActive(_0x449db7)){_0x48d49f['message']=_0xb53f('0x3e');throw _0x48d49f[_0xb53f('0x3f')]+_0xb53f('0x40');}};}function checkInterval(_0x469f41){return function(){if(!isNotNull(_0x469f41[_0xb53f('0x41')])){_0x469f41[_0xb53f('0x3c')]=_0xb53f('0x42');throw _0x469f41[_0xb53f('0x3f')]+_0xb53f('0x43');}if(!isNotNull(_0x469f41[_0xb53f('0x41')][_0xb53f('0x44')])){_0x469f41[_0xb53f('0x3c')]=_0xb53f('0x42');throw _0x469f41[_0xb53f('0x3f')]+_0xb53f('0x43');}if(!isNotNull(_[_0xb53f('0x45')](_0x469f41[_0xb53f('0x41')][_0xb53f('0x44')]))){_0x469f41['message']=_0xb53f('0x42');throw _0x469f41[_0xb53f('0x3f')]+_0xb53f('0x43');}};}function msgResponse(_0x4190a4,_0x4c45ea,_0xbecd37){return{'action':_0x4190a4,'response':_0x4c45ea,'message':_0xbecd37,'stack':_0xbecd37};}function myreject(_0x1e931f){return function(_0x4e9509){return _0x1e931f(msgResponse(_0xb53f('0x46'),_0xb53f('0x47'),JSON['stringify'](_0x4e9509)));};}function getSeconds(_0x143300,_0x12fe55){var _0x541ac6=moment(_0x143300)[_0xb53f('0x48')](0x0);var _0x41a63f=moment(_0x12fe55)['milliseconds'](0x0);return _0x541ac6['diff'](_0x41a63f,_0xb53f('0x49'));}function emit(_0x3db239,_0x294910,_0x431d66){io['to'](_0x3db239)[_0xb53f('0x4a')](_0x294910,_0x431d66);}function emitVoiceQueueSummary(_0x39b06c){if(_0x39b06c[_0xb53f('0x4b')]===_0xb53f('0x4c')){var _0x5bc3c5={'id':_0x39b06c['id'],'name':_0x39b06c[_0xb53f('0x3f')],'strategy':_0x39b06c[_0xb53f('0x4d')],'answered':_0x39b06c[_0xb53f('0x4e')],'available':_0x39b06c[_0xb53f('0x4f')],'loggedIn':_0x39b06c[_0xb53f('0x50')],'pTalking':_0x39b06c['pTalking'],'sumBillable':_0x39b06c['sumBillable'],'sumDuration':_0x39b06c['sumDuration'],'sumHoldTime':_0x39b06c[_0xb53f('0x51')]||0x0,'talking':_0x39b06c[_0xb53f('0x52')],'total':_0x39b06c['total'],'type':_0x39b06c[_0xb53f('0x4b')],'unmanaged':_0x39b06c[_0xb53f('0x53')],'abandoned':_0x39b06c[_0xb53f('0x54')],'waiting':_0x39b06c[_0xb53f('0x55')],'loggedInDb':_0x39b06c['loggedInDb'],'dialActive':_0x39b06c[_0xb53f('0x56')],'dialMethod':_0x39b06c[_0xb53f('0x57')],'dialOriginateCallerIdName':_0x39b06c[_0xb53f('0x58')],'dialOriginateCallerIdNumber':_0x39b06c[_0xb53f('0x59')],'dialOriginateTimeout':_0x39b06c[_0xb53f('0x5a')],'dialPrefix':_0x39b06c['dialPrefix'],'outboundAnswerAgiCallsDay':_0x39b06c[_0xb53f('0x5b')],'outboundAnswerCallsDay':_0x39b06c[_0xb53f('0x5c')],'outboundBlacklistCallsDay':_0x39b06c[_0xb53f('0x5d')],'outboundBusyCallsDay':_0x39b06c[_0xb53f('0x5e')],'outboundCongestionCallsDay':_0x39b06c[_0xb53f('0x5f')],'outboundDropCallsDayACS':_0x39b06c[_0xb53f('0x60')],'outboundDropCallsDayCallersExit':_0x39b06c[_0xb53f('0x61')],'outboundDropCallsDayTimeout':_0x39b06c['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x39b06c['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x39b06c[_0xb53f('0x62')],'outboundOriginateFailureCallsDay':_0x39b06c['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x39b06c['outboundReCallsDay'],'outboundRejectCallsDay':_0x39b06c[_0xb53f('0x63')],'outboundUnknownCallsDay':_0x39b06c[_0xb53f('0x64')],'predictiveIntervalAnsweredCalls':_0x39b06c[_0xb53f('0x65')],'predictiveIntervalAvgHoldtime':_0x39b06c[_0xb53f('0x66')],'predictiveIntervalAvgTalktime':_0x39b06c[_0xb53f('0x67')],'predictiveIntervalDroppedCallsCallersExit':_0x39b06c[_0xb53f('0x68')],'predictiveIntervalDroppedCallsTimeout':_0x39b06c[_0xb53f('0x69')],'predictiveIntervalErlangCalls':_0x39b06c[_0xb53f('0x6a')],'predictiveIntervalErlangCallsDroppedCalls':_0x39b06c[_0xb53f('0x6b')],'predictiveIntervalHitRate':_0x39b06c['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x39b06c['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x39b06c[_0xb53f('0x6c')],'predictiveIntervalAvailable':_0x39b06c[_0xb53f('0x6d')],'predictiveIntervalTotalCalls':_0x39b06c['predictiveIntervalTotalCalls'],'message':_0x39b06c[_0xb53f('0x3c')],'originated':_0x39b06c[_0xb53f('0x6e')],'erlangCalls':_0x39b06c[_0xb53f('0x6f')],'erlangCallToSecond':_0x39b06c[_0xb53f('0x70')],'erlangAbandonmentRate':_0x39b06c[_0xb53f('0x71')],'erlangBusyFactor':_0x39b06c[_0xb53f('0x72')],'startPredictive':_0x39b06c[_0xb53f('0x73')],'startProgressive':_0x39b06c[_0xb53f('0x23')]};if(_0x39b06c[_0xb53f('0x74')]){_0x5bc3c5['Trunk']={'id':_0x39b06c['Trunk']['id'],'name':_0x39b06c['Trunk'][_0xb53f('0x3f')],'active':_0x39b06c[_0xb53f('0x74')]['active'],'callerid':_0x39b06c[_0xb53f('0x74')][_0xb53f('0x75')]};}if(_0x39b06c[_0xb53f('0x41')]){_0x5bc3c5[_0xb53f('0x41')]={'id':_0x39b06c['Interval']['id'],'name':_0x39b06c[_0xb53f('0x41')][_0xb53f('0x3f')]};}var _0x69ea62=md5(JSON[_0xb53f('0x76')](_0x5bc3c5));if(_0x39b06c['md5']!==_0x69ea62){_0x39b06c[_0xb53f('0x3')]=_0x69ea62;emit(util[_0xb53f('0x77')](_0xb53f('0x78'),_0x5bc3c5['name']),_0xb53f('0x79'),_0x5bc3c5);}}}function emitCampaignSummary(_0x43c8da){if(_0x43c8da[_0xb53f('0x4b')]===_0xb53f('0x7a')){emit(util[_0xb53f('0x77')]('campaign:ivr:%s',_0x43c8da[_0xb53f('0x3f')]),_0xb53f('0x7b'),_0x43c8da);}}function checkGetDataPredictive(_0x404493){if(isNotNull(_0x404493)&&!_[_0xb53f('0x45')](_0x404493)){loggerPredictive[_0xb53f('0x7c')](_0xb53f('0x7d'));loggerPredictive[_0xb53f('0x7c')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x404493['predictiveIntervalTotalCalls']);loggerPredictive[_0xb53f('0x7c')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x404493[_0xb53f('0x65')]);loggerPredictive[_0xb53f('0x7c')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x404493[_0xb53f('0x69')]);loggerPredictive['info']('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x404493['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive['info'](_0xb53f('0x7e'),_0x404493['predictiveIntervalAvgHoldtime']);loggerPredictive['info'](_0xb53f('0x7f'),_0x404493[_0xb53f('0x67')]);loggerPredictive[_0xb53f('0x7c')]('---------------------------');if(_0x404493[_0xb53f('0x80')]>0x0){if(!_[_0xb53f('0x3b')](_0x404493[_0xb53f('0x67')])&&_0x404493[_0xb53f('0x67')]>0x0){return!![];}loggerPredictive[_0xb53f('0x7c')](_0xb53f('0x81'));if(!_['isUndefined'](_0x404493[_0xb53f('0x66')])&&_0x404493['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive['info'](_0xb53f('0x82'));}else{loggerPredictive[_0xb53f('0x7c')](_0xb53f('0x83'));}}else{loggerPredictive['info'](_0xb53f('0x84'));}return![];}function mergeDataErlangB(_0x48b460){return function(_0x23f347){loggerPredictive['info'](_0xb53f('0x85'));loggerPredictive['info'](_0xb53f('0x86'),_0x23f347[_0xb53f('0x6f')]);loggerPredictive['info']('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x23f347[_0xb53f('0x70')]);loggerPredictive[_0xb53f('0x7c')](_0xb53f('0x87'),_0x23f347[_0xb53f('0x71')]);loggerPredictive[_0xb53f('0x7c')](_0xb53f('0x88'),_0x23f347['erlangBusyFactor']);loggerPredictive[_0xb53f('0x7c')](_0xb53f('0x87'),_0x23f347['erlangAbandonmentRate']);loggerPredictive[_0xb53f('0x7c')](_0xb53f('0x89'));_['merge'](_0x48b460,_0x23f347);};}function getDiff(_0x32a723){var _0x7672a8=moment()['milliseconds'](0x0);var _0x869d3b=moment(_0x32a723)['milliseconds'](0x0);return _0x7672a8['diff'](_0x869d3b,_0xb53f('0x49'));}function ifInterval(_0xf34882,_0x2074f8){if(_[_0xb53f('0x3b')](_0x2074f8)){return![];}return getDiff(_0x2074f8)<_0xf34882*0x3c;}function freeVariablesPredictive(_0x64f127){if(isNotNull(_0x64f127)){if(!_[_0xb53f('0x3b')](_0x64f127[_0xb53f('0x23')])){_0x64f127[_0xb53f('0x23')]=undefined;loggerPredictive[_0xb53f('0x7c')](_0x64f127[_0xb53f('0x3f')],_0xb53f('0x8a'));}if(!_[_0xb53f('0x3b')](_0x64f127[_0xb53f('0x73')])){_0x64f127[_0xb53f('0x73')]=undefined;loggerPredictive['info'](_0x64f127[_0xb53f('0x3f')],'clearing\x20variable\x20start\x20predictive');}if(!_[_0xb53f('0x3b')](_0x64f127[_0xb53f('0x8b')])){clearInterval(_0x64f127[_0xb53f('0x8b')]);_0x64f127['handlePredictive']=undefined;loggerPredictive[_0xb53f('0x7c')](_0x64f127['name'],_0xb53f('0x8c'));}}}function erlangb(_0xa63c1c,_0x24a422){if(_0x24a422===0x0){return 0x0;}var _0x1d9038=0x1;for(var _0x212b5b=0x1;_0x212b5b<=_0x24a422;_0x212b5b+=0x1){_0x1d9038=0x1+_0x1d9038*_0x212b5b/_0xa63c1c;}return 0x1/_0x1d9038;}function isVoiceQueueOutbound(_0x12dc5f){return _0x12dc5f==='outbound';}function isNotPreview(_0x554cea){return _0x554cea!==_0xb53f('0x8d');}function isCampaignIvr(_0x352078){return _0x352078===_0xb53f('0x7a');}function getCallerId(_0x4908b2,_0x18d96c,_0x4e80cf){if(!_[_0xb53f('0x3b')](_0x4e80cf)&&typeof _0x4e80cf==='string'&&!_['isEmpty'](_0x4e80cf)){if(!_[_0xb53f('0x3b')](_0x18d96c)&&typeof _0x18d96c===_0xb53f('0x8e')&&!_[_0xb53f('0x45')](_0x18d96c)){return util[_0xb53f('0x77')](_0xb53f('0x8f'),_0x18d96c,_0x4e80cf);}return util['format']('\x22%s\x22\x20<%s>',_0x4e80cf,_0x4e80cf);}if(!_[_0xb53f('0x3b')](_0x4908b2)&&typeof _0x4908b2===_0xb53f('0x8e')&&!_[_0xb53f('0x45')](_0x4908b2)){return _0x4908b2;}return _0xb53f('0x90');}function loggerCatchQueueSummary(_0x1dd559,_0x46e9ea){return function(_0x153f3a){freeVariablesPredictive(_0x46e9ea);emitVoiceQueueSummary(_0x46e9ea);emitCampaignSummary(_0x46e9ea);loggerSyncQueueSummary[_0xb53f('0x91')](_0x1dd559,util['inspect'](_0x153f3a,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x338c4f,_0x4b8ca9){return function(_0xcc881a){loggerPredictive['error'](_0x4b8ca9[_0xb53f('0x3f')],_0x338c4f);loggerPredictive[_0xb53f('0x91')](_0xcc881a[_0xb53f('0x92')]);freeVariablesPredictive(_0x4b8ca9);};}function loggerCatch(_0x1476de){return function(_0x29a8fb){logger[_0xb53f('0x91')](_0x1476de,util[_0xb53f('0x93')](_0x29a8fb,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x5ad5e1){return _0x5ad5e1&&!_[_0xb53f('0x3b')](_0x5ad5e1)&&_0x5ad5e1[_0xb53f('0x94')]>0x0;}function decremetOriginate(_0x27fcff){if(!_[_0xb53f('0x3b')](_0x27fcff)&&_0x27fcff!==null){if(typeof _0x27fcff[_0xb53f('0x6e')]!==_0xb53f('0x95')){if(_0x27fcff['originated']>0x0){_0x27fcff['originated']-=0x1;}else{logger[_0xb53f('0x91')](_0xb53f('0x96'));}}}else{logger[_0xb53f('0x91')](_0xb53f('0x97'));}}function checkContactLowerLimitOriginate(_0x435b6f,_0xad2f08,_0x22815d){if(_0xad2f08>_0x22815d){for(var _0x377415=0x0;_0x377415<_0xad2f08-_0x22815d;_0x377415+=0x1){decremetOriginate(_0x435b6f);}}}function loggerGetContactDialer(_0x516b69,_0x3406ff,_0x2160dd){return function(_0x3fdeee){checkContactLowerLimitOriginate(_0x3406ff,_0x2160dd,0x0);logger[_0xb53f('0x91')](_0x516b69,util[_0xb53f('0x93')](_0x3fdeee,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x4ea5e7){return function(_0x51393e){if(isNotNull(_0x51393e)&&isNotNull(_0x51393e[0x0])){if(_0x51393e[0x0]['contactsRescheduled']>0x0){_0x4ea5e7['message']=_0xb53f('0x98');logger['info']('[getContactDialer2][ReScheduled]'+_0x4ea5e7[_0xb53f('0x3f')],_0x51393e[0x0][_0xb53f('0x99')],_0xb53f('0x9a'));}else{_0x4ea5e7['message']=_0xb53f('0x9b');logger[_0xb53f('0x7c')](_0xb53f('0x9c')+_0x4ea5e7[_0xb53f('0x3f')]);}}};}function notSendMessagesQueue(_0xf042f4){if(_0xf042f4[_0xb53f('0x9d')]){freeVariablesPredictive(_0xf042f4);if(_0xf042f4['originated']===0x0&&_0xf042f4['talking']===0x0&&_0xf042f4[_0xb53f('0x55')]===0x0&&(_0xf042f4[_0xb53f('0x9e')]||0x0)===0x0){_0xf042f4['sendMessageOneNotActive']=![];_0xf042f4[_0xb53f('0x4f')]=0x0;_0xf042f4[_0xb53f('0x3c')]=_0xb53f('0x3e');loggerSyncQueueSummary[_0xb53f('0x91')](_0xb53f('0x9f'),_0xf042f4[_0xb53f('0x3f')],_0xb53f('0xa0'));}else{_0xf042f4[_0xb53f('0x3c')]=_0xb53f('0xa1');loggerSyncQueueSummary[_0xb53f('0x91')](_0xb53f('0x9f'),_0xf042f4['name'],_0xb53f('0xa2'));}emitVoiceQueueSummary(_0xf042f4);}}function notSendMessagesCampaign(_0x3a4763){if(_0x3a4763['sendMessageOneNotActive']){if(_0x3a4763['originated']===0x0){_0x3a4763[_0xb53f('0x9d')]=![];_0x3a4763[_0xb53f('0x3c')]=_0xb53f('0x3e');loggerSyncQueueSummary['error'](_0xb53f('0xa3'),_0x3a4763['name'],'is\x20not\x20active');}else{_0x3a4763[_0xb53f('0x3c')]='IS_DISACTIVED';loggerSyncQueueSummary[_0xb53f('0x91')](_0xb53f('0xa3'),_0x3a4763['name'],_0xb53f('0xa2'));}emitCampaignSummary(_0x3a4763);}}function createObjHistory(_0x3d3d30,_0x581828,_0x55f4cc,_0x578fcc,_0x567c72){_0x3d3d30['message']=_0x55f4cc;var _0x16058c=new Action(_0x3d3d30,_0x581828);var _0x562dae=new History(_0x16058c);_0x562dae[_0xb53f('0xa4')]=_0x578fcc;_0x562dae[_0xb53f('0xa5')]=_0x567c72;_0x562dae[_0xb53f('0xa6')]=_0x16058c[_0xb53f('0xa7')];return _0x562dae;}Dialer[_0xb53f('0x16')][_0xb53f('0x38')]=function(){var _0x1617ec=this;setInterval(function(){_0x1617ec[_0xb53f('0xa8')](_0x1617ec[_0xb53f('0x21')],_0xb53f('0xa9'));_0x1617ec[_0xb53f('0xa8')](_0x1617ec[_0xb53f('0x1f')],_0xb53f('0xaa'));},0x32c8);};Dialer[_0xb53f('0x16')]['clearZombieChannels']=function(_0x6cbbf8,_0x15cc16){var _0x18868b=this;for(var _0x20593f in _0x6cbbf8){if(typeof _0x6cbbf8[_0x20593f]!=='undefined'){this[_0xb53f('0xab')][_0xb53f('0xac')](function(){if(!_[_0xb53f('0xad')](_0x6cbbf8[_0x20593f])){return ami['Action']({'action':_0xb53f('0xae'),'channel':_0x6cbbf8[_0x20593f][_0xb53f('0xaf')]})['catch'](function(_0x26cf58){if(_0x26cf58[_0xb53f('0x3c')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x6cbbf8[_0x20593f]&&_0x6cbbf8[_0x20593f][_0xb53f('0x4b')]!==_0xb53f('0x7a')){_0x18868b[_0xb53f('0xb0')](_0x18868b[_0xb53f('0x19')][_0x6cbbf8[_0x20593f]['queue']]);logger[_0xb53f('0x91')](_0xb53f('0xb1'),_0x15cc16,_0x20593f,_0x6cbbf8[_0x20593f][_0xb53f('0xb2')]);delete _0x6cbbf8[_0x20593f];}if(_0x6cbbf8[_0x20593f]&&_0x6cbbf8[_0x20593f][_0xb53f('0x4b')]==='ivr'){_0x18868b[_0xb53f('0xb0')](_0x18868b['campaigns'][_0x6cbbf8[_0x20593f][_0xb53f('0xb2')]]);logger['error'](_0xb53f('0xb3'),_0x15cc16,_0x20593f,_0x6cbbf8[_0x20593f]['queue']);delete _0x6cbbf8[_0x20593f];}},0x2328);}});}});}}};Dialer[_0xb53f('0x16')]['countReScheduled']=function(_0x4d10dc){return BPromise[_0xb53f('0xb4')]()[_0xb53f('0x3a')](cmHopper['countReScheduled'](_0x4d10dc))[_0xb53f('0xb5')](loggerCatch(_0xb53f('0xb6')));};Dialer['prototype'][_0xb53f('0xb7')]=function(_0x4c2109){return BPromise['resolve']()['then'](cmHopperBlack[_0xb53f('0xb7')](_0x4c2109))[_0xb53f('0xb5')](loggerCatch(_0xb53f('0xb8')));};Dialer['prototype']['checkIsBlackListIvr']=function(_0x3740b8){return BPromise[_0xb53f('0xb4')]()[_0xb53f('0x3a')](cmHopperBlack[_0xb53f('0xb9')](_0x3740b8))[_0xb53f('0xb5')](loggerCatch(_0xb53f('0xba')));};Dialer[_0xb53f('0x16')][_0xb53f('0xbb')]=function(_0x4cdcba){return BPromise['resolve']()[_0xb53f('0x3a')](cmHopperHistory['avgHandleTime'](_0x4cdcba))[_0xb53f('0xb5')](loggerCatch(_0xb53f('0xbc')));};Dialer[_0xb53f('0x16')][_0xb53f('0xbd')]=function(_0x571030){return BPromise['resolve']()[_0xb53f('0x3a')](cmHopper['rescheduleContact'](_0x571030))[_0xb53f('0xb5')](loggerCatch('[rescheduleContact]\x20'));};Dialer[_0xb53f('0x16')][_0xb53f('0xbe')]=function(_0x7d229d,_0x788413,_0x164bb6){return BPromise['resolve']()[_0xb53f('0x3a')](cmHopper[_0xb53f('0xbe')](_0x7d229d,_0x788413,_0x164bb6))[_0xb53f('0xb5')](loggerCatch(_0xb53f('0xbf')));};Dialer[_0xb53f('0x16')][_0xb53f('0xc0')]=function(_0x544113,_0x1557a4,_0x15444e,_0x3dee9e,_0xe2ed6e){return BPromise['resolve']()[_0xb53f('0x3a')](cmHopper[_0xb53f('0xc0')](_0x544113,_0x1557a4,_0x15444e,_0x3dee9e))[_0xb53f('0xb5')](function(_0x150fce){_0xe2ed6e[_0xb53f('0xc1')]-=_0x15444e;_0xe2ed6e[_0xb53f('0xc1')]=_0xe2ed6e[_0xb53f('0xc1')]>0x0?_0xe2ed6e[_0xb53f('0xc1')]:0x0;loggerCatch('[getContactDialer]\x20')(_0x150fce);});};Dialer['prototype']['getContactDialerIvr']=function(_0x529449,_0x31bf6f,_0x1bcf7f,_0x3be49b){return BPromise['resolve']()[_0xb53f('0x3a')](cmHopper[_0xb53f('0xc2')](_0x529449,_0x31bf6f,_0x1bcf7f))[_0xb53f('0xb5')](function(_0x8678f){_0x3be49b[_0xb53f('0xc1')]-=_0x31bf6f;_0x3be49b[_0xb53f('0xc1')]=_0x3be49b[_0xb53f('0xc1')]>0x0?_0x3be49b[_0xb53f('0xc1')]:0x0;loggerCatch(_0xb53f('0xc3'))(_0x8678f);});};Dialer[_0xb53f('0x16')][_0xb53f('0xc4')]=function(_0x4df81d){return BPromise[_0xb53f('0xb4')]()['then'](voiceQueueRt[_0xb53f('0xc4')](_0x4df81d))['catch'](loggerCatch(_0xb53f('0xc5')));};Dialer['prototype'][_0xb53f('0xc6')]=function(_0x247c0a){return BPromise['resolve']()[_0xb53f('0x3a')](cmHopper['moveContactManagedDialer'](_0x247c0a))['catch'](loggerCatch(_0xb53f('0xc7')));};Dialer['prototype'][_0xb53f('0xc8')]=function(_0x52e30a){return BPromise[_0xb53f('0xb4')]()[_0xb53f('0x3a')](cmHopperHistory[_0xb53f('0xc8')](_0x52e30a))['catch'](loggerCatch('[createHistory]\x20'));};Dialer['prototype'][_0xb53f('0xb0')]=function(_0x7043f){if(!_[_0xb53f('0x3b')](_0x7043f)&&_0x7043f!==null){if(typeof _0x7043f[_0xb53f('0x6e')]!==_0xb53f('0x95')){if(_0x7043f['originated']>0x0){_0x7043f[_0xb53f('0x6e')]-=0x1;}else{logger[_0xb53f('0x91')](_0xb53f('0xc9'));}}}else{logger['error']('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0xb53f('0x16')][_0xb53f('0xca')]=function(_0x3b7970,_0x1d9479){var _0x2d58a5=this;return function(_0x39375d){_0x2d58a5[_0xb53f('0xb0')](_0x1d9479);logger[_0xb53f('0x91')](_0x3b7970,util[_0xb53f('0x93')](_0x39375d,{'showHidden':![],'depth':null}));};};Dialer[_0xb53f('0x16')][_0xb53f('0xcb')]=function(_0x4ce137,_0x3cb39d,_0x40d729){var _0xa280b8={'state':0x19,'statedesc':_0xb53f('0xcc')};this[_0xb53f('0xb0')](_0x3cb39d);this[_0xb53f('0xcd')](_[_0xb53f('0xce')](_0xa280b8,_[_0xb53f('0xcf')](_0x40d729,['ContactId',_0xb53f('0xd0'),_0xb53f('0xd1'),'VoiceQueueId','CampaignId'])),'[emptyContact][createHistory]',_0xb53f('0xd2'));logger['error'](_0x4ce137);};Dialer[_0xb53f('0x16')]['isSuccess']=function(_0x5c18dc){return _0x5c18dc===_0xb53f('0xd3');};Dialer[_0xb53f('0x16')]['isTrunkReachable']=function(_0x5ced4c){return!_['isUndefined'](_0x5ced4c)&&_0x5ced4c&&!_[_0xb53f('0x3b')](_0x5ced4c[_0xb53f('0x3f')])&&!_['isUndefined'](_0x5ced4c[_0xb53f('0xd4')])&&_0x5ced4c['active']&&(this[_0xb53f('0x1c')][util[_0xb53f('0x77')](_0xb53f('0xd5'),_0x5ced4c[_0xb53f('0x3f')])][_0xb53f('0xae')]===_0xb53f('0xd6')||this[_0xb53f('0x1c')][util[_0xb53f('0x77')](_0xb53f('0xd5'),_0x5ced4c[_0xb53f('0x3f')])][_0xb53f('0xae')]===_0xb53f('0xd7'));};Dialer[_0xb53f('0x16')][_0xb53f('0xcd')]=function(_0x1c69fb,_0x459ace,_0x11f725){this[_0xb53f('0xc8')](_0x1c69fb)['catch'](loggerCatch(_0x459ace));this[_0xb53f('0xc6')](_0x1c69fb)[_0xb53f('0xb5')](loggerCatch(_0x11f725));};Dialer['prototype']['syncVarSet']=function(_0x563492){var _0x3b0ce8=this[_0xb53f('0x21')][_0x563492[_0xb53f('0xd8')]];var _0x39331f;if(!_[_0xb53f('0xad')](_0x563492)&&!_[_0xb53f('0xad')](_0x563492[_0xb53f('0xd9')])&&!_[_0xb53f('0xad')](_0x563492[_0xb53f('0xd9')]['amdstatus'])&&_0x563492[_0xb53f('0xda')]===_0xb53f('0xdb')&&_0x3b0ce8){if(_0x3b0ce8['type']!==_0xb53f('0x7a')&&this[_0xb53f('0x19')][_0x3b0ce8[_0xb53f('0xb2')]][_0xb53f('0xdc')]&&_0x563492[_0xb53f('0xdd')]==='HANGUP'){delete this['uniqueId'][_0x563492['uniqueid']];this[_0xb53f('0xb0')](this[_0xb53f('0x19')][_0x3b0ce8['queue']]);this[_0xb53f('0x19')][_0x3b0ce8[_0xb53f('0xb2')]][_0xb53f('0x5c')]+=0x1;this[_0xb53f('0x19')][_0x3b0ce8[_0xb53f('0xb2')]][_0xb53f('0x5b')]+=0x1;_0x39331f=new Hangup(_0x3b0ce8,_0x563492);_0x39331f[_0xb53f('0xa4')]=0x12;_0x39331f['statedesc']=_0xb53f('0xde');_0x39331f[_0xb53f('0xdf')]=_0xb53f('0xe0');ami[_0xb53f('0x4a')]('custom:amd',ut[_0xb53f('0xe1')](_0x39331f,_0xb53f('0xe2')));this[_0xb53f('0xcd')](_0x39331f,_0xb53f('0xe3'),_0xb53f('0xe4'));}if(_0x3b0ce8[_0xb53f('0x4b')]!=='ivr'&&this[_0xb53f('0x19')][_0x3b0ce8[_0xb53f('0xb2')]][_0xb53f('0xdc')]&&_0x563492[_0xb53f('0xdd')]===_0xb53f('0xe5')){var _0x5b5412=this;return new BPromise(function(_0x5062ec,_0x2f0d6d){delete _0x5b5412[_0xb53f('0x21')][_0x563492[_0xb53f('0xd8')]];_0x5b5412[_0xb53f('0xb0')](_0x5b5412[_0xb53f('0x19')][_0x3b0ce8[_0xb53f('0xb2')]]);_0x5b5412['voiceQueues'][_0x3b0ce8['queue']]['outboundAnswerCallsDay']+=0x1;_0x5b5412['voiceQueues'][_0x3b0ce8[_0xb53f('0xb2')]][_0xb53f('0x5b')]+=0x1;var _0x5a604d=_0x5b5412[_0xb53f('0x19')][_0x3b0ce8[_0xb53f('0xb2')]];var _0x326a27=new Hangup(_0x3b0ce8,_0x563492);_0x326a27[_0xb53f('0xa4')]=0x13;_0x326a27[_0xb53f('0xa5')]=_0xb53f('0xe6');_0x326a27[_0xb53f('0xdf')]=_0xb53f('0xe0');_0x326a27['countmachineretry']+=0x1;_0x326a27[_0xb53f('0xe7')]+=0x1;_0x326a27[_0xb53f('0xe2')]=!![];ami[_0xb53f('0x4a')](_0xb53f('0xe8'),ut[_0xb53f('0xe1')](_0x326a27,_0xb53f('0xe2')));_0x5b5412[_0xb53f('0xc8')](_0x326a27)[_0xb53f('0xb5')](loggerCatch(_0xb53f('0xe9')));if(_0x326a27[_0xb53f('0xea')]+_0x326a27[_0xb53f('0xeb')]+_0x326a27[_0xb53f('0xec')]+_0x326a27[_0xb53f('0xed')]+_0x326a27[_0xb53f('0xee')]+_0x326a27[_0xb53f('0xef')]+_0x326a27[_0xb53f('0xf0')]+_0x326a27['countagentrejectretry']>=_0x5a604d[_0xb53f('0xf1')]){_0x5b5412[_0xb53f('0xf2')](_0x326a27,_0x5062ec,_0x2f0d6d,'reason19\x20machine....');}else{if(_0x326a27[_0xb53f('0xf0')]>=_0x5a604d[_0xb53f('0xf3')]){_0x5b5412['createStateFinal'](_0x326a27,_0x5062ec,_0x2f0d6d,_0xb53f('0xf4'));}else{_0x5b5412[_0xb53f('0xbd')]({'active':![],'countmachineretry':_0x326a27[_0xb53f('0xf0')],'scheduledat':moment()[_0xb53f('0xf5')](_0x5a604d[_0xb53f('0xf6')],_0xb53f('0xf7'))['format'](_0xb53f('0xf8')),'ContactId':_0x326a27['ContactId'],'ListId':_0x326a27[_0xb53f('0xd0')],'VoiceQueueId':_0x326a27[_0xb53f('0xf9')]||undefined,'CampaignId':_0x326a27[_0xb53f('0xfa')]||undefined})[_0xb53f('0xb5')](loggerCatch('[rescheduleContact][Machine]'));_0x5062ec({'reschedule':0x1});}}});}if(_0x3b0ce8[_0xb53f('0x4b')]==='ivr'&&this[_0xb53f('0x1a')][_0x3b0ce8[_0xb53f('0xb2')]][_0xb53f('0xdc')]&&_0x563492['value']===_0xb53f('0xfb')){delete this[_0xb53f('0x21')][_0x563492[_0xb53f('0xd8')]];this[_0xb53f('0xb0')](this[_0xb53f('0x1a')][_0x3b0ce8['queue']]);_0x39331f=new Hangup(_0x3b0ce8,_0x563492);_0x39331f[_0xb53f('0xa4')]=0x12;_0x39331f[_0xb53f('0xa5')]='HangupInAMD';_0x39331f[_0xb53f('0xdf')]='AMD';ami[_0xb53f('0x4a')](_0xb53f('0xe8'),ut[_0xb53f('0xe1')](_0x39331f,_0xb53f('0xe2')));this[_0xb53f('0xcd')](_0x39331f,'[syncHangupInAMDIvr][createHistory]',_0xb53f('0xfc'));}if(_0x3b0ce8[_0xb53f('0x4b')]===_0xb53f('0x7a')&&this[_0xb53f('0x1a')][_0x3b0ce8[_0xb53f('0xb2')]][_0xb53f('0xdc')]&&_0x563492[_0xb53f('0xdd')]===_0xb53f('0xe5')){var _0x5b5412=this;return new BPromise(function(_0x4ead50,_0x342ff3){delete _0x5b5412[_0xb53f('0x21')][_0x563492[_0xb53f('0xd8')]];_0x5b5412[_0xb53f('0xb0')](_0x5b5412[_0xb53f('0x1a')][_0x3b0ce8[_0xb53f('0xb2')]]);_0x5b5412['campaigns'][_0x3b0ce8['queue']][_0xb53f('0x5c')]+=0x1;_0x5b5412['campaigns'][_0x3b0ce8[_0xb53f('0xb2')]][_0xb53f('0x5b')]+=0x1;var _0x302930=_0x5b5412['campaigns'][_0x3b0ce8['queue']];var _0x4e32b1=new Hangup(_0x3b0ce8,_0x563492);_0x4e32b1[_0xb53f('0xa4')]=0x13;_0x4e32b1[_0xb53f('0xa5')]=_0xb53f('0xe6');_0x4e32b1[_0xb53f('0xdf')]=_0xb53f('0xe0');_0x4e32b1[_0xb53f('0xf0')]+=0x1;_0x4e32b1[_0xb53f('0xe7')]+=0x1;_0x4e32b1[_0xb53f('0xe2')]=!![];ami[_0xb53f('0x4a')]('custom:amd',ut[_0xb53f('0xe1')](_0x4e32b1,_0xb53f('0xe2')));_0x5b5412[_0xb53f('0xc8')](_0x4e32b1)['catch'](loggerCatch(_0xb53f('0xe9')));if(_0x4e32b1[_0xb53f('0xea')]+_0x4e32b1['countcongestionretry']+_0x4e32b1[_0xb53f('0xec')]+_0x4e32b1['countnosuchnumberretry']+_0x4e32b1[_0xb53f('0xee')]+_0x4e32b1[_0xb53f('0xef')]+_0x4e32b1[_0xb53f('0xf0')]+_0x4e32b1[_0xb53f('0xfd')]>=_0x302930[_0xb53f('0xf1')]){_0x5b5412['stateGlobal'](_0x4e32b1,_0x4ead50,_0x342ff3,_0xb53f('0xfe'));}else{if(_0x4e32b1['countmachineretry']>=_0x302930['dialMachineMaxRetry']){_0x5b5412[_0xb53f('0xff')](_0x4e32b1,_0x4ead50,_0x342ff3,_0xb53f('0xf4'));}else{_0x5b5412[_0xb53f('0xbd')]({'active':![],'countmachineretry':_0x4e32b1[_0xb53f('0xf0')],'scheduledat':moment()[_0xb53f('0xf5')](_0x302930['dialMachineRetryFrequency'],'minutes')['format'](_0xb53f('0xf8')),'ContactId':_0x4e32b1[_0xb53f('0x100')],'ListId':_0x4e32b1[_0xb53f('0xd0')],'VoiceQueueId':_0x4e32b1['VoiceQueueId']||undefined,'CampaignId':_0x4e32b1[_0xb53f('0xfa')]||undefined})[_0xb53f('0xb5')](loggerCatch(_0xb53f('0x101')));_0x4ead50({'reschedule':0x1});}}});}}};Dialer[_0xb53f('0x16')]['syncHangup']=function(_0xa1c2ad){var _0x2e302d=this[_0xb53f('0x21')][_0xa1c2ad['uniqueid']];var _0x4d3501=this;var _0x553484;if(_0x2e302d&&_0x2e302d[_0xb53f('0x4b')]===_0xb53f('0x7a')){delete this[_0xb53f('0x21')][_0xa1c2ad[_0xb53f('0xd8')]];this['updateOriginated'](this[_0xb53f('0x1a')][_0x2e302d[_0xb53f('0xb2')]]);this[_0xb53f('0x1a')][_0x2e302d[_0xb53f('0xb2')]][_0xb53f('0x102')]+=0x1;_0x553484=new Hangup(_0x2e302d,_0xa1c2ad);this['createHistory'](_0x553484)[_0xb53f('0xb5')](loggerCatch('[syncHangupIvr][createHistory]'));this['moveContactManagedDialer'](_0x553484)[_0xb53f('0xb5')](loggerCatch(_0xb53f('0x103')));}if(_0x2e302d&&_0x2e302d[_0xb53f('0x4b')]!=='ivr'&&isNotNull(this[_0xb53f('0x19')][_0x2e302d[_0xb53f('0xb2')]]['dialQueueProject'])){delete this[_0xb53f('0x21')][_0xa1c2ad[_0xb53f('0xd8')]];this[_0xb53f('0xb0')](this[_0xb53f('0x19')][_0x2e302d[_0xb53f('0xb2')]]);this[_0xb53f('0x19')][_0x2e302d['queue']][_0xb53f('0x5c')]+=0x1;this[_0xb53f('0x19')][_0x2e302d[_0xb53f('0xb2')]][_0xb53f('0x5b')]+=0x1;_0x553484=new Hangup(_0x2e302d,_0xa1c2ad);_0x553484['state']=0x10;_0x553484['statedesc']='AnswerAGI';_0x553484['membername']=_0xb53f('0x104');this[_0xb53f('0xc8')](_0x553484)[_0xb53f('0xb5')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xb53f('0xc6')](_0x553484)[_0xb53f('0xb5')](loggerCatch(_0xb53f('0x103')));}if(_0x2e302d&&_0x2e302d['type']!==_0xb53f('0x7a')&&!isNotNull(this['voiceQueues'][_0x2e302d[_0xb53f('0xb2')]][_0xb53f('0x105')])){delete this[_0xb53f('0x21')][_0xa1c2ad['uniqueid']];this[_0xb53f('0xb0')](this[_0xb53f('0x19')][_0x2e302d[_0xb53f('0xb2')]]);this[_0xb53f('0x19')][_0x2e302d[_0xb53f('0xb2')]][_0xb53f('0x64')]+=0x1;_0x553484=new Hangup(_0x2e302d,_0xa1c2ad);_0x553484['state']=0xc;_0x553484[_0xb53f('0xa5')]=_0xa1c2ad['cause-txt'];_0x553484['membername']=_0xb53f('0x106');this['createHistory'](_0x553484)[_0xb53f('0xb5')](loggerCatch(_0xb53f('0x107')));this[_0xb53f('0xc6')](_0x553484)[_0xb53f('0xb5')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0xb53f('0x16')][_0xb53f('0x2e')]=function(_0x379672){var _0x1b8482=this['uniqueId'][_0x379672['uniqueid']];var _0x2dc95f=this;if(this[_0xb53f('0x19')][_0x379672[_0xb53f('0xb2')]]){if(_0x1b8482&&_0x1b8482[_0xb53f('0x4b')]!=='ivr'){delete this[_0xb53f('0x21')][_0x379672[_0xb53f('0xd8')]];this[_0xb53f('0x19')][_0x379672['queue']][_0xb53f('0x5c')]+=0x1;var _0x57a740=new AgentComplete(_0x1b8482,_0x379672);if(_0x379672[_0xb53f('0x108')]===_0xb53f('0x109')){_0x57a740[_0xb53f('0x10a')]=this[_0xb53f('0x19')][_0x379672[_0xb53f('0xb2')]][_0xb53f('0x10b')]&&this[_0xb53f('0x19')][_0x379672[_0xb53f('0xb2')]]['dialAgiAfterHangupAgent']?moment()[_0xb53f('0x77')](_0xb53f('0xf8')):undefined;}this[_0xb53f('0xc8')](_0x57a740)[_0xb53f('0xb5')](loggerCatch(_0xb53f('0x10c')));this[_0xb53f('0xc6')](_0x57a740)[_0xb53f('0xb5')](loggerCatch(_0xb53f('0x10d')));}}};Dialer[_0xb53f('0x16')][_0xb53f('0x28')]=function(_0xbdec56){if(this['voiceQueues'][_0xbdec56[_0xb53f('0xb2')]]){if(this['uniqueId'][_0xbdec56[_0xb53f('0xd8')]]&&this[_0xb53f('0x21')][_0xbdec56[_0xb53f('0xd8')]][_0xb53f('0x4b')]!=='ivr'){this['updateOriginated'](this[_0xb53f('0x19')][_0xbdec56[_0xb53f('0xb2')]]);this[_0xb53f('0x21')][_0xbdec56[_0xb53f('0xd8')]][_0xb53f('0x10e')]=moment()[_0xb53f('0x77')](_0xb53f('0xf8'));}}};Dialer[_0xb53f('0x16')]['queueCallerAbandonCreateState']=function(_0x4ea202){this[_0xb53f('0xc8')](_0x4ea202)[_0xb53f('0xb5')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0xb53f('0xc6')](_0x4ea202)[_0xb53f('0xb5')](loggerCatch(_0xb53f('0x10f')));};Dialer[_0xb53f('0x16')]['syncQueueCallerAbandon']=function(_0x4666f1){var _0x10bb71=this[_0xb53f('0x21')][_0x4666f1['uniqueid']];var _0x29ccfc=this;if(this[_0xb53f('0x19')][_0x4666f1['queue']]){if(_0x10bb71&&_0x10bb71[_0xb53f('0x4b')]!==_0xb53f('0x7a')){delete this[_0xb53f('0x21')][_0x4666f1[_0xb53f('0xd8')]];this[_0xb53f('0xb0')](this['voiceQueues'][_0x4666f1[_0xb53f('0xb2')]]);_0x10bb71[_0xb53f('0x110')]=moment()['format'](_0xb53f('0xf8'));var _0x140a7e=new QueueCallerAbandon(_0x10bb71,_0x4666f1);if(getSeconds(_0x10bb71['droptime'],_0x10bb71[_0xb53f('0x111')])>=_0x10bb71['dialQueueTimeout']){this[_0xb53f('0x19')][_0x4666f1[_0xb53f('0xb2')]][_0xb53f('0x69')]+=0x1;this[_0xb53f('0x19')][_0x4666f1['queue']][_0xb53f('0x112')]+=0x1;this[_0xb53f('0x19')][_0x4666f1[_0xb53f('0xb2')]][_0xb53f('0x6b')]+=0x1;_0x140a7e['state']=0xa;_0x140a7e[_0xb53f('0xa5')]=_0xb53f('0x113');_0x140a7e[_0xb53f('0x114')]=_0xb53f('0x115');_0x140a7e['agiafterat']=this['voiceQueues'][_0x4666f1[_0xb53f('0xb2')]][_0xb53f('0x10b')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x140a7e[_0xb53f('0xee')]+=0x1;_0x140a7e[_0xb53f('0xe7')]+=0x1;if(_0x140a7e[_0xb53f('0xee')]>=this['voiceQueues'][_0x4666f1[_0xb53f('0xb2')]][_0xb53f('0x116')]){this['queueCallerAbandonCreateState'](_0x140a7e);}else{this[_0xb53f('0xbd')]({'active':![],'countdropretry':_0x140a7e[_0xb53f('0xee')],'scheduledat':moment()[_0xb53f('0xf5')](this[_0xb53f('0x19')][_0x4666f1[_0xb53f('0xb2')]]['dialDropRetryFrequency'],'minutes')[_0xb53f('0x77')](_0xb53f('0xf8')),'ContactId':_0x10bb71[_0xb53f('0x100')],'ListId':_0x10bb71['ListId'],'VoiceQueueId':_0x10bb71[_0xb53f('0xf9')]||undefined,'CampaignId':_0x10bb71[_0xb53f('0xfa')]||undefined})[_0xb53f('0xb5')](loggerCatch(_0xb53f('0x117')));var _0xac4322=new History(_0x140a7e);_0xac4322[_0xb53f('0xa4')]=0xa;_0xac4322[_0xb53f('0xa5')]=_0xb53f('0x113');_0xac4322['starttime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0xac4322[_0xb53f('0xa6')]=_0xac4322[_0xb53f('0xa7')];_0xac4322[_0xb53f('0x118')]=_0x140a7e['calleridname'];_0xac4322[_0xb53f('0x119')]=_0x140a7e[_0xb53f('0x119')];this['createHistory'](_0xac4322)['catch'](loggerCatch(_0xb53f('0x11a')));}}else{this[_0xb53f('0x19')][_0x4666f1[_0xb53f('0xb2')]][_0xb53f('0x68')]+=0x1;this[_0xb53f('0x19')][_0x4666f1[_0xb53f('0xb2')]][_0xb53f('0x61')]+=0x1;_0x140a7e['state']=0xb;_0x140a7e[_0xb53f('0xa5')]=_0xb53f('0x11b');_0x140a7e[_0xb53f('0x114')]=_0xb53f('0x11c');_0x140a7e['countabandonedretry']+=0x1;_0x140a7e[_0xb53f('0xe7')]+=0x1;if(_0x140a7e[_0xb53f('0xef')]>=this[_0xb53f('0x19')][_0x4666f1[_0xb53f('0xb2')]][_0xb53f('0x11d')]){this['queueCallerAbandonCreateState'](_0x140a7e);}else{this[_0xb53f('0xbd')]({'active':![],'countabandonedretry':_0x140a7e[_0xb53f('0xef')],'scheduledat':moment()[_0xb53f('0xf5')](this[_0xb53f('0x19')][_0x4666f1[_0xb53f('0xb2')]]['dialAbandonedRetryFrequency'],_0xb53f('0xf7'))['format'](_0xb53f('0xf8')),'ContactId':_0x10bb71['ContactId'],'ListId':_0x10bb71[_0xb53f('0xd0')],'VoiceQueueId':_0x10bb71['VoiceQueueId']||undefined,'CampaignId':_0x10bb71[_0xb53f('0xfa')]||undefined})['catch'](loggerCatch(_0xb53f('0x11e')));var _0xac4322=new History(_0x140a7e);_0xac4322[_0xb53f('0xa4')]=0xb;_0xac4322[_0xb53f('0xa5')]=_0xb53f('0x11b');_0xac4322[_0xb53f('0xa7')]=moment()[_0xb53f('0x77')]('YYYY-MM-DD\x20HH:mm:ss');_0xac4322[_0xb53f('0xa6')]=_0xac4322[_0xb53f('0xa7')];_0xac4322[_0xb53f('0x118')]=_0x140a7e[_0xb53f('0x118')];_0xac4322[_0xb53f('0x119')]=_0x140a7e[_0xb53f('0x119')];this[_0xb53f('0xc8')](_0xac4322)[_0xb53f('0xb5')](loggerCatch(_0xb53f('0x11f')));}}}}};Dialer[_0xb53f('0x16')][_0xb53f('0x120')]=function(_0x11cd3e){if(this[_0xb53f('0x1f')][_0x11cd3e[_0xb53f('0xd8')]]){this[_0xb53f('0x1f')][_0x11cd3e['uniqueid']]['channel']=_0x11cd3e[_0xb53f('0xaf')];}if(this['uniqueId'][_0x11cd3e[_0xb53f('0xd8')]]){this['uniqueId'][_0x11cd3e['uniqueid']][_0xb53f('0xaf')]=_0x11cd3e[_0xb53f('0xaf')];}};Dialer[_0xb53f('0x16')][_0xb53f('0x35')]=function(_0x499dff){if(strategy[this[_0xb53f('0x19')][this[_0xb53f('0x1f')][_0x499dff[_0xb53f('0x121')]][_0xb53f('0xb2')]][_0xb53f('0x4d')]]===_0xb53f('0x15')){if(this['actions'][_0x499dff['actionid']]&&_[_0xb53f('0xad')](this[_0xb53f('0x1f')][_0x499dff[_0xb53f('0x121')]][_0xb53f('0x122')])&&_0x499dff['status']==='1'&&_0x499dff[_0xb53f('0x123')]==='0'){if(this[_0xb53f('0x1b')][_0x499dff[_0xb53f('0x124')]]){if(!this['agents'][_0x499dff[_0xb53f('0x124')]][_0xb53f('0x122')]){this[_0xb53f('0x1b')][_0x499dff[_0xb53f('0x124')]]['locked']=!![];this[_0xb53f('0x1f')][_0x499dff[_0xb53f('0x121')]][_0xb53f('0x122')]=!![];this[_0xb53f('0x1f')][_0x499dff[_0xb53f('0x121')]][_0xb53f('0x124')]=_0x499dff['stateinterface'];}}}}else if((strategy[this[_0xb53f('0x19')][this[_0xb53f('0x1f')][_0x499dff['actionid']]['queue']]['strategy']]||_0xb53f('0x125'))===_0xb53f('0x125')){if(this[_0xb53f('0x1f')][_0x499dff[_0xb53f('0x121')]]){if(this[_0xb53f('0x1b')][_0x499dff['stateinterface']]){this[_0xb53f('0x1f')][_0x499dff['actionid']][_0xb53f('0x124')]=_0x499dff[_0xb53f('0x124')];if(_[_0xb53f('0xad')](this[_0xb53f('0x25')][this['actions'][_0x499dff['actionid']]['queue']])){this[_0xb53f('0x25')][this[_0xb53f('0x1f')][_0x499dff['actionid']]['queue']]=[];}this[_0xb53f('0x25')][this[_0xb53f('0x1f')][_0x499dff['actionid']][_0xb53f('0xb2')]]['push'](_[_0xb53f('0xce')](_[_0xb53f('0xcf')](this[_0xb53f('0x1f')][_0x499dff[_0xb53f('0x121')]],[_0xb53f('0x126'),_0xb53f('0x124')]),{'status':_0x499dff[_0xb53f('0xae')],'paused':_0x499dff[_0xb53f('0x123')]}));}}}};function unlockQueueStatus(_0xe9dbf6,_0x307b8f){setTimeout(function(){if(_[_0xb53f('0x3b')](_0xe9dbf6[_0xb53f('0x127')])){loggerBooked[_0xb53f('0x91')](_0xb53f('0x128'),_0x307b8f);}_0xe9dbf6[_0xb53f('0x127')]=!![];loggerBooked[_0xb53f('0x7c')]('[booked][unlockQueueStatus]',_0x307b8f,JSON[_0xb53f('0x76')](_[_0xb53f('0xcf')](_0xe9dbf6,[_0xb53f('0x3f'),_0xb53f('0x127')])));},0x1f3);}Dialer[_0xb53f('0x16')][_0xb53f('0x37')]=function(_0x58f16a){var _0x18e5ae=this;var _0x3a8fc5=_0x18e5ae['voiceQueues'][_0x18e5ae[_0xb53f('0x1f')][_0x58f16a[_0xb53f('0x121')]][_0xb53f('0xb2')]];if(strategy[this[_0xb53f('0x19')][this[_0xb53f('0x1f')][_0x58f16a[_0xb53f('0x121')]][_0xb53f('0xb2')]][_0xb53f('0x4d')]]===_0xb53f('0x15')){if(this[_0xb53f('0x1f')][_0x58f16a['actionid']]&&this[_0xb53f('0x1f')][_0x58f16a['actionid']][_0xb53f('0x124')]){this[_0xb53f('0x8d')]['run'](this[_0xb53f('0x1f')][_0x58f16a[_0xb53f('0x121')]][_0xb53f('0x126')],this[_0xb53f('0x1f')][_0x58f16a[_0xb53f('0x121')]][_0xb53f('0x124')])[_0xb53f('0xb5')](function(_0x3271ba){logger['error']('[Catch][Preview][syncQueueStatusComplete]',util['inspect'](_0x3271ba,{'showHidden':![],'depth':null}));})[_0xb53f('0x18')](function(){_0x18e5ae[_0xb53f('0xb0')](_0x18e5ae[_0xb53f('0x19')][_0x18e5ae['actions'][_0x58f16a[_0xb53f('0x121')]][_0xb53f('0xb2')]]);_0x18e5ae['agents'][_0x18e5ae['actions'][_0x58f16a['actionid']][_0xb53f('0x124')]]['locked']=![];delete _0x18e5ae[_0xb53f('0x1f')][_0x58f16a['actionid']];unlockQueueStatus(_0x3a8fc5);});}else{this[_0xb53f('0xb0')](this['voiceQueues'][this[_0xb53f('0x1f')][_0x58f16a[_0xb53f('0x121')]][_0xb53f('0xb2')]]);this['rescheduleContact']({'active':![],'ContactId':this['actions'][_0x58f16a[_0xb53f('0x121')]]['ContactId'],'ListId':this[_0xb53f('0x1f')][_0x58f16a['actionid']]['ListId'],'VoiceQueueId':this[_0xb53f('0x1f')][_0x58f16a['actionid']][_0xb53f('0xf9')]||undefined,'CampaignId':this[_0xb53f('0x1f')][_0x58f16a['actionid']]['CampaignId']||undefined})[_0xb53f('0xb5')](loggerCatch(_0xb53f('0x129')));delete this[_0xb53f('0x1f')][_0x58f16a[_0xb53f('0x121')]];unlockQueueStatus(_0x3a8fc5);}}else if((strategy[this['voiceQueues'][this['actions'][_0x58f16a[_0xb53f('0x121')]]['queue']][_0xb53f('0x4d')]]||'rrmemory')===_0xb53f('0x125')){var _0xc9d83d;if(this[_0xb53f('0x1f')][_0x58f16a[_0xb53f('0x121')]]&&!_[_0xb53f('0x45')](this[_0xb53f('0x25')][this['actions'][_0x58f16a[_0xb53f('0x121')]][_0xb53f('0xb2')]])){if(this[_0xb53f('0x26')][_0x18e5ae['actions'][_0x58f16a[_0xb53f('0x121')]][_0xb53f('0xb2')]]){this[_0xb53f('0x26')][_0x18e5ae[_0xb53f('0x1f')][_0x58f16a[_0xb53f('0x121')]][_0xb53f('0xb2')]]=this[_0xb53f('0x26')][this[_0xb53f('0x1f')][_0x58f16a['actionid']][_0xb53f('0xb2')]]?this[_0xb53f('0x26')][this['actions'][_0x58f16a[_0xb53f('0x121')]][_0xb53f('0xb2')]]:this[_0xb53f('0x25')][this['actions'][_0x58f16a['actionid']]['queue']]?this['queueBooked'][this[_0xb53f('0x1f')][_0x58f16a[_0xb53f('0x121')]][_0xb53f('0xb2')]][_0xb53f('0x12a')]||0x0:0x0;}this[_0xb53f('0x25')][this[_0xb53f('0x1f')][_0x58f16a[_0xb53f('0x121')]][_0xb53f('0xb2')]][_0xb53f('0x12a')]=this[_0xb53f('0x26')][this[_0xb53f('0x1f')][_0x58f16a[_0xb53f('0x121')]]['queue']];for(var _0x2d7e3f=0x0;_0x2d7e3f<this['queueBooked'][this['actions'][_0x58f16a[_0xb53f('0x121')]][_0xb53f('0xb2')]][_0xb53f('0x94')];_0x2d7e3f+=0x1){_0xc9d83d=rr(this[_0xb53f('0x25')][this[_0xb53f('0x1f')][_0x58f16a['actionid']][_0xb53f('0xb2')]]);this[_0xb53f('0x26')][_0x18e5ae[_0xb53f('0x1f')][_0x58f16a[_0xb53f('0x121')]]['queue']]=this[_0xb53f('0x25')][this['actions'][_0x58f16a[_0xb53f('0x121')]][_0xb53f('0xb2')]][_0xb53f('0x12a')];if(_0xc9d83d[_0xb53f('0xae')]==='1'&&_0xc9d83d['paused']==='0'){break;}}if(!_['isNil'](_0xc9d83d)){this[_0xb53f('0x1b')][_0xc9d83d[_0xb53f('0x124')]][_0xb53f('0x12b')]=_[_0xb53f('0x3b')](this[_0xb53f('0x1b')][_0xc9d83d[_0xb53f('0x124')]][_0xb53f('0x12b')])?!![]:this[_0xb53f('0x1b')][_0xc9d83d[_0xb53f('0x124')]][_0xb53f('0x12b')];}loggerBooked[_0xb53f('0x7c')](_0xb53f('0x12c'),_0x58f16a[_0xb53f('0x121')],_0xb53f('0x12d'),JSON[_0xb53f('0x76')](_[_0xb53f('0xcf')](this['agents'][_0xc9d83d[_0xb53f('0x124')]],[_0xb53f('0x3f'),_0xb53f('0x12b')])),_0xb53f('0x12e'),JSON[_0xb53f('0x76')](_0xc9d83d[_0xb53f('0x126')]));if(!_['isNil'](_0xc9d83d)&&_0xc9d83d['status']==='1'&&_0xc9d83d[_0xb53f('0x123')]==='0'&&this[_0xb53f('0x1b')][_0xc9d83d[_0xb53f('0x124')]][_0xb53f('0x12b')]){this[_0xb53f('0x1b')][_0xc9d83d[_0xb53f('0x124')]][_0xb53f('0x12b')]=![];this[_0xb53f('0x25')][_0x18e5ae['actions'][_0x58f16a[_0xb53f('0x121')]][_0xb53f('0xb2')]]=[];this['preview']['run'](_0xc9d83d[_0xb53f('0x126')],_0xc9d83d[_0xb53f('0x124')])[_0xb53f('0xb5')](function(_0x4a6b54){logger[_0xb53f('0x91')]('[Catch][Preview][syncQueueStatusComplete]',util[_0xb53f('0x93')](_0x4a6b54,{'showHidden':![],'depth':null}));})[_0xb53f('0x18')](function(){_0x18e5ae['updateOriginated'](_0x18e5ae[_0xb53f('0x19')][_0x18e5ae[_0xb53f('0x1f')][_0x58f16a[_0xb53f('0x121')]][_0xb53f('0xb2')]]);setTimeout(function(){_0x18e5ae[_0xb53f('0x1b')][_0xc9d83d[_0xb53f('0x124')]]['unlockRR']=!![];loggerBooked[_0xb53f('0x7c')](_0xb53f('0x12f'),_0x58f16a[_0xb53f('0x121')],_0xb53f('0x12d'),JSON['stringify'](_['pick'](_0x18e5ae[_0xb53f('0x1b')][_0xc9d83d['stateinterface']],[_0xb53f('0x3f'),_0xb53f('0x12b')])),_0xb53f('0x12e'),JSON[_0xb53f('0x76')](_0xc9d83d[_0xb53f('0x126')]));},0xc7);delete _0x18e5ae['actions'][_0x58f16a['actionid']];unlockQueueStatus(_0x3a8fc5,_0x58f16a['actionid']);});}else{loggerBooked[_0xb53f('0x7c')](_0xb53f('0x130'));this['updateOriginated'](this['voiceQueues'][this[_0xb53f('0x1f')][_0x58f16a[_0xb53f('0x121')]][_0xb53f('0xb2')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0xb53f('0x1f')][_0x58f16a[_0xb53f('0x121')]][_0xb53f('0x100')],'ListId':this[_0xb53f('0x1f')][_0x58f16a[_0xb53f('0x121')]]['ListId'],'VoiceQueueId':this['actions'][_0x58f16a[_0xb53f('0x121')]][_0xb53f('0xf9')]||undefined,'CampaignId':this[_0xb53f('0x1f')][_0x58f16a[_0xb53f('0x121')]][_0xb53f('0xfa')]||undefined})['catch'](loggerCatch(_0xb53f('0x129')));delete this[_0xb53f('0x1f')][_0x58f16a[_0xb53f('0x121')]];unlockQueueStatus(_0x3a8fc5);}}else{loggerBooked[_0xb53f('0x7c')](_0xb53f('0x131'));this[_0xb53f('0xb0')](this['voiceQueues'][this[_0xb53f('0x1f')][_0x58f16a[_0xb53f('0x121')]][_0xb53f('0xb2')]]);this[_0xb53f('0xbd')]({'active':![],'ContactId':this['actions'][_0x58f16a[_0xb53f('0x121')]][_0xb53f('0x100')],'ListId':this['actions'][_0x58f16a[_0xb53f('0x121')]][_0xb53f('0xd0')],'VoiceQueueId':this[_0xb53f('0x1f')][_0x58f16a['actionid']][_0xb53f('0xf9')]||undefined,'CampaignId':this[_0xb53f('0x1f')][_0x58f16a['actionid']][_0xb53f('0xfa')]||undefined})[_0xb53f('0xb5')](loggerCatch(_0xb53f('0x132')));delete this[_0xb53f('0x1f')][_0x58f16a['actionid']];unlockQueueStatus(_0x3a8fc5);}}else{loggerBooked[_0xb53f('0x7c')](_0xb53f('0x133'));this[_0xb53f('0xb0')](this['voiceQueues'][this['actions'][_0x58f16a[_0xb53f('0x121')]][_0xb53f('0xb2')]]);this[_0xb53f('0xbd')]({'active':![],'ContactId':this[_0xb53f('0x1f')][_0x58f16a[_0xb53f('0x121')]][_0xb53f('0x100')],'ListId':this[_0xb53f('0x1f')][_0x58f16a['actionid']][_0xb53f('0xd0')],'VoiceQueueId':this['actions'][_0x58f16a['actionid']][_0xb53f('0xf9')]||undefined,'CampaignId':this[_0xb53f('0x1f')][_0x58f16a['actionid']][_0xb53f('0xfa')]||undefined})[_0xb53f('0xb5')](loggerCatch(_0xb53f('0x134')));delete this['actions'][_0x58f16a[_0xb53f('0x121')]];unlockQueueStatus(_0x3a8fc5);}};Dialer['prototype'][_0xb53f('0x135')]=function(){var _0x488963=this;return BPromise[_0xb53f('0xb4')]()['then'](cmHopper[_0xb53f('0x136')]({}))[_0xb53f('0x3a')](function(){setInterval(function(){_0x488963[_0xb53f('0x137')]();},0x3e8);});};Dialer[_0xb53f('0x16')][_0xb53f('0x138')]=function(_0x351ca7){var _0x2dca85=this;return function(){if(!_0x2dca85[_0xb53f('0x139')](_0x351ca7[_0xb53f('0x74')])){if(!_0x2dca85[_0xb53f('0x139')](_0x351ca7[_0xb53f('0x13a')])){_0x351ca7[_0xb53f('0x3c')]=_0xb53f('0x13b');throw _0x351ca7[_0xb53f('0x3f')]+'\x20trunk\x20is\x20not\x20reachable';}}};};Dialer[_0xb53f('0x16')][_0xb53f('0x13c')]=function(_0x30e61d,_0x488ff5,_0x427802,_0x843d7){var _0x13d89d=this;return function(){var _0x148cf5=!![];return _0x13d89d[_0xb53f('0x13d')](_0x30e61d,_0x488ff5,_0x427802,_0x843d7,_0x148cf5);};};Dialer[_0xb53f('0x16')][_0xb53f('0x13e')]=function(_0x30134c,_0x3d0fb2,_0x55a5b5,_0x14d794){var _0x3959bf=this;return function(){var _0x2eb9a5=![];return _0x3959bf[_0xb53f('0x13d')](_0x30134c[_0xb53f('0x44')],_0x3d0fb2,_0x55a5b5,_0x14d794,_0x2eb9a5);};};Dialer[_0xb53f('0x16')]['ifTime']=function(_0x4ac685,_0x56a868,_0xf30a0b,_0x2d05e8,_0x2ed41a){var _0x220648=[];return new BPromise(function(_0x8076ce,_0x2a8612){if(!isNotNull(_0x4ac685)){_0x2d05e8['message']=_0xb53f('0x42');return _0x2a8612(msgResponse(_0xb53f('0x13d'),_0xb53f('0x13f'),_0xf30a0b+_0xb53f('0x140')));}if(_[_0xb53f('0x45')](_0x4ac685)){_0x2d05e8['message']='INTERVAL_IS_EMPTY';return _0x2a8612(msgResponse(_0xb53f('0x13d'),_0xb53f('0x13f'),_0xf30a0b+_0xb53f('0x141')));}if(_0x56a868&&_[_0xb53f('0x3b')](config[_0xb53f('0x142')][_0x56a868])){_0x2d05e8[_0xb53f('0x3c')]=_0xb53f('0x143');return _0x2a8612(msgResponse(_0xb53f('0x13d'),_0xb53f('0x13f'),_0xf30a0b+_0xb53f('0x144')+_0x56a868));}if(_[_0xb53f('0x145')](_0x4ac685)){for(var _0x1987ae=0x0;_0x1987ae<_0x4ac685[_0xb53f('0x94')];_0x1987ae+=0x1){_0x220648['push'](ami[_0xb53f('0x146')]({'action':_0xb53f('0x147'),'command':util[_0xb53f('0x77')](_0xb53f('0x148'),_0x4ac685[_0x1987ae]['interval'],!_[_0xb53f('0x3b')](config[_0xb53f('0x142')][_0x56a868])?_0x56a868:'')})['then'](function(_0x16ac1e){return _0x16ac1e[_0xb53f('0x149')][_0xb53f('0x14a')](_0xb53f('0x14b'))>=0x0;})['catch'](myreject(_0x2a8612)));}}else{_0x220648[_0xb53f('0x14c')](ami[_0xb53f('0x146')]({'action':_0xb53f('0x147'),'command':util['format'](_0xb53f('0x148'),_0x4ac685,!_[_0xb53f('0x3b')](config[_0xb53f('0x142')][_0x56a868])?_0x56a868:'')})[_0xb53f('0x3a')](function(_0x327574){return _0x327574[_0xb53f('0x149')][_0xb53f('0x14a')](_0xb53f('0x14b'))>=0x0;})[_0xb53f('0xb5')](myreject(_0x2a8612)));}BPromise[_0xb53f('0x14d')](_0x220648)['then'](function(_0xe4cc42){var _0x39df79=_[_0xb53f('0x14e')](_0xe4cc42);if(_0x39df79){return _0x8076ce(_0x39df79);}else{_0x2d05e8[_0xb53f('0x3c')]=_0x2ed41a?_0xb53f('0x14f'):_0xb53f('0x150');return _0x2a8612(msgResponse(_0xb53f('0x151'),_0xb53f('0x13f'),_0xb53f('0x152')+_0x2ed41a+'\x20'+_0xf30a0b+_0xb53f('0x153')+util[_0xb53f('0x93')](_0x4ac685,{'showHidden':![],'depth':null})+_0xb53f('0x154')+_0x56a868));}})[_0xb53f('0xb5')](function(_0x19d40b){return _0x2a8612(msgResponse('ifTime',_0xb53f('0x13f'),JSON[_0xb53f('0x76')](_0x19d40b)));});});};Dialer[_0xb53f('0x16')]['checkDialMethod']=function(_0x45c801){var _0x5eee36=this;return function(){switch(_0x45c801['dialMethod']){case _0xb53f('0x155'):freeVariablesPredictive(_0x45c801);_0x5eee36[_0xb53f('0x156')](_0x45c801,0x1);break;case _0xb53f('0x157'):freeVariablesPredictive(_0x45c801);_0x5eee36[_0xb53f('0x156')](_0x45c801,_0x45c801[_0xb53f('0x158')]);break;case _0xb53f('0x159'):_0x5eee36[_0xb53f('0x159')](_0x45c801);break;case _0xb53f('0x7'):freeVariablesPredictive(_0x45c801);_0x5eee36[_0xb53f('0x156')](_0x45c801,0x1);break;default:freeVariablesPredictive(_0x45c801);logger[_0xb53f('0x91')](_0xb53f('0x15a'),_0x45c801[_0xb53f('0x3f')],_0xb53f('0x15b'));}};};Dialer[_0xb53f('0x16')][_0xb53f('0x15c')]=function(_0x3304b5){return BPromise[_0xb53f('0xb4')]()[_0xb53f('0x3a')](cmHopper[_0xb53f('0x15d')](_0x3304b5['id'],previewRecallmeReminderInterval))[_0xb53f('0x3a')](function(_0x43e8b2){for(var _0x416df6=0x0;_0x416df6<_0x43e8b2[_0xb53f('0x94')];_0x416df6++){var _0x4f0dc6=_0x43e8b2[_0x416df6][_0xb53f('0x15e')]['name'];if(_0x4f0dc6)io['to'](util[_0xb53f('0x77')](_0xb53f('0x15f'),_0x4f0dc6))[_0xb53f('0x4a')](_0xb53f('0x160'),{'hopper':_0x43e8b2[_0x416df6]});}})[_0xb53f('0xb5')](function(_0x502bf0){});};Dialer[_0xb53f('0x16')][_0xb53f('0x161')]=function(_0x4e37cf){var _0xbc005e=this;return function(){_0xbc005e[_0xb53f('0x162')](_0x4e37cf);};};Dialer[_0xb53f('0x16')][_0xb53f('0x30')]=function(_0x29a04c){var _0x5ac9b4=this;if(isNotPreview(_0x29a04c[_0xb53f('0x57')])){if(isVoiceQueueOutbound(_0x29a04c[_0xb53f('0x4b')])&&isActive(_0x29a04c[_0xb53f('0x56')])){_0x29a04c[_0xb53f('0x9d')]=!![];BPromise[_0xb53f('0xb4')]()[_0xb53f('0x3a')](checkIsLoggedIn(_0x29a04c,_0x29a04c[_0xb53f('0x50')]))[_0xb53f('0x3a')](checkIsActive(_0x29a04c,_0x29a04c['dialActive']))['then'](checkInterval(_0x29a04c))['then'](_0x5ac9b4[_0xb53f('0x138')](_0x29a04c))['then'](_0x5ac9b4[_0xb53f('0x13c')](_0x29a04c[_0xb53f('0x163')],_0x29a04c[_0xb53f('0x164')],_0x29a04c[_0xb53f('0x3f')],_0x29a04c))[_0xb53f('0x3a')](_0x5ac9b4[_0xb53f('0x13e')](_0x29a04c[_0xb53f('0x41')],_0x29a04c[_0xb53f('0x164')],_0x29a04c[_0xb53f('0x3f')],_0x29a04c))['then'](_0x5ac9b4['checkDialMethod'](_0x29a04c))[_0xb53f('0xb5')](loggerCatchQueueSummary(_0xb53f('0x165'),_0x29a04c));}else{notSendMessagesQueue(_0x29a04c);}}else{freeVariablesPredictive(_0x29a04c);if(_0x29a04c[_0xb53f('0x166')]){_0x5ac9b4['checkPreviewRecallReminder'](_0x29a04c);}}};Dialer[_0xb53f('0x16')][_0xb53f('0x137')]=function(){var _0x2524f2=this;var _0x4e19b9;for(var _0x36b804 in this[_0xb53f('0x1a')]){if(typeof this[_0xb53f('0x1a')][_0x36b804]!==_0xb53f('0x95')){_0x4e19b9=this[_0xb53f('0x1a')][_0x36b804];if(isCampaignIvr(_0x4e19b9[_0xb53f('0x4b')])&&isActive(_0x4e19b9[_0xb53f('0xd4')])){_0x4e19b9[_0xb53f('0x9d')]=!![];BPromise[_0xb53f('0xb4')]()[_0xb53f('0x3a')](checkIsActive(_0x4e19b9,_0x4e19b9[_0xb53f('0xd4')]))[_0xb53f('0x3a')](checkInterval(_0x4e19b9))[_0xb53f('0x3a')](_0x2524f2['checkIsTrunkReachable'](_0x4e19b9))[_0xb53f('0x3a')](_0x2524f2[_0xb53f('0x13c')](_0x4e19b9[_0xb53f('0x163')],_0x4e19b9[_0xb53f('0x164')],_0x4e19b9['name'],_0x4e19b9))[_0xb53f('0x3a')](_0x2524f2['checkIfTimeIntervals'](_0x4e19b9[_0xb53f('0x41')],_0x4e19b9[_0xb53f('0x164')],_0x4e19b9[_0xb53f('0x3f')],_0x4e19b9))['then'](_0x2524f2[_0xb53f('0x161')](_0x4e19b9))['catch'](loggerCatchQueueSummary(_0xb53f('0x167'),_0x4e19b9));}else{notSendMessagesCampaign(_0x4e19b9);}}}};function getCallerIdRandom(_0x4b8c23,_0x4c4b0d){var _0x140109;var _0x23bd84;var _0x530ab6;if(_0x4c4b0d<=0x0){_0x4c4b0d=0x1;}_0x140109=new RegExp('\x5cw{0,'+_0x4c4b0d+'}$');_0x23bd84=Math[_0xb53f('0x168')](0xa,_0x4c4b0d-0x1);_0x530ab6=Math['pow'](0xa,_0x4c4b0d)-0x1;return util[_0xb53f('0x77')]('%s',_['replace'](_0x4b8c23,_0x140109,_[_0xb53f('0x169')](_0x23bd84,_0x530ab6)));}function extractCalleridName(_0x5b3070){var _0x38e665=_0x5b3070[_0xb53f('0x16a')](/"(.*?)"/);return _0x38e665?_0x38e665[0x1]:_0x5b3070;}function extractCalleridNumber(_0x3e78f2){var _0x357048=_0x3e78f2[_0xb53f('0x16a')](/<(.*?)>/);return _0x357048?_0x357048[0x1]:_0x3e78f2;}Dialer[_0xb53f('0x16')][_0xb53f('0x16b')]=function(_0x13518f,_0x2dc200){var _0xd59bfe=this;var _0x1826b5=uuid['v4']();this[_0xb53f('0x1f')][_0x1826b5]=new Action(_0x13518f,_0x2dc200,_0x1826b5);return new BPromise(function(_0x2eb5c6,_0x22fc62){if(_['isUndefined'](_0x13518f)&&typeof _0x13518f!==_0xb53f('0x16c')){return _0x22fc62(msgResponse(_0xb53f('0x16d'),_0xb53f('0x13f'),_0xb53f('0x16e')));}if(_[_0xb53f('0x3b')](_0x2dc200[_0xb53f('0x16f')][_0xb53f('0x170')])||_0x2dc200[_0xb53f('0x16f')][_0xb53f('0x170')]===null){return _0x22fc62(msgResponse(_0xb53f('0x16d'),_0xb53f('0x13f'),_0xb53f('0x171')));}var _0x3f14c5={'XMD-CALLERID':_0xd59bfe[_0xb53f('0x1f')][_0x1826b5][_0xb53f('0x172')](),'XMD-AGI':_0x13518f[_0xb53f('0x105')]?util[_0xb53f('0x77')](_0xb53f('0x173'),ipAgi,_0x13518f[_0xb53f('0x105')]):_0xb53f('0x174'),'XMD-AGIAFTER':_0x13518f[_0xb53f('0x10b')]?util['format'](_0xb53f('0x173'),ipAgi,_0x13518f[_0xb53f('0x10b')]):_0xb53f('0x174'),'XMD-QUEUE':_0x13518f[_0xb53f('0x4b')]===_0xb53f('0x4c')?util['format'](_0xb53f('0x175'),_0x13518f['name'],_0x13518f[_0xb53f('0x176')]||'',_0x13518f[_0xb53f('0x177')]?'c':'',_0x13518f['dialQueueTimeout']||0x3):_0xb53f('0x174'),'XMD-CONTACTID':_0x2dc200[_0xb53f('0x100')],'XMD-CDRTYPE':_0xb53f('0x178'),'CALLERID(all)':_0xd59bfe[_0xb53f('0x1f')][_0x1826b5]['getCaller'](),'XMD-AMD':_0x13518f[_0xb53f('0xdc')]?_0xb53f('0x179'):_0xb53f('0x174'),'XMD-DESTINATION':_0xb53f('0xdb')};if(_0x13518f[_0xb53f('0xdc')]){_0x3f14c5[_0xb53f('0x17a')]=_0x13518f['dialAMDInitialSilence']||0x9c4;_0x3f14c5['XMD-AMDGREETING']=_0x13518f[_0xb53f('0x17b')]||0x5dc;_0x3f14c5[_0xb53f('0x17c')]=_0x13518f[_0xb53f('0x17d')]||0x320;_0x3f14c5[_0xb53f('0x17e')]=_0x13518f[_0xb53f('0x17f')]||0x1388;_0x3f14c5[_0xb53f('0x180')]=_0x13518f['dialAMDMinWordLength']||0x64;_0x3f14c5['XMD-AMDBETWEENWORDSSILENCE']=_0x13518f[_0xb53f('0x181')]||0x32;_0x3f14c5['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x13518f['dialAMDMaximumNumberOfWords']||0x3;_0x3f14c5['XMD-AMDSILENCETHRESHOLD']=_0x13518f[_0xb53f('0x182')]||0x100;_0x3f14c5['XMD-AMDMAXIMUMWORDLENGTH']=_0x13518f[_0xb53f('0x183')]||0x1388;}if(_0x13518f[_0xb53f('0x4b')]===_0xb53f('0x4c')){_0x3f14c5[_0xb53f('0x184')]=_0x2dc200[_0xb53f('0xf9')];}else{_0x3f14c5['XMD-CAMPAIGNID']=_0x2dc200[_0xb53f('0xfa')];}for(var _0x1a8970 in _0x2dc200[_0xb53f('0x16f')]){if(typeof _0x2dc200[_0xb53f('0x16f')][_0x1a8970]!==_0xb53f('0x95')){if(isNotNull(_0x2dc200[_0xb53f('0x16f')][_0x1a8970])&&_0x1a8970!=='id'&&_0x1a8970!==_0xb53f('0x185')&&_0x1a8970!==_0xb53f('0x186')&&_0x1a8970!==_0xb53f('0x187')){_0x3f14c5[util[_0xb53f('0x77')]('%s%s',_0xb53f('0x188'),_[_0xb53f('0x189')](_0x1a8970))]=_0x2dc200[_0xb53f('0x16f')][_0x1a8970];}}}var _0x27c9b1=_0xd59bfe[_0xb53f('0x139')](_0x13518f[_0xb53f('0x74')])?getCallerId(_0x13518f[_0xb53f('0x74')][_0xb53f('0x75')],_0x13518f[_0xb53f('0x58')],_0x13518f[_0xb53f('0x18a')]>0x0?getCallerIdRandom(_0x13518f[_0xb53f('0x59')],_0x13518f['dialRandomLastDigitCallerIdNumber']):_0x13518f[_0xb53f('0x59')]):getCallerId(_[_0xb53f('0xad')](_0x13518f['TrunkBackup'])?_0x13518f[_0xb53f('0x74')]['callerid']:_0x13518f[_0xb53f('0x13a')][_0xb53f('0x75')],_0x13518f[_0xb53f('0x58')],_0x13518f['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x13518f['dialOriginateCallerIdNumber'],_0x13518f['dialRandomLastDigitCallerIdNumber']):_0x13518f[_0xb53f('0x59')]);if(_0x27c9b1){_0x3f14c5[_0xb53f('0x18b')]=_0xd59bfe[_0xb53f('0x1f')][_0x1826b5][_0xb53f('0x18c')]=extractCalleridName(_0x27c9b1);_0x3f14c5[_0xb53f('0x18d')]=_0xd59bfe[_0xb53f('0x1f')][_0x1826b5][_0xb53f('0x18e')]=extractCalleridNumber(_0x27c9b1);}return ami[_0xb53f('0x146')]({'actionid':_0x1826b5,'action':_0xb53f('0x16d'),'channel':_0xd59bfe['isTrunkReachable'](_0x13518f[_0xb53f('0x74')])?util[_0xb53f('0x77')](_0xb53f('0x18f'),_0x13518f['Trunk'][_0xb53f('0x3f')],isNotNull(_0x13518f[_0xb53f('0x190')])?_0x13518f[_0xb53f('0x190')][_0xb53f('0x191')]()||'':'',_0x13518f[_0xb53f('0x192')]>0x0?_0x2dc200[_0xb53f('0x16f')][_0xb53f('0x170')]['substring'](_0x13518f[_0xb53f('0x192')]):_0x2dc200[_0xb53f('0x16f')][_0xb53f('0x170')]):util['format'](_0xb53f('0x18f'),_[_0xb53f('0xad')](_0x13518f[_0xb53f('0x13a')])?_0x13518f[_0xb53f('0x74')][_0xb53f('0x3f')]:_0x13518f[_0xb53f('0x13a')][_0xb53f('0x3f')],isNotNull(_0x13518f[_0xb53f('0x190')])?_0x13518f['dialPrefix'][_0xb53f('0x191')]()||'':'',_0x13518f[_0xb53f('0x192')]>0x0?_0x2dc200[_0xb53f('0x16f')]['phone'][_0xb53f('0x193')](_0x13518f[_0xb53f('0x192')]):_0x2dc200['Contact'][_0xb53f('0x170')]),'callerid':_0x27c9b1,'Exten':'xcally-motion-dialer','Context':_0xb53f('0x194'),'Priority':'1','variable':_0x3f14c5,'timeout':(_0x13518f[_0xb53f('0x5a')]||0x1e)*0x3e8,'async':!![],'channelid':_0x1826b5})[_0xb53f('0x3a')](function(_0x5ea69e){return _0x2eb5c6(_0x5ea69e);})['catch'](function(_0xd9789f){_0x13518f[_0xb53f('0x195')]+=0x1;var _0x594b6d=new History(_0xd59bfe['actions'][_0x1826b5]);logger['error'](util[_0xb53f('0x77')](_0xb53f('0x196'),JSON[_0xb53f('0x76')](_0xd9789f)));_0x594b6d[_0xb53f('0xa4')]=0xe;_0x594b6d[_0xb53f('0xa5')]=_0xb53f('0x197');_0x594b6d['starttime']=moment()['format'](_0xb53f('0xf8'));_0x594b6d['endtime']=_0x594b6d[_0xb53f('0xa7')];_0xd59bfe[_0xb53f('0xc8')](_0x594b6d)[_0xb53f('0xb5')](loggerCatch(_0xb53f('0x198')));_0xd59bfe[_0xb53f('0xc6')](_0x594b6d)['catch'](loggerCatch(_0xb53f('0x198')))['finally'](function(){delete _0xd59bfe[_0xb53f('0x1f')][_0x1826b5];return _0x22fc62(msgResponse(_0xb53f('0x16d'),_0xb53f('0x47'),_0xb53f('0x199')));});});});};Dialer[_0xb53f('0x16')]['syncOriginateResponse']=function(_0x282f85){var _0x24ada1=this[_0xb53f('0x1f')][_0x282f85[_0xb53f('0x121')]];if(_0x24ada1){delete this[_0xb53f('0x1f')][_0x282f85[_0xb53f('0x121')]];_0x24ada1[_0xb53f('0x111')]=moment()[_0xb53f('0x77')]('YYYY-MM-DD\x20HH:mm:ss');var _0x3c5e08=_0x24ada1[_0xb53f('0x4b')]===_0xb53f('0x7a')?this[_0xb53f('0x1a')][_0x24ada1['queue']]:this[_0xb53f('0x19')][_0x24ada1[_0xb53f('0x19a')]()];if(!this[_0xb53f('0x19b')](_0x282f85[_0xb53f('0x19c')])){this[_0xb53f('0xb0')](_0x3c5e08);return this[_0xb53f('0x19d')](_0x24ada1,_0x3c5e08,_0x282f85)[_0xb53f('0xb5')](loggerCatch(_0xb53f('0x19e')));}this[_0xb53f('0x21')][_0x282f85[_0xb53f('0xd8')]]=_0x24ada1;}};Dialer[_0xb53f('0x16')][_0xb53f('0x19f')]=function(_0x8816bb,_0x1e5dc1,_0x4bcd6c){var _0x4219ea=new History(_0x1e5dc1);if(_0x4219ea['countbusyretry']+_0x4219ea[_0xb53f('0xeb')]+_0x4219ea[_0xb53f('0xec')]+_0x4219ea[_0xb53f('0xed')]+_0x4219ea[_0xb53f('0xee')]+_0x4219ea[_0xb53f('0xef')]+_0x4219ea['countmachineretry']+_0x4219ea['countagentrejectretry']>=_0x4bcd6c['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x8816bb){case 0x3:if(_0x4219ea['countnoanswerretry']>=_0x4bcd6c[_0xb53f('0x1a0')]-0x1){return!![];}this[_0xb53f('0xbd')]({'active':![],'countnoanswerretry':_0x4219ea['countnoanswerretry']+=0x1,'scheduledat':moment()[_0xb53f('0xf5')](_0x4bcd6c[_0xb53f('0x1a1')],_0xb53f('0xf7'))[_0xb53f('0x77')](_0xb53f('0xf8')),'ContactId':_0x4219ea['ContactId'],'ListId':_0x4219ea[_0xb53f('0xd0')],'VoiceQueueId':_0x4219ea[_0xb53f('0xf9')]||undefined,'CampaignId':_0x4219ea[_0xb53f('0xfa')]||undefined})[_0xb53f('0xb5')](loggerCatch(_0xb53f('0x1a2')));break;case 0x5:if(_0x4219ea['countbusyretry']>=_0x4bcd6c['dialBusyMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x4219ea[_0xb53f('0xea')]+=0x1,'scheduledat':moment()[_0xb53f('0xf5')](_0x4bcd6c[_0xb53f('0x1a3')],_0xb53f('0xf7'))[_0xb53f('0x77')](_0xb53f('0xf8')),'ContactId':_0x4219ea['ContactId'],'ListId':_0x4219ea[_0xb53f('0xd0')],'VoiceQueueId':_0x4219ea[_0xb53f('0xf9')]||undefined,'CampaignId':_0x4219ea[_0xb53f('0xfa')]||undefined})['catch'](loggerCatch(_0xb53f('0x1a4')));break;case 0x8:if(_0x4219ea[_0xb53f('0xeb')]>=_0x4bcd6c['dialCongestionMaxRetry']-0x1){return!![];}this[_0xb53f('0xbd')]({'active':![],'countcongestionretry':_0x4219ea[_0xb53f('0xeb')]+=0x1,'scheduledat':moment()[_0xb53f('0xf5')](_0x4bcd6c[_0xb53f('0x1a5')],_0xb53f('0xf7'))[_0xb53f('0x77')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4219ea[_0xb53f('0x100')],'ListId':_0x4219ea[_0xb53f('0xd0')],'VoiceQueueId':_0x4219ea[_0xb53f('0xf9')]||undefined,'CampaignId':_0x4219ea[_0xb53f('0xfa')]||undefined})[_0xb53f('0xb5')](loggerCatch(_0xb53f('0x1a6')));break;case 0x0:if(_0x4219ea[_0xb53f('0xed')]>=_0x4bcd6c[_0xb53f('0x1a7')]-0x1){return!![];}else{this[_0xb53f('0xbd')]({'active':![],'countnosuchnumberretry':_0x4219ea[_0xb53f('0xed')]+=0x1,'scheduledat':moment()['add'](_0x4bcd6c[_0xb53f('0x1a8')],_0xb53f('0xf7'))[_0xb53f('0x77')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4219ea['ContactId'],'ListId':_0x4219ea[_0xb53f('0xd0')],'VoiceQueueId':_0x4219ea[_0xb53f('0xf9')]||undefined,'CampaignId':_0x4219ea[_0xb53f('0xfa')]||undefined})[_0xb53f('0xb5')](loggerCatch(_0xb53f('0x1a9')));}break;case 0xa:if(_0x4219ea[_0xb53f('0xee')]>=_0x4bcd6c['dialDropMaxRetry']-0x1){return!![];}this[_0xb53f('0xbd')]({'active':![],'countdropretry':_0x4219ea[_0xb53f('0xee')]+=0x1,'scheduledat':moment()['add'](_0x4bcd6c['dialDropRetryFrequency'],_0xb53f('0xf7'))[_0xb53f('0x77')](_0xb53f('0xf8')),'ContactId':_0x4219ea[_0xb53f('0x100')],'ListId':_0x4219ea['ListId'],'VoiceQueueId':_0x4219ea['VoiceQueueId']||undefined,'CampaignId':_0x4219ea[_0xb53f('0xfa')]||undefined})['catch'](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x4219ea[_0xb53f('0xef')]>=_0x4bcd6c[_0xb53f('0x11d')]-0x1){return!![];}this[_0xb53f('0xbd')]({'active':![],'countabandonedretry':_0x4219ea[_0xb53f('0xef')]+=0x1,'scheduledat':moment()[_0xb53f('0xf5')](_0x4bcd6c[_0xb53f('0x1aa')],_0xb53f('0xf7'))[_0xb53f('0x77')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4219ea[_0xb53f('0x100')],'ListId':_0x4219ea[_0xb53f('0xd0')],'VoiceQueueId':_0x4219ea['VoiceQueueId']||undefined,'CampaignId':_0x4219ea['CampaignId']||undefined})[_0xb53f('0xb5')](loggerCatch(_0xb53f('0x11e')));break;case 0x13:if(_0x4219ea[_0xb53f('0xf0')]>=_0x4bcd6c[_0xb53f('0xf3')]-0x1){return!![];}this[_0xb53f('0xbd')]({'active':![],'countmachineretry':_0x4219ea[_0xb53f('0xf0')]+=0x1,'scheduledat':moment()[_0xb53f('0xf5')](_0x4bcd6c['dialMachineRetryFrequency'],_0xb53f('0xf7'))[_0xb53f('0x77')](_0xb53f('0xf8')),'ContactId':_0x4219ea[_0xb53f('0x100')],'ListId':_0x4219ea[_0xb53f('0xd0')],'VoiceQueueId':_0x4219ea[_0xb53f('0xf9')]||undefined,'CampaignId':_0x4219ea[_0xb53f('0xfa')]||undefined})[_0xb53f('0xb5')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x4219ea[_0xb53f('0xfd')]>=_0x4bcd6c[_0xb53f('0x1ab')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countagentrejectretry':_0x4219ea[_0xb53f('0xfd')]+=0x1,'scheduledat':moment()[_0xb53f('0xf5')](_0x4bcd6c['dialAgentRejectRetryFrequency'],'minutes')[_0xb53f('0x77')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4219ea[_0xb53f('0x100')],'ListId':_0x4219ea['ListId'],'VoiceQueueId':_0x4219ea[_0xb53f('0xf9')]||undefined,'CampaignId':_0x4219ea['CampaignId']||undefined})['catch'](loggerCatch(_0xb53f('0x1ac')));break;default:return!![];}};Dialer[_0xb53f('0x16')][_0xb53f('0x19d')]=function(_0x3cac75,_0x26892e,_0x21008e){var _0x57cdb9=this;var _0x1134de=new History(_0x3cac75);return new BPromise(function(_0x363c8c,_0x70de15){if(_['isUndefined'](_0x26892e)&&typeof _0x26892e!==_0xb53f('0x16c')){return _0x70de15(msgResponse(_0xb53f('0x1ad'),_0xb53f('0x13f'),_0xb53f('0x1ae')));}if(_[_0xb53f('0x3b')](_0x21008e)&&typeof _0x21008e!=='object'){return _0x70de15(msgResponse(_0xb53f('0x1ad'),_0xb53f('0x13f'),_0xb53f('0x1af')));}switch(_0x21008e[_0xb53f('0x108')]){case'0':_0x26892e[_0xb53f('0x62')]+=0x1;_0x1134de[_0xb53f('0xa4')]=0x0;_0x1134de['statedesc']=_0xb53f('0x1b0');_0x1134de[_0xb53f('0xed')]+=0x1;_0x1134de[_0xb53f('0xe7')]+=0x1;ami[_0xb53f('0x4a')](_0xb53f('0x1b1'),ut[_0xb53f('0xe1')](_0x3cac75,_0xb53f('0x1b2')));_0x57cdb9[_0xb53f('0xc8')](_0x1134de)[_0xb53f('0xb5')](loggerCatch(_0xb53f('0xe9')));if(_0x57cdb9[_0xb53f('0x19f')](0x0,_0x3cac75,_0x26892e)){if(_0x1134de['countnosuchnumberretry']>=_0x26892e[_0xb53f('0x1a7')]){_0x57cdb9[_0xb53f('0xff')](_0x1134de,_0x363c8c,_0x70de15,_0xb53f('0x1b3'));}else{_0x57cdb9[_0xb53f('0xf2')](_0x1134de,_0x363c8c,_0x70de15,_0xb53f('0x1b3'));}}break;case'3':_0x26892e[_0xb53f('0x1b4')]+=0x1;_0x1134de[_0xb53f('0xa4')]=0x3;_0x1134de[_0xb53f('0xa5')]='NoAnswer';_0x1134de[_0xb53f('0xec')]+=0x1;_0x1134de[_0xb53f('0xe7')]+=0x1;ami[_0xb53f('0x4a')](_0xb53f('0x1b5'),ut['buildObj'](_0x3cac75,_0xb53f('0x1b6')));_0x57cdb9[_0xb53f('0xc8')](_0x1134de)[_0xb53f('0xb5')](loggerCatch(_0xb53f('0x1b7')));if(_0x57cdb9[_0xb53f('0x19f')](0x3,_0x3cac75,_0x26892e)){if(_0x1134de[_0xb53f('0xec')]>=_0x26892e[_0xb53f('0x1a0')]){_0x57cdb9[_0xb53f('0xff')](_0x1134de,_0x363c8c,_0x70de15,'reason\x203\x20ringing\x20no\x20answer');}else{_0x57cdb9['stateGlobal'](_0x1134de,_0x363c8c,_0x70de15,_0xb53f('0x1b8'));}}break;case'5':_0x26892e[_0xb53f('0x5e')]+=0x1;_0x1134de[_0xb53f('0xa4')]=0x5;_0x1134de[_0xb53f('0xa5')]='Busy';_0x1134de[_0xb53f('0xea')]+=0x1;_0x1134de[_0xb53f('0xe7')]+=0x1;ami[_0xb53f('0x4a')](_0xb53f('0x1b9'),ut['buildObj'](_0x3cac75,_0xb53f('0x1ba')));_0x57cdb9[_0xb53f('0xc8')](_0x1134de)[_0xb53f('0xb5')](loggerCatch(_0xb53f('0x1bb')));if(_0x57cdb9[_0xb53f('0x19f')](0x5,_0x3cac75,_0x26892e)){if(_0x1134de[_0xb53f('0xea')]>=_0x26892e[_0xb53f('0x1bc')]){_0x57cdb9[_0xb53f('0xff')](_0x1134de,_0x363c8c,_0x70de15,_0xb53f('0x1bd'));}else{_0x57cdb9[_0xb53f('0xf2')](_0x1134de,_0x363c8c,_0x70de15,_0xb53f('0x1bd'));}}break;case'8':_0x26892e[_0xb53f('0x5f')]+=0x1;_0x1134de[_0xb53f('0xa4')]=0x8;_0x1134de[_0xb53f('0xa5')]=_0xb53f('0x1be');_0x1134de[_0xb53f('0xeb')]+=0x1;_0x1134de[_0xb53f('0xe7')]+=0x1;ami[_0xb53f('0x4a')](_0xb53f('0x1bf'),ut['buildObj'](_0x3cac75,_0xb53f('0x1c0')));_0x57cdb9[_0xb53f('0xc8')](_0x1134de)['catch'](loggerCatch(_0xb53f('0x1c1')));if(_0x57cdb9[_0xb53f('0x19f')](0x8,_0x3cac75,_0x26892e)){if(_0x1134de[_0xb53f('0xeb')]>=_0x26892e[_0xb53f('0x1c2')]){_0x57cdb9[_0xb53f('0xff')](_0x1134de,_0x363c8c,_0x70de15,'reason\x208\x20congestion');}else{_0x57cdb9['stateGlobal'](_0x1134de,_0x363c8c,_0x70de15,_0xb53f('0x1c3'));}}break;case'11':_0x26892e[_0xb53f('0x1c4')]+=0x1;_0x1134de[_0xb53f('0xa4')]=0xb;_0x1134de['statedesc']='Abandoned';_0x1134de[_0xb53f('0xef')]+=0x1;_0x1134de[_0xb53f('0xe7')]+=0x1;_0x57cdb9[_0xb53f('0xc8')](_0x1134de)[_0xb53f('0xb5')](loggerCatch(_0xb53f('0x11f')));if(_0x57cdb9[_0xb53f('0x19f')](0xb,_0x3cac75,_0x26892e)){if(_0x1134de[_0xb53f('0xef')]>=_0x26892e['dialAbandonedMaxRetry']){_0x57cdb9[_0xb53f('0xff')](_0x1134de,_0x363c8c,_0x70de15,'reason\x2011\x20abandoned');}else{_0x57cdb9[_0xb53f('0xf2')](_0x1134de,_0x363c8c,_0x70de15,_0xb53f('0x1c5'));}}break;case'20':_0x26892e['outboundRejectCallsDay']+=0x1;_0x1134de['state']=0x14;_0x1134de['statedesc']=_0xb53f('0x1c6');_0x1134de[_0xb53f('0xfd')]+=0x1;_0x1134de[_0xb53f('0xe7')]+=0x1;ami[_0xb53f('0x4a')]('custom:agentreject',ut[_0xb53f('0xe1')](_0x3cac75,_0xb53f('0x1c7')));_0x57cdb9[_0xb53f('0xc8')](_0x1134de)[_0xb53f('0xb5')](loggerCatch(_0xb53f('0x1c8')));if(_0x57cdb9[_0xb53f('0x19f')](0x14,_0x3cac75,_0x26892e)){if(_0x1134de[_0xb53f('0xfd')]>=_0x26892e['dialAgentRejectMaxRetry']){_0x57cdb9['createStateFinal'](_0x1134de,_0x363c8c,_0x70de15,_0xb53f('0x1c9'));}else{_0x57cdb9['stateGlobal'](_0x1134de,_0x363c8c,_0x70de15,_0xb53f('0x1c9'));}}break;default:_0x26892e[_0xb53f('0x64')]+=0x1;_0x1134de[_0xb53f('0xa4')]=0xc;_0x1134de[_0xb53f('0xa5')]=_0x21008e[_0xb53f('0x108')];_0x57cdb9[_0xb53f('0xc8')](_0x1134de)[_0xb53f('0xb5')](loggerCatch(_0xb53f('0x1ca')));if(_0x57cdb9[_0xb53f('0x19f')](_0x21008e[_0xb53f('0x108')],_0x3cac75,_0x26892e)){if(_0x1134de[_0xb53f('0xea')]+_0x1134de[_0xb53f('0xeb')]+_0x1134de['countnoanswerretry']+_0x1134de[_0xb53f('0xed')]+_0x1134de[_0xb53f('0xee')]+_0x1134de[_0xb53f('0xef')]+_0x1134de[_0xb53f('0xf0')]+_0x1134de[_0xb53f('0xfd')]>=_0x26892e[_0xb53f('0xf1')]){_0x57cdb9[_0xb53f('0xf2')](_0x1134de,_0x363c8c,_0x70de15,_0x21008e[_0xb53f('0x108')]);}else{_0x57cdb9[_0xb53f('0xff')](_0x1134de,_0x363c8c,_0x70de15,_0x21008e[_0xb53f('0x108')]);}}}});};Dialer[_0xb53f('0x16')][_0xb53f('0xf2')]=function(_0x43c868,_0x266ed1,_0x3df7e5,_0x15024f){var _0x2f918e=new Final(_0x43c868);_0x2f918e[_0xb53f('0xa4')]=0xf;_0x2f918e[_0xb53f('0xa5')]=_0xb53f('0x1cb');this[_0xb53f('0xff')](_0x2f918e,_0x266ed1,_0x3df7e5,_0x15024f);};Dialer[_0xb53f('0x16')][_0xb53f('0xff')]=function(_0x227a9f,_0x2c2a81,_0x47e88e,_0x51e8d9){this[_0xb53f('0xc6')](_0x227a9f)[_0xb53f('0x3a')](function(){return _0x2c2a81(msgResponse('[callProgressDetecting]',_0xb53f('0xd3'),_0x51e8d9));})['catch'](function(){return _0x47e88e(msgResponse(_0xb53f('0x1cc'),_0xb53f('0x13f'),_0xb53f('0x1cd')));});};Dialer[_0xb53f('0x16')]['predictive']=function(_0x1fc613){var _0x3d780e=_0x1fc613[_0xb53f('0x1ce')]/0x64;var _0x1f1b7a=_0x1fc613[_0xb53f('0x112')]/(_0x1fc613[_0xb53f('0x112')]+_0x1fc613[_0xb53f('0x5c')]);var _0x1678d0=Math[_0xb53f('0x1cf')](_0x1fc613[_0xb53f('0x6d')]*(_0x1fc613[_0xb53f('0x1d0')]/0x64));var _0x4ab618=Math['round'](_0x1fc613[_0xb53f('0x6d')]*(_0x1fc613[_0xb53f('0x1d1')]/0x64));var _0x3b4919=_0x1fc613[_0xb53f('0x4f')]+_0x1fc613[_0xb53f('0x52')];var _0x4f5c3=Math[_0xb53f('0x1d2')](_0x1fc613['erlangCalls']*_0x1fc613[_0xb53f('0x71')]*_0x1fc613[_0xb53f('0x1d3')]*_0x1fc613[_0xb53f('0x1d4')]);if(_[_0xb53f('0x3b')](_0x1fc613['startProgressive'])){if(!_[_0xb53f('0x3b')](_0x1fc613[_0xb53f('0x73')])){_0x1fc613[_0xb53f('0x73')]=undefined;loggerPredictive[_0xb53f('0x91')](_0xb53f('0x1d5'),_0xb53f('0x1d6'));}if(!_[_0xb53f('0x3b')](_0x1fc613[_0xb53f('0x8b')])){loggerPredictive['error'](_0xb53f('0x1d5'),_0xb53f('0x1d7'));clearInterval(_0x1fc613[_0xb53f('0x8b')]);_0x1fc613[_0xb53f('0x8b')]=undefined;}_0x1fc613[_0xb53f('0x23')]=moment()[_0xb53f('0x77')](_0xb53f('0xf8'));loggerPredictive[_0xb53f('0x7c')](_0x1fc613[_0xb53f('0x3f')],_0xb53f('0x1d8'),_0x1fc613[_0xb53f('0x23')]);this['handlePower'](_0x1fc613,0x1);}else if(ifInterval(_0x1fc613[_0xb53f('0x1d9')],_0x1fc613[_0xb53f('0x23')])){this[_0xb53f('0x156')](_0x1fc613,0x1);loggerPredictiveCalls[_0xb53f('0x7c')](_0xb53f('0x1da'),_0x1fc613[_0xb53f('0x23')],_0x1fc613[_0xb53f('0x3f')]);_0x1fc613['erlangCalls']=0x0;_0x1fc613[_0xb53f('0x6b')]=0x0;}else if(_0x3d780e<_0x1f1b7a&&_0x1fc613[_0xb53f('0x1db')]===_0xb53f('0x1dc')){freeVariablesPredictive(_0x1fc613);loggerPredictive[_0xb53f('0x7c')](_0xb53f('0x1dd'),'Dropped\x20calls\x20day',_0x1f1b7a,_0xb53f('0x23'),_0x1fc613[_0xb53f('0x3f')]);}else if(_0x4f5c3<_0x1fc613[_0xb53f('0x6b')]&&_0x1fc613['dialPredictiveOptimization']==='dropRate'){freeVariablesPredictive(_0x1fc613);loggerPredictive['info'](_0xb53f('0x1de'),_0xb53f('0x1df'),_0x4f5c3,_0xb53f('0x1e0'),_0x1fc613['predictiveIntervalErlangCallsDroppedCalls'],'startProgressive',_0x1fc613[_0xb53f('0x3f')]);}else if(!ifInterval(_0x1fc613[_0xb53f('0x1d9')],_0x1fc613['startProgressive'])&&_[_0xb53f('0x3b')](_0x1fc613[_0xb53f('0x73')])&&!_[_0xb53f('0x3b')](_0x1fc613['startProgressive'])){_0x1fc613[_0xb53f('0x73')]=moment()[_0xb53f('0x77')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xb53f('0x7c')](_0x1fc613[_0xb53f('0x3f')],'started\x20in\x20predictive\x20at',_0x1fc613[_0xb53f('0x73')]);this[_0xb53f('0xbb')](_0x1fc613[_0xb53f('0x1d9')])[_0xb53f('0x3a')](this[_0xb53f('0x1e1')](_0x1fc613))[_0xb53f('0x3a')](mergeDataErlangB(_0x1fc613))['then'](this['startMethodPredictive'](_0x1fc613))[_0xb53f('0xb5')](loggerCatchPredictive(_0xb53f('0x1e2'),_0x1fc613));}else if(!ifInterval(_0x1fc613[_0xb53f('0x1d9')],_0x1fc613[_0xb53f('0x73')])){_0x1fc613['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x1fc613[_0xb53f('0x73')]=moment()[_0xb53f('0x77')](_0xb53f('0xf8'));loggerPredictive[_0xb53f('0x7c')](_0x1fc613[_0xb53f('0x3f')],'recalculate\x20predictive\x20at',_0x1fc613[_0xb53f('0x73')]);clearInterval(_0x1fc613[_0xb53f('0x8b')]);_0x1fc613['handlePredictive']=undefined;this['averageHandleTime'](_0x1fc613[_0xb53f('0x1d9')])['then'](this['getDataPredictive'](_0x1fc613))[_0xb53f('0x3a')](mergeDataErlangB(_0x1fc613))['then'](this[_0xb53f('0x1e3')](_0x1fc613))['catch'](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x1fc613));}else if(_0x1fc613[_0xb53f('0x6d')]&&_0x3b4919<_0x1fc613[_0xb53f('0x6d')]-_0x4ab618){freeVariablesPredictive(_0x1fc613);loggerPredictive[_0xb53f('0x7c')](_0x1fc613[_0xb53f('0x3f')],_0xb53f('0x1e4'),_0x3b4919,')\x20are\x20less\x20than\x20threshold\x20(',_0x1fc613[_0xb53f('0x6d')],'-',_0x4ab618,'=',_0x1fc613[_0xb53f('0x6d')]-_0x4ab618,')');}else if(_0x1fc613[_0xb53f('0x6d')]&&_0x3b4919>_0x1fc613[_0xb53f('0x6d')]+_0x1678d0){freeVariablesPredictive(_0x1fc613);loggerPredictive[_0xb53f('0x7c')](_0x1fc613[_0xb53f('0x3f')],_0xb53f('0x1e4'),_0x3b4919,')\x20are\x20more\x20than\x20threshold\x20(',_0x1fc613[_0xb53f('0x6d')],'+',_0x1678d0,'=',_0x1fc613['predictiveIntervalAvailable']+_0x1678d0,')');}};Dialer['prototype'][_0xb53f('0x1e1')]=function(_0x5081a8){var _0x3c3058=this;return function(_0x38d057){return new BPromise(function(_0x20e928,_0xbe8c28){_[_0xb53f('0xce')](_0x5081a8,_0x38d057[0x0]);if(checkGetDataPredictive(_0x38d057[0x0])){var _0x318c8a=_0x5081a8[_0xb53f('0x6d')]=_0x5081a8[_0xb53f('0x52')]+_0x5081a8[_0xb53f('0x4f')];var _0x39c408=_0x5081a8[_0xb53f('0x1d9')]*0x3c;var _0x10de8e=_0x38d057[0x0]['predictiveIntervalAvgTalktime']+_0x38d057[0x0][_0xb53f('0x66')];var _0x3d12b8=(_0x38d057[0x0][_0xb53f('0x65')]+_0x38d057[0x0][_0xb53f('0x69')]+_0x38d057[0x0][_0xb53f('0x68')])/_0x38d057[0x0][_0xb53f('0x80')];_0x5081a8[_0xb53f('0x1d3')]=_0x3d12b8>0x0?_0x3d12b8:0x1;switch(_0x5081a8[_0xb53f('0x1db')]){case _0xb53f('0x1dc'):var _0x596f6e=_0x5081a8[_0xb53f('0x1ce')]/0x64;return _0x3c3058['abandonmentRate'](_0x318c8a,_0x39c408,_0x10de8e,_0x3d12b8,_0x596f6e)[_0xb53f('0x3a')](function(_0x1224c){return _0x20e928(_0x1224c);});case'agentBusyFactor':var _0x473b70=_0x5081a8[_0xb53f('0x1ce')]/0x64;return _0x3c3058[_0xb53f('0x1e5')](_0x318c8a,_0x39c408,_0x10de8e,_0x3d12b8,_0x473b70)[_0xb53f('0x3a')](function(_0x3404ac){return _0x20e928(_0x3404ac);});default:return _0xbe8c28(msgResponse('[getDataPredictive]',_0xb53f('0x13f'),_0xb53f('0x1e6')));}}else{return _0xbe8c28(msgResponse(_0xb53f('0x1e7'),'Failure',_0xb53f('0x1e8')));}});};};Dialer[_0xb53f('0x16')][_0xb53f('0x1e9')]=function(_0x301de6){var _0x3a40c5=this;return function(_0x339350){return new BPromise(function(_0x2288c2,_0xc77679){_[_0xb53f('0xce')](_0x301de6,_0x339350[0x0]);if(checkGetDataPredictive(_0x339350[0x0])){loggerPredictive[_0xb53f('0x7c')](JSON[_0xb53f('0x76')](_0x339350[0x0]));if(_0x301de6[_0xb53f('0x1db')]===_0xb53f('0x1dc')){return _0x3a40c5[_0xb53f('0xc4')](_0x301de6['id'])[_0xb53f('0x3a')](function(_0x14b4c6){var _0x4d465a=_0x301de6['loggedIn']-_0x14b4c6[0x0]['outboundQueuePauses'];var _0x4184d4=_0x301de6[_0xb53f('0x1d9')]*0x3c;var _0x13791c=_0x339350[0x0][_0xb53f('0x67')]+_0x339350[0x0]['predictiveIntervalAvgHoldtime'];var _0x58aa7c=(_0x339350[0x0]['predictiveIntervalAnsweredCalls']+_0x339350[0x0][_0xb53f('0x69')]+_0x339350[0x0][_0xb53f('0x68')])/_0x339350[0x0][_0xb53f('0x80')];var _0x360bab=_0x301de6[_0xb53f('0x1ce')]/0x64;_0x301de6[_0xb53f('0x6c')]=_0x14b4c6[0x0][_0xb53f('0x1ea')]||0x0;_0x301de6[_0xb53f('0x1d3')]=_0x58aa7c>0x0?_0x58aa7c:0x1;return _0x3a40c5[_0xb53f('0x1eb')](_0x4d465a,_0x4184d4,_0x13791c,_0x58aa7c,_0x360bab);})[_0xb53f('0x3a')](function(_0x4ee303){return _0x2288c2(_0x4ee303);})[_0xb53f('0xb5')](function(_0x2d3c40){return _0xc77679(msgResponse(_0xb53f('0x1ec'),_0xb53f('0x13f'),JSON[_0xb53f('0x76')](_0x2d3c40)));});}if(_0x301de6[_0xb53f('0x1db')]===_0xb53f('0x1ed')){return _0x3a40c5[_0xb53f('0xc4')](_0x301de6['id'])['then'](function(_0x1761ba){var _0x2bc143=_0x301de6[_0xb53f('0x50')]-_0x1761ba[0x0][_0xb53f('0x1ea')];var _0x80b1af=_0x301de6[_0xb53f('0x1d9')]*0x3c;var _0x36d939=_0x339350[0x0][_0xb53f('0x67')]+_0x339350[0x0][_0xb53f('0x66')];var _0xe20fbc=(_0x339350[0x0][_0xb53f('0x65')]+_0x339350[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x339350[0x0][_0xb53f('0x68')])/_0x339350[0x0]['predictiveIntervalTotalCalls'];var _0x534375=_0x301de6[_0xb53f('0x1ce')]/0x64;_0x301de6[_0xb53f('0x6c')]=_0x1761ba[0x0][_0xb53f('0x1ea')]||0x0;_0x301de6[_0xb53f('0x1d3')]=_0xe20fbc>0x0?_0xe20fbc:0x1;return _0x3a40c5[_0xb53f('0x1e5')](_0x2bc143,_0x80b1af,_0x36d939,_0xe20fbc,_0x534375);})[_0xb53f('0x3a')](function(_0x16bbbb){return _0x2288c2(_0x16bbbb);})[_0xb53f('0xb5')](function(_0x33e64d){return _0xc77679(msgResponse('[CatchErlangB]',_0xb53f('0x13f'),JSON['stringify'](_0x33e64d)));});}}else{return _0xc77679(msgResponse(_0xb53f('0x1e7'),_0xb53f('0x13f'),_0xb53f('0x1e8')));}});};};Dialer[_0xb53f('0x16')][_0xb53f('0x1e3')]=function(_0x3aa552){var _0x52902c=this;return function(){var _0x3c803b=0x0;var _0x587747=Math[_0xb53f('0x1d2')](_0x3aa552['erlangCallToSecond']*0x3e8);if(_0x587747>0x0){_0x587747=_0x587747<0x64?0x64:_0x587747;loggerPredictive[_0xb53f('0x7c')](_0x3aa552[_0xb53f('0x3f')],_0xb53f('0x1ee'),_0x587747,'milliseconds');_0x3aa552[_0xb53f('0x8b')]=setInterval(function(){_0x52902c['handlePredictive'](_0x3aa552);loggerPredictiveCalls['info'](_0xb53f('0x1ef'),_0x3c803b+=0x1);},_0x587747);}else{loggerPredictive[_0xb53f('0x7c')](_0x3aa552['name'],_0xb53f('0x1f0'));}};};Dialer[_0xb53f('0x16')][_0xb53f('0x1f1')]=function(_0x3b2d1e,_0x4731a6){var _0x477563=this;return function(_0x441ab8){if(_[_0xb53f('0x45')](_0x441ab8)){if(_[_0xb53f('0xad')](_0x4731a6['UserId'])||!_0x4731a6[_0xb53f('0x1f2')]){if(_0x3b2d1e['dialMethod']==='booked'){_0x3b2d1e[_0xb53f('0x127')]=_[_0xb53f('0x3b')](_0x3b2d1e[_0xb53f('0x127')])?!![]:_0x3b2d1e[_0xb53f('0x127')];var _0x1dec36=uuid['v4']();_0x477563['actions'][_0x1dec36]=new Action(_0x3b2d1e,_0x4731a6,_0x1dec36);loggerBooked[_0xb53f('0x7c')](_0xb53f('0x1f3'),_0x1dec36,_0xb53f('0x1f4'),JSON[_0xb53f('0x76')](_0x3b2d1e[_0xb53f('0x127')]),'Queue:\x20',_0x3b2d1e[_0xb53f('0x3f')]);if(_0x3b2d1e[_0xb53f('0x127')]){_0x3b2d1e[_0xb53f('0x127')]=![];_0x477563[_0xb53f('0x25')][_0x477563['actions'][_0x1dec36][_0xb53f('0xb2')]]=[];ami[_0xb53f('0x146')]({'actionid':_0x1dec36,'action':_0xb53f('0x1f5'),'queue':_0x3b2d1e['name']})[_0xb53f('0xb5')](function(){_0x477563['updateOriginated'](_0x3b2d1e);_0x477563[_0xb53f('0xbd')]({'active':![],'ContactId':_0x477563[_0xb53f('0x1f')][_0x1dec36][_0xb53f('0x100')],'ListId':_0x477563['actions'][_0x1dec36][_0xb53f('0xd0')],'VoiceQueueId':_0x477563['actions'][_0x1dec36][_0xb53f('0xf9')]||undefined,'CampaignId':_0x477563[_0xb53f('0x1f')][_0x1dec36][_0xb53f('0xfa')]||undefined})['catch'](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x477563[_0xb53f('0x1f')][_0x1dec36];});}else{loggerBooked[_0xb53f('0x7c')](_0xb53f('0x1f6'),JSON['stringify'](_0x3b2d1e[_0xb53f('0x127')]),'Queue:\x20',_0x3b2d1e[_0xb53f('0x3f')]);_0x477563[_0xb53f('0xb0')](_0x3b2d1e);_0x477563['rescheduleContact']({'active':![],'ContactId':_0x477563[_0xb53f('0x1f')][_0x1dec36][_0xb53f('0x100')],'ListId':_0x477563[_0xb53f('0x1f')][_0x1dec36][_0xb53f('0xd0')],'VoiceQueueId':_0x477563[_0xb53f('0x1f')][_0x1dec36][_0xb53f('0xf9')]||undefined,'CampaignId':_0x477563[_0xb53f('0x1f')][_0x1dec36][_0xb53f('0xfa')]||undefined})['catch'](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x477563[_0xb53f('0x1f')][_0x1dec36];}}else{return _0x477563[_0xb53f('0x16b')](_0x3b2d1e,_0x4731a6);}}else{if(getDiff(_0x4731a6[_0xb53f('0x1f7')])<_0x3b2d1e['dialRecallMeTimeout']*0x3c){if(_0x4731a6[_0xb53f('0x15e')]&&!_0x4731a6[_0xb53f('0x15e')][_0xb53f('0x1f8')]){_0x477563[_0xb53f('0x8d')]['run'](_0x4731a6['id'])[_0xb53f('0x18')](function(){_0x477563[_0xb53f('0xb0')](_0x3b2d1e);});}else{_0x477563[_0xb53f('0xbe')]({'active':![]},_0x4731a6['id'],0x1)[_0xb53f('0x18')](function(){_0x477563[_0xb53f('0xb0')](_0x3b2d1e);});}}else{_0x3b2d1e[_0xb53f('0x1f9')]+=0x1;_0x477563[_0xb53f('0xb0')](_0x3b2d1e);if(_0x3b2d1e[_0xb53f('0x1fa')]){_0x477563[_0xb53f('0xbd')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x4731a6[_0xb53f('0x100')],'ListId':_0x4731a6['ListId'],'VoiceQueueId':_0x4731a6[_0xb53f('0xf9')]||undefined,'CampaignId':_0x4731a6[_0xb53f('0xfa')]||undefined})['catch'](loggerCatch(_0xb53f('0x1fb')));_0x477563[_0xb53f('0xc8')](createObjHistory(_0x3b2d1e,_0x4731a6,_0xb53f('0x1fc'),0x17,_0xb53f('0x1fd')))['catch'](loggerCatch(_0xb53f('0x1fe')));}else{_0x477563[_0xb53f('0xcd')](createObjHistory(_0x3b2d1e,_0x4731a6,_0xb53f('0x1ff'),0x16,'RecallFailedTimeout'),'[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]');}}}}else{_0x3b2d1e[_0xb53f('0x5d')]+=0x1;_0x477563[_0xb53f('0xcd')](createObjHistory(_0x3b2d1e,_0x4731a6,_0xb53f('0x200'),0xd,_0xb53f('0x201')),_0xb53f('0x202'),_0xb53f('0x203'));throw _0xb53f('0x204');}};};Dialer[_0xb53f('0x16')][_0xb53f('0x162')]=function(_0x1df6f2){var _0x10d0bb=this;var _0x5d0fb8=_0x1df6f2[_0xb53f('0x205')]-_0x1df6f2[_0xb53f('0x6e')]-_0x1df6f2['temp'];emitCampaignSummary(_0x1df6f2);if(_0x5d0fb8>0x0){if(_0x5d0fb8>this[_0xb53f('0x1d')]){_0x5d0fb8=this[_0xb53f('0x1d')];}_0x1df6f2[_0xb53f('0xc1')]+=_0x5d0fb8;this[_0xb53f('0xc2')](_0x1df6f2['id'],_0x5d0fb8,_0x1df6f2[_0xb53f('0x206')],_0x1df6f2)[_0xb53f('0x3a')](function(_0x60500b){_0x1df6f2[_0xb53f('0xc1')]-=_0x5d0fb8;_0x1df6f2['temp']=_0x1df6f2[_0xb53f('0xc1')]>0x0?_0x1df6f2[_0xb53f('0xc1')]:0x0;if(!checkContactEmpty(_0x60500b)){_0x1df6f2[_0xb53f('0x3c')]=_0xb53f('0x9b');logger[_0xb53f('0x7c')](_0xb53f('0x207')+_0x1df6f2[_0xb53f('0x3f')]);}else{_0x1df6f2[_0xb53f('0x6e')]+=_0x60500b[_0xb53f('0x94')];_0x1df6f2[_0xb53f('0x3c')]='RUNNING';for(var _0x50e033=0x0;_0x50e033<_0x60500b[_0xb53f('0x94')];_0x50e033+=0x1){_0x1df6f2['ivrTotalCallsDays']+=0x1;if(_[_0xb53f('0xad')](_0x60500b[_0x50e033])||_[_0xb53f('0xad')](_0x60500b[_0x50e033][_0xb53f('0x16f')])||_['isNil'](_0x60500b[_0x50e033][_0xb53f('0x16f')][_0xb53f('0x170')])){_0x10d0bb[_0xb53f('0xcb')]('[actionOriginate]\x20',_0x1df6f2,_0x60500b[_0x50e033]);}else{_0x10d0bb[_0xb53f('0xb9')](_[_0xb53f('0xcf')](_0x60500b[_0x50e033],[_0xb53f('0xfa'),'Contact.phone']))[_0xb53f('0x3a')](_0x10d0bb[_0xb53f('0x1f1')](_0x1df6f2,_0x60500b[_0x50e033]))[_0xb53f('0xb5')](_0x10d0bb[_0xb53f('0xca')](_0xb53f('0x208'),_0x1df6f2));}}}})[_0xb53f('0xb5')](loggerGetContactDialer(_0xb53f('0x209'),_0x1df6f2,_0x5d0fb8));}};Dialer[_0xb53f('0x16')][_0xb53f('0x156')]=function(_0x21dfb5,_0x46ce01){var _0x4e3137=this;var _0x1ed602=[];var _0x332f58=_0x46ce01>=0x1?_0x46ce01:0x1;if(_0x21dfb5[_0xb53f('0x57')]===_0xb53f('0x7')){_0x332f58=0x1;}var _0x4936be=Math[_0xb53f('0x1d2')](_0x21dfb5['available']*_0x332f58)-_0x21dfb5[_0xb53f('0x6e')]-_0x21dfb5[_0xb53f('0xc1')];emitVoiceQueueSummary(_0x21dfb5);if(_0x21dfb5[_0xb53f('0x20a')]>0x0){var _0x428d99=_0x21dfb5[_0xb53f('0x20a')]-_0x21dfb5['originated']-_0x21dfb5[_0xb53f('0x52')]-_0x21dfb5[_0xb53f('0xc1')]-_0x21dfb5[_0xb53f('0x9e')];if(_0x4936be>_0x428d99){_0x4936be=_0x428d99;}}if(_0x4936be>0x0){if(_0x21dfb5[_0xb53f('0x57')]===_0xb53f('0x7')){_0x4936be=0x1;}if(_0x4936be>this['maxNumberOriginate']){_0x4936be=this[_0xb53f('0x1d')];}_0x21dfb5[_0xb53f('0xc1')]+=_0x4936be;for(var _0x30c64e in this[_0xb53f('0x1b')]){if(typeof this[_0xb53f('0x1b')][_0x30c64e]!==_0xb53f('0x95')){if(this[_0xb53f('0x1b')][_0x30c64e][_0xb53f('0xa4')]==='not_inuse'&&this[_0xb53f('0x1b')][_0x30c64e][_0xb53f('0xae')]==='reachable'){_0x1ed602[_0xb53f('0x14c')](this[_0xb53f('0x1b')][_0x30c64e]['id']);}}}this[_0xb53f('0xc0')](_0x21dfb5['id'],_0x1ed602,_0x4936be,_0x21dfb5[_0xb53f('0x206')],_0x21dfb5)['then'](function(_0x117e33){_0x21dfb5[_0xb53f('0xc1')]-=_0x4936be;_0x21dfb5[_0xb53f('0xc1')]=_0x21dfb5[_0xb53f('0xc1')]>0x0?_0x21dfb5[_0xb53f('0xc1')]:0x0;if(!checkContactEmpty(_0x117e33)){_0x4e3137['countReScheduled'](_0x21dfb5)['then'](sendMessageReschedule(_0x21dfb5))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x21dfb5['originated']+=_0x117e33[_0xb53f('0x94')];_0x21dfb5[_0xb53f('0x3c')]=_0x21dfb5['dialMethod']===_0xb53f('0x7')?_0xb53f('0x179'):_0xb53f('0x20b');for(var _0x214cf6=0x0;_0x214cf6<_0x117e33[_0xb53f('0x94')];_0x214cf6+=0x1){if(_['isNil'](_0x117e33[_0x214cf6])||_[_0xb53f('0xad')](_0x117e33[_0x214cf6][_0xb53f('0x16f')])||_[_0xb53f('0xad')](_0x117e33[_0x214cf6][_0xb53f('0x16f')][_0xb53f('0x170')])){_0x4e3137[_0xb53f('0xcb')](_0xb53f('0x20c'),_0x21dfb5,_0x117e33[_0x214cf6]);}else{_0x4e3137[_0xb53f('0xb7')](_['pick'](_0x117e33[_0x214cf6],[_0xb53f('0xf9'),_0xb53f('0x20d')]))[_0xb53f('0x3a')](_0x4e3137[_0xb53f('0x1f1')](_0x21dfb5,_0x117e33[_0x214cf6]))[_0xb53f('0xb5')](_0x4e3137[_0xb53f('0xca')](_0xb53f('0x20c'),_0x21dfb5));}}}})[_0xb53f('0xb5')](loggerGetContactDialer(_0xb53f('0x20e'),_0x21dfb5,_0x4936be));}};Dialer[_0xb53f('0x16')]['handlePredictive']=function(_0x5402cd){if(_0x5402cd[_0xb53f('0x20a')]>0x0){var _0x4a6876=_0x5402cd[_0xb53f('0x20a')]-_0x5402cd['originated']-_0x5402cd[_0xb53f('0x52')];if(_0x4a6876>0x0){this[_0xb53f('0x20f')](_0x5402cd);}else{loggerPredictiveCalls['info'](_0xb53f('0x210'));}}else{this[_0xb53f('0x20f')](_0x5402cd);}};Dialer[_0xb53f('0x16')][_0xb53f('0x20f')]=function(_0x2c903f){var _0x1a943c=this;var _0x322f36=[];_0x2c903f[_0xb53f('0x6e')]+=0x1;for(var _0xbe9515 in this[_0xb53f('0x1b')]){if(typeof this[_0xb53f('0x1b')][_0xbe9515]!=='undefined'){if(this[_0xb53f('0x1b')][_0xbe9515][_0xb53f('0xa4')]===_0xb53f('0x211')&&this['agents'][_0xbe9515][_0xb53f('0xae')]==='reachable'){_0x322f36['push'](this[_0xb53f('0x1b')][_0xbe9515]['id']);}}}this['getContactDialer'](_0x2c903f['id'],_0x322f36,0x1,_0x2c903f['dialOrderByScheduledAt'],_0x2c903f)['then'](function(_0x1b8a56){if(!checkContactEmpty(_0x1b8a56)){checkContactLowerLimitOriginate(_0x2c903f,0x1,0x0);_0x1a943c[_0xb53f('0x212')](_0x2c903f)[_0xb53f('0x3a')](sendMessageReschedule(_0x2c903f))['catch'](loggerCatch(_0xb53f('0xb6')));}else{_0x2c903f[_0xb53f('0x3c')]=_0xb53f('0x20b');if(_[_0xb53f('0xad')](_0x1b8a56[0x0])||_[_0xb53f('0xad')](_0x1b8a56[0x0][_0xb53f('0x16f')])||_[_0xb53f('0xad')](_0x1b8a56[0x0][_0xb53f('0x16f')][_0xb53f('0x170')])){_0x1a943c[_0xb53f('0xcb')](_0xb53f('0x20c'),_0x2c903f,_0x1b8a56[0x0]);}else{_0x1a943c[_0xb53f('0xb7')](_[_0xb53f('0xcf')](_0x1b8a56[0x0],[_0xb53f('0xf9'),_0xb53f('0x20d')]))[_0xb53f('0x3a')](_0x1a943c['checkContactBlack'](_0x2c903f,_0x1b8a56[0x0]))[_0xb53f('0xb5')](_0x1a943c[_0xb53f('0xca')]('[actionOriginatePredictive]\x20',_0x2c903f));}}})[_0xb53f('0xb5')](loggerGetContactDialer(_0xb53f('0x213'),_0x2c903f,0x1));emitVoiceQueueSummary(_0x2c903f);};Dialer['prototype'][_0xb53f('0x1eb')]=function(_0x59c7f0,_0x17165f,_0x445f9f,_0x1185cf,_0x1b668f,_0x21bcda){loggerPredictive['info'](_0xb53f('0x214'));loggerPredictive[_0xb53f('0x7c')](_0xb53f('0x215'),_0x59c7f0);loggerPredictive['info'](_0xb53f('0x216'),_0x17165f);loggerPredictive['info'](_0xb53f('0x217'),_0x445f9f);loggerPredictive['info'](_0xb53f('0x218'),_0x1185cf);loggerPredictive['info'](_0xb53f('0x219'),_0x1b668f);loggerPredictive[_0xb53f('0x7c')](_0xb53f('0x89'));return new BPromise(function(_0x48056b,_0x3a9621){if(_0x59c7f0<=0x0||isNaN(_0x59c7f0)){return _0x3a9621(msgResponse(_0xb53f('0x21a'),_0xb53f('0x47'),_0xb53f('0x21b')+_0x59c7f0));}if(_0x445f9f<=0x0||isNaN(_0x445f9f)){return _0x3a9621(msgResponse(_0xb53f('0x21a'),'Error',_0xb53f('0x21c')+_0x445f9f));}if(_0x1185cf<=0x0||isNaN(_0x1185cf)){return _0x3a9621(msgResponse(_0xb53f('0x21a'),_0xb53f('0x47'),_0xb53f('0x21d')+_0x1185cf));}if(_0x17165f<=0x0||isNaN(_0x17165f)){return _0x3a9621(msgResponse('[abandonmentRate]',_0xb53f('0x47'),_0xb53f('0x21e')+_0x17165f));}if(_0x1b668f<=0x0||isNaN(_0x1b668f)){return _0x3a9621(msgResponse(_0xb53f('0x21a'),_0xb53f('0x47'),'Amax\x20=\x20'+_0x1b668f));}_0x21bcda=_0x21bcda||0x0;var _0x2cb07f=0x1/_0x445f9f;var _0x5ac0ab=0x0;var _0x647dd8=0x0;var _0x36ac8f=0x0;var _0x24e20b=0x0;for(var _0x22c624=0x0;_0x36ac8f<_0x1b668f;_0x22c624+=0x1){_0x647dd8=_0x22c624/_0x17165f;_0x5ac0ab=(_0x1185cf*_0x647dd8+_0x21bcda)/_0x2cb07f;_0x36ac8f=erlangb(_0x5ac0ab,_0x59c7f0);_0x24e20b=_0x5ac0ab/_0x59c7f0*(0x1-erlangb(_0x5ac0ab,_0x59c7f0));}return _0x48056b({'erlangCalls':_0x22c624,'erlangCallToSecond':_0x17165f/_0x22c624,'erlangAbandonmentRate':_0x36ac8f,'erlangBusyFactor':_0x24e20b});});};Dialer['prototype'][_0xb53f('0x1e5')]=function(_0x4433d1,_0x45945d,_0x1029db,_0x9c3787,_0x1068a9,_0x2a192b){loggerPredictive[_0xb53f('0x7c')](_0xb53f('0x21f'));loggerPredictive[_0xb53f('0x7c')](_0xb53f('0x215'),_0x4433d1);loggerPredictive['info'](_0xb53f('0x216'),_0x45945d);loggerPredictive['info']('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',_0x1029db);loggerPredictive[_0xb53f('0x7c')](_0xb53f('0x218'),_0x9c3787);loggerPredictive[_0xb53f('0x7c')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1068a9);loggerPredictive[_0xb53f('0x7c')](_0xb53f('0x89'));return new BPromise(function(_0xc56e29,_0x2bb568){if(_0x4433d1<=0x0||isNaN(_0x4433d1)){return _0x2bb568(msgResponse(_0xb53f('0x220'),_0xb53f('0x47'),_0xb53f('0x21b')+_0x4433d1));}if(_0x1029db<=0x0||isNaN(_0x1029db)){return _0x2bb568(msgResponse('[busyFactor]','Error',_0xb53f('0x21c')+_0x1029db));}if(_0x9c3787<=0x0||isNaN(_0x9c3787)){return _0x2bb568(msgResponse(_0xb53f('0x220'),'Error',_0xb53f('0x21d')+_0x9c3787));}if(_0x45945d<=0x0||isNaN(_0x45945d)){return _0x2bb568(msgResponse(_0xb53f('0x220'),_0xb53f('0x47'),_0xb53f('0x21e')+_0x45945d));}if(_0x1068a9<=0x0||isNaN(_0x1068a9)){return _0x2bb568(msgResponse(_0xb53f('0x220'),_0xb53f('0x47'),_0xb53f('0x221')+_0x1068a9));}_0x2a192b=_0x2a192b||0x0;var _0x50420e=0x1/_0x1029db;var _0x34eb09=0x0;var _0x2b22db=0x0;var _0x1d9298=0x0;var _0x45f419=0x0;for(var _0x35086e=0x0;_0x45f419<_0x1068a9;_0x35086e+=0x1){_0x2b22db=_0x35086e/_0x45945d;_0x34eb09=(_0x9c3787*_0x2b22db+_0x2a192b)/_0x50420e;_0x1d9298=erlangb(_0x34eb09,_0x4433d1);_0x45f419=_0x34eb09/_0x4433d1*(0x1-erlangb(_0x34eb09,_0x4433d1));}return _0xc56e29({'erlangCalls':_0x35086e,'erlangCallToSecond':_0x45945d/_0x35086e,'erlangAbandonmentRate':_0x1d9298,'erlangBusyFactor':_0x45f419});});};module[_0xb53f('0x222')]=Dialer;