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