Built motion from commit (unavailable).|2.6.0
[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 _0x84a0=['[syncAgentComplete][createHistory][5]','dialBusyMaxRetry','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','custom:agentreject','agentreject','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[callProgressDetecting]','Success','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','averageHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(','predictiveIntervalDroppedCallsTimeout','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','abandonmentRate','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','UserId','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','Agent','voicePause','dialRecallInQueue','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','length','[actionOriginate]\x20','Contact.phone','checkContactBlack','[getContactCampaign2]','dialLimitQueue','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','not_inuse','[actionOriginatePredictive]\x20','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','p\x20=\x20','interval\x20=\x20','Umin\x20=\x20','exports','util','lodash','bluebird','uuid','md5','ioredis','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperFinal','../rpc/cmHopperAdditionalPhone','./action','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','rrmemory','prototype','enqueue','tail','finally','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','hangup','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','\x20INTERVAL_IS_NULL','Intervals','isEmpty','INTERVAL_IS_NULL','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','emit','type','outbound','strategy','answered','available','loggedIn','pTalking','sumDuration','sumHoldTime','talking','total','unmanaged','waiting','loggedInDb','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCallToSecond','erlangBusyFactor','startPredictive','Trunk','active','callerid','format','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','clearing\x20variable\x20start\x20predictive','handlePredictive','preview','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','inspect','error','undefined','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','clearZombieChannels','[uniqueid]','isNil','Action','status','channel','No\x20such\x20channel','queue','[Dialer][checkChannel]','updateOriginated','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','[countReScheduled]\x20','checkIsBlackList','catch','[checkIsBlackList]\x20','verifyAdditionalPhones','swapAdditionalPhones','[swapAdditionalPhone]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','pick','ContactId','ListId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isTrunkReachable','SIP/%s','reachable','saveInDb','syncVarSet','uniqueid','variable','dialAMDActive','value','HANGUP','outboundAnswerCallsDay','HangupInAMD','AMD','custom:amd','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','membername','countmachineretry','countglobal','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','minutes','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','buildObj','dialGlobalMaxRetry','VoiceQueueId','syncHangup','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','dialQueueProject','AnswerAGI','[syncHangupIvr]','cause-txt','Unknow','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','syncAgentConnect','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','dropreason','TIMEOUT','dialDropRetryFrequency','callAdditionalPhoneAfterMin','voiceQueue','additional','dialDropMaxRetry','[rescheduleContact][Drop]','Drop','starttime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','[syncAgentComplete][createHistory][11]','syncNewExten','locked','stateinterface','actionid','push','idHopper','paused','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','indexOf','true','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','power','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','dialActive','dialGlobalInterval','dialTimezone','[syncQueueSummary]','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','NONE','\x22agi://%s/square,%s\x22','\x22%s,%s%s,,,%s\x22','dialQueueOptions','getCaller','ACTIVE','xcally-motion-dialer','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','createdAt','updatedAt','%s%s','toUpper','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','trim','substring','dialCutDigit','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Abandoned]','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','entity\x20is\x20undefine','evt\x20is\x20undefine','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy'];(function(_0xf9c18,_0x1d3074){var _0x5f4364=function(_0x2c1d6d){while(--_0x2c1d6d){_0xf9c18['push'](_0xf9c18['shift']());}};_0x5f4364(++_0x1d3074);}(_0x84a0,0x66));var _0x084a=function(_0x43600e,_0x37ec91){_0x43600e=_0x43600e-0x0;var _0x31f1a3=_0x84a0[_0x43600e];return _0x31f1a3;};'use strict';var util=require(_0x084a('0x0'));var _=require(_0x084a('0x1'));var BPromise=require(_0x084a('0x2'));var uuid=require(_0x084a('0x3'));var moment=require('moment');var rr=require('rr');var md5=require(_0x084a('0x4'));var Redis=require(_0x084a('0x5'));var ut=require('../preview/util/util');var config=require('../../../config/environment/');var logger=require(_0x084a('0x6'))(_0x084a('0x7'));var loggerBooked=require('../../../config/logger')(_0x084a('0x8'));var loggerPredictive=require(_0x084a('0x6'))(_0x084a('0x9'));var loggerPredictiveCalls=require(_0x084a('0x6'))(_0x084a('0xa'));var loggerSyncQueueSummary=require('../../../config/logger')(_0x084a('0xb'));var ami=require(_0x084a('0xc'));config[_0x084a('0xd')]=_[_0x084a('0xe')](config[_0x084a('0xd')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x084a('0xd')]));var cmHopper=require(_0x084a('0xf'));var cmHopperHistory=require(_0x084a('0x10'));var cmHopperFinal=require(_0x084a('0x11'));var cmHopperAdditionalPhone=require(_0x084a('0x12'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require(_0x084a('0x13'));var History=require(_0x084a('0x14'));var Final=require(_0x084a('0x15'));var AgentComplete=require(_0x084a('0x16'));var QueueCallerAbandon=require(_0x084a('0x17'));var Hangup=require(_0x084a('0x18'));var ipAgi=process[_0x084a('0x19')][_0x084a('0x1a')]||'127.0.0.1';var strategy={'rrmemory':_0x084a('0x1b'),'roundrobin':'roundrobin'};var Sequence=function(){};Sequence[_0x084a('0x1c')][_0x084a('0x1d')]=function(_0x366624){this[_0x084a('0x1e')]=this[_0x084a('0x1e')]?this['tail'][_0x084a('0x1f')](_0x366624):_0x366624();};function Dialer(_0x4abd81,_0x6799af){this[_0x084a('0x20')]=new Sequence();this['preview']=_0x6799af;this[_0x084a('0x21')]=_0x4abd81[_0x084a('0x21')];this[_0x084a('0x22')]=_0x4abd81[_0x084a('0x22')];this[_0x084a('0x23')]=_0x4abd81[_0x084a('0x23')];this[_0x084a('0x24')]=_0x4abd81[_0x084a('0x24')];this[_0x084a('0x25')]=config[_0x084a('0x25')]||0x2;this[_0x084a('0x26')]={};this[_0x084a('0x27')]={};this[_0x084a('0x28')]={};this[_0x084a('0x29')]={};this[_0x084a('0x2a')]={};this['startPredictive']={};this[_0x084a('0x2b')]={};this[_0x084a('0x2c')]={};this[_0x084a('0x2d')]={};this[_0x084a('0x2e')]={};ami['on'](_0x084a('0x2f'),this['syncAgentConnect'][_0x084a('0x30')](this));ami['on'](_0x084a('0x31'),this[_0x084a('0x32')][_0x084a('0x30')](this));ami['on'](_0x084a('0x33'),this[_0x084a('0x34')]['bind'](this));ami['on'](_0x084a('0x35'),this[_0x084a('0x36')][_0x084a('0x30')](this));ami['on']('custom:queuesummary',this[_0x084a('0xb')][_0x084a('0x30')](this));ami['on'](_0x084a('0x37'),this['syncHangup']['bind'](this));ami['on']('newexten',this['syncNewExten'][_0x084a('0x30')](this));ami['on']('varset',this['syncVarSet']['bind'](this));ami['on'](_0x084a('0x38'),this[_0x084a('0x39')][_0x084a('0x30')](this));ami['on'](_0x084a('0x3a'),this[_0x084a('0x3b')][_0x084a('0x30')](this));this[_0x084a('0x3c')]();this[_0x084a('0x3d')]();}function isNotNull(_0x5e6ea8){return _0x5e6ea8!==null&&!_[_0x084a('0x3e')](_0x5e6ea8);}function checkIsLoggedIn(_0x3b2b38,_0x501a16){return function(){if(_0x501a16<=0x0){_0x3b2b38[_0x084a('0x3f')]=_0x084a('0x40');throw _0x3b2b38[_0x084a('0x41')]+_0x084a('0x42');}};}function isActive(_0x448ae9){return _0x448ae9;}function checkIsActive(_0x202602,_0x3a99fe){return function(){if(!isActive(_0x3a99fe)){_0x202602[_0x084a('0x3f')]=_0x084a('0x43');throw _0x202602[_0x084a('0x41')]+_0x084a('0x44');}};}function checkInterval(_0x31bb9e){return function(){if(!isNotNull(_0x31bb9e[_0x084a('0x45')])){_0x31bb9e['message']='INTERVAL_IS_NULL';throw _0x31bb9e[_0x084a('0x41')]+_0x084a('0x46');}if(!isNotNull(_0x31bb9e[_0x084a('0x45')][_0x084a('0x47')])){_0x31bb9e[_0x084a('0x3f')]='INTERVAL_IS_NULL';throw _0x31bb9e[_0x084a('0x41')]+_0x084a('0x46');}if(!isNotNull(_[_0x084a('0x48')](_0x31bb9e['Interval'][_0x084a('0x47')]))){_0x31bb9e[_0x084a('0x3f')]=_0x084a('0x49');throw _0x31bb9e['name']+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x49af13,_0xf97d1b,_0x2e1806){return{'action':_0x49af13,'response':_0xf97d1b,'message':_0x2e1806,'stack':_0x2e1806};}function myreject(_0x1444ed){return function(_0x4e594f){return _0x1444ed(msgResponse(_0x084a('0x4a'),_0x084a('0x4b'),JSON[_0x084a('0x4c')](_0x4e594f)));};}function getSeconds(_0x28b199,_0x28a0a5){var _0x25f44e=moment(_0x28b199)[_0x084a('0x4d')](0x0);var _0x19354f=moment(_0x28a0a5)[_0x084a('0x4d')](0x0);return _0x25f44e[_0x084a('0x4e')](_0x19354f,_0x084a('0x4f'));}function emit(_0x1454a9,_0x284cdc,_0x1659d3){io['to'](_0x1454a9)[_0x084a('0x50')](_0x284cdc,_0x1659d3);}function emitVoiceQueueSummary(_0x597d87){if(_0x597d87[_0x084a('0x51')]===_0x084a('0x52')){var _0x1a0e56={'id':_0x597d87['id'],'name':_0x597d87[_0x084a('0x41')],'strategy':_0x597d87[_0x084a('0x53')],'answered':_0x597d87[_0x084a('0x54')],'available':_0x597d87[_0x084a('0x55')],'loggedIn':_0x597d87[_0x084a('0x56')],'pTalking':_0x597d87[_0x084a('0x57')],'sumBillable':_0x597d87['sumBillable'],'sumDuration':_0x597d87[_0x084a('0x58')],'sumHoldTime':_0x597d87[_0x084a('0x59')]||0x0,'talking':_0x597d87[_0x084a('0x5a')],'total':_0x597d87[_0x084a('0x5b')],'type':_0x597d87[_0x084a('0x51')],'unmanaged':_0x597d87[_0x084a('0x5c')],'abandoned':_0x597d87['abandoned'],'waiting':_0x597d87[_0x084a('0x5d')],'loggedInDb':_0x597d87[_0x084a('0x5e')],'dialActive':_0x597d87['dialActive'],'dialMethod':_0x597d87[_0x084a('0x5f')],'dialOriginateCallerIdName':_0x597d87[_0x084a('0x60')],'dialOriginateCallerIdNumber':_0x597d87[_0x084a('0x61')],'dialOriginateTimeout':_0x597d87['dialOriginateTimeout'],'dialPrefix':_0x597d87[_0x084a('0x62')],'outboundAnswerAgiCallsDay':_0x597d87[_0x084a('0x63')],'outboundAnswerCallsDay':_0x597d87['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x597d87[_0x084a('0x64')],'outboundBusyCallsDay':_0x597d87[_0x084a('0x65')],'outboundCongestionCallsDay':_0x597d87['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x597d87['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x597d87[_0x084a('0x66')],'outboundDropCallsDayTimeout':_0x597d87[_0x084a('0x67')],'outboundNoAnswerCallsDay':_0x597d87[_0x084a('0x68')],'outboundNoSuchCallsDay':_0x597d87[_0x084a('0x69')],'outboundOriginateFailureCallsDay':_0x597d87[_0x084a('0x6a')],'outboundReCallsDay':_0x597d87[_0x084a('0x6b')],'outboundRejectCallsDay':_0x597d87[_0x084a('0x6c')],'outboundUnknownCallsDay':_0x597d87[_0x084a('0x6d')],'predictiveIntervalAnsweredCalls':_0x597d87[_0x084a('0x6e')],'predictiveIntervalAvgHoldtime':_0x597d87[_0x084a('0x6f')],'predictiveIntervalAvgTalktime':_0x597d87[_0x084a('0x70')],'predictiveIntervalDroppedCallsCallersExit':_0x597d87['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x597d87['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x597d87[_0x084a('0x71')],'predictiveIntervalErlangCallsDroppedCalls':_0x597d87[_0x084a('0x72')],'predictiveIntervalHitRate':_0x597d87[_0x084a('0x73')],'predictiveIntervalMultiplicativeFactor':_0x597d87['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x597d87[_0x084a('0x74')],'predictiveIntervalAvailable':_0x597d87[_0x084a('0x75')],'predictiveIntervalTotalCalls':_0x597d87[_0x084a('0x76')],'message':_0x597d87[_0x084a('0x3f')],'originated':_0x597d87[_0x084a('0x77')],'erlangCalls':_0x597d87['erlangCalls'],'erlangCallToSecond':_0x597d87[_0x084a('0x78')],'erlangAbandonmentRate':_0x597d87['erlangAbandonmentRate'],'erlangBusyFactor':_0x597d87[_0x084a('0x79')],'startPredictive':_0x597d87[_0x084a('0x7a')],'startProgressive':_0x597d87[_0x084a('0x2b')]};if(_0x597d87['Trunk']){_0x1a0e56['Trunk']={'id':_0x597d87[_0x084a('0x7b')]['id'],'name':_0x597d87[_0x084a('0x7b')]['name'],'active':_0x597d87[_0x084a('0x7b')][_0x084a('0x7c')],'callerid':_0x597d87[_0x084a('0x7b')][_0x084a('0x7d')]};}if(_0x597d87['Interval']){_0x1a0e56[_0x084a('0x45')]={'id':_0x597d87[_0x084a('0x45')]['id'],'name':_0x597d87[_0x084a('0x45')][_0x084a('0x41')]};}var _0x5d6864=md5(JSON[_0x084a('0x4c')](_0x1a0e56));if(_0x597d87[_0x084a('0x4')]!==_0x5d6864){_0x597d87[_0x084a('0x4')]=_0x5d6864;emit(util[_0x084a('0x7e')]('voice:queue:%s',_0x1a0e56['name']),_0x084a('0x7f'),_0x1a0e56);}}}function emitCampaignSummary(_0x3a6905){if(_0x3a6905[_0x084a('0x51')]===_0x084a('0x80')){emit(util[_0x084a('0x7e')](_0x084a('0x81'),_0x3a6905[_0x084a('0x41')]),_0x084a('0x82'),_0x3a6905);}}function checkGetDataPredictive(_0xf6ce0d){if(isNotNull(_0xf6ce0d)&&!_[_0x084a('0x48')](_0xf6ce0d)){loggerPredictive[_0x084a('0x83')](_0x084a('0x84'));loggerPredictive['info'](_0x084a('0x85'),_0xf6ce0d[_0x084a('0x76')]);loggerPredictive[_0x084a('0x83')](_0x084a('0x86'),_0xf6ce0d[_0x084a('0x6e')]);loggerPredictive[_0x084a('0x83')](_0x084a('0x87'),_0xf6ce0d['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0x084a('0x83')](_0x084a('0x88'),_0xf6ce0d[_0x084a('0x89')]);loggerPredictive['info']('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xf6ce0d[_0x084a('0x6f')]);loggerPredictive['info'](_0x084a('0x8a'),_0xf6ce0d[_0x084a('0x70')]);loggerPredictive['info'](_0x084a('0x8b'));if(_0xf6ce0d['predictiveIntervalTotalCalls']>0x0){if(!_['isUndefined'](_0xf6ce0d[_0x084a('0x70')])&&_0xf6ce0d[_0x084a('0x70')]>0x0){return!![];}loggerPredictive[_0x084a('0x83')](_0x084a('0x8c'));if(!_[_0x084a('0x3e')](_0xf6ce0d[_0x084a('0x6f')])&&_0xf6ce0d[_0x084a('0x6f')]>0x0){return!![];}loggerPredictive['info'](_0x084a('0x8d'));}else{loggerPredictive[_0x084a('0x83')](_0x084a('0x8e'));}}else{loggerPredictive['info'](_0x084a('0x8f'));}return![];}function mergeDataErlangB(_0x339088){return function(_0x12db87){loggerPredictive[_0x084a('0x83')]('---------\x20ErlangB\x20---------');loggerPredictive[_0x084a('0x83')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x12db87[_0x084a('0x90')]);loggerPredictive[_0x084a('0x83')](_0x084a('0x91'),_0x12db87['erlangCallToSecond']);loggerPredictive['info'](_0x084a('0x92'),_0x12db87[_0x084a('0x93')]);loggerPredictive['info'](_0x084a('0x94'),_0x12db87['erlangBusyFactor']);loggerPredictive['info'](_0x084a('0x92'),_0x12db87[_0x084a('0x93')]);loggerPredictive[_0x084a('0x83')](_0x084a('0x8b'));_[_0x084a('0x95')](_0x339088,_0x12db87);};}function getDiff(_0x2c934f){var _0x3f2c41=moment()[_0x084a('0x4d')](0x0);var _0x114aa5=moment(_0x2c934f)['milliseconds'](0x0);return _0x3f2c41[_0x084a('0x4e')](_0x114aa5,_0x084a('0x4f'));}function ifInterval(_0x3668eb,_0x50a029){if(_[_0x084a('0x3e')](_0x50a029)){return![];}return getDiff(_0x50a029)<_0x3668eb*0x3c;}function freeVariablesPredictive(_0x3d8128){if(isNotNull(_0x3d8128)){if(!_['isUndefined'](_0x3d8128[_0x084a('0x2b')])){_0x3d8128['startProgressive']=undefined;loggerPredictive['info'](_0x3d8128[_0x084a('0x41')],'clearing\x20variable\x20start\x20progressive');}if(!_['isUndefined'](_0x3d8128[_0x084a('0x7a')])){_0x3d8128[_0x084a('0x7a')]=undefined;loggerPredictive[_0x084a('0x83')](_0x3d8128['name'],_0x084a('0x96'));}if(!_[_0x084a('0x3e')](_0x3d8128[_0x084a('0x97')])){clearInterval(_0x3d8128[_0x084a('0x97')]);_0x3d8128[_0x084a('0x97')]=undefined;loggerPredictive[_0x084a('0x83')](_0x3d8128[_0x084a('0x41')],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0x51e090,_0x2ba35a){if(_0x2ba35a===0x0){return 0x0;}var _0x36ba24=0x1;for(var _0x5c77a3=0x1;_0x5c77a3<=_0x2ba35a;_0x5c77a3+=0x1){_0x36ba24=0x1+_0x36ba24*_0x5c77a3/_0x51e090;}return 0x1/_0x36ba24;}function isVoiceQueueOutbound(_0x3a8192){return _0x3a8192===_0x084a('0x52');}function isNotPreview(_0x31c37b){return _0x31c37b!==_0x084a('0x98');}function isCampaignIvr(_0x48e300){return _0x48e300===_0x084a('0x80');}function getCallerId(_0x3fa52e,_0xabf4c2,_0x5a9bfe){if(!_['isUndefined'](_0x5a9bfe)&&typeof _0x5a9bfe===_0x084a('0x99')&&!_[_0x084a('0x48')](_0x5a9bfe)){if(!_[_0x084a('0x3e')](_0xabf4c2)&&typeof _0xabf4c2===_0x084a('0x99')&&!_[_0x084a('0x48')](_0xabf4c2)){return util[_0x084a('0x7e')](_0x084a('0x9a'),_0xabf4c2,_0x5a9bfe);}return util['format'](_0x084a('0x9a'),_0x5a9bfe,_0x5a9bfe);}if(!_['isUndefined'](_0x3fa52e)&&typeof _0x3fa52e==='string'&&!_[_0x084a('0x48')](_0x3fa52e)){return _0x3fa52e;}return _0x084a('0x9b');}function loggerCatchQueueSummary(_0x2c35ce,_0x4a2745){return function(_0x163a5d){freeVariablesPredictive(_0x4a2745);emitVoiceQueueSummary(_0x4a2745);emitCampaignSummary(_0x4a2745);loggerSyncQueueSummary['error'](_0x2c35ce,util[_0x084a('0x9c')](_0x163a5d,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x1054ea,_0x2417b4){return function(_0x12cef4){loggerPredictive[_0x084a('0x9d')](_0x2417b4[_0x084a('0x41')],_0x1054ea);loggerPredictive['error'](_0x12cef4['stack']);freeVariablesPredictive(_0x2417b4);};}function loggerCatch(_0x1bec42){return function(_0x1e1ea8){logger[_0x084a('0x9d')](_0x1bec42,util[_0x084a('0x9c')](_0x1e1ea8,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x22abf5){return _0x22abf5&&!_[_0x084a('0x3e')](_0x22abf5)&&_0x22abf5['length']>0x0;}function decremetOriginate(_0x3f58de){if(!_[_0x084a('0x3e')](_0x3f58de)&&_0x3f58de!==null){if(typeof _0x3f58de[_0x084a('0x77')]!==_0x084a('0x9e')){if(_0x3f58de[_0x084a('0x77')]>0x0){_0x3f58de[_0x084a('0x77')]-=0x1;}else{logger[_0x084a('0x9d')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x084a('0x9d')](_0x084a('0x9f'));}}function checkContactLowerLimitOriginate(_0x25a4d3,_0x33ba14,_0x19fabb){if(_0x33ba14>_0x19fabb){for(var _0xb287e7=0x0;_0xb287e7<_0x33ba14-_0x19fabb;_0xb287e7+=0x1){decremetOriginate(_0x25a4d3);}}}function loggerGetContactDialer(_0x3824db,_0x26cd70,_0x476fcc){return function(_0x1ada1d){checkContactLowerLimitOriginate(_0x26cd70,_0x476fcc,0x0);logger['error'](_0x3824db,util['inspect'](_0x1ada1d,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x586b6b){return function(_0x2216d4){if(isNotNull(_0x2216d4)&&isNotNull(_0x2216d4[0x0])){if(_0x2216d4[0x0][_0x084a('0xa0')]>0x0){_0x586b6b['message']=_0x084a('0xa1');logger[_0x084a('0x83')](_0x084a('0xa2')+_0x586b6b[_0x084a('0x41')],_0x2216d4[0x0]['contactsRescheduled'],'contacts');}else{_0x586b6b[_0x084a('0x3f')]=_0x084a('0xa3');logger[_0x084a('0x83')](_0x084a('0xa4')+_0x586b6b[_0x084a('0x41')]);}}};}function notSendMessagesQueue(_0x372563){if(_0x372563[_0x084a('0xa5')]){freeVariablesPredictive(_0x372563);if(_0x372563['originated']===0x0&&_0x372563[_0x084a('0x5a')]===0x0&&_0x372563[_0x084a('0x5d')]===0x0&&(_0x372563[_0x084a('0x57')]||0x0)===0x0){_0x372563[_0x084a('0xa5')]=![];_0x372563[_0x084a('0x55')]=0x0;_0x372563[_0x084a('0x3f')]=_0x084a('0x43');loggerSyncQueueSummary['error'](_0x084a('0xa6'),_0x372563[_0x084a('0x41')],_0x084a('0xa7'));}else{_0x372563[_0x084a('0x3f')]=_0x084a('0xa8');loggerSyncQueueSummary[_0x084a('0x9d')](_0x084a('0xa6'),_0x372563[_0x084a('0x41')],_0x084a('0xa9'));}emitVoiceQueueSummary(_0x372563);}}function notSendMessagesCampaign(_0xd75c49){if(_0xd75c49[_0x084a('0xa5')]){if(_0xd75c49['originated']===0x0){_0xd75c49[_0x084a('0xa5')]=![];_0xd75c49[_0x084a('0x3f')]='NOT_ACTIVE';loggerSyncQueueSummary[_0x084a('0x9d')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0xd75c49['name'],_0x084a('0xa7'));}else{_0xd75c49[_0x084a('0x3f')]='IS_DISACTIVED';loggerSyncQueueSummary[_0x084a('0x9d')](_0x084a('0xaa'),_0xd75c49[_0x084a('0x41')],_0x084a('0xa9'));}emitCampaignSummary(_0xd75c49);}}function createObjHistory(_0x1b8359,_0x362d2e,_0x8e0634,_0x27bafc,_0x1916b1){_0x1b8359[_0x084a('0x3f')]=_0x8e0634;var _0xe03abd=new Action(_0x1b8359,_0x362d2e);var _0x7c85e3=new History(_0xe03abd);_0x7c85e3[_0x084a('0xab')]=_0x27bafc;_0x7c85e3[_0x084a('0xac')]=_0x1916b1;_0x7c85e3[_0x084a('0xad')]=_0xe03abd['starttime'];return _0x7c85e3;}Dialer[_0x084a('0x1c')][_0x084a('0x3d')]=function(){var _0x3fa618=this;setInterval(function(){_0x3fa618[_0x084a('0xae')](_0x3fa618[_0x084a('0x29')],_0x084a('0xaf'));_0x3fa618[_0x084a('0xae')](_0x3fa618[_0x084a('0x27')],'[actions]');},0x32c8);};Dialer['prototype'][_0x084a('0xae')]=function(_0x2602ac,_0x5d4217){var _0x5d99ca=this;for(var _0x3459be in _0x2602ac){if(typeof _0x2602ac[_0x3459be]!=='undefined'){this[_0x084a('0x20')]['enqueue'](function(){if(!_[_0x084a('0xb0')](_0x2602ac[_0x3459be])){return ami[_0x084a('0xb1')]({'action':_0x084a('0xb2'),'channel':_0x2602ac[_0x3459be][_0x084a('0xb3')]})['catch'](function(_0x5ebbe8){if(_0x5ebbe8['message']===_0x084a('0xb4')){setTimeout(function(){if(_0x2602ac[_0x3459be]&&_0x2602ac[_0x3459be][_0x084a('0x51')]!==_0x084a('0x80')){_0x5d99ca['updateOriginated'](_0x5d99ca[_0x084a('0x21')][_0x2602ac[_0x3459be][_0x084a('0xb5')]]);logger['error'](_0x084a('0xb6'),_0x5d4217,_0x3459be,_0x2602ac[_0x3459be][_0x084a('0xb5')]);delete _0x2602ac[_0x3459be];}if(_0x2602ac[_0x3459be]&&_0x2602ac[_0x3459be]['type']===_0x084a('0x80')){_0x5d99ca[_0x084a('0xb7')](_0x5d99ca[_0x084a('0x22')][_0x2602ac[_0x3459be]['queue']]);logger['error'](_0x084a('0xb8'),_0x5d4217,_0x3459be,_0x2602ac[_0x3459be]['queue']);delete _0x2602ac[_0x3459be];}},0x2328);}});}});}}};Dialer[_0x084a('0x1c')][_0x084a('0xb9')]=function(_0x11894e){return BPromise[_0x084a('0xba')]()[_0x084a('0xbb')](cmHopper[_0x084a('0xb9')](_0x11894e))['catch'](loggerCatch(_0x084a('0xbc')));};Dialer['prototype']['checkIsBlackList']=function(_0x248cab){return BPromise[_0x084a('0xba')]()[_0x084a('0xbb')](cmHopperBlack[_0x084a('0xbd')](_0x248cab))[_0x084a('0xbe')](loggerCatch(_0x084a('0xbf')));};Dialer['prototype']['verifyAdditionalPhones']=function(_0x152da1,_0x430302,_0x3ec654){return BPromise['resolve']()[_0x084a('0xbb')](cmHopperAdditionalPhone[_0x084a('0xc0')](_0x152da1,_0x430302,_0x3ec654))['catch'](loggerCatch('[verifyAdditionalPhone]\x20'));};Dialer[_0x084a('0x1c')]['swapAdditionalPhones']=function(_0x5c93b2,_0x135e46,_0x2d9c66){return BPromise['resolve']()[_0x084a('0xbb')](cmHopperAdditionalPhone[_0x084a('0xc1')](_0x5c93b2,_0x135e46,_0x2d9c66))['catch'](loggerCatch(_0x084a('0xc2')));};Dialer[_0x084a('0x1c')][_0x084a('0xc3')]=function(_0x2f645f){return BPromise[_0x084a('0xba')]()[_0x084a('0xbb')](cmHopperBlack['checkIsBlackListIvr'](_0x2f645f))['catch'](loggerCatch(_0x084a('0xc4')));};Dialer[_0x084a('0x1c')]['averageHandleTime']=function(_0x3696d9){return BPromise['resolve']()[_0x084a('0xbb')](cmHopperHistory[_0x084a('0xc5')](_0x3696d9))[_0x084a('0xbe')](loggerCatch(_0x084a('0xc6')));};Dialer[_0x084a('0x1c')][_0x084a('0xc7')]=function(_0x4f9c22){return BPromise['resolve']()[_0x084a('0xbb')](cmHopper[_0x084a('0xc7')](_0x4f9c22))[_0x084a('0xbe')](loggerCatch(_0x084a('0xc8')));};Dialer[_0x084a('0x1c')]['unlockContact']=function(_0x2011f1,_0x37c85e,_0x135c45){return BPromise[_0x084a('0xba')]()['then'](cmHopper[_0x084a('0xc9')](_0x2011f1,_0x37c85e,_0x135c45))[_0x084a('0xbe')](loggerCatch(_0x084a('0xca')));};Dialer[_0x084a('0x1c')][_0x084a('0xcb')]=function(_0x2f8c33,_0x2aaef5,_0x8b4013,_0x35d065,_0x3a2420){return BPromise[_0x084a('0xba')]()['then'](cmHopper['getContactDialer'](_0x2f8c33,_0x2aaef5,_0x8b4013,_0x35d065))[_0x084a('0xbe')](function(_0x5b76b0){_0x3a2420[_0x084a('0xcc')]-=_0x8b4013;_0x3a2420[_0x084a('0xcc')]=_0x3a2420[_0x084a('0xcc')]>0x0?_0x3a2420[_0x084a('0xcc')]:0x0;loggerCatch(_0x084a('0xcd'))(_0x5b76b0);});};Dialer['prototype'][_0x084a('0xce')]=function(_0x41908d,_0x5d8ee5,_0x439204,_0x3e150d){return BPromise[_0x084a('0xba')]()['then'](cmHopper[_0x084a('0xce')](_0x41908d,_0x5d8ee5,_0x439204))[_0x084a('0xbe')](function(_0x5f5c16){_0x3e150d[_0x084a('0xcc')]-=_0x5d8ee5;_0x3e150d[_0x084a('0xcc')]=_0x3e150d[_0x084a('0xcc')]>0x0?_0x3e150d[_0x084a('0xcc')]:0x0;loggerCatch(_0x084a('0xcf'))(_0x5f5c16);});};Dialer['prototype'][_0x084a('0xd0')]=function(_0x1a58c6){return BPromise[_0x084a('0xba')]()[_0x084a('0xbb')](voiceQueueRt['getVoiceQueueRtPauses'](_0x1a58c6))[_0x084a('0xbe')](loggerCatch(_0x084a('0xd1')));};Dialer[_0x084a('0x1c')][_0x084a('0xd2')]=function(_0x1957a0){return BPromise[_0x084a('0xba')]()[_0x084a('0xbb')](cmHopper['moveContactManagedDialer'](_0x1957a0))[_0x084a('0xbe')](loggerCatch(_0x084a('0xd3')));};Dialer[_0x084a('0x1c')][_0x084a('0xd4')]=function(_0x3e51c0){return BPromise[_0x084a('0xba')]()[_0x084a('0xbb')](cmHopperHistory[_0x084a('0xd4')](_0x3e51c0))[_0x084a('0xbe')](loggerCatch(_0x084a('0xd5')));};Dialer[_0x084a('0x1c')][_0x084a('0xb7')]=function(_0x3ff42e){if(!_[_0x084a('0x3e')](_0x3ff42e)&&_0x3ff42e!==null){if(typeof _0x3ff42e[_0x084a('0x77')]!==_0x084a('0x9e')){if(_0x3ff42e[_0x084a('0x77')]>0x0){_0x3ff42e['originated']-=0x1;}else{logger[_0x084a('0x9d')](_0x084a('0xd6'));}}}else{logger[_0x084a('0x9d')](_0x084a('0xd7'));}};Dialer['prototype'][_0x084a('0xd8')]=function(_0x142449,_0x4662f9){var _0x23df0c=this;return function(_0x17b8e6){_0x23df0c[_0x084a('0xb7')](_0x4662f9);logger['error'](_0x142449,util['inspect'](_0x17b8e6,{'showHidden':![],'depth':null}));};};Dialer[_0x084a('0x1c')][_0x084a('0xd9')]=function(_0x459907,_0x3b89f6,_0x3dd10e){var _0x3565f5={'state':0x19,'statedesc':_0x084a('0xda')};this[_0x084a('0xb7')](_0x3b89f6);this['saveInDb'](_[_0x084a('0x95')](_0x3565f5,_[_0x084a('0xdb')](_0x3dd10e,[_0x084a('0xdc'),_0x084a('0xdd'),'UserId','VoiceQueueId',_0x084a('0xde')])),_0x084a('0xdf'),_0x084a('0xe0'));logger[_0x084a('0x9d')](_0x459907);};Dialer[_0x084a('0x1c')]['isSuccess']=function(_0x57ed50){return _0x57ed50==='Success';};Dialer[_0x084a('0x1c')][_0x084a('0xe1')]=function(_0x5dab17){return!_[_0x084a('0x3e')](_0x5dab17)&&_0x5dab17&&!_[_0x084a('0x3e')](_0x5dab17['name'])&&!_[_0x084a('0x3e')](_0x5dab17[_0x084a('0x7c')])&&_0x5dab17[_0x084a('0x7c')]&&(this['trunks'][util[_0x084a('0x7e')](_0x084a('0xe2'),_0x5dab17[_0x084a('0x41')])][_0x084a('0xb2')]===_0x084a('0xe3')||this[_0x084a('0x24')][util['format'](_0x084a('0xe2'),_0x5dab17['name'])][_0x084a('0xb2')]==='unmonitored');};Dialer[_0x084a('0x1c')][_0x084a('0xe4')]=function(_0x43f940,_0x358e01,_0x19215b){this[_0x084a('0xd4')](_0x43f940)[_0x084a('0xbe')](loggerCatch(_0x358e01));this[_0x084a('0xd2')](_0x43f940)[_0x084a('0xbe')](loggerCatch(_0x19215b));};Dialer[_0x084a('0x1c')][_0x084a('0xe5')]=function(_0x193db9){var _0x557b25=this[_0x084a('0x29')][_0x193db9[_0x084a('0xe6')]];var _0x30f34d;if(!_[_0x084a('0xb0')](_0x193db9)&&!_[_0x084a('0xb0')](_0x193db9[_0x084a('0xe7')])&&!_[_0x084a('0xb0')](_0x193db9[_0x084a('0xe7')]['amdstatus'])&&_0x193db9['exten']==='xcally-motion-dialer'&&_0x557b25){if(_0x557b25[_0x084a('0x51')]!==_0x084a('0x80')&&this[_0x084a('0x21')][_0x557b25[_0x084a('0xb5')]][_0x084a('0xe8')]&&_0x193db9[_0x084a('0xe9')]===_0x084a('0xea')){delete this[_0x084a('0x29')][_0x193db9[_0x084a('0xe6')]];this[_0x084a('0xb7')](this[_0x084a('0x21')][_0x557b25[_0x084a('0xb5')]]);this[_0x084a('0x21')][_0x557b25[_0x084a('0xb5')]][_0x084a('0xeb')]+=0x1;this[_0x084a('0x21')][_0x557b25[_0x084a('0xb5')]][_0x084a('0x63')]+=0x1;_0x30f34d=new Hangup(_0x557b25,_0x193db9);_0x30f34d[_0x084a('0xab')]=0x12;_0x30f34d[_0x084a('0xac')]=_0x084a('0xec');_0x30f34d['membername']=_0x084a('0xed');ami[_0x084a('0x50')](_0x084a('0xee'),ut['buildObj'](_0x30f34d,_0x084a('0xef')));this[_0x084a('0xe4')](_0x30f34d,_0x084a('0xf0'),_0x084a('0xf1'));}if(_0x557b25['type']!==_0x084a('0x80')&&this[_0x084a('0x21')][_0x557b25['queue']][_0x084a('0xe8')]&&_0x193db9['value']==='MACHINE'){var _0x3c7310=this;return new BPromise(function(_0x163ee0,_0x270c3e){delete _0x3c7310[_0x084a('0x29')][_0x193db9[_0x084a('0xe6')]];_0x3c7310['updateOriginated'](_0x3c7310[_0x084a('0x21')][_0x557b25[_0x084a('0xb5')]]);_0x3c7310[_0x084a('0x21')][_0x557b25[_0x084a('0xb5')]][_0x084a('0xeb')]+=0x1;_0x3c7310[_0x084a('0x21')][_0x557b25['queue']][_0x084a('0x63')]+=0x1;var _0x5e988c=_0x3c7310[_0x084a('0x21')][_0x557b25[_0x084a('0xb5')]];var _0x409c4e=new Hangup(_0x557b25,_0x193db9);_0x409c4e[_0x084a('0xab')]=0x13;_0x409c4e['statedesc']='Machine';_0x409c4e[_0x084a('0xf2')]='AMD';_0x409c4e[_0x084a('0xf3')]+=0x1;_0x409c4e[_0x084a('0xf4')]+=0x1;_0x409c4e[_0x084a('0xef')]=!![];ami[_0x084a('0x50')]('custom:amd',ut['buildObj'](_0x409c4e,'amd'));_0x3c7310['createHistory'](_0x409c4e)['catch'](loggerCatch(_0x084a('0xf5')));if(_0x409c4e[_0x084a('0xf6')]+_0x409c4e[_0x084a('0xf7')]+_0x409c4e[_0x084a('0xf8')]+_0x409c4e[_0x084a('0xf9')]+_0x409c4e[_0x084a('0xfa')]+_0x409c4e[_0x084a('0xfb')]+_0x409c4e[_0x084a('0xf3')]+_0x409c4e[_0x084a('0xfc')]>=_0x5e988c['dialGlobalMaxRetry']){_0x3c7310[_0x084a('0xfd')](_0x409c4e,_0x163ee0,_0x270c3e,_0x084a('0xfe'));}else{if(_0x409c4e['countmachineretry']>=_0x5e988c[_0x084a('0xff')]){_0x3c7310[_0x084a('0x100')](_0x409c4e,_0x163ee0,_0x270c3e,_0x084a('0x101'));}else{_0x3c7310[_0x084a('0xc7')]({'active':![],'countmachineretry':_0x409c4e[_0x084a('0xf3')],'scheduledat':moment()[_0x084a('0x102')](_0x5e988c['dialMachineRetryFrequency'],_0x084a('0x103'))[_0x084a('0x7e')](_0x084a('0x104')),'ContactId':_0x409c4e[_0x084a('0xdc')],'ListId':_0x409c4e[_0x084a('0xdd')],'VoiceQueueId':_0x409c4e['VoiceQueueId']||undefined,'CampaignId':_0x409c4e[_0x084a('0xde')]||undefined})['catch'](loggerCatch(_0x084a('0x105')));_0x163ee0({'reschedule':0x1});}}});}if(_0x557b25[_0x084a('0x51')]===_0x084a('0x80')&&this['campaigns'][_0x557b25[_0x084a('0xb5')]][_0x084a('0xe8')]&&_0x193db9[_0x084a('0xe9')]===_0x084a('0xea')){delete this['uniqueId'][_0x193db9[_0x084a('0xe6')]];this[_0x084a('0xb7')](this[_0x084a('0x22')][_0x557b25[_0x084a('0xb5')]]);_0x30f34d=new Hangup(_0x557b25,_0x193db9);_0x30f34d[_0x084a('0xab')]=0x12;_0x30f34d[_0x084a('0xac')]='HangupInAMD';_0x30f34d[_0x084a('0xf2')]=_0x084a('0xed');ami[_0x084a('0x50')]('custom:amd',ut['buildObj'](_0x30f34d,_0x084a('0xef')));this[_0x084a('0xe4')](_0x30f34d,_0x084a('0x106'),_0x084a('0x107'));}if(_0x557b25[_0x084a('0x51')]===_0x084a('0x80')&&this[_0x084a('0x22')][_0x557b25[_0x084a('0xb5')]][_0x084a('0xe8')]&&_0x193db9['value']===_0x084a('0x108')){var _0x3c7310=this;return new BPromise(function(_0x22c26e,_0xd0b78c){delete _0x3c7310[_0x084a('0x29')][_0x193db9[_0x084a('0xe6')]];_0x3c7310[_0x084a('0xb7')](_0x3c7310['campaigns'][_0x557b25['queue']]);_0x3c7310[_0x084a('0x22')][_0x557b25['queue']]['outboundAnswerCallsDay']+=0x1;_0x3c7310[_0x084a('0x22')][_0x557b25[_0x084a('0xb5')]][_0x084a('0x63')]+=0x1;var _0x9c2089=_0x3c7310[_0x084a('0x22')][_0x557b25[_0x084a('0xb5')]];var _0x37ead4=new Hangup(_0x557b25,_0x193db9);_0x37ead4[_0x084a('0xab')]=0x13;_0x37ead4[_0x084a('0xac')]='Machine';_0x37ead4[_0x084a('0xf2')]=_0x084a('0xed');_0x37ead4['countmachineretry']+=0x1;_0x37ead4[_0x084a('0xf4')]+=0x1;_0x37ead4[_0x084a('0xef')]=!![];ami['emit'](_0x084a('0xee'),ut[_0x084a('0x109')](_0x37ead4,'amd'));_0x3c7310[_0x084a('0xd4')](_0x37ead4)[_0x084a('0xbe')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x37ead4['countbusyretry']+_0x37ead4[_0x084a('0xf7')]+_0x37ead4['countnoanswerretry']+_0x37ead4['countnosuchnumberretry']+_0x37ead4[_0x084a('0xfa')]+_0x37ead4['countabandonedretry']+_0x37ead4[_0x084a('0xf3')]+_0x37ead4[_0x084a('0xfc')]>=_0x9c2089[_0x084a('0x10a')]){_0x3c7310[_0x084a('0xfd')](_0x37ead4,_0x22c26e,_0xd0b78c,_0x084a('0xfe'));}else{if(_0x37ead4[_0x084a('0xf3')]>=_0x9c2089[_0x084a('0xff')]){_0x3c7310[_0x084a('0x100')](_0x37ead4,_0x22c26e,_0xd0b78c,'reason\x2019\x20machine....');}else{_0x3c7310[_0x084a('0xc7')]({'active':![],'countmachineretry':_0x37ead4[_0x084a('0xf3')],'scheduledat':moment()['add'](_0x9c2089['dialMachineRetryFrequency'],_0x084a('0x103'))['format'](_0x084a('0x104')),'ContactId':_0x37ead4['ContactId'],'ListId':_0x37ead4[_0x084a('0xdd')],'VoiceQueueId':_0x37ead4[_0x084a('0x10b')]||undefined,'CampaignId':_0x37ead4[_0x084a('0xde')]||undefined})['catch'](loggerCatch(_0x084a('0x105')));_0x22c26e({'reschedule':0x1});}}});}}};Dialer[_0x084a('0x1c')][_0x084a('0x10c')]=function(_0x3fc7cb){var _0x5bd87f=this['uniqueId'][_0x3fc7cb[_0x084a('0xe6')]];var _0x166b66=this;var _0x1b2826;if(_0x5bd87f&&_0x5bd87f[_0x084a('0x51')]===_0x084a('0x80')){delete this[_0x084a('0x29')][_0x3fc7cb['uniqueid']];this['updateOriginated'](this[_0x084a('0x22')][_0x5bd87f[_0x084a('0xb5')]]);this[_0x084a('0x22')][_0x5bd87f[_0x084a('0xb5')]][_0x084a('0x10d')]+=0x1;_0x1b2826=new Hangup(_0x5bd87f,_0x3fc7cb);this[_0x084a('0xd4')](_0x1b2826)[_0x084a('0xbe')](loggerCatch(_0x084a('0x10e')));this[_0x084a('0xd2')](_0x1b2826)[_0x084a('0xbe')](loggerCatch('[syncHangupIvr]'));}if(_0x5bd87f&&_0x5bd87f[_0x084a('0x51')]!==_0x084a('0x80')&&isNotNull(this['voiceQueues'][_0x5bd87f[_0x084a('0xb5')]][_0x084a('0x10f')])){delete this[_0x084a('0x29')][_0x3fc7cb[_0x084a('0xe6')]];this['updateOriginated'](this[_0x084a('0x21')][_0x5bd87f[_0x084a('0xb5')]]);this[_0x084a('0x21')][_0x5bd87f[_0x084a('0xb5')]]['outboundAnswerCallsDay']+=0x1;this[_0x084a('0x21')][_0x5bd87f[_0x084a('0xb5')]][_0x084a('0x63')]+=0x1;_0x1b2826=new Hangup(_0x5bd87f,_0x3fc7cb);_0x1b2826[_0x084a('0xab')]=0x10;_0x1b2826[_0x084a('0xac')]=_0x084a('0x110');_0x1b2826[_0x084a('0xf2')]='AGI';this['createHistory'](_0x1b2826)[_0x084a('0xbe')](loggerCatch(_0x084a('0x10e')));this[_0x084a('0xd2')](_0x1b2826)[_0x084a('0xbe')](loggerCatch(_0x084a('0x111')));}if(_0x5bd87f&&_0x5bd87f[_0x084a('0x51')]!=='ivr'&&!isNotNull(this[_0x084a('0x21')][_0x5bd87f[_0x084a('0xb5')]][_0x084a('0x10f')])){delete this[_0x084a('0x29')][_0x3fc7cb[_0x084a('0xe6')]];this['updateOriginated'](this[_0x084a('0x21')][_0x5bd87f[_0x084a('0xb5')]]);this['voiceQueues'][_0x5bd87f[_0x084a('0xb5')]]['outboundUnknownCallsDay']+=0x1;_0x1b2826=new Hangup(_0x5bd87f,_0x3fc7cb);_0x1b2826[_0x084a('0xab')]=0xc;_0x1b2826[_0x084a('0xac')]=_0x3fc7cb[_0x084a('0x112')];_0x1b2826[_0x084a('0xf2')]=_0x084a('0x113');this[_0x084a('0xd4')](_0x1b2826)['catch'](loggerCatch(_0x084a('0x10e')));this[_0x084a('0xd2')](_0x1b2826)[_0x084a('0xbe')](loggerCatch(_0x084a('0x111')));}};Dialer[_0x084a('0x1c')][_0x084a('0x36')]=function(_0x535a00){var _0x4f9c60=this[_0x084a('0x29')][_0x535a00[_0x084a('0xe6')]];var _0xdeb09f=this;if(this[_0x084a('0x21')][_0x535a00[_0x084a('0xb5')]]){if(_0x4f9c60&&_0x4f9c60[_0x084a('0x51')]!==_0x084a('0x80')){delete this['uniqueId'][_0x535a00['uniqueid']];this[_0x084a('0x21')][_0x535a00[_0x084a('0xb5')]]['outboundAnswerCallsDay']+=0x1;var _0x566772=new AgentComplete(_0x4f9c60,_0x535a00);if(_0x535a00[_0x084a('0x114')]===_0x084a('0x115')){_0x566772[_0x084a('0x116')]=this['voiceQueues'][_0x535a00['queue']][_0x084a('0x117')]&&this[_0x084a('0x21')][_0x535a00[_0x084a('0xb5')]][_0x084a('0x118')]?moment()[_0x084a('0x7e')](_0x084a('0x104')):undefined;}this[_0x084a('0xd4')](_0x566772)['catch'](loggerCatch(_0x084a('0x119')));this[_0x084a('0xd2')](_0x566772)['catch'](loggerCatch(_0x084a('0x11a')));}}};Dialer[_0x084a('0x1c')][_0x084a('0x11b')]=function(_0x5d17ff){if(this['voiceQueues'][_0x5d17ff[_0x084a('0xb5')]]){if(this[_0x084a('0x29')][_0x5d17ff[_0x084a('0xe6')]]&&this['uniqueId'][_0x5d17ff[_0x084a('0xe6')]][_0x084a('0x51')]!==_0x084a('0x80')){this['updateOriginated'](this[_0x084a('0x21')][_0x5d17ff[_0x084a('0xb5')]]);this[_0x084a('0x29')][_0x5d17ff[_0x084a('0xe6')]][_0x084a('0x11c')]=moment()[_0x084a('0x7e')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0x084a('0x1c')][_0x084a('0x11d')]=function(_0x1ba2e6,_0x9ad132){this['createHistory'](_0x1ba2e6)['catch'](loggerCatch(_0x084a('0x119')));if(_0x9ad132==0x0){this[_0x084a('0xd2')](_0x1ba2e6)['catch'](loggerCatch(_0x084a('0x11e')));}};Dialer[_0x084a('0x1c')][_0x084a('0x32')]=function(_0x44075c){var _0x5d545f=this[_0x084a('0x29')][_0x44075c['uniqueid']];var _0x311c40=this;var _0x3ca579=![];var _0x3a972d;var _0x4217f2;if(this[_0x084a('0x21')][_0x44075c[_0x084a('0xb5')]]){if(_0x5d545f&&_0x5d545f[_0x084a('0x51')]!=='ivr'){delete this[_0x084a('0x29')][_0x44075c[_0x084a('0xe6')]];this[_0x084a('0xb7')](this['voiceQueues'][_0x44075c[_0x084a('0xb5')]]);_0x5d545f['droptime']=moment()[_0x084a('0x7e')](_0x084a('0x104'));var _0x40e2d7=new QueueCallerAbandon(_0x5d545f,_0x44075c);if(getSeconds(_0x5d545f[_0x084a('0x11f')],_0x5d545f[_0x084a('0x120')])>=_0x5d545f[_0x084a('0x121')]){this[_0x084a('0x21')][_0x44075c[_0x084a('0xb5')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0x084a('0x21')][_0x44075c['queue']][_0x084a('0x67')]+=0x1;this[_0x084a('0x21')][_0x44075c[_0x084a('0xb5')]][_0x084a('0x72')]+=0x1;_0x40e2d7[_0x084a('0xab')]=0xa;_0x40e2d7[_0x084a('0xac')]='Drop';_0x40e2d7[_0x084a('0x122')]=_0x084a('0x123');_0x40e2d7[_0x084a('0x116')]=this[_0x084a('0x21')][_0x44075c[_0x084a('0xb5')]][_0x084a('0x117')]?moment()[_0x084a('0x7e')](_0x084a('0x104')):undefined;_0x40e2d7[_0x084a('0xfa')]+=0x1;_0x40e2d7[_0x084a('0xf4')]+=0x1;_0x3a972d=this[_0x084a('0x21')][_0x44075c[_0x084a('0xb5')]][_0x084a('0x124')];_0x4217f2=this[_0x084a('0x21')][_0x44075c[_0x084a('0xb5')]][_0x084a('0x125')];_0x311c40[_0x084a('0xc0')](_0x40e2d7,_0x40e2d7[_0x084a('0xab')],_0x5d545f[_0x084a('0x126')])['then'](function(_0x3989bd){_0x3ca579=_0x3989bd[_0x084a('0x127')]==0x1;if(_0x40e2d7[_0x084a('0xfa')]>=_0x311c40[_0x084a('0x21')][_0x44075c[_0x084a('0xb5')]][_0x084a('0x128')]){_0x311c40['queueCallerAbandonCreateState'](_0x40e2d7,_0x3989bd[_0x084a('0x127')]);}else{_0x311c40[_0x084a('0xc7')]({'active':![],'countdropretry':_0x40e2d7[_0x084a('0xfa')],'scheduledat':moment()['add'](this[_0x084a('0x21')][_0x44075c[_0x084a('0xb5')]]['dialDropRetryFrequency'],_0x084a('0x103'))[_0x084a('0x7e')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5d545f[_0x084a('0xdc')],'ListId':_0x5d545f[_0x084a('0xdd')],'VoiceQueueId':_0x5d545f[_0x084a('0x10b')]||undefined,'CampaignId':_0x5d545f[_0x084a('0xde')]||undefined})[_0x084a('0xbe')](loggerCatch(_0x084a('0x129')));var _0x3d49e6=new History(_0x40e2d7);_0x3d49e6['state']=0xa;_0x3d49e6['statedesc']=_0x084a('0x12a');_0x3d49e6['starttime']=moment()[_0x084a('0x7e')](_0x084a('0x104'));_0x3d49e6['endtime']=_0x3d49e6[_0x084a('0x12b')];_0x3d49e6[_0x084a('0x12c')]=_0x40e2d7[_0x084a('0x12c')];_0x3d49e6['calleridnum']=_0x40e2d7[_0x084a('0x12d')];_0x311c40[_0x084a('0xd4')](_0x3d49e6)[_0x084a('0xbe')](loggerCatch(_0x084a('0x12e')));}})[_0x084a('0xbb')](function(_0x20aee6){if(_0x3ca579)_0x311c40['swapAdditionalPhones'](_0x40e2d7,_0x3a972d,_0x4217f2)['then'](function(_0x56daf2){return 0x1;});});}else{this['voiceQueues'][_0x44075c[_0x084a('0xb5')]][_0x084a('0x89')]+=0x1;this[_0x084a('0x21')][_0x44075c['queue']][_0x084a('0x66')]+=0x1;_0x40e2d7[_0x084a('0xab')]=0xb;_0x40e2d7[_0x084a('0xac')]=_0x084a('0x12f');_0x40e2d7[_0x084a('0x122')]=_0x084a('0x130');_0x40e2d7[_0x084a('0xfb')]+=0x1;_0x40e2d7[_0x084a('0xf4')]+=0x1;_0x3a972d=this[_0x084a('0x21')][_0x44075c[_0x084a('0xb5')]][_0x084a('0x131')];_0x4217f2=this[_0x084a('0x21')][_0x44075c[_0x084a('0xb5')]][_0x084a('0x125')];_0x311c40[_0x084a('0xc0')](_0x40e2d7,_0x40e2d7[_0x084a('0xab')],_0x5d545f[_0x084a('0x126')])[_0x084a('0xbb')](function(_0x8e3b8f){if(_0x40e2d7[_0x084a('0xfb')]>=_0x311c40[_0x084a('0x21')][_0x44075c[_0x084a('0xb5')]][_0x084a('0x132')]){_0x311c40['queueCallerAbandonCreateState'](_0x40e2d7,_0x8e3b8f['additional']);}else{_0x311c40[_0x084a('0xc7')]({'active':![],'countabandonedretry':_0x40e2d7['countabandonedretry'],'scheduledat':moment()[_0x084a('0x102')](this[_0x084a('0x21')][_0x44075c['queue']][_0x084a('0x131')],_0x084a('0x103'))[_0x084a('0x7e')](_0x084a('0x104')),'ContactId':_0x5d545f['ContactId'],'ListId':_0x5d545f['ListId'],'VoiceQueueId':_0x5d545f[_0x084a('0x10b')]||undefined,'CampaignId':_0x5d545f[_0x084a('0xde')]||undefined})[_0x084a('0xbe')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x4e917b=new History(_0x40e2d7);_0x4e917b[_0x084a('0xab')]=0xb;_0x4e917b[_0x084a('0xac')]=_0x084a('0x12f');_0x4e917b['starttime']=moment()[_0x084a('0x7e')](_0x084a('0x104'));_0x4e917b['endtime']=_0x4e917b[_0x084a('0x12b')];_0x4e917b[_0x084a('0x12c')]=_0x40e2d7[_0x084a('0x12c')];_0x4e917b[_0x084a('0x12d')]=_0x40e2d7['calleridnum'];_0x311c40[_0x084a('0xd4')](_0x4e917b)[_0x084a('0xbe')](loggerCatch(_0x084a('0x133')));}})['then'](function(_0x55d986){if(_0x3ca579)_0x311c40[_0x084a('0xc1')](_0x40e2d7,_0x3a972d,_0x4217f2)[_0x084a('0xbb')](function(_0x41be24){return 0x1;});});}}}};Dialer[_0x084a('0x1c')][_0x084a('0x134')]=function(_0x4923f8){if(this['actions'][_0x4923f8[_0x084a('0xe6')]]){this[_0x084a('0x27')][_0x4923f8[_0x084a('0xe6')]][_0x084a('0xb3')]=_0x4923f8[_0x084a('0xb3')];}if(this[_0x084a('0x29')][_0x4923f8[_0x084a('0xe6')]]){this[_0x084a('0x29')][_0x4923f8[_0x084a('0xe6')]][_0x084a('0xb3')]=_0x4923f8[_0x084a('0xb3')];}};Dialer[_0x084a('0x1c')][_0x084a('0x39')]=function(_0x416b45){if(strategy[this['voiceQueues'][this[_0x084a('0x27')][_0x416b45['actionid']][_0x084a('0xb5')]][_0x084a('0x53')]]==='roundrobin'){if(this[_0x084a('0x27')][_0x416b45['actionid']]&&_[_0x084a('0xb0')](this[_0x084a('0x27')][_0x416b45['actionid']][_0x084a('0x135')])&&_0x416b45[_0x084a('0xb2')]==='1'&&_0x416b45['paused']==='0'){if(this[_0x084a('0x23')][_0x416b45[_0x084a('0x136')]]){if(!this[_0x084a('0x23')][_0x416b45[_0x084a('0x136')]][_0x084a('0x135')]){this[_0x084a('0x23')][_0x416b45['stateinterface']][_0x084a('0x135')]=!![];this[_0x084a('0x27')][_0x416b45['actionid']][_0x084a('0x135')]=!![];this['actions'][_0x416b45['actionid']][_0x084a('0x136')]=_0x416b45['stateinterface'];}}}}else if((strategy[this[_0x084a('0x21')][this[_0x084a('0x27')][_0x416b45['actionid']]['queue']][_0x084a('0x53')]]||_0x084a('0x1b'))===_0x084a('0x1b')){if(this[_0x084a('0x27')][_0x416b45[_0x084a('0x137')]]){if(this['agents'][_0x416b45['stateinterface']]){this[_0x084a('0x27')][_0x416b45[_0x084a('0x137')]][_0x084a('0x136')]=_0x416b45[_0x084a('0x136')];if(_[_0x084a('0xb0')](this[_0x084a('0x2d')][this[_0x084a('0x27')][_0x416b45[_0x084a('0x137')]][_0x084a('0xb5')]])){this[_0x084a('0x2d')][this[_0x084a('0x27')][_0x416b45['actionid']][_0x084a('0xb5')]]=[];}this[_0x084a('0x2d')][this[_0x084a('0x27')][_0x416b45['actionid']][_0x084a('0xb5')]][_0x084a('0x138')](_['merge'](_[_0x084a('0xdb')](this[_0x084a('0x27')][_0x416b45['actionid']],[_0x084a('0x139'),_0x084a('0x136')]),{'status':_0x416b45[_0x084a('0xb2')],'paused':_0x416b45[_0x084a('0x13a')]}));}}}};function unlockQueueStatus(_0x594fee,_0x1abe6b){setTimeout(function(){if(_[_0x084a('0x3e')](_0x594fee[_0x084a('0x13b')])){loggerBooked[_0x084a('0x9d')](_0x084a('0x13c'),_0x1abe6b);}_0x594fee[_0x084a('0x13b')]=!![];loggerBooked['info'](_0x084a('0x13d'),_0x1abe6b,JSON[_0x084a('0x4c')](_[_0x084a('0xdb')](_0x594fee,['name',_0x084a('0x13b')])));},0x1f3);}Dialer['prototype'][_0x084a('0x3b')]=function(_0x433118){var _0x587e31=this;var _0x5f3394=_0x587e31[_0x084a('0x21')][_0x587e31[_0x084a('0x27')][_0x433118[_0x084a('0x137')]][_0x084a('0xb5')]];if(strategy[this[_0x084a('0x21')][this[_0x084a('0x27')][_0x433118[_0x084a('0x137')]][_0x084a('0xb5')]][_0x084a('0x53')]]==='roundrobin'){if(this[_0x084a('0x27')][_0x433118[_0x084a('0x137')]]&&this[_0x084a('0x27')][_0x433118[_0x084a('0x137')]]['stateinterface']){this['preview'][_0x084a('0x13e')](this[_0x084a('0x27')][_0x433118[_0x084a('0x137')]]['idHopper'],this['actions'][_0x433118[_0x084a('0x137')]][_0x084a('0x136')])[_0x084a('0xbe')](function(_0x265dd6){logger[_0x084a('0x9d')](_0x084a('0x13f'),util['inspect'](_0x265dd6,{'showHidden':![],'depth':null}));})[_0x084a('0x1f')](function(){_0x587e31[_0x084a('0xb7')](_0x587e31[_0x084a('0x21')][_0x587e31[_0x084a('0x27')][_0x433118[_0x084a('0x137')]][_0x084a('0xb5')]]);_0x587e31['agents'][_0x587e31[_0x084a('0x27')][_0x433118[_0x084a('0x137')]][_0x084a('0x136')]][_0x084a('0x135')]=![];delete _0x587e31[_0x084a('0x27')][_0x433118['actionid']];unlockQueueStatus(_0x5f3394);});}else{this[_0x084a('0xb7')](this[_0x084a('0x21')][this[_0x084a('0x27')][_0x433118['actionid']]['queue']]);this[_0x084a('0xc7')]({'active':![],'ContactId':this[_0x084a('0x27')][_0x433118[_0x084a('0x137')]][_0x084a('0xdc')],'ListId':this['actions'][_0x433118[_0x084a('0x137')]][_0x084a('0xdd')],'VoiceQueueId':this[_0x084a('0x27')][_0x433118[_0x084a('0x137')]][_0x084a('0x10b')]||undefined,'CampaignId':this[_0x084a('0x27')][_0x433118[_0x084a('0x137')]][_0x084a('0xde')]||undefined})[_0x084a('0xbe')](loggerCatch(_0x084a('0x140')));delete this['actions'][_0x433118[_0x084a('0x137')]];unlockQueueStatus(_0x5f3394);}}else if((strategy[this[_0x084a('0x21')][this[_0x084a('0x27')][_0x433118[_0x084a('0x137')]]['queue']][_0x084a('0x53')]]||'rrmemory')==='rrmemory'){var _0x5ddd90;if(this[_0x084a('0x27')][_0x433118[_0x084a('0x137')]]&&!_[_0x084a('0x48')](this['queueBooked'][this[_0x084a('0x27')][_0x433118[_0x084a('0x137')]][_0x084a('0xb5')]])){if(this['queueBookedRR'][_0x587e31['actions'][_0x433118['actionid']][_0x084a('0xb5')]]){this[_0x084a('0x2e')][_0x587e31[_0x084a('0x27')][_0x433118[_0x084a('0x137')]][_0x084a('0xb5')]]=this['queueBookedRR'][this[_0x084a('0x27')][_0x433118[_0x084a('0x137')]][_0x084a('0xb5')]]?this[_0x084a('0x2e')][this[_0x084a('0x27')][_0x433118[_0x084a('0x137')]][_0x084a('0xb5')]]:this[_0x084a('0x2d')][this[_0x084a('0x27')][_0x433118['actionid']][_0x084a('0xb5')]]?this[_0x084a('0x2d')][this[_0x084a('0x27')][_0x433118[_0x084a('0x137')]]['queue']][_0x084a('0x141')]||0x0:0x0;}this['queueBooked'][this[_0x084a('0x27')][_0x433118[_0x084a('0x137')]]['queue']][_0x084a('0x141')]=this[_0x084a('0x2e')][this[_0x084a('0x27')][_0x433118[_0x084a('0x137')]]['queue']];for(var _0x32692f=0x0;_0x32692f<this['queueBooked'][this['actions'][_0x433118[_0x084a('0x137')]][_0x084a('0xb5')]]['length'];_0x32692f+=0x1){_0x5ddd90=rr(this['queueBooked'][this[_0x084a('0x27')][_0x433118['actionid']][_0x084a('0xb5')]]);this[_0x084a('0x2e')][_0x587e31[_0x084a('0x27')][_0x433118[_0x084a('0x137')]][_0x084a('0xb5')]]=this[_0x084a('0x2d')][this['actions'][_0x433118[_0x084a('0x137')]][_0x084a('0xb5')]]['_rr'];if(_0x5ddd90[_0x084a('0xb2')]==='1'&&_0x5ddd90[_0x084a('0x13a')]==='0'){break;}}if(!_[_0x084a('0xb0')](_0x5ddd90)){this[_0x084a('0x23')][_0x5ddd90['stateinterface']][_0x084a('0x142')]=_[_0x084a('0x3e')](this[_0x084a('0x23')][_0x5ddd90[_0x084a('0x136')]]['unlockRR'])?!![]:this[_0x084a('0x23')][_0x5ddd90[_0x084a('0x136')]][_0x084a('0x142')];}loggerBooked['info'](_0x084a('0x143'),_0x433118[_0x084a('0x137')],_0x084a('0x144'),JSON[_0x084a('0x4c')](_[_0x084a('0xdb')](this[_0x084a('0x23')][_0x5ddd90[_0x084a('0x136')]],[_0x084a('0x41'),_0x084a('0x142')])),_0x084a('0x145'),JSON['stringify'](_0x5ddd90[_0x084a('0x139')]));if(!_[_0x084a('0xb0')](_0x5ddd90)&&_0x5ddd90[_0x084a('0xb2')]==='1'&&_0x5ddd90[_0x084a('0x13a')]==='0'&&this[_0x084a('0x23')][_0x5ddd90[_0x084a('0x136')]][_0x084a('0x142')]){this[_0x084a('0x23')][_0x5ddd90[_0x084a('0x136')]][_0x084a('0x142')]=![];this[_0x084a('0x2d')][_0x587e31['actions'][_0x433118[_0x084a('0x137')]][_0x084a('0xb5')]]=[];this[_0x084a('0x98')][_0x084a('0x13e')](_0x5ddd90['idHopper'],_0x5ddd90[_0x084a('0x136')])[_0x084a('0xbe')](function(_0x12eecc){logger[_0x084a('0x9d')](_0x084a('0x13f'),util[_0x084a('0x9c')](_0x12eecc,{'showHidden':![],'depth':null}));})[_0x084a('0x1f')](function(){_0x587e31['updateOriginated'](_0x587e31['voiceQueues'][_0x587e31['actions'][_0x433118[_0x084a('0x137')]]['queue']]);setTimeout(function(){_0x587e31[_0x084a('0x23')][_0x5ddd90[_0x084a('0x136')]][_0x084a('0x142')]=!![];loggerBooked[_0x084a('0x83')](_0x084a('0x146'),_0x433118[_0x084a('0x137')],_0x084a('0x144'),JSON['stringify'](_['pick'](_0x587e31[_0x084a('0x23')][_0x5ddd90['stateinterface']],[_0x084a('0x41'),_0x084a('0x142')])),_0x084a('0x145'),JSON[_0x084a('0x4c')](_0x5ddd90['idHopper']));},0xc7);delete _0x587e31[_0x084a('0x27')][_0x433118[_0x084a('0x137')]];unlockQueueStatus(_0x5f3394,_0x433118['actionid']);});}else{loggerBooked[_0x084a('0x83')](_0x084a('0x147'));this[_0x084a('0xb7')](this[_0x084a('0x21')][this['actions'][_0x433118[_0x084a('0x137')]][_0x084a('0xb5')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0x084a('0x27')][_0x433118['actionid']][_0x084a('0xdc')],'ListId':this['actions'][_0x433118[_0x084a('0x137')]][_0x084a('0xdd')],'VoiceQueueId':this[_0x084a('0x27')][_0x433118[_0x084a('0x137')]][_0x084a('0x10b')]||undefined,'CampaignId':this[_0x084a('0x27')][_0x433118[_0x084a('0x137')]][_0x084a('0xde')]||undefined})[_0x084a('0xbe')](loggerCatch(_0x084a('0x140')));delete this[_0x084a('0x27')][_0x433118[_0x084a('0x137')]];unlockQueueStatus(_0x5f3394);}}else{loggerBooked[_0x084a('0x83')]('[booked][unlock2]');this['updateOriginated'](this[_0x084a('0x21')][this[_0x084a('0x27')][_0x433118[_0x084a('0x137')]]['queue']]);this[_0x084a('0xc7')]({'active':![],'ContactId':this[_0x084a('0x27')][_0x433118['actionid']][_0x084a('0xdc')],'ListId':this['actions'][_0x433118[_0x084a('0x137')]][_0x084a('0xdd')],'VoiceQueueId':this[_0x084a('0x27')][_0x433118[_0x084a('0x137')]][_0x084a('0x10b')]||undefined,'CampaignId':this['actions'][_0x433118['actionid']][_0x084a('0xde')]||undefined})[_0x084a('0xbe')](loggerCatch(_0x084a('0x148')));delete this['actions'][_0x433118['actionid']];unlockQueueStatus(_0x5f3394);}}else{loggerBooked[_0x084a('0x83')](_0x084a('0x149'));this[_0x084a('0xb7')](this['voiceQueues'][this[_0x084a('0x27')][_0x433118[_0x084a('0x137')]][_0x084a('0xb5')]]);this[_0x084a('0xc7')]({'active':![],'ContactId':this[_0x084a('0x27')][_0x433118[_0x084a('0x137')]][_0x084a('0xdc')],'ListId':this[_0x084a('0x27')][_0x433118[_0x084a('0x137')]]['ListId'],'VoiceQueueId':this[_0x084a('0x27')][_0x433118['actionid']][_0x084a('0x10b')]||undefined,'CampaignId':this[_0x084a('0x27')][_0x433118[_0x084a('0x137')]]['CampaignId']||undefined})['catch'](loggerCatch(_0x084a('0x14a')));delete this[_0x084a('0x27')][_0x433118['actionid']];unlockQueueStatus(_0x5f3394);}};Dialer['prototype'][_0x084a('0x3c')]=function(){var _0x1ff440=this;setInterval(function(){_0x1ff440[_0x084a('0x14b')]();},0x3e8);};Dialer[_0x084a('0x1c')][_0x084a('0x14c')]=function(_0x32a001){var _0x4c64ce=this;return function(){if(!_0x4c64ce[_0x084a('0xe1')](_0x32a001[_0x084a('0x7b')])){if(!_0x4c64ce['isTrunkReachable'](_0x32a001[_0x084a('0x14d')])){_0x32a001['message']=_0x084a('0x14e');throw _0x32a001['name']+_0x084a('0x14f');}}};};Dialer['prototype'][_0x084a('0x150')]=function(_0x2c9f59,_0x3a6d2a,_0x17b548,_0x4a0995){var _0x4956a7=this;return function(){var _0x4e5269=!![];return _0x4956a7[_0x084a('0x151')](_0x2c9f59,_0x3a6d2a,_0x17b548,_0x4a0995,_0x4e5269);};};Dialer['prototype'][_0x084a('0x152')]=function(_0x3771fe,_0x26ead2,_0x4123fc,_0x5c5f3d){var _0x4384af=this;return function(){var _0x56fcf0=![];return _0x4384af[_0x084a('0x151')](_0x3771fe[_0x084a('0x47')],_0x26ead2,_0x4123fc,_0x5c5f3d,_0x56fcf0);};};Dialer[_0x084a('0x1c')][_0x084a('0x151')]=function(_0x1a5edd,_0x4660bc,_0x270cfc,_0x247bd3,_0x474000){var _0x507662=[];return new BPromise(function(_0x1c65b9,_0x45a4ff){if(!isNotNull(_0x1a5edd)){_0x247bd3[_0x084a('0x3f')]=_0x084a('0x49');return _0x45a4ff(msgResponse('ifTime',_0x084a('0x153'),_0x270cfc+_0x084a('0x154')));}if(_[_0x084a('0x48')](_0x1a5edd)){_0x247bd3['message']=_0x084a('0x155');return _0x45a4ff(msgResponse(_0x084a('0x151'),_0x084a('0x153'),_0x270cfc+'\x20Intervals\x20is\x20empty\x20'));}if(_0x4660bc&&_[_0x084a('0x3e')](config[_0x084a('0x156')][_0x4660bc])){_0x247bd3[_0x084a('0x3f')]=_0x084a('0x157');return _0x45a4ff(msgResponse('ifTime',_0x084a('0x153'),_0x270cfc+_0x084a('0x158')+_0x4660bc));}if(_[_0x084a('0x159')](_0x1a5edd)){for(var _0x49a01a=0x0;_0x49a01a<_0x1a5edd['length'];_0x49a01a+=0x1){_0x507662['push'](ami[_0x084a('0xb1')]({'action':_0x084a('0x15a'),'command':util[_0x084a('0x7e')](_0x084a('0x15b'),_0x1a5edd[_0x49a01a]['interval'],!_['isUndefined'](config[_0x084a('0x156')][_0x4660bc])?_0x4660bc:'')})['then'](function(_0x1c288a){return _0x1c288a['content']['indexOf']('true')>=0x0;})[_0x084a('0xbe')](myreject(_0x45a4ff)));}}else{_0x507662[_0x084a('0x138')](ami[_0x084a('0xb1')]({'action':'command','command':util[_0x084a('0x7e')](_0x084a('0x15b'),_0x1a5edd,!_[_0x084a('0x3e')](config[_0x084a('0x156')][_0x4660bc])?_0x4660bc:'')})[_0x084a('0xbb')](function(_0x575e73){return _0x575e73['content'][_0x084a('0x15c')](_0x084a('0x15d'))>=0x0;})[_0x084a('0xbe')](myreject(_0x45a4ff)));}BPromise['all'](_0x507662)[_0x084a('0xbb')](function(_0x427e25){var _0x116a52=_[_0x084a('0x15e')](_0x427e25);if(_0x116a52){return _0x1c65b9(_0x116a52);}else{_0x247bd3[_0x084a('0x3f')]=_0x474000?_0x084a('0x15f'):_0x084a('0x160');return _0x45a4ff(msgResponse('[ifTime][promiseAll]',_0x084a('0x153'),_0x084a('0x161')+_0x474000+'\x20'+_0x270cfc+_0x084a('0x162')+util['inspect'](_0x1a5edd,{'showHidden':![],'depth':null})+_0x084a('0x163')+_0x4660bc));}})[_0x084a('0xbe')](function(_0x220e5a){return _0x45a4ff(msgResponse('ifTime','Failure',JSON['stringify'](_0x220e5a)));});});};Dialer['prototype'][_0x084a('0x164')]=function(_0x2baa78){var _0x4dedb2=this;return function(){switch(_0x2baa78[_0x084a('0x5f')]){case _0x084a('0x165'):freeVariablesPredictive(_0x2baa78);_0x4dedb2[_0x084a('0x166')](_0x2baa78,0x1);break;case _0x084a('0x167'):freeVariablesPredictive(_0x2baa78);_0x4dedb2['handlePower'](_0x2baa78,_0x2baa78['dialPowerLevel']);break;case'predictive':_0x4dedb2[_0x084a('0x9')](_0x2baa78);break;case'booked':freeVariablesPredictive(_0x2baa78);_0x4dedb2[_0x084a('0x166')](_0x2baa78,0x1);break;default:freeVariablesPredictive(_0x2baa78);logger[_0x084a('0x9d')](_0x084a('0x168'),_0x2baa78[_0x084a('0x41')],_0x084a('0x169'));}};};Dialer[_0x084a('0x1c')][_0x084a('0x16a')]=function(_0x5a4607){var _0x478655=this;return function(){_0x478655[_0x084a('0x16b')](_0x5a4607);};};Dialer[_0x084a('0x1c')][_0x084a('0xb')]=function(_0x4ec5e5){var _0x1e13ac=this;if(isNotPreview(_0x4ec5e5[_0x084a('0x5f')])){if(isVoiceQueueOutbound(_0x4ec5e5[_0x084a('0x51')])&&isActive(_0x4ec5e5[_0x084a('0x16c')])){_0x4ec5e5[_0x084a('0xa5')]=!![];BPromise[_0x084a('0xba')]()['then'](checkIsLoggedIn(_0x4ec5e5,_0x4ec5e5[_0x084a('0x56')]))[_0x084a('0xbb')](checkIsActive(_0x4ec5e5,_0x4ec5e5[_0x084a('0x16c')]))[_0x084a('0xbb')](checkInterval(_0x4ec5e5))[_0x084a('0xbb')](_0x1e13ac[_0x084a('0x14c')](_0x4ec5e5))[_0x084a('0xbb')](_0x1e13ac['checkIfTime'](_0x4ec5e5[_0x084a('0x16d')],_0x4ec5e5[_0x084a('0x16e')],_0x4ec5e5[_0x084a('0x41')],_0x4ec5e5))[_0x084a('0xbb')](_0x1e13ac[_0x084a('0x152')](_0x4ec5e5['Interval'],_0x4ec5e5[_0x084a('0x16e')],_0x4ec5e5[_0x084a('0x41')],_0x4ec5e5))[_0x084a('0xbb')](_0x1e13ac[_0x084a('0x164')](_0x4ec5e5))['catch'](loggerCatchQueueSummary(_0x084a('0x16f'),_0x4ec5e5));}else{notSendMessagesQueue(_0x4ec5e5);}}else{freeVariablesPredictive(_0x4ec5e5);}};Dialer[_0x084a('0x1c')]['syncCampaigns']=function(){var _0x44bb67=this;var _0x2f1a4c;for(var _0x89e888 in this['campaigns']){if(typeof this['campaigns'][_0x89e888]!==_0x084a('0x9e')){_0x2f1a4c=this[_0x084a('0x22')][_0x89e888];if(isCampaignIvr(_0x2f1a4c[_0x084a('0x51')])&&isActive(_0x2f1a4c['active'])){_0x2f1a4c[_0x084a('0xa5')]=!![];BPromise[_0x084a('0xba')]()[_0x084a('0xbb')](checkIsActive(_0x2f1a4c,_0x2f1a4c[_0x084a('0x7c')]))[_0x084a('0xbb')](checkInterval(_0x2f1a4c))[_0x084a('0xbb')](_0x44bb67['checkIsTrunkReachable'](_0x2f1a4c))[_0x084a('0xbb')](_0x44bb67[_0x084a('0x150')](_0x2f1a4c[_0x084a('0x16d')],_0x2f1a4c[_0x084a('0x16e')],_0x2f1a4c[_0x084a('0x41')],_0x2f1a4c))[_0x084a('0xbb')](_0x44bb67[_0x084a('0x152')](_0x2f1a4c['Interval'],_0x2f1a4c['dialTimezone'],_0x2f1a4c[_0x084a('0x41')],_0x2f1a4c))['then'](_0x44bb67['launchHandleIvr'](_0x2f1a4c))[_0x084a('0xbe')](loggerCatchQueueSummary(_0x084a('0x170'),_0x2f1a4c));}else{notSendMessagesCampaign(_0x2f1a4c);}}}};function getCallerIdRandom(_0x3b55cc,_0x41647f){var _0x187b26;var _0x12d022;var _0x2dc406;if(_0x41647f<=0x0){_0x41647f=0x1;}_0x187b26=new RegExp(_0x084a('0x171')+_0x41647f+'}$');_0x12d022=Math[_0x084a('0x172')](0xa,_0x41647f-0x1);_0x2dc406=Math[_0x084a('0x172')](0xa,_0x41647f)-0x1;return util['format']('%s',_[_0x084a('0x173')](_0x3b55cc,_0x187b26,_[_0x084a('0x174')](_0x12d022,_0x2dc406)));}function extractCalleridName(_0x31d7cf){var _0x48488b=_0x31d7cf[_0x084a('0x175')](/"(.*?)"/);return _0x48488b?_0x48488b[0x1]:_0x31d7cf;}function extractCalleridNumber(_0x39d056){var _0x4e2c89=_0x39d056[_0x084a('0x175')](/<(.*?)>/);return _0x4e2c89?_0x4e2c89[0x1]:_0x39d056;}Dialer[_0x084a('0x1c')][_0x084a('0x176')]=function(_0x3e212c,_0x407768){var _0x1fc993=this;var _0x4563f0=uuid['v4']();this[_0x084a('0x27')][_0x4563f0]=new Action(_0x3e212c,_0x407768,_0x4563f0);return new BPromise(function(_0x1d2385,_0x3bbd19){if(_['isUndefined'](_0x3e212c)&&typeof _0x3e212c!==_0x084a('0x177')){return _0x3bbd19(msgResponse(_0x084a('0x178'),'Failure',_0x084a('0x179')));}if(_[_0x084a('0x3e')](_0x407768[_0x084a('0x17a')])||_0x407768[_0x084a('0x17a')]===null){return _0x3bbd19(msgResponse(_0x084a('0x178'),_0x084a('0x153'),_0x084a('0x17b')));}var _0x2c6ab8={'XMD-CALLERID':_0x1fc993[_0x084a('0x27')][_0x4563f0]['getCaller'](),'XMD-AGI':_0x3e212c[_0x084a('0x10f')]?util[_0x084a('0x7e')]('\x22agi://%s/square,%s\x22',ipAgi,_0x3e212c[_0x084a('0x10f')]):_0x084a('0x17c'),'XMD-AGIAFTER':_0x3e212c[_0x084a('0x117')]?util[_0x084a('0x7e')](_0x084a('0x17d'),ipAgi,_0x3e212c[_0x084a('0x117')]):'NONE','XMD-QUEUE':_0x3e212c[_0x084a('0x51')]==='outbound'?util[_0x084a('0x7e')](_0x084a('0x17e'),_0x3e212c[_0x084a('0x41')],_0x3e212c[_0x084a('0x17f')]||'',_0x3e212c['dialAgiAfterHangupAgent']?'c':'',_0x3e212c[_0x084a('0x121')]||0x3):_0x084a('0x17c'),'XMD-CONTACTID':_0x407768['ContactId'],'XMD-CDRTYPE':_0x084a('0x7'),'CALLERID(all)':_0x1fc993[_0x084a('0x27')][_0x4563f0][_0x084a('0x180')](),'XMD-AMD':_0x3e212c[_0x084a('0xe8')]?_0x084a('0x181'):'NONE','XMD-DESTINATION':_0x084a('0x182')};if(_0x3e212c[_0x084a('0xe8')]){_0x2c6ab8['XMD-AMDINITIALSILENCE']=_0x3e212c[_0x084a('0x183')]||0x9c4;_0x2c6ab8[_0x084a('0x184')]=_0x3e212c[_0x084a('0x185')]||0x5dc;_0x2c6ab8[_0x084a('0x186')]=_0x3e212c[_0x084a('0x187')]||0x320;_0x2c6ab8[_0x084a('0x188')]=_0x3e212c[_0x084a('0x189')]||0x1388;_0x2c6ab8[_0x084a('0x18a')]=_0x3e212c[_0x084a('0x18b')]||0x64;_0x2c6ab8[_0x084a('0x18c')]=_0x3e212c[_0x084a('0x18d')]||0x32;_0x2c6ab8[_0x084a('0x18e')]=_0x3e212c[_0x084a('0x18f')]||0x3;_0x2c6ab8[_0x084a('0x190')]=_0x3e212c[_0x084a('0x191')]||0x100;_0x2c6ab8[_0x084a('0x192')]=_0x3e212c['dialAMDMaximumWordLength']||0x1388;}if(_0x3e212c[_0x084a('0x51')]===_0x084a('0x52')){_0x2c6ab8[_0x084a('0x193')]=_0x407768[_0x084a('0x10b')];}else{_0x2c6ab8[_0x084a('0x194')]=_0x407768['CampaignId'];}for(var _0x3fc7ca in _0x407768['Contact']){if(typeof _0x407768[_0x084a('0x195')][_0x3fc7ca]!=='undefined'){if(isNotNull(_0x407768[_0x084a('0x195')][_0x3fc7ca])&&_0x3fc7ca!=='id'&&_0x3fc7ca!=='tags'&&_0x3fc7ca!==_0x084a('0x196')&&_0x3fc7ca!==_0x084a('0x197')){_0x2c6ab8[util[_0x084a('0x7e')](_0x084a('0x198'),'XMD-',_[_0x084a('0x199')](_0x3fc7ca))]=_0x407768[_0x084a('0x195')][_0x3fc7ca];}}}var _0x4c78dd=_0x1fc993[_0x084a('0xe1')](_0x3e212c[_0x084a('0x7b')])?getCallerId(_0x3e212c['Trunk'][_0x084a('0x7d')],_0x3e212c[_0x084a('0x60')],_0x3e212c[_0x084a('0x19a')]>0x0?getCallerIdRandom(_0x3e212c['dialOriginateCallerIdNumber'],_0x3e212c[_0x084a('0x19a')]):_0x3e212c['dialOriginateCallerIdNumber']):getCallerId(_['isNil'](_0x3e212c[_0x084a('0x14d')])?_0x3e212c[_0x084a('0x7b')][_0x084a('0x7d')]:_0x3e212c['TrunkBackup'][_0x084a('0x7d')],_0x3e212c[_0x084a('0x60')],_0x3e212c[_0x084a('0x19a')]>0x0?getCallerIdRandom(_0x3e212c['dialOriginateCallerIdNumber'],_0x3e212c[_0x084a('0x19a')]):_0x3e212c['dialOriginateCallerIdNumber']);if(_0x4c78dd){_0x2c6ab8['XMD-ORIGINATECALLERIDNAME']=_0x1fc993[_0x084a('0x27')][_0x4563f0]['originatecalleridname']=extractCalleridName(_0x4c78dd);_0x2c6ab8[_0x084a('0x19b')]=_0x407768[_0x084a('0x17a')];}return ami['Action']({'actionid':_0x4563f0,'action':_0x084a('0x178'),'channel':_0x1fc993[_0x084a('0xe1')](_0x3e212c[_0x084a('0x7b')])?util['format'](_0x084a('0x19c'),_0x3e212c[_0x084a('0x7b')]['name'],isNotNull(_0x3e212c[_0x084a('0x62')])?_0x3e212c[_0x084a('0x62')][_0x084a('0x19d')]()||'':'',_0x3e212c['dialCutDigit']>0x0?_0x407768[_0x084a('0x17a')][_0x084a('0x19e')](_0x3e212c['dialCutDigit']):_0x407768[_0x084a('0x17a')]):util[_0x084a('0x7e')](_0x084a('0x19c'),_['isNil'](_0x3e212c[_0x084a('0x14d')])?_0x3e212c[_0x084a('0x7b')][_0x084a('0x41')]:_0x3e212c['TrunkBackup'][_0x084a('0x41')],isNotNull(_0x3e212c['dialPrefix'])?_0x3e212c[_0x084a('0x62')]['trim']()||'':'',_0x3e212c[_0x084a('0x19f')]>0x0?_0x407768[_0x084a('0x17a')][_0x084a('0x19e')](_0x3e212c[_0x084a('0x19f')]):_0x407768[_0x084a('0x17a')]),'callerid':_0x4c78dd,'Exten':_0x084a('0x182'),'Context':_0x084a('0x1a0'),'Priority':'1','variable':_0x2c6ab8,'timeout':(_0x3e212c['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x4563f0})[_0x084a('0xbb')](function(_0x4656af){return _0x1d2385(_0x4656af);})['catch'](function(_0x5b7057){_0x3e212c[_0x084a('0x6a')]+=0x1;var _0x53973d=new History(_0x1fc993[_0x084a('0x27')][_0x4563f0]);logger[_0x084a('0x9d')](util[_0x084a('0x7e')](_0x084a('0x1a1'),JSON['stringify'](_0x5b7057)));_0x53973d[_0x084a('0xab')]=0xe;_0x53973d[_0x084a('0xac')]=_0x084a('0x1a2');_0x53973d[_0x084a('0x12b')]=moment()[_0x084a('0x7e')](_0x084a('0x104'));_0x53973d[_0x084a('0xad')]=_0x53973d[_0x084a('0x12b')];_0x1fc993[_0x084a('0xd4')](_0x53973d)[_0x084a('0xbe')](loggerCatch('[originate][error]'));_0x1fc993[_0x084a('0xd2')](_0x53973d)[_0x084a('0xbe')](loggerCatch(_0x084a('0x1a3')))[_0x084a('0x1f')](function(){delete _0x1fc993[_0x084a('0x27')][_0x4563f0];return _0x3bbd19(msgResponse(_0x084a('0x178'),_0x084a('0x4b'),'originate\x20action\x20Error'));});});});};Dialer[_0x084a('0x1c')]['syncOriginateResponse']=function(_0x5a70f6){var _0x50ec2a=this['actions'][_0x5a70f6[_0x084a('0x137')]];if(_0x50ec2a){delete this[_0x084a('0x27')][_0x5a70f6[_0x084a('0x137')]];_0x50ec2a[_0x084a('0x120')]=moment()[_0x084a('0x7e')](_0x084a('0x104'));var _0x5a3ec0=_0x50ec2a[_0x084a('0x51')]===_0x084a('0x80')?this[_0x084a('0x22')][_0x50ec2a[_0x084a('0xb5')]]:this[_0x084a('0x21')][_0x50ec2a[_0x084a('0x1a4')]()];if(!this['isSuccess'](_0x5a70f6[_0x084a('0x1a5')])){this[_0x084a('0xb7')](_0x5a3ec0);return this[_0x084a('0x1a6')](_0x50ec2a,_0x5a3ec0,_0x5a70f6)[_0x084a('0xbe')](loggerCatch(_0x084a('0x1a7')));}this[_0x084a('0x29')][_0x5a70f6['uniqueid']]=_0x50ec2a;}};Dialer['prototype'][_0x084a('0x1a8')]=function(_0x2f8de9,_0x764550,_0x2a42cb){var _0x1ebcca=new History(_0x764550);if(_0x1ebcca[_0x084a('0xf6')]+_0x1ebcca[_0x084a('0xf7')]+_0x1ebcca[_0x084a('0xf8')]+_0x1ebcca[_0x084a('0xf9')]+_0x1ebcca[_0x084a('0xfa')]+_0x1ebcca[_0x084a('0xfb')]+_0x1ebcca[_0x084a('0xf3')]+_0x1ebcca[_0x084a('0xfc')]>=_0x2a42cb[_0x084a('0x10a')]-0x1){return!![];}switch(_0x2f8de9){case 0x3:if(_0x1ebcca[_0x084a('0xf8')]>=_0x2a42cb[_0x084a('0x1a9')]-0x1){return!![];}this[_0x084a('0xc7')]({'active':![],'countnoanswerretry':_0x1ebcca['countnoanswerretry']+=0x1,'scheduledat':moment()[_0x084a('0x102')](_0x2a42cb[_0x084a('0x1aa')],_0x084a('0x103'))['format'](_0x084a('0x104')),'ContactId':_0x1ebcca['ContactId'],'ListId':_0x1ebcca['ListId'],'VoiceQueueId':_0x1ebcca['VoiceQueueId']||undefined,'CampaignId':_0x1ebcca[_0x084a('0xde')]||undefined})[_0x084a('0xbe')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x1ebcca[_0x084a('0xf6')]>=_0x2a42cb['dialBusyMaxRetry']-0x1){return!![];}this[_0x084a('0xc7')]({'active':![],'countbusyretry':_0x1ebcca[_0x084a('0xf6')]+=0x1,'scheduledat':moment()[_0x084a('0x102')](_0x2a42cb[_0x084a('0x1ab')],'minutes')[_0x084a('0x7e')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1ebcca[_0x084a('0xdc')],'ListId':_0x1ebcca[_0x084a('0xdd')],'VoiceQueueId':_0x1ebcca[_0x084a('0x10b')]||undefined,'CampaignId':_0x1ebcca[_0x084a('0xde')]||undefined})[_0x084a('0xbe')](loggerCatch(_0x084a('0x1ac')));break;case 0x8:if(_0x1ebcca[_0x084a('0xf7')]>=_0x2a42cb[_0x084a('0x1ad')]-0x1){return!![];}this[_0x084a('0xc7')]({'active':![],'countcongestionretry':_0x1ebcca[_0x084a('0xf7')]+=0x1,'scheduledat':moment()[_0x084a('0x102')](_0x2a42cb['dialCongestionRetryFrequency'],_0x084a('0x103'))[_0x084a('0x7e')](_0x084a('0x104')),'ContactId':_0x1ebcca[_0x084a('0xdc')],'ListId':_0x1ebcca[_0x084a('0xdd')],'VoiceQueueId':_0x1ebcca[_0x084a('0x10b')]||undefined,'CampaignId':_0x1ebcca[_0x084a('0xde')]||undefined})[_0x084a('0xbe')](loggerCatch(_0x084a('0x1ae')));break;case 0x0:if(_0x1ebcca[_0x084a('0xf9')]>=_0x2a42cb[_0x084a('0x1af')]-0x1){return!![];}else{this[_0x084a('0xc7')]({'active':![],'countnosuchnumberretry':_0x1ebcca[_0x084a('0xf9')]+=0x1,'scheduledat':moment()['add'](_0x2a42cb['dialNoSuchNumberRetryFrequency'],'minutes')['format'](_0x084a('0x104')),'ContactId':_0x1ebcca['ContactId'],'ListId':_0x1ebcca[_0x084a('0xdd')],'VoiceQueueId':_0x1ebcca[_0x084a('0x10b')]||undefined,'CampaignId':_0x1ebcca['CampaignId']||undefined})[_0x084a('0xbe')](loggerCatch(_0x084a('0x1b0')));}break;case 0xa:if(_0x1ebcca['countdropretry']>=_0x2a42cb[_0x084a('0x128')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countdropretry':_0x1ebcca[_0x084a('0xfa')]+=0x1,'scheduledat':moment()['add'](_0x2a42cb['dialDropRetryFrequency'],_0x084a('0x103'))[_0x084a('0x7e')](_0x084a('0x104')),'ContactId':_0x1ebcca[_0x084a('0xdc')],'ListId':_0x1ebcca['ListId'],'VoiceQueueId':_0x1ebcca[_0x084a('0x10b')]||undefined,'CampaignId':_0x1ebcca['CampaignId']||undefined})['catch'](loggerCatch(_0x084a('0x129')));break;case 0xb:if(_0x1ebcca[_0x084a('0xfb')]>=_0x2a42cb[_0x084a('0x132')]-0x1){return!![];}this[_0x084a('0xc7')]({'active':![],'countabandonedretry':_0x1ebcca['countabandonedretry']+=0x1,'scheduledat':moment()[_0x084a('0x102')](_0x2a42cb[_0x084a('0x131')],'minutes')[_0x084a('0x7e')](_0x084a('0x104')),'ContactId':_0x1ebcca[_0x084a('0xdc')],'ListId':_0x1ebcca[_0x084a('0xdd')],'VoiceQueueId':_0x1ebcca[_0x084a('0x10b')]||undefined,'CampaignId':_0x1ebcca[_0x084a('0xde')]||undefined})[_0x084a('0xbe')](loggerCatch(_0x084a('0x1b1')));break;case 0x13:if(_0x1ebcca[_0x084a('0xf3')]>=_0x2a42cb[_0x084a('0xff')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countmachineretry':_0x1ebcca['countmachineretry']+=0x1,'scheduledat':moment()['add'](_0x2a42cb[_0x084a('0x1b2')],_0x084a('0x103'))[_0x084a('0x7e')](_0x084a('0x104')),'ContactId':_0x1ebcca[_0x084a('0xdc')],'ListId':_0x1ebcca[_0x084a('0xdd')],'VoiceQueueId':_0x1ebcca[_0x084a('0x10b')]||undefined,'CampaignId':_0x1ebcca['CampaignId']||undefined})[_0x084a('0xbe')](loggerCatch(_0x084a('0x105')));break;case 0x14:if(_0x1ebcca[_0x084a('0xfc')]>=_0x2a42cb['dialAgentRejectMaxRetry']-0x1){return!![];}this[_0x084a('0xc7')]({'active':![],'countagentrejectretry':_0x1ebcca[_0x084a('0xfc')]+=0x1,'scheduledat':moment()[_0x084a('0x102')](_0x2a42cb[_0x084a('0x1b3')],_0x084a('0x103'))[_0x084a('0x7e')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1ebcca['ContactId'],'ListId':_0x1ebcca['ListId'],'VoiceQueueId':_0x1ebcca[_0x084a('0x10b')]||undefined,'CampaignId':_0x1ebcca[_0x084a('0xde')]||undefined})['catch'](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0x084a('0x1c')]['callProgressDetecting']=function(_0x4ea122,_0x22f435,_0x1cc588){var _0x5c5057=this;var _0x4a0c0b=new History(_0x4ea122);var _0xbebbb8=![];var _0x558af1;var _0x4c45a5;return new BPromise(function(_0x4d1f35,_0x4588fc){if(_[_0x084a('0x3e')](_0x22f435)&&typeof _0x22f435!==_0x084a('0x177')){return _0x4588fc(msgResponse('[callProgressDetecting]',_0x084a('0x153'),_0x084a('0x1b4')));}if(_[_0x084a('0x3e')](_0x1cc588)&&typeof _0x1cc588!=='object'){return _0x4588fc(msgResponse('[callProgressDetecting]',_0x084a('0x153'),_0x084a('0x1b5')));}_0x5c5057[_0x084a('0xc0')](_0x4a0c0b,_0x1cc588[_0x084a('0x114')],_0x22f435)[_0x084a('0xbb')](function(_0x23d4a5){if(_0x23d4a5['additional']==0x1)_0xbebbb8=!![];switch(_0x1cc588[_0x084a('0x114')]){case'0':_0x22f435[_0x084a('0x69')]+=0x1;_0x4a0c0b[_0x084a('0xab')]=0x0;_0x4a0c0b[_0x084a('0xac')]='NoSuchNumber';_0x4a0c0b['countnosuchnumberretry']+=0x1;_0x4a0c0b['countglobal']+=0x1;ami[_0x084a('0x50')](_0x084a('0x1b6'),ut['buildObj'](_0x4ea122,_0x084a('0x1b7')));_0x558af1=_0x22f435['dialNoSuchNumberRetryFrequency'];_0x4c45a5=_0x22f435[_0x084a('0x125')];_0x5c5057[_0x084a('0xd4')](_0x4a0c0b)[_0x084a('0xbe')](loggerCatch(_0x084a('0xf5')));if(_0x5c5057[_0x084a('0x1a8')](0x0,_0x4ea122,_0x22f435)&&!_0xbebbb8){if(_0x4a0c0b['countnosuchnumberretry']>=_0x22f435[_0x084a('0x1af')]){_0x5c5057[_0x084a('0x100')](_0x4a0c0b,_0x4d1f35,_0x4588fc,_0x084a('0x1b8'));}else{_0x5c5057['stateGlobal'](_0x4a0c0b,_0x4d1f35,_0x4588fc,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x22f435[_0x084a('0x68')]+=0x1;_0x4a0c0b[_0x084a('0xab')]=0x3;_0x4a0c0b[_0x084a('0xac')]='NoAnswer';_0x4a0c0b[_0x084a('0xf8')]+=0x1;_0x4a0c0b[_0x084a('0xf4')]+=0x1;ami[_0x084a('0x50')](_0x084a('0x1b9'),ut[_0x084a('0x109')](_0x4ea122,_0x084a('0x1ba')));_0x558af1=_0x22f435['dialNoAnswerRetryFrequency'];_0x4c45a5=_0x22f435[_0x084a('0x125')];_0x5c5057['createHistory'](_0x4a0c0b)[_0x084a('0xbe')](loggerCatch(_0x084a('0x1bb')));if(_0x5c5057[_0x084a('0x1a8')](0x3,_0x4ea122,_0x22f435)&&!_0xbebbb8){if(_0x4a0c0b[_0x084a('0xf8')]>=_0x22f435[_0x084a('0x1a9')]){_0x5c5057[_0x084a('0x100')](_0x4a0c0b,_0x4d1f35,_0x4588fc,_0x084a('0x1bc'));}else{_0x5c5057[_0x084a('0xfd')](_0x4a0c0b,_0x4d1f35,_0x4588fc,_0x084a('0x1bc'));}}break;case'5':_0x22f435[_0x084a('0x65')]+=0x1;_0x4a0c0b[_0x084a('0xab')]=0x5;_0x4a0c0b[_0x084a('0xac')]=_0x084a('0x1bd');_0x4a0c0b[_0x084a('0xf6')]+=0x1;_0x4a0c0b[_0x084a('0xf4')]+=0x1;ami[_0x084a('0x50')](_0x084a('0x1be'),ut['buildObj'](_0x4ea122,_0x084a('0x1bf')));_0x558af1=_0x22f435[_0x084a('0x1ab')];_0x4c45a5=_0x22f435['callAdditionalPhoneAfterMin'];_0x5c5057[_0x084a('0xd4')](_0x4a0c0b)['catch'](loggerCatch(_0x084a('0x1c0')));if(_0x5c5057[_0x084a('0x1a8')](0x5,_0x4ea122,_0x22f435)&&!_0xbebbb8){if(_0x4a0c0b[_0x084a('0xf6')]>=_0x22f435[_0x084a('0x1c1')]){_0x5c5057['createStateFinal'](_0x4a0c0b,_0x4d1f35,_0x4588fc,_0x084a('0x1c2'));}else{_0x5c5057['stateGlobal'](_0x4a0c0b,_0x4d1f35,_0x4588fc,_0x084a('0x1c2'));}}break;case'8':_0x22f435[_0x084a('0x1c3')]+=0x1;_0x4a0c0b[_0x084a('0xab')]=0x8;_0x4a0c0b[_0x084a('0xac')]=_0x084a('0x1c4');_0x4a0c0b['countcongestionretry']+=0x1;_0x4a0c0b[_0x084a('0xf4')]+=0x1;_0x558af1=_0x22f435[_0x084a('0x1c5')];_0x4c45a5=_0x22f435[_0x084a('0x125')];ami[_0x084a('0x50')](_0x084a('0x1c6'),ut[_0x084a('0x109')](_0x4ea122,_0x084a('0x1c7')));_0x5c5057[_0x084a('0xd4')](_0x4a0c0b)[_0x084a('0xbe')](loggerCatch(_0x084a('0x1c8')));if(_0x5c5057['checkRetriveMax'](0x8,_0x4ea122,_0x22f435)&&!_0xbebbb8){if(_0x4a0c0b[_0x084a('0xf7')]>=_0x22f435[_0x084a('0x1ad')]){_0x5c5057[_0x084a('0x100')](_0x4a0c0b,_0x4d1f35,_0x4588fc,_0x084a('0x1c9'));}else{_0x5c5057[_0x084a('0xfd')](_0x4a0c0b,_0x4d1f35,_0x4588fc,_0x084a('0x1c9'));}}break;case'11':_0x22f435[_0x084a('0x1ca')]+=0x1;_0x4a0c0b['state']=0xb;_0x4a0c0b['statedesc']=_0x084a('0x12f');_0x4a0c0b[_0x084a('0xfb')]+=0x1;_0x4a0c0b[_0x084a('0xf4')]+=0x1;_0x558af1=_0x22f435['dialAbandonedRetryFrequency'];_0x4c45a5=_0x22f435[_0x084a('0x125')];_0x5c5057[_0x084a('0xd4')](_0x4a0c0b)[_0x084a('0xbe')](loggerCatch(_0x084a('0x133')));if(_0x5c5057[_0x084a('0x1a8')](0xb,_0x4ea122,_0x22f435)&&!_0xbebbb8){if(_0x4a0c0b[_0x084a('0xfb')]>=_0x22f435[_0x084a('0x132')]){_0x5c5057[_0x084a('0x100')](_0x4a0c0b,_0x4d1f35,_0x4588fc,_0x084a('0x1cb'));}else{_0x5c5057[_0x084a('0xfd')](_0x4a0c0b,_0x4d1f35,_0x4588fc,_0x084a('0x1cb'));}}break;case'20':_0x22f435['outboundRejectCallsDay']+=0x1;_0x4a0c0b['state']=0x14;_0x4a0c0b[_0x084a('0xac')]='AgentReject';_0x4a0c0b[_0x084a('0xfc')]+=0x1;_0x4a0c0b[_0x084a('0xf4')]+=0x1;_0x558af1=_0x22f435[_0x084a('0x1b3')];_0x4c45a5=_0x22f435[_0x084a('0x125')];ami[_0x084a('0x50')](_0x084a('0x1cc'),ut[_0x084a('0x109')](_0x4ea122,_0x084a('0x1cd')));_0x5c5057['createHistory'](_0x4a0c0b)[_0x084a('0xbe')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x5c5057['checkRetriveMax'](0x14,_0x4ea122,_0x22f435)&&!_0xbebbb8){if(_0x4a0c0b['countagentrejectretry']>=_0x22f435[_0x084a('0x1ce')]){_0x5c5057[_0x084a('0x100')](_0x4a0c0b,_0x4d1f35,_0x4588fc,'reason\x2020\x20agentreject');}else{_0x5c5057[_0x084a('0xfd')](_0x4a0c0b,_0x4d1f35,_0x4588fc,_0x084a('0x1cf'));}}break;default:_0x22f435[_0x084a('0x6d')]+=0x1;_0x4a0c0b['state']=0xc;_0x4a0c0b[_0x084a('0xac')]=_0x1cc588[_0x084a('0x114')];_0x558af1=_0x22f435['dialAgentRejectRetryFrequency'];_0x4c45a5=_0x22f435[_0x084a('0x125')];_0x5c5057[_0x084a('0xd4')](_0x4a0c0b)[_0x084a('0xbe')](loggerCatch(_0x084a('0x1d0')));if(_0x5c5057[_0x084a('0x1a8')](_0x1cc588['reason'],_0x4ea122,_0x22f435)&&!_0xbebbb8){if(_0x4a0c0b[_0x084a('0xf6')]+_0x4a0c0b['countcongestionretry']+_0x4a0c0b['countnoanswerretry']+_0x4a0c0b[_0x084a('0xf9')]+_0x4a0c0b[_0x084a('0xfa')]+_0x4a0c0b[_0x084a('0xfb')]+_0x4a0c0b[_0x084a('0xf3')]+_0x4a0c0b['countagentrejectretry']>=_0x22f435[_0x084a('0x10a')]){_0x5c5057[_0x084a('0xfd')](_0x4a0c0b,_0x4d1f35,_0x4588fc,_0x1cc588[_0x084a('0x114')]);}else{_0x5c5057[_0x084a('0x100')](_0x4a0c0b,_0x4d1f35,_0x4588fc,_0x1cc588['reason']);}}}})['then'](function(_0x58e750){if(_0xbebbb8){_0x5c5057[_0x084a('0xc1')](_0x4a0c0b,_0x558af1,_0x4c45a5)[_0x084a('0xbb')](function(_0x5b4f6b){return _0x4d1f35(0x1);});}});});};Dialer[_0x084a('0x1c')][_0x084a('0xfd')]=function(_0x512757,_0xf69885,_0x5dae3d,_0x2a50b8){var _0x37f530=new Final(_0x512757);_0x37f530['state']=0xf;_0x37f530[_0x084a('0xac')]=_0x084a('0x1d1');this[_0x084a('0x100')](_0x37f530,_0xf69885,_0x5dae3d,_0x2a50b8);};Dialer[_0x084a('0x1c')][_0x084a('0x100')]=function(_0x10e95a,_0x4ee618,_0x561818,_0x5df7ea){this[_0x084a('0xd2')](_0x10e95a)[_0x084a('0xbb')](function(){return _0x4ee618(msgResponse(_0x084a('0x1d2'),_0x084a('0x1d3'),_0x5df7ea));})[_0x084a('0xbe')](function(){return _0x561818(msgResponse('[moveContactManagedDialer][0]',_0x084a('0x153'),'contact\x20not\x20moved'));});};Dialer['prototype'][_0x084a('0x9')]=function(_0x372331){var _0x9b1bad=_0x372331[_0x084a('0x1d4')]/0x64;var _0x418ee1=_0x372331['outboundDropCallsDayTimeout']/(_0x372331['outboundDropCallsDayTimeout']+_0x372331[_0x084a('0xeb')]);var _0x30aa72=Math[_0x084a('0x1d5')](_0x372331['predictiveIntervalAvailable']*(_0x372331[_0x084a('0x1d6')]/0x64));var _0x3cff50=Math[_0x084a('0x1d5')](_0x372331[_0x084a('0x75')]*(_0x372331['predictiveIntervalMinThreshold']/0x64));var _0x3d926d=_0x372331[_0x084a('0x55')]+_0x372331['talking'];var _0x302dc8=Math[_0x084a('0x1d7')](_0x372331[_0x084a('0x90')]*_0x372331[_0x084a('0x93')]*_0x372331[_0x084a('0x73')]*_0x372331['predictiveIntervalMultiplicativeFactor']);if(_[_0x084a('0x3e')](_0x372331[_0x084a('0x2b')])){if(!_[_0x084a('0x3e')](_0x372331[_0x084a('0x7a')])){_0x372331[_0x084a('0x7a')]=undefined;loggerPredictive[_0x084a('0x9d')]('[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine');}if(!_['isUndefined'](_0x372331['handlePredictive'])){loggerPredictive[_0x084a('0x9d')](_0x084a('0x1d8'),_0x084a('0x1d9'));clearInterval(_0x372331[_0x084a('0x97')]);_0x372331[_0x084a('0x97')]=undefined;}_0x372331[_0x084a('0x2b')]=moment()['format'](_0x084a('0x104'));loggerPredictive[_0x084a('0x83')](_0x372331['name'],_0x084a('0x1da'),_0x372331[_0x084a('0x2b')]);this['handlePower'](_0x372331,0x1);}else if(ifInterval(_0x372331[_0x084a('0x1db')],_0x372331[_0x084a('0x2b')])){this[_0x084a('0x166')](_0x372331,0x1);loggerPredictiveCalls['info']('[startMethodPredictive][StartProgressive][Loop]',_0x372331[_0x084a('0x2b')],_0x372331[_0x084a('0x41')]);_0x372331[_0x084a('0x90')]=0x0;_0x372331['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x9b1bad<_0x418ee1&&_0x372331['dialPredictiveOptimization']===_0x084a('0x1dc')){freeVariablesPredictive(_0x372331);loggerPredictive[_0x084a('0x83')](_0x084a('0x1dd'),_0x084a('0x1de'),_0x418ee1,'startProgressive',_0x372331[_0x084a('0x41')]);}else if(_0x302dc8<_0x372331['predictiveIntervalErlangCallsDroppedCalls']&&_0x372331[_0x084a('0x1df')]===_0x084a('0x1dc')){freeVariablesPredictive(_0x372331);loggerPredictive[_0x084a('0x83')](_0x084a('0x1e0'),'Max\x20Drop\x20',_0x302dc8,_0x084a('0x1e1'),_0x372331[_0x084a('0x72')],_0x084a('0x2b'),_0x372331[_0x084a('0x41')]);}else if(!ifInterval(_0x372331[_0x084a('0x1db')],_0x372331[_0x084a('0x2b')])&&_[_0x084a('0x3e')](_0x372331['startPredictive'])&&!_[_0x084a('0x3e')](_0x372331['startProgressive'])){_0x372331['startPredictive']=moment()[_0x084a('0x7e')](_0x084a('0x104'));loggerPredictive[_0x084a('0x83')](_0x372331['name'],'started\x20in\x20predictive\x20at',_0x372331[_0x084a('0x7a')]);this[_0x084a('0x1e2')](_0x372331[_0x084a('0x1db')])[_0x084a('0xbb')](this[_0x084a('0x1e3')](_0x372331))[_0x084a('0xbb')](mergeDataErlangB(_0x372331))['then'](this[_0x084a('0x1e4')](_0x372331))[_0x084a('0xbe')](loggerCatchPredictive(_0x084a('0x1e5'),_0x372331));}else if(!ifInterval(_0x372331['dialPredictiveInterval'],_0x372331[_0x084a('0x7a')])){_0x372331[_0x084a('0x72')]=0x0;_0x372331[_0x084a('0x7a')]=moment()['format'](_0x084a('0x104'));loggerPredictive[_0x084a('0x83')](_0x372331['name'],_0x084a('0x1e6'),_0x372331[_0x084a('0x7a')]);clearInterval(_0x372331['handlePredictive']);_0x372331[_0x084a('0x97')]=undefined;this[_0x084a('0x1e2')](_0x372331['dialPredictiveInterval'])[_0x084a('0xbb')](this['getDataPredictive'](_0x372331))['then'](mergeDataErlangB(_0x372331))[_0x084a('0xbb')](this[_0x084a('0x1e4')](_0x372331))[_0x084a('0xbe')](loggerCatchPredictive(_0x084a('0x1e7'),_0x372331));}else if(_0x372331[_0x084a('0x75')]&&_0x3d926d<_0x372331[_0x084a('0x75')]-_0x3cff50){freeVariablesPredictive(_0x372331);loggerPredictive[_0x084a('0x83')](_0x372331[_0x084a('0x41')],_0x084a('0x1e8'),_0x3d926d,')\x20are\x20less\x20than\x20threshold\x20(',_0x372331[_0x084a('0x75')],'-',_0x3cff50,'=',_0x372331[_0x084a('0x75')]-_0x3cff50,')');}else if(_0x372331[_0x084a('0x75')]&&_0x3d926d>_0x372331[_0x084a('0x75')]+_0x30aa72){freeVariablesPredictive(_0x372331);loggerPredictive[_0x084a('0x83')](_0x372331[_0x084a('0x41')],_0x084a('0x1e8'),_0x3d926d,')\x20are\x20more\x20than\x20threshold\x20(',_0x372331[_0x084a('0x75')],'+',_0x30aa72,'=',_0x372331['predictiveIntervalAvailable']+_0x30aa72,')');}};Dialer[_0x084a('0x1c')]['getDataPredictive']=function(_0x1f5ade){var _0x28d95d=this;return function(_0x34a8aa){return new BPromise(function(_0x4c3321,_0x8d14b4){_['merge'](_0x1f5ade,_0x34a8aa[0x0]);if(checkGetDataPredictive(_0x34a8aa[0x0])){var _0x5899c6=_0x1f5ade[_0x084a('0x75')]=_0x1f5ade[_0x084a('0x5a')]+_0x1f5ade[_0x084a('0x55')];var _0x431166=_0x1f5ade['dialPredictiveInterval']*0x3c;var _0x3ec5fc=_0x34a8aa[0x0][_0x084a('0x70')]+_0x34a8aa[0x0][_0x084a('0x6f')];var _0x581657=(_0x34a8aa[0x0][_0x084a('0x6e')]+_0x34a8aa[0x0][_0x084a('0x1e9')]+_0x34a8aa[0x0][_0x084a('0x89')])/_0x34a8aa[0x0][_0x084a('0x76')];_0x1f5ade['predictiveIntervalHitRate']=_0x581657>0x0?_0x581657:0x1;switch(_0x1f5ade[_0x084a('0x1df')]){case'dropRate':var _0x3d63ce=_0x1f5ade[_0x084a('0x1d4')]/0x64;return _0x28d95d['abandonmentRate'](_0x5899c6,_0x431166,_0x3ec5fc,_0x581657,_0x3d63ce)[_0x084a('0xbb')](function(_0x5f9f46){return _0x4c3321(_0x5f9f46);});case _0x084a('0x1ea'):var _0xe5054=_0x1f5ade['dialPredictiveOptimizationPercentage']/0x64;return _0x28d95d[_0x084a('0x1eb')](_0x5899c6,_0x431166,_0x3ec5fc,_0x581657,_0xe5054)['then'](function(_0x5ad594){return _0x4c3321(_0x5ad594);});default:return _0x8d14b4(msgResponse(_0x084a('0x1ec'),_0x084a('0x153'),_0x084a('0x1ed')));}}else{return _0x8d14b4(msgResponse(_0x084a('0x1ec'),_0x084a('0x153'),_0x084a('0x1ee')));}});};};Dialer[_0x084a('0x1c')][_0x084a('0x1ef')]=function(_0x5944e7){var _0x550f4a=this;return function(_0x2d3df7){return new BPromise(function(_0xbbfa5a,_0xfb1bc4){_['merge'](_0x5944e7,_0x2d3df7[0x0]);if(checkGetDataPredictive(_0x2d3df7[0x0])){loggerPredictive[_0x084a('0x83')](JSON[_0x084a('0x4c')](_0x2d3df7[0x0]));if(_0x5944e7[_0x084a('0x1df')]===_0x084a('0x1dc')){return _0x550f4a[_0x084a('0xd0')](_0x5944e7['id'])[_0x084a('0xbb')](function(_0x373861){var _0x46d51f=_0x5944e7[_0x084a('0x56')]-_0x373861[0x0][_0x084a('0x1f0')];var _0x29ff29=_0x5944e7[_0x084a('0x1db')]*0x3c;var _0x4eb972=_0x2d3df7[0x0]['predictiveIntervalAvgTalktime']+_0x2d3df7[0x0][_0x084a('0x6f')];var _0x540df3=(_0x2d3df7[0x0][_0x084a('0x6e')]+_0x2d3df7[0x0][_0x084a('0x1e9')]+_0x2d3df7[0x0][_0x084a('0x89')])/_0x2d3df7[0x0][_0x084a('0x76')];var _0x4f034=_0x5944e7[_0x084a('0x1d4')]/0x64;_0x5944e7[_0x084a('0x74')]=_0x373861[0x0][_0x084a('0x1f0')]||0x0;_0x5944e7[_0x084a('0x73')]=_0x540df3>0x0?_0x540df3:0x1;return _0x550f4a[_0x084a('0x1f1')](_0x46d51f,_0x29ff29,_0x4eb972,_0x540df3,_0x4f034);})[_0x084a('0xbb')](function(_0x52de64){return _0xbbfa5a(_0x52de64);})[_0x084a('0xbe')](function(_0x38b110){return _0xfb1bc4(msgResponse(_0x084a('0x1f2'),_0x084a('0x153'),JSON[_0x084a('0x4c')](_0x38b110)));});}if(_0x5944e7['dialPredictiveOptimization']===_0x084a('0x1ea')){return _0x550f4a['getVoiceQueueRtPauses'](_0x5944e7['id'])[_0x084a('0xbb')](function(_0x42140d){var _0x41b79e=_0x5944e7['loggedIn']-_0x42140d[0x0][_0x084a('0x1f0')];var _0x388a21=_0x5944e7[_0x084a('0x1db')]*0x3c;var _0x2fabb7=_0x2d3df7[0x0][_0x084a('0x70')]+_0x2d3df7[0x0][_0x084a('0x6f')];var _0xf115ae=(_0x2d3df7[0x0][_0x084a('0x6e')]+_0x2d3df7[0x0][_0x084a('0x1e9')]+_0x2d3df7[0x0][_0x084a('0x89')])/_0x2d3df7[0x0][_0x084a('0x76')];var _0x474c49=_0x5944e7[_0x084a('0x1d4')]/0x64;_0x5944e7['predictiveIntervalPauses']=_0x42140d[0x0][_0x084a('0x1f0')]||0x0;_0x5944e7[_0x084a('0x73')]=_0xf115ae>0x0?_0xf115ae:0x1;return _0x550f4a['busyFactor'](_0x41b79e,_0x388a21,_0x2fabb7,_0xf115ae,_0x474c49);})[_0x084a('0xbb')](function(_0x4ecd9e){return _0xbbfa5a(_0x4ecd9e);})['catch'](function(_0x2734c9){return _0xfb1bc4(msgResponse(_0x084a('0x1f2'),'Failure',JSON['stringify'](_0x2734c9)));});}}else{return _0xfb1bc4(msgResponse('[getDataPredictive]',_0x084a('0x153'),_0x084a('0x1ee')));}});};};Dialer['prototype'][_0x084a('0x1e4')]=function(_0x2abe78){var _0x5e25a3=this;return function(){var _0x1958a7=0x0;var _0x4ed50c=Math[_0x084a('0x1d7')](_0x2abe78['erlangCallToSecond']*0x3e8);if(_0x4ed50c>0x0){_0x4ed50c=_0x4ed50c<0x64?0x64:_0x4ed50c;loggerPredictive['info'](_0x2abe78[_0x084a('0x41')],_0x084a('0x1f3'),_0x4ed50c,_0x084a('0x4d'));_0x2abe78[_0x084a('0x97')]=setInterval(function(){_0x5e25a3[_0x084a('0x97')](_0x2abe78);loggerPredictiveCalls[_0x084a('0x83')](_0x084a('0x1f4'),_0x1958a7+=0x1);},_0x4ed50c);}else{loggerPredictive[_0x084a('0x83')](_0x2abe78['name'],_0x084a('0x1f5'));}};};Dialer[_0x084a('0x1c')]['checkContactBlack']=function(_0x3b0f94,_0x208a9a){var _0x2d1c9b=this;return function(_0x44b2d6){if(_[_0x084a('0x48')](_0x44b2d6)){if(_['isNil'](_0x208a9a[_0x084a('0x1f6')])||!_0x208a9a[_0x084a('0x1f7')]){if(_0x3b0f94['dialMethod']==='booked'){_0x3b0f94[_0x084a('0x13b')]=_[_0x084a('0x3e')](_0x3b0f94['queueStatusComplete'])?!![]:_0x3b0f94['queueStatusComplete'];var _0x20e797=uuid['v4']();_0x2d1c9b['actions'][_0x20e797]=new Action(_0x3b0f94,_0x208a9a,_0x20e797);loggerBooked['info'](_0x084a('0x1f8'),_0x20e797,_0x084a('0x1f9'),JSON[_0x084a('0x4c')](_0x3b0f94[_0x084a('0x13b')]),'Queue:\x20',_0x3b0f94[_0x084a('0x41')]);if(_0x3b0f94[_0x084a('0x13b')]){_0x3b0f94[_0x084a('0x13b')]=![];_0x2d1c9b['queueBooked'][_0x2d1c9b[_0x084a('0x27')][_0x20e797][_0x084a('0xb5')]]=[];ami[_0x084a('0xb1')]({'actionid':_0x20e797,'action':'queuestatus','queue':_0x3b0f94[_0x084a('0x41')]})[_0x084a('0xbe')](function(){_0x2d1c9b[_0x084a('0xb7')](_0x3b0f94);_0x2d1c9b[_0x084a('0xc7')]({'active':![],'ContactId':_0x2d1c9b[_0x084a('0x27')][_0x20e797][_0x084a('0xdc')],'ListId':_0x2d1c9b[_0x084a('0x27')][_0x20e797][_0x084a('0xdd')],'VoiceQueueId':_0x2d1c9b[_0x084a('0x27')][_0x20e797]['VoiceQueueId']||undefined,'CampaignId':_0x2d1c9b['actions'][_0x20e797]['CampaignId']||undefined})['catch'](loggerCatch(_0x084a('0x1fa')));delete _0x2d1c9b[_0x084a('0x27')][_0x20e797];});}else{loggerBooked[_0x084a('0x83')]('[booked][checkContactBlack][else]',JSON[_0x084a('0x4c')](_0x3b0f94[_0x084a('0x13b')]),'Queue:\x20',_0x3b0f94['name']);_0x2d1c9b[_0x084a('0xb7')](_0x3b0f94);_0x2d1c9b[_0x084a('0xc7')]({'active':![],'ContactId':_0x2d1c9b['actions'][_0x20e797]['ContactId'],'ListId':_0x2d1c9b[_0x084a('0x27')][_0x20e797]['ListId'],'VoiceQueueId':_0x2d1c9b['actions'][_0x20e797]['VoiceQueueId']||undefined,'CampaignId':_0x2d1c9b[_0x084a('0x27')][_0x20e797][_0x084a('0xde')]||undefined})[_0x084a('0xbe')](loggerCatch(_0x084a('0x1fa')));delete _0x2d1c9b[_0x084a('0x27')][_0x20e797];}}else{return _0x2d1c9b['actionOriginate'](_0x3b0f94,_0x208a9a);}}else{if(getDiff(_0x208a9a[_0x084a('0x1fb')])<_0x3b0f94[_0x084a('0x1fc')]*0x3c){if(_0x208a9a['Agent']&&!_0x208a9a[_0x084a('0x1fd')][_0x084a('0x1fe')]){_0x2d1c9b['preview'][_0x084a('0x13e')](_0x208a9a['id'])[_0x084a('0x1f')](function(){_0x2d1c9b[_0x084a('0xb7')](_0x3b0f94);});}else{_0x2d1c9b['unlockContact']({'active':![]},_0x208a9a['id'],0x1)[_0x084a('0x1f')](function(){_0x2d1c9b[_0x084a('0xb7')](_0x3b0f94);});}}else{_0x3b0f94[_0x084a('0x6b')]+=0x1;_0x2d1c9b[_0x084a('0xb7')](_0x3b0f94);if(_0x3b0f94[_0x084a('0x1ff')]){_0x2d1c9b[_0x084a('0xc7')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x208a9a[_0x084a('0xdc')],'ListId':_0x208a9a[_0x084a('0xdd')],'VoiceQueueId':_0x208a9a[_0x084a('0x10b')]||undefined,'CampaignId':_0x208a9a[_0x084a('0xde')]||undefined})[_0x084a('0xbe')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x2d1c9b[_0x084a('0xd4')](createObjHistory(_0x3b0f94,_0x208a9a,'RECALLINQUEUE',0x17,_0x084a('0x200')))[_0x084a('0xbe')](loggerCatch(_0x084a('0x201')));}else{_0x2d1c9b['saveInDb'](createObjHistory(_0x3b0f94,_0x208a9a,_0x084a('0x202'),0x16,_0x084a('0x203')),_0x084a('0x204'),'[Originate][HistoryRecallClose]');}}}}else{_0x3b0f94[_0x084a('0x64')]+=0x1;_0x2d1c9b[_0x084a('0xe4')](createObjHistory(_0x3b0f94,_0x208a9a,'BLACKLIST',0xd,'Blacklist'),_0x084a('0x205'),_0x084a('0x206'));throw _0x084a('0x207');}};};Dialer[_0x084a('0x1c')]['handleIvr']=function(_0x37b971){var _0x2760b2=this;var _0x5b6966=_0x37b971[_0x084a('0x208')]-_0x37b971[_0x084a('0x77')]-_0x37b971[_0x084a('0xcc')];emitCampaignSummary(_0x37b971);if(_0x5b6966>0x0){if(_0x5b6966>this[_0x084a('0x25')]){_0x5b6966=this['maxNumberOriginate'];}_0x37b971[_0x084a('0xcc')]+=_0x5b6966;this[_0x084a('0xce')](_0x37b971['id'],_0x5b6966,_0x37b971[_0x084a('0x209')],_0x37b971)[_0x084a('0xbb')](function(_0xbb1e06){_0x37b971['temp']-=_0x5b6966;_0x37b971['temp']=_0x37b971['temp']>0x0?_0x37b971[_0x084a('0xcc')]:0x0;if(!checkContactEmpty(_0xbb1e06)){_0x37b971[_0x084a('0x3f')]=_0x084a('0xa3');logger[_0x084a('0x83')](_0x084a('0x20a')+_0x37b971[_0x084a('0x41')]);}else{_0x37b971['originated']+=_0xbb1e06['length'];_0x37b971[_0x084a('0x3f')]=_0x084a('0x20b');for(var _0x159165=0x0;_0x159165<_0xbb1e06[_0x084a('0x20c')];_0x159165+=0x1){_0x37b971['ivrTotalCallsDays']+=0x1;if(_['isNil'](_0xbb1e06[_0x159165])||_[_0x084a('0xb0')](_0xbb1e06[_0x159165]['Contact'])||_['isNil'](_0xbb1e06[_0x159165][_0x084a('0x17a')])){_0x2760b2[_0x084a('0xd9')](_0x084a('0x20d'),_0x37b971,_0xbb1e06[_0x159165]);}else{_0x2760b2['checkIsBlackListIvr'](_[_0x084a('0xdb')](_0xbb1e06[_0x159165],[_0x084a('0xde'),_0x084a('0x20e')]))[_0x084a('0xbb')](_0x2760b2[_0x084a('0x20f')](_0x37b971,_0xbb1e06[_0x159165]))[_0x084a('0xbe')](_0x2760b2['loggerHandler']('[actionOriginateIvr]\x20',_0x37b971));}}}})[_0x084a('0xbe')](loggerGetContactDialer(_0x084a('0x210'),_0x37b971,_0x5b6966));}};Dialer[_0x084a('0x1c')][_0x084a('0x166')]=function(_0x46b263,_0x52b48c){var _0x53c908=this;var _0xdfee67=[];var _0x3bccc4=_0x52b48c>=0x1?_0x52b48c:0x1;if(_0x46b263[_0x084a('0x5f')]===_0x084a('0x8')){_0x3bccc4=0x1;}var _0x406565=Math[_0x084a('0x1d7')](_0x46b263[_0x084a('0x55')]*_0x3bccc4)-_0x46b263[_0x084a('0x77')]-_0x46b263[_0x084a('0xcc')];emitVoiceQueueSummary(_0x46b263);if(_0x46b263[_0x084a('0x211')]>0x0){var _0x359ca3=_0x46b263[_0x084a('0x211')]-_0x46b263[_0x084a('0x77')]-_0x46b263[_0x084a('0x5a')]-_0x46b263[_0x084a('0xcc')]-_0x46b263[_0x084a('0x57')];if(_0x406565>_0x359ca3){_0x406565=_0x359ca3;}}if(_0x406565>0x0){if(_0x46b263[_0x084a('0x5f')]===_0x084a('0x8')){_0x406565=0x1;}if(_0x406565>this[_0x084a('0x25')]){_0x406565=this[_0x084a('0x25')];}_0x46b263[_0x084a('0xcc')]+=_0x406565;for(var _0x41a08f in this['agents']){if(typeof this[_0x084a('0x23')][_0x41a08f]!=='undefined'){if(this[_0x084a('0x23')][_0x41a08f][_0x084a('0xab')]==='not_inuse'&&this[_0x084a('0x23')][_0x41a08f][_0x084a('0xb2')]===_0x084a('0xe3')){_0xdfee67[_0x084a('0x138')](this[_0x084a('0x23')][_0x41a08f]['id']);}}}this['getContactDialer'](_0x46b263['id'],_0xdfee67,_0x406565,_0x46b263[_0x084a('0x209')],_0x46b263)[_0x084a('0xbb')](function(_0x1aebb7){_0x46b263[_0x084a('0xcc')]-=_0x406565;_0x46b263['temp']=_0x46b263[_0x084a('0xcc')]>0x0?_0x46b263['temp']:0x0;if(!checkContactEmpty(_0x1aebb7)){_0x53c908['countReScheduled'](_0x46b263)[_0x084a('0xbb')](sendMessageReschedule(_0x46b263))[_0x084a('0xbe')](loggerCatch('[countReScheduled]\x20'));}else{_0x46b263[_0x084a('0x77')]+=_0x1aebb7['length'];_0x46b263[_0x084a('0x3f')]=_0x46b263['dialMethod']==='booked'?_0x084a('0x181'):'RUNNING';for(var _0x953f15=0x0;_0x953f15<_0x1aebb7[_0x084a('0x20c')];_0x953f15+=0x1){if(_['isNil'](_0x1aebb7[_0x953f15])||_[_0x084a('0xb0')](_0x1aebb7[_0x953f15][_0x084a('0x195')])||_[_0x084a('0xb0')](_0x1aebb7[_0x953f15]['phone'])){_0x53c908[_0x084a('0xd9')](_0x084a('0x20d'),_0x46b263,_0x1aebb7[_0x953f15]);}else{_0x53c908[_0x084a('0xbd')](_['pick'](_0x1aebb7[_0x953f15],[_0x084a('0x10b'),'Contact.phone']))[_0x084a('0xbb')](_0x53c908[_0x084a('0x20f')](_0x46b263,_0x1aebb7[_0x953f15]))[_0x084a('0xbe')](_0x53c908['loggerHandler'](_0x084a('0x20d'),_0x46b263));}}}})['catch'](loggerGetContactDialer(_0x084a('0x212'),_0x46b263,_0x406565));}};Dialer[_0x084a('0x1c')]['handlePredictive']=function(_0x36a19f){if(_0x36a19f[_0x084a('0x211')]>0x0){var _0x2c12b1=_0x36a19f[_0x084a('0x211')]-_0x36a19f[_0x084a('0x77')]-_0x36a19f[_0x084a('0x5a')];if(_0x2c12b1>0x0){this[_0x084a('0x213')](_0x36a19f);}else{loggerPredictiveCalls[_0x084a('0x83')](_0x084a('0x214'));}}else{this['tryOriginatePredictive'](_0x36a19f);}};Dialer[_0x084a('0x1c')][_0x084a('0x213')]=function(_0x2f04b9){var _0x28f7bf=this;var _0x37d7a8=[];_0x2f04b9[_0x084a('0x77')]+=0x1;for(var _0x449c9a in this[_0x084a('0x23')]){if(typeof this[_0x084a('0x23')][_0x449c9a]!==_0x084a('0x9e')){if(this[_0x084a('0x23')][_0x449c9a][_0x084a('0xab')]===_0x084a('0x215')&&this['agents'][_0x449c9a][_0x084a('0xb2')]===_0x084a('0xe3')){_0x37d7a8['push'](this['agents'][_0x449c9a]['id']);}}}this[_0x084a('0xcb')](_0x2f04b9['id'],_0x37d7a8,0x1,_0x2f04b9[_0x084a('0x209')],_0x2f04b9)[_0x084a('0xbb')](function(_0x69f674){if(!checkContactEmpty(_0x69f674)){checkContactLowerLimitOriginate(_0x2f04b9,0x1,0x0);_0x28f7bf[_0x084a('0xb9')](_0x2f04b9)[_0x084a('0xbb')](sendMessageReschedule(_0x2f04b9))[_0x084a('0xbe')](loggerCatch(_0x084a('0xbc')));}else{_0x2f04b9[_0x084a('0x3f')]='RUNNING';if(_['isNil'](_0x69f674[0x0])||_[_0x084a('0xb0')](_0x69f674[0x0][_0x084a('0x195')])||_['isNil'](_0x69f674[0x0][_0x084a('0x17a')])){_0x28f7bf[_0x084a('0xd9')](_0x084a('0x20d'),_0x2f04b9,_0x69f674[0x0]);}else{_0x28f7bf[_0x084a('0xbd')](_[_0x084a('0xdb')](_0x69f674[0x0],[_0x084a('0x10b'),'Contact.phone']))['then'](_0x28f7bf[_0x084a('0x20f')](_0x2f04b9,_0x69f674[0x0]))['catch'](_0x28f7bf[_0x084a('0xd8')](_0x084a('0x216'),_0x2f04b9));}}})['catch'](loggerGetContactDialer('[getContactDialerPredictive]',_0x2f04b9,0x1));emitVoiceQueueSummary(_0x2f04b9);};Dialer[_0x084a('0x1c')]['abandonmentRate']=function(_0x25b79a,_0x7fb8a4,_0x29c041,_0x56d63e,_0x169cf5,_0x2b886f){loggerPredictive[_0x084a('0x83')](_0x084a('0x217'));loggerPredictive[_0x084a('0x83')](_0x084a('0x218'),_0x25b79a);loggerPredictive[_0x084a('0x83')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x7fb8a4);loggerPredictive[_0x084a('0x83')](_0x084a('0x219'),_0x29c041);loggerPredictive[_0x084a('0x83')](_0x084a('0x21a'),_0x56d63e);loggerPredictive[_0x084a('0x83')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x169cf5);loggerPredictive[_0x084a('0x83')]('---------------------------');return new BPromise(function(_0x15f573,_0x21c464){if(_0x25b79a<=0x0||isNaN(_0x25b79a)){return _0x21c464(msgResponse(_0x084a('0x21b'),_0x084a('0x4b'),_0x084a('0x21c')+_0x25b79a));}if(_0x29c041<=0x0||isNaN(_0x29c041)){return _0x21c464(msgResponse('[abandonmentRate]',_0x084a('0x4b'),_0x084a('0x21d')+_0x29c041));}if(_0x56d63e<=0x0||isNaN(_0x56d63e)){return _0x21c464(msgResponse(_0x084a('0x21b'),_0x084a('0x4b'),'p\x20=\x20'+_0x56d63e));}if(_0x7fb8a4<=0x0||isNaN(_0x7fb8a4)){return _0x21c464(msgResponse('[abandonmentRate]',_0x084a('0x4b'),'interval\x20=\x20'+_0x7fb8a4));}if(_0x169cf5<=0x0||isNaN(_0x169cf5)){return _0x21c464(msgResponse('[abandonmentRate]','Error','Amax\x20=\x20'+_0x169cf5));}_0x2b886f=_0x2b886f||0x0;var _0x4e4250=0x1/_0x29c041;var _0x95dff0=0x0;var _0x5a8ab6=0x0;var _0x869c02=0x0;var _0x468b32=0x0;for(var _0x316ffe=0x0;_0x869c02<_0x169cf5;_0x316ffe+=0x1){_0x5a8ab6=_0x316ffe/_0x7fb8a4;_0x95dff0=(_0x56d63e*_0x5a8ab6+_0x2b886f)/_0x4e4250;_0x869c02=erlangb(_0x95dff0,_0x25b79a);_0x468b32=_0x95dff0/_0x25b79a*(0x1-erlangb(_0x95dff0,_0x25b79a));}return _0x15f573({'erlangCalls':_0x316ffe,'erlangCallToSecond':_0x7fb8a4/_0x316ffe,'erlangAbandonmentRate':_0x869c02,'erlangBusyFactor':_0x468b32});});};Dialer['prototype'][_0x084a('0x1eb')]=function(_0x53311a,_0x25e8b2,_0x3ab95e,_0xe55bcc,_0x219392,_0x38e76f){loggerPredictive[_0x084a('0x83')](_0x084a('0x21e'));loggerPredictive[_0x084a('0x83')](_0x084a('0x218'),_0x53311a);loggerPredictive[_0x084a('0x83')](_0x084a('0x21f'),_0x25e8b2);loggerPredictive[_0x084a('0x83')](_0x084a('0x219'),_0x3ab95e);loggerPredictive[_0x084a('0x83')](_0x084a('0x21a'),_0xe55bcc);loggerPredictive['info'](_0x084a('0x220'),_0x219392);loggerPredictive[_0x084a('0x83')](_0x084a('0x8b'));return new BPromise(function(_0x33c1f9,_0xe04024){if(_0x53311a<=0x0||isNaN(_0x53311a)){return _0xe04024(msgResponse(_0x084a('0x221'),'Error',_0x084a('0x21c')+_0x53311a));}if(_0x3ab95e<=0x0||isNaN(_0x3ab95e)){return _0xe04024(msgResponse(_0x084a('0x221'),_0x084a('0x4b'),_0x084a('0x21d')+_0x3ab95e));}if(_0xe55bcc<=0x0||isNaN(_0xe55bcc)){return _0xe04024(msgResponse(_0x084a('0x221'),_0x084a('0x4b'),_0x084a('0x222')+_0xe55bcc));}if(_0x25e8b2<=0x0||isNaN(_0x25e8b2)){return _0xe04024(msgResponse(_0x084a('0x221'),'Error',_0x084a('0x223')+_0x25e8b2));}if(_0x219392<=0x0||isNaN(_0x219392)){return _0xe04024(msgResponse(_0x084a('0x221'),'Error',_0x084a('0x224')+_0x219392));}_0x38e76f=_0x38e76f||0x0;var _0x296770=0x1/_0x3ab95e;var _0x3e15a2=0x0;var _0x471d41=0x0;var _0x1f57dd=0x0;var _0x1c176d=0x0;for(var _0x3015d3=0x0;_0x1c176d<_0x219392;_0x3015d3+=0x1){_0x471d41=_0x3015d3/_0x25e8b2;_0x3e15a2=(_0xe55bcc*_0x471d41+_0x38e76f)/_0x296770;_0x1f57dd=erlangb(_0x3e15a2,_0x53311a);_0x1c176d=_0x3e15a2/_0x53311a*(0x1-erlangb(_0x3e15a2,_0x53311a));}return _0x33c1f9({'erlangCalls':_0x3015d3,'erlangCallToSecond':_0x25e8b2/_0x3015d3,'erlangAbandonmentRate':_0x1f57dd,'erlangBusyFactor':_0x1c176d});});};module[_0x084a('0x225')]=Dialer;