5a3f8886751c0f43cbbf55b75d542ece9dfba214
[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 _0xc56b=['iftime\x20%s,%s','some','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','power','dialPowerLevel','Queue','launchHandleIvr','handleIvr','loggedIn','dialGlobalInterval','dialTimezone','checkIsTrunkReachable','[syncCampaigns]','\x5cw{0,','pow','replace','match','object','voiceQueue\x20is\x20undefine','phone','Contact','originate','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','getCaller','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','updatedAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','dialPrefix','dialCutDigit','substring','SIP/%s/%s%s','trim','from-sip','OriginateError','[originate][error]','originate\x20action\x20Error','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAbandonedRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','dialNoSuchNumberMaxRetry','outboundNoAnswerCallsDay','NoAnswer','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','predictiveIntervalMaxThreshold','round','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','predictiveIntervalErlangCallsDroppedCalls','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','dialPredictiveInterval','getDataPredictive','startMethodPredictive','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','dialPredictiveOptimizationPercentage','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','Agent','voicePause','log','Contact\x20updated','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','temp','dialOrderByScheduledAt','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','[handlePredictive][limitChannel]','tryOriginatePredictive','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','interval\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','[busyFactor]','p\x20=\x20','Umin\x20=\x20','exports','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/environment/','../../../config/logger','booked','predictive','predictiveCalls','syncQueueSummary','../ami','defaults','redis','localhost','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','roundrobin','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','startPredictive','startProgressive','ivrOriginated','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','hangup','syncHangup','newexten','syncVarSet','queuemember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Interval','isEmpty','Intervals','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','emit','outbound','strategy','answered','available','pTalking','sumDuration','sumHoldTime','talking','total','type','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','info','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\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','clearing\x20variable\x20start\x20progressive','handlePredictive','string','\x22%s\x22\x20<%s>','inspect','error','stack','hasOwnProperty','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','contacts','sendMessageOneNotActive','NOT_ACTIVE','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','starttime','loopClearZombieChannels','clearZombieChannels','[actions]','isNil','Action','status','channel','catch','queue','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','updateOriginated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','pick','ContactId','ListId','[emptyContact]','isSuccess','Success','isTrunkReachable','SIP/%s','reachable','unmonitored','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','value','HangupInAMD','membername','AMD','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','dialAMDActive','countmachineretry','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','VoiceQueueId','[rescheduleContact][Machine]','HANGUP','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','Machine','countglobal','amd','countnoanswerretry','dialGlobalMaxRetry','stateGlobal','CampaignId','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','AnswerAGI','dialQueueProject','Unknow','syncAgentComplete','reason','agent','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','dialQueueTimeout','outboundDropCallsDayTimeout','dropreason','TIMEOUT','agiafterat','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','Drop','calleridname','calleridnum','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','actionid','locked','paused','stateinterface','rrmemory','queueBooked','push','idHopper','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','queueStatusComplete','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','syncCampaigns','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','length','command','timezones','content','indexOf','true'];(function(_0x3cdbec,_0x45eba3){var _0x1894a3=function(_0x613575){while(--_0x613575){_0x3cdbec['push'](_0x3cdbec['shift']());}};_0x1894a3(++_0x45eba3);}(_0xc56b,0xd0));var _0xbc56=function(_0x14e8b8,_0x2f7af7){_0x14e8b8=_0x14e8b8-0x0;var _0x2e136b=_0xc56b[_0x14e8b8];return _0x2e136b;};'use strict';var util=require('util');var _=require(_0xbc56('0x0'));var BPromise=require(_0xbc56('0x1'));var uuid=require(_0xbc56('0x2'));var moment=require(_0xbc56('0x3'));var rr=require('rr');var md5=require(_0xbc56('0x4'));var Redis=require(_0xbc56('0x5'));var ut=require('../preview/util/util');var config=require(_0xbc56('0x6'));var logger=require(_0xbc56('0x7'))('dialer');var loggerBooked=require(_0xbc56('0x7'))(_0xbc56('0x8'));var loggerPredictive=require('../../../config/logger')(_0xbc56('0x9'));var loggerPredictiveCalls=require(_0xbc56('0x7'))(_0xbc56('0xa'));var loggerSyncQueueSummary=require(_0xbc56('0x7'))(_0xbc56('0xb'));var ami=require(_0xbc56('0xc'));config['redis']=_[_0xbc56('0xd')](config[_0xbc56('0xe')],{'host':_0xbc56('0xf'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0xbc56('0x10'));var voiceQueueRt=require(_0xbc56('0x11'));var Action=require(_0xbc56('0x12'));var History=require(_0xbc56('0x13'));var Final=require(_0xbc56('0x14'));var AgentComplete=require(_0xbc56('0x15'));var QueueCallerAbandon=require(_0xbc56('0x16'));var Hangup=require(_0xbc56('0x17'));var ipAgi=process[_0xbc56('0x18')][_0xbc56('0x19')]||_0xbc56('0x1a');var strategy={'rrmemory':'rrmemory','roundrobin':_0xbc56('0x1b')};var Sequence=function(){};Sequence[_0xbc56('0x1c')][_0xbc56('0x1d')]=function(_0x746270){this[_0xbc56('0x1e')]=this[_0xbc56('0x1e')]?this[_0xbc56('0x1e')][_0xbc56('0x1f')](_0x746270):_0x746270();};function Dialer(_0x412ed9,_0xf69bb3){this[_0xbc56('0x20')]=new Sequence();this[_0xbc56('0x21')]=_0xf69bb3;this[_0xbc56('0x22')]=_0x412ed9[_0xbc56('0x22')];this[_0xbc56('0x23')]=_0x412ed9[_0xbc56('0x23')];this['agents']=_0x412ed9[_0xbc56('0x24')];this['trunks']=_0x412ed9[_0xbc56('0x25')];this[_0xbc56('0x26')]=config[_0xbc56('0x26')]||0x2;this[_0xbc56('0x27')]={};this[_0xbc56('0x28')]={};this[_0xbc56('0x29')]={};this[_0xbc56('0x2a')]={};this['optionPredictive']={};this[_0xbc56('0x2b')]={};this[_0xbc56('0x2c')]={};this[_0xbc56('0x2d')]={};this['queueBooked']={};this['queueBookedRR']={};ami['on']('agentconnect',this[_0xbc56('0x2e')][_0xbc56('0x2f')](this));ami['on'](_0xbc56('0x30'),this[_0xbc56('0x31')][_0xbc56('0x2f')](this));ami['on'](_0xbc56('0x32'),this[_0xbc56('0x33')][_0xbc56('0x2f')](this));ami['on'](_0xbc56('0x34'),this['syncAgentComplete'][_0xbc56('0x2f')](this));ami['on']('custom:queuesummary',this[_0xbc56('0xb')]['bind'](this));ami['on'](_0xbc56('0x35'),this[_0xbc56('0x36')]['bind'](this));ami['on'](_0xbc56('0x37'),this['syncNewExten'][_0xbc56('0x2f')](this));ami['on']('varset',this[_0xbc56('0x38')][_0xbc56('0x2f')](this));ami['on'](_0xbc56('0x39'),this['syncQueueMember'][_0xbc56('0x2f')](this));ami['on'](_0xbc56('0x3a'),this[_0xbc56('0x3b')][_0xbc56('0x2f')](this));this[_0xbc56('0x3c')]();this['loopClearZombieChannels']();}function isNotNull(_0x5963f7){return _0x5963f7!==null&&!_[_0xbc56('0x3d')](_0x5963f7);}function checkIsLoggedIn(_0x33540e,_0x4433e3){return function(){if(_0x4433e3<=0x0){_0x33540e[_0xbc56('0x3e')]=_0xbc56('0x3f');throw _0x33540e[_0xbc56('0x40')]+_0xbc56('0x41');}};}function isActive(_0x5ba377){return _0x5ba377;}function checkIsActive(_0x876ede,_0x43bb71){return function(){if(!isActive(_0x43bb71)){_0x876ede[_0xbc56('0x3e')]='NOT_ACTIVE';throw _0x876ede[_0xbc56('0x40')]+'\x20NOT\x20Active';}};}function checkInterval(_0x39d19f){return function(){if(!isNotNull(_0x39d19f['Interval'])){_0x39d19f[_0xbc56('0x3e')]=_0xbc56('0x42');throw _0x39d19f[_0xbc56('0x40')]+_0xbc56('0x43');}if(!isNotNull(_0x39d19f[_0xbc56('0x44')]['Intervals'])){_0x39d19f[_0xbc56('0x3e')]=_0xbc56('0x42');throw _0x39d19f[_0xbc56('0x40')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0xbc56('0x45')](_0x39d19f[_0xbc56('0x44')][_0xbc56('0x46')]))){_0x39d19f['message']=_0xbc56('0x42');throw _0x39d19f[_0xbc56('0x40')]+_0xbc56('0x43');}};}function msgResponse(_0x9b0fd1,_0x1a4c89,_0x20ee9c){return{'action':_0x9b0fd1,'response':_0x1a4c89,'message':_0x20ee9c,'stack':_0x20ee9c};}function myreject(_0x22b0fd){return function(_0x1d4af2){return _0x22b0fd(msgResponse(_0xbc56('0x47'),_0xbc56('0x48'),JSON[_0xbc56('0x49')](_0x1d4af2)));};}function getSeconds(_0x173ccc,_0x240f25){var _0x45dadd=moment(_0x173ccc)[_0xbc56('0x4a')](0x0);var _0xff6a3=moment(_0x240f25)[_0xbc56('0x4a')](0x0);return _0x45dadd[_0xbc56('0x4b')](_0xff6a3,_0xbc56('0x4c'));}function emit(_0x131003,_0x30387a,_0x2652e1){io['to'](_0x131003)[_0xbc56('0x4d')](_0x30387a,_0x2652e1);}function emitVoiceQueueSummary(_0x529bd7){if(_0x529bd7['type']===_0xbc56('0x4e')){var _0x6e0601={'id':_0x529bd7['id'],'name':_0x529bd7[_0xbc56('0x40')],'strategy':_0x529bd7[_0xbc56('0x4f')],'answered':_0x529bd7[_0xbc56('0x50')],'available':_0x529bd7[_0xbc56('0x51')],'loggedIn':_0x529bd7['loggedIn'],'pTalking':_0x529bd7[_0xbc56('0x52')],'sumBillable':_0x529bd7['sumBillable'],'sumDuration':_0x529bd7[_0xbc56('0x53')],'sumHoldTime':_0x529bd7[_0xbc56('0x54')]||0x0,'talking':_0x529bd7[_0xbc56('0x55')],'total':_0x529bd7[_0xbc56('0x56')],'type':_0x529bd7[_0xbc56('0x57')],'unmanaged':_0x529bd7[_0xbc56('0x58')],'abandoned':_0x529bd7[_0xbc56('0x59')],'waiting':_0x529bd7[_0xbc56('0x5a')],'loggedInDb':_0x529bd7[_0xbc56('0x5b')],'dialActive':_0x529bd7[_0xbc56('0x5c')],'dialMethod':_0x529bd7[_0xbc56('0x5d')],'dialOriginateCallerIdName':_0x529bd7[_0xbc56('0x5e')],'dialOriginateCallerIdNumber':_0x529bd7[_0xbc56('0x5f')],'dialOriginateTimeout':_0x529bd7[_0xbc56('0x60')],'dialPrefix':_0x529bd7['dialPrefix'],'outboundAnswerAgiCallsDay':_0x529bd7[_0xbc56('0x61')],'outboundAnswerCallsDay':_0x529bd7[_0xbc56('0x62')],'outboundBlacklistCallsDay':_0x529bd7['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x529bd7[_0xbc56('0x63')],'outboundCongestionCallsDay':_0x529bd7[_0xbc56('0x64')],'outboundDropCallsDayACS':_0x529bd7['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x529bd7[_0xbc56('0x65')],'outboundDropCallsDayTimeout':_0x529bd7['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x529bd7['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x529bd7[_0xbc56('0x66')],'outboundOriginateFailureCallsDay':_0x529bd7[_0xbc56('0x67')],'outboundReCallsDay':_0x529bd7[_0xbc56('0x68')],'outboundRejectCallsDay':_0x529bd7['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x529bd7[_0xbc56('0x69')],'predictiveIntervalAnsweredCalls':_0x529bd7[_0xbc56('0x6a')],'predictiveIntervalAvgHoldtime':_0x529bd7[_0xbc56('0x6b')],'predictiveIntervalAvgTalktime':_0x529bd7[_0xbc56('0x6c')],'predictiveIntervalDroppedCallsCallersExit':_0x529bd7[_0xbc56('0x6d')],'predictiveIntervalDroppedCallsTimeout':_0x529bd7[_0xbc56('0x6e')],'predictiveIntervalErlangCalls':_0x529bd7[_0xbc56('0x6f')],'predictiveIntervalErlangCallsDroppedCalls':_0x529bd7['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x529bd7[_0xbc56('0x70')],'predictiveIntervalMultiplicativeFactor':_0x529bd7[_0xbc56('0x71')],'predictiveIntervalPauses':_0x529bd7[_0xbc56('0x72')],'predictiveIntervalAvailable':_0x529bd7[_0xbc56('0x73')],'predictiveIntervalTotalCalls':_0x529bd7[_0xbc56('0x74')],'message':_0x529bd7[_0xbc56('0x3e')],'originated':_0x529bd7[_0xbc56('0x75')],'erlangCalls':_0x529bd7[_0xbc56('0x76')],'erlangCallToSecond':_0x529bd7['erlangCallToSecond'],'erlangAbandonmentRate':_0x529bd7[_0xbc56('0x77')],'erlangBusyFactor':_0x529bd7[_0xbc56('0x78')],'startPredictive':_0x529bd7[_0xbc56('0x2b')],'startProgressive':_0x529bd7[_0xbc56('0x2c')]};if(_0x529bd7[_0xbc56('0x79')]){_0x6e0601[_0xbc56('0x79')]={'id':_0x529bd7['Trunk']['id'],'name':_0x529bd7[_0xbc56('0x79')][_0xbc56('0x40')],'active':_0x529bd7['Trunk'][_0xbc56('0x7a')],'callerid':_0x529bd7[_0xbc56('0x79')][_0xbc56('0x7b')]};}if(_0x529bd7['Interval']){_0x6e0601[_0xbc56('0x44')]={'id':_0x529bd7[_0xbc56('0x44')]['id'],'name':_0x529bd7[_0xbc56('0x44')][_0xbc56('0x40')]};}var _0x5928c7=md5(JSON[_0xbc56('0x49')](_0x6e0601));if(_0x529bd7[_0xbc56('0x4')]!==_0x5928c7){_0x529bd7[_0xbc56('0x4')]=_0x5928c7;emit(util[_0xbc56('0x7c')](_0xbc56('0x7d'),_0x6e0601['name']),_0xbc56('0x7e'),_0x6e0601);}}}function emitCampaignSummary(_0xfe2a76){if(_0xfe2a76[_0xbc56('0x57')]===_0xbc56('0x7f')){emit(util[_0xbc56('0x7c')](_0xbc56('0x80'),_0xfe2a76[_0xbc56('0x40')]),_0xbc56('0x81'),_0xfe2a76);}}function checkGetDataPredictive(_0xb0ad04){if(isNotNull(_0xb0ad04)){if(!_[_0xbc56('0x45')](_0xb0ad04)){loggerPredictive[_0xbc56('0x82')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0xbc56('0x82')](_0xbc56('0x83'),_0xb0ad04[_0xbc56('0x74')]);loggerPredictive[_0xbc56('0x82')](_0xbc56('0x84'),_0xb0ad04[_0xbc56('0x6a')]);loggerPredictive[_0xbc56('0x82')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xb0ad04[_0xbc56('0x6e')]);loggerPredictive['info'](_0xbc56('0x85'),_0xb0ad04[_0xbc56('0x6d')]);loggerPredictive['info'](_0xbc56('0x86'),_0xb0ad04['predictiveIntervalAvgHoldtime']);loggerPredictive[_0xbc56('0x82')](_0xbc56('0x87'),_0xb0ad04[_0xbc56('0x6c')]);loggerPredictive[_0xbc56('0x82')](_0xbc56('0x88'));if(_0xb0ad04[_0xbc56('0x74')]>0x0){if(!_[_0xbc56('0x3d')](_0xb0ad04['predictiveIntervalAvgTalktime'])&&_0xb0ad04[_0xbc56('0x6c')]>0x0){return!![];}else{loggerPredictive[_0xbc56('0x82')](_0xbc56('0x89'));}if(!_['isUndefined'](_0xb0ad04[_0xbc56('0x6b')])&&_0xb0ad04['predictiveIntervalAvgHoldtime']>0x0){return!![];}else{loggerPredictive[_0xbc56('0x82')](_0xbc56('0x8a'));}}else{loggerPredictive['info'](_0xbc56('0x8b'));}}else{loggerPredictive['info'](_0xbc56('0x8c'));}}else{loggerPredictive[_0xbc56('0x82')](_0xbc56('0x8c'));}return![];}function mergeDataErlangB(_0x19135e){return function(_0xfebd62){loggerPredictive[_0xbc56('0x82')](_0xbc56('0x8d'));loggerPredictive['info'](_0xbc56('0x8e'),_0xfebd62[_0xbc56('0x76')]);loggerPredictive[_0xbc56('0x82')](_0xbc56('0x8f'),_0xfebd62[_0xbc56('0x90')]);loggerPredictive[_0xbc56('0x82')](_0xbc56('0x91'),_0xfebd62[_0xbc56('0x77')]);loggerPredictive['info'](_0xbc56('0x92'),_0xfebd62[_0xbc56('0x78')]);loggerPredictive[_0xbc56('0x82')](_0xbc56('0x91'),_0xfebd62[_0xbc56('0x77')]);loggerPredictive[_0xbc56('0x82')](_0xbc56('0x88'));_[_0xbc56('0x93')](_0x19135e,_0xfebd62);};}function getDiff(_0x557ffc){var _0xb138d7=moment()['milliseconds'](0x0);var _0x5865a5=moment(_0x557ffc)[_0xbc56('0x4a')](0x0);return _0xb138d7[_0xbc56('0x4b')](_0x5865a5,'seconds');}function ifInterval(_0x55c5ef,_0x3457b8){if(_[_0xbc56('0x3d')](_0x3457b8)){return![];}if(getDiff(_0x3457b8)<_0x55c5ef*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x129936){if(isNotNull(_0x129936)){if(!_[_0xbc56('0x3d')](_0x129936[_0xbc56('0x2c')])){_0x129936[_0xbc56('0x2c')]=undefined;loggerPredictive[_0xbc56('0x82')](_0x129936['name'],_0xbc56('0x94'));}if(!_['isUndefined'](_0x129936[_0xbc56('0x2b')])){_0x129936[_0xbc56('0x2b')]=undefined;loggerPredictive[_0xbc56('0x82')](_0x129936['name'],'clearing\x20variable\x20start\x20predictive');}if(!_[_0xbc56('0x3d')](_0x129936[_0xbc56('0x95')])){clearInterval(_0x129936[_0xbc56('0x95')]);_0x129936[_0xbc56('0x95')]=undefined;loggerPredictive[_0xbc56('0x82')](_0x129936[_0xbc56('0x40')],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0x1716c8,_0x2011e9){if(_0x2011e9===0x0){return 0x0;}var _0x4685e5=0x1;for(var _0x5b5fcf=0x1;_0x5b5fcf<=_0x2011e9;_0x5b5fcf+=0x1){_0x4685e5=0x1+_0x4685e5*_0x5b5fcf/_0x1716c8;}return 0x1/_0x4685e5;}function isVoiceQueueOutbound(_0x1027c9){return _0x1027c9===_0xbc56('0x4e');}function isNotPreview(_0x468b27){return _0x468b27!==_0xbc56('0x21');}function isCampaignIvr(_0x35e3d4){return _0x35e3d4===_0xbc56('0x7f');}function getCallerId(_0x13324e,_0x3c70ad,_0x399344){if(!_[_0xbc56('0x3d')](_0x399344)&&_0xbc56('0x96')===typeof _0x399344&&!_['isEmpty'](_0x399344)){if(!_[_0xbc56('0x3d')](_0x3c70ad)&&_0xbc56('0x96')===typeof _0x3c70ad&&!_[_0xbc56('0x45')](_0x3c70ad)){return util[_0xbc56('0x7c')](_0xbc56('0x97'),_0x3c70ad,_0x399344);}return util['format'](_0xbc56('0x97'),_0x399344,_0x399344);}if(!_[_0xbc56('0x3d')](_0x13324e)&&'string'===typeof _0x13324e&&!_[_0xbc56('0x45')](_0x13324e)){return _0x13324e;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x261925,_0x43694f){return function(_0x2d65d4){freeVariablesPredictive(_0x43694f);emitVoiceQueueSummary(_0x43694f);emitCampaignSummary(_0x43694f);loggerSyncQueueSummary['error'](_0x261925,util[_0xbc56('0x98')](_0x2d65d4,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x3a9a20,_0x540210){return function(_0x32bec5){loggerPredictive[_0xbc56('0x99')](_0x540210[_0xbc56('0x40')],_0x3a9a20);loggerPredictive[_0xbc56('0x99')](_0x32bec5[_0xbc56('0x9a')]);freeVariablesPredictive(_0x540210);};}function loggerCatch(_0x2ae0b8){return function(_0x38c191){logger[_0xbc56('0x99')](_0x2ae0b8,util[_0xbc56('0x98')](_0x38c191,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x154a52){return _0x154a52&&!_['isUndefined'](_0x154a52)&&_0x154a52['length']>0x0;}function decremetOriginate(_0xbc2cc7){if(!_['isUndefined'](_0xbc2cc7)&&_0xbc2cc7!==null){if(_0xbc2cc7[_0xbc56('0x9b')]('originated')){if(_0xbc2cc7['originated']>0x0){_0xbc2cc7[_0xbc56('0x75')]-=0x1;}else{logger[_0xbc56('0x99')](_0xbc56('0x9c'));}}}else{logger[_0xbc56('0x99')](_0xbc56('0x9d'));}}function checkContactLowerLimitOriginate(_0x389353,_0x1ebba1,_0x1a4c38){if(_0x1ebba1>_0x1a4c38){for(var _0x3766d0=0x0;_0x3766d0<_0x1ebba1-_0x1a4c38;_0x3766d0+=0x1){decremetOriginate(_0x389353);}}}function loggerGetContactDialer(_0x3e59ef,_0x3efc10,_0x484322){return function(_0x535ba8){checkContactLowerLimitOriginate(_0x3efc10,_0x484322,0x0);logger[_0xbc56('0x99')](_0x3e59ef,util[_0xbc56('0x98')](_0x535ba8,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x2c87bb){return function(_0x1422c5){if(isNotNull(_0x1422c5)&&isNotNull(_0x1422c5[0x0])){if(_0x1422c5[0x0][_0xbc56('0x9e')]>0x0){_0x2c87bb[_0xbc56('0x3e')]=_0xbc56('0x9f');logger[_0xbc56('0x82')]('[getContactDialer2][ReScheduled]'+_0x2c87bb['name'],_0x1422c5[0x0][_0xbc56('0x9e')],_0xbc56('0xa0'));}else{_0x2c87bb[_0xbc56('0x3e')]='AVAILABLE_CONTACTS_FINISHED';logger[_0xbc56('0x82')]('[getContactDialer2][Empty]'+_0x2c87bb[_0xbc56('0x40')]);}}};}function notSendMessagesQueue(_0x52e83b){if(_0x52e83b['sendMessageOneNotActive']){freeVariablesPredictive(_0x52e83b);if(_0x52e83b[_0xbc56('0x75')]===0x0&&_0x52e83b['talking']===0x0&&_0x52e83b['waiting']===0x0&&(_0x52e83b[_0xbc56('0x52')]||0x0)===0x0){_0x52e83b[_0xbc56('0xa1')]=![];_0x52e83b[_0xbc56('0x51')]=0x0;_0x52e83b['message']=_0xbc56('0xa2');loggerSyncQueueSummary[_0xbc56('0x99')](_0xbc56('0xa3'),_0x52e83b['name'],_0xbc56('0xa4'));}else{_0x52e83b['message']=_0xbc56('0xa5');loggerSyncQueueSummary[_0xbc56('0x99')](_0xbc56('0xa3'),_0x52e83b[_0xbc56('0x40')],_0xbc56('0xa6'));}emitVoiceQueueSummary(_0x52e83b);}}function notSendMessagesCampaign(_0x586c49){if(_0x586c49[_0xbc56('0xa1')]){if(_0x586c49['originated']===0x0){_0x586c49['sendMessageOneNotActive']=![];_0x586c49['message']=_0xbc56('0xa2');loggerSyncQueueSummary[_0xbc56('0x99')](_0xbc56('0xa7'),_0x586c49[_0xbc56('0x40')],_0xbc56('0xa4'));}else{_0x586c49[_0xbc56('0x3e')]=_0xbc56('0xa5');loggerSyncQueueSummary[_0xbc56('0x99')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x586c49['name'],_0xbc56('0xa6'));}emitCampaignSummary(_0x586c49);}}function createObjHistory(_0x518677,_0x5ba4f6,_0x55bf71,_0x22cdec,_0x619889){_0x518677[_0xbc56('0x3e')]=_0x55bf71;var _0x56f8ac=new Action(_0x518677,_0x5ba4f6);var _0x896914=new History(_0x56f8ac);_0x896914[_0xbc56('0xa8')]=_0x22cdec;_0x896914[_0xbc56('0xa9')]=_0x619889;_0x896914[_0xbc56('0xaa')]=_0x56f8ac[_0xbc56('0xab')];return _0x896914;}Dialer['prototype'][_0xbc56('0xac')]=function(){var _0x315d1f=this;setInterval(function(){_0x315d1f[_0xbc56('0xad')](_0x315d1f[_0xbc56('0x2a')],'[uniqueid]');_0x315d1f[_0xbc56('0xad')](_0x315d1f[_0xbc56('0x28')],_0xbc56('0xae'));},0x32c8);};Dialer[_0xbc56('0x1c')][_0xbc56('0xad')]=function(_0x19cb61,_0x175c52){var _0x513c8c=this;for(var _0x196cb7 in _0x19cb61){if(_0x19cb61[_0xbc56('0x9b')](_0x196cb7)){this[_0xbc56('0x20')][_0xbc56('0x1d')](function(){if(!_[_0xbc56('0xaf')](_0x19cb61[_0x196cb7])){return ami[_0xbc56('0xb0')]({'action':_0xbc56('0xb1'),'channel':_0x19cb61[_0x196cb7][_0xbc56('0xb2')]})[_0xbc56('0xb3')](function(_0x398b38){if(_0x398b38[_0xbc56('0x3e')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x19cb61[_0x196cb7]&&_0x19cb61[_0x196cb7][_0xbc56('0x57')]!==_0xbc56('0x7f')){_0x513c8c['updateOriginated'](_0x513c8c[_0xbc56('0x22')][_0x19cb61[_0x196cb7][_0xbc56('0xb4')]]);logger['error']('[Dialer][checkChannel]',_0x175c52,_0x196cb7,_0x19cb61[_0x196cb7][_0xbc56('0xb4')]);delete _0x19cb61[_0x196cb7];}if(_0x19cb61[_0x196cb7]&&_0x19cb61[_0x196cb7]['type']===_0xbc56('0x7f')){_0x513c8c['updateOriginated'](_0x513c8c[_0xbc56('0x23')][_0x19cb61[_0x196cb7]['queue']]);logger[_0xbc56('0x99')](_0xbc56('0xb5'),_0x175c52,_0x196cb7,_0x19cb61[_0x196cb7][_0xbc56('0xb4')]);delete _0x19cb61[_0x196cb7];}},0x2328);}});}});}}};Dialer[_0xbc56('0x1c')][_0xbc56('0xb6')]=function(_0x869831){return BPromise[_0xbc56('0xb7')]()[_0xbc56('0xb8')](cmHopper[_0xbc56('0xb6')](_0x869831))[_0xbc56('0xb3')](loggerCatch(_0xbc56('0xb9')));};Dialer[_0xbc56('0x1c')][_0xbc56('0xba')]=function(_0x135e76){return BPromise[_0xbc56('0xb7')]()[_0xbc56('0xb8')](cmHopperBlack['checkIsBlackList'](_0x135e76))[_0xbc56('0xb3')](loggerCatch(_0xbc56('0xbb')));};Dialer[_0xbc56('0x1c')][_0xbc56('0xbc')]=function(_0x5f55c5){return BPromise[_0xbc56('0xb7')]()[_0xbc56('0xb8')](cmHopperBlack[_0xbc56('0xbc')](_0x5f55c5))['catch'](loggerCatch(_0xbc56('0xbd')));};Dialer[_0xbc56('0x1c')][_0xbc56('0xbe')]=function(_0x14205e){return BPromise['resolve']()[_0xbc56('0xb8')](cmHopperHistory[_0xbc56('0xbf')](_0x14205e))[_0xbc56('0xb3')](loggerCatch(_0xbc56('0xc0')));};Dialer['prototype']['rescheduleContact']=function(_0x41a404){return BPromise[_0xbc56('0xb7')]()[_0xbc56('0xb8')](cmHopper[_0xbc56('0xc1')](_0x41a404))[_0xbc56('0xb3')](loggerCatch(_0xbc56('0xc2')));};Dialer[_0xbc56('0x1c')][_0xbc56('0xc3')]=function(_0x3be37e,_0x1e4f9e,_0x590493){return BPromise['resolve']()[_0xbc56('0xb8')](cmHopper[_0xbc56('0xc3')](_0x3be37e,_0x1e4f9e,_0x590493))['catch'](loggerCatch(_0xbc56('0xc4')));};Dialer[_0xbc56('0x1c')][_0xbc56('0xc5')]=function(_0x11a35b,_0x862ce1,_0x24352b,_0x5e90e5){return BPromise[_0xbc56('0xb7')]()[_0xbc56('0xb8')](cmHopper['getContactDialer'](_0x11a35b,_0x862ce1,_0x24352b,_0x5e90e5))[_0xbc56('0xb3')](loggerCatch(_0xbc56('0xc6')));};Dialer['prototype']['getContactDialerIvr']=function(_0x866577,_0x2f2b59,_0x4fec31){return BPromise[_0xbc56('0xb7')]()[_0xbc56('0xb8')](cmHopper[_0xbc56('0xc7')](_0x866577,_0x2f2b59,_0x4fec31))[_0xbc56('0xb3')](loggerCatch(_0xbc56('0xc6')));};Dialer[_0xbc56('0x1c')][_0xbc56('0xc8')]=function(_0x23f4e5){return BPromise[_0xbc56('0xb7')]()[_0xbc56('0xb8')](voiceQueueRt[_0xbc56('0xc8')](_0x23f4e5))[_0xbc56('0xb3')](loggerCatch(_0xbc56('0xc9')));};Dialer[_0xbc56('0x1c')][_0xbc56('0xca')]=function(_0x4de0c7){return BPromise[_0xbc56('0xb7')]()[_0xbc56('0xb8')](cmHopper['moveContactManagedDialer'](_0x4de0c7))[_0xbc56('0xb3')](loggerCatch(_0xbc56('0xcb')));};Dialer['prototype'][_0xbc56('0xcc')]=function(_0x4b6830){return BPromise[_0xbc56('0xb7')]()[_0xbc56('0xb8')](cmHopperHistory[_0xbc56('0xcc')](_0x4b6830))[_0xbc56('0xb3')](loggerCatch(_0xbc56('0xcd')));};Dialer['prototype'][_0xbc56('0xce')]=function(_0x87465a){if(!_[_0xbc56('0x3d')](_0x87465a)&&_0x87465a!==null){if(_0x87465a[_0xbc56('0x9b')](_0xbc56('0x75'))){if(_0x87465a['originated']>0x0){_0x87465a['originated']-=0x1;}else{logger['error'](_0xbc56('0xcf'));}}}else{logger['error'](_0xbc56('0xd0'));}};Dialer[_0xbc56('0x1c')][_0xbc56('0xd1')]=function(_0x2d6262,_0x371aad){var _0x1ddf60=this;return function(_0x15b0f8){_0x1ddf60['updateOriginated'](_0x371aad);logger[_0xbc56('0x99')](_0x2d6262,util[_0xbc56('0x98')](_0x15b0f8,{'showHidden':![],'depth':null}));};};Dialer[_0xbc56('0x1c')][_0xbc56('0xd2')]=function(_0x1cf9c5,_0x27da2f,_0x3dc238){var _0x2add9a={'state':0x19,'statedesc':_0xbc56('0xd3')};this[_0xbc56('0xce')](_0x27da2f);this[_0xbc56('0xd4')](_[_0xbc56('0x93')](_0x2add9a,_[_0xbc56('0xd5')](_0x3dc238,[_0xbc56('0xd6'),_0xbc56('0xd7'),'UserId','VoiceQueueId','CampaignId'])),'[emptyContact][createHistory]',_0xbc56('0xd8'));logger[_0xbc56('0x99')](_0x1cf9c5);};Dialer['prototype'][_0xbc56('0xd9')]=function(_0x445beb){return _0x445beb===_0xbc56('0xda');};Dialer[_0xbc56('0x1c')][_0xbc56('0xdb')]=function(_0x3122c6){return!_[_0xbc56('0x3d')](_0x3122c6)&&_0x3122c6&&!_[_0xbc56('0x3d')](_0x3122c6[_0xbc56('0x40')])&&!_[_0xbc56('0x3d')](_0x3122c6['active'])&&_0x3122c6['active']&&(this['trunks'][util[_0xbc56('0x7c')](_0xbc56('0xdc'),_0x3122c6[_0xbc56('0x40')])][_0xbc56('0xb1')]===_0xbc56('0xdd')||this[_0xbc56('0x25')][util[_0xbc56('0x7c')](_0xbc56('0xdc'),_0x3122c6['name'])][_0xbc56('0xb1')]===_0xbc56('0xde'));};Dialer[_0xbc56('0x1c')][_0xbc56('0xd4')]=function(_0x184b19,_0x1b8e03,_0x363591){this[_0xbc56('0xcc')](_0x184b19)[_0xbc56('0xb3')](loggerCatch(_0x1b8e03));this['moveContactManagedDialer'](_0x184b19)[_0xbc56('0xb3')](loggerCatch(_0x363591));};Dialer[_0xbc56('0x1c')][_0xbc56('0x38')]=function(_0x2aba1f){var _0x45106c=this[_0xbc56('0x2a')][_0x2aba1f[_0xbc56('0xdf')]];var _0x5f1948;if(!_[_0xbc56('0xaf')](_0x2aba1f)&&!_[_0xbc56('0xaf')](_0x2aba1f['variable'])&&!_['isNil'](_0x2aba1f[_0xbc56('0xe0')][_0xbc56('0xe1')])&&_0x2aba1f[_0xbc56('0xe2')]===_0xbc56('0xe3')&&_0x45106c){if(_0x45106c['type']!==_0xbc56('0x7f')&&this['voiceQueues'][_0x45106c[_0xbc56('0xb4')]]['dialAMDActive']&&_0x2aba1f[_0xbc56('0xe4')]==='HANGUP'){delete this[_0xbc56('0x2a')][_0x2aba1f[_0xbc56('0xdf')]];this[_0xbc56('0xce')](this[_0xbc56('0x22')][_0x45106c[_0xbc56('0xb4')]]);this[_0xbc56('0x22')][_0x45106c['queue']][_0xbc56('0x62')]+=0x1;this[_0xbc56('0x22')][_0x45106c[_0xbc56('0xb4')]][_0xbc56('0x61')]+=0x1;_0x5f1948=new Hangup(_0x45106c,_0x2aba1f);_0x5f1948['state']=0x12;_0x5f1948[_0xbc56('0xa9')]=_0xbc56('0xe5');_0x5f1948[_0xbc56('0xe6')]=_0xbc56('0xe7');this[_0xbc56('0xd4')](_0x5f1948,_0xbc56('0xe8'),_0xbc56('0xe9'));}if(_0x45106c[_0xbc56('0x57')]!==_0xbc56('0x7f')&&this['voiceQueues'][_0x45106c[_0xbc56('0xb4')]][_0xbc56('0xea')]&&_0x2aba1f[_0xbc56('0xe4')]==='MACHINE'){var _0x430bad=this;return new BPromise(function(_0x1945c9,_0x5b11be){delete _0x430bad[_0xbc56('0x2a')][_0x2aba1f[_0xbc56('0xdf')]];_0x430bad['updateOriginated'](_0x430bad[_0xbc56('0x22')][_0x45106c[_0xbc56('0xb4')]]);_0x430bad['voiceQueues'][_0x45106c[_0xbc56('0xb4')]][_0xbc56('0x62')]+=0x1;_0x430bad[_0xbc56('0x22')][_0x45106c[_0xbc56('0xb4')]][_0xbc56('0x61')]+=0x1;var _0x57e2eb=_0x430bad[_0xbc56('0x22')][_0x45106c[_0xbc56('0xb4')]];var _0x582b70=new Hangup(_0x45106c,_0x2aba1f);_0x582b70[_0xbc56('0xa8')]=0x13;_0x582b70[_0xbc56('0xa9')]='Machine';_0x582b70[_0xbc56('0xe6')]=_0xbc56('0xe7');_0x582b70[_0xbc56('0xeb')]+=0x1;_0x582b70['countglobal']+=0x1;_0x582b70['amd']=!![];_0x430bad[_0xbc56('0xcc')](_0x582b70)[_0xbc56('0xb3')](loggerCatch(_0xbc56('0xec')));if(_0x582b70[_0xbc56('0xed')]+_0x582b70[_0xbc56('0xee')]+_0x582b70['countnoanswerretry']+_0x582b70[_0xbc56('0xef')]+_0x582b70[_0xbc56('0xf0')]+_0x582b70[_0xbc56('0xf1')]+_0x582b70[_0xbc56('0xeb')]+_0x582b70[_0xbc56('0xf2')]>=_0x57e2eb['dialGlobalMaxRetry']){_0x430bad['stateGlobal'](_0x582b70,_0x1945c9,_0x5b11be,_0xbc56('0xf3'));}else{if(_0x582b70[_0xbc56('0xeb')]>=_0x57e2eb[_0xbc56('0xf4')]){_0x430bad[_0xbc56('0xf5')](_0x582b70,_0x1945c9,_0x5b11be,_0xbc56('0xf6'));}else{_0x430bad[_0xbc56('0xc1')]({'active':![],'countmachineretry':_0x582b70[_0xbc56('0xeb')],'scheduledat':moment()[_0xbc56('0xf7')](_0x57e2eb[_0xbc56('0xf8')],_0xbc56('0xf9'))['format'](_0xbc56('0xfa')),'ContactId':_0x582b70['ContactId'],'ListId':_0x582b70[_0xbc56('0xd7')],'VoiceQueueId':_0x582b70[_0xbc56('0xfb')]||undefined,'CampaignId':_0x582b70['CampaignId']||undefined})['catch'](loggerCatch(_0xbc56('0xfc')));_0x1945c9({'reschedule':0x1});}}});}if(_0x45106c[_0xbc56('0x57')]===_0xbc56('0x7f')&&this[_0xbc56('0x23')][_0x45106c[_0xbc56('0xb4')]]['dialAMDActive']&&_0x2aba1f[_0xbc56('0xe4')]===_0xbc56('0xfd')){delete this[_0xbc56('0x2a')][_0x2aba1f['uniqueid']];this[_0xbc56('0xce')](this['campaigns'][_0x45106c[_0xbc56('0xb4')]]);_0x5f1948=new Hangup(_0x45106c,_0x2aba1f);_0x5f1948[_0xbc56('0xa8')]=0x12;_0x5f1948['statedesc']='HangupInAMD';_0x5f1948[_0xbc56('0xe6')]='AMD';this['saveInDb'](_0x5f1948,_0xbc56('0xfe'),_0xbc56('0xff'));}if(_0x45106c['type']===_0xbc56('0x7f')&&this[_0xbc56('0x23')][_0x45106c[_0xbc56('0xb4')]]['dialAMDActive']&&_0x2aba1f['value']===_0xbc56('0x100')){var _0x430bad=this;return new BPromise(function(_0x56f690,_0x4c1c65){delete _0x430bad[_0xbc56('0x2a')][_0x2aba1f[_0xbc56('0xdf')]];_0x430bad[_0xbc56('0xce')](_0x430bad[_0xbc56('0x23')][_0x45106c['queue']]);_0x430bad[_0xbc56('0x23')][_0x45106c[_0xbc56('0xb4')]]['outboundAnswerCallsDay']+=0x1;_0x430bad[_0xbc56('0x23')][_0x45106c['queue']]['outboundAnswerAgiCallsDay']+=0x1;var _0x4bd3d8=_0x430bad[_0xbc56('0x23')][_0x45106c[_0xbc56('0xb4')]];var _0x3f1f6c=new Hangup(_0x45106c,_0x2aba1f);_0x3f1f6c[_0xbc56('0xa8')]=0x13;_0x3f1f6c['statedesc']=_0xbc56('0x101');_0x3f1f6c[_0xbc56('0xe6')]=_0xbc56('0xe7');_0x3f1f6c[_0xbc56('0xeb')]+=0x1;_0x3f1f6c[_0xbc56('0x102')]+=0x1;_0x3f1f6c[_0xbc56('0x103')]=!![];_0x430bad[_0xbc56('0xcc')](_0x3f1f6c)[_0xbc56('0xb3')](loggerCatch(_0xbc56('0xec')));if(_0x3f1f6c[_0xbc56('0xed')]+_0x3f1f6c['countcongestionretry']+_0x3f1f6c[_0xbc56('0x104')]+_0x3f1f6c[_0xbc56('0xef')]+_0x3f1f6c[_0xbc56('0xf0')]+_0x3f1f6c[_0xbc56('0xf1')]+_0x3f1f6c[_0xbc56('0xeb')]+_0x3f1f6c[_0xbc56('0xf2')]>=_0x4bd3d8[_0xbc56('0x105')]){_0x430bad[_0xbc56('0x106')](_0x3f1f6c,_0x56f690,_0x4c1c65,_0xbc56('0xf3'));}else{if(_0x3f1f6c[_0xbc56('0xeb')]>=_0x4bd3d8[_0xbc56('0xf4')]){_0x430bad[_0xbc56('0xf5')](_0x3f1f6c,_0x56f690,_0x4c1c65,_0xbc56('0xf6'));}else{_0x430bad['rescheduleContact']({'active':![],'countmachineretry':_0x3f1f6c[_0xbc56('0xeb')],'scheduledat':moment()[_0xbc56('0xf7')](_0x4bd3d8[_0xbc56('0xf8')],_0xbc56('0xf9'))[_0xbc56('0x7c')](_0xbc56('0xfa')),'ContactId':_0x3f1f6c['ContactId'],'ListId':_0x3f1f6c[_0xbc56('0xd7')],'VoiceQueueId':_0x3f1f6c[_0xbc56('0xfb')]||undefined,'CampaignId':_0x3f1f6c[_0xbc56('0x107')]||undefined})[_0xbc56('0xb3')](loggerCatch(_0xbc56('0xfc')));_0x56f690({'reschedule':0x1});}}});}}};Dialer['prototype'][_0xbc56('0x36')]=function(_0x53569e){var _0x11eef5=this[_0xbc56('0x2a')][_0x53569e[_0xbc56('0xdf')]];var _0x94fb47=this;var _0x4ec0d0;if(_0x11eef5&&_0x11eef5[_0xbc56('0x57')]===_0xbc56('0x7f')){delete this['uniqueId'][_0x53569e[_0xbc56('0xdf')]];this[_0xbc56('0xce')](this[_0xbc56('0x23')][_0x11eef5['queue']]);this['campaigns'][_0x11eef5[_0xbc56('0xb4')]][_0xbc56('0x108')]+=0x1;_0x4ec0d0=new Hangup(_0x11eef5,_0x53569e);this[_0xbc56('0xcc')](_0x4ec0d0)[_0xbc56('0xb3')](loggerCatch(_0xbc56('0x109')));this['moveContactManagedDialer'](_0x4ec0d0)['catch'](loggerCatch(_0xbc56('0x10a')));}if(_0x11eef5&&_0x11eef5[_0xbc56('0x57')]!==_0xbc56('0x7f')&&isNotNull(this['voiceQueues'][_0x11eef5[_0xbc56('0xb4')]]['dialQueueProject'])){delete this[_0xbc56('0x2a')][_0x53569e[_0xbc56('0xdf')]];this['updateOriginated'](this['voiceQueues'][_0x11eef5[_0xbc56('0xb4')]]);this['voiceQueues'][_0x11eef5[_0xbc56('0xb4')]][_0xbc56('0x62')]+=0x1;this['voiceQueues'][_0x11eef5[_0xbc56('0xb4')]]['outboundAnswerAgiCallsDay']+=0x1;_0x4ec0d0=new Hangup(_0x11eef5,_0x53569e);_0x4ec0d0['state']=0x10;_0x4ec0d0[_0xbc56('0xa9')]=_0xbc56('0x10b');_0x4ec0d0[_0xbc56('0xe6')]='AGI';this['createHistory'](_0x4ec0d0)['catch'](loggerCatch(_0xbc56('0x109')));this[_0xbc56('0xca')](_0x4ec0d0)[_0xbc56('0xb3')](loggerCatch(_0xbc56('0x10a')));}if(_0x11eef5&&_0x11eef5[_0xbc56('0x57')]!=='ivr'&&!isNotNull(this['voiceQueues'][_0x11eef5[_0xbc56('0xb4')]][_0xbc56('0x10c')])){delete this[_0xbc56('0x2a')][_0x53569e[_0xbc56('0xdf')]];this[_0xbc56('0xce')](this[_0xbc56('0x22')][_0x11eef5[_0xbc56('0xb4')]]);this[_0xbc56('0x22')][_0x11eef5[_0xbc56('0xb4')]][_0xbc56('0x69')]+=0x1;_0x4ec0d0=new Hangup(_0x11eef5,_0x53569e);_0x4ec0d0[_0xbc56('0xa8')]=0xc;_0x4ec0d0[_0xbc56('0xa9')]=_0x53569e['cause-txt'];_0x4ec0d0['membername']=_0xbc56('0x10d');this[_0xbc56('0xcc')](_0x4ec0d0)[_0xbc56('0xb3')](loggerCatch(_0xbc56('0x109')));this[_0xbc56('0xca')](_0x4ec0d0)[_0xbc56('0xb3')](loggerCatch(_0xbc56('0x10a')));}};Dialer[_0xbc56('0x1c')][_0xbc56('0x10e')]=function(_0x2b168a){var _0x517528=this['uniqueId'][_0x2b168a[_0xbc56('0xdf')]];var _0x3ac891=this;if(this[_0xbc56('0x22')][_0x2b168a[_0xbc56('0xb4')]]){if(_0x517528&&_0x517528['type']!==_0xbc56('0x7f')){delete this[_0xbc56('0x2a')][_0x2b168a[_0xbc56('0xdf')]];this[_0xbc56('0x22')][_0x2b168a[_0xbc56('0xb4')]][_0xbc56('0x62')]+=0x1;var _0x18568c=new AgentComplete(_0x517528,_0x2b168a);if(_0x2b168a[_0xbc56('0x10f')]===_0xbc56('0x110')){_0x18568c['agiafterat']=this[_0xbc56('0x22')][_0x2b168a[_0xbc56('0xb4')]][_0xbc56('0x111')]&&this[_0xbc56('0x22')][_0x2b168a[_0xbc56('0xb4')]][_0xbc56('0x112')]?moment()['format'](_0xbc56('0xfa')):undefined;}this['createHistory'](_0x18568c)['catch'](loggerCatch(_0xbc56('0x113')));this[_0xbc56('0xca')](_0x18568c)[_0xbc56('0xb3')](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0xbc56('0x1c')][_0xbc56('0x2e')]=function(_0x1e21e5){if(this[_0xbc56('0x22')][_0x1e21e5[_0xbc56('0xb4')]]){if(this['uniqueId'][_0x1e21e5[_0xbc56('0xdf')]]&&this[_0xbc56('0x2a')][_0x1e21e5[_0xbc56('0xdf')]]['type']!==_0xbc56('0x7f')){this['updateOriginated'](this[_0xbc56('0x22')][_0x1e21e5[_0xbc56('0xb4')]]);this[_0xbc56('0x2a')][_0x1e21e5['uniqueid']][_0xbc56('0x114')]=moment()[_0xbc56('0x7c')](_0xbc56('0xfa'));}}};Dialer['prototype'][_0xbc56('0x115')]=function(_0x5d4d71){this[_0xbc56('0xcc')](_0x5d4d71)[_0xbc56('0xb3')](loggerCatch(_0xbc56('0x113')));this[_0xbc56('0xca')](_0x5d4d71)[_0xbc56('0xb3')](loggerCatch(_0xbc56('0x116')));};Dialer[_0xbc56('0x1c')]['syncQueueCallerAbandon']=function(_0x2785ee){var _0x4e457f=this['uniqueId'][_0x2785ee[_0xbc56('0xdf')]];var _0x464647=this;if(this[_0xbc56('0x22')][_0x2785ee[_0xbc56('0xb4')]]){if(_0x4e457f&&_0x4e457f[_0xbc56('0x57')]!==_0xbc56('0x7f')){delete this[_0xbc56('0x2a')][_0x2785ee[_0xbc56('0xdf')]];this['updateOriginated'](this[_0xbc56('0x22')][_0x2785ee[_0xbc56('0xb4')]]);_0x4e457f[_0xbc56('0x117')]=moment()[_0xbc56('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');var _0x4aaa98=new QueueCallerAbandon(_0x4e457f,_0x2785ee);if(getSeconds(_0x4e457f['droptime'],_0x4e457f['responsetime'])>=_0x4e457f[_0xbc56('0x118')]){this['voiceQueues'][_0x2785ee[_0xbc56('0xb4')]][_0xbc56('0x6e')]+=0x1;this[_0xbc56('0x22')][_0x2785ee[_0xbc56('0xb4')]][_0xbc56('0x119')]+=0x1;this[_0xbc56('0x22')][_0x2785ee[_0xbc56('0xb4')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x4aaa98[_0xbc56('0xa8')]=0xa;_0x4aaa98[_0xbc56('0xa9')]='Drop';_0x4aaa98[_0xbc56('0x11a')]=_0xbc56('0x11b');_0x4aaa98[_0xbc56('0x11c')]=this[_0xbc56('0x22')][_0x2785ee['queue']][_0xbc56('0x111')]?moment()[_0xbc56('0x7c')](_0xbc56('0xfa')):undefined;_0x4aaa98['countdropretry']+=0x1;_0x4aaa98[_0xbc56('0x102')]+=0x1;if(_0x4aaa98[_0xbc56('0xf0')]>=this[_0xbc56('0x22')][_0x2785ee['queue']][_0xbc56('0x11d')]){this['queueCallerAbandonCreateState'](_0x4aaa98);}else{this[_0xbc56('0xc1')]({'active':![],'countdropretry':_0x4aaa98[_0xbc56('0xf0')],'scheduledat':moment()[_0xbc56('0xf7')](this['voiceQueues'][_0x2785ee['queue']][_0xbc56('0x11e')],_0xbc56('0xf9'))[_0xbc56('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4e457f[_0xbc56('0xd6')],'ListId':_0x4e457f[_0xbc56('0xd7')],'VoiceQueueId':_0x4e457f['VoiceQueueId']||undefined,'CampaignId':_0x4e457f[_0xbc56('0x107')]||undefined})['catch'](loggerCatch(_0xbc56('0x11f')));var _0xec25c3=new History(_0x4aaa98);_0xec25c3[_0xbc56('0xa8')]=0xa;_0xec25c3[_0xbc56('0xa9')]=_0xbc56('0x120');_0xec25c3[_0xbc56('0xab')]=moment()[_0xbc56('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');_0xec25c3[_0xbc56('0xaa')]=_0xec25c3[_0xbc56('0xab')];_0xec25c3[_0xbc56('0x121')]=_0x4aaa98['calleridname'];_0xec25c3[_0xbc56('0x122')]=_0x4aaa98[_0xbc56('0x122')];this[_0xbc56('0xcc')](_0xec25c3)['catch'](loggerCatch('[syncAgentComplete][createHistory][10]'));}}else{this[_0xbc56('0x22')][_0x2785ee[_0xbc56('0xb4')]][_0xbc56('0x6d')]+=0x1;this[_0xbc56('0x22')][_0x2785ee[_0xbc56('0xb4')]][_0xbc56('0x65')]+=0x1;_0x4aaa98['state']=0xb;_0x4aaa98[_0xbc56('0xa9')]=_0xbc56('0x123');_0x4aaa98[_0xbc56('0x11a')]=_0xbc56('0x124');_0x4aaa98[_0xbc56('0xf1')]+=0x1;_0x4aaa98['countglobal']+=0x1;if(_0x4aaa98['countabandonedretry']>=this[_0xbc56('0x22')][_0x2785ee[_0xbc56('0xb4')]][_0xbc56('0x125')]){this[_0xbc56('0x115')](_0x4aaa98);}else{this[_0xbc56('0xc1')]({'active':![],'countabandonedretry':_0x4aaa98[_0xbc56('0xf1')],'scheduledat':moment()[_0xbc56('0xf7')](this[_0xbc56('0x22')][_0x2785ee[_0xbc56('0xb4')]]['dialAbandonedRetryFrequency'],_0xbc56('0xf9'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4e457f[_0xbc56('0xd6')],'ListId':_0x4e457f[_0xbc56('0xd7')],'VoiceQueueId':_0x4e457f[_0xbc56('0xfb')]||undefined,'CampaignId':_0x4e457f[_0xbc56('0x107')]||undefined})[_0xbc56('0xb3')](loggerCatch(_0xbc56('0x126')));var _0xec25c3=new History(_0x4aaa98);_0xec25c3[_0xbc56('0xa8')]=0xb;_0xec25c3[_0xbc56('0xa9')]=_0xbc56('0x123');_0xec25c3[_0xbc56('0xab')]=moment()[_0xbc56('0x7c')](_0xbc56('0xfa'));_0xec25c3[_0xbc56('0xaa')]=_0xec25c3[_0xbc56('0xab')];_0xec25c3[_0xbc56('0x121')]=_0x4aaa98[_0xbc56('0x121')];_0xec25c3[_0xbc56('0x122')]=_0x4aaa98[_0xbc56('0x122')];this[_0xbc56('0xcc')](_0xec25c3)[_0xbc56('0xb3')](loggerCatch(_0xbc56('0x127')));}}}}};Dialer[_0xbc56('0x1c')]['syncNewExten']=function(_0xc6afc1){if(this[_0xbc56('0x28')][_0xc6afc1['uniqueid']]){this[_0xbc56('0x28')][_0xc6afc1[_0xbc56('0xdf')]][_0xbc56('0xb2')]=_0xc6afc1[_0xbc56('0xb2')];}if(this['uniqueId'][_0xc6afc1[_0xbc56('0xdf')]]){this[_0xbc56('0x2a')][_0xc6afc1[_0xbc56('0xdf')]][_0xbc56('0xb2')]=_0xc6afc1[_0xbc56('0xb2')];}};Dialer[_0xbc56('0x1c')]['syncQueueMember']=function(_0x19dbb2){if(strategy[this['voiceQueues'][this[_0xbc56('0x28')][_0x19dbb2[_0xbc56('0x128')]][_0xbc56('0xb4')]][_0xbc56('0x4f')]]===_0xbc56('0x1b')){if(this[_0xbc56('0x28')][_0x19dbb2['actionid']]&&_['isNil'](this[_0xbc56('0x28')][_0x19dbb2[_0xbc56('0x128')]][_0xbc56('0x129')])&&_0x19dbb2[_0xbc56('0xb1')]==='1'&&_0x19dbb2[_0xbc56('0x12a')]==='0'){if(this[_0xbc56('0x24')][_0x19dbb2['stateinterface']]){if(!this[_0xbc56('0x24')][_0x19dbb2[_0xbc56('0x12b')]][_0xbc56('0x129')]){this['agents'][_0x19dbb2['stateinterface']]['locked']=!![];this[_0xbc56('0x28')][_0x19dbb2[_0xbc56('0x128')]][_0xbc56('0x129')]=!![];this[_0xbc56('0x28')][_0x19dbb2[_0xbc56('0x128')]][_0xbc56('0x12b')]=_0x19dbb2[_0xbc56('0x12b')];}}}}else if((strategy[this['voiceQueues'][this[_0xbc56('0x28')][_0x19dbb2[_0xbc56('0x128')]][_0xbc56('0xb4')]]['strategy']]||_0xbc56('0x12c'))===_0xbc56('0x12c')){if(this[_0xbc56('0x28')][_0x19dbb2['actionid']]){if(this[_0xbc56('0x24')][_0x19dbb2[_0xbc56('0x12b')]]){this['actions'][_0x19dbb2[_0xbc56('0x128')]]['stateinterface']=_0x19dbb2['stateinterface'];if(_['isNil'](this['queueBooked'][this['actions'][_0x19dbb2[_0xbc56('0x128')]]['queue']])){this[_0xbc56('0x12d')][this[_0xbc56('0x28')][_0x19dbb2[_0xbc56('0x128')]]['queue']]=[];}this['queueBooked'][this[_0xbc56('0x28')][_0x19dbb2['actionid']][_0xbc56('0xb4')]][_0xbc56('0x12e')](_[_0xbc56('0x93')](_[_0xbc56('0xd5')](this[_0xbc56('0x28')][_0x19dbb2['actionid']],[_0xbc56('0x12f'),'stateinterface']),{'status':_0x19dbb2['status'],'paused':_0x19dbb2[_0xbc56('0x12a')]}));}}}};function unlockQueueStatus(_0x4a8821,_0x3eba1e){setTimeout(function(){if(_['isUndefined'](_0x4a8821['queueStatusComplete'])){loggerBooked[_0xbc56('0x99')](_0xbc56('0x130'),_0x3eba1e);}_0x4a8821['queueStatusComplete']=!![];loggerBooked[_0xbc56('0x82')](_0xbc56('0x131'),_0x3eba1e,JSON[_0xbc56('0x49')](_[_0xbc56('0xd5')](_0x4a8821,[_0xbc56('0x40'),_0xbc56('0x132')])));},0x1f3);}Dialer['prototype'][_0xbc56('0x3b')]=function(_0x52846a){var _0x161245=this;var _0x107e07=_0x161245['voiceQueues'][_0x161245['actions'][_0x52846a[_0xbc56('0x128')]][_0xbc56('0xb4')]];if(strategy[this[_0xbc56('0x22')][this[_0xbc56('0x28')][_0x52846a[_0xbc56('0x128')]][_0xbc56('0xb4')]]['strategy']]===_0xbc56('0x1b')){if(this[_0xbc56('0x28')][_0x52846a[_0xbc56('0x128')]]&&this[_0xbc56('0x28')][_0x52846a[_0xbc56('0x128')]]['stateinterface']){this['preview'][_0xbc56('0x133')](this[_0xbc56('0x28')][_0x52846a[_0xbc56('0x128')]][_0xbc56('0x12f')],this[_0xbc56('0x28')][_0x52846a[_0xbc56('0x128')]][_0xbc56('0x12b')])['catch'](function(_0x21b789){logger['error'](_0xbc56('0x134'),util[_0xbc56('0x98')](_0x21b789,{'showHidden':![],'depth':null}));})[_0xbc56('0x1f')](function(){_0x161245[_0xbc56('0xce')](_0x161245[_0xbc56('0x22')][_0x161245[_0xbc56('0x28')][_0x52846a[_0xbc56('0x128')]]['queue']]);_0x161245[_0xbc56('0x24')][_0x161245[_0xbc56('0x28')][_0x52846a[_0xbc56('0x128')]][_0xbc56('0x12b')]]['locked']=![];delete _0x161245[_0xbc56('0x28')][_0x52846a['actionid']];unlockQueueStatus(_0x107e07);});}else{this[_0xbc56('0xce')](this[_0xbc56('0x22')][this['actions'][_0x52846a[_0xbc56('0x128')]]['queue']]);this['rescheduleContact']({'active':![],'ContactId':this[_0xbc56('0x28')][_0x52846a['actionid']]['ContactId'],'ListId':this['actions'][_0x52846a[_0xbc56('0x128')]][_0xbc56('0xd7')],'VoiceQueueId':this[_0xbc56('0x28')][_0x52846a[_0xbc56('0x128')]][_0xbc56('0xfb')]||undefined,'CampaignId':this[_0xbc56('0x28')][_0x52846a[_0xbc56('0x128')]][_0xbc56('0x107')]||undefined})[_0xbc56('0xb3')](loggerCatch(_0xbc56('0x135')));delete this[_0xbc56('0x28')][_0x52846a[_0xbc56('0x128')]];unlockQueueStatus(_0x107e07);}}else if((strategy[this[_0xbc56('0x22')][this['actions'][_0x52846a[_0xbc56('0x128')]]['queue']][_0xbc56('0x4f')]]||'rrmemory')===_0xbc56('0x12c')){var _0x1420a7;if(this[_0xbc56('0x28')][_0x52846a[_0xbc56('0x128')]]&&!_[_0xbc56('0x45')](this[_0xbc56('0x12d')][this[_0xbc56('0x28')][_0x52846a[_0xbc56('0x128')]][_0xbc56('0xb4')]])){if(this[_0xbc56('0x136')][_0x161245[_0xbc56('0x28')][_0x52846a[_0xbc56('0x128')]][_0xbc56('0xb4')]]){this[_0xbc56('0x136')][_0x161245[_0xbc56('0x28')][_0x52846a[_0xbc56('0x128')]][_0xbc56('0xb4')]]=this[_0xbc56('0x136')][this['actions'][_0x52846a[_0xbc56('0x128')]][_0xbc56('0xb4')]]?this[_0xbc56('0x136')][this['actions'][_0x52846a[_0xbc56('0x128')]][_0xbc56('0xb4')]]:this[_0xbc56('0x12d')][this[_0xbc56('0x28')][_0x52846a[_0xbc56('0x128')]]['queue']]?this['queueBooked'][this[_0xbc56('0x28')][_0x52846a[_0xbc56('0x128')]]['queue']][_0xbc56('0x137')]||0x0:0x0;}this[_0xbc56('0x12d')][this[_0xbc56('0x28')][_0x52846a['actionid']][_0xbc56('0xb4')]][_0xbc56('0x137')]=this[_0xbc56('0x136')][this[_0xbc56('0x28')][_0x52846a['actionid']][_0xbc56('0xb4')]];for(var _0x25a802=0x0;_0x25a802<this[_0xbc56('0x12d')][this[_0xbc56('0x28')][_0x52846a[_0xbc56('0x128')]][_0xbc56('0xb4')]]['length'];_0x25a802+=0x1){_0x1420a7=rr(this['queueBooked'][this['actions'][_0x52846a[_0xbc56('0x128')]][_0xbc56('0xb4')]]);this['queueBookedRR'][_0x161245[_0xbc56('0x28')][_0x52846a[_0xbc56('0x128')]][_0xbc56('0xb4')]]=this[_0xbc56('0x12d')][this['actions'][_0x52846a[_0xbc56('0x128')]][_0xbc56('0xb4')]][_0xbc56('0x137')];if(_0x1420a7[_0xbc56('0xb1')]==='1'&&_0x1420a7[_0xbc56('0x12a')]==='0'){break;}}if(!_['isNil'](_0x1420a7)){this[_0xbc56('0x24')][_0x1420a7[_0xbc56('0x12b')]][_0xbc56('0x138')]=_['isUndefined'](this[_0xbc56('0x24')][_0x1420a7[_0xbc56('0x12b')]]['unlockRR'])?!![]:this['agents'][_0x1420a7[_0xbc56('0x12b')]][_0xbc56('0x138')];}loggerBooked['info'](_0xbc56('0x139'),_0x52846a[_0xbc56('0x128')],_0xbc56('0x13a'),JSON[_0xbc56('0x49')](_['pick'](this['agents'][_0x1420a7[_0xbc56('0x12b')]],[_0xbc56('0x40'),_0xbc56('0x138')])),_0xbc56('0x13b'),JSON[_0xbc56('0x49')](_0x1420a7[_0xbc56('0x12f')]));if(!_[_0xbc56('0xaf')](_0x1420a7)&&_0x1420a7[_0xbc56('0xb1')]==='1'&&_0x1420a7[_0xbc56('0x12a')]==='0'&&this[_0xbc56('0x24')][_0x1420a7['stateinterface']][_0xbc56('0x138')]){this[_0xbc56('0x24')][_0x1420a7[_0xbc56('0x12b')]][_0xbc56('0x138')]=![];this[_0xbc56('0x12d')][_0x161245[_0xbc56('0x28')][_0x52846a[_0xbc56('0x128')]][_0xbc56('0xb4')]]=[];this['preview'][_0xbc56('0x133')](_0x1420a7[_0xbc56('0x12f')],_0x1420a7[_0xbc56('0x12b')])[_0xbc56('0xb3')](function(_0x112743){logger['error']('[Catch][Preview][syncQueueStatusComplete]',util[_0xbc56('0x98')](_0x112743,{'showHidden':![],'depth':null}));})['finally'](function(){_0x161245[_0xbc56('0xce')](_0x161245['voiceQueues'][_0x161245[_0xbc56('0x28')][_0x52846a[_0xbc56('0x128')]][_0xbc56('0xb4')]]);setTimeout(function(){_0x161245[_0xbc56('0x24')][_0x1420a7['stateinterface']]['unlockRR']=!![];loggerBooked['info'](_0xbc56('0x13c'),_0x52846a[_0xbc56('0x128')],'Agent:\x20',JSON[_0xbc56('0x49')](_[_0xbc56('0xd5')](_0x161245[_0xbc56('0x24')][_0x1420a7['stateinterface']],[_0xbc56('0x40'),_0xbc56('0x138')])),_0xbc56('0x13b'),JSON[_0xbc56('0x49')](_0x1420a7[_0xbc56('0x12f')]));},0xc7);delete _0x161245[_0xbc56('0x28')][_0x52846a[_0xbc56('0x128')]];unlockQueueStatus(_0x107e07,_0x52846a['actionid']);});}else{loggerBooked[_0xbc56('0x82')](_0xbc56('0x13d'));this[_0xbc56('0xce')](this['voiceQueues'][this['actions'][_0x52846a[_0xbc56('0x128')]]['queue']]);this['rescheduleContact']({'active':![],'ContactId':this['actions'][_0x52846a[_0xbc56('0x128')]][_0xbc56('0xd6')],'ListId':this[_0xbc56('0x28')][_0x52846a['actionid']][_0xbc56('0xd7')],'VoiceQueueId':this['actions'][_0x52846a[_0xbc56('0x128')]][_0xbc56('0xfb')]||undefined,'CampaignId':this[_0xbc56('0x28')][_0x52846a[_0xbc56('0x128')]][_0xbc56('0x107')]||undefined})['catch'](loggerCatch(_0xbc56('0x135')));delete this['actions'][_0x52846a[_0xbc56('0x128')]];unlockQueueStatus(_0x107e07);}}else{loggerBooked[_0xbc56('0x82')](_0xbc56('0x13e'));this[_0xbc56('0xce')](this['voiceQueues'][this[_0xbc56('0x28')][_0x52846a[_0xbc56('0x128')]][_0xbc56('0xb4')]]);this[_0xbc56('0xc1')]({'active':![],'ContactId':this['actions'][_0x52846a[_0xbc56('0x128')]]['ContactId'],'ListId':this[_0xbc56('0x28')][_0x52846a[_0xbc56('0x128')]][_0xbc56('0xd7')],'VoiceQueueId':this[_0xbc56('0x28')][_0x52846a['actionid']][_0xbc56('0xfb')]||undefined,'CampaignId':this[_0xbc56('0x28')][_0x52846a['actionid']]['CampaignId']||undefined})['catch'](loggerCatch(_0xbc56('0x13f')));delete this[_0xbc56('0x28')][_0x52846a[_0xbc56('0x128')]];unlockQueueStatus(_0x107e07);}}else{loggerBooked['info'](_0xbc56('0x140'));this[_0xbc56('0xce')](this[_0xbc56('0x22')][this[_0xbc56('0x28')][_0x52846a[_0xbc56('0x128')]][_0xbc56('0xb4')]]);this[_0xbc56('0xc1')]({'active':![],'ContactId':this[_0xbc56('0x28')][_0x52846a[_0xbc56('0x128')]][_0xbc56('0xd6')],'ListId':this[_0xbc56('0x28')][_0x52846a[_0xbc56('0x128')]][_0xbc56('0xd7')],'VoiceQueueId':this[_0xbc56('0x28')][_0x52846a[_0xbc56('0x128')]][_0xbc56('0xfb')]||undefined,'CampaignId':this[_0xbc56('0x28')][_0x52846a['actionid']][_0xbc56('0x107')]||undefined})['catch'](loggerCatch('[unlock3][syncQueueStatusComplete]'));delete this[_0xbc56('0x28')][_0x52846a[_0xbc56('0x128')]];unlockQueueStatus(_0x107e07);}};Dialer[_0xbc56('0x1c')][_0xbc56('0x3c')]=function(){var _0xc6fde3=this;setInterval(function(){_0xc6fde3[_0xbc56('0x141')]();},0x3e8);};Dialer[_0xbc56('0x1c')]['checkIsTrunkReachable']=function(_0x536863){var _0x25610f=this;return function(){if(!_0x25610f[_0xbc56('0xdb')](_0x536863[_0xbc56('0x79')])){if(!_0x25610f['isTrunkReachable'](_0x536863[_0xbc56('0x142')])){_0x536863['message']=_0xbc56('0x143');throw _0x536863[_0xbc56('0x40')]+_0xbc56('0x144');}}};};Dialer[_0xbc56('0x1c')][_0xbc56('0x145')]=function(_0x24c9ae,_0xc59cf0,_0x49a95e,_0x666b20){var _0x257574=this;return function(){var _0x46d257=!![];return _0x257574[_0xbc56('0x146')](_0x24c9ae,_0xc59cf0,_0x49a95e,_0x666b20,_0x46d257);};};Dialer['prototype'][_0xbc56('0x147')]=function(_0x7445b3,_0x567b11,_0xfd6cf7,_0x1127f7){var _0x23281c=this;return function(){var _0xcce4b0=![];return _0x23281c[_0xbc56('0x146')](_0x7445b3[_0xbc56('0x46')],_0x567b11,_0xfd6cf7,_0x1127f7,_0xcce4b0);};};Dialer[_0xbc56('0x1c')][_0xbc56('0x146')]=function(_0x4cb286,_0x1571e4,_0x433d56,_0x390ac1,_0x3cd5c0){var _0x2d0ab7=[];return new BPromise(function(_0x57c737,_0x75f8bd){if(!isNotNull(_0x4cb286)){_0x390ac1['message']=_0xbc56('0x42');return _0x75f8bd(msgResponse(_0xbc56('0x146'),_0xbc56('0x148'),_0x433d56+_0xbc56('0x149')));}if(_[_0xbc56('0x45')](_0x4cb286)){_0x390ac1[_0xbc56('0x3e')]=_0xbc56('0x14a');return _0x75f8bd(msgResponse(_0xbc56('0x146'),'Failure',_0x433d56+_0xbc56('0x14b')));}if(_0x1571e4&&_[_0xbc56('0x3d')](config['timezones'][_0x1571e4])){_0x390ac1[_0xbc56('0x3e')]=_0xbc56('0x14c');return _0x75f8bd(msgResponse(_0xbc56('0x146'),_0xbc56('0x148'),_0x433d56+_0xbc56('0x14d')+_0x1571e4));}if(_[_0xbc56('0x14e')](_0x4cb286)){for(var _0x47e959=0x0;_0x47e959<_0x4cb286[_0xbc56('0x14f')];_0x47e959+=0x1){_0x2d0ab7[_0xbc56('0x12e')](ami['Action']({'action':_0xbc56('0x150'),'command':util[_0xbc56('0x7c')]('iftime\x20%s,%s',_0x4cb286[_0x47e959]['interval'],!_[_0xbc56('0x3d')](config[_0xbc56('0x151')][_0x1571e4])?_0x1571e4:'')})[_0xbc56('0xb8')](function(_0x4dea22){return _0x4dea22[_0xbc56('0x152')][_0xbc56('0x153')](_0xbc56('0x154'))>=0x0?!![]:![];})[_0xbc56('0xb3')](myreject(_0x75f8bd)));}}else{_0x2d0ab7[_0xbc56('0x12e')](ami['Action']({'action':_0xbc56('0x150'),'command':util[_0xbc56('0x7c')](_0xbc56('0x155'),_0x4cb286,!_['isUndefined'](config[_0xbc56('0x151')][_0x1571e4])?_0x1571e4:'')})[_0xbc56('0xb8')](function(_0xa04add){return _0xa04add[_0xbc56('0x152')][_0xbc56('0x153')](_0xbc56('0x154'))>=0x0?!![]:![];})[_0xbc56('0xb3')](myreject(_0x75f8bd)));}BPromise['all'](_0x2d0ab7)[_0xbc56('0xb8')](function(_0x175cd6){var _0xc6c64f=_[_0xbc56('0x156')](_0x175cd6);if(_0xc6c64f){return _0x57c737(_0xc6c64f);}else{_0x390ac1[_0xbc56('0x3e')]=_0x3cd5c0?'GLOBAL_INTERVAL_IS_OVERTIME':_0xbc56('0x157');return _0x75f8bd(msgResponse(_0xbc56('0x158'),_0xbc56('0x148'),_0xbc56('0x159')+_0x3cd5c0+'\x20'+_0x433d56+_0xbc56('0x15a')+util[_0xbc56('0x98')](_0x4cb286,{'showHidden':![],'depth':null})+_0xbc56('0x15b')+_0x1571e4));}})[_0xbc56('0xb3')](function(_0x24fa84){return _0x75f8bd(msgResponse(_0xbc56('0x146'),_0xbc56('0x148'),JSON[_0xbc56('0x49')](_0x24fa84)));});});};Dialer[_0xbc56('0x1c')][_0xbc56('0x15c')]=function(_0x5825db){var _0x45e137=this;return function(){switch(_0x5825db['dialMethod']){case _0xbc56('0x15d'):freeVariablesPredictive(_0x5825db);_0x45e137[_0xbc56('0x15e')](_0x5825db,0x1);break;case _0xbc56('0x15f'):freeVariablesPredictive(_0x5825db);_0x45e137['handlePower'](_0x5825db,_0x5825db[_0xbc56('0x160')]);break;case _0xbc56('0x9'):_0x45e137[_0xbc56('0x9')](_0x5825db);break;case _0xbc56('0x8'):freeVariablesPredictive(_0x5825db);_0x45e137[_0xbc56('0x15e')](_0x5825db,0x1);break;default:freeVariablesPredictive(_0x5825db);logger[_0xbc56('0x99')](_0xbc56('0x161'),_0x5825db['name'],'method\x20not\x20recognized');}};};Dialer[_0xbc56('0x1c')][_0xbc56('0x162')]=function(_0x829c1b){var _0x31aeff=this;return function(){_0x31aeff[_0xbc56('0x163')](_0x829c1b);};};Dialer[_0xbc56('0x1c')]['syncQueueSummary']=function(_0x4ae1ab){var _0x4bd8c7=this;if(isNotPreview(_0x4ae1ab[_0xbc56('0x5d')])){if(isVoiceQueueOutbound(_0x4ae1ab['type'])&&isActive(_0x4ae1ab['dialActive'])){_0x4ae1ab['sendMessageOneNotActive']=!![];BPromise[_0xbc56('0xb7')]()[_0xbc56('0xb8')](checkIsLoggedIn(_0x4ae1ab,_0x4ae1ab[_0xbc56('0x164')]))['then'](checkIsActive(_0x4ae1ab,_0x4ae1ab['dialActive']))[_0xbc56('0xb8')](checkInterval(_0x4ae1ab))[_0xbc56('0xb8')](_0x4bd8c7['checkIsTrunkReachable'](_0x4ae1ab))[_0xbc56('0xb8')](_0x4bd8c7[_0xbc56('0x145')](_0x4ae1ab[_0xbc56('0x165')],_0x4ae1ab[_0xbc56('0x166')],_0x4ae1ab[_0xbc56('0x40')],_0x4ae1ab))[_0xbc56('0xb8')](_0x4bd8c7[_0xbc56('0x147')](_0x4ae1ab[_0xbc56('0x44')],_0x4ae1ab[_0xbc56('0x166')],_0x4ae1ab[_0xbc56('0x40')],_0x4ae1ab))[_0xbc56('0xb8')](_0x4bd8c7[_0xbc56('0x15c')](_0x4ae1ab))[_0xbc56('0xb3')](loggerCatchQueueSummary('[syncQueueSummary]',_0x4ae1ab));}else{notSendMessagesQueue(_0x4ae1ab);}}else{freeVariablesPredictive(_0x4ae1ab);}};Dialer[_0xbc56('0x1c')][_0xbc56('0x141')]=function(){var _0x8d958c=this;var _0x3a0d1b;for(var _0x513d94 in this[_0xbc56('0x23')]){if(this[_0xbc56('0x23')][_0xbc56('0x9b')](_0x513d94)){_0x3a0d1b=this[_0xbc56('0x23')][_0x513d94];if(isCampaignIvr(_0x3a0d1b[_0xbc56('0x57')])&&isActive(_0x3a0d1b['active'])){_0x3a0d1b[_0xbc56('0xa1')]=!![];BPromise[_0xbc56('0xb7')]()[_0xbc56('0xb8')](checkIsActive(_0x3a0d1b,_0x3a0d1b['active']))['then'](checkInterval(_0x3a0d1b))['then'](_0x8d958c[_0xbc56('0x167')](_0x3a0d1b))[_0xbc56('0xb8')](_0x8d958c['checkIfTime'](_0x3a0d1b[_0xbc56('0x165')],_0x3a0d1b['dialTimezone'],_0x3a0d1b[_0xbc56('0x40')],_0x3a0d1b))[_0xbc56('0xb8')](_0x8d958c[_0xbc56('0x147')](_0x3a0d1b[_0xbc56('0x44')],_0x3a0d1b['dialTimezone'],_0x3a0d1b[_0xbc56('0x40')],_0x3a0d1b))[_0xbc56('0xb8')](_0x8d958c['launchHandleIvr'](_0x3a0d1b))[_0xbc56('0xb3')](loggerCatchQueueSummary(_0xbc56('0x168'),_0x3a0d1b));}else{notSendMessagesCampaign(_0x3a0d1b);}}}};function getCallerIdRandom(_0x3c4a33,_0xef4cc9){var _0x227828,_0x2a3e8d,_0x26fdf9;if(_0xef4cc9<=0x0){_0xef4cc9=0x1;}_0x227828=new RegExp(_0xbc56('0x169')+_0xef4cc9+'}$');_0x2a3e8d=Math[_0xbc56('0x16a')](0xa,_0xef4cc9-0x1);_0x26fdf9=Math['pow'](0xa,_0xef4cc9)-0x1;return util[_0xbc56('0x7c')]('%s',_[_0xbc56('0x16b')](_0x3c4a33,_0x227828,_['random'](_0x2a3e8d,_0x26fdf9)));}function extractCalleridName(_0xba5a18){var _0x510cd3=_0xba5a18['match'](/"(.*?)"/);return _0x510cd3?_0x510cd3[0x1]:_0xba5a18;}function extractCalleridNumber(_0x520e28){var _0x1b46ee=_0x520e28[_0xbc56('0x16c')](/<(.*?)>/);return _0x1b46ee?_0x1b46ee[0x1]:_0x520e28;}Dialer[_0xbc56('0x1c')]['actionOriginate']=function(_0x57a3fd,_0x43e597){var _0xf446ed=this;var _0x201d6f=uuid['v4']();this[_0xbc56('0x28')][_0x201d6f]=new Action(_0x57a3fd,_0x43e597,_0x201d6f);return new BPromise(function(_0x4c8a39,_0x97f578){if(_[_0xbc56('0x3d')](_0x57a3fd)&&_0xbc56('0x16d')!==typeof _0x57a3fd){return _0x97f578(msgResponse('originate',_0xbc56('0x148'),_0xbc56('0x16e')));}if(_[_0xbc56('0x3d')](_0x43e597['Contact'][_0xbc56('0x16f')])||_0x43e597[_0xbc56('0x170')][_0xbc56('0x16f')]===null){return _0x97f578(msgResponse(_0xbc56('0x171'),'Failure',_0xbc56('0x172')));}var _0x583fd8={'XMD-CALLERID':_0xf446ed[_0xbc56('0x28')][_0x201d6f]['getCaller'](),'XMD-AGI':_0x57a3fd[_0xbc56('0x10c')]?util['format'](_0xbc56('0x173'),ipAgi,_0x57a3fd['dialQueueProject']):_0xbc56('0x174'),'XMD-AGIAFTER':_0x57a3fd[_0xbc56('0x111')]?util[_0xbc56('0x7c')]('\x22agi://%s/square,%s\x22',ipAgi,_0x57a3fd['dialQueueProject2']):_0xbc56('0x174'),'XMD-QUEUE':_0x57a3fd['type']===_0xbc56('0x4e')?util['format'](_0xbc56('0x175'),_0x57a3fd[_0xbc56('0x40')],_0x57a3fd[_0xbc56('0x176')]||'',_0x57a3fd[_0xbc56('0x112')]?'c':'',_0x57a3fd[_0xbc56('0x118')]||0x3):_0xbc56('0x174'),'XMD-CONTACTID':_0x43e597['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0xf446ed[_0xbc56('0x28')][_0x201d6f][_0xbc56('0x177')](),'XMD-AMD':_0x57a3fd[_0xbc56('0xea')]?_0xbc56('0x178'):'NONE','XMD-DESTINATION':_0xbc56('0xe3')};if(_0x57a3fd[_0xbc56('0xea')]){_0x583fd8[_0xbc56('0x179')]=_0x57a3fd[_0xbc56('0x17a')]||0x9c4;_0x583fd8[_0xbc56('0x17b')]=_0x57a3fd[_0xbc56('0x17c')]||0x5dc;_0x583fd8['XMD-AMDAFTERGREETINGSILENCE']=_0x57a3fd[_0xbc56('0x17d')]||0x320;_0x583fd8[_0xbc56('0x17e')]=_0x57a3fd[_0xbc56('0x17f')]||0x1388;_0x583fd8['XMD-AMDMINWORDLENGTH']=_0x57a3fd['dialAMDMinWordLength']||0x64;_0x583fd8['XMD-AMDBETWEENWORDSSILENCE']=_0x57a3fd[_0xbc56('0x180')]||0x32;_0x583fd8[_0xbc56('0x181')]=_0x57a3fd[_0xbc56('0x182')]||0x3;_0x583fd8[_0xbc56('0x183')]=_0x57a3fd[_0xbc56('0x184')]||0x100;_0x583fd8[_0xbc56('0x185')]=_0x57a3fd[_0xbc56('0x186')]||0x1388;}if(_0x57a3fd[_0xbc56('0x57')]===_0xbc56('0x4e')){_0x583fd8[_0xbc56('0x187')]=_0x43e597[_0xbc56('0xfb')];}else{_0x583fd8[_0xbc56('0x188')]=_0x43e597[_0xbc56('0x107')];}for(var _0x488dfd in _0x43e597[_0xbc56('0x170')]){if(_0x43e597[_0xbc56('0x170')][_0xbc56('0x9b')](_0x488dfd)){if(isNotNull(_0x43e597[_0xbc56('0x170')][_0x488dfd])&&_0x488dfd!=='id'&&_0x488dfd!==_0xbc56('0x189')&&_0x488dfd!=='createdAt'&&_0x488dfd!==_0xbc56('0x18a')){_0x583fd8[util['format'](_0xbc56('0x18b'),_0xbc56('0x18c'),_[_0xbc56('0x18d')](_0x488dfd))]=_0x43e597['Contact'][_0x488dfd];}}}var _0x49717b=_0xf446ed[_0xbc56('0xdb')](_0x57a3fd[_0xbc56('0x79')])?getCallerId(_0x57a3fd[_0xbc56('0x79')][_0xbc56('0x7b')],_0x57a3fd[_0xbc56('0x5e')],_0x57a3fd[_0xbc56('0x18e')]>0x0?getCallerIdRandom(_0x57a3fd[_0xbc56('0x5f')],_0x57a3fd[_0xbc56('0x18e')]):_0x57a3fd[_0xbc56('0x5f')]):getCallerId(_['isNil'](_0x57a3fd[_0xbc56('0x142')])?_0x57a3fd['Trunk'][_0xbc56('0x7b')]:_0x57a3fd[_0xbc56('0x142')][_0xbc56('0x7b')],_0x57a3fd[_0xbc56('0x5e')],_0x57a3fd['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x57a3fd[_0xbc56('0x5f')],_0x57a3fd[_0xbc56('0x18e')]):_0x57a3fd['dialOriginateCallerIdNumber']);if(_0x49717b){_0x583fd8[_0xbc56('0x18f')]=_0xf446ed[_0xbc56('0x28')][_0x201d6f][_0xbc56('0x190')]=extractCalleridName(_0x49717b);_0x583fd8[_0xbc56('0x191')]=_0xf446ed[_0xbc56('0x28')][_0x201d6f][_0xbc56('0x192')]=extractCalleridNumber(_0x49717b);}return ami[_0xbc56('0xb0')]({'actionid':_0x201d6f,'action':'originate','channel':_0xf446ed['isTrunkReachable'](_0x57a3fd[_0xbc56('0x79')])?util[_0xbc56('0x7c')]('SIP/%s/%s%s',_0x57a3fd['Trunk'][_0xbc56('0x40')],isNotNull(_0x57a3fd['dialPrefix'])?_0x57a3fd[_0xbc56('0x193')]['trim']()||'':'',_0x57a3fd[_0xbc56('0x194')]>0x0?_0x43e597[_0xbc56('0x170')][_0xbc56('0x16f')][_0xbc56('0x195')](_0x57a3fd[_0xbc56('0x194')]):_0x43e597[_0xbc56('0x170')]['phone']):util[_0xbc56('0x7c')](_0xbc56('0x196'),_[_0xbc56('0xaf')](_0x57a3fd['TrunkBackup'])?_0x57a3fd['Trunk']['name']:_0x57a3fd[_0xbc56('0x142')][_0xbc56('0x40')],isNotNull(_0x57a3fd['dialPrefix'])?_0x57a3fd[_0xbc56('0x193')][_0xbc56('0x197')]()||'':'',_0x57a3fd[_0xbc56('0x194')]>0x0?_0x43e597[_0xbc56('0x170')]['phone'][_0xbc56('0x195')](_0x57a3fd[_0xbc56('0x194')]):_0x43e597[_0xbc56('0x170')]['phone']),'callerid':_0x49717b,'Exten':_0xbc56('0xe3'),'Context':_0xbc56('0x198'),'Priority':'1','variable':_0x583fd8,'timeout':(_0x57a3fd['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x201d6f})[_0xbc56('0xb8')](function(_0x428144){return _0x4c8a39(_0x428144);})[_0xbc56('0xb3')](function(_0x386f4d){_0x57a3fd[_0xbc56('0x67')]+=0x1;var _0x1b056b=new History(_0xf446ed[_0xbc56('0x28')][_0x201d6f]);logger[_0xbc56('0x99')](util[_0xbc56('0x7c')]('[originateError]:\x20%s',JSON[_0xbc56('0x49')](_0x386f4d)));_0x1b056b['state']=0xe;_0x1b056b[_0xbc56('0xa9')]=_0xbc56('0x199');_0x1b056b[_0xbc56('0xab')]=moment()[_0xbc56('0x7c')](_0xbc56('0xfa'));_0x1b056b['endtime']=_0x1b056b[_0xbc56('0xab')];_0xf446ed[_0xbc56('0xcc')](_0x1b056b)[_0xbc56('0xb3')](loggerCatch('[originate][error]'));_0xf446ed[_0xbc56('0xca')](_0x1b056b)['catch'](loggerCatch(_0xbc56('0x19a')))[_0xbc56('0x1f')](function(){delete _0xf446ed[_0xbc56('0x28')][_0x201d6f];return _0x97f578(msgResponse(_0xbc56('0x171'),_0xbc56('0x48'),_0xbc56('0x19b')));});});});};Dialer['prototype'][_0xbc56('0x33')]=function(_0x5701e6){var _0x50adf4=this[_0xbc56('0x28')][_0x5701e6['actionid']];var _0x418fde=this;if(_0x50adf4){delete this[_0xbc56('0x28')][_0x5701e6[_0xbc56('0x128')]];_0x50adf4['responsetime']=moment()[_0xbc56('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');var _0x138ab9=_0x50adf4[_0xbc56('0x57')]===_0xbc56('0x7f')?this[_0xbc56('0x23')][_0x50adf4['queue']]:this[_0xbc56('0x22')][_0x50adf4[_0xbc56('0x19c')]()];if(!this[_0xbc56('0xd9')](_0x5701e6[_0xbc56('0x19d')])){this['updateOriginated'](_0x138ab9);return this[_0xbc56('0x19e')](_0x50adf4,_0x138ab9,_0x5701e6)[_0xbc56('0xb8')](function(_0xbb438c){})[_0xbc56('0xb3')](loggerCatch(_0xbc56('0x19f')));}else{this['uniqueId'][_0x5701e6[_0xbc56('0xdf')]]=_0x50adf4;}}};Dialer[_0xbc56('0x1c')][_0xbc56('0x1a0')]=function(_0x1b4eb2,_0x1712c7,_0x46d427){var _0x202c91=new History(_0x1712c7);if(_0x202c91[_0xbc56('0xed')]+_0x202c91[_0xbc56('0xee')]+_0x202c91['countnoanswerretry']+_0x202c91[_0xbc56('0xef')]+_0x202c91[_0xbc56('0xf0')]+_0x202c91[_0xbc56('0xf1')]+_0x202c91[_0xbc56('0xeb')]+_0x202c91['countagentrejectretry']>=_0x46d427[_0xbc56('0x105')]-0x1){return!![];}switch(_0x1b4eb2){case 0x3:if(_0x202c91[_0xbc56('0x104')]>=_0x46d427['dialNoAnswerMaxRetry']-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnoanswerretry':_0x202c91[_0xbc56('0x104')]+=0x1,'scheduledat':moment()[_0xbc56('0xf7')](_0x46d427[_0xbc56('0x1a1')],_0xbc56('0xf9'))[_0xbc56('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x202c91[_0xbc56('0xd6')],'ListId':_0x202c91[_0xbc56('0xd7')],'VoiceQueueId':_0x202c91[_0xbc56('0xfb')]||undefined,'CampaignId':_0x202c91[_0xbc56('0x107')]||undefined})[_0xbc56('0xb3')](loggerCatch('[rescheduleContact][NoAnswer]'));}break;case 0x5:if(_0x202c91[_0xbc56('0xed')]>=_0x46d427[_0xbc56('0x1a2')]-0x1){return!![];}else{this[_0xbc56('0xc1')]({'active':![],'countbusyretry':_0x202c91[_0xbc56('0xed')]+=0x1,'scheduledat':moment()['add'](_0x46d427[_0xbc56('0x1a3')],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x202c91[_0xbc56('0xd6')],'ListId':_0x202c91['ListId'],'VoiceQueueId':_0x202c91[_0xbc56('0xfb')]||undefined,'CampaignId':_0x202c91[_0xbc56('0x107')]||undefined})[_0xbc56('0xb3')](loggerCatch(_0xbc56('0x1a4')));}break;case 0x8:if(_0x202c91[_0xbc56('0xee')]>=_0x46d427[_0xbc56('0x1a5')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countcongestionretry':_0x202c91[_0xbc56('0xee')]+=0x1,'scheduledat':moment()['add'](_0x46d427['dialCongestionRetryFrequency'],'minutes')['format'](_0xbc56('0xfa')),'ContactId':_0x202c91[_0xbc56('0xd6')],'ListId':_0x202c91[_0xbc56('0xd7')],'VoiceQueueId':_0x202c91[_0xbc56('0xfb')]||undefined,'CampaignId':_0x202c91[_0xbc56('0x107')]||undefined})['catch'](loggerCatch('[rescheduleContact]\x20[Congestion]'));}break;case 0x0:if(_0x202c91[_0xbc56('0xef')]>=_0x46d427['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this[_0xbc56('0xc1')]({'active':![],'countnosuchnumberretry':_0x202c91[_0xbc56('0xef')]+=0x1,'scheduledat':moment()[_0xbc56('0xf7')](_0x46d427[_0xbc56('0x1a6')],_0xbc56('0xf9'))[_0xbc56('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x202c91[_0xbc56('0xd6')],'ListId':_0x202c91[_0xbc56('0xd7')],'VoiceQueueId':_0x202c91[_0xbc56('0xfb')]||undefined,'CampaignId':_0x202c91[_0xbc56('0x107')]||undefined})[_0xbc56('0xb3')](loggerCatch(_0xbc56('0x1a7')));}break;case 0xa:if(_0x202c91['countdropretry']>=_0x46d427[_0xbc56('0x11d')]-0x1){return!![];}else{this[_0xbc56('0xc1')]({'active':![],'countdropretry':_0x202c91[_0xbc56('0xf0')]+=0x1,'scheduledat':moment()[_0xbc56('0xf7')](_0x46d427['dialDropRetryFrequency'],_0xbc56('0xf9'))['format'](_0xbc56('0xfa')),'ContactId':_0x202c91[_0xbc56('0xd6')],'ListId':_0x202c91[_0xbc56('0xd7')],'VoiceQueueId':_0x202c91[_0xbc56('0xfb')]||undefined,'CampaignId':_0x202c91['CampaignId']||undefined})[_0xbc56('0xb3')](loggerCatch(_0xbc56('0x11f')));}break;case 0xb:if(_0x202c91[_0xbc56('0xf1')]>=_0x46d427[_0xbc56('0x125')]-0x1){return!![];}else{this[_0xbc56('0xc1')]({'active':![],'countabandonedretry':_0x202c91[_0xbc56('0xf1')]+=0x1,'scheduledat':moment()[_0xbc56('0xf7')](_0x46d427[_0xbc56('0x1a8')],_0xbc56('0xf9'))[_0xbc56('0x7c')](_0xbc56('0xfa')),'ContactId':_0x202c91[_0xbc56('0xd6')],'ListId':_0x202c91[_0xbc56('0xd7')],'VoiceQueueId':_0x202c91[_0xbc56('0xfb')]||undefined,'CampaignId':_0x202c91[_0xbc56('0x107')]||undefined})['catch'](loggerCatch(_0xbc56('0x126')));}break;case 0x13:if(_0x202c91[_0xbc56('0xeb')]>=_0x46d427['dialMachineMaxRetry']-0x1){return!![];}else{this[_0xbc56('0xc1')]({'active':![],'countmachineretry':_0x202c91[_0xbc56('0xeb')]+=0x1,'scheduledat':moment()['add'](_0x46d427[_0xbc56('0xf8')],'minutes')[_0xbc56('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x202c91[_0xbc56('0xd6')],'ListId':_0x202c91[_0xbc56('0xd7')],'VoiceQueueId':_0x202c91[_0xbc56('0xfb')]||undefined,'CampaignId':_0x202c91[_0xbc56('0x107')]||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));}break;case 0x14:if(_0x202c91[_0xbc56('0xf2')]>=_0x46d427[_0xbc56('0x1a9')]-0x1){return!![];}else{this[_0xbc56('0xc1')]({'active':![],'countagentrejectretry':_0x202c91[_0xbc56('0xf2')]+=0x1,'scheduledat':moment()[_0xbc56('0xf7')](_0x46d427[_0xbc56('0x1aa')],_0xbc56('0xf9'))['format'](_0xbc56('0xfa')),'ContactId':_0x202c91['ContactId'],'ListId':_0x202c91[_0xbc56('0xd7')],'VoiceQueueId':_0x202c91[_0xbc56('0xfb')]||undefined,'CampaignId':_0x202c91[_0xbc56('0x107')]||undefined})['catch'](loggerCatch(_0xbc56('0x1ab')));}break;default:return!![];}};Dialer[_0xbc56('0x1c')]['callProgressDetecting']=function(_0x523c71,_0x20c573,_0x358eeb){var _0x16b917=this;var _0x1e45e1=new History(_0x523c71);return new BPromise(function(_0x360dde,_0x1a8710){if(_[_0xbc56('0x3d')](_0x20c573)&&_0xbc56('0x16d')!==typeof _0x20c573){return _0x1a8710(msgResponse(_0xbc56('0x1ac'),_0xbc56('0x148'),_0xbc56('0x1ad')));}if(_['isUndefined'](_0x358eeb)&&_0xbc56('0x16d')!==typeof _0x358eeb){return _0x1a8710(msgResponse(_0xbc56('0x1ac'),_0xbc56('0x148'),_0xbc56('0x1ae')));}switch(_0x358eeb[_0xbc56('0x10f')]){case'0':_0x20c573[_0xbc56('0x66')]+=0x1;_0x1e45e1['state']=0x0;_0x1e45e1[_0xbc56('0xa9')]=_0xbc56('0x1af');_0x1e45e1[_0xbc56('0xef')]+=0x1;_0x1e45e1[_0xbc56('0x102')]+=0x1;ami[_0xbc56('0x4d')](_0xbc56('0x1b0'),ut[_0xbc56('0x1b1')](_0x523c71,_0xbc56('0x1b2')));_0x16b917[_0xbc56('0xcc')](_0x1e45e1)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x16b917[_0xbc56('0x1a0')](0x0,_0x523c71,_0x20c573)){if(_0x1e45e1[_0xbc56('0xef')]>=_0x20c573[_0xbc56('0x1b3')]){_0x16b917['createStateFinal'](_0x1e45e1,_0x360dde,_0x1a8710,'reason\x200\x20no\x20such\x20number....');}else{_0x16b917[_0xbc56('0x106')](_0x1e45e1,_0x360dde,_0x1a8710,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x20c573[_0xbc56('0x1b4')]+=0x1;_0x1e45e1['state']=0x3;_0x1e45e1[_0xbc56('0xa9')]=_0xbc56('0x1b5');_0x1e45e1[_0xbc56('0x104')]+=0x1;_0x1e45e1['countglobal']+=0x1;ami[_0xbc56('0x4d')](_0xbc56('0x1b6'),ut[_0xbc56('0x1b1')](_0x523c71,'noanswer'));_0x16b917[_0xbc56('0xcc')](_0x1e45e1)[_0xbc56('0xb3')](loggerCatch(_0xbc56('0x1b7')));if(_0x16b917[_0xbc56('0x1a0')](0x3,_0x523c71,_0x20c573)){if(_0x1e45e1['countnoanswerretry']>=_0x20c573[_0xbc56('0x1b8')]){_0x16b917[_0xbc56('0xf5')](_0x1e45e1,_0x360dde,_0x1a8710,_0xbc56('0x1b9'));}else{_0x16b917[_0xbc56('0x106')](_0x1e45e1,_0x360dde,_0x1a8710,_0xbc56('0x1b9'));}}break;case'5':_0x20c573[_0xbc56('0x63')]+=0x1;_0x1e45e1['state']=0x5;_0x1e45e1[_0xbc56('0xa9')]=_0xbc56('0x1ba');_0x1e45e1[_0xbc56('0xed')]+=0x1;_0x1e45e1[_0xbc56('0x102')]+=0x1;ami['emit'](_0xbc56('0x1bb'),ut[_0xbc56('0x1b1')](_0x523c71,_0xbc56('0x1bc')));_0x16b917[_0xbc56('0xcc')](_0x1e45e1)[_0xbc56('0xb3')](loggerCatch(_0xbc56('0x1bd')));if(_0x16b917['checkRetriveMax'](0x5,_0x523c71,_0x20c573)){if(_0x1e45e1['countbusyretry']>=_0x20c573[_0xbc56('0x1a2')]){_0x16b917[_0xbc56('0xf5')](_0x1e45e1,_0x360dde,_0x1a8710,_0xbc56('0x1be'));}else{_0x16b917[_0xbc56('0x106')](_0x1e45e1,_0x360dde,_0x1a8710,'reason\x205\x20busy');}}break;case'8':_0x20c573['outboundCongestionCallsDay']+=0x1;_0x1e45e1[_0xbc56('0xa8')]=0x8;_0x1e45e1['statedesc']='Congestion';_0x1e45e1[_0xbc56('0xee')]+=0x1;_0x1e45e1['countglobal']+=0x1;ami[_0xbc56('0x4d')](_0xbc56('0x1bf'),ut['buildObj'](_0x523c71,_0xbc56('0x1c0')));_0x16b917[_0xbc56('0xcc')](_0x1e45e1)[_0xbc56('0xb3')](loggerCatch(_0xbc56('0x1c1')));if(_0x16b917[_0xbc56('0x1a0')](0x8,_0x523c71,_0x20c573)){if(_0x1e45e1[_0xbc56('0xee')]>=_0x20c573['dialCongestionMaxRetry']){_0x16b917['createStateFinal'](_0x1e45e1,_0x360dde,_0x1a8710,'reason\x208\x20congestion');}else{_0x16b917[_0xbc56('0x106')](_0x1e45e1,_0x360dde,_0x1a8710,_0xbc56('0x1c2'));}}break;case'11':_0x20c573[_0xbc56('0x1c3')]+=0x1;_0x1e45e1['state']=0xb;_0x1e45e1[_0xbc56('0xa9')]=_0xbc56('0x123');_0x1e45e1[_0xbc56('0xf1')]+=0x1;_0x1e45e1[_0xbc56('0x102')]+=0x1;_0x16b917[_0xbc56('0xcc')](_0x1e45e1)[_0xbc56('0xb3')](loggerCatch(_0xbc56('0x127')));if(_0x16b917[_0xbc56('0x1a0')](0xb,_0x523c71,_0x20c573)){if(_0x1e45e1[_0xbc56('0xf1')]>=_0x20c573[_0xbc56('0x125')]){_0x16b917[_0xbc56('0xf5')](_0x1e45e1,_0x360dde,_0x1a8710,_0xbc56('0x1c4'));}else{_0x16b917['stateGlobal'](_0x1e45e1,_0x360dde,_0x1a8710,'reason\x2011\x20abandoned');}}break;case'20':_0x20c573[_0xbc56('0x1c5')]+=0x1;_0x1e45e1['state']=0x14;_0x1e45e1['statedesc']=_0xbc56('0x1c6');_0x1e45e1[_0xbc56('0xf2')]+=0x1;_0x1e45e1[_0xbc56('0x102')]+=0x1;ami[_0xbc56('0x4d')](_0xbc56('0x1c7'),ut[_0xbc56('0x1b1')](_0x523c71,_0xbc56('0x1c8')));_0x16b917[_0xbc56('0xcc')](_0x1e45e1)[_0xbc56('0xb3')](loggerCatch(_0xbc56('0x1c9')));if(_0x16b917[_0xbc56('0x1a0')](0x14,_0x523c71,_0x20c573)){if(_0x1e45e1[_0xbc56('0xf2')]>=_0x20c573['dialAgentRejectMaxRetry']){_0x16b917[_0xbc56('0xf5')](_0x1e45e1,_0x360dde,_0x1a8710,_0xbc56('0x1ca'));}else{_0x16b917[_0xbc56('0x106')](_0x1e45e1,_0x360dde,_0x1a8710,'reason\x2020\x20agentreject');}}break;default:_0x20c573[_0xbc56('0x69')]+=0x1;_0x1e45e1[_0xbc56('0xa8')]=0xc;_0x1e45e1[_0xbc56('0xa9')]=_0x358eeb['reason'];_0x16b917['createHistory'](_0x1e45e1)[_0xbc56('0xb3')](loggerCatch(_0xbc56('0x1cb')));if(_0x16b917['checkRetriveMax'](_0x358eeb[_0xbc56('0x10f')],_0x523c71,_0x20c573)){if(_0x1e45e1[_0xbc56('0xed')]+_0x1e45e1[_0xbc56('0xee')]+_0x1e45e1['countnoanswerretry']+_0x1e45e1[_0xbc56('0xef')]+_0x1e45e1['countdropretry']+_0x1e45e1[_0xbc56('0xf1')]+_0x1e45e1[_0xbc56('0xeb')]+_0x1e45e1[_0xbc56('0xf2')]>=_0x20c573[_0xbc56('0x105')]){_0x16b917[_0xbc56('0x106')](_0x1e45e1,_0x360dde,_0x1a8710,_0x358eeb[_0xbc56('0x10f')]);}else{_0x16b917[_0xbc56('0xf5')](_0x1e45e1,_0x360dde,_0x1a8710,_0x358eeb[_0xbc56('0x10f')]);}}}});};Dialer[_0xbc56('0x1c')][_0xbc56('0x106')]=function(_0xb8f612,_0x3b5540,_0x5bb9b4,_0x2001fb){var _0x1f5038=new Final(_0xb8f612);_0x1f5038[_0xbc56('0xa8')]=0xf;_0x1f5038['statedesc']=_0xbc56('0x1cc');this['createStateFinal'](_0x1f5038,_0x3b5540,_0x5bb9b4,_0x2001fb);};Dialer[_0xbc56('0x1c')][_0xbc56('0xf5')]=function(_0x1317a3,_0x1b69f5,_0x4257b0,_0x5ac784){this[_0xbc56('0xca')](_0x1317a3)['then'](function(_0x23f60b){return _0x1b69f5(msgResponse(_0xbc56('0x1ac'),'Success',_0x5ac784));})[_0xbc56('0xb3')](function(_0x5ab424){return _0x4257b0(msgResponse(_0xbc56('0x1cd'),_0xbc56('0x148'),_0xbc56('0x1ce')));});};Dialer[_0xbc56('0x1c')][_0xbc56('0x9')]=function(_0x3d7dff){var _0x1aa9ba=this;var _0x1bcc4c=_0x3d7dff['dialPredictiveOptimizationPercentage']/0x64;var _0x26b7c3=_0x3d7dff[_0xbc56('0x119')]/(_0x3d7dff[_0xbc56('0x119')]+_0x3d7dff[_0xbc56('0x62')]);var _0x474caa=Math['round'](_0x3d7dff[_0xbc56('0x73')]*(_0x3d7dff[_0xbc56('0x1cf')]/0x64));var _0xf4a36e=Math[_0xbc56('0x1d0')](_0x3d7dff[_0xbc56('0x73')]*(_0x3d7dff[_0xbc56('0x1d1')]/0x64));var _0x2f8317=_0x3d7dff[_0xbc56('0x51')]+_0x3d7dff['talking'];var _0x3fe1b8=Math[_0xbc56('0x1d2')](_0x3d7dff[_0xbc56('0x76')]*_0x3d7dff[_0xbc56('0x77')]*_0x3d7dff[_0xbc56('0x70')]*_0x3d7dff['predictiveIntervalMultiplicativeFactor']);if(_[_0xbc56('0x3d')](_0x3d7dff[_0xbc56('0x2c')])){if(!_['isUndefined'](_0x3d7dff['startPredictive'])){_0x3d7dff[_0xbc56('0x2b')]=undefined;loggerPredictive['error'](_0xbc56('0x1d3'),_0xbc56('0x1d4'));}if(!_[_0xbc56('0x3d')](_0x3d7dff[_0xbc56('0x95')])){loggerPredictive['error'](_0xbc56('0x1d3'),_0xbc56('0x1d5'));clearInterval(_0x3d7dff[_0xbc56('0x95')]);_0x3d7dff[_0xbc56('0x95')]=undefined;}_0x3d7dff[_0xbc56('0x2c')]=moment()[_0xbc56('0x7c')](_0xbc56('0xfa'));loggerPredictive[_0xbc56('0x82')](_0x3d7dff[_0xbc56('0x40')],'collection\x20data\x20in\x20progressive\x20at',_0x3d7dff[_0xbc56('0x2c')]);this[_0xbc56('0x15e')](_0x3d7dff,0x1);}else if(ifInterval(_0x3d7dff['dialPredictiveInterval'],_0x3d7dff['startProgressive'])){this[_0xbc56('0x15e')](_0x3d7dff,0x1);loggerPredictiveCalls[_0xbc56('0x82')](_0xbc56('0x1d6'),_0x3d7dff[_0xbc56('0x2c')],_0x3d7dff[_0xbc56('0x40')]);_0x3d7dff[_0xbc56('0x76')]=0x0;_0x3d7dff['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x1bcc4c<_0x26b7c3&&_0x3d7dff[_0xbc56('0x1d7')]==='dropRate'){freeVariablesPredictive(_0x3d7dff);loggerPredictive[_0xbc56('0x82')](_0xbc56('0x1d8'),'Dropped\x20calls\x20day',_0x26b7c3,_0xbc56('0x2c'),_0x3d7dff[_0xbc56('0x40')]);}else if(_0x3fe1b8<_0x3d7dff[_0xbc56('0x1d9')]&&_0x3d7dff['dialPredictiveOptimization']===_0xbc56('0x1da')){freeVariablesPredictive(_0x3d7dff);loggerPredictive[_0xbc56('0x82')](_0xbc56('0x1db'),_0xbc56('0x1dc'),_0x3fe1b8,'Drop\x20in\x20this\x20interval',_0x3d7dff[_0xbc56('0x1d9')],'startProgressive',_0x3d7dff[_0xbc56('0x40')]);}else if(!ifInterval(_0x3d7dff[_0xbc56('0x1dd')],_0x3d7dff['startProgressive'])&&_[_0xbc56('0x3d')](_0x3d7dff['startPredictive'])&&!_['isUndefined'](_0x3d7dff['startProgressive'])){_0x3d7dff[_0xbc56('0x2b')]=moment()[_0xbc56('0x7c')](_0xbc56('0xfa'));loggerPredictive[_0xbc56('0x82')](_0x3d7dff[_0xbc56('0x40')],'started\x20in\x20predictive\x20at',_0x3d7dff['startPredictive']);this[_0xbc56('0xbe')](_0x3d7dff['dialPredictiveInterval'])[_0xbc56('0xb8')](this[_0xbc56('0x1de')](_0x3d7dff))[_0xbc56('0xb8')](mergeDataErlangB(_0x3d7dff))[_0xbc56('0xb8')](this[_0xbc56('0x1df')](_0x3d7dff))[_0xbc56('0xb3')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x3d7dff));}else if(!ifInterval(_0x3d7dff[_0xbc56('0x1dd')],_0x3d7dff[_0xbc56('0x2b')])){_0x3d7dff[_0xbc56('0x1d9')]=0x0;_0x3d7dff[_0xbc56('0x2b')]=moment()[_0xbc56('0x7c')](_0xbc56('0xfa'));loggerPredictive[_0xbc56('0x82')](_0x3d7dff[_0xbc56('0x40')],_0xbc56('0x1e0'),_0x3d7dff[_0xbc56('0x2b')]);clearInterval(_0x3d7dff['handlePredictive']);_0x3d7dff[_0xbc56('0x95')]=undefined;this['averageHandleTime'](_0x3d7dff[_0xbc56('0x1dd')])[_0xbc56('0xb8')](this[_0xbc56('0x1de')](_0x3d7dff))[_0xbc56('0xb8')](mergeDataErlangB(_0x3d7dff))['then'](this['startMethodPredictive'](_0x3d7dff))[_0xbc56('0xb3')](loggerCatchPredictive(_0xbc56('0x1e1'),_0x3d7dff));}else if(_0x3d7dff['predictiveIntervalAvailable']&&_0x2f8317<_0x3d7dff[_0xbc56('0x73')]-_0xf4a36e){freeVariablesPredictive(_0x3d7dff);loggerPredictive[_0xbc56('0x82')](_0x3d7dff[_0xbc56('0x40')],_0xbc56('0x1e2'),_0x2f8317,')\x20are\x20less\x20than\x20threshold\x20(',_0x3d7dff[_0xbc56('0x73')],'-',_0xf4a36e,'=',_0x3d7dff[_0xbc56('0x73')]-_0xf4a36e,')');}else if(_0x3d7dff[_0xbc56('0x73')]&&_0x2f8317>_0x3d7dff[_0xbc56('0x73')]+_0x474caa){freeVariablesPredictive(_0x3d7dff);loggerPredictive[_0xbc56('0x82')](_0x3d7dff[_0xbc56('0x40')],_0xbc56('0x1e2'),_0x2f8317,_0xbc56('0x1e3'),_0x3d7dff['predictiveIntervalAvailable'],'+',_0x474caa,'=',_0x3d7dff['predictiveIntervalAvailable']+_0x474caa,')');}};Dialer[_0xbc56('0x1c')][_0xbc56('0x1de')]=function(_0x6310b2){var _0x60a843=this;return function(_0x352f4a){return new BPromise(function(_0xb2121f,_0x58a4b0){_[_0xbc56('0x93')](_0x6310b2,_0x352f4a[0x0]);if(checkGetDataPredictive(_0x352f4a[0x0])){var _0x3030ff=_0x6310b2[_0xbc56('0x73')]=_0x6310b2[_0xbc56('0x55')]+_0x6310b2[_0xbc56('0x51')];var _0x305433=_0x6310b2[_0xbc56('0x1dd')]*0x3c;var _0x534e8e=_0x352f4a[0x0][_0xbc56('0x6c')]+_0x352f4a[0x0][_0xbc56('0x6b')];var _0x34f78f=(_0x352f4a[0x0]['predictiveIntervalAnsweredCalls']+_0x352f4a[0x0][_0xbc56('0x6e')]+_0x352f4a[0x0][_0xbc56('0x6d')])/_0x352f4a[0x0]['predictiveIntervalTotalCalls'];_0x6310b2[_0xbc56('0x70')]=_0x34f78f>0x0?_0x34f78f:0x1;switch(_0x6310b2[_0xbc56('0x1d7')]){case'dropRate':var _0x9b0192=_0x6310b2['dialPredictiveOptimizationPercentage']/0x64;return _0x60a843[_0xbc56('0x1e4')](_0x3030ff,_0x305433,_0x534e8e,_0x34f78f,_0x9b0192)[_0xbc56('0xb8')](function(_0x431db0){return _0xb2121f(_0x431db0);});case _0xbc56('0x1e5'):var _0x1bb38a=_0x6310b2[_0xbc56('0x1e6')]/0x64;return _0x60a843[_0xbc56('0x1e7')](_0x3030ff,_0x305433,_0x534e8e,_0x34f78f,_0x1bb38a)[_0xbc56('0xb8')](function(_0x3b0a8c){return _0xb2121f(_0x3b0a8c);});default:return _0x58a4b0(msgResponse(_0xbc56('0x1e8'),'Failure',_0xbc56('0x1e9')));}}else{return _0x58a4b0(msgResponse(_0xbc56('0x1e8'),_0xbc56('0x148'),_0xbc56('0x1ea')));}});};};Dialer['prototype'][_0xbc56('0x1eb')]=function(_0xc9532){var _0x3b40dc=this;return function(_0x31d288){return new BPromise(function(_0x228590,_0x29707b){_['merge'](_0xc9532,_0x31d288[0x0]);if(checkGetDataPredictive(_0x31d288[0x0])){loggerPredictive[_0xbc56('0x82')](JSON[_0xbc56('0x49')](_0x31d288[0x0]));if(_0xc9532[_0xbc56('0x1d7')]==='dropRate'){return _0x3b40dc['getVoiceQueueRtPauses'](_0xc9532['id'])[_0xbc56('0xb8')](function(_0x4efc66){var _0x5709c7=_0xc9532[_0xbc56('0x164')]-_0x4efc66[0x0][_0xbc56('0x1ec')];var _0x188064=_0xc9532[_0xbc56('0x1dd')]*0x3c;var _0x2d27e4=_0x31d288[0x0][_0xbc56('0x6c')]+_0x31d288[0x0][_0xbc56('0x6b')];var _0x5626fb=(_0x31d288[0x0][_0xbc56('0x6a')]+_0x31d288[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x31d288[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x31d288[0x0][_0xbc56('0x74')];var _0x51ac8c=_0xc9532['dialPredictiveOptimizationPercentage']/0x64;_0xc9532['predictiveIntervalPauses']=_0x4efc66[0x0]['outboundQueuePauses']||0x0;_0xc9532[_0xbc56('0x70')]=_0x5626fb>0x0?_0x5626fb:0x1;return _0x3b40dc[_0xbc56('0x1e4')](_0x5709c7,_0x188064,_0x2d27e4,_0x5626fb,_0x51ac8c);})[_0xbc56('0xb8')](function(_0x3f4eaa){return _0x228590(_0x3f4eaa);})[_0xbc56('0xb3')](function(_0x1b2d87){return _0x29707b(msgResponse('[CatchErlangB]','Failure',JSON[_0xbc56('0x49')](_0x1b2d87)));});}if(_0xc9532[_0xbc56('0x1d7')]===_0xbc56('0x1e5')){return _0x3b40dc[_0xbc56('0xc8')](_0xc9532['id'])[_0xbc56('0xb8')](function(_0x319f0d){var _0x42accf=_0xc9532[_0xbc56('0x164')]-_0x319f0d[0x0][_0xbc56('0x1ec')];var _0x58b7a2=_0xc9532[_0xbc56('0x1dd')]*0x3c;var _0x14a33a=_0x31d288[0x0][_0xbc56('0x6c')]+_0x31d288[0x0][_0xbc56('0x6b')];var _0x1498f6=(_0x31d288[0x0]['predictiveIntervalAnsweredCalls']+_0x31d288[0x0][_0xbc56('0x6e')]+_0x31d288[0x0][_0xbc56('0x6d')])/_0x31d288[0x0][_0xbc56('0x74')];var _0x1391b2=_0xc9532[_0xbc56('0x1e6')]/0x64;_0xc9532[_0xbc56('0x72')]=_0x319f0d[0x0][_0xbc56('0x1ec')]||0x0;_0xc9532[_0xbc56('0x70')]=_0x1498f6>0x0?_0x1498f6:0x1;return _0x3b40dc[_0xbc56('0x1e7')](_0x42accf,_0x58b7a2,_0x14a33a,_0x1498f6,_0x1391b2);})[_0xbc56('0xb8')](function(_0x37b73c){return _0x228590(_0x37b73c);})[_0xbc56('0xb3')](function(_0x1d0c92){return _0x29707b(msgResponse(_0xbc56('0x1ed'),'Failure',JSON[_0xbc56('0x49')](_0x1d0c92)));});}}else{return _0x29707b(msgResponse(_0xbc56('0x1e8'),_0xbc56('0x148'),'check\x20failure'));}});};};Dialer[_0xbc56('0x1c')][_0xbc56('0x1df')]=function(_0x5307b8){var _0x353483=this;return function(){var _0x50b302=0x0;var _0x5101a9=Math[_0xbc56('0x1d2')](_0x5307b8[_0xbc56('0x90')]*0x3e8);if(_0x5101a9>0x0){_0x5101a9=_0x5101a9<0x64?0x64:_0x5101a9;loggerPredictive[_0xbc56('0x82')](_0x5307b8['name'],'one\x20call\x20every:',_0x5101a9,'milliseconds');_0x5307b8[_0xbc56('0x95')]=setInterval(function(){_0x353483[_0xbc56('0x95')](_0x5307b8);loggerPredictiveCalls[_0xbc56('0x82')](_0xbc56('0x1ee'),_0x50b302+=0x1);},_0x5101a9);}else{loggerPredictive[_0xbc56('0x82')](_0x5307b8['name'],_0xbc56('0x1ef'));}};};Dialer[_0xbc56('0x1c')][_0xbc56('0x1f0')]=function(_0x2f616e,_0x3ab5d8){var _0x439957=this;return function(_0x2e27fc){if(_[_0xbc56('0x45')](_0x2e27fc)){if(_['isNil'](_0x3ab5d8['UserId'])||!_0x3ab5d8[_0xbc56('0x1f1')]){if(_0x2f616e[_0xbc56('0x5d')]===_0xbc56('0x8')){_0x2f616e[_0xbc56('0x132')]=_[_0xbc56('0x3d')](_0x2f616e['queueStatusComplete'])?!![]:_0x2f616e['queueStatusComplete'];var _0x7eb6ad=uuid['v4']();_0x439957[_0xbc56('0x28')][_0x7eb6ad]=new Action(_0x2f616e,_0x3ab5d8,_0x7eb6ad);loggerBooked[_0xbc56('0x82')](_0xbc56('0x1f2'),_0x7eb6ad,'queueStatusComplete:\x20',JSON[_0xbc56('0x49')](_0x2f616e[_0xbc56('0x132')]),_0xbc56('0x1f3'),_0x2f616e['name']);if(_0x2f616e[_0xbc56('0x132')]){_0x2f616e[_0xbc56('0x132')]=![];_0x439957['queueBooked'][_0x439957['actions'][_0x7eb6ad]['queue']]=[];ami[_0xbc56('0xb0')]({'actionid':_0x7eb6ad,'action':_0xbc56('0x1f4'),'queue':_0x2f616e[_0xbc56('0x40')]})[_0xbc56('0xb3')](function(_0x2cf9c7){_0x439957[_0xbc56('0xce')](_0x2f616e);_0x439957[_0xbc56('0xc1')]({'active':![],'ContactId':_0x439957[_0xbc56('0x28')][_0x7eb6ad]['ContactId'],'ListId':_0x439957[_0xbc56('0x28')][_0x7eb6ad][_0xbc56('0xd7')],'VoiceQueueId':_0x439957[_0xbc56('0x28')][_0x7eb6ad][_0xbc56('0xfb')]||undefined,'CampaignId':_0x439957[_0xbc56('0x28')][_0x7eb6ad][_0xbc56('0x107')]||undefined})[_0xbc56('0xb3')](loggerCatch(_0xbc56('0x1f5')));delete _0x439957[_0xbc56('0x28')][_0x7eb6ad];});}else{loggerBooked[_0xbc56('0x82')]('[booked][checkContactBlack][else]',JSON[_0xbc56('0x49')](_0x2f616e[_0xbc56('0x132')]),_0xbc56('0x1f3'),_0x2f616e['name']);_0x439957[_0xbc56('0xce')](_0x2f616e);_0x439957['rescheduleContact']({'active':![],'ContactId':_0x439957[_0xbc56('0x28')][_0x7eb6ad][_0xbc56('0xd6')],'ListId':_0x439957['actions'][_0x7eb6ad][_0xbc56('0xd7')],'VoiceQueueId':_0x439957[_0xbc56('0x28')][_0x7eb6ad]['VoiceQueueId']||undefined,'CampaignId':_0x439957[_0xbc56('0x28')][_0x7eb6ad][_0xbc56('0x107')]||undefined})['catch'](loggerCatch(_0xbc56('0x1f5')));delete _0x439957[_0xbc56('0x28')][_0x7eb6ad];}}else{return _0x439957['actionOriginate'](_0x2f616e,_0x3ab5d8);}}else{if(getDiff(_0x3ab5d8[_0xbc56('0x1f6')])<_0x2f616e[_0xbc56('0x1f7')]*0x3c){if(_0x3ab5d8[_0xbc56('0x1f8')]&&!_0x3ab5d8[_0xbc56('0x1f8')][_0xbc56('0x1f9')]){_0x439957[_0xbc56('0x21')][_0xbc56('0x133')](_0x3ab5d8['id'])[_0xbc56('0x1f')](function(){_0x439957['updateOriginated'](_0x2f616e);});}else{_0x439957[_0xbc56('0xc3')]({'active':![]},_0x3ab5d8['id'],0x1)[_0xbc56('0x1f')](function(){console[_0xbc56('0x1fa')](_0xbc56('0x1fb'));_0x439957[_0xbc56('0xce')](_0x2f616e);});}}else{_0x2f616e[_0xbc56('0x68')]+=0x1;_0x439957[_0xbc56('0xce')](_0x2f616e);if(_0x2f616e[_0xbc56('0x1fc')]){_0x439957[_0xbc56('0xc1')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x3ab5d8[_0xbc56('0xd6')],'ListId':_0x3ab5d8[_0xbc56('0xd7')],'VoiceQueueId':_0x3ab5d8[_0xbc56('0xfb')]||undefined,'CampaignId':_0x3ab5d8[_0xbc56('0x107')]||undefined})[_0xbc56('0xb3')](loggerCatch(_0xbc56('0x1fd')));_0x439957['createHistory'](createObjHistory(_0x2f616e,_0x3ab5d8,_0xbc56('0x1fe'),0x17,_0xbc56('0x1ff')))[_0xbc56('0xb3')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x439957[_0xbc56('0xd4')](createObjHistory(_0x2f616e,_0x3ab5d8,_0xbc56('0x200'),0x16,_0xbc56('0x201')),_0xbc56('0x202'),_0xbc56('0x203'));}}}}else{_0x2f616e['outboundBlacklistCallsDay']+=0x1;_0x439957[_0xbc56('0xd4')](createObjHistory(_0x2f616e,_0x3ab5d8,_0xbc56('0x204'),0xd,_0xbc56('0x205')),_0xbc56('0x206'),_0xbc56('0x207'));throw _0xbc56('0x208');}};};Dialer['prototype'][_0xbc56('0x163')]=function(_0xf84f2a){var _0x4c83de=this;var _0x3085d3=[];var _0x1b3db1=_0xf84f2a[_0xbc56('0x209')]-_0xf84f2a[_0xbc56('0x75')]-_0xf84f2a[_0xbc56('0x20a')];emitCampaignSummary(_0xf84f2a);if(_0x1b3db1>0x0){if(_0x1b3db1>this[_0xbc56('0x26')]){_0x1b3db1=this['maxNumberOriginate'];}_0xf84f2a[_0xbc56('0x20a')]+=_0x1b3db1;this[_0xbc56('0xc7')](_0xf84f2a['id'],_0x1b3db1,_0xf84f2a[_0xbc56('0x20b')])[_0xbc56('0xb8')](function(_0x1832b2){_0xf84f2a[_0xbc56('0x20a')]-=_0x1b3db1;_0xf84f2a[_0xbc56('0x20a')]=_0xf84f2a[_0xbc56('0x20a')]>0x0?_0xf84f2a[_0xbc56('0x20a')]:0x0;if(!checkContactEmpty(_0x1832b2)){_0xf84f2a[_0xbc56('0x3e')]='AVAILABLE_CONTACTS_FINISHED';logger[_0xbc56('0x82')]('[getContactCampaign2][Empty]'+_0xf84f2a[_0xbc56('0x40')]);}else{_0xf84f2a['originated']+=_0x1832b2[_0xbc56('0x14f')];_0xf84f2a['message']=_0xbc56('0x20c');for(var _0x5fb8df=0x0;_0x5fb8df<_0x1832b2[_0xbc56('0x14f')];_0x5fb8df+=0x1){_0xf84f2a[_0xbc56('0x20d')]+=0x1;if(_[_0xbc56('0xaf')](_0x1832b2[_0x5fb8df])||_[_0xbc56('0xaf')](_0x1832b2[_0x5fb8df]['Contact'])||_['isNil'](_0x1832b2[_0x5fb8df][_0xbc56('0x170')]['phone'])){_0x4c83de['emptyContact'](_0xbc56('0x20e'),_0xf84f2a,_0x1832b2[_0x5fb8df]);}else{_0x4c83de[_0xbc56('0xbc')](_['pick'](_0x1832b2[_0x5fb8df],[_0xbc56('0x107'),_0xbc56('0x20f')]))[_0xbc56('0xb8')](_0x4c83de[_0xbc56('0x1f0')](_0xf84f2a,_0x1832b2[_0x5fb8df]))[_0xbc56('0xb3')](_0x4c83de[_0xbc56('0xd1')](_0xbc56('0x210'),_0xf84f2a));}}}})[_0xbc56('0xb3')](loggerGetContactDialer(_0xbc56('0x211'),_0xf84f2a,_0x1b3db1));}};Dialer[_0xbc56('0x1c')][_0xbc56('0x15e')]=function(_0x5b67ab,_0x47200e){var _0x346f2c=this;var _0x438f19=[];var _0x1e37db=_0x47200e>=0x1?_0x47200e:0x1;var _0x408eb5=[];if(_0x5b67ab[_0xbc56('0x5d')]===_0xbc56('0x8')){_0x1e37db=0x1;}var _0xa24d29=Math[_0xbc56('0x1d2')](_0x5b67ab[_0xbc56('0x51')]*_0x1e37db)-_0x5b67ab['originated']-_0x5b67ab[_0xbc56('0x20a')];emitVoiceQueueSummary(_0x5b67ab);if(_0x5b67ab[_0xbc56('0x212')]>0x0){var _0x2024bf=_0x5b67ab[_0xbc56('0x212')]-_0x5b67ab['originated']-_0x5b67ab[_0xbc56('0x55')]-_0x5b67ab[_0xbc56('0x20a')]-_0x5b67ab[_0xbc56('0x52')];if(_0xa24d29>_0x2024bf){_0xa24d29=_0x2024bf;}}if(_0xa24d29>0x0){if(_0x5b67ab[_0xbc56('0x5d')]===_0xbc56('0x8')){_0xa24d29=0x1;}if(_0xa24d29>this[_0xbc56('0x26')]){_0xa24d29=this['maxNumberOriginate'];}_0x5b67ab[_0xbc56('0x20a')]+=_0xa24d29;for(var _0x27a5f5 in this[_0xbc56('0x24')]){if(this[_0xbc56('0x24')][_0xbc56('0x9b')](_0x27a5f5)){if(this[_0xbc56('0x24')][_0x27a5f5][_0xbc56('0xa8')]===_0xbc56('0x213')&&this['agents'][_0x27a5f5][_0xbc56('0xb1')]===_0xbc56('0xdd')){_0x438f19[_0xbc56('0x12e')](this[_0xbc56('0x24')][_0x27a5f5]['id']);}}}this[_0xbc56('0xc5')](_0x5b67ab['id'],_0x438f19,_0xa24d29,_0x5b67ab[_0xbc56('0x20b')])['then'](function(_0x27e011){_0x5b67ab[_0xbc56('0x20a')]-=_0xa24d29;_0x5b67ab[_0xbc56('0x20a')]=_0x5b67ab[_0xbc56('0x20a')]>0x0?_0x5b67ab[_0xbc56('0x20a')]:0x0;if(!checkContactEmpty(_0x27e011)){_0x346f2c[_0xbc56('0xb6')](_0x5b67ab)[_0xbc56('0xb8')](sendMessageReschedule(_0x5b67ab))[_0xbc56('0xb3')](loggerCatch('[countReScheduled]\x20'));}else{_0x5b67ab[_0xbc56('0x75')]+=_0x27e011[_0xbc56('0x14f')];_0x5b67ab['message']=_0x5b67ab[_0xbc56('0x5d')]==='booked'?_0xbc56('0x178'):_0xbc56('0x20c');for(var _0x4ad474=0x0;_0x4ad474<_0x27e011[_0xbc56('0x14f')];_0x4ad474+=0x1){if(_['isNil'](_0x27e011[_0x4ad474])||_[_0xbc56('0xaf')](_0x27e011[_0x4ad474][_0xbc56('0x170')])||_[_0xbc56('0xaf')](_0x27e011[_0x4ad474]['Contact']['phone'])){_0x346f2c['emptyContact'](_0xbc56('0x20e'),_0x5b67ab,_0x27e011[_0x4ad474]);}else{_0x346f2c['checkIsBlackList'](_[_0xbc56('0xd5')](_0x27e011[_0x4ad474],['VoiceQueueId',_0xbc56('0x20f')]))['then'](_0x346f2c[_0xbc56('0x1f0')](_0x5b67ab,_0x27e011[_0x4ad474]))[_0xbc56('0xb3')](_0x346f2c[_0xbc56('0xd1')]('[actionOriginate]\x20',_0x5b67ab));}}}})['catch'](loggerGetContactDialer('[getContactDialer2]',_0x5b67ab,_0xa24d29));}};Dialer[_0xbc56('0x1c')][_0xbc56('0x95')]=function(_0x2f85da){var _0x22669d=this;if(_0x2f85da[_0xbc56('0x212')]>0x0){var _0x130f1d=_0x2f85da[_0xbc56('0x212')]-_0x2f85da[_0xbc56('0x75')]-_0x2f85da[_0xbc56('0x55')];if(_0x130f1d>0x0){this['tryOriginatePredictive'](_0x2f85da);}else{loggerPredictiveCalls[_0xbc56('0x82')](_0xbc56('0x214'));}}else{this[_0xbc56('0x215')](_0x2f85da);}};Dialer[_0xbc56('0x1c')]['tryOriginatePredictive']=function(_0xc25c75){var _0x14e305=this;var _0x553f56=[];_0xc25c75[_0xbc56('0x75')]+=0x1;for(var _0x176204 in this[_0xbc56('0x24')]){if(this[_0xbc56('0x24')]['hasOwnProperty'](_0x176204)){if(this[_0xbc56('0x24')][_0x176204][_0xbc56('0xa8')]===_0xbc56('0x213')&&this[_0xbc56('0x24')][_0x176204]['status']===_0xbc56('0xdd')){_0x553f56['push'](this['agents'][_0x176204]['id']);}}}this[_0xbc56('0xc5')](_0xc25c75['id'],_0x553f56,0x1,_0xc25c75[_0xbc56('0x20b')])[_0xbc56('0xb8')](function(_0x39f419){if(!checkContactEmpty(_0x39f419)){checkContactLowerLimitOriginate(_0xc25c75,0x1,0x0);_0x14e305[_0xbc56('0xb6')](_0xc25c75)[_0xbc56('0xb8')](sendMessageReschedule(_0xc25c75))[_0xbc56('0xb3')](loggerCatch(_0xbc56('0xb9')));}else{_0xc25c75[_0xbc56('0x3e')]=_0xbc56('0x20c');if(_['isNil'](_0x39f419[0x0])||_[_0xbc56('0xaf')](_0x39f419[0x0][_0xbc56('0x170')])||_[_0xbc56('0xaf')](_0x39f419[0x0][_0xbc56('0x170')][_0xbc56('0x16f')])){_0x14e305[_0xbc56('0xd2')](_0xbc56('0x20e'),_0xc25c75,_0x39f419[0x0]);}else{_0x14e305[_0xbc56('0xba')](_[_0xbc56('0xd5')](_0x39f419[0x0],[_0xbc56('0xfb'),_0xbc56('0x20f')]))[_0xbc56('0xb8')](_0x14e305[_0xbc56('0x1f0')](_0xc25c75,_0x39f419[0x0]))[_0xbc56('0xb3')](_0x14e305['loggerHandler'](_0xbc56('0x216'),_0xc25c75));}}})['catch'](loggerGetContactDialer(_0xbc56('0x217'),_0xc25c75,0x1));emitVoiceQueueSummary(_0xc25c75);};Dialer['prototype'][_0xbc56('0x1e4')]=function(_0x2e5be7,_0xaf54e8,_0x4547df,_0x265300,_0x2f54e3,_0x5c2f3d){loggerPredictive['info']('--------\x20Drop\x20Rate\x20--------');loggerPredictive['info'](_0xbc56('0x218'),_0x2e5be7);loggerPredictive[_0xbc56('0x82')](_0xbc56('0x219'),_0xaf54e8);loggerPredictive['info'](_0xbc56('0x21a'),_0x4547df);loggerPredictive[_0xbc56('0x82')](_0xbc56('0x21b'),_0x265300);loggerPredictive[_0xbc56('0x82')](_0xbc56('0x21c'),_0x2f54e3);loggerPredictive[_0xbc56('0x82')]('---------------------------');return new BPromise(function(_0x4c0573,_0x4c597b){if(_0x2e5be7<=0x0||isNaN(_0x2e5be7)){return _0x4c597b(msgResponse(_0xbc56('0x21d'),'Error',_0xbc56('0x21e')+_0x2e5be7));}if(_0x4547df<=0x0||isNaN(_0x4547df)){return _0x4c597b(msgResponse(_0xbc56('0x21d'),_0xbc56('0x48'),'Ts\x20=\x20'+_0x4547df));}if(_0x265300<=0x0||isNaN(_0x265300)){return _0x4c597b(msgResponse(_0xbc56('0x21d'),_0xbc56('0x48'),'p\x20=\x20'+_0x265300));}if(_0xaf54e8<=0x0||isNaN(_0xaf54e8)){return _0x4c597b(msgResponse(_0xbc56('0x21d'),_0xbc56('0x48'),_0xbc56('0x21f')+_0xaf54e8));}if(_0x2f54e3<=0x0||isNaN(_0x2f54e3)){return _0x4c597b(msgResponse(_0xbc56('0x21d'),'Error','Amax\x20=\x20'+_0x2f54e3));}_0x5c2f3d=_0x5c2f3d||0x0;var _0x5175e7=0x1/_0x4547df;var _0x29c03a=0x0;var _0x59c798=0x0;var _0x14c69f=0x0;var _0x4301a9=0x0;for(var _0x2b476e=0x0;_0x14c69f<_0x2f54e3;_0x2b476e+=0x1){_0x59c798=_0x2b476e/_0xaf54e8;_0x29c03a=(_0x265300*_0x59c798+_0x5c2f3d)/_0x5175e7;_0x14c69f=erlangb(_0x29c03a,_0x2e5be7);_0x4301a9=_0x29c03a/_0x2e5be7*(0x1-erlangb(_0x29c03a,_0x2e5be7));}return _0x4c0573({'erlangCalls':_0x2b476e,'erlangCallToSecond':_0xaf54e8/_0x2b476e,'erlangAbandonmentRate':_0x14c69f,'erlangBusyFactor':_0x4301a9});});};Dialer['prototype'][_0xbc56('0x1e7')]=function(_0x5d37c2,_0x35f525,_0x36b4ab,_0x425002,_0x3cb6a1,_0x570606){loggerPredictive['info'](_0xbc56('0x220'));loggerPredictive[_0xbc56('0x82')]('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',_0x5d37c2);loggerPredictive[_0xbc56('0x82')](_0xbc56('0x219'),_0x35f525);loggerPredictive['info'](_0xbc56('0x21a'),_0x36b4ab);loggerPredictive[_0xbc56('0x82')](_0xbc56('0x21b'),_0x425002);loggerPredictive['info']('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3cb6a1);loggerPredictive[_0xbc56('0x82')](_0xbc56('0x88'));return new BPromise(function(_0x171676,_0x3fbd70){if(_0x5d37c2<=0x0||isNaN(_0x5d37c2)){return _0x3fbd70(msgResponse(_0xbc56('0x221'),'Error','m\x20=\x20'+_0x5d37c2));}if(_0x36b4ab<=0x0||isNaN(_0x36b4ab)){return _0x3fbd70(msgResponse(_0xbc56('0x221'),_0xbc56('0x48'),'Ts\x20=\x20'+_0x36b4ab));}if(_0x425002<=0x0||isNaN(_0x425002)){return _0x3fbd70(msgResponse(_0xbc56('0x221'),'Error',_0xbc56('0x222')+_0x425002));}if(_0x35f525<=0x0||isNaN(_0x35f525)){return _0x3fbd70(msgResponse(_0xbc56('0x221'),'Error',_0xbc56('0x21f')+_0x35f525));}if(_0x3cb6a1<=0x0||isNaN(_0x3cb6a1)){return _0x3fbd70(msgResponse(_0xbc56('0x221'),_0xbc56('0x48'),_0xbc56('0x223')+_0x3cb6a1));}_0x570606=_0x570606||0x0;var _0x1694bc=0x1/_0x36b4ab;var _0x1b4f92=0x0;var _0x4afaa9=0x0;var _0x310d1a=0x0;var _0x53960e=0x0;for(var _0x1c8521=0x0;_0x53960e<_0x3cb6a1;_0x1c8521+=0x1){_0x4afaa9=_0x1c8521/_0x35f525;_0x1b4f92=(_0x425002*_0x4afaa9+_0x570606)/_0x1694bc;_0x310d1a=erlangb(_0x1b4f92,_0x5d37c2);_0x53960e=_0x1b4f92/_0x5d37c2*(0x1-erlangb(_0x1b4f92,_0x5d37c2));}return _0x171676({'erlangCalls':_0x1c8521,'erlangCallToSecond':_0x35f525/_0x1c8521,'erlangAbandonmentRate':_0x310d1a,'erlangBusyFactor':_0x53960e});});};module[_0xbc56('0x224')]=Dialer;