143929e7174e7a17af3efbc8392b43421a86d7e0
[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 _0xa9e0=['[syncMachineIvr]','[syncHangupIvr][createHistory]','dialQueueProject','AGI','[syncHangupIvr]','cause-txt','Unknow','reason','agent','agiafterat','dialQueueProject2','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','droptime','responsetime','dialQueueTimeout','Drop','TIMEOUT','dialDropMaxRetry','countdropretry','dialDropRetryFrequency','minutes','[rescheduleContact][Drop]','calleridname','calleridnum','CRIS\x20evt\x2010.1','CRIS\x20queueCallerAbandon\x2010.1','log','CRIS\x20createHistory\x2010.1','[syncAgentComplete][createHistory][10]','Abandoned','dropreason','CALLEREXIT','countabandonedretry','add','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','endtime','CRIS\x20createHistory\x2011','[syncAgentComplete][createHistory][11]','syncNewExten','channel','actionid','locked','paused','stateinterface','push','merge','idHopper','[unlockQueueStatus][undefined]','queueStatusComplete','[booked][unlockQueueStatus]','preview','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','Failure','\x20Timezone\x20unknow\x20','isArray','Action','command','iftime\x20%s,%s','interval','timezones','content','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','checkDialMethod','power','handlePower','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','syncQueueSummary','dialGlobalInterval','dialTimezone','[syncQueueSummary]','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','actionOriginate','object','voiceQueue\x20is\x20undefine','Contact','phone','originate','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialAgiAfterHangupAgent','ACTIVE','xcally-motion-dialer','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-CAMPAIGNID','tags','createdAt','updatedAt','XMD-','toUpper','callerid','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','originatecalleridname','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','isSuccess','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','countnoanswerretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','dialNoAnswerMaxRetry','countbusyretry','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','countcongestionretry','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoSuchNumberRetryFrequency','dialMachineRetryFrequency','[rescheduleContact][Machine]','dialAgentRejectMaxRetry','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','countglobal','reason\x200\x20no\x20such\x20number....','createStateFinal','NoAnswer','stateGlobal','reason\x203\x20ringing\x20no\x20answer','Busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','reason\x208\x20congestion','outboundAbandonedCallsDay','dialAbandonedMaxRetry','reason\x2011\x20abandoned','AgentReject','[syncAgentComplete][createHistory][20]','outboundUnknownCallsDay','[syncAgentComplete][createHistory][?]','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dropRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','outboundQueuePauses','[CatchErlangB]','milliseconds','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','Agent','voicePause','Contact\x20updated','RECALLINQUEUE','RecallInQueue','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][MoveBlacklist]','limitCalls','temp','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','reachable','[actionOriginate]\x20','checkIsBlackList','[getContactDialer2]','tryOriginatePredictive','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','p\x20=\x20','interval\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','m\x20=\x20','[busyFactor]','Umin\x20=\x20','exports','util','lodash','bluebird','md5','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','../ami','redis','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperFinal','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','env','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','finally','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','startPredictive','startProgressive','queueBooked','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','syncHangup','newexten','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','Error','stringify','diff','seconds','emit','type','strategy','loggedIn','pTalking','sumDuration','sumHoldTime','talking','total','abandoned','waiting','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','format','voice:queue:%s','voice_queue:save','ivr','campaign:save','-----\x20Stats\x20Predictive\x20---','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','outbound','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','originated','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','available','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','IS_DISACTIVED','is\x20disactive','state','statedesc','starttime','[uniqueid]','clearZombieChannels','hasOwnProperty','isNil','catch','No\x20such\x20channel','[Dialer][checkChannel]','queue','updateOriginated','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','[countReScheduled]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','emptyContact','saveInDb','pick','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','Success','isTrunkReachable','SIP/%s','status','unmonitored','uniqueid','variable','exten','dialAMDActive','value','HANGUP','membername','AMD','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','amd','[syncMachine][createHistory]','HangupInAMD','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','[syncMachineIvr][createHistory]'];(function(_0x556bb1,_0x34830d){var _0x45455f=function(_0x13c6ba){while(--_0x13c6ba){_0x556bb1['push'](_0x556bb1['shift']());}};_0x45455f(++_0x34830d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var uuid=require('uuid');var moment=require('moment');var rr=require('rr');var md5=require(_0x0a9e('0x3'));var Redis=require('ioredis');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var loggerBooked=require(_0x0a9e('0x5'))(_0x0a9e('0x7'));var loggerPredictive=require('../../../config/logger')(_0x0a9e('0x8'));var loggerPredictiveCalls=require(_0x0a9e('0x5'))(_0x0a9e('0x9'));var loggerSyncQueueSummary=require('../../../config/logger')('syncQueueSummary');var ami=require(_0x0a9e('0xa'));config['redis']=_['defaults'](config[_0x0a9e('0xb')],{'host':_0x0a9e('0xc'),'port':0x18eb});var io=require(_0x0a9e('0xd'))(new Redis(config[_0x0a9e('0xb')]));var cmHopper=require(_0x0a9e('0xe'));var cmHopperFinal=require(_0x0a9e('0xf'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require('./action');var History=require(_0x0a9e('0x10'));var Final=require(_0x0a9e('0x11'));var AgentComplete=require(_0x0a9e('0x12'));var QueueCallerAbandon=require(_0x0a9e('0x13'));var Hangup=require(_0x0a9e('0x14'));var ipAgi=process[_0x0a9e('0x15')]['XCALLY_IP_AGI']||_0x0a9e('0x16');var strategy={'rrmemory':_0x0a9e('0x17'),'roundrobin':_0x0a9e('0x18')};var Sequence=function(){};Sequence[_0x0a9e('0x19')][_0x0a9e('0x1a')]=function(_0x4d5611){this['tail']=this[_0x0a9e('0x1b')]?this['tail'][_0x0a9e('0x1c')](_0x4d5611):_0x4d5611();};function Dialer(_0x519dfd,_0x16033c){this[_0x0a9e('0x1d')]=new Sequence();this['preview']=_0x16033c;this[_0x0a9e('0x1e')]=_0x519dfd['voiceQueues'];this[_0x0a9e('0x1f')]=_0x519dfd[_0x0a9e('0x1f')];this[_0x0a9e('0x20')]=_0x519dfd[_0x0a9e('0x20')];this[_0x0a9e('0x21')]=_0x519dfd[_0x0a9e('0x21')];this[_0x0a9e('0x22')]=config[_0x0a9e('0x22')]||0x2;this[_0x0a9e('0x23')]={};this[_0x0a9e('0x24')]={};this[_0x0a9e('0x25')]={};this[_0x0a9e('0x26')]={};this['optionPredictive']={};this[_0x0a9e('0x27')]={};this[_0x0a9e('0x28')]={};this['ivrOriginated']={};this[_0x0a9e('0x29')]={};this['queueBookedRR']={};ami['on']('agentconnect',this[_0x0a9e('0x2a')][_0x0a9e('0x2b')](this));ami['on'](_0x0a9e('0x2c'),this[_0x0a9e('0x2d')]['bind'](this));ami['on'](_0x0a9e('0x2e'),this[_0x0a9e('0x2f')][_0x0a9e('0x2b')](this));ami['on'](_0x0a9e('0x30'),this[_0x0a9e('0x31')][_0x0a9e('0x2b')](this));ami['on'](_0x0a9e('0x32'),this['syncQueueSummary']['bind'](this));ami['on'](_0x0a9e('0x33'),this[_0x0a9e('0x34')][_0x0a9e('0x2b')](this));ami['on'](_0x0a9e('0x35'),this['syncNewExten'][_0x0a9e('0x2b')](this));ami['on']('varset',this[_0x0a9e('0x36')]['bind'](this));ami['on'](_0x0a9e('0x37'),this[_0x0a9e('0x38')][_0x0a9e('0x2b')](this));ami['on'](_0x0a9e('0x39'),this[_0x0a9e('0x3a')][_0x0a9e('0x2b')](this));this[_0x0a9e('0x3b')]();this[_0x0a9e('0x3c')]();}function isNotNull(_0x5a101a){return _0x5a101a!==null&&!_[_0x0a9e('0x3d')](_0x5a101a);}function checkIsLoggedIn(_0x468813,_0x2b1f27){return function(){if(_0x2b1f27<=0x0){_0x468813[_0x0a9e('0x3e')]='AGENTS_NOT_LOGGED';throw _0x468813[_0x0a9e('0x3f')]+_0x0a9e('0x40');}};}function isActive(_0x1843b2){return _0x1843b2;}function checkIsActive(_0x824a4f,_0x58b06f){return function(){if(!isActive(_0x58b06f)){_0x824a4f[_0x0a9e('0x3e')]=_0x0a9e('0x41');throw _0x824a4f[_0x0a9e('0x3f')]+_0x0a9e('0x42');}};}function checkInterval(_0x540530){return function(){if(!isNotNull(_0x540530[_0x0a9e('0x43')])){_0x540530['message']=_0x0a9e('0x44');throw _0x540530[_0x0a9e('0x3f')]+_0x0a9e('0x45');}if(!isNotNull(_0x540530[_0x0a9e('0x43')][_0x0a9e('0x46')])){_0x540530['message']=_0x0a9e('0x44');throw _0x540530[_0x0a9e('0x3f')]+_0x0a9e('0x45');}if(!isNotNull(_[_0x0a9e('0x47')](_0x540530[_0x0a9e('0x43')][_0x0a9e('0x46')]))){_0x540530[_0x0a9e('0x3e')]=_0x0a9e('0x44');throw _0x540530['name']+_0x0a9e('0x45');}};}function msgResponse(_0x5e7238,_0x2cc7a0,_0x14b13f){return{'action':_0x5e7238,'response':_0x2cc7a0,'message':_0x14b13f,'stack':_0x14b13f};}function myreject(_0x2b7e7f){return function(_0x3f3d41){return _0x2b7e7f(msgResponse('[ifTime][Action]',_0x0a9e('0x48'),JSON[_0x0a9e('0x49')](_0x3f3d41)));};}function getSeconds(_0x1fa90d,_0x15de0e){var _0x4853b1=moment(_0x1fa90d)['milliseconds'](0x0);var _0x1e8694=moment(_0x15de0e)['milliseconds'](0x0);return _0x4853b1[_0x0a9e('0x4a')](_0x1e8694,_0x0a9e('0x4b'));}function emit(_0x381c37,_0x1ef87a,_0x4f41ae){io['to'](_0x381c37)[_0x0a9e('0x4c')](_0x1ef87a,_0x4f41ae);}function emitVoiceQueueSummary(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x4d')]==='outbound'){var _0x1dbf74={'id':_0x3bfce8['id'],'name':_0x3bfce8[_0x0a9e('0x3f')],'strategy':_0x3bfce8[_0x0a9e('0x4e')],'answered':_0x3bfce8['answered'],'available':_0x3bfce8['available'],'loggedIn':_0x3bfce8[_0x0a9e('0x4f')],'pTalking':_0x3bfce8[_0x0a9e('0x50')],'sumBillable':_0x3bfce8['sumBillable'],'sumDuration':_0x3bfce8[_0x0a9e('0x51')],'sumHoldTime':_0x3bfce8[_0x0a9e('0x52')]||0x0,'talking':_0x3bfce8[_0x0a9e('0x53')],'total':_0x3bfce8[_0x0a9e('0x54')],'type':_0x3bfce8['type'],'unmanaged':_0x3bfce8['unmanaged'],'abandoned':_0x3bfce8[_0x0a9e('0x55')],'waiting':_0x3bfce8[_0x0a9e('0x56')],'loggedInDb':_0x3bfce8['loggedInDb'],'dialActive':_0x3bfce8[_0x0a9e('0x57')],'dialMethod':_0x3bfce8[_0x0a9e('0x58')],'dialOriginateCallerIdName':_0x3bfce8[_0x0a9e('0x59')],'dialOriginateCallerIdNumber':_0x3bfce8['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x3bfce8[_0x0a9e('0x5a')],'dialPrefix':_0x3bfce8[_0x0a9e('0x5b')],'outboundAnswerAgiCallsDay':_0x3bfce8[_0x0a9e('0x5c')],'outboundAnswerCallsDay':_0x3bfce8[_0x0a9e('0x5d')],'outboundBlacklistCallsDay':_0x3bfce8[_0x0a9e('0x5e')],'outboundBusyCallsDay':_0x3bfce8[_0x0a9e('0x5f')],'outboundCongestionCallsDay':_0x3bfce8[_0x0a9e('0x60')],'outboundDropCallsDayACS':_0x3bfce8[_0x0a9e('0x61')],'outboundDropCallsDayCallersExit':_0x3bfce8[_0x0a9e('0x62')],'outboundDropCallsDayTimeout':_0x3bfce8[_0x0a9e('0x63')],'outboundNoAnswerCallsDay':_0x3bfce8[_0x0a9e('0x64')],'outboundNoSuchCallsDay':_0x3bfce8[_0x0a9e('0x65')],'outboundOriginateFailureCallsDay':_0x3bfce8[_0x0a9e('0x66')],'outboundReCallsDay':_0x3bfce8[_0x0a9e('0x67')],'outboundRejectCallsDay':_0x3bfce8[_0x0a9e('0x68')],'outboundUnknownCallsDay':_0x3bfce8['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x3bfce8['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x3bfce8[_0x0a9e('0x69')],'predictiveIntervalAvgTalktime':_0x3bfce8[_0x0a9e('0x6a')],'predictiveIntervalDroppedCallsCallersExit':_0x3bfce8[_0x0a9e('0x6b')],'predictiveIntervalDroppedCallsTimeout':_0x3bfce8[_0x0a9e('0x6c')],'predictiveIntervalErlangCalls':_0x3bfce8[_0x0a9e('0x6d')],'predictiveIntervalErlangCallsDroppedCalls':_0x3bfce8[_0x0a9e('0x6e')],'predictiveIntervalHitRate':_0x3bfce8[_0x0a9e('0x6f')],'predictiveIntervalMultiplicativeFactor':_0x3bfce8[_0x0a9e('0x70')],'predictiveIntervalPauses':_0x3bfce8[_0x0a9e('0x71')],'predictiveIntervalAvailable':_0x3bfce8[_0x0a9e('0x72')],'predictiveIntervalTotalCalls':_0x3bfce8[_0x0a9e('0x73')],'message':_0x3bfce8[_0x0a9e('0x3e')],'originated':_0x3bfce8['originated'],'erlangCalls':_0x3bfce8[_0x0a9e('0x74')],'erlangCallToSecond':_0x3bfce8[_0x0a9e('0x75')],'erlangAbandonmentRate':_0x3bfce8[_0x0a9e('0x76')],'erlangBusyFactor':_0x3bfce8[_0x0a9e('0x77')],'startPredictive':_0x3bfce8[_0x0a9e('0x27')],'startProgressive':_0x3bfce8[_0x0a9e('0x28')]};if(_0x3bfce8[_0x0a9e('0x78')]){_0x1dbf74[_0x0a9e('0x78')]={'id':_0x3bfce8['Trunk']['id'],'name':_0x3bfce8[_0x0a9e('0x78')]['name'],'active':_0x3bfce8[_0x0a9e('0x78')][_0x0a9e('0x79')],'callerid':_0x3bfce8[_0x0a9e('0x78')]['callerid']};}if(_0x3bfce8[_0x0a9e('0x43')]){_0x1dbf74[_0x0a9e('0x43')]={'id':_0x3bfce8[_0x0a9e('0x43')]['id'],'name':_0x3bfce8[_0x0a9e('0x43')][_0x0a9e('0x3f')]};}var _0x37be73=md5(JSON[_0x0a9e('0x49')](_0x1dbf74));if(_0x3bfce8['md5']!==_0x37be73){_0x3bfce8[_0x0a9e('0x3')]=_0x37be73;emit(util[_0x0a9e('0x7a')](_0x0a9e('0x7b'),_0x1dbf74[_0x0a9e('0x3f')]),_0x0a9e('0x7c'),_0x1dbf74);}}}function emitCampaignSummary(_0x992c77){if(_0x992c77[_0x0a9e('0x4d')]===_0x0a9e('0x7d')){emit(util[_0x0a9e('0x7a')]('campaign:ivr:%s',_0x992c77[_0x0a9e('0x3f')]),_0x0a9e('0x7e'),_0x992c77);}}function checkGetDataPredictive(_0x4f7240){if(isNotNull(_0x4f7240)){if(!_['isEmpty'](_0x4f7240)){loggerPredictive['info'](_0x0a9e('0x7f'));loggerPredictive[_0x0a9e('0x80')](_0x0a9e('0x81'),_0x4f7240[_0x0a9e('0x73')]);loggerPredictive[_0x0a9e('0x80')](_0x0a9e('0x82'),_0x4f7240[_0x0a9e('0x83')]);loggerPredictive[_0x0a9e('0x80')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4f7240['predictiveIntervalDroppedCallsTimeout']);loggerPredictive['info'](_0x0a9e('0x84'),_0x4f7240[_0x0a9e('0x6b')]);loggerPredictive[_0x0a9e('0x80')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4f7240[_0x0a9e('0x69')]);loggerPredictive[_0x0a9e('0x80')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4f7240['predictiveIntervalAvgTalktime']);loggerPredictive[_0x0a9e('0x80')]('---------------------------');if(_0x4f7240[_0x0a9e('0x73')]>0x0){if(!_['isUndefined'](_0x4f7240[_0x0a9e('0x6a')])&&_0x4f7240[_0x0a9e('0x6a')]>0x0){return!![];}else{loggerPredictive[_0x0a9e('0x80')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}if(!_[_0x0a9e('0x3d')](_0x4f7240[_0x0a9e('0x69')])&&_0x4f7240['predictiveIntervalAvgHoldtime']>0x0){return!![];}else{loggerPredictive['info'](_0x0a9e('0x85'));}}else{loggerPredictive[_0x0a9e('0x80')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0x0a9e('0x80')]('History\x20information\x20are\x20empty');}}else{loggerPredictive[_0x0a9e('0x80')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0xe22ccc){return function(_0x4a6deb){loggerPredictive['info']('---------\x20ErlangB\x20---------');loggerPredictive[_0x0a9e('0x80')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4a6deb[_0x0a9e('0x74')]);loggerPredictive[_0x0a9e('0x80')](_0x0a9e('0x86'),_0x4a6deb[_0x0a9e('0x75')]);loggerPredictive[_0x0a9e('0x80')](_0x0a9e('0x87'),_0x4a6deb[_0x0a9e('0x76')]);loggerPredictive[_0x0a9e('0x80')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4a6deb[_0x0a9e('0x77')]);loggerPredictive[_0x0a9e('0x80')](_0x0a9e('0x87'),_0x4a6deb[_0x0a9e('0x76')]);loggerPredictive[_0x0a9e('0x80')](_0x0a9e('0x88'));_['merge'](_0xe22ccc,_0x4a6deb);};}function getDiff(_0x956fbe){var _0x26bc80=moment()['milliseconds'](0x0);var _0x3649cc=moment(_0x956fbe)['milliseconds'](0x0);return _0x26bc80[_0x0a9e('0x4a')](_0x3649cc,'seconds');}function ifInterval(_0x4b3c1a,_0x5674ee){if(_[_0x0a9e('0x3d')](_0x5674ee)){return![];}if(getDiff(_0x5674ee)<_0x4b3c1a*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x49d231){if(isNotNull(_0x49d231)){if(!_[_0x0a9e('0x3d')](_0x49d231[_0x0a9e('0x28')])){_0x49d231[_0x0a9e('0x28')]=undefined;loggerPredictive[_0x0a9e('0x80')](_0x49d231[_0x0a9e('0x3f')],_0x0a9e('0x89'));}if(!_['isUndefined'](_0x49d231[_0x0a9e('0x27')])){_0x49d231['startPredictive']=undefined;loggerPredictive[_0x0a9e('0x80')](_0x49d231[_0x0a9e('0x3f')],_0x0a9e('0x8a'));}if(!_['isUndefined'](_0x49d231[_0x0a9e('0x8b')])){clearInterval(_0x49d231[_0x0a9e('0x8b')]);_0x49d231[_0x0a9e('0x8b')]=undefined;loggerPredictive[_0x0a9e('0x80')](_0x49d231['name'],_0x0a9e('0x8c'));}}}function erlangb(_0xe05a5a,_0x54327c){if(_0x54327c===0x0){return 0x0;}var _0x797b45=0x1;for(var _0x17e88c=0x1;_0x17e88c<=_0x54327c;_0x17e88c+=0x1){_0x797b45=0x1+_0x797b45*_0x17e88c/_0xe05a5a;}return 0x1/_0x797b45;}function isVoiceQueueOutbound(_0x88dcbf){return _0x88dcbf===_0x0a9e('0x8d');}function isNotPreview(_0x401837){return _0x401837!=='preview';}function isCampaignIvr(_0x176840){return _0x176840===_0x0a9e('0x7d');}function getCallerId(_0x281c7d,_0x47bb43,_0x3528b7){if(!_['isUndefined'](_0x3528b7)&&'string'===typeof _0x3528b7&&!_[_0x0a9e('0x47')](_0x3528b7)){if(!_[_0x0a9e('0x3d')](_0x47bb43)&&_0x0a9e('0x8e')===typeof _0x47bb43&&!_[_0x0a9e('0x47')](_0x47bb43)){return util[_0x0a9e('0x7a')](_0x0a9e('0x8f'),_0x47bb43,_0x3528b7);}return util[_0x0a9e('0x7a')](_0x0a9e('0x8f'),_0x3528b7,_0x3528b7);}if(!_[_0x0a9e('0x3d')](_0x281c7d)&&_0x0a9e('0x8e')===typeof _0x281c7d&&!_[_0x0a9e('0x47')](_0x281c7d)){return _0x281c7d;}return _0x0a9e('0x90');}function loggerCatchQueueSummary(_0x2bbb86,_0x2b8192){return function(_0x320898){freeVariablesPredictive(_0x2b8192);emitVoiceQueueSummary(_0x2b8192);emitCampaignSummary(_0x2b8192);loggerSyncQueueSummary[_0x0a9e('0x91')](_0x2bbb86,util[_0x0a9e('0x92')](_0x320898,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x4257c9,_0x5150a4){return function(_0x1b0b98){loggerPredictive[_0x0a9e('0x91')](_0x5150a4[_0x0a9e('0x3f')],_0x4257c9);loggerPredictive['error'](_0x1b0b98[_0x0a9e('0x93')]);freeVariablesPredictive(_0x5150a4);};}function loggerCatch(_0x30944e){return function(_0x4b341d){logger[_0x0a9e('0x91')](_0x30944e,util[_0x0a9e('0x92')](_0x4b341d,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x3ef315){return _0x3ef315&&!_[_0x0a9e('0x3d')](_0x3ef315)&&_0x3ef315[_0x0a9e('0x94')]>0x0;}function decremetOriginate(_0x4a43a8){if(!_['isUndefined'](_0x4a43a8)&&_0x4a43a8!==null){if(_0x4a43a8['hasOwnProperty'](_0x0a9e('0x95'))){if(_0x4a43a8[_0x0a9e('0x95')]>0x0){_0x4a43a8[_0x0a9e('0x95')]-=0x1;}else{logger[_0x0a9e('0x91')](_0x0a9e('0x96'));}}}else{logger[_0x0a9e('0x91')](_0x0a9e('0x97'));}}function checkContactLowerLimitOriginate(_0x1a0677,_0x5512d1,_0x235f8f){if(_0x5512d1>_0x235f8f){for(var _0xcbc8b2=0x0;_0xcbc8b2<_0x5512d1-_0x235f8f;_0xcbc8b2+=0x1){decremetOriginate(_0x1a0677);}}}function loggerGetContactDialer(_0x12ccdb,_0x4a4fc7,_0x2bdc44){return function(_0x583b2e){checkContactLowerLimitOriginate(_0x4a4fc7,_0x2bdc44,0x0);logger[_0x0a9e('0x91')](_0x12ccdb,util[_0x0a9e('0x92')](_0x583b2e,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x4c46c1){return function(_0x2ed01e){if(isNotNull(_0x2ed01e)&&isNotNull(_0x2ed01e[0x0])){if(_0x2ed01e[0x0][_0x0a9e('0x98')]>0x0){_0x4c46c1[_0x0a9e('0x3e')]=_0x0a9e('0x99');logger['info'](_0x0a9e('0x9a')+_0x4c46c1[_0x0a9e('0x3f')],_0x2ed01e[0x0][_0x0a9e('0x98')],_0x0a9e('0x9b'));}else{_0x4c46c1['message']=_0x0a9e('0x9c');logger[_0x0a9e('0x80')](_0x0a9e('0x9d')+_0x4c46c1[_0x0a9e('0x3f')]);}}};}function notSendMessagesQueue(_0x4abc8f){if(_0x4abc8f[_0x0a9e('0x9e')]){freeVariablesPredictive(_0x4abc8f);if(_0x4abc8f[_0x0a9e('0x95')]===0x0&&_0x4abc8f[_0x0a9e('0x53')]===0x0&&_0x4abc8f[_0x0a9e('0x56')]===0x0&&(_0x4abc8f[_0x0a9e('0x50')]||0x0)===0x0){_0x4abc8f[_0x0a9e('0x9e')]=![];_0x4abc8f[_0x0a9e('0x9f')]=0x0;_0x4abc8f[_0x0a9e('0x3e')]=_0x0a9e('0x41');loggerSyncQueueSummary[_0x0a9e('0x91')](_0x0a9e('0xa0'),_0x4abc8f[_0x0a9e('0x3f')],_0x0a9e('0xa1'));}else{_0x4abc8f[_0x0a9e('0x3e')]='IS_DISACTIVED';loggerSyncQueueSummary[_0x0a9e('0x91')](_0x0a9e('0xa0'),_0x4abc8f[_0x0a9e('0x3f')],'is\x20disactive');}emitVoiceQueueSummary(_0x4abc8f);}}function notSendMessagesCampaign(_0x3736e0){if(_0x3736e0[_0x0a9e('0x9e')]){if(_0x3736e0[_0x0a9e('0x95')]===0x0){_0x3736e0[_0x0a9e('0x9e')]=![];_0x3736e0['message']='NOT_ACTIVE';loggerSyncQueueSummary[_0x0a9e('0x91')](_0x0a9e('0xa2'),_0x3736e0['name'],_0x0a9e('0xa1'));}else{_0x3736e0['message']=_0x0a9e('0xa3');loggerSyncQueueSummary[_0x0a9e('0x91')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x3736e0[_0x0a9e('0x3f')],_0x0a9e('0xa4'));}emitCampaignSummary(_0x3736e0);}}function createObjHistory(_0x2d2286,_0x42b959,_0x3755fe,_0x1f42a0,_0x444f1f){_0x2d2286['message']=_0x3755fe;var _0x2973d3=new Action(_0x2d2286,_0x42b959);var _0x3ca9b9=new History(_0x2973d3);_0x3ca9b9[_0x0a9e('0xa5')]=_0x1f42a0;_0x3ca9b9[_0x0a9e('0xa6')]=_0x444f1f;_0x3ca9b9['endtime']=_0x2973d3[_0x0a9e('0xa7')];return _0x3ca9b9;}Dialer[_0x0a9e('0x19')]['loopClearZombieChannels']=function(){var _0x1d6834=this;setInterval(function(){_0x1d6834['clearZombieChannels'](_0x1d6834[_0x0a9e('0x26')],_0x0a9e('0xa8'));_0x1d6834[_0x0a9e('0xa9')](_0x1d6834[_0x0a9e('0x24')],'[actions]');},0x32c8);};Dialer['prototype'][_0x0a9e('0xa9')]=function(_0x2b9c01,_0x94dcf5){var _0x5ac73d=this;for(var _0x3b4a9f in _0x2b9c01){if(_0x2b9c01[_0x0a9e('0xaa')](_0x3b4a9f)){this['sequence']['enqueue'](function(){if(!_[_0x0a9e('0xab')](_0x2b9c01[_0x3b4a9f])){return ami['Action']({'action':'status','channel':_0x2b9c01[_0x3b4a9f]['channel']})[_0x0a9e('0xac')](function(_0xf3601c){if(_0xf3601c[_0x0a9e('0x3e')]===_0x0a9e('0xad')){setTimeout(function(){if(_0x2b9c01[_0x3b4a9f]&&_0x2b9c01[_0x3b4a9f][_0x0a9e('0x4d')]!==_0x0a9e('0x7d')){_0x5ac73d['updateOriginated'](_0x5ac73d[_0x0a9e('0x1e')][_0x2b9c01[_0x3b4a9f]['queue']]);logger[_0x0a9e('0x91')](_0x0a9e('0xae'),_0x94dcf5,_0x3b4a9f,_0x2b9c01[_0x3b4a9f][_0x0a9e('0xaf')]);delete _0x2b9c01[_0x3b4a9f];}if(_0x2b9c01[_0x3b4a9f]&&_0x2b9c01[_0x3b4a9f][_0x0a9e('0x4d')]==='ivr'){_0x5ac73d[_0x0a9e('0xb0')](_0x5ac73d[_0x0a9e('0x1f')][_0x2b9c01[_0x3b4a9f][_0x0a9e('0xaf')]]);logger['error'](_0x0a9e('0xb1'),_0x94dcf5,_0x3b4a9f,_0x2b9c01[_0x3b4a9f][_0x0a9e('0xaf')]);delete _0x2b9c01[_0x3b4a9f];}},0x2328);}});}});}}};Dialer[_0x0a9e('0x19')][_0x0a9e('0xb2')]=function(_0x255e49){return BPromise[_0x0a9e('0xb3')]()[_0x0a9e('0xb4')](cmHopper[_0x0a9e('0xb2')](_0x255e49))['catch'](loggerCatch(_0x0a9e('0xb5')));};Dialer[_0x0a9e('0x19')]['checkIsBlackList']=function(_0x40e0f0){return BPromise[_0x0a9e('0xb3')]()[_0x0a9e('0xb4')](cmHopperBlack['checkIsBlackList'](_0x40e0f0))[_0x0a9e('0xac')](loggerCatch('[checkIsBlackList]\x20'));};Dialer[_0x0a9e('0x19')][_0x0a9e('0xb6')]=function(_0x558a87){return BPromise[_0x0a9e('0xb3')]()[_0x0a9e('0xb4')](cmHopperBlack[_0x0a9e('0xb6')](_0x558a87))[_0x0a9e('0xac')](loggerCatch(_0x0a9e('0xb7')));};Dialer['prototype'][_0x0a9e('0xb8')]=function(_0x31d25a){return BPromise[_0x0a9e('0xb3')]()[_0x0a9e('0xb4')](cmHopperHistory[_0x0a9e('0xb9')](_0x31d25a))[_0x0a9e('0xac')](loggerCatch(_0x0a9e('0xba')));};Dialer[_0x0a9e('0x19')][_0x0a9e('0xbb')]=function(_0x31af8c){return BPromise[_0x0a9e('0xb3')]()[_0x0a9e('0xb4')](cmHopper[_0x0a9e('0xbb')](_0x31af8c))['catch'](loggerCatch(_0x0a9e('0xbc')));};Dialer[_0x0a9e('0x19')][_0x0a9e('0xbd')]=function(_0x2ed526,_0xb0599a,_0x5d9ddb){return BPromise[_0x0a9e('0xb3')]()[_0x0a9e('0xb4')](cmHopper['unlockContact'](_0x2ed526,_0xb0599a,_0x5d9ddb))[_0x0a9e('0xac')](loggerCatch('[unlockContact]\x20'));};Dialer[_0x0a9e('0x19')][_0x0a9e('0xbe')]=function(_0x1d93b1,_0xf8c6c4,_0x4f4d2d,_0x3ceba6){return BPromise['resolve']()[_0x0a9e('0xb4')](cmHopper[_0x0a9e('0xbe')](_0x1d93b1,_0xf8c6c4,_0x4f4d2d,_0x3ceba6))['catch'](loggerCatch(_0x0a9e('0xbf')));};Dialer[_0x0a9e('0x19')][_0x0a9e('0xc0')]=function(_0x4ab276,_0x4c788f,_0x1b82b7){return BPromise[_0x0a9e('0xb3')]()[_0x0a9e('0xb4')](cmHopper[_0x0a9e('0xc0')](_0x4ab276,_0x4c788f,_0x1b82b7))[_0x0a9e('0xac')](loggerCatch(_0x0a9e('0xbf')));};Dialer[_0x0a9e('0x19')][_0x0a9e('0xc1')]=function(_0x3f8124){return BPromise['resolve']()[_0x0a9e('0xb4')](voiceQueueRt['getVoiceQueueRtPauses'](_0x3f8124))[_0x0a9e('0xac')](loggerCatch(_0x0a9e('0xc2')));};Dialer[_0x0a9e('0x19')][_0x0a9e('0xc3')]=function(_0x1b61d5){return BPromise['resolve']()[_0x0a9e('0xb4')](cmHopper[_0x0a9e('0xc3')](_0x1b61d5))[_0x0a9e('0xac')](loggerCatch(_0x0a9e('0xc4')));};Dialer[_0x0a9e('0x19')]['createHistory']=function(_0x4f074c){return BPromise[_0x0a9e('0xb3')]()['then'](cmHopperHistory[_0x0a9e('0xc5')](_0x4f074c))[_0x0a9e('0xac')](loggerCatch(_0x0a9e('0xc6')));};Dialer[_0x0a9e('0x19')][_0x0a9e('0xb0')]=function(_0x213e5d){if(!_['isUndefined'](_0x213e5d)&&_0x213e5d!==null){if(_0x213e5d['hasOwnProperty'](_0x0a9e('0x95'))){if(_0x213e5d['originated']>0x0){_0x213e5d[_0x0a9e('0x95')]-=0x1;}else{logger['error'](_0x0a9e('0xc7'));}}}else{logger['error']('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0x0a9e('0x19')][_0x0a9e('0xc8')]=function(_0x5e9b0b,_0x170af6){var _0x17cb30=this;return function(_0x15c6b9){_0x17cb30[_0x0a9e('0xb0')](_0x170af6);logger[_0x0a9e('0x91')](_0x5e9b0b,util['inspect'](_0x15c6b9,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0x0a9e('0xc9')]=function(_0x22286c,_0x41c8cd,_0x24beb6){var _0x59303b={'state':0x19,'statedesc':'notFound'};this[_0x0a9e('0xb0')](_0x41c8cd);this[_0x0a9e('0xca')](_['merge'](_0x59303b,_[_0x0a9e('0xcb')](_0x24beb6,[_0x0a9e('0xcc'),_0x0a9e('0xcd'),_0x0a9e('0xce'),_0x0a9e('0xcf'),_0x0a9e('0xd0')])),_0x0a9e('0xd1'),_0x0a9e('0xd2'));logger[_0x0a9e('0x91')](_0x22286c);};Dialer[_0x0a9e('0x19')]['isSuccess']=function(_0x1065a7){return _0x1065a7===_0x0a9e('0xd3');};Dialer[_0x0a9e('0x19')][_0x0a9e('0xd4')]=function(_0x1d0b02){return!_['isUndefined'](_0x1d0b02)&&_0x1d0b02&&!_['isUndefined'](_0x1d0b02[_0x0a9e('0x3f')])&&!_[_0x0a9e('0x3d')](_0x1d0b02[_0x0a9e('0x79')])&&_0x1d0b02[_0x0a9e('0x79')]&&(this[_0x0a9e('0x21')][util['format'](_0x0a9e('0xd5'),_0x1d0b02[_0x0a9e('0x3f')])][_0x0a9e('0xd6')]==='reachable'||this[_0x0a9e('0x21')][util['format'](_0x0a9e('0xd5'),_0x1d0b02['name'])][_0x0a9e('0xd6')]===_0x0a9e('0xd7'));};Dialer[_0x0a9e('0x19')]['saveInDb']=function(_0xc9529d,_0x5ed560,_0x4383da){this[_0x0a9e('0xc5')](_0xc9529d)[_0x0a9e('0xac')](loggerCatch(_0x5ed560));this[_0x0a9e('0xc3')](_0xc9529d)[_0x0a9e('0xac')](loggerCatch(_0x4383da));};Dialer[_0x0a9e('0x19')][_0x0a9e('0x36')]=function(_0xe89aaa){var _0x2aaf07=this[_0x0a9e('0x26')][_0xe89aaa[_0x0a9e('0xd8')]];var _0xc876d4;if(!_[_0x0a9e('0xab')](_0xe89aaa)&&!_[_0x0a9e('0xab')](_0xe89aaa[_0x0a9e('0xd9')])&&!_[_0x0a9e('0xab')](_0xe89aaa['variable']['amdstatus'])&&_0xe89aaa[_0x0a9e('0xda')]==='xcally-motion-dialer'&&_0x2aaf07){if(_0x2aaf07[_0x0a9e('0x4d')]!==_0x0a9e('0x7d')&&this['voiceQueues'][_0x2aaf07[_0x0a9e('0xaf')]][_0x0a9e('0xdb')]&&_0xe89aaa[_0x0a9e('0xdc')]===_0x0a9e('0xdd')){delete this['uniqueId'][_0xe89aaa[_0x0a9e('0xd8')]];this[_0x0a9e('0xb0')](this[_0x0a9e('0x1e')][_0x2aaf07[_0x0a9e('0xaf')]]);this['voiceQueues'][_0x2aaf07[_0x0a9e('0xaf')]][_0x0a9e('0x5d')]+=0x1;this[_0x0a9e('0x1e')][_0x2aaf07['queue']][_0x0a9e('0x5c')]+=0x1;_0xc876d4=new Hangup(_0x2aaf07,_0xe89aaa);_0xc876d4[_0x0a9e('0xa5')]=0x12;_0xc876d4[_0x0a9e('0xa6')]='HangupInAMD';_0xc876d4[_0x0a9e('0xde')]=_0x0a9e('0xdf');this[_0x0a9e('0xca')](_0xc876d4,_0x0a9e('0xe0'),_0x0a9e('0xe1'));}if(_0x2aaf07['type']!==_0x0a9e('0x7d')&&this[_0x0a9e('0x1e')][_0x2aaf07['queue']][_0x0a9e('0xdb')]&&_0xe89aaa[_0x0a9e('0xdc')]===_0x0a9e('0xe2')){delete this['uniqueId'][_0xe89aaa['uniqueid']];this['updateOriginated'](this[_0x0a9e('0x1e')][_0x2aaf07[_0x0a9e('0xaf')]]);this['voiceQueues'][_0x2aaf07[_0x0a9e('0xaf')]][_0x0a9e('0x5d')]+=0x1;this[_0x0a9e('0x1e')][_0x2aaf07['queue']][_0x0a9e('0x5c')]+=0x1;_0xc876d4=new Hangup(_0x2aaf07,_0xe89aaa);_0xc876d4[_0x0a9e('0xa5')]=0x13;_0xc876d4[_0x0a9e('0xa6')]=_0x0a9e('0xe3');_0xc876d4[_0x0a9e('0xde')]=_0x0a9e('0xdf');_0xc876d4[_0x0a9e('0xe4')]=!![];this[_0x0a9e('0xca')](_0xc876d4,_0x0a9e('0xe5'),'[syncMachine]');}if(_0x2aaf07[_0x0a9e('0x4d')]==='ivr'&&this[_0x0a9e('0x1f')][_0x2aaf07[_0x0a9e('0xaf')]][_0x0a9e('0xdb')]&&_0xe89aaa[_0x0a9e('0xdc')]===_0x0a9e('0xdd')){delete this[_0x0a9e('0x26')][_0xe89aaa['uniqueid']];this[_0x0a9e('0xb0')](this[_0x0a9e('0x1f')][_0x2aaf07[_0x0a9e('0xaf')]]);_0xc876d4=new Hangup(_0x2aaf07,_0xe89aaa);_0xc876d4[_0x0a9e('0xa5')]=0x12;_0xc876d4['statedesc']=_0x0a9e('0xe6');_0xc876d4[_0x0a9e('0xde')]=_0x0a9e('0xdf');this[_0x0a9e('0xca')](_0xc876d4,_0x0a9e('0xe7'),_0x0a9e('0xe8'));}if(_0x2aaf07[_0x0a9e('0x4d')]===_0x0a9e('0x7d')&&this[_0x0a9e('0x1f')][_0x2aaf07[_0x0a9e('0xaf')]]['dialAMDActive']&&_0xe89aaa[_0x0a9e('0xdc')]===_0x0a9e('0xe2')){delete this[_0x0a9e('0x26')][_0xe89aaa[_0x0a9e('0xd8')]];this[_0x0a9e('0xb0')](this[_0x0a9e('0x1f')][_0x2aaf07[_0x0a9e('0xaf')]]);_0xc876d4=new Hangup(_0x2aaf07,_0xe89aaa);_0xc876d4[_0x0a9e('0xa5')]=0x13;_0xc876d4['statedesc']=_0x0a9e('0xe3');_0xc876d4[_0x0a9e('0xde')]=_0x0a9e('0xdf');_0xc876d4['amd']=!![];this[_0x0a9e('0xca')](_0xc876d4,_0x0a9e('0xe9'),_0x0a9e('0xea'));}}};Dialer[_0x0a9e('0x19')][_0x0a9e('0x34')]=function(_0x1ba457){var _0x424f1b=this[_0x0a9e('0x26')][_0x1ba457[_0x0a9e('0xd8')]];var _0x451010=this;var _0x5a7dad;if(_0x424f1b&&_0x424f1b[_0x0a9e('0x4d')]===_0x0a9e('0x7d')){delete this[_0x0a9e('0x26')][_0x1ba457[_0x0a9e('0xd8')]];this[_0x0a9e('0xb0')](this[_0x0a9e('0x1f')][_0x424f1b['queue']]);this[_0x0a9e('0x1f')][_0x424f1b['queue']]['ivrAnswerCallsDay']+=0x1;_0x5a7dad=new Hangup(_0x424f1b,_0x1ba457);this['createHistory'](_0x5a7dad)[_0x0a9e('0xac')](loggerCatch(_0x0a9e('0xeb')));this[_0x0a9e('0xc3')](_0x5a7dad)[_0x0a9e('0xac')](loggerCatch('[syncHangupIvr]'));}if(_0x424f1b&&_0x424f1b[_0x0a9e('0x4d')]!==_0x0a9e('0x7d')&&isNotNull(this[_0x0a9e('0x1e')][_0x424f1b[_0x0a9e('0xaf')]][_0x0a9e('0xec')])){delete this['uniqueId'][_0x1ba457['uniqueid']];this[_0x0a9e('0xb0')](this[_0x0a9e('0x1e')][_0x424f1b[_0x0a9e('0xaf')]]);this['voiceQueues'][_0x424f1b[_0x0a9e('0xaf')]][_0x0a9e('0x5d')]+=0x1;this[_0x0a9e('0x1e')][_0x424f1b['queue']][_0x0a9e('0x5c')]+=0x1;_0x5a7dad=new Hangup(_0x424f1b,_0x1ba457);_0x5a7dad[_0x0a9e('0xa5')]=0x10;_0x5a7dad[_0x0a9e('0xa6')]='AnswerAGI';_0x5a7dad[_0x0a9e('0xde')]=_0x0a9e('0xed');this[_0x0a9e('0xc5')](_0x5a7dad)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));this['moveContactManagedDialer'](_0x5a7dad)[_0x0a9e('0xac')](loggerCatch(_0x0a9e('0xee')));}if(_0x424f1b&&_0x424f1b[_0x0a9e('0x4d')]!==_0x0a9e('0x7d')&&!isNotNull(this['voiceQueues'][_0x424f1b[_0x0a9e('0xaf')]]['dialQueueProject'])){delete this[_0x0a9e('0x26')][_0x1ba457[_0x0a9e('0xd8')]];this[_0x0a9e('0xb0')](this['voiceQueues'][_0x424f1b[_0x0a9e('0xaf')]]);this[_0x0a9e('0x1e')][_0x424f1b[_0x0a9e('0xaf')]]['outboundUnknownCallsDay']+=0x1;_0x5a7dad=new Hangup(_0x424f1b,_0x1ba457);_0x5a7dad[_0x0a9e('0xa5')]=0xc;_0x5a7dad['statedesc']=_0x1ba457[_0x0a9e('0xef')];_0x5a7dad['membername']=_0x0a9e('0xf0');this['createHistory'](_0x5a7dad)[_0x0a9e('0xac')](loggerCatch(_0x0a9e('0xeb')));this[_0x0a9e('0xc3')](_0x5a7dad)[_0x0a9e('0xac')](loggerCatch(_0x0a9e('0xee')));}};Dialer[_0x0a9e('0x19')][_0x0a9e('0x31')]=function(_0x5acdc9){var _0x35ace3=this[_0x0a9e('0x26')][_0x5acdc9['uniqueid']];var _0xf4fb77=this;if(this[_0x0a9e('0x1e')][_0x5acdc9['queue']]){if(_0x35ace3&&_0x35ace3[_0x0a9e('0x4d')]!==_0x0a9e('0x7d')){delete this[_0x0a9e('0x26')][_0x5acdc9['uniqueid']];this[_0x0a9e('0x1e')][_0x5acdc9[_0x0a9e('0xaf')]][_0x0a9e('0x5d')]+=0x1;var _0x3f0d64=new AgentComplete(_0x35ace3,_0x5acdc9);if(_0x5acdc9[_0x0a9e('0xf1')]===_0x0a9e('0xf2')){_0x3f0d64[_0x0a9e('0xf3')]=this[_0x0a9e('0x1e')][_0x5acdc9[_0x0a9e('0xaf')]][_0x0a9e('0xf4')]&&this['voiceQueues'][_0x5acdc9[_0x0a9e('0xaf')]]['dialAgiAfterHangupAgent']?moment()[_0x0a9e('0x7a')](_0x0a9e('0xf5')):undefined;}this[_0x0a9e('0xc5')](_0x3f0d64)[_0x0a9e('0xac')](loggerCatch(_0x0a9e('0xf6')));this[_0x0a9e('0xc3')](_0x3f0d64)['catch'](loggerCatch(_0x0a9e('0xf7')));}}};Dialer[_0x0a9e('0x19')][_0x0a9e('0x2a')]=function(_0x55a599){if(this[_0x0a9e('0x1e')][_0x55a599[_0x0a9e('0xaf')]]){if(this[_0x0a9e('0x26')][_0x55a599[_0x0a9e('0xd8')]]&&this[_0x0a9e('0x26')][_0x55a599[_0x0a9e('0xd8')]][_0x0a9e('0x4d')]!=='ivr'){this[_0x0a9e('0xb0')](this[_0x0a9e('0x1e')][_0x55a599[_0x0a9e('0xaf')]]);this[_0x0a9e('0x26')][_0x55a599[_0x0a9e('0xd8')]][_0x0a9e('0xf8')]=moment()[_0x0a9e('0x7a')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer['prototype'][_0x0a9e('0xf9')]=function(_0x3f507c){this[_0x0a9e('0xc5')](_0x3f507c)[_0x0a9e('0xac')](loggerCatch(_0x0a9e('0xf6')));this[_0x0a9e('0xc3')](_0x3f507c)[_0x0a9e('0xac')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer[_0x0a9e('0x19')][_0x0a9e('0x2d')]=function(_0x2d8e91){var _0x2675a5=this[_0x0a9e('0x26')][_0x2d8e91[_0x0a9e('0xd8')]];var _0x16be7e=this;if(this['voiceQueues'][_0x2d8e91[_0x0a9e('0xaf')]]){if(_0x2675a5&&_0x2675a5[_0x0a9e('0x4d')]!==_0x0a9e('0x7d')){delete this['uniqueId'][_0x2d8e91[_0x0a9e('0xd8')]];this[_0x0a9e('0xb0')](this[_0x0a9e('0x1e')][_0x2d8e91[_0x0a9e('0xaf')]]);_0x2675a5['droptime']=moment()[_0x0a9e('0x7a')](_0x0a9e('0xf5'));var _0x21d082=new QueueCallerAbandon(_0x2675a5,_0x2d8e91);if(getSeconds(_0x2675a5[_0x0a9e('0xfa')],_0x2675a5[_0x0a9e('0xfb')])>=_0x2675a5[_0x0a9e('0xfc')]){this[_0x0a9e('0x1e')][_0x2d8e91[_0x0a9e('0xaf')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0x0a9e('0x1e')][_0x2d8e91[_0x0a9e('0xaf')]][_0x0a9e('0x63')]+=0x1;this[_0x0a9e('0x1e')][_0x2d8e91['queue']]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x21d082[_0x0a9e('0xa5')]=0xa;_0x21d082[_0x0a9e('0xa6')]=_0x0a9e('0xfd');_0x21d082['dropreason']=_0x0a9e('0xfe');_0x21d082[_0x0a9e('0xf3')]=this['voiceQueues'][_0x2d8e91[_0x0a9e('0xaf')]]['dialQueueProject2']?moment()[_0x0a9e('0x7a')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x21d082['countdropretry']+=0x1;if(_0x21d082['countdropretry']>=this[_0x0a9e('0x1e')][_0x2d8e91[_0x0a9e('0xaf')]][_0x0a9e('0xff')]){this[_0x0a9e('0xf9')](_0x21d082);}else{this[_0x0a9e('0xbb')]({'active':![],'countdropretry':_0x21d082[_0x0a9e('0x100')],'scheduledat':moment()['add'](this[_0x0a9e('0x1e')][_0x2d8e91[_0x0a9e('0xaf')]][_0x0a9e('0x101')],_0x0a9e('0x102'))[_0x0a9e('0x7a')](_0x0a9e('0xf5')),'ContactId':_0x2675a5[_0x0a9e('0xcc')],'ListId':_0x2675a5['ListId'],'VoiceQueueId':_0x2675a5['VoiceQueueId']||undefined,'CampaignId':_0x2675a5[_0x0a9e('0xd0')]||undefined})['catch'](loggerCatch(_0x0a9e('0x103')));var _0x19e024=new History(_0x21d082);_0x19e024[_0x0a9e('0xa5')]=0xa;_0x19e024[_0x0a9e('0xa6')]=_0x0a9e('0xfd');_0x19e024[_0x0a9e('0xa7')]=moment()['format'](_0x0a9e('0xf5'));_0x19e024['endtime']=_0x19e024['starttime'];_0x19e024[_0x0a9e('0x104')]=_0x21d082['calleridname'];_0x19e024[_0x0a9e('0x105')]=_0x21d082['calleridnum'];console['log'](_0x0a9e('0x106'),_0x2d8e91);console['log'](_0x0a9e('0x107'),_0x21d082);console[_0x0a9e('0x108')](_0x0a9e('0x109'),_0x19e024);this['createHistory'](_0x19e024)[_0x0a9e('0xac')](loggerCatch(_0x0a9e('0x10a')));}}else{this[_0x0a9e('0x1e')][_0x2d8e91['queue']]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0x0a9e('0x1e')][_0x2d8e91[_0x0a9e('0xaf')]][_0x0a9e('0x62')]+=0x1;_0x21d082[_0x0a9e('0xa5')]=0xb;_0x21d082[_0x0a9e('0xa6')]=_0x0a9e('0x10b');_0x21d082[_0x0a9e('0x10c')]=_0x0a9e('0x10d');_0x21d082[_0x0a9e('0x10e')]+=0x1;if(_0x21d082[_0x0a9e('0x10e')]>=this['voiceQueues'][_0x2d8e91['queue']]['dialAbandonedMaxRetry']){this[_0x0a9e('0xf9')](_0x21d082);}else{this[_0x0a9e('0xbb')]({'active':![],'countabandonedretry':_0x21d082[_0x0a9e('0x10e')],'scheduledat':moment()[_0x0a9e('0x10f')](this[_0x0a9e('0x1e')][_0x2d8e91[_0x0a9e('0xaf')]][_0x0a9e('0x110')],_0x0a9e('0x102'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2675a5[_0x0a9e('0xcc')],'ListId':_0x2675a5[_0x0a9e('0xcd')],'VoiceQueueId':_0x2675a5['VoiceQueueId']||undefined,'CampaignId':_0x2675a5[_0x0a9e('0xd0')]||undefined})[_0x0a9e('0xac')](loggerCatch(_0x0a9e('0x111')));var _0x19e024=new History(_0x21d082);_0x19e024[_0x0a9e('0xa5')]=0xb;_0x19e024[_0x0a9e('0xa6')]=_0x0a9e('0x10b');_0x19e024[_0x0a9e('0xa7')]=moment()[_0x0a9e('0x7a')](_0x0a9e('0xf5'));_0x19e024[_0x0a9e('0x112')]=_0x19e024[_0x0a9e('0xa7')];console['log'](_0x0a9e('0x113'),_0x19e024);this[_0x0a9e('0xc5')](_0x19e024)[_0x0a9e('0xac')](loggerCatch(_0x0a9e('0x114')));}}}}};Dialer[_0x0a9e('0x19')][_0x0a9e('0x115')]=function(_0x292e67){if(this[_0x0a9e('0x24')][_0x292e67[_0x0a9e('0xd8')]]){this[_0x0a9e('0x24')][_0x292e67[_0x0a9e('0xd8')]][_0x0a9e('0x116')]=_0x292e67['channel'];}if(this['uniqueId'][_0x292e67[_0x0a9e('0xd8')]]){this[_0x0a9e('0x26')][_0x292e67[_0x0a9e('0xd8')]][_0x0a9e('0x116')]=_0x292e67[_0x0a9e('0x116')];}};Dialer[_0x0a9e('0x19')][_0x0a9e('0x38')]=function(_0x4f7907){if(strategy[this[_0x0a9e('0x1e')][this['actions'][_0x4f7907[_0x0a9e('0x117')]][_0x0a9e('0xaf')]][_0x0a9e('0x4e')]]===_0x0a9e('0x18')){if(this[_0x0a9e('0x24')][_0x4f7907[_0x0a9e('0x117')]]&&_[_0x0a9e('0xab')](this[_0x0a9e('0x24')][_0x4f7907[_0x0a9e('0x117')]][_0x0a9e('0x118')])&&_0x4f7907[_0x0a9e('0xd6')]==='1'&&_0x4f7907[_0x0a9e('0x119')]==='0'){if(this[_0x0a9e('0x20')][_0x4f7907[_0x0a9e('0x11a')]]){if(!this[_0x0a9e('0x20')][_0x4f7907[_0x0a9e('0x11a')]]['locked']){this['agents'][_0x4f7907[_0x0a9e('0x11a')]][_0x0a9e('0x118')]=!![];this['actions'][_0x4f7907['actionid']][_0x0a9e('0x118')]=!![];this[_0x0a9e('0x24')][_0x4f7907[_0x0a9e('0x117')]]['stateinterface']=_0x4f7907[_0x0a9e('0x11a')];}}}}else if((strategy[this['voiceQueues'][this[_0x0a9e('0x24')][_0x4f7907['actionid']][_0x0a9e('0xaf')]]['strategy']]||_0x0a9e('0x17'))===_0x0a9e('0x17')){if(this[_0x0a9e('0x24')][_0x4f7907['actionid']]){if(this[_0x0a9e('0x20')][_0x4f7907['stateinterface']]){this['actions'][_0x4f7907[_0x0a9e('0x117')]][_0x0a9e('0x11a')]=_0x4f7907[_0x0a9e('0x11a')];if(_[_0x0a9e('0xab')](this[_0x0a9e('0x29')][this[_0x0a9e('0x24')][_0x4f7907[_0x0a9e('0x117')]][_0x0a9e('0xaf')]])){this[_0x0a9e('0x29')][this[_0x0a9e('0x24')][_0x4f7907[_0x0a9e('0x117')]][_0x0a9e('0xaf')]]=[];}this[_0x0a9e('0x29')][this[_0x0a9e('0x24')][_0x4f7907[_0x0a9e('0x117')]][_0x0a9e('0xaf')]][_0x0a9e('0x11b')](_[_0x0a9e('0x11c')](_[_0x0a9e('0xcb')](this['actions'][_0x4f7907[_0x0a9e('0x117')]],[_0x0a9e('0x11d'),_0x0a9e('0x11a')]),{'status':_0x4f7907[_0x0a9e('0xd6')],'paused':_0x4f7907['paused']}));}}}};function unlockQueueStatus(_0x49c3be,_0x54658d){setTimeout(function(){if(_[_0x0a9e('0x3d')](_0x49c3be['queueStatusComplete'])){loggerBooked[_0x0a9e('0x91')](_0x0a9e('0x11e'),_0x54658d);}_0x49c3be[_0x0a9e('0x11f')]=!![];loggerBooked[_0x0a9e('0x80')](_0x0a9e('0x120'),_0x54658d,JSON[_0x0a9e('0x49')](_[_0x0a9e('0xcb')](_0x49c3be,[_0x0a9e('0x3f'),_0x0a9e('0x11f')])));},0x1f3);}Dialer[_0x0a9e('0x19')]['syncQueueStatusComplete']=function(_0x283c59){var _0x47a018=this;var _0x2509f3=_0x47a018['voiceQueues'][_0x47a018[_0x0a9e('0x24')][_0x283c59[_0x0a9e('0x117')]][_0x0a9e('0xaf')]];if(strategy[this['voiceQueues'][this[_0x0a9e('0x24')][_0x283c59[_0x0a9e('0x117')]]['queue']]['strategy']]===_0x0a9e('0x18')){if(this[_0x0a9e('0x24')][_0x283c59[_0x0a9e('0x117')]]&&this['actions'][_0x283c59['actionid']]['stateinterface']){this[_0x0a9e('0x121')][_0x0a9e('0x122')](this[_0x0a9e('0x24')][_0x283c59[_0x0a9e('0x117')]][_0x0a9e('0x11d')],this[_0x0a9e('0x24')][_0x283c59[_0x0a9e('0x117')]][_0x0a9e('0x11a')])[_0x0a9e('0xac')](function(_0x18e38b){logger[_0x0a9e('0x91')](_0x0a9e('0x123'),util[_0x0a9e('0x92')](_0x18e38b,{'showHidden':![],'depth':null}));})[_0x0a9e('0x1c')](function(){_0x47a018[_0x0a9e('0xb0')](_0x47a018[_0x0a9e('0x1e')][_0x47a018[_0x0a9e('0x24')][_0x283c59[_0x0a9e('0x117')]]['queue']]);_0x47a018[_0x0a9e('0x20')][_0x47a018[_0x0a9e('0x24')][_0x283c59[_0x0a9e('0x117')]][_0x0a9e('0x11a')]][_0x0a9e('0x118')]=![];delete _0x47a018[_0x0a9e('0x24')][_0x283c59['actionid']];unlockQueueStatus(_0x2509f3);});}else{this[_0x0a9e('0xb0')](this[_0x0a9e('0x1e')][this[_0x0a9e('0x24')][_0x283c59[_0x0a9e('0x117')]][_0x0a9e('0xaf')]]);this[_0x0a9e('0xbb')]({'active':![],'ContactId':this[_0x0a9e('0x24')][_0x283c59[_0x0a9e('0x117')]][_0x0a9e('0xcc')],'ListId':this['actions'][_0x283c59['actionid']][_0x0a9e('0xcd')],'VoiceQueueId':this[_0x0a9e('0x24')][_0x283c59['actionid']][_0x0a9e('0xcf')]||undefined,'CampaignId':this[_0x0a9e('0x24')][_0x283c59['actionid']][_0x0a9e('0xd0')]||undefined})['catch'](loggerCatch(_0x0a9e('0x124')));delete this[_0x0a9e('0x24')][_0x283c59['actionid']];unlockQueueStatus(_0x2509f3);}}else if((strategy[this[_0x0a9e('0x1e')][this[_0x0a9e('0x24')][_0x283c59['actionid']][_0x0a9e('0xaf')]][_0x0a9e('0x4e')]]||'rrmemory')===_0x0a9e('0x17')){var _0x237994;if(this[_0x0a9e('0x24')][_0x283c59[_0x0a9e('0x117')]]&&!_[_0x0a9e('0x47')](this[_0x0a9e('0x29')][this['actions'][_0x283c59[_0x0a9e('0x117')]][_0x0a9e('0xaf')]])){if(this['queueBookedRR'][_0x47a018[_0x0a9e('0x24')][_0x283c59[_0x0a9e('0x117')]][_0x0a9e('0xaf')]]){this[_0x0a9e('0x125')][_0x47a018[_0x0a9e('0x24')][_0x283c59[_0x0a9e('0x117')]][_0x0a9e('0xaf')]]=this['queueBookedRR'][this['actions'][_0x283c59['actionid']]['queue']]?this['queueBookedRR'][this[_0x0a9e('0x24')][_0x283c59[_0x0a9e('0x117')]]['queue']]:this['queueBooked'][this[_0x0a9e('0x24')][_0x283c59['actionid']][_0x0a9e('0xaf')]]?this[_0x0a9e('0x29')][this[_0x0a9e('0x24')][_0x283c59[_0x0a9e('0x117')]][_0x0a9e('0xaf')]][_0x0a9e('0x126')]||0x0:0x0;}this['queueBooked'][this[_0x0a9e('0x24')][_0x283c59[_0x0a9e('0x117')]]['queue']][_0x0a9e('0x126')]=this[_0x0a9e('0x125')][this[_0x0a9e('0x24')][_0x283c59[_0x0a9e('0x117')]][_0x0a9e('0xaf')]];for(var _0x2f1cc0=0x0;_0x2f1cc0<this[_0x0a9e('0x29')][this['actions'][_0x283c59[_0x0a9e('0x117')]]['queue']][_0x0a9e('0x94')];_0x2f1cc0+=0x1){_0x237994=rr(this[_0x0a9e('0x29')][this['actions'][_0x283c59[_0x0a9e('0x117')]][_0x0a9e('0xaf')]]);this['queueBookedRR'][_0x47a018[_0x0a9e('0x24')][_0x283c59['actionid']][_0x0a9e('0xaf')]]=this[_0x0a9e('0x29')][this['actions'][_0x283c59[_0x0a9e('0x117')]]['queue']][_0x0a9e('0x126')];if(_0x237994[_0x0a9e('0xd6')]==='1'&&_0x237994[_0x0a9e('0x119')]==='0'){break;}}if(!_[_0x0a9e('0xab')](_0x237994)){this[_0x0a9e('0x20')][_0x237994[_0x0a9e('0x11a')]][_0x0a9e('0x127')]=_['isUndefined'](this[_0x0a9e('0x20')][_0x237994[_0x0a9e('0x11a')]][_0x0a9e('0x127')])?!![]:this[_0x0a9e('0x20')][_0x237994[_0x0a9e('0x11a')]]['unlockRR'];}loggerBooked[_0x0a9e('0x80')]('[booked][RR]',_0x283c59['actionid'],_0x0a9e('0x128'),JSON['stringify'](_[_0x0a9e('0xcb')](this[_0x0a9e('0x20')][_0x237994['stateinterface']],[_0x0a9e('0x3f'),_0x0a9e('0x127')])),_0x0a9e('0x129'),JSON[_0x0a9e('0x49')](_0x237994[_0x0a9e('0x11d')]));if(!_[_0x0a9e('0xab')](_0x237994)&&_0x237994[_0x0a9e('0xd6')]==='1'&&_0x237994[_0x0a9e('0x119')]==='0'&&this[_0x0a9e('0x20')][_0x237994['stateinterface']][_0x0a9e('0x127')]){this[_0x0a9e('0x20')][_0x237994[_0x0a9e('0x11a')]][_0x0a9e('0x127')]=![];this['queueBooked'][_0x47a018[_0x0a9e('0x24')][_0x283c59[_0x0a9e('0x117')]][_0x0a9e('0xaf')]]=[];this['preview'][_0x0a9e('0x122')](_0x237994[_0x0a9e('0x11d')],_0x237994[_0x0a9e('0x11a')])['catch'](function(_0x3e61a4){logger['error'](_0x0a9e('0x123'),util[_0x0a9e('0x92')](_0x3e61a4,{'showHidden':![],'depth':null}));})[_0x0a9e('0x1c')](function(){_0x47a018[_0x0a9e('0xb0')](_0x47a018[_0x0a9e('0x1e')][_0x47a018[_0x0a9e('0x24')][_0x283c59[_0x0a9e('0x117')]]['queue']]);setTimeout(function(){_0x47a018[_0x0a9e('0x20')][_0x237994[_0x0a9e('0x11a')]][_0x0a9e('0x127')]=!![];loggerBooked[_0x0a9e('0x80')](_0x0a9e('0x12a'),_0x283c59[_0x0a9e('0x117')],_0x0a9e('0x128'),JSON[_0x0a9e('0x49')](_[_0x0a9e('0xcb')](_0x47a018[_0x0a9e('0x20')][_0x237994[_0x0a9e('0x11a')]],[_0x0a9e('0x3f'),_0x0a9e('0x127')])),_0x0a9e('0x129'),JSON[_0x0a9e('0x49')](_0x237994[_0x0a9e('0x11d')]));},0xc7);delete _0x47a018[_0x0a9e('0x24')][_0x283c59[_0x0a9e('0x117')]];unlockQueueStatus(_0x2509f3,_0x283c59[_0x0a9e('0x117')]);});}else{loggerBooked[_0x0a9e('0x80')](_0x0a9e('0x12b'));this[_0x0a9e('0xb0')](this[_0x0a9e('0x1e')][this['actions'][_0x283c59[_0x0a9e('0x117')]][_0x0a9e('0xaf')]]);this[_0x0a9e('0xbb')]({'active':![],'ContactId':this['actions'][_0x283c59[_0x0a9e('0x117')]]['ContactId'],'ListId':this[_0x0a9e('0x24')][_0x283c59[_0x0a9e('0x117')]][_0x0a9e('0xcd')],'VoiceQueueId':this[_0x0a9e('0x24')][_0x283c59[_0x0a9e('0x117')]][_0x0a9e('0xcf')]||undefined,'CampaignId':this[_0x0a9e('0x24')][_0x283c59[_0x0a9e('0x117')]]['CampaignId']||undefined})[_0x0a9e('0xac')](loggerCatch(_0x0a9e('0x124')));delete this['actions'][_0x283c59[_0x0a9e('0x117')]];unlockQueueStatus(_0x2509f3);}}else{loggerBooked[_0x0a9e('0x80')](_0x0a9e('0x12c'));this['updateOriginated'](this[_0x0a9e('0x1e')][this[_0x0a9e('0x24')][_0x283c59[_0x0a9e('0x117')]][_0x0a9e('0xaf')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0x0a9e('0x24')][_0x283c59[_0x0a9e('0x117')]][_0x0a9e('0xcc')],'ListId':this[_0x0a9e('0x24')][_0x283c59[_0x0a9e('0x117')]]['ListId'],'VoiceQueueId':this[_0x0a9e('0x24')][_0x283c59[_0x0a9e('0x117')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x0a9e('0x24')][_0x283c59[_0x0a9e('0x117')]][_0x0a9e('0xd0')]||undefined})['catch'](loggerCatch('[unlock2][syncQueueStatusComplete]'));delete this[_0x0a9e('0x24')][_0x283c59[_0x0a9e('0x117')]];unlockQueueStatus(_0x2509f3);}}else{loggerBooked[_0x0a9e('0x80')](_0x0a9e('0x12d'));this[_0x0a9e('0xb0')](this[_0x0a9e('0x1e')][this[_0x0a9e('0x24')][_0x283c59[_0x0a9e('0x117')]]['queue']]);this['rescheduleContact']({'active':![],'ContactId':this[_0x0a9e('0x24')][_0x283c59['actionid']][_0x0a9e('0xcc')],'ListId':this[_0x0a9e('0x24')][_0x283c59[_0x0a9e('0x117')]][_0x0a9e('0xcd')],'VoiceQueueId':this['actions'][_0x283c59[_0x0a9e('0x117')]][_0x0a9e('0xcf')]||undefined,'CampaignId':this['actions'][_0x283c59[_0x0a9e('0x117')]]['CampaignId']||undefined})[_0x0a9e('0xac')](loggerCatch(_0x0a9e('0x12e')));delete this[_0x0a9e('0x24')][_0x283c59[_0x0a9e('0x117')]];unlockQueueStatus(_0x2509f3);}};Dialer[_0x0a9e('0x19')][_0x0a9e('0x3b')]=function(){var _0x595efc=this;setInterval(function(){_0x595efc[_0x0a9e('0x12f')]();},0x3e8);};Dialer['prototype'][_0x0a9e('0x130')]=function(_0x1afaf2){var _0x4229e6=this;return function(){if(!_0x4229e6[_0x0a9e('0xd4')](_0x1afaf2[_0x0a9e('0x78')])){if(!_0x4229e6[_0x0a9e('0xd4')](_0x1afaf2[_0x0a9e('0x131')])){_0x1afaf2['message']=_0x0a9e('0x132');throw _0x1afaf2[_0x0a9e('0x3f')]+_0x0a9e('0x133');}}};};Dialer[_0x0a9e('0x19')][_0x0a9e('0x134')]=function(_0x534f61,_0x3cd588,_0x2eea54,_0x488d6c){var _0x55bb89=this;return function(){var _0x2240ea=!![];return _0x55bb89[_0x0a9e('0x135')](_0x534f61,_0x3cd588,_0x2eea54,_0x488d6c,_0x2240ea);};};Dialer[_0x0a9e('0x19')][_0x0a9e('0x136')]=function(_0x380539,_0x1f1f36,_0x4d35ed,_0x1e31c2){var _0x13782b=this;return function(){var _0x2a9f6e=![];return _0x13782b['ifTime'](_0x380539[_0x0a9e('0x46')],_0x1f1f36,_0x4d35ed,_0x1e31c2,_0x2a9f6e);};};Dialer[_0x0a9e('0x19')][_0x0a9e('0x135')]=function(_0x1c738f,_0x57425c,_0x5d4935,_0x45c980,_0x465b51){var _0x45630b=[];return new BPromise(function(_0x121aa2,_0x1ba7b2){if(!isNotNull(_0x1c738f)){_0x45c980[_0x0a9e('0x3e')]=_0x0a9e('0x44');return _0x1ba7b2(msgResponse(_0x0a9e('0x135'),'Failure',_0x5d4935+_0x0a9e('0x137')));}if(_['isEmpty'](_0x1c738f)){_0x45c980[_0x0a9e('0x3e')]=_0x0a9e('0x138');return _0x1ba7b2(msgResponse(_0x0a9e('0x135'),'Failure',_0x5d4935+'\x20Intervals\x20is\x20empty\x20'));}if(_0x57425c&&_[_0x0a9e('0x3d')](config['timezones'][_0x57425c])){_0x45c980[_0x0a9e('0x3e')]='TIMEZONE_UNKNOW';return _0x1ba7b2(msgResponse('ifTime',_0x0a9e('0x139'),_0x5d4935+_0x0a9e('0x13a')+_0x57425c));}if(_[_0x0a9e('0x13b')](_0x1c738f)){for(var _0x2e6482=0x0;_0x2e6482<_0x1c738f[_0x0a9e('0x94')];_0x2e6482+=0x1){_0x45630b[_0x0a9e('0x11b')](ami[_0x0a9e('0x13c')]({'action':_0x0a9e('0x13d'),'command':util[_0x0a9e('0x7a')](_0x0a9e('0x13e'),_0x1c738f[_0x2e6482][_0x0a9e('0x13f')],!_[_0x0a9e('0x3d')](config[_0x0a9e('0x140')][_0x57425c])?_0x57425c:'')})['then'](function(_0x58f251){return _0x58f251[_0x0a9e('0x141')]['indexOf'](_0x0a9e('0x142'))>=0x0?!![]:![];})[_0x0a9e('0xac')](myreject(_0x1ba7b2)));}}else{_0x45630b[_0x0a9e('0x11b')](ami['Action']({'action':'command','command':util[_0x0a9e('0x7a')](_0x0a9e('0x13e'),_0x1c738f,!_[_0x0a9e('0x3d')](config[_0x0a9e('0x140')][_0x57425c])?_0x57425c:'')})[_0x0a9e('0xb4')](function(_0x5ac14c){return _0x5ac14c[_0x0a9e('0x141')]['indexOf'](_0x0a9e('0x142'))>=0x0?!![]:![];})['catch'](myreject(_0x1ba7b2)));}BPromise[_0x0a9e('0x143')](_0x45630b)[_0x0a9e('0xb4')](function(_0x595a5e){var _0x1fe77c=_[_0x0a9e('0x144')](_0x595a5e);if(_0x1fe77c){return _0x121aa2(_0x1fe77c);}else{_0x45c980[_0x0a9e('0x3e')]=_0x465b51?_0x0a9e('0x145'):_0x0a9e('0x146');return _0x1ba7b2(msgResponse(_0x0a9e('0x147'),'Failure',_0x0a9e('0x148')+_0x465b51+'\x20'+_0x5d4935+_0x0a9e('0x149')+util[_0x0a9e('0x92')](_0x1c738f,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x57425c));}})[_0x0a9e('0xac')](function(_0x934f69){return _0x1ba7b2(msgResponse(_0x0a9e('0x135'),'Failure',JSON[_0x0a9e('0x49')](_0x934f69)));});});};Dialer[_0x0a9e('0x19')][_0x0a9e('0x14a')]=function(_0x2317e7){var _0x1d39bd=this;return function(){switch(_0x2317e7[_0x0a9e('0x58')]){case'progressive':freeVariablesPredictive(_0x2317e7);_0x1d39bd['handlePower'](_0x2317e7,0x1);break;case _0x0a9e('0x14b'):freeVariablesPredictive(_0x2317e7);_0x1d39bd[_0x0a9e('0x14c')](_0x2317e7,_0x2317e7['dialPowerLevel']);break;case _0x0a9e('0x8'):_0x1d39bd[_0x0a9e('0x8')](_0x2317e7);break;case _0x0a9e('0x7'):freeVariablesPredictive(_0x2317e7);_0x1d39bd[_0x0a9e('0x14c')](_0x2317e7,0x1);break;default:freeVariablesPredictive(_0x2317e7);logger[_0x0a9e('0x91')](_0x0a9e('0x14d'),_0x2317e7['name'],_0x0a9e('0x14e'));}};};Dialer[_0x0a9e('0x19')][_0x0a9e('0x14f')]=function(_0x4edb79){var _0x45c6ce=this;return function(){_0x45c6ce[_0x0a9e('0x150')](_0x4edb79);};};Dialer[_0x0a9e('0x19')][_0x0a9e('0x151')]=function(_0x5beea6){var _0x49bb4f=this;if(isNotPreview(_0x5beea6[_0x0a9e('0x58')])){if(isVoiceQueueOutbound(_0x5beea6[_0x0a9e('0x4d')])&&isActive(_0x5beea6[_0x0a9e('0x57')])){_0x5beea6['sendMessageOneNotActive']=!![];BPromise[_0x0a9e('0xb3')]()[_0x0a9e('0xb4')](checkIsLoggedIn(_0x5beea6,_0x5beea6[_0x0a9e('0x4f')]))[_0x0a9e('0xb4')](checkIsActive(_0x5beea6,_0x5beea6[_0x0a9e('0x57')]))[_0x0a9e('0xb4')](checkInterval(_0x5beea6))[_0x0a9e('0xb4')](_0x49bb4f[_0x0a9e('0x130')](_0x5beea6))['then'](_0x49bb4f['checkIfTime'](_0x5beea6[_0x0a9e('0x152')],_0x5beea6[_0x0a9e('0x153')],_0x5beea6['name'],_0x5beea6))[_0x0a9e('0xb4')](_0x49bb4f['checkIfTimeIntervals'](_0x5beea6[_0x0a9e('0x43')],_0x5beea6[_0x0a9e('0x153')],_0x5beea6['name'],_0x5beea6))[_0x0a9e('0xb4')](_0x49bb4f[_0x0a9e('0x14a')](_0x5beea6))['catch'](loggerCatchQueueSummary(_0x0a9e('0x154'),_0x5beea6));}else{notSendMessagesQueue(_0x5beea6);}}else{freeVariablesPredictive(_0x5beea6);}};Dialer[_0x0a9e('0x19')][_0x0a9e('0x12f')]=function(){var _0x17259c=this;var _0x434df7;for(var _0x45b8ed in this[_0x0a9e('0x1f')]){if(this['campaigns'][_0x0a9e('0xaa')](_0x45b8ed)){_0x434df7=this[_0x0a9e('0x1f')][_0x45b8ed];if(isCampaignIvr(_0x434df7[_0x0a9e('0x4d')])&&isActive(_0x434df7[_0x0a9e('0x79')])){_0x434df7[_0x0a9e('0x9e')]=!![];BPromise[_0x0a9e('0xb3')]()[_0x0a9e('0xb4')](checkIsActive(_0x434df7,_0x434df7['active']))['then'](checkInterval(_0x434df7))[_0x0a9e('0xb4')](_0x17259c[_0x0a9e('0x130')](_0x434df7))[_0x0a9e('0xb4')](_0x17259c['checkIfTime'](_0x434df7['dialGlobalInterval'],_0x434df7[_0x0a9e('0x153')],_0x434df7['name'],_0x434df7))[_0x0a9e('0xb4')](_0x17259c[_0x0a9e('0x136')](_0x434df7[_0x0a9e('0x43')],_0x434df7[_0x0a9e('0x153')],_0x434df7[_0x0a9e('0x3f')],_0x434df7))[_0x0a9e('0xb4')](_0x17259c[_0x0a9e('0x14f')](_0x434df7))[_0x0a9e('0xac')](loggerCatchQueueSummary(_0x0a9e('0x155'),_0x434df7));}else{notSendMessagesCampaign(_0x434df7);}}}};function getCallerIdRandom(_0x47e61e,_0x516859){var _0x399cf4,_0x54d34e,_0x2f4540;if(_0x516859<=0x0){_0x516859=0x1;}_0x399cf4=new RegExp(_0x0a9e('0x156')+_0x516859+'}$');_0x54d34e=Math[_0x0a9e('0x157')](0xa,_0x516859-0x1);_0x2f4540=Math[_0x0a9e('0x157')](0xa,_0x516859)-0x1;return util['format']('%s',_[_0x0a9e('0x158')](_0x47e61e,_0x399cf4,_[_0x0a9e('0x159')](_0x54d34e,_0x2f4540)));}function extractCalleridName(_0x2bc6a3){var _0x5174c5=_0x2bc6a3[_0x0a9e('0x15a')](/"(.*?)"/);return _0x5174c5?_0x5174c5[0x1]:_0x2bc6a3;}function extractCalleridNumber(_0xcdd954){var _0x1e30bc=_0xcdd954['match'](/<(.*?)>/);return _0x1e30bc?_0x1e30bc[0x1]:_0xcdd954;}Dialer[_0x0a9e('0x19')][_0x0a9e('0x15b')]=function(_0x459ab7,_0x6e8a19){var _0x69b4d6=this;var _0x1ab878=uuid['v4']();this['actions'][_0x1ab878]=new Action(_0x459ab7,_0x6e8a19,_0x1ab878);return new BPromise(function(_0x5613e3,_0x46146f){if(_[_0x0a9e('0x3d')](_0x459ab7)&&_0x0a9e('0x15c')!==typeof _0x459ab7){return _0x46146f(msgResponse('originate','Failure',_0x0a9e('0x15d')));}if(_[_0x0a9e('0x3d')](_0x6e8a19[_0x0a9e('0x15e')]['phone'])||_0x6e8a19['Contact'][_0x0a9e('0x15f')]===null){return _0x46146f(msgResponse(_0x0a9e('0x160'),_0x0a9e('0x139'),_0x0a9e('0x161')));}var _0x1bafdd={'XMD-CALLERID':_0x69b4d6['actions'][_0x1ab878][_0x0a9e('0x162')](),'XMD-AGI':_0x459ab7['dialQueueProject']?util[_0x0a9e('0x7a')](_0x0a9e('0x163'),ipAgi,_0x459ab7['dialQueueProject']):_0x0a9e('0x164'),'XMD-AGIAFTER':_0x459ab7['dialQueueProject2']?util[_0x0a9e('0x7a')](_0x0a9e('0x163'),ipAgi,_0x459ab7[_0x0a9e('0xf4')]):_0x0a9e('0x164'),'XMD-QUEUE':_0x459ab7[_0x0a9e('0x4d')]==='outbound'?util[_0x0a9e('0x7a')](_0x0a9e('0x165'),_0x459ab7[_0x0a9e('0x3f')],_0x459ab7['dialQueueOptions']||'',_0x459ab7[_0x0a9e('0x166')]?'c':'',_0x459ab7['dialQueueTimeout']||0x3):_0x0a9e('0x164'),'XMD-CONTACTID':_0x6e8a19[_0x0a9e('0xcc')],'XMD-CDRTYPE':_0x0a9e('0x6'),'CALLERID(all)':_0x69b4d6['actions'][_0x1ab878][_0x0a9e('0x162')](),'XMD-AMD':_0x459ab7[_0x0a9e('0xdb')]?_0x0a9e('0x167'):_0x0a9e('0x164'),'XMD-DESTINATION':_0x0a9e('0x168')};if(_0x459ab7[_0x0a9e('0xdb')]){_0x1bafdd['XMD-AMDINITIALSILENCE']=_0x459ab7[_0x0a9e('0x169')]||0x9c4;_0x1bafdd[_0x0a9e('0x16a')]=_0x459ab7[_0x0a9e('0x16b')]||0x5dc;_0x1bafdd[_0x0a9e('0x16c')]=_0x459ab7[_0x0a9e('0x16d')]||0x320;_0x1bafdd[_0x0a9e('0x16e')]=_0x459ab7[_0x0a9e('0x16f')]||0x1388;_0x1bafdd[_0x0a9e('0x170')]=_0x459ab7['dialAMDMinWordLength']||0x64;_0x1bafdd[_0x0a9e('0x171')]=_0x459ab7[_0x0a9e('0x172')]||0x32;_0x1bafdd[_0x0a9e('0x173')]=_0x459ab7[_0x0a9e('0x174')]||0x3;_0x1bafdd['XMD-AMDSILENCETHRESHOLD']=_0x459ab7[_0x0a9e('0x175')]||0x100;_0x1bafdd['XMD-AMDMAXIMUMWORDLENGTH']=_0x459ab7[_0x0a9e('0x176')]||0x1388;}if(_0x459ab7[_0x0a9e('0x4d')]===_0x0a9e('0x8d')){_0x1bafdd['XMD-VOICEQUEUEID']=_0x6e8a19[_0x0a9e('0xcf')];}else{_0x1bafdd[_0x0a9e('0x177')]=_0x6e8a19[_0x0a9e('0xd0')];}for(var _0x36c0f4 in _0x6e8a19['Contact']){if(_0x6e8a19[_0x0a9e('0x15e')][_0x0a9e('0xaa')](_0x36c0f4)){if(isNotNull(_0x6e8a19[_0x0a9e('0x15e')][_0x36c0f4])&&_0x36c0f4!=='id'&&_0x36c0f4!==_0x0a9e('0x178')&&_0x36c0f4!==_0x0a9e('0x179')&&_0x36c0f4!==_0x0a9e('0x17a')){_0x1bafdd[util[_0x0a9e('0x7a')]('%s%s',_0x0a9e('0x17b'),_[_0x0a9e('0x17c')](_0x36c0f4))]=_0x6e8a19[_0x0a9e('0x15e')][_0x36c0f4];}}}var _0xa42055=_0x69b4d6['isTrunkReachable'](_0x459ab7[_0x0a9e('0x78')])?getCallerId(_0x459ab7['Trunk'][_0x0a9e('0x17d')],_0x459ab7[_0x0a9e('0x59')],_0x459ab7[_0x0a9e('0x17e')]>0x0?getCallerIdRandom(_0x459ab7[_0x0a9e('0x17f')],_0x459ab7[_0x0a9e('0x17e')]):_0x459ab7[_0x0a9e('0x17f')]):getCallerId(_[_0x0a9e('0xab')](_0x459ab7['TrunkBackup'])?_0x459ab7[_0x0a9e('0x78')]['callerid']:_0x459ab7[_0x0a9e('0x131')][_0x0a9e('0x17d')],_0x459ab7['dialOriginateCallerIdName'],_0x459ab7[_0x0a9e('0x17e')]>0x0?getCallerIdRandom(_0x459ab7[_0x0a9e('0x17f')],_0x459ab7[_0x0a9e('0x17e')]):_0x459ab7[_0x0a9e('0x17f')]);if(_0xa42055){_0x1bafdd['XMD-ORIGINATECALLERIDNAME']=_0x69b4d6[_0x0a9e('0x24')][_0x1ab878][_0x0a9e('0x180')]=extractCalleridName(_0xa42055);_0x1bafdd['XMD-ORIGINATECALLERIDNUM']=_0x69b4d6[_0x0a9e('0x24')][_0x1ab878]['originatecalleridnum']=extractCalleridNumber(_0xa42055);}return ami['Action']({'actionid':_0x1ab878,'action':'originate','channel':_0x69b4d6[_0x0a9e('0xd4')](_0x459ab7[_0x0a9e('0x78')])?util['format'](_0x0a9e('0x181'),_0x459ab7[_0x0a9e('0x78')]['name'],isNotNull(_0x459ab7[_0x0a9e('0x5b')])?_0x459ab7[_0x0a9e('0x5b')][_0x0a9e('0x182')]()||'':'',_0x459ab7[_0x0a9e('0x183')]>0x0?_0x6e8a19[_0x0a9e('0x15e')][_0x0a9e('0x15f')][_0x0a9e('0x184')](_0x459ab7['dialCutDigit']):_0x6e8a19[_0x0a9e('0x15e')]['phone']):util[_0x0a9e('0x7a')](_0x0a9e('0x181'),_[_0x0a9e('0xab')](_0x459ab7[_0x0a9e('0x131')])?_0x459ab7[_0x0a9e('0x78')][_0x0a9e('0x3f')]:_0x459ab7['TrunkBackup'][_0x0a9e('0x3f')],isNotNull(_0x459ab7[_0x0a9e('0x5b')])?_0x459ab7[_0x0a9e('0x5b')]['trim']()||'':'',_0x459ab7[_0x0a9e('0x183')]>0x0?_0x6e8a19[_0x0a9e('0x15e')][_0x0a9e('0x15f')][_0x0a9e('0x184')](_0x459ab7[_0x0a9e('0x183')]):_0x6e8a19[_0x0a9e('0x15e')][_0x0a9e('0x15f')]),'callerid':_0xa42055,'Exten':_0x0a9e('0x168'),'Context':_0x0a9e('0x185'),'Priority':'1','variable':_0x1bafdd,'timeout':(_0x459ab7[_0x0a9e('0x5a')]||0x1e)*0x3e8,'async':!![],'channelid':_0x1ab878})[_0x0a9e('0xb4')](function(_0x19732c){return _0x5613e3(_0x19732c);})[_0x0a9e('0xac')](function(_0x130947){_0x459ab7[_0x0a9e('0x66')]+=0x1;var _0x2efc65=new History(_0x69b4d6['actions'][_0x1ab878]);logger[_0x0a9e('0x91')](util[_0x0a9e('0x7a')](_0x0a9e('0x186'),JSON['stringify'](_0x130947)));_0x2efc65[_0x0a9e('0xa5')]=0xe;_0x2efc65[_0x0a9e('0xa6')]=_0x0a9e('0x187');_0x2efc65[_0x0a9e('0xa7')]=moment()['format'](_0x0a9e('0xf5'));_0x2efc65[_0x0a9e('0x112')]=_0x2efc65[_0x0a9e('0xa7')];_0x69b4d6[_0x0a9e('0xc5')](_0x2efc65)['catch'](loggerCatch(_0x0a9e('0x188')));_0x69b4d6[_0x0a9e('0xc3')](_0x2efc65)[_0x0a9e('0xac')](loggerCatch(_0x0a9e('0x188')))['finally'](function(){delete _0x69b4d6['actions'][_0x1ab878];return _0x46146f(msgResponse(_0x0a9e('0x160'),_0x0a9e('0x48'),_0x0a9e('0x189')));});});});};Dialer[_0x0a9e('0x19')][_0x0a9e('0x2f')]=function(_0x433b5d){var _0x15df71=this[_0x0a9e('0x24')][_0x433b5d[_0x0a9e('0x117')]];var _0x84117=this;if(_0x15df71){delete this[_0x0a9e('0x24')][_0x433b5d[_0x0a9e('0x117')]];_0x15df71[_0x0a9e('0xfb')]=moment()[_0x0a9e('0x7a')]('YYYY-MM-DD\x20HH:mm:ss');var _0x7f3b59=_0x15df71[_0x0a9e('0x4d')]===_0x0a9e('0x7d')?this['campaigns'][_0x15df71['queue']]:this[_0x0a9e('0x1e')][_0x15df71['getQueue']()];if(!this[_0x0a9e('0x18a')](_0x433b5d[_0x0a9e('0x18b')])){this[_0x0a9e('0xb0')](_0x7f3b59);return this[_0x0a9e('0x18c')](_0x15df71,_0x7f3b59,_0x433b5d)['then'](function(_0x59ce14){})[_0x0a9e('0xac')](loggerCatch(_0x0a9e('0x18d')));}else{this[_0x0a9e('0x26')][_0x433b5d[_0x0a9e('0xd8')]]=_0x15df71;}}};Dialer['prototype'][_0x0a9e('0x18e')]=function(_0xc1811b,_0xa64f55,_0x25f5fa){var _0x193ef7=new History(_0xa64f55);if(_0x193ef7['countbusyretry']+_0x193ef7['countcongestionretry']+_0x193ef7[_0x0a9e('0x18f')]+_0x193ef7[_0x0a9e('0x190')]+_0x193ef7[_0x0a9e('0x100')]+_0x193ef7[_0x0a9e('0x10e')]+_0x193ef7[_0x0a9e('0x191')]+_0x193ef7[_0x0a9e('0x192')]>=_0x25f5fa[_0x0a9e('0x193')]-0x1){return!![];}switch(_0xc1811b){case 0x3:if(_0x193ef7['countnoanswerretry']>=_0x25f5fa[_0x0a9e('0x194')]-0x1){return!![];}else{this[_0x0a9e('0xbb')]({'active':![],'countnoanswerretry':_0x193ef7[_0x0a9e('0x18f')]+=0x1,'scheduledat':moment()['add'](_0x25f5fa['dialNoAnswerRetryFrequency'],'minutes')[_0x0a9e('0x7a')](_0x0a9e('0xf5')),'ContactId':_0x193ef7['ContactId'],'ListId':_0x193ef7[_0x0a9e('0xcd')],'VoiceQueueId':_0x193ef7[_0x0a9e('0xcf')]||undefined,'CampaignId':_0x193ef7[_0x0a9e('0xd0')]||undefined})['catch'](loggerCatch('[rescheduleContact][NoAnswer]'));}break;case 0x5:if(_0x193ef7[_0x0a9e('0x195')]>=_0x25f5fa[_0x0a9e('0x196')]-0x1){return!![];}else{this[_0x0a9e('0xbb')]({'active':![],'countbusyretry':_0x193ef7[_0x0a9e('0x195')]+=0x1,'scheduledat':moment()['add'](_0x25f5fa[_0x0a9e('0x197')],'minutes')['format'](_0x0a9e('0xf5')),'ContactId':_0x193ef7['ContactId'],'ListId':_0x193ef7[_0x0a9e('0xcd')],'VoiceQueueId':_0x193ef7[_0x0a9e('0xcf')]||undefined,'CampaignId':_0x193ef7[_0x0a9e('0xd0')]||undefined})['catch'](loggerCatch(_0x0a9e('0x198')));}break;case 0x8:if(_0x193ef7[_0x0a9e('0x199')]>=_0x25f5fa[_0x0a9e('0x19a')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countcongestionretry':_0x193ef7['countcongestionretry']+=0x1,'scheduledat':moment()[_0x0a9e('0x10f')](_0x25f5fa[_0x0a9e('0x19b')],_0x0a9e('0x102'))[_0x0a9e('0x7a')](_0x0a9e('0xf5')),'ContactId':_0x193ef7[_0x0a9e('0xcc')],'ListId':_0x193ef7['ListId'],'VoiceQueueId':_0x193ef7['VoiceQueueId']||undefined,'CampaignId':_0x193ef7[_0x0a9e('0xd0')]||undefined})[_0x0a9e('0xac')](loggerCatch('[rescheduleContact]\x20[Congestion]'));}break;case 0x0:if(_0x193ef7['countnosuchnumberretry']>=_0x25f5fa['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x193ef7['countnosuchnumberretry']+=0x1,'scheduledat':moment()['add'](_0x25f5fa[_0x0a9e('0x19c')],'minutes')[_0x0a9e('0x7a')](_0x0a9e('0xf5')),'ContactId':_0x193ef7[_0x0a9e('0xcc')],'ListId':_0x193ef7[_0x0a9e('0xcd')],'VoiceQueueId':_0x193ef7[_0x0a9e('0xcf')]||undefined,'CampaignId':_0x193ef7[_0x0a9e('0xd0')]||undefined})[_0x0a9e('0xac')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x193ef7[_0x0a9e('0x100')]>=_0x25f5fa[_0x0a9e('0xff')]-0x1){return!![];}else{this[_0x0a9e('0xbb')]({'active':![],'countdropretry':_0x193ef7[_0x0a9e('0x100')]+=0x1,'scheduledat':moment()[_0x0a9e('0x10f')](_0x25f5fa[_0x0a9e('0x101')],_0x0a9e('0x102'))[_0x0a9e('0x7a')](_0x0a9e('0xf5')),'ContactId':_0x193ef7[_0x0a9e('0xcc')],'ListId':_0x193ef7[_0x0a9e('0xcd')],'VoiceQueueId':_0x193ef7['VoiceQueueId']||undefined,'CampaignId':_0x193ef7[_0x0a9e('0xd0')]||undefined})[_0x0a9e('0xac')](loggerCatch('[rescheduleContact][Drop]'));}break;case 0xb:if(_0x193ef7[_0x0a9e('0x10e')]>=_0x25f5fa['dialAbandonedMaxRetry']-0x1){return!![];}else{this[_0x0a9e('0xbb')]({'active':![],'countabandonedretry':_0x193ef7[_0x0a9e('0x10e')]+=0x1,'scheduledat':moment()['add'](_0x25f5fa['dialAbandonedRetryFrequency'],_0x0a9e('0x102'))['format'](_0x0a9e('0xf5')),'ContactId':_0x193ef7[_0x0a9e('0xcc')],'ListId':_0x193ef7[_0x0a9e('0xcd')],'VoiceQueueId':_0x193ef7[_0x0a9e('0xcf')]||undefined,'CampaignId':_0x193ef7[_0x0a9e('0xd0')]||undefined})['catch'](loggerCatch(_0x0a9e('0x111')));}break;case 0x13:if(_0x193ef7['countmachineretry']>=_0x25f5fa['dialMachineMaxRetry']-0x1){return!![];}else{this[_0x0a9e('0xbb')]({'active':![],'countmachineretry':_0x193ef7[_0x0a9e('0x191')]+=0x1,'scheduledat':moment()[_0x0a9e('0x10f')](_0x25f5fa[_0x0a9e('0x19d')],_0x0a9e('0x102'))['format'](_0x0a9e('0xf5')),'ContactId':_0x193ef7[_0x0a9e('0xcc')],'ListId':_0x193ef7[_0x0a9e('0xcd')],'VoiceQueueId':_0x193ef7[_0x0a9e('0xcf')]||undefined,'CampaignId':_0x193ef7['CampaignId']||undefined})[_0x0a9e('0xac')](loggerCatch(_0x0a9e('0x19e')));}break;case 0x14:if(_0x193ef7['countagentrejectretry']>=_0x25f5fa[_0x0a9e('0x19f')]-0x1){return!![];}else{this[_0x0a9e('0xbb')]({'active':![],'countagentrejectretry':_0x193ef7[_0x0a9e('0x192')]+=0x1,'scheduledat':moment()[_0x0a9e('0x10f')](_0x25f5fa['dialAgentRejectRetryFrequency'],_0x0a9e('0x102'))[_0x0a9e('0x7a')](_0x0a9e('0xf5')),'ContactId':_0x193ef7[_0x0a9e('0xcc')],'ListId':_0x193ef7[_0x0a9e('0xcd')],'VoiceQueueId':_0x193ef7['VoiceQueueId']||undefined,'CampaignId':_0x193ef7[_0x0a9e('0xd0')]||undefined})[_0x0a9e('0xac')](loggerCatch('[rescheduleContact][AgentReject]'));}break;default:return!![];}};Dialer[_0x0a9e('0x19')]['callProgressDetecting']=function(_0x151abc,_0x2f5bfc,_0x41354f){var _0x1f2eaa=this;var _0x9c7523=new History(_0x151abc);return new BPromise(function(_0x115092,_0x25de7c){if(_[_0x0a9e('0x3d')](_0x2f5bfc)&&_0x0a9e('0x15c')!==typeof _0x2f5bfc){return _0x25de7c(msgResponse(_0x0a9e('0x1a0'),_0x0a9e('0x139'),_0x0a9e('0x1a1')));}if(_[_0x0a9e('0x3d')](_0x41354f)&&_0x0a9e('0x15c')!==typeof _0x41354f){return _0x25de7c(msgResponse(_0x0a9e('0x1a0'),'Failure',_0x0a9e('0x1a2')));}switch(_0x41354f[_0x0a9e('0xf1')]){case'0':_0x2f5bfc[_0x0a9e('0x65')]+=0x1;_0x9c7523[_0x0a9e('0xa5')]=0x0;_0x9c7523[_0x0a9e('0xa6')]=_0x0a9e('0x1a3');_0x9c7523[_0x0a9e('0x190')]+=0x1;_0x9c7523[_0x0a9e('0x1a4')]+=0x1;_0x1f2eaa['createHistory'](_0x9c7523)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x1f2eaa['checkRetriveMax'](0x0,_0x151abc,_0x2f5bfc)){if(_0x9c7523[_0x0a9e('0x195')]+_0x9c7523['countcongestionretry']+_0x9c7523['countnoanswerretry']+_0x9c7523['countnosuchnumberretry']+_0x9c7523[_0x0a9e('0x100')]+_0x9c7523[_0x0a9e('0x10e')]+_0x9c7523[_0x0a9e('0x191')]+_0x9c7523[_0x0a9e('0x192')]>=_0x2f5bfc['dialGlobalMaxRetry']){_0x1f2eaa['stateGlobal'](_0x9c7523,_0x115092,_0x25de7c,_0x0a9e('0x1a5'));}else{_0x1f2eaa[_0x0a9e('0x1a6')](_0x9c7523,_0x115092,_0x25de7c,_0x0a9e('0x1a5'));}}break;case'3':_0x2f5bfc[_0x0a9e('0x64')]+=0x1;_0x9c7523['state']=0x3;_0x9c7523[_0x0a9e('0xa6')]=_0x0a9e('0x1a7');_0x9c7523[_0x0a9e('0x18f')]+=0x1;_0x9c7523[_0x0a9e('0x1a4')]+=0x1;_0x1f2eaa[_0x0a9e('0xc5')](_0x9c7523)[_0x0a9e('0xac')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x1f2eaa[_0x0a9e('0x18e')](0x3,_0x151abc,_0x2f5bfc)){if(_0x9c7523['countnoanswerretry']>=_0x2f5bfc['dialNoAnswerMaxRetry']){_0x1f2eaa[_0x0a9e('0x1a6')](_0x9c7523,_0x115092,_0x25de7c,'reason\x203\x20ringing\x20no\x20answer');}else{_0x1f2eaa[_0x0a9e('0x1a8')](_0x9c7523,_0x115092,_0x25de7c,_0x0a9e('0x1a9'));}}break;case'5':_0x2f5bfc[_0x0a9e('0x5f')]+=0x1;_0x9c7523[_0x0a9e('0xa5')]=0x5;_0x9c7523[_0x0a9e('0xa6')]=_0x0a9e('0x1aa');_0x9c7523[_0x0a9e('0x195')]+=0x1;_0x9c7523[_0x0a9e('0x1a4')]+=0x1;_0x1f2eaa[_0x0a9e('0xc5')](_0x9c7523)['catch'](loggerCatch(_0x0a9e('0x1ab')));if(_0x1f2eaa[_0x0a9e('0x18e')](0x5,_0x151abc,_0x2f5bfc)){if(_0x9c7523['countbusyretry']>=_0x2f5bfc[_0x0a9e('0x196')]){_0x1f2eaa[_0x0a9e('0x1a6')](_0x9c7523,_0x115092,_0x25de7c,_0x0a9e('0x1ac'));}else{_0x1f2eaa[_0x0a9e('0x1a8')](_0x9c7523,_0x115092,_0x25de7c,'reason\x205\x20busy');}}break;case'8':_0x2f5bfc[_0x0a9e('0x60')]+=0x1;_0x9c7523[_0x0a9e('0xa5')]=0x8;_0x9c7523[_0x0a9e('0xa6')]=_0x0a9e('0x1ad');_0x9c7523[_0x0a9e('0x199')]+=0x1;_0x9c7523['countglobal']+=0x1;_0x1f2eaa['createHistory'](_0x9c7523)[_0x0a9e('0xac')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x1f2eaa[_0x0a9e('0x18e')](0x8,_0x151abc,_0x2f5bfc)){if(_0x9c7523['countcongestionretry']>=_0x2f5bfc[_0x0a9e('0x19a')]){_0x1f2eaa['createStateFinal'](_0x9c7523,_0x115092,_0x25de7c,_0x0a9e('0x1ae'));}else{_0x1f2eaa['stateGlobal'](_0x9c7523,_0x115092,_0x25de7c,_0x0a9e('0x1ae'));}}break;case'11':_0x2f5bfc[_0x0a9e('0x1af')]+=0x1;_0x9c7523[_0x0a9e('0xa5')]=0xb;_0x9c7523['statedesc']='Abandoned';_0x9c7523[_0x0a9e('0x10e')]+=0x1;_0x9c7523['countglobal']+=0x1;_0x1f2eaa[_0x0a9e('0xc5')](_0x9c7523)['catch'](loggerCatch(_0x0a9e('0x114')));if(_0x1f2eaa['checkRetriveMax'](0xb,_0x151abc,_0x2f5bfc)){if(_0x9c7523[_0x0a9e('0x10e')]>=_0x2f5bfc[_0x0a9e('0x1b0')]){_0x1f2eaa['createStateFinal'](_0x9c7523,_0x115092,_0x25de7c,_0x0a9e('0x1b1'));}else{_0x1f2eaa[_0x0a9e('0x1a8')](_0x9c7523,_0x115092,_0x25de7c,_0x0a9e('0x1b1'));}}break;case'20':_0x2f5bfc[_0x0a9e('0x68')]+=0x1;_0x9c7523[_0x0a9e('0xa5')]=0x14;_0x9c7523[_0x0a9e('0xa6')]=_0x0a9e('0x1b2');_0x9c7523[_0x0a9e('0x192')]+=0x1;_0x9c7523[_0x0a9e('0x1a4')]+=0x1;_0x1f2eaa['createHistory'](_0x9c7523)[_0x0a9e('0xac')](loggerCatch(_0x0a9e('0x1b3')));if(_0x1f2eaa[_0x0a9e('0x18e')](0x14,_0x151abc,_0x2f5bfc)){if(_0x9c7523[_0x0a9e('0x192')]>=_0x2f5bfc[_0x0a9e('0x19f')]){_0x1f2eaa['createStateFinal'](_0x9c7523,_0x115092,_0x25de7c,'reason\x2020\x20agentreject');}else{_0x1f2eaa[_0x0a9e('0x1a8')](_0x9c7523,_0x115092,_0x25de7c,'reason\x2020\x20agentreject');}}break;default:_0x2f5bfc[_0x0a9e('0x1b4')]+=0x1;_0x9c7523['state']=0xc;_0x9c7523[_0x0a9e('0xa6')]=_0x41354f[_0x0a9e('0xf1')];_0x1f2eaa[_0x0a9e('0xc5')](_0x9c7523)[_0x0a9e('0xac')](loggerCatch(_0x0a9e('0x1b5')));if(_0x1f2eaa[_0x0a9e('0x18e')](_0x41354f[_0x0a9e('0xf1')],_0x151abc,_0x2f5bfc)){if(_0x9c7523['countbusyretry']+_0x9c7523['countcongestionretry']+_0x9c7523[_0x0a9e('0x18f')]+_0x9c7523[_0x0a9e('0x190')]+_0x9c7523['countdropretry']+_0x9c7523[_0x0a9e('0x10e')]+_0x9c7523[_0x0a9e('0x191')]+_0x9c7523[_0x0a9e('0x192')]>=_0x2f5bfc['dialGlobalMaxRetry']){_0x1f2eaa['stateGlobal'](_0x9c7523,_0x115092,_0x25de7c,_0x41354f['reason']);}else{_0x1f2eaa[_0x0a9e('0x1a6')](_0x9c7523,_0x115092,_0x25de7c,_0x41354f[_0x0a9e('0xf1')]);}}}});};Dialer[_0x0a9e('0x19')][_0x0a9e('0x1a8')]=function(_0x4ab36f,_0x2fec22,_0x5d0eb5,_0x103402){var _0x547a2a=new Final(_0x4ab36f);_0x547a2a[_0x0a9e('0xa5')]=0xf;_0x547a2a['statedesc']='Global';this[_0x0a9e('0x1a6')](_0x547a2a,_0x2fec22,_0x5d0eb5,_0x103402);};Dialer[_0x0a9e('0x19')]['createStateFinal']=function(_0x5dbf0b,_0x31114d,_0x5dacb3,_0x1352c){this['moveContactManagedDialer'](_0x5dbf0b)[_0x0a9e('0xb4')](function(_0xb5209d){return _0x31114d(msgResponse(_0x0a9e('0x1a0'),'Success',_0x1352c));})['catch'](function(_0x1754c8){return _0x5dacb3(msgResponse(_0x0a9e('0x1b6'),_0x0a9e('0x139'),_0x0a9e('0x1b7')));});};Dialer['prototype'][_0x0a9e('0x8')]=function(_0x136d28){var _0x539ad9=this;var _0x360306=_0x136d28[_0x0a9e('0x1b8')]/0x64;var _0x11ba87=_0x136d28['outboundDropCallsDayTimeout']/(_0x136d28[_0x0a9e('0x63')]+_0x136d28[_0x0a9e('0x5d')]);var _0xb1fd37=Math[_0x0a9e('0x1b9')](_0x136d28[_0x0a9e('0x72')]*(_0x136d28[_0x0a9e('0x1ba')]/0x64));var _0x7412c=Math[_0x0a9e('0x1b9')](_0x136d28[_0x0a9e('0x72')]*(_0x136d28[_0x0a9e('0x1bb')]/0x64));var _0x3f5891=_0x136d28[_0x0a9e('0x9f')]+_0x136d28[_0x0a9e('0x53')];var _0x34ff77=Math[_0x0a9e('0x1bc')](_0x136d28[_0x0a9e('0x74')]*_0x136d28[_0x0a9e('0x76')]*_0x136d28[_0x0a9e('0x6f')]*_0x136d28[_0x0a9e('0x70')]);if(_[_0x0a9e('0x3d')](_0x136d28[_0x0a9e('0x28')])){if(!_[_0x0a9e('0x3d')](_0x136d28['startPredictive'])){_0x136d28[_0x0a9e('0x27')]=undefined;loggerPredictive[_0x0a9e('0x91')](_0x0a9e('0x1bd'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0x0a9e('0x3d')](_0x136d28[_0x0a9e('0x8b')])){loggerPredictive[_0x0a9e('0x91')](_0x0a9e('0x1bd'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x136d28[_0x0a9e('0x8b')]);_0x136d28[_0x0a9e('0x8b')]=undefined;}_0x136d28['startProgressive']=moment()[_0x0a9e('0x7a')](_0x0a9e('0xf5'));loggerPredictive[_0x0a9e('0x80')](_0x136d28['name'],'collection\x20data\x20in\x20progressive\x20at',_0x136d28[_0x0a9e('0x28')]);this[_0x0a9e('0x14c')](_0x136d28,0x1);}else if(ifInterval(_0x136d28[_0x0a9e('0x1be')],_0x136d28['startProgressive'])){this['handlePower'](_0x136d28,0x1);loggerPredictiveCalls[_0x0a9e('0x80')](_0x0a9e('0x1bf'),_0x136d28[_0x0a9e('0x28')],_0x136d28[_0x0a9e('0x3f')]);_0x136d28['erlangCalls']=0x0;_0x136d28[_0x0a9e('0x6e')]=0x0;}else if(_0x360306<_0x11ba87&&_0x136d28['dialPredictiveOptimization']==='dropRate'){freeVariablesPredictive(_0x136d28);loggerPredictive[_0x0a9e('0x80')](_0x0a9e('0x1c0'),_0x0a9e('0x1c1'),_0x11ba87,'startProgressive',_0x136d28[_0x0a9e('0x3f')]);}else if(_0x34ff77<_0x136d28[_0x0a9e('0x6e')]&&_0x136d28[_0x0a9e('0x1c2')]==='dropRate'){freeVariablesPredictive(_0x136d28);loggerPredictive['info'](_0x0a9e('0x1c3'),_0x0a9e('0x1c4'),_0x34ff77,_0x0a9e('0x1c5'),_0x136d28['predictiveIntervalErlangCallsDroppedCalls'],'startProgressive',_0x136d28[_0x0a9e('0x3f')]);}else if(!ifInterval(_0x136d28['dialPredictiveInterval'],_0x136d28['startProgressive'])&&_['isUndefined'](_0x136d28[_0x0a9e('0x27')])&&!_[_0x0a9e('0x3d')](_0x136d28[_0x0a9e('0x28')])){_0x136d28['startPredictive']=moment()[_0x0a9e('0x7a')](_0x0a9e('0xf5'));loggerPredictive['info'](_0x136d28[_0x0a9e('0x3f')],'started\x20in\x20predictive\x20at',_0x136d28[_0x0a9e('0x27')]);this[_0x0a9e('0xb8')](_0x136d28['dialPredictiveInterval'])[_0x0a9e('0xb4')](this[_0x0a9e('0x1c6')](_0x136d28))[_0x0a9e('0xb4')](mergeDataErlangB(_0x136d28))['then'](this[_0x0a9e('0x1c7')](_0x136d28))[_0x0a9e('0xac')](loggerCatchPredictive(_0x0a9e('0x1c8'),_0x136d28));}else if(!ifInterval(_0x136d28['dialPredictiveInterval'],_0x136d28[_0x0a9e('0x27')])){_0x136d28[_0x0a9e('0x6e')]=0x0;_0x136d28[_0x0a9e('0x27')]=moment()['format'](_0x0a9e('0xf5'));loggerPredictive[_0x0a9e('0x80')](_0x136d28[_0x0a9e('0x3f')],_0x0a9e('0x1c9'),_0x136d28[_0x0a9e('0x27')]);clearInterval(_0x136d28[_0x0a9e('0x8b')]);_0x136d28[_0x0a9e('0x8b')]=undefined;this[_0x0a9e('0xb8')](_0x136d28['dialPredictiveInterval'])[_0x0a9e('0xb4')](this[_0x0a9e('0x1c6')](_0x136d28))[_0x0a9e('0xb4')](mergeDataErlangB(_0x136d28))[_0x0a9e('0xb4')](this['startMethodPredictive'](_0x136d28))[_0x0a9e('0xac')](loggerCatchPredictive(_0x0a9e('0x1ca'),_0x136d28));}else if(_0x136d28['predictiveIntervalAvailable']&&_0x3f5891<_0x136d28[_0x0a9e('0x72')]-_0x7412c){freeVariablesPredictive(_0x136d28);loggerPredictive[_0x0a9e('0x80')](_0x136d28[_0x0a9e('0x3f')],_0x0a9e('0x1cb'),_0x3f5891,_0x0a9e('0x1cc'),_0x136d28[_0x0a9e('0x72')],'-',_0x7412c,'=',_0x136d28[_0x0a9e('0x72')]-_0x7412c,')');}else if(_0x136d28[_0x0a9e('0x72')]&&_0x3f5891>_0x136d28['predictiveIntervalAvailable']+_0xb1fd37){freeVariablesPredictive(_0x136d28);loggerPredictive[_0x0a9e('0x80')](_0x136d28['name'],_0x0a9e('0x1cb'),_0x3f5891,_0x0a9e('0x1cd'),_0x136d28['predictiveIntervalAvailable'],'+',_0xb1fd37,'=',_0x136d28[_0x0a9e('0x72')]+_0xb1fd37,')');}};Dialer[_0x0a9e('0x19')]['getDataPredictive']=function(_0x1b4341){var _0x3eff33=this;return function(_0x5b6054){return new BPromise(function(_0xe89e7c,_0x4e8b2a){_['merge'](_0x1b4341,_0x5b6054[0x0]);if(checkGetDataPredictive(_0x5b6054[0x0])){var _0x57d6ff=_0x1b4341[_0x0a9e('0x72')]=_0x1b4341[_0x0a9e('0x53')]+_0x1b4341['available'];var _0x41a8f0=_0x1b4341[_0x0a9e('0x1be')]*0x3c;var _0x5d26c8=_0x5b6054[0x0][_0x0a9e('0x6a')]+_0x5b6054[0x0][_0x0a9e('0x69')];var _0x4bdcd3=(_0x5b6054[0x0][_0x0a9e('0x83')]+_0x5b6054[0x0][_0x0a9e('0x6c')]+_0x5b6054[0x0][_0x0a9e('0x6b')])/_0x5b6054[0x0]['predictiveIntervalTotalCalls'];_0x1b4341[_0x0a9e('0x6f')]=_0x4bdcd3>0x0?_0x4bdcd3:0x1;switch(_0x1b4341[_0x0a9e('0x1c2')]){case _0x0a9e('0x1ce'):var _0x956255=_0x1b4341[_0x0a9e('0x1b8')]/0x64;return _0x3eff33['abandonmentRate'](_0x57d6ff,_0x41a8f0,_0x5d26c8,_0x4bdcd3,_0x956255)[_0x0a9e('0xb4')](function(_0x495ac6){return _0xe89e7c(_0x495ac6);});case _0x0a9e('0x1cf'):var _0x43e45a=_0x1b4341[_0x0a9e('0x1b8')]/0x64;return _0x3eff33[_0x0a9e('0x1d0')](_0x57d6ff,_0x41a8f0,_0x5d26c8,_0x4bdcd3,_0x43e45a)[_0x0a9e('0xb4')](function(_0x25cae1){return _0xe89e7c(_0x25cae1);});default:return _0x4e8b2a(msgResponse(_0x0a9e('0x1d1'),_0x0a9e('0x139'),_0x0a9e('0x1d2')));}}else{return _0x4e8b2a(msgResponse('[getDataPredictive]',_0x0a9e('0x139'),_0x0a9e('0x1d3')));}});};};Dialer[_0x0a9e('0x19')]['getDataPredictiveOld']=function(_0x48782d){var _0x5c2e1b=this;return function(_0x4b99fb){return new BPromise(function(_0x49e349,_0x347d13){_['merge'](_0x48782d,_0x4b99fb[0x0]);if(checkGetDataPredictive(_0x4b99fb[0x0])){loggerPredictive[_0x0a9e('0x80')](JSON[_0x0a9e('0x49')](_0x4b99fb[0x0]));if(_0x48782d[_0x0a9e('0x1c2')]===_0x0a9e('0x1ce')){return _0x5c2e1b[_0x0a9e('0xc1')](_0x48782d['id'])[_0x0a9e('0xb4')](function(_0x5dd837){var _0x20a1c0=_0x48782d['loggedIn']-_0x5dd837[0x0]['outboundQueuePauses'];var _0x139b02=_0x48782d['dialPredictiveInterval']*0x3c;var _0x2885c8=_0x4b99fb[0x0]['predictiveIntervalAvgTalktime']+_0x4b99fb[0x0][_0x0a9e('0x69')];var _0x638297=(_0x4b99fb[0x0][_0x0a9e('0x83')]+_0x4b99fb[0x0][_0x0a9e('0x6c')]+_0x4b99fb[0x0][_0x0a9e('0x6b')])/_0x4b99fb[0x0]['predictiveIntervalTotalCalls'];var _0x1ee915=_0x48782d[_0x0a9e('0x1b8')]/0x64;_0x48782d['predictiveIntervalPauses']=_0x5dd837[0x0][_0x0a9e('0x1d4')]||0x0;_0x48782d[_0x0a9e('0x6f')]=_0x638297>0x0?_0x638297:0x1;return _0x5c2e1b['abandonmentRate'](_0x20a1c0,_0x139b02,_0x2885c8,_0x638297,_0x1ee915);})[_0x0a9e('0xb4')](function(_0x26320a){return _0x49e349(_0x26320a);})[_0x0a9e('0xac')](function(_0x3f8171){return _0x347d13(msgResponse(_0x0a9e('0x1d5'),_0x0a9e('0x139'),JSON[_0x0a9e('0x49')](_0x3f8171)));});}if(_0x48782d['dialPredictiveOptimization']===_0x0a9e('0x1cf')){return _0x5c2e1b[_0x0a9e('0xc1')](_0x48782d['id'])[_0x0a9e('0xb4')](function(_0x16a8c4){var _0x587f68=_0x48782d[_0x0a9e('0x4f')]-_0x16a8c4[0x0][_0x0a9e('0x1d4')];var _0x189e15=_0x48782d[_0x0a9e('0x1be')]*0x3c;var _0x32c53e=_0x4b99fb[0x0][_0x0a9e('0x6a')]+_0x4b99fb[0x0][_0x0a9e('0x69')];var _0x8095d6=(_0x4b99fb[0x0]['predictiveIntervalAnsweredCalls']+_0x4b99fb[0x0][_0x0a9e('0x6c')]+_0x4b99fb[0x0][_0x0a9e('0x6b')])/_0x4b99fb[0x0][_0x0a9e('0x73')];var _0x4a80a0=_0x48782d[_0x0a9e('0x1b8')]/0x64;_0x48782d[_0x0a9e('0x71')]=_0x16a8c4[0x0][_0x0a9e('0x1d4')]||0x0;_0x48782d[_0x0a9e('0x6f')]=_0x8095d6>0x0?_0x8095d6:0x1;return _0x5c2e1b[_0x0a9e('0x1d0')](_0x587f68,_0x189e15,_0x32c53e,_0x8095d6,_0x4a80a0);})[_0x0a9e('0xb4')](function(_0x13f18){return _0x49e349(_0x13f18);})[_0x0a9e('0xac')](function(_0x16b449){return _0x347d13(msgResponse(_0x0a9e('0x1d5'),'Failure',JSON[_0x0a9e('0x49')](_0x16b449)));});}}else{return _0x347d13(msgResponse(_0x0a9e('0x1d1'),_0x0a9e('0x139'),'check\x20failure'));}});};};Dialer['prototype'][_0x0a9e('0x1c7')]=function(_0x37165a){var _0x395034=this;return function(){var _0x73014f=0x0;var _0x2cbfa3=Math[_0x0a9e('0x1bc')](_0x37165a[_0x0a9e('0x75')]*0x3e8);if(_0x2cbfa3>0x0){_0x2cbfa3=_0x2cbfa3<0x64?0x64:_0x2cbfa3;loggerPredictive[_0x0a9e('0x80')](_0x37165a[_0x0a9e('0x3f')],'one\x20call\x20every:',_0x2cbfa3,_0x0a9e('0x1d6'));_0x37165a[_0x0a9e('0x8b')]=setInterval(function(){_0x395034['handlePredictive'](_0x37165a);loggerPredictiveCalls[_0x0a9e('0x80')](_0x0a9e('0x1d7'),_0x73014f+=0x1);},_0x2cbfa3);}else{loggerPredictive['info'](_0x37165a['name'],_0x0a9e('0x1d8'));}};};Dialer[_0x0a9e('0x19')][_0x0a9e('0x1d9')]=function(_0x31f9fe,_0x33d28f){var _0x548204=this;return function(_0x468a11){if(_['isEmpty'](_0x468a11)){if(_['isNil'](_0x33d28f['UserId'])||!_0x33d28f[_0x0a9e('0x1da')]){if(_0x31f9fe['dialMethod']==='booked'){_0x31f9fe['queueStatusComplete']=_[_0x0a9e('0x3d')](_0x31f9fe[_0x0a9e('0x11f')])?!![]:_0x31f9fe[_0x0a9e('0x11f')];var _0x45520d=uuid['v4']();_0x548204['actions'][_0x45520d]=new Action(_0x31f9fe,_0x33d28f,_0x45520d);loggerBooked[_0x0a9e('0x80')]('[booked][checkContactBlack]',_0x45520d,'queueStatusComplete:\x20',JSON[_0x0a9e('0x49')](_0x31f9fe[_0x0a9e('0x11f')]),_0x0a9e('0x1db'),_0x31f9fe['name']);if(_0x31f9fe['queueStatusComplete']){_0x31f9fe['queueStatusComplete']=![];_0x548204[_0x0a9e('0x29')][_0x548204[_0x0a9e('0x24')][_0x45520d][_0x0a9e('0xaf')]]=[];ami[_0x0a9e('0x13c')]({'actionid':_0x45520d,'action':_0x0a9e('0x1dc'),'queue':_0x31f9fe['name']})[_0x0a9e('0xac')](function(_0x1036d4){_0x548204[_0x0a9e('0xb0')](_0x31f9fe);_0x548204[_0x0a9e('0xbb')]({'active':![],'ContactId':_0x548204[_0x0a9e('0x24')][_0x45520d][_0x0a9e('0xcc')],'ListId':_0x548204['actions'][_0x45520d][_0x0a9e('0xcd')],'VoiceQueueId':_0x548204[_0x0a9e('0x24')][_0x45520d][_0x0a9e('0xcf')]||undefined,'CampaignId':_0x548204[_0x0a9e('0x24')][_0x45520d][_0x0a9e('0xd0')]||undefined})[_0x0a9e('0xac')](loggerCatch(_0x0a9e('0x1dd')));delete _0x548204[_0x0a9e('0x24')][_0x45520d];});}else{loggerBooked[_0x0a9e('0x80')](_0x0a9e('0x1de'),JSON[_0x0a9e('0x49')](_0x31f9fe[_0x0a9e('0x11f')]),_0x0a9e('0x1db'),_0x31f9fe[_0x0a9e('0x3f')]);_0x548204[_0x0a9e('0xb0')](_0x31f9fe);_0x548204[_0x0a9e('0xbb')]({'active':![],'ContactId':_0x548204[_0x0a9e('0x24')][_0x45520d][_0x0a9e('0xcc')],'ListId':_0x548204['actions'][_0x45520d][_0x0a9e('0xcd')],'VoiceQueueId':_0x548204[_0x0a9e('0x24')][_0x45520d]['VoiceQueueId']||undefined,'CampaignId':_0x548204['actions'][_0x45520d]['CampaignId']||undefined})[_0x0a9e('0xac')](loggerCatch(_0x0a9e('0x1dd')));delete _0x548204['actions'][_0x45520d];}}else{return _0x548204[_0x0a9e('0x15b')](_0x31f9fe,_0x33d28f);}}else{if(getDiff(_0x33d28f[_0x0a9e('0x1df')])<_0x31f9fe['dialRecallMeTimeout']*0x3c){if(_0x33d28f[_0x0a9e('0x1e0')]&&!_0x33d28f['Agent'][_0x0a9e('0x1e1')]){_0x548204['preview'][_0x0a9e('0x122')](_0x33d28f['id'])[_0x0a9e('0x1c')](function(){_0x548204[_0x0a9e('0xb0')](_0x31f9fe);});}else{_0x548204[_0x0a9e('0xbd')]({'active':![]},_0x33d28f['id'],0x1)['finally'](function(){console[_0x0a9e('0x108')](_0x0a9e('0x1e2'));_0x548204[_0x0a9e('0xb0')](_0x31f9fe);});}}else{_0x31f9fe['outboundReCallsDay']+=0x1;_0x548204['updateOriginated'](_0x31f9fe);if(_0x31f9fe['dialRecallInQueue']){_0x548204['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x33d28f[_0x0a9e('0xcc')],'ListId':_0x33d28f[_0x0a9e('0xcd')],'VoiceQueueId':_0x33d28f[_0x0a9e('0xcf')]||undefined,'CampaignId':_0x33d28f[_0x0a9e('0xd0')]||undefined})[_0x0a9e('0xac')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x548204[_0x0a9e('0xc5')](createObjHistory(_0x31f9fe,_0x33d28f,_0x0a9e('0x1e3'),0x17,_0x0a9e('0x1e4')))[_0x0a9e('0xac')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x548204[_0x0a9e('0xca')](createObjHistory(_0x31f9fe,_0x33d28f,_0x0a9e('0x1e5'),0x16,_0x0a9e('0x1e6')),_0x0a9e('0x1e7'),_0x0a9e('0x1e8'));}}}}else{_0x31f9fe['outboundBlacklistCallsDay']+=0x1;_0x548204[_0x0a9e('0xca')](createObjHistory(_0x31f9fe,_0x33d28f,_0x0a9e('0x1e9'),0xd,_0x0a9e('0x1ea')),'[Originate][historyBlacklist]',_0x0a9e('0x1eb'));throw'inBlackList';}};};Dialer[_0x0a9e('0x19')][_0x0a9e('0x150')]=function(_0x126fa7){var _0xda737b=this;var _0x415fce=[];var _0x59f11d=_0x126fa7[_0x0a9e('0x1ec')]-_0x126fa7[_0x0a9e('0x95')]-_0x126fa7[_0x0a9e('0x1ed')];emitCampaignSummary(_0x126fa7);if(_0x59f11d>0x0){if(_0x59f11d>this[_0x0a9e('0x22')]){_0x59f11d=this[_0x0a9e('0x22')];}_0x126fa7['temp']+=_0x59f11d;this[_0x0a9e('0xc0')](_0x126fa7['id'],_0x59f11d,_0x126fa7[_0x0a9e('0x1ee')])[_0x0a9e('0xb4')](function(_0x5bba8b){_0x126fa7[_0x0a9e('0x1ed')]-=_0x59f11d;_0x126fa7['temp']=_0x126fa7['temp']>0x0?_0x126fa7[_0x0a9e('0x1ed')]:0x0;if(!checkContactEmpty(_0x5bba8b)){_0x126fa7['message']=_0x0a9e('0x9c');logger[_0x0a9e('0x80')](_0x0a9e('0x1ef')+_0x126fa7['name']);}else{_0x126fa7[_0x0a9e('0x95')]+=_0x5bba8b[_0x0a9e('0x94')];_0x126fa7[_0x0a9e('0x3e')]=_0x0a9e('0x1f0');for(var _0x3bd4da=0x0;_0x3bd4da<_0x5bba8b[_0x0a9e('0x94')];_0x3bd4da+=0x1){_0x126fa7[_0x0a9e('0x1f1')]+=0x1;if(_[_0x0a9e('0xab')](_0x5bba8b[_0x3bd4da])||_['isNil'](_0x5bba8b[_0x3bd4da][_0x0a9e('0x15e')])||_[_0x0a9e('0xab')](_0x5bba8b[_0x3bd4da][_0x0a9e('0x15e')][_0x0a9e('0x15f')])){_0xda737b[_0x0a9e('0xc9')]('[actionOriginate]\x20',_0x126fa7,_0x5bba8b[_0x3bd4da]);}else{_0xda737b['checkIsBlackListIvr'](_[_0x0a9e('0xcb')](_0x5bba8b[_0x3bd4da],['CampaignId',_0x0a9e('0x1f2')]))[_0x0a9e('0xb4')](_0xda737b['checkContactBlack'](_0x126fa7,_0x5bba8b[_0x3bd4da]))[_0x0a9e('0xac')](_0xda737b[_0x0a9e('0xc8')](_0x0a9e('0x1f3'),_0x126fa7));}}}})['catch'](loggerGetContactDialer(_0x0a9e('0x1f4'),_0x126fa7,_0x59f11d));}};Dialer[_0x0a9e('0x19')][_0x0a9e('0x14c')]=function(_0x14cf4c,_0x1b2cf5){var _0x1d7537=this;var _0x9ecf57=[];var _0x305a4b=_0x1b2cf5>=0x1?_0x1b2cf5:0x1;var _0x5695b6=[];if(_0x14cf4c[_0x0a9e('0x58')]===_0x0a9e('0x7')){_0x305a4b=0x1;}var _0x459efc=Math[_0x0a9e('0x1bc')](_0x14cf4c[_0x0a9e('0x9f')]*_0x305a4b)-_0x14cf4c['originated']-_0x14cf4c[_0x0a9e('0x1ed')];emitVoiceQueueSummary(_0x14cf4c);if(_0x14cf4c['dialLimitQueue']>0x0){var _0x36ff91=_0x14cf4c[_0x0a9e('0x1f5')]-_0x14cf4c[_0x0a9e('0x95')]-_0x14cf4c['talking']-_0x14cf4c[_0x0a9e('0x1ed')]-_0x14cf4c['pTalking'];if(_0x459efc>_0x36ff91){_0x459efc=_0x36ff91;}}if(_0x459efc>0x0){if(_0x14cf4c[_0x0a9e('0x58')]===_0x0a9e('0x7')){_0x459efc=0x1;}if(_0x459efc>this[_0x0a9e('0x22')]){_0x459efc=this[_0x0a9e('0x22')];}_0x14cf4c['temp']+=_0x459efc;for(var _0x323936 in this['agents']){if(this[_0x0a9e('0x20')][_0x0a9e('0xaa')](_0x323936)){if(this['agents'][_0x323936][_0x0a9e('0xa5')]===_0x0a9e('0x1f6')&&this[_0x0a9e('0x20')][_0x323936]['status']===_0x0a9e('0x1f7')){_0x9ecf57['push'](this[_0x0a9e('0x20')][_0x323936]['id']);}}}this[_0x0a9e('0xbe')](_0x14cf4c['id'],_0x9ecf57,_0x459efc,_0x14cf4c['dialOrderByScheduledAt'])['then'](function(_0x4b3f95){_0x14cf4c['temp']-=_0x459efc;_0x14cf4c[_0x0a9e('0x1ed')]=_0x14cf4c[_0x0a9e('0x1ed')]>0x0?_0x14cf4c[_0x0a9e('0x1ed')]:0x0;if(!checkContactEmpty(_0x4b3f95)){_0x1d7537[_0x0a9e('0xb2')](_0x14cf4c)['then'](sendMessageReschedule(_0x14cf4c))[_0x0a9e('0xac')](loggerCatch('[countReScheduled]\x20'));}else{_0x14cf4c[_0x0a9e('0x95')]+=_0x4b3f95[_0x0a9e('0x94')];_0x14cf4c['message']=_0x14cf4c[_0x0a9e('0x58')]===_0x0a9e('0x7')?_0x0a9e('0x167'):_0x0a9e('0x1f0');for(var _0x37c272=0x0;_0x37c272<_0x4b3f95[_0x0a9e('0x94')];_0x37c272+=0x1){if(_[_0x0a9e('0xab')](_0x4b3f95[_0x37c272])||_['isNil'](_0x4b3f95[_0x37c272][_0x0a9e('0x15e')])||_[_0x0a9e('0xab')](_0x4b3f95[_0x37c272][_0x0a9e('0x15e')][_0x0a9e('0x15f')])){_0x1d7537[_0x0a9e('0xc9')](_0x0a9e('0x1f8'),_0x14cf4c,_0x4b3f95[_0x37c272]);}else{_0x1d7537[_0x0a9e('0x1f9')](_[_0x0a9e('0xcb')](_0x4b3f95[_0x37c272],[_0x0a9e('0xcf'),_0x0a9e('0x1f2')]))[_0x0a9e('0xb4')](_0x1d7537['checkContactBlack'](_0x14cf4c,_0x4b3f95[_0x37c272]))[_0x0a9e('0xac')](_0x1d7537[_0x0a9e('0xc8')](_0x0a9e('0x1f8'),_0x14cf4c));}}}})[_0x0a9e('0xac')](loggerGetContactDialer(_0x0a9e('0x1fa'),_0x14cf4c,_0x459efc));}};Dialer[_0x0a9e('0x19')][_0x0a9e('0x8b')]=function(_0x5b393b){var _0x2c2a3e=this;if(_0x5b393b[_0x0a9e('0x1f5')]>0x0){var _0x1d504a=_0x5b393b['dialLimitQueue']-_0x5b393b[_0x0a9e('0x95')]-_0x5b393b[_0x0a9e('0x53')];if(_0x1d504a>0x0){this[_0x0a9e('0x1fb')](_0x5b393b);}else{loggerPredictiveCalls['info']('[handlePredictive][limitChannel]');}}else{this[_0x0a9e('0x1fb')](_0x5b393b);}};Dialer[_0x0a9e('0x19')][_0x0a9e('0x1fb')]=function(_0x4061b2){var _0x241492=this;var _0x5e29c1=[];_0x4061b2[_0x0a9e('0x95')]+=0x1;for(var _0x584f70 in this[_0x0a9e('0x20')]){if(this[_0x0a9e('0x20')]['hasOwnProperty'](_0x584f70)){if(this[_0x0a9e('0x20')][_0x584f70]['state']===_0x0a9e('0x1f6')&&this[_0x0a9e('0x20')][_0x584f70]['status']===_0x0a9e('0x1f7')){_0x5e29c1[_0x0a9e('0x11b')](this[_0x0a9e('0x20')][_0x584f70]['id']);}}}this['getContactDialer'](_0x4061b2['id'],_0x5e29c1,0x1,_0x4061b2[_0x0a9e('0x1ee')])[_0x0a9e('0xb4')](function(_0x15b9f7){if(!checkContactEmpty(_0x15b9f7)){checkContactLowerLimitOriginate(_0x4061b2,0x1,0x0);_0x241492[_0x0a9e('0xb2')](_0x4061b2)[_0x0a9e('0xb4')](sendMessageReschedule(_0x4061b2))[_0x0a9e('0xac')](loggerCatch('[countReScheduled]\x20'));}else{_0x4061b2[_0x0a9e('0x3e')]=_0x0a9e('0x1f0');if(_[_0x0a9e('0xab')](_0x15b9f7[0x0])||_[_0x0a9e('0xab')](_0x15b9f7[0x0]['Contact'])||_['isNil'](_0x15b9f7[0x0][_0x0a9e('0x15e')][_0x0a9e('0x15f')])){_0x241492[_0x0a9e('0xc9')]('[actionOriginate]\x20',_0x4061b2,_0x15b9f7[0x0]);}else{_0x241492['checkIsBlackList'](_[_0x0a9e('0xcb')](_0x15b9f7[0x0],['VoiceQueueId','Contact.phone']))[_0x0a9e('0xb4')](_0x241492[_0x0a9e('0x1d9')](_0x4061b2,_0x15b9f7[0x0]))['catch'](_0x241492[_0x0a9e('0xc8')](_0x0a9e('0x1fc'),_0x4061b2));}}})[_0x0a9e('0xac')](loggerGetContactDialer(_0x0a9e('0x1fd'),_0x4061b2,0x1));emitVoiceQueueSummary(_0x4061b2);};Dialer[_0x0a9e('0x19')]['abandonmentRate']=function(_0x395897,_0x1db07,_0x499e86,_0x12c434,_0x27668b,_0x1b6408){loggerPredictive[_0x0a9e('0x80')](_0x0a9e('0x1fe'));loggerPredictive['info'](_0x0a9e('0x1ff'),_0x395897);loggerPredictive[_0x0a9e('0x80')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1db07);loggerPredictive['info'](_0x0a9e('0x200'),_0x499e86);loggerPredictive[_0x0a9e('0x80')]('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',_0x12c434);loggerPredictive['info'](_0x0a9e('0x201'),_0x27668b);loggerPredictive[_0x0a9e('0x80')](_0x0a9e('0x88'));return new BPromise(function(_0x46ba2c,_0xb6d223){if(_0x395897<=0x0||isNaN(_0x395897)){return _0xb6d223(msgResponse('[abandonmentRate]',_0x0a9e('0x48'),'m\x20=\x20'+_0x395897));}if(_0x499e86<=0x0||isNaN(_0x499e86)){return _0xb6d223(msgResponse('[abandonmentRate]',_0x0a9e('0x48'),'Ts\x20=\x20'+_0x499e86));}if(_0x12c434<=0x0||isNaN(_0x12c434)){return _0xb6d223(msgResponse(_0x0a9e('0x202'),'Error',_0x0a9e('0x203')+_0x12c434));}if(_0x1db07<=0x0||isNaN(_0x1db07)){return _0xb6d223(msgResponse('[abandonmentRate]','Error',_0x0a9e('0x204')+_0x1db07));}if(_0x27668b<=0x0||isNaN(_0x27668b)){return _0xb6d223(msgResponse(_0x0a9e('0x202'),_0x0a9e('0x48'),'Amax\x20=\x20'+_0x27668b));}_0x1b6408=_0x1b6408||0x0;var _0x58c6a8=0x1/_0x499e86;var _0x537da0=0x0;var _0x4239b8=0x0;var _0x70ca91=0x0;var _0x4a3895=0x0;for(var _0x2ed3ba=0x0;_0x70ca91<_0x27668b;_0x2ed3ba+=0x1){_0x4239b8=_0x2ed3ba/_0x1db07;_0x537da0=(_0x12c434*_0x4239b8+_0x1b6408)/_0x58c6a8;_0x70ca91=erlangb(_0x537da0,_0x395897);_0x4a3895=_0x537da0/_0x395897*(0x1-erlangb(_0x537da0,_0x395897));}return _0x46ba2c({'erlangCalls':_0x2ed3ba,'erlangCallToSecond':_0x1db07/_0x2ed3ba,'erlangAbandonmentRate':_0x70ca91,'erlangBusyFactor':_0x4a3895});});};Dialer['prototype'][_0x0a9e('0x1d0')]=function(_0x4e8586,_0x4665ea,_0x247806,_0x56736e,_0x5925f7,_0x4c4874){loggerPredictive[_0x0a9e('0x80')](_0x0a9e('0x205'));loggerPredictive[_0x0a9e('0x80')](_0x0a9e('0x1ff'),_0x4e8586);loggerPredictive[_0x0a9e('0x80')](_0x0a9e('0x206'),_0x4665ea);loggerPredictive[_0x0a9e('0x80')](_0x0a9e('0x200'),_0x247806);loggerPredictive[_0x0a9e('0x80')](_0x0a9e('0x207'),_0x56736e);loggerPredictive[_0x0a9e('0x80')](_0x0a9e('0x208'),_0x5925f7);loggerPredictive[_0x0a9e('0x80')](_0x0a9e('0x88'));return new BPromise(function(_0x2e8669,_0x5242e9){if(_0x4e8586<=0x0||isNaN(_0x4e8586)){return _0x5242e9(msgResponse('[busyFactor]',_0x0a9e('0x48'),_0x0a9e('0x209')+_0x4e8586));}if(_0x247806<=0x0||isNaN(_0x247806)){return _0x5242e9(msgResponse(_0x0a9e('0x20a'),_0x0a9e('0x48'),'Ts\x20=\x20'+_0x247806));}if(_0x56736e<=0x0||isNaN(_0x56736e)){return _0x5242e9(msgResponse(_0x0a9e('0x20a'),'Error',_0x0a9e('0x203')+_0x56736e));}if(_0x4665ea<=0x0||isNaN(_0x4665ea)){return _0x5242e9(msgResponse('[busyFactor]',_0x0a9e('0x48'),'interval\x20=\x20'+_0x4665ea));}if(_0x5925f7<=0x0||isNaN(_0x5925f7)){return _0x5242e9(msgResponse('[busyFactor]',_0x0a9e('0x48'),_0x0a9e('0x20b')+_0x5925f7));}_0x4c4874=_0x4c4874||0x0;var _0xc2ae55=0x1/_0x247806;var _0x164ba4=0x0;var _0x502bd9=0x0;var _0x48b8e7=0x0;var _0x5b53aa=0x0;for(var _0x5d54fb=0x0;_0x5b53aa<_0x5925f7;_0x5d54fb+=0x1){_0x502bd9=_0x5d54fb/_0x4665ea;_0x164ba4=(_0x56736e*_0x502bd9+_0x4c4874)/_0xc2ae55;_0x48b8e7=erlangb(_0x164ba4,_0x4e8586);_0x5b53aa=_0x164ba4/_0x4e8586*(0x1-erlangb(_0x164ba4,_0x4e8586));}return _0x2e8669({'erlangCalls':_0x5d54fb,'erlangCallToSecond':_0x4665ea/_0x5d54fb,'erlangAbandonmentRate':_0x48b8e7,'erlangBusyFactor':_0x5b53aa});});};module[_0x0a9e('0x20c')]=Dialer;