Built motion from commit (unavailable).|2.5.31
[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 _0xf269=['\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','content','indexOf','true','all','some','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','dialActive','loggedIn','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','[syncQueueSummary]','checkIfTimeIntervals','[syncCampaigns]','pow','random','match','actionOriginate','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueTimeout','ACTIVE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','tags','updatedAt','%s%s','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','TrunkBackup','XMD-ORIGINATECALLERIDNAME','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','trim','dialCutDigit','SIP/%s/%s%s','from-sip','outboundOriginateFailureCallsDay','OriginateError','[originate][error]','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','object','[callProgressDetecting]','entity\x20is\x20undefine','custom:agentnosuchnumber','nosuchnumber','createStateFinal','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','outboundRejectCallsDay','AgentReject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','[moveContactManagedDialer][0]','contact\x20not\x20moved','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','predictiveIntervalHitRate','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','predictiveIntervalErlangCallsDroppedCalls','dropRate','Dropped\x20calls\x20day','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','getDataPredictive','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','dialPredictiveOptimizationPercentage','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','queuestatus','[booked][checkContactBlack][else]','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','dialRecallMeTimeout','Agent','outboundReCallsDay','RECALLINQUEUE','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','temp','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','dialLimitQueue','not_inuse','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[countReScheduled]\x20','[getContactDialerPredictive]','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','Amax\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','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','lodash','bluebird','moment','md5','ioredis','../../../config/environment/','dialer','../../../config/logger','booked','predictive','predictiveCalls','defaults','redis','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','./final','./agentComplete','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','prototype','enqueue','tail','finally','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','syncAgentComplete','custom:queuesummary','syncQueueSummary','hangup','newexten','varset','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','Error','milliseconds','diff','seconds','emit','type','outbound','answered','available','pTalking','sumDuration','talking','unmanaged','abandoned','waiting','loggedInDb','dialMethod','dialOriginateCallerIdName','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalErlangCalls','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangBusyFactor','startProgressive','Trunk','active','callerid','stringify','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','error','inspect','stack','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','state','statedesc','starttime','clearZombieChannels','[uniqueid]','[actions]','isNil','Action','status','channel','catch','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','resolve','then','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','pick','ContactId','ListId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','reachable','SIP/%s','moveContactManagedDialer','syncVarSet','uniqueid','variable','amdstatus','xcally-motion-dialer','HANGUP','HangupInAMD','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','dialAMDActive','value','Machine','countmachineretry','countglobal','[syncAgentComplete][createHistory][0]','countbusyretry','countnosuchnumberretry','countdropretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','reason\x2019\x20machine....','add','minutes','YYYY-MM-DD\x20HH:mm:ss','membername','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','AMD','countcongestionretry','countnoanswerretry','dialMachineRetryFrequency','[rescheduleContact][Machine]','ivrAnswerCallsDay','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','[syncHangupIvr][createHistory]','outboundUnknownCallsDay','cause-txt','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','Drop','dropreason','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','countabandonedretry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','endtime','[syncAgentComplete][createHistory][11]','syncNewExten','actionid','strategy','roundrobin','locked','paused','stateinterface','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','[unlock][syncQueueStatusComplete]','_rr','unlockRR','Agent:\x20','[Catch][Preview][syncQueueStatusComplete]','[booked][RR][finaly]','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock2]','[booked][unlock3]','syncCampaigns','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','Failure','\x20Intervals\x20is\x20null\x20','\x20Intervals\x20is\x20empty\x20','timezones'];(function(_0x325e42,_0x4d06){var _0x5218c7=function(_0x5a97ab){while(--_0x5a97ab){_0x325e42['push'](_0x325e42['shift']());}};_0x5218c7(++_0x4d06);}(_0xf269,0xd2));var _0x9f26=function(_0x5f49c9,_0x447c8d){_0x5f49c9=_0x5f49c9-0x0;var _0x263adc=_0xf269[_0x5f49c9];return _0x263adc;};'use strict';var util=require('util');var _=require(_0x9f26('0x0'));var BPromise=require(_0x9f26('0x1'));var uuid=require('uuid');var moment=require(_0x9f26('0x2'));var rr=require('rr');var md5=require(_0x9f26('0x3'));var Redis=require(_0x9f26('0x4'));var ut=require('../preview/util/util');var config=require(_0x9f26('0x5'));var logger=require('../../../config/logger')(_0x9f26('0x6'));var loggerBooked=require(_0x9f26('0x7'))(_0x9f26('0x8'));var loggerPredictive=require(_0x9f26('0x7'))(_0x9f26('0x9'));var loggerPredictiveCalls=require(_0x9f26('0x7'))(_0x9f26('0xa'));var loggerSyncQueueSummary=require(_0x9f26('0x7'))('syncQueueSummary');var ami=require('../ami');config['redis']=_[_0x9f26('0xb')](config[_0x9f26('0xc')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9f26('0xc')]));var cmHopper=require(_0x9f26('0xd'));var cmHopperHistory=require(_0x9f26('0xe'));var cmHopperBlack=require(_0x9f26('0xf'));var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require('./action');var History=require('./history');var Final=require(_0x9f26('0x10'));var AgentComplete=require(_0x9f26('0x11'));var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require(_0x9f26('0x12'));var ipAgi=process[_0x9f26('0x13')][_0x9f26('0x14')]||_0x9f26('0x15');var strategy={'rrmemory':_0x9f26('0x16'),'roundrobin':'roundrobin'};var Sequence=function(){};Sequence[_0x9f26('0x17')][_0x9f26('0x18')]=function(_0x514267){this['tail']=this[_0x9f26('0x19')]?this[_0x9f26('0x19')][_0x9f26('0x1a')](_0x514267):_0x514267();};function Dialer(_0x382bfe,_0x1208e0){this['sequence']=new Sequence();this[_0x9f26('0x1b')]=_0x1208e0;this[_0x9f26('0x1c')]=_0x382bfe[_0x9f26('0x1c')];this[_0x9f26('0x1d')]=_0x382bfe[_0x9f26('0x1d')];this[_0x9f26('0x1e')]=_0x382bfe['agents'];this['trunks']=_0x382bfe[_0x9f26('0x1f')];this['maxNumberOriginate']=config[_0x9f26('0x20')]||0x2;this[_0x9f26('0x21')]={};this[_0x9f26('0x22')]={};this[_0x9f26('0x23')]={};this[_0x9f26('0x24')]={};this[_0x9f26('0x25')]={};this[_0x9f26('0x26')]={};this['startProgressive']={};this[_0x9f26('0x27')]={};this[_0x9f26('0x28')]={};this[_0x9f26('0x29')]={};ami['on'](_0x9f26('0x2a'),this[_0x9f26('0x2b')][_0x9f26('0x2c')](this));ami['on'](_0x9f26('0x2d'),this[_0x9f26('0x2e')][_0x9f26('0x2c')](this));ami['on'](_0x9f26('0x2f'),this[_0x9f26('0x30')][_0x9f26('0x2c')](this));ami['on']('agentcomplete',this[_0x9f26('0x31')][_0x9f26('0x2c')](this));ami['on'](_0x9f26('0x32'),this[_0x9f26('0x33')][_0x9f26('0x2c')](this));ami['on'](_0x9f26('0x34'),this['syncHangup'][_0x9f26('0x2c')](this));ami['on'](_0x9f26('0x35'),this['syncNewExten']['bind'](this));ami['on'](_0x9f26('0x36'),this['syncVarSet'][_0x9f26('0x2c')](this));ami['on']('queuemember',this[_0x9f26('0x37')][_0x9f26('0x2c')](this));ami['on'](_0x9f26('0x38'),this[_0x9f26('0x39')][_0x9f26('0x2c')](this));this[_0x9f26('0x3a')]();this[_0x9f26('0x3b')]();}function isNotNull(_0x315b28){return _0x315b28!==null&&!_[_0x9f26('0x3c')](_0x315b28);}function checkIsLoggedIn(_0x2ad80b,_0x2cc229){return function(){if(_0x2cc229<=0x0){_0x2ad80b[_0x9f26('0x3d')]=_0x9f26('0x3e');throw _0x2ad80b[_0x9f26('0x3f')]+_0x9f26('0x40');}};}function isActive(_0x3267d9){return _0x3267d9;}function checkIsActive(_0x20685e,_0x40a469){return function(){if(!isActive(_0x40a469)){_0x20685e[_0x9f26('0x3d')]=_0x9f26('0x41');throw _0x20685e[_0x9f26('0x3f')]+_0x9f26('0x42');}};}function checkInterval(_0x42b778){return function(){if(!isNotNull(_0x42b778[_0x9f26('0x43')])){_0x42b778['message']=_0x9f26('0x44');throw _0x42b778[_0x9f26('0x3f')]+_0x9f26('0x45');}if(!isNotNull(_0x42b778[_0x9f26('0x43')][_0x9f26('0x46')])){_0x42b778[_0x9f26('0x3d')]='INTERVAL_IS_NULL';throw _0x42b778['name']+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x9f26('0x47')](_0x42b778[_0x9f26('0x43')]['Intervals']))){_0x42b778[_0x9f26('0x3d')]=_0x9f26('0x44');throw _0x42b778[_0x9f26('0x3f')]+_0x9f26('0x45');}};}function msgResponse(_0x1d62fb,_0x10a08c,_0x58037f){return{'action':_0x1d62fb,'response':_0x10a08c,'message':_0x58037f,'stack':_0x58037f};}function myreject(_0x45bbdc){return function(_0x2680ff){return _0x45bbdc(msgResponse('[ifTime][Action]',_0x9f26('0x48'),JSON['stringify'](_0x2680ff)));};}function getSeconds(_0x11e63d,_0x81c266){var _0x1a2bcb=moment(_0x11e63d)[_0x9f26('0x49')](0x0);var _0x54767b=moment(_0x81c266)[_0x9f26('0x49')](0x0);return _0x1a2bcb[_0x9f26('0x4a')](_0x54767b,_0x9f26('0x4b'));}function emit(_0x4f4447,_0x430cc6,_0x102432){io['to'](_0x4f4447)[_0x9f26('0x4c')](_0x430cc6,_0x102432);}function emitVoiceQueueSummary(_0xf8414b){if(_0xf8414b[_0x9f26('0x4d')]===_0x9f26('0x4e')){var _0x4a241d={'id':_0xf8414b['id'],'name':_0xf8414b[_0x9f26('0x3f')],'strategy':_0xf8414b['strategy'],'answered':_0xf8414b[_0x9f26('0x4f')],'available':_0xf8414b[_0x9f26('0x50')],'loggedIn':_0xf8414b['loggedIn'],'pTalking':_0xf8414b[_0x9f26('0x51')],'sumBillable':_0xf8414b['sumBillable'],'sumDuration':_0xf8414b[_0x9f26('0x52')],'sumHoldTime':_0xf8414b['sumHoldTime']||0x0,'talking':_0xf8414b[_0x9f26('0x53')],'total':_0xf8414b['total'],'type':_0xf8414b[_0x9f26('0x4d')],'unmanaged':_0xf8414b[_0x9f26('0x54')],'abandoned':_0xf8414b[_0x9f26('0x55')],'waiting':_0xf8414b[_0x9f26('0x56')],'loggedInDb':_0xf8414b[_0x9f26('0x57')],'dialActive':_0xf8414b['dialActive'],'dialMethod':_0xf8414b[_0x9f26('0x58')],'dialOriginateCallerIdName':_0xf8414b[_0x9f26('0x59')],'dialOriginateCallerIdNumber':_0xf8414b['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0xf8414b['dialOriginateTimeout'],'dialPrefix':_0xf8414b[_0x9f26('0x5a')],'outboundAnswerAgiCallsDay':_0xf8414b[_0x9f26('0x5b')],'outboundAnswerCallsDay':_0xf8414b[_0x9f26('0x5c')],'outboundBlacklistCallsDay':_0xf8414b[_0x9f26('0x5d')],'outboundBusyCallsDay':_0xf8414b['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0xf8414b[_0x9f26('0x5e')],'outboundDropCallsDayACS':_0xf8414b[_0x9f26('0x5f')],'outboundDropCallsDayCallersExit':_0xf8414b[_0x9f26('0x60')],'outboundDropCallsDayTimeout':_0xf8414b[_0x9f26('0x61')],'outboundNoAnswerCallsDay':_0xf8414b['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0xf8414b[_0x9f26('0x62')],'outboundOriginateFailureCallsDay':_0xf8414b['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0xf8414b['outboundReCallsDay'],'outboundRejectCallsDay':_0xf8414b['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0xf8414b['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0xf8414b[_0x9f26('0x63')],'predictiveIntervalAvgHoldtime':_0xf8414b[_0x9f26('0x64')],'predictiveIntervalAvgTalktime':_0xf8414b[_0x9f26('0x65')],'predictiveIntervalDroppedCallsCallersExit':_0xf8414b['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0xf8414b['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0xf8414b[_0x9f26('0x66')],'predictiveIntervalErlangCallsDroppedCalls':_0xf8414b['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0xf8414b['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0xf8414b['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0xf8414b[_0x9f26('0x67')],'predictiveIntervalAvailable':_0xf8414b[_0x9f26('0x68')],'predictiveIntervalTotalCalls':_0xf8414b[_0x9f26('0x69')],'message':_0xf8414b[_0x9f26('0x3d')],'originated':_0xf8414b[_0x9f26('0x6a')],'erlangCalls':_0xf8414b[_0x9f26('0x6b')],'erlangCallToSecond':_0xf8414b['erlangCallToSecond'],'erlangAbandonmentRate':_0xf8414b['erlangAbandonmentRate'],'erlangBusyFactor':_0xf8414b[_0x9f26('0x6c')],'startPredictive':_0xf8414b[_0x9f26('0x26')],'startProgressive':_0xf8414b[_0x9f26('0x6d')]};if(_0xf8414b[_0x9f26('0x6e')]){_0x4a241d['Trunk']={'id':_0xf8414b[_0x9f26('0x6e')]['id'],'name':_0xf8414b[_0x9f26('0x6e')]['name'],'active':_0xf8414b['Trunk'][_0x9f26('0x6f')],'callerid':_0xf8414b[_0x9f26('0x6e')][_0x9f26('0x70')]};}if(_0xf8414b[_0x9f26('0x43')]){_0x4a241d[_0x9f26('0x43')]={'id':_0xf8414b[_0x9f26('0x43')]['id'],'name':_0xf8414b['Interval'][_0x9f26('0x3f')]};}var _0x2504f=md5(JSON[_0x9f26('0x71')](_0x4a241d));if(_0xf8414b['md5']!==_0x2504f){_0xf8414b['md5']=_0x2504f;emit(util[_0x9f26('0x72')](_0x9f26('0x73'),_0x4a241d[_0x9f26('0x3f')]),_0x9f26('0x74'),_0x4a241d);}}}function emitCampaignSummary(_0x327a48){if(_0x327a48[_0x9f26('0x4d')]===_0x9f26('0x75')){emit(util['format'](_0x9f26('0x76'),_0x327a48['name']),_0x9f26('0x77'),_0x327a48);}}function checkGetDataPredictive(_0x3bdf75){if(isNotNull(_0x3bdf75)&&!_[_0x9f26('0x47')](_0x3bdf75)){loggerPredictive[_0x9f26('0x78')](_0x9f26('0x79'));loggerPredictive[_0x9f26('0x78')](_0x9f26('0x7a'),_0x3bdf75[_0x9f26('0x69')]);loggerPredictive[_0x9f26('0x78')](_0x9f26('0x7b'),_0x3bdf75['predictiveIntervalAnsweredCalls']);loggerPredictive[_0x9f26('0x78')](_0x9f26('0x7c'),_0x3bdf75[_0x9f26('0x7d')]);loggerPredictive[_0x9f26('0x78')](_0x9f26('0x7e'),_0x3bdf75[_0x9f26('0x7f')]);loggerPredictive['info'](_0x9f26('0x80'),_0x3bdf75[_0x9f26('0x64')]);loggerPredictive[_0x9f26('0x78')](_0x9f26('0x81'),_0x3bdf75[_0x9f26('0x65')]);loggerPredictive[_0x9f26('0x78')](_0x9f26('0x82'));if(_0x3bdf75[_0x9f26('0x69')]>0x0){if(!_['isUndefined'](_0x3bdf75[_0x9f26('0x65')])&&_0x3bdf75[_0x9f26('0x65')]>0x0){return!![];}loggerPredictive['info'](_0x9f26('0x83'));if(!_['isUndefined'](_0x3bdf75[_0x9f26('0x64')])&&_0x3bdf75['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0x9f26('0x78')](_0x9f26('0x84'));}else{loggerPredictive[_0x9f26('0x78')](_0x9f26('0x85'));}}else{loggerPredictive['info']('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x32b0fe){return function(_0x2e12ab){loggerPredictive['info'](_0x9f26('0x86'));loggerPredictive[_0x9f26('0x78')](_0x9f26('0x87'),_0x2e12ab[_0x9f26('0x6b')]);loggerPredictive[_0x9f26('0x78')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2e12ab[_0x9f26('0x88')]);loggerPredictive[_0x9f26('0x78')](_0x9f26('0x89'),_0x2e12ab[_0x9f26('0x8a')]);loggerPredictive[_0x9f26('0x78')](_0x9f26('0x8b'),_0x2e12ab['erlangBusyFactor']);loggerPredictive[_0x9f26('0x78')](_0x9f26('0x89'),_0x2e12ab[_0x9f26('0x8a')]);loggerPredictive[_0x9f26('0x78')]('---------------------------');_[_0x9f26('0x8c')](_0x32b0fe,_0x2e12ab);};}function getDiff(_0x2831b6){var _0x2d3198=moment()[_0x9f26('0x49')](0x0);var _0x55d1d5=moment(_0x2831b6)['milliseconds'](0x0);return _0x2d3198[_0x9f26('0x4a')](_0x55d1d5,_0x9f26('0x4b'));}function ifInterval(_0x52cd8d,_0x223f2d){if(_[_0x9f26('0x3c')](_0x223f2d)){return![];}return getDiff(_0x223f2d)<_0x52cd8d*0x3c;}function freeVariablesPredictive(_0x2a1b3e){if(isNotNull(_0x2a1b3e)){if(!_[_0x9f26('0x3c')](_0x2a1b3e[_0x9f26('0x6d')])){_0x2a1b3e['startProgressive']=undefined;loggerPredictive[_0x9f26('0x78')](_0x2a1b3e[_0x9f26('0x3f')],_0x9f26('0x8d'));}if(!_['isUndefined'](_0x2a1b3e['startPredictive'])){_0x2a1b3e[_0x9f26('0x26')]=undefined;loggerPredictive[_0x9f26('0x78')](_0x2a1b3e[_0x9f26('0x3f')],_0x9f26('0x8e'));}if(!_['isUndefined'](_0x2a1b3e[_0x9f26('0x8f')])){clearInterval(_0x2a1b3e[_0x9f26('0x8f')]);_0x2a1b3e[_0x9f26('0x8f')]=undefined;loggerPredictive[_0x9f26('0x78')](_0x2a1b3e[_0x9f26('0x3f')],_0x9f26('0x90'));}}}function erlangb(_0x19e563,_0xaeddf3){if(_0xaeddf3===0x0){return 0x0;}var _0x113c26=0x1;for(var _0xb1aae1=0x1;_0xb1aae1<=_0xaeddf3;_0xb1aae1+=0x1){_0x113c26=0x1+_0x113c26*_0xb1aae1/_0x19e563;}return 0x1/_0x113c26;}function isVoiceQueueOutbound(_0x281a61){return _0x281a61===_0x9f26('0x4e');}function isNotPreview(_0x41b63){return _0x41b63!==_0x9f26('0x1b');}function isCampaignIvr(_0x5135e8){return _0x5135e8===_0x9f26('0x75');}function getCallerId(_0x1fd65a,_0x92c215,_0x3102c0){if(!_[_0x9f26('0x3c')](_0x3102c0)&&typeof _0x3102c0===_0x9f26('0x91')&&!_['isEmpty'](_0x3102c0)){if(!_['isUndefined'](_0x92c215)&&typeof _0x92c215===_0x9f26('0x91')&&!_['isEmpty'](_0x92c215)){return util[_0x9f26('0x72')](_0x9f26('0x92'),_0x92c215,_0x3102c0);}return util[_0x9f26('0x72')]('\x22%s\x22\x20<%s>',_0x3102c0,_0x3102c0);}if(!_[_0x9f26('0x3c')](_0x1fd65a)&&typeof _0x1fd65a===_0x9f26('0x91')&&!_[_0x9f26('0x47')](_0x1fd65a)){return _0x1fd65a;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x455859,_0x412dd8){return function(_0x4655b8){freeVariablesPredictive(_0x412dd8);emitVoiceQueueSummary(_0x412dd8);emitCampaignSummary(_0x412dd8);loggerSyncQueueSummary[_0x9f26('0x93')](_0x455859,util[_0x9f26('0x94')](_0x4655b8,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x2d22ff,_0x56fa29){return function(_0x38bc4f){loggerPredictive['error'](_0x56fa29['name'],_0x2d22ff);loggerPredictive[_0x9f26('0x93')](_0x38bc4f[_0x9f26('0x95')]);freeVariablesPredictive(_0x56fa29);};}function loggerCatch(_0x19f44e){return function(_0x4ed0ad){logger[_0x9f26('0x93')](_0x19f44e,util[_0x9f26('0x94')](_0x4ed0ad,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x497471){return _0x497471&&!_[_0x9f26('0x3c')](_0x497471)&&_0x497471[_0x9f26('0x96')]>0x0;}function decremetOriginate(_0x9bb8c){if(!_[_0x9f26('0x3c')](_0x9bb8c)&&_0x9bb8c!==null){if(typeof _0x9bb8c[_0x9f26('0x6a')]!==_0x9f26('0x97')){if(_0x9bb8c[_0x9f26('0x6a')]>0x0){_0x9bb8c['originated']-=0x1;}else{logger['error'](_0x9f26('0x98'));}}}else{logger[_0x9f26('0x93')](_0x9f26('0x99'));}}function checkContactLowerLimitOriginate(_0x46b09c,_0x2e2637,_0x53c9fd){if(_0x2e2637>_0x53c9fd){for(var _0x24a35d=0x0;_0x24a35d<_0x2e2637-_0x53c9fd;_0x24a35d+=0x1){decremetOriginate(_0x46b09c);}}}function loggerGetContactDialer(_0x22ba17,_0x32e2bf,_0x4b8000){return function(_0x1319d5){checkContactLowerLimitOriginate(_0x32e2bf,_0x4b8000,0x0);logger['error'](_0x22ba17,util[_0x9f26('0x94')](_0x1319d5,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0xf02b62){return function(_0x4aaacc){if(isNotNull(_0x4aaacc)&&isNotNull(_0x4aaacc[0x0])){if(_0x4aaacc[0x0][_0x9f26('0x9a')]>0x0){_0xf02b62[_0x9f26('0x3d')]='RESCHEDULED_CONTACTS';logger[_0x9f26('0x78')](_0x9f26('0x9b')+_0xf02b62[_0x9f26('0x3f')],_0x4aaacc[0x0]['contactsRescheduled'],_0x9f26('0x9c'));}else{_0xf02b62[_0x9f26('0x3d')]=_0x9f26('0x9d');logger[_0x9f26('0x78')]('[getContactDialer2][Empty]'+_0xf02b62[_0x9f26('0x3f')]);}}};}function notSendMessagesQueue(_0x1fddb7){if(_0x1fddb7[_0x9f26('0x9e')]){freeVariablesPredictive(_0x1fddb7);if(_0x1fddb7['originated']===0x0&&_0x1fddb7[_0x9f26('0x53')]===0x0&&_0x1fddb7['waiting']===0x0&&(_0x1fddb7['pTalking']||0x0)===0x0){_0x1fddb7[_0x9f26('0x9e')]=![];_0x1fddb7['available']=0x0;_0x1fddb7[_0x9f26('0x3d')]=_0x9f26('0x41');loggerSyncQueueSummary[_0x9f26('0x93')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x1fddb7['name'],'is\x20not\x20active');}else{_0x1fddb7[_0x9f26('0x3d')]='IS_DISACTIVED';loggerSyncQueueSummary[_0x9f26('0x93')](_0x9f26('0x9f'),_0x1fddb7[_0x9f26('0x3f')],'is\x20disactive');}emitVoiceQueueSummary(_0x1fddb7);}}function notSendMessagesCampaign(_0x5c8bf7){if(_0x5c8bf7[_0x9f26('0x9e')]){if(_0x5c8bf7[_0x9f26('0x6a')]===0x0){_0x5c8bf7[_0x9f26('0x9e')]=![];_0x5c8bf7['message']=_0x9f26('0x41');loggerSyncQueueSummary['error'](_0x9f26('0xa0'),_0x5c8bf7[_0x9f26('0x3f')],_0x9f26('0xa1'));}else{_0x5c8bf7['message']=_0x9f26('0xa2');loggerSyncQueueSummary[_0x9f26('0x93')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x5c8bf7['name'],_0x9f26('0xa3'));}emitCampaignSummary(_0x5c8bf7);}}function createObjHistory(_0x16d8ca,_0x5c49dd,_0x404e63,_0x4f6c42,_0x33b211){_0x16d8ca[_0x9f26('0x3d')]=_0x404e63;var _0x591713=new Action(_0x16d8ca,_0x5c49dd);var _0x136b86=new History(_0x591713);_0x136b86[_0x9f26('0xa4')]=_0x4f6c42;_0x136b86[_0x9f26('0xa5')]=_0x33b211;_0x136b86['endtime']=_0x591713[_0x9f26('0xa6')];return _0x136b86;}Dialer['prototype'][_0x9f26('0x3b')]=function(){var _0x3d8915=this;setInterval(function(){_0x3d8915[_0x9f26('0xa7')](_0x3d8915[_0x9f26('0x24')],_0x9f26('0xa8'));_0x3d8915['clearZombieChannels'](_0x3d8915[_0x9f26('0x22')],_0x9f26('0xa9'));},0x32c8);};Dialer[_0x9f26('0x17')][_0x9f26('0xa7')]=function(_0x21b552,_0x5abc1a){var _0x168854=this;for(var _0x173e12 in _0x21b552){if(typeof _0x21b552[_0x173e12]!==_0x9f26('0x97')){this['sequence'][_0x9f26('0x18')](function(){if(!_[_0x9f26('0xaa')](_0x21b552[_0x173e12])){return ami[_0x9f26('0xab')]({'action':_0x9f26('0xac'),'channel':_0x21b552[_0x173e12][_0x9f26('0xad')]})[_0x9f26('0xae')](function(_0x53364e){if(_0x53364e[_0x9f26('0x3d')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x21b552[_0x173e12]&&_0x21b552[_0x173e12][_0x9f26('0x4d')]!==_0x9f26('0x75')){_0x168854[_0x9f26('0xaf')](_0x168854[_0x9f26('0x1c')][_0x21b552[_0x173e12][_0x9f26('0xb0')]]);logger[_0x9f26('0x93')](_0x9f26('0xb1'),_0x5abc1a,_0x173e12,_0x21b552[_0x173e12][_0x9f26('0xb0')]);delete _0x21b552[_0x173e12];}if(_0x21b552[_0x173e12]&&_0x21b552[_0x173e12][_0x9f26('0x4d')]===_0x9f26('0x75')){_0x168854[_0x9f26('0xaf')](_0x168854['campaigns'][_0x21b552[_0x173e12]['queue']]);logger[_0x9f26('0x93')](_0x9f26('0xb2'),_0x5abc1a,_0x173e12,_0x21b552[_0x173e12][_0x9f26('0xb0')]);delete _0x21b552[_0x173e12];}},0x2328);}});}});}}};Dialer['prototype']['countReScheduled']=function(_0x43ba7b){return BPromise[_0x9f26('0xb3')]()[_0x9f26('0xb4')](cmHopper['countReScheduled'](_0x43ba7b))[_0x9f26('0xae')](loggerCatch('[countReScheduled]\x20'));};Dialer[_0x9f26('0x17')]['checkIsBlackList']=function(_0x3e6684){return BPromise[_0x9f26('0xb3')]()[_0x9f26('0xb4')](cmHopperBlack[_0x9f26('0xb5')](_0x3e6684))[_0x9f26('0xae')](loggerCatch(_0x9f26('0xb6')));};Dialer['prototype'][_0x9f26('0xb7')]=function(_0x2a7557){return BPromise[_0x9f26('0xb3')]()['then'](cmHopperBlack[_0x9f26('0xb7')](_0x2a7557))[_0x9f26('0xae')](loggerCatch(_0x9f26('0xb8')));};Dialer['prototype'][_0x9f26('0xb9')]=function(_0x35e6bf){return BPromise[_0x9f26('0xb3')]()['then'](cmHopperHistory[_0x9f26('0xba')](_0x35e6bf))[_0x9f26('0xae')](loggerCatch(_0x9f26('0xbb')));};Dialer[_0x9f26('0x17')]['rescheduleContact']=function(_0x570175){return BPromise['resolve']()[_0x9f26('0xb4')](cmHopper[_0x9f26('0xbc')](_0x570175))[_0x9f26('0xae')](loggerCatch(_0x9f26('0xbd')));};Dialer['prototype'][_0x9f26('0xbe')]=function(_0x303053,_0x482565,_0x309b6f){return BPromise[_0x9f26('0xb3')]()[_0x9f26('0xb4')](cmHopper[_0x9f26('0xbe')](_0x303053,_0x482565,_0x309b6f))[_0x9f26('0xae')](loggerCatch(_0x9f26('0xbf')));};Dialer['prototype'][_0x9f26('0xc0')]=function(_0x2f115d,_0x2df81f,_0x581981,_0x27a1ec){return BPromise['resolve']()[_0x9f26('0xb4')](cmHopper['getContactDialer'](_0x2f115d,_0x2df81f,_0x581981,_0x27a1ec))[_0x9f26('0xae')](loggerCatch(_0x9f26('0xc1')));};Dialer[_0x9f26('0x17')][_0x9f26('0xc2')]=function(_0x69470a,_0x1b3359,_0x2044b9){return BPromise[_0x9f26('0xb3')]()['then'](cmHopper['getContactDialerIvr'](_0x69470a,_0x1b3359,_0x2044b9))[_0x9f26('0xae')](loggerCatch(_0x9f26('0xc1')));};Dialer['prototype'][_0x9f26('0xc3')]=function(_0x407740){return BPromise[_0x9f26('0xb3')]()[_0x9f26('0xb4')](voiceQueueRt[_0x9f26('0xc3')](_0x407740))[_0x9f26('0xae')](loggerCatch(_0x9f26('0xc4')));};Dialer[_0x9f26('0x17')]['moveContactManagedDialer']=function(_0x5a250d){return BPromise[_0x9f26('0xb3')]()['then'](cmHopper['moveContactManagedDialer'](_0x5a250d))[_0x9f26('0xae')](loggerCatch(_0x9f26('0xc5')));};Dialer[_0x9f26('0x17')][_0x9f26('0xc6')]=function(_0xdff1ad){return BPromise['resolve']()[_0x9f26('0xb4')](cmHopperHistory['createHistory'](_0xdff1ad))[_0x9f26('0xae')](loggerCatch(_0x9f26('0xc7')));};Dialer[_0x9f26('0x17')][_0x9f26('0xaf')]=function(_0x586136){if(!_[_0x9f26('0x3c')](_0x586136)&&_0x586136!==null){if(typeof _0x586136[_0x9f26('0x6a')]!=='undefined'){if(_0x586136['originated']>0x0){_0x586136[_0x9f26('0x6a')]-=0x1;}else{logger[_0x9f26('0x93')](_0x9f26('0xc8'));}}}else{logger['error'](_0x9f26('0xc9'));}};Dialer[_0x9f26('0x17')][_0x9f26('0xca')]=function(_0x322427,_0x3a4f63){var _0x4ee915=this;return function(_0x592565){_0x4ee915[_0x9f26('0xaf')](_0x3a4f63);logger[_0x9f26('0x93')](_0x322427,util[_0x9f26('0x94')](_0x592565,{'showHidden':![],'depth':null}));};};Dialer[_0x9f26('0x17')][_0x9f26('0xcb')]=function(_0x121968,_0x4d78f8,_0x9250ad){var _0x4aa68f={'state':0x19,'statedesc':_0x9f26('0xcc')};this[_0x9f26('0xaf')](_0x4d78f8);this[_0x9f26('0xcd')](_['merge'](_0x4aa68f,_[_0x9f26('0xce')](_0x9250ad,[_0x9f26('0xcf'),_0x9f26('0xd0'),'UserId',_0x9f26('0xd1'),_0x9f26('0xd2')])),_0x9f26('0xd3'),_0x9f26('0xd4'));logger[_0x9f26('0x93')](_0x121968);};Dialer['prototype'][_0x9f26('0xd5')]=function(_0x148cca){return _0x148cca===_0x9f26('0xd6');};Dialer['prototype'][_0x9f26('0xd7')]=function(_0x3e16d5){return!_['isUndefined'](_0x3e16d5)&&_0x3e16d5&&!_[_0x9f26('0x3c')](_0x3e16d5[_0x9f26('0x3f')])&&!_[_0x9f26('0x3c')](_0x3e16d5[_0x9f26('0x6f')])&&_0x3e16d5['active']&&(this['trunks'][util['format']('SIP/%s',_0x3e16d5[_0x9f26('0x3f')])][_0x9f26('0xac')]===_0x9f26('0xd8')||this[_0x9f26('0x1f')][util[_0x9f26('0x72')](_0x9f26('0xd9'),_0x3e16d5[_0x9f26('0x3f')])][_0x9f26('0xac')]==='unmonitored');};Dialer[_0x9f26('0x17')][_0x9f26('0xcd')]=function(_0x1c2111,_0x4782f5,_0x43b94d){this[_0x9f26('0xc6')](_0x1c2111)['catch'](loggerCatch(_0x4782f5));this[_0x9f26('0xda')](_0x1c2111)[_0x9f26('0xae')](loggerCatch(_0x43b94d));};Dialer[_0x9f26('0x17')][_0x9f26('0xdb')]=function(_0xbbdce1){var _0x42c2df=this[_0x9f26('0x24')][_0xbbdce1[_0x9f26('0xdc')]];var _0x12ab33;if(!_[_0x9f26('0xaa')](_0xbbdce1)&&!_['isNil'](_0xbbdce1[_0x9f26('0xdd')])&&!_[_0x9f26('0xaa')](_0xbbdce1[_0x9f26('0xdd')][_0x9f26('0xde')])&&_0xbbdce1['exten']===_0x9f26('0xdf')&&_0x42c2df){if(_0x42c2df['type']!==_0x9f26('0x75')&&this[_0x9f26('0x1c')][_0x42c2df[_0x9f26('0xb0')]]['dialAMDActive']&&_0xbbdce1['value']===_0x9f26('0xe0')){delete this[_0x9f26('0x24')][_0xbbdce1[_0x9f26('0xdc')]];this[_0x9f26('0xaf')](this[_0x9f26('0x1c')][_0x42c2df[_0x9f26('0xb0')]]);this[_0x9f26('0x1c')][_0x42c2df[_0x9f26('0xb0')]][_0x9f26('0x5c')]+=0x1;this[_0x9f26('0x1c')][_0x42c2df[_0x9f26('0xb0')]][_0x9f26('0x5b')]+=0x1;_0x12ab33=new Hangup(_0x42c2df,_0xbbdce1);_0x12ab33[_0x9f26('0xa4')]=0x12;_0x12ab33[_0x9f26('0xa5')]=_0x9f26('0xe1');_0x12ab33['membername']='AMD';ami['emit'](_0x9f26('0xe2'),ut[_0x9f26('0xe3')](_0x12ab33,_0x9f26('0xe4')));this[_0x9f26('0xcd')](_0x12ab33,_0x9f26('0xe5'),_0x9f26('0xe6'));}if(_0x42c2df[_0x9f26('0x4d')]!==_0x9f26('0x75')&&this[_0x9f26('0x1c')][_0x42c2df['queue']][_0x9f26('0xe7')]&&_0xbbdce1[_0x9f26('0xe8')]==='MACHINE'){var _0x531ad7=this;return new BPromise(function(_0x4d9285,_0x25bdc9){delete _0x531ad7['uniqueId'][_0xbbdce1[_0x9f26('0xdc')]];_0x531ad7[_0x9f26('0xaf')](_0x531ad7['voiceQueues'][_0x42c2df[_0x9f26('0xb0')]]);_0x531ad7['voiceQueues'][_0x42c2df[_0x9f26('0xb0')]][_0x9f26('0x5c')]+=0x1;_0x531ad7[_0x9f26('0x1c')][_0x42c2df[_0x9f26('0xb0')]][_0x9f26('0x5b')]+=0x1;var _0x2ef54c=_0x531ad7[_0x9f26('0x1c')][_0x42c2df['queue']];var _0x424038=new Hangup(_0x42c2df,_0xbbdce1);_0x424038[_0x9f26('0xa4')]=0x13;_0x424038['statedesc']=_0x9f26('0xe9');_0x424038['membername']='AMD';_0x424038[_0x9f26('0xea')]+=0x1;_0x424038[_0x9f26('0xeb')]+=0x1;_0x424038[_0x9f26('0xe4')]=!![];ami[_0x9f26('0x4c')](_0x9f26('0xe2'),ut[_0x9f26('0xe3')](_0x424038,'amd'));_0x531ad7[_0x9f26('0xc6')](_0x424038)[_0x9f26('0xae')](loggerCatch(_0x9f26('0xec')));if(_0x424038[_0x9f26('0xed')]+_0x424038['countcongestionretry']+_0x424038['countnoanswerretry']+_0x424038[_0x9f26('0xee')]+_0x424038[_0x9f26('0xef')]+_0x424038['countabandonedretry']+_0x424038[_0x9f26('0xea')]+_0x424038[_0x9f26('0xf0')]>=_0x2ef54c[_0x9f26('0xf1')]){_0x531ad7[_0x9f26('0xf2')](_0x424038,_0x4d9285,_0x25bdc9,_0x9f26('0xf3'));}else{if(_0x424038[_0x9f26('0xea')]>=_0x2ef54c[_0x9f26('0xf4')]){_0x531ad7['createStateFinal'](_0x424038,_0x4d9285,_0x25bdc9,_0x9f26('0xf5'));}else{_0x531ad7[_0x9f26('0xbc')]({'active':![],'countmachineretry':_0x424038[_0x9f26('0xea')],'scheduledat':moment()[_0x9f26('0xf6')](_0x2ef54c['dialMachineRetryFrequency'],_0x9f26('0xf7'))[_0x9f26('0x72')](_0x9f26('0xf8')),'ContactId':_0x424038[_0x9f26('0xcf')],'ListId':_0x424038['ListId'],'VoiceQueueId':_0x424038[_0x9f26('0xd1')]||undefined,'CampaignId':_0x424038[_0x9f26('0xd2')]||undefined})[_0x9f26('0xae')](loggerCatch('[rescheduleContact][Machine]'));_0x4d9285({'reschedule':0x1});}}});}if(_0x42c2df[_0x9f26('0x4d')]===_0x9f26('0x75')&&this[_0x9f26('0x1d')][_0x42c2df['queue']][_0x9f26('0xe7')]&&_0xbbdce1[_0x9f26('0xe8')]===_0x9f26('0xe0')){delete this['uniqueId'][_0xbbdce1[_0x9f26('0xdc')]];this[_0x9f26('0xaf')](this[_0x9f26('0x1d')][_0x42c2df[_0x9f26('0xb0')]]);_0x12ab33=new Hangup(_0x42c2df,_0xbbdce1);_0x12ab33[_0x9f26('0xa4')]=0x12;_0x12ab33[_0x9f26('0xa5')]=_0x9f26('0xe1');_0x12ab33[_0x9f26('0xf9')]='AMD';ami[_0x9f26('0x4c')](_0x9f26('0xe2'),ut[_0x9f26('0xe3')](_0x12ab33,_0x9f26('0xe4')));this['saveInDb'](_0x12ab33,_0x9f26('0xfa'),_0x9f26('0xfb'));}if(_0x42c2df['type']===_0x9f26('0x75')&&this['campaigns'][_0x42c2df['queue']][_0x9f26('0xe7')]&&_0xbbdce1[_0x9f26('0xe8')]===_0x9f26('0xfc')){var _0x531ad7=this;return new BPromise(function(_0x4beeae,_0x1c881d){delete _0x531ad7[_0x9f26('0x24')][_0xbbdce1[_0x9f26('0xdc')]];_0x531ad7[_0x9f26('0xaf')](_0x531ad7[_0x9f26('0x1d')][_0x42c2df[_0x9f26('0xb0')]]);_0x531ad7[_0x9f26('0x1d')][_0x42c2df[_0x9f26('0xb0')]][_0x9f26('0x5c')]+=0x1;_0x531ad7[_0x9f26('0x1d')][_0x42c2df[_0x9f26('0xb0')]][_0x9f26('0x5b')]+=0x1;var _0x374829=_0x531ad7[_0x9f26('0x1d')][_0x42c2df['queue']];var _0x735fca=new Hangup(_0x42c2df,_0xbbdce1);_0x735fca[_0x9f26('0xa4')]=0x13;_0x735fca[_0x9f26('0xa5')]=_0x9f26('0xe9');_0x735fca['membername']=_0x9f26('0xfd');_0x735fca['countmachineretry']+=0x1;_0x735fca[_0x9f26('0xeb')]+=0x1;_0x735fca['amd']=!![];ami[_0x9f26('0x4c')](_0x9f26('0xe2'),ut['buildObj'](_0x735fca,_0x9f26('0xe4')));_0x531ad7[_0x9f26('0xc6')](_0x735fca)[_0x9f26('0xae')](loggerCatch(_0x9f26('0xec')));if(_0x735fca['countbusyretry']+_0x735fca[_0x9f26('0xfe')]+_0x735fca[_0x9f26('0xff')]+_0x735fca[_0x9f26('0xee')]+_0x735fca['countdropretry']+_0x735fca['countabandonedretry']+_0x735fca[_0x9f26('0xea')]+_0x735fca[_0x9f26('0xf0')]>=_0x374829['dialGlobalMaxRetry']){_0x531ad7[_0x9f26('0xf2')](_0x735fca,_0x4beeae,_0x1c881d,_0x9f26('0xf3'));}else{if(_0x735fca[_0x9f26('0xea')]>=_0x374829[_0x9f26('0xf4')]){_0x531ad7['createStateFinal'](_0x735fca,_0x4beeae,_0x1c881d,_0x9f26('0xf5'));}else{_0x531ad7[_0x9f26('0xbc')]({'active':![],'countmachineretry':_0x735fca['countmachineretry'],'scheduledat':moment()['add'](_0x374829[_0x9f26('0x100')],_0x9f26('0xf7'))[_0x9f26('0x72')](_0x9f26('0xf8')),'ContactId':_0x735fca[_0x9f26('0xcf')],'ListId':_0x735fca[_0x9f26('0xd0')],'VoiceQueueId':_0x735fca[_0x9f26('0xd1')]||undefined,'CampaignId':_0x735fca[_0x9f26('0xd2')]||undefined})[_0x9f26('0xae')](loggerCatch(_0x9f26('0x101')));_0x4beeae({'reschedule':0x1});}}});}}};Dialer[_0x9f26('0x17')]['syncHangup']=function(_0x45edcd){var _0x5c0e7a=this['uniqueId'][_0x45edcd[_0x9f26('0xdc')]];var _0x2f7204=this;var _0x2f804b;if(_0x5c0e7a&&_0x5c0e7a['type']===_0x9f26('0x75')){delete this[_0x9f26('0x24')][_0x45edcd['uniqueid']];this['updateOriginated'](this[_0x9f26('0x1d')][_0x5c0e7a['queue']]);this['campaigns'][_0x5c0e7a[_0x9f26('0xb0')]][_0x9f26('0x102')]+=0x1;_0x2f804b=new Hangup(_0x5c0e7a,_0x45edcd);this[_0x9f26('0xc6')](_0x2f804b)[_0x9f26('0xae')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x9f26('0xda')](_0x2f804b)[_0x9f26('0xae')](loggerCatch(_0x9f26('0x103')));}if(_0x5c0e7a&&_0x5c0e7a[_0x9f26('0x4d')]!==_0x9f26('0x75')&&isNotNull(this['voiceQueues'][_0x5c0e7a[_0x9f26('0xb0')]][_0x9f26('0x104')])){delete this[_0x9f26('0x24')][_0x45edcd[_0x9f26('0xdc')]];this[_0x9f26('0xaf')](this[_0x9f26('0x1c')][_0x5c0e7a[_0x9f26('0xb0')]]);this[_0x9f26('0x1c')][_0x5c0e7a[_0x9f26('0xb0')]][_0x9f26('0x5c')]+=0x1;this[_0x9f26('0x1c')][_0x5c0e7a[_0x9f26('0xb0')]][_0x9f26('0x5b')]+=0x1;_0x2f804b=new Hangup(_0x5c0e7a,_0x45edcd);_0x2f804b['state']=0x10;_0x2f804b[_0x9f26('0xa5')]=_0x9f26('0x105');_0x2f804b['membername']=_0x9f26('0x106');this['createHistory'](_0x2f804b)[_0x9f26('0xae')](loggerCatch(_0x9f26('0x107')));this[_0x9f26('0xda')](_0x2f804b)[_0x9f26('0xae')](loggerCatch(_0x9f26('0x103')));}if(_0x5c0e7a&&_0x5c0e7a[_0x9f26('0x4d')]!=='ivr'&&!isNotNull(this[_0x9f26('0x1c')][_0x5c0e7a[_0x9f26('0xb0')]]['dialQueueProject'])){delete this[_0x9f26('0x24')][_0x45edcd[_0x9f26('0xdc')]];this[_0x9f26('0xaf')](this[_0x9f26('0x1c')][_0x5c0e7a[_0x9f26('0xb0')]]);this[_0x9f26('0x1c')][_0x5c0e7a['queue']][_0x9f26('0x108')]+=0x1;_0x2f804b=new Hangup(_0x5c0e7a,_0x45edcd);_0x2f804b[_0x9f26('0xa4')]=0xc;_0x2f804b[_0x9f26('0xa5')]=_0x45edcd[_0x9f26('0x109')];_0x2f804b[_0x9f26('0xf9')]='Unknow';this[_0x9f26('0xc6')](_0x2f804b)[_0x9f26('0xae')](loggerCatch(_0x9f26('0x107')));this[_0x9f26('0xda')](_0x2f804b)[_0x9f26('0xae')](loggerCatch(_0x9f26('0x103')));}};Dialer['prototype']['syncAgentComplete']=function(_0x35c288){var _0x393dfb=this[_0x9f26('0x24')][_0x35c288['uniqueid']];var _0x48ea62=this;if(this[_0x9f26('0x1c')][_0x35c288[_0x9f26('0xb0')]]){if(_0x393dfb&&_0x393dfb[_0x9f26('0x4d')]!==_0x9f26('0x75')){delete this[_0x9f26('0x24')][_0x35c288[_0x9f26('0xdc')]];this[_0x9f26('0x1c')][_0x35c288[_0x9f26('0xb0')]][_0x9f26('0x5c')]+=0x1;var _0x15b9f5=new AgentComplete(_0x393dfb,_0x35c288);if(_0x35c288[_0x9f26('0x10a')]===_0x9f26('0x10b')){_0x15b9f5[_0x9f26('0x10c')]=this[_0x9f26('0x1c')][_0x35c288[_0x9f26('0xb0')]][_0x9f26('0x10d')]&&this[_0x9f26('0x1c')][_0x35c288[_0x9f26('0xb0')]][_0x9f26('0x10e')]?moment()[_0x9f26('0x72')](_0x9f26('0xf8')):undefined;}this['createHistory'](_0x15b9f5)[_0x9f26('0xae')](loggerCatch(_0x9f26('0x10f')));this[_0x9f26('0xda')](_0x15b9f5)[_0x9f26('0xae')](loggerCatch(_0x9f26('0x110')));}}};Dialer[_0x9f26('0x17')][_0x9f26('0x2b')]=function(_0x292b0e){if(this[_0x9f26('0x1c')][_0x292b0e[_0x9f26('0xb0')]]){if(this['uniqueId'][_0x292b0e[_0x9f26('0xdc')]]&&this[_0x9f26('0x24')][_0x292b0e[_0x9f26('0xdc')]][_0x9f26('0x4d')]!==_0x9f26('0x75')){this['updateOriginated'](this[_0x9f26('0x1c')][_0x292b0e[_0x9f26('0xb0')]]);this['uniqueId'][_0x292b0e[_0x9f26('0xdc')]][_0x9f26('0x111')]=moment()[_0x9f26('0x72')](_0x9f26('0xf8'));}}};Dialer['prototype'][_0x9f26('0x112')]=function(_0xfa7702){this[_0x9f26('0xc6')](_0xfa7702)[_0x9f26('0xae')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x9f26('0xda')](_0xfa7702)[_0x9f26('0xae')](loggerCatch(_0x9f26('0x113')));};Dialer[_0x9f26('0x17')][_0x9f26('0x2e')]=function(_0xd83cde){var _0x18c8a3=this[_0x9f26('0x24')][_0xd83cde[_0x9f26('0xdc')]];var _0x1c58db=this;if(this[_0x9f26('0x1c')][_0xd83cde['queue']]){if(_0x18c8a3&&_0x18c8a3['type']!==_0x9f26('0x75')){delete this[_0x9f26('0x24')][_0xd83cde[_0x9f26('0xdc')]];this[_0x9f26('0xaf')](this[_0x9f26('0x1c')][_0xd83cde[_0x9f26('0xb0')]]);_0x18c8a3[_0x9f26('0x114')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x377209=new QueueCallerAbandon(_0x18c8a3,_0xd83cde);if(getSeconds(_0x18c8a3['droptime'],_0x18c8a3[_0x9f26('0x115')])>=_0x18c8a3['dialQueueTimeout']){this['voiceQueues'][_0xd83cde[_0x9f26('0xb0')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0x9f26('0x1c')][_0xd83cde[_0x9f26('0xb0')]][_0x9f26('0x61')]+=0x1;this[_0x9f26('0x1c')][_0xd83cde['queue']]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x377209[_0x9f26('0xa4')]=0xa;_0x377209[_0x9f26('0xa5')]=_0x9f26('0x116');_0x377209[_0x9f26('0x117')]='TIMEOUT';_0x377209[_0x9f26('0x10c')]=this[_0x9f26('0x1c')][_0xd83cde[_0x9f26('0xb0')]][_0x9f26('0x10d')]?moment()['format'](_0x9f26('0xf8')):undefined;_0x377209[_0x9f26('0xef')]+=0x1;_0x377209[_0x9f26('0xeb')]+=0x1;if(_0x377209[_0x9f26('0xef')]>=this[_0x9f26('0x1c')][_0xd83cde[_0x9f26('0xb0')]][_0x9f26('0x118')]){this[_0x9f26('0x112')](_0x377209);}else{this['rescheduleContact']({'active':![],'countdropretry':_0x377209['countdropretry'],'scheduledat':moment()['add'](this[_0x9f26('0x1c')][_0xd83cde[_0x9f26('0xb0')]][_0x9f26('0x119')],_0x9f26('0xf7'))[_0x9f26('0x72')](_0x9f26('0xf8')),'ContactId':_0x18c8a3[_0x9f26('0xcf')],'ListId':_0x18c8a3['ListId'],'VoiceQueueId':_0x18c8a3[_0x9f26('0xd1')]||undefined,'CampaignId':_0x18c8a3['CampaignId']||undefined})['catch'](loggerCatch(_0x9f26('0x11a')));var _0x3de79e=new History(_0x377209);_0x3de79e[_0x9f26('0xa4')]=0xa;_0x3de79e[_0x9f26('0xa5')]=_0x9f26('0x116');_0x3de79e['starttime']=moment()[_0x9f26('0x72')]('YYYY-MM-DD\x20HH:mm:ss');_0x3de79e['endtime']=_0x3de79e[_0x9f26('0xa6')];_0x3de79e[_0x9f26('0x11b')]=_0x377209['calleridname'];_0x3de79e[_0x9f26('0x11c')]=_0x377209[_0x9f26('0x11c')];this[_0x9f26('0xc6')](_0x3de79e)[_0x9f26('0xae')](loggerCatch(_0x9f26('0x11d')));}}else{this[_0x9f26('0x1c')][_0xd83cde['queue']][_0x9f26('0x7f')]+=0x1;this[_0x9f26('0x1c')][_0xd83cde[_0x9f26('0xb0')]][_0x9f26('0x60')]+=0x1;_0x377209[_0x9f26('0xa4')]=0xb;_0x377209['statedesc']=_0x9f26('0x11e');_0x377209[_0x9f26('0x117')]='CALLEREXIT';_0x377209[_0x9f26('0x11f')]+=0x1;_0x377209[_0x9f26('0xeb')]+=0x1;if(_0x377209[_0x9f26('0x11f')]>=this[_0x9f26('0x1c')][_0xd83cde[_0x9f26('0xb0')]][_0x9f26('0x120')]){this[_0x9f26('0x112')](_0x377209);}else{this[_0x9f26('0xbc')]({'active':![],'countabandonedretry':_0x377209[_0x9f26('0x11f')],'scheduledat':moment()[_0x9f26('0xf6')](this['voiceQueues'][_0xd83cde[_0x9f26('0xb0')]][_0x9f26('0x121')],_0x9f26('0xf7'))[_0x9f26('0x72')](_0x9f26('0xf8')),'ContactId':_0x18c8a3[_0x9f26('0xcf')],'ListId':_0x18c8a3[_0x9f26('0xd0')],'VoiceQueueId':_0x18c8a3['VoiceQueueId']||undefined,'CampaignId':_0x18c8a3['CampaignId']||undefined})[_0x9f26('0xae')](loggerCatch(_0x9f26('0x122')));var _0x3de79e=new History(_0x377209);_0x3de79e[_0x9f26('0xa4')]=0xb;_0x3de79e[_0x9f26('0xa5')]=_0x9f26('0x11e');_0x3de79e[_0x9f26('0xa6')]=moment()['format'](_0x9f26('0xf8'));_0x3de79e[_0x9f26('0x123')]=_0x3de79e[_0x9f26('0xa6')];_0x3de79e[_0x9f26('0x11b')]=_0x377209[_0x9f26('0x11b')];_0x3de79e[_0x9f26('0x11c')]=_0x377209[_0x9f26('0x11c')];this[_0x9f26('0xc6')](_0x3de79e)[_0x9f26('0xae')](loggerCatch(_0x9f26('0x124')));}}}}};Dialer[_0x9f26('0x17')][_0x9f26('0x125')]=function(_0x33023d){if(this[_0x9f26('0x22')][_0x33023d[_0x9f26('0xdc')]]){this[_0x9f26('0x22')][_0x33023d[_0x9f26('0xdc')]]['channel']=_0x33023d[_0x9f26('0xad')];}if(this[_0x9f26('0x24')][_0x33023d[_0x9f26('0xdc')]]){this[_0x9f26('0x24')][_0x33023d[_0x9f26('0xdc')]][_0x9f26('0xad')]=_0x33023d[_0x9f26('0xad')];}};Dialer[_0x9f26('0x17')][_0x9f26('0x37')]=function(_0x398950){if(strategy[this[_0x9f26('0x1c')][this[_0x9f26('0x22')][_0x398950[_0x9f26('0x126')]]['queue']][_0x9f26('0x127')]]===_0x9f26('0x128')){if(this['actions'][_0x398950['actionid']]&&_[_0x9f26('0xaa')](this[_0x9f26('0x22')][_0x398950[_0x9f26('0x126')]][_0x9f26('0x129')])&&_0x398950[_0x9f26('0xac')]==='1'&&_0x398950[_0x9f26('0x12a')]==='0'){if(this['agents'][_0x398950['stateinterface']]){if(!this[_0x9f26('0x1e')][_0x398950[_0x9f26('0x12b')]]['locked']){this[_0x9f26('0x1e')][_0x398950[_0x9f26('0x12b')]]['locked']=!![];this['actions'][_0x398950[_0x9f26('0x126')]][_0x9f26('0x129')]=!![];this[_0x9f26('0x22')][_0x398950[_0x9f26('0x126')]][_0x9f26('0x12b')]=_0x398950[_0x9f26('0x12b')];}}}}else if((strategy[this[_0x9f26('0x1c')][this[_0x9f26('0x22')][_0x398950[_0x9f26('0x126')]][_0x9f26('0xb0')]][_0x9f26('0x127')]]||_0x9f26('0x16'))===_0x9f26('0x16')){if(this[_0x9f26('0x22')][_0x398950[_0x9f26('0x126')]]){if(this[_0x9f26('0x1e')][_0x398950['stateinterface']]){this[_0x9f26('0x22')][_0x398950[_0x9f26('0x126')]][_0x9f26('0x12b')]=_0x398950[_0x9f26('0x12b')];if(_[_0x9f26('0xaa')](this[_0x9f26('0x28')][this[_0x9f26('0x22')][_0x398950[_0x9f26('0x126')]][_0x9f26('0xb0')]])){this[_0x9f26('0x28')][this[_0x9f26('0x22')][_0x398950['actionid']][_0x9f26('0xb0')]]=[];}this[_0x9f26('0x28')][this['actions'][_0x398950[_0x9f26('0x126')]][_0x9f26('0xb0')]][_0x9f26('0x12c')](_[_0x9f26('0x8c')](_[_0x9f26('0xce')](this[_0x9f26('0x22')][_0x398950['actionid']],[_0x9f26('0x12d'),_0x9f26('0x12b')]),{'status':_0x398950['status'],'paused':_0x398950[_0x9f26('0x12a')]}));}}}};function unlockQueueStatus(_0x4139a0,_0x233ce0){setTimeout(function(){if(_[_0x9f26('0x3c')](_0x4139a0[_0x9f26('0x12e')])){loggerBooked[_0x9f26('0x93')](_0x9f26('0x12f'),_0x233ce0);}_0x4139a0[_0x9f26('0x12e')]=!![];loggerBooked[_0x9f26('0x78')](_0x9f26('0x130'),_0x233ce0,JSON[_0x9f26('0x71')](_[_0x9f26('0xce')](_0x4139a0,[_0x9f26('0x3f'),_0x9f26('0x12e')])));},0x1f3);}Dialer['prototype'][_0x9f26('0x39')]=function(_0x212428){var _0x3f6591=this;var _0x39c3aa=_0x3f6591['voiceQueues'][_0x3f6591[_0x9f26('0x22')][_0x212428[_0x9f26('0x126')]][_0x9f26('0xb0')]];if(strategy[this[_0x9f26('0x1c')][this[_0x9f26('0x22')][_0x212428[_0x9f26('0x126')]][_0x9f26('0xb0')]]['strategy']]===_0x9f26('0x128')){if(this[_0x9f26('0x22')][_0x212428['actionid']]&&this['actions'][_0x212428[_0x9f26('0x126')]][_0x9f26('0x12b')]){this[_0x9f26('0x1b')][_0x9f26('0x131')](this[_0x9f26('0x22')][_0x212428['actionid']][_0x9f26('0x12d')],this[_0x9f26('0x22')][_0x212428[_0x9f26('0x126')]][_0x9f26('0x12b')])[_0x9f26('0xae')](function(_0x4ea38f){logger['error']('[Catch][Preview][syncQueueStatusComplete]',util[_0x9f26('0x94')](_0x4ea38f,{'showHidden':![],'depth':null}));})['finally'](function(){_0x3f6591[_0x9f26('0xaf')](_0x3f6591[_0x9f26('0x1c')][_0x3f6591['actions'][_0x212428[_0x9f26('0x126')]][_0x9f26('0xb0')]]);_0x3f6591[_0x9f26('0x1e')][_0x3f6591[_0x9f26('0x22')][_0x212428[_0x9f26('0x126')]]['stateinterface']][_0x9f26('0x129')]=![];delete _0x3f6591[_0x9f26('0x22')][_0x212428[_0x9f26('0x126')]];unlockQueueStatus(_0x39c3aa);});}else{this[_0x9f26('0xaf')](this['voiceQueues'][this[_0x9f26('0x22')][_0x212428[_0x9f26('0x126')]][_0x9f26('0xb0')]]);this[_0x9f26('0xbc')]({'active':![],'ContactId':this['actions'][_0x212428[_0x9f26('0x126')]][_0x9f26('0xcf')],'ListId':this[_0x9f26('0x22')][_0x212428[_0x9f26('0x126')]][_0x9f26('0xd0')],'VoiceQueueId':this[_0x9f26('0x22')][_0x212428[_0x9f26('0x126')]][_0x9f26('0xd1')]||undefined,'CampaignId':this[_0x9f26('0x22')][_0x212428[_0x9f26('0x126')]]['CampaignId']||undefined})['catch'](loggerCatch(_0x9f26('0x132')));delete this[_0x9f26('0x22')][_0x212428[_0x9f26('0x126')]];unlockQueueStatus(_0x39c3aa);}}else if((strategy[this[_0x9f26('0x1c')][this[_0x9f26('0x22')][_0x212428[_0x9f26('0x126')]]['queue']][_0x9f26('0x127')]]||_0x9f26('0x16'))===_0x9f26('0x16')){var _0x5adc60;if(this[_0x9f26('0x22')][_0x212428['actionid']]&&!_[_0x9f26('0x47')](this[_0x9f26('0x28')][this[_0x9f26('0x22')][_0x212428['actionid']]['queue']])){if(this['queueBookedRR'][_0x3f6591[_0x9f26('0x22')][_0x212428['actionid']][_0x9f26('0xb0')]]){this[_0x9f26('0x29')][_0x3f6591[_0x9f26('0x22')][_0x212428[_0x9f26('0x126')]][_0x9f26('0xb0')]]=this[_0x9f26('0x29')][this[_0x9f26('0x22')][_0x212428['actionid']][_0x9f26('0xb0')]]?this[_0x9f26('0x29')][this['actions'][_0x212428[_0x9f26('0x126')]][_0x9f26('0xb0')]]:this[_0x9f26('0x28')][this[_0x9f26('0x22')][_0x212428[_0x9f26('0x126')]][_0x9f26('0xb0')]]?this[_0x9f26('0x28')][this[_0x9f26('0x22')][_0x212428[_0x9f26('0x126')]][_0x9f26('0xb0')]][_0x9f26('0x133')]||0x0:0x0;}this[_0x9f26('0x28')][this['actions'][_0x212428['actionid']][_0x9f26('0xb0')]][_0x9f26('0x133')]=this[_0x9f26('0x29')][this[_0x9f26('0x22')][_0x212428[_0x9f26('0x126')]][_0x9f26('0xb0')]];for(var _0x21e01a=0x0;_0x21e01a<this[_0x9f26('0x28')][this[_0x9f26('0x22')][_0x212428['actionid']][_0x9f26('0xb0')]][_0x9f26('0x96')];_0x21e01a+=0x1){_0x5adc60=rr(this[_0x9f26('0x28')][this[_0x9f26('0x22')][_0x212428[_0x9f26('0x126')]][_0x9f26('0xb0')]]);this['queueBookedRR'][_0x3f6591['actions'][_0x212428['actionid']][_0x9f26('0xb0')]]=this[_0x9f26('0x28')][this[_0x9f26('0x22')][_0x212428[_0x9f26('0x126')]]['queue']]['_rr'];if(_0x5adc60[_0x9f26('0xac')]==='1'&&_0x5adc60[_0x9f26('0x12a')]==='0'){break;}}if(!_[_0x9f26('0xaa')](_0x5adc60)){this[_0x9f26('0x1e')][_0x5adc60['stateinterface']][_0x9f26('0x134')]=_[_0x9f26('0x3c')](this['agents'][_0x5adc60['stateinterface']][_0x9f26('0x134')])?!![]:this['agents'][_0x5adc60[_0x9f26('0x12b')]]['unlockRR'];}loggerBooked['info']('[booked][RR]',_0x212428[_0x9f26('0x126')],_0x9f26('0x135'),JSON[_0x9f26('0x71')](_[_0x9f26('0xce')](this['agents'][_0x5adc60[_0x9f26('0x12b')]],[_0x9f26('0x3f'),_0x9f26('0x134')])),'contactAgent-idHopper:\x20',JSON[_0x9f26('0x71')](_0x5adc60['idHopper']));if(!_[_0x9f26('0xaa')](_0x5adc60)&&_0x5adc60[_0x9f26('0xac')]==='1'&&_0x5adc60[_0x9f26('0x12a')]==='0'&&this[_0x9f26('0x1e')][_0x5adc60['stateinterface']]['unlockRR']){this[_0x9f26('0x1e')][_0x5adc60[_0x9f26('0x12b')]][_0x9f26('0x134')]=![];this[_0x9f26('0x28')][_0x3f6591[_0x9f26('0x22')][_0x212428[_0x9f26('0x126')]][_0x9f26('0xb0')]]=[];this['preview'][_0x9f26('0x131')](_0x5adc60[_0x9f26('0x12d')],_0x5adc60[_0x9f26('0x12b')])[_0x9f26('0xae')](function(_0x4d7964){logger[_0x9f26('0x93')](_0x9f26('0x136'),util[_0x9f26('0x94')](_0x4d7964,{'showHidden':![],'depth':null}));})[_0x9f26('0x1a')](function(){_0x3f6591[_0x9f26('0xaf')](_0x3f6591[_0x9f26('0x1c')][_0x3f6591[_0x9f26('0x22')][_0x212428['actionid']][_0x9f26('0xb0')]]);setTimeout(function(){_0x3f6591[_0x9f26('0x1e')][_0x5adc60[_0x9f26('0x12b')]]['unlockRR']=!![];loggerBooked['info'](_0x9f26('0x137'),_0x212428[_0x9f26('0x126')],_0x9f26('0x135'),JSON[_0x9f26('0x71')](_[_0x9f26('0xce')](_0x3f6591['agents'][_0x5adc60[_0x9f26('0x12b')]],[_0x9f26('0x3f'),_0x9f26('0x134')])),_0x9f26('0x138'),JSON['stringify'](_0x5adc60[_0x9f26('0x12d')]));},0xc7);delete _0x3f6591[_0x9f26('0x22')][_0x212428['actionid']];unlockQueueStatus(_0x39c3aa,_0x212428[_0x9f26('0x126')]);});}else{loggerBooked[_0x9f26('0x78')](_0x9f26('0x139'));this[_0x9f26('0xaf')](this[_0x9f26('0x1c')][this['actions'][_0x212428['actionid']][_0x9f26('0xb0')]]);this[_0x9f26('0xbc')]({'active':![],'ContactId':this[_0x9f26('0x22')][_0x212428['actionid']][_0x9f26('0xcf')],'ListId':this[_0x9f26('0x22')][_0x212428['actionid']][_0x9f26('0xd0')],'VoiceQueueId':this[_0x9f26('0x22')][_0x212428['actionid']][_0x9f26('0xd1')]||undefined,'CampaignId':this[_0x9f26('0x22')][_0x212428[_0x9f26('0x126')]]['CampaignId']||undefined})['catch'](loggerCatch(_0x9f26('0x132')));delete this[_0x9f26('0x22')][_0x212428['actionid']];unlockQueueStatus(_0x39c3aa);}}else{loggerBooked[_0x9f26('0x78')](_0x9f26('0x13a'));this[_0x9f26('0xaf')](this[_0x9f26('0x1c')][this[_0x9f26('0x22')][_0x212428[_0x9f26('0x126')]][_0x9f26('0xb0')]]);this[_0x9f26('0xbc')]({'active':![],'ContactId':this[_0x9f26('0x22')][_0x212428[_0x9f26('0x126')]][_0x9f26('0xcf')],'ListId':this[_0x9f26('0x22')][_0x212428[_0x9f26('0x126')]][_0x9f26('0xd0')],'VoiceQueueId':this[_0x9f26('0x22')][_0x212428[_0x9f26('0x126')]][_0x9f26('0xd1')]||undefined,'CampaignId':this[_0x9f26('0x22')][_0x212428[_0x9f26('0x126')]][_0x9f26('0xd2')]||undefined})[_0x9f26('0xae')](loggerCatch('[unlock2][syncQueueStatusComplete]'));delete this[_0x9f26('0x22')][_0x212428[_0x9f26('0x126')]];unlockQueueStatus(_0x39c3aa);}}else{loggerBooked['info'](_0x9f26('0x13b'));this[_0x9f26('0xaf')](this[_0x9f26('0x1c')][this[_0x9f26('0x22')][_0x212428['actionid']][_0x9f26('0xb0')]]);this[_0x9f26('0xbc')]({'active':![],'ContactId':this['actions'][_0x212428[_0x9f26('0x126')]][_0x9f26('0xcf')],'ListId':this[_0x9f26('0x22')][_0x212428[_0x9f26('0x126')]][_0x9f26('0xd0')],'VoiceQueueId':this[_0x9f26('0x22')][_0x212428['actionid']][_0x9f26('0xd1')]||undefined,'CampaignId':this[_0x9f26('0x22')][_0x212428[_0x9f26('0x126')]][_0x9f26('0xd2')]||undefined})[_0x9f26('0xae')](loggerCatch('[unlock3][syncQueueStatusComplete]'));delete this['actions'][_0x212428[_0x9f26('0x126')]];unlockQueueStatus(_0x39c3aa);}};Dialer['prototype'][_0x9f26('0x3a')]=function(){var _0x101830=this;setInterval(function(){_0x101830[_0x9f26('0x13c')]();},0x3e8);};Dialer[_0x9f26('0x17')]['checkIsTrunkReachable']=function(_0x477d87){var _0x36b16c=this;return function(){if(!_0x36b16c['isTrunkReachable'](_0x477d87['Trunk'])){if(!_0x36b16c[_0x9f26('0xd7')](_0x477d87['TrunkBackup'])){_0x477d87[_0x9f26('0x3d')]=_0x9f26('0x13d');throw _0x477d87['name']+_0x9f26('0x13e');}}};};Dialer[_0x9f26('0x17')][_0x9f26('0x13f')]=function(_0x2153d7,_0x2486ee,_0x48ac7a,_0x16a9e9){var _0x42a37e=this;return function(){var _0x37bffd=!![];return _0x42a37e['ifTime'](_0x2153d7,_0x2486ee,_0x48ac7a,_0x16a9e9,_0x37bffd);};};Dialer[_0x9f26('0x17')]['checkIfTimeIntervals']=function(_0x4390ed,_0x423fe1,_0x1fa9d7,_0x1f8687){var _0x532a63=this;return function(){var _0x42ee8f=![];return _0x532a63[_0x9f26('0x140')](_0x4390ed[_0x9f26('0x46')],_0x423fe1,_0x1fa9d7,_0x1f8687,_0x42ee8f);};};Dialer['prototype']['ifTime']=function(_0x2eb778,_0x5b233f,_0x4b8015,_0x4be60d,_0x2e71a5){var _0x55a87f=[];return new BPromise(function(_0x30daeb,_0x5362db){if(!isNotNull(_0x2eb778)){_0x4be60d[_0x9f26('0x3d')]=_0x9f26('0x44');return _0x5362db(msgResponse(_0x9f26('0x140'),_0x9f26('0x141'),_0x4b8015+_0x9f26('0x142')));}if(_[_0x9f26('0x47')](_0x2eb778)){_0x4be60d['message']='INTERVAL_IS_EMPTY';return _0x5362db(msgResponse(_0x9f26('0x140'),'Failure',_0x4b8015+_0x9f26('0x143')));}if(_0x5b233f&&_['isUndefined'](config[_0x9f26('0x144')][_0x5b233f])){_0x4be60d[_0x9f26('0x3d')]='TIMEZONE_UNKNOW';return _0x5362db(msgResponse(_0x9f26('0x140'),_0x9f26('0x141'),_0x4b8015+_0x9f26('0x145')+_0x5b233f));}if(_[_0x9f26('0x146')](_0x2eb778)){for(var _0x6a517d=0x0;_0x6a517d<_0x2eb778['length'];_0x6a517d+=0x1){_0x55a87f[_0x9f26('0x12c')](ami[_0x9f26('0xab')]({'action':_0x9f26('0x147'),'command':util['format'](_0x9f26('0x148'),_0x2eb778[_0x6a517d]['interval'],!_[_0x9f26('0x3c')](config['timezones'][_0x5b233f])?_0x5b233f:'')})['then'](function(_0x46617f){return _0x46617f[_0x9f26('0x149')][_0x9f26('0x14a')](_0x9f26('0x14b'))>=0x0;})['catch'](myreject(_0x5362db)));}}else{_0x55a87f[_0x9f26('0x12c')](ami['Action']({'action':_0x9f26('0x147'),'command':util[_0x9f26('0x72')](_0x9f26('0x148'),_0x2eb778,!_[_0x9f26('0x3c')](config[_0x9f26('0x144')][_0x5b233f])?_0x5b233f:'')})[_0x9f26('0xb4')](function(_0x2b372e){return _0x2b372e[_0x9f26('0x149')][_0x9f26('0x14a')](_0x9f26('0x14b'))>=0x0;})['catch'](myreject(_0x5362db)));}BPromise[_0x9f26('0x14c')](_0x55a87f)[_0x9f26('0xb4')](function(_0x48da6e){var _0x11075c=_[_0x9f26('0x14d')](_0x48da6e);if(_0x11075c){return _0x30daeb(_0x11075c);}else{_0x4be60d['message']=_0x2e71a5?'GLOBAL_INTERVAL_IS_OVERTIME':_0x9f26('0x14e');return _0x5362db(msgResponse(_0x9f26('0x14f'),_0x9f26('0x141'),_0x9f26('0x150')+_0x2e71a5+'\x20'+_0x4b8015+_0x9f26('0x151')+util[_0x9f26('0x94')](_0x2eb778,{'showHidden':![],'depth':null})+_0x9f26('0x152')+_0x5b233f));}})[_0x9f26('0xae')](function(_0x295d8b){return _0x5362db(msgResponse(_0x9f26('0x140'),'Failure',JSON[_0x9f26('0x71')](_0x295d8b)));});});};Dialer[_0x9f26('0x17')][_0x9f26('0x153')]=function(_0x36a5a5){var _0x3da9ed=this;return function(){switch(_0x36a5a5['dialMethod']){case _0x9f26('0x154'):freeVariablesPredictive(_0x36a5a5);_0x3da9ed[_0x9f26('0x155')](_0x36a5a5,0x1);break;case _0x9f26('0x156'):freeVariablesPredictive(_0x36a5a5);_0x3da9ed['handlePower'](_0x36a5a5,_0x36a5a5[_0x9f26('0x157')]);break;case _0x9f26('0x9'):_0x3da9ed[_0x9f26('0x9')](_0x36a5a5);break;case'booked':freeVariablesPredictive(_0x36a5a5);_0x3da9ed[_0x9f26('0x155')](_0x36a5a5,0x1);break;default:freeVariablesPredictive(_0x36a5a5);logger[_0x9f26('0x93')](_0x9f26('0x158'),_0x36a5a5[_0x9f26('0x3f')],_0x9f26('0x159'));}};};Dialer[_0x9f26('0x17')][_0x9f26('0x15a')]=function(_0x316602){var _0x169437=this;return function(){_0x169437[_0x9f26('0x15b')](_0x316602);};};Dialer[_0x9f26('0x17')][_0x9f26('0x33')]=function(_0x1c96aa){var _0x15c3a3=this;if(isNotPreview(_0x1c96aa[_0x9f26('0x58')])){if(isVoiceQueueOutbound(_0x1c96aa[_0x9f26('0x4d')])&&isActive(_0x1c96aa[_0x9f26('0x15c')])){_0x1c96aa[_0x9f26('0x9e')]=!![];BPromise['resolve']()[_0x9f26('0xb4')](checkIsLoggedIn(_0x1c96aa,_0x1c96aa[_0x9f26('0x15d')]))[_0x9f26('0xb4')](checkIsActive(_0x1c96aa,_0x1c96aa[_0x9f26('0x15c')]))[_0x9f26('0xb4')](checkInterval(_0x1c96aa))[_0x9f26('0xb4')](_0x15c3a3[_0x9f26('0x15e')](_0x1c96aa))[_0x9f26('0xb4')](_0x15c3a3[_0x9f26('0x13f')](_0x1c96aa[_0x9f26('0x15f')],_0x1c96aa[_0x9f26('0x160')],_0x1c96aa[_0x9f26('0x3f')],_0x1c96aa))[_0x9f26('0xb4')](_0x15c3a3['checkIfTimeIntervals'](_0x1c96aa['Interval'],_0x1c96aa[_0x9f26('0x160')],_0x1c96aa['name'],_0x1c96aa))[_0x9f26('0xb4')](_0x15c3a3[_0x9f26('0x153')](_0x1c96aa))[_0x9f26('0xae')](loggerCatchQueueSummary(_0x9f26('0x161'),_0x1c96aa));}else{notSendMessagesQueue(_0x1c96aa);}}else{freeVariablesPredictive(_0x1c96aa);}};Dialer[_0x9f26('0x17')][_0x9f26('0x13c')]=function(){var _0x439a95=this;var _0x1248a9;for(var _0x2b21b0 in this[_0x9f26('0x1d')]){if(typeof this[_0x9f26('0x1d')][_0x2b21b0]!==_0x9f26('0x97')){_0x1248a9=this['campaigns'][_0x2b21b0];if(isCampaignIvr(_0x1248a9[_0x9f26('0x4d')])&&isActive(_0x1248a9['active'])){_0x1248a9[_0x9f26('0x9e')]=!![];BPromise[_0x9f26('0xb3')]()[_0x9f26('0xb4')](checkIsActive(_0x1248a9,_0x1248a9[_0x9f26('0x6f')]))[_0x9f26('0xb4')](checkInterval(_0x1248a9))[_0x9f26('0xb4')](_0x439a95['checkIsTrunkReachable'](_0x1248a9))['then'](_0x439a95[_0x9f26('0x13f')](_0x1248a9['dialGlobalInterval'],_0x1248a9[_0x9f26('0x160')],_0x1248a9['name'],_0x1248a9))[_0x9f26('0xb4')](_0x439a95[_0x9f26('0x162')](_0x1248a9[_0x9f26('0x43')],_0x1248a9[_0x9f26('0x160')],_0x1248a9[_0x9f26('0x3f')],_0x1248a9))['then'](_0x439a95[_0x9f26('0x15a')](_0x1248a9))[_0x9f26('0xae')](loggerCatchQueueSummary(_0x9f26('0x163'),_0x1248a9));}else{notSendMessagesCampaign(_0x1248a9);}}}};function getCallerIdRandom(_0xbf7923,_0x3eefc1){var _0xe4e74;var _0x113aa5;var _0x67035f;if(_0x3eefc1<=0x0){_0x3eefc1=0x1;}_0xe4e74=new RegExp('\x5cw{0,'+_0x3eefc1+'}$');_0x113aa5=Math[_0x9f26('0x164')](0xa,_0x3eefc1-0x1);_0x67035f=Math['pow'](0xa,_0x3eefc1)-0x1;return util[_0x9f26('0x72')]('%s',_['replace'](_0xbf7923,_0xe4e74,_[_0x9f26('0x165')](_0x113aa5,_0x67035f)));}function extractCalleridName(_0x5eac2b){var _0x14976d=_0x5eac2b['match'](/"(.*?)"/);return _0x14976d?_0x14976d[0x1]:_0x5eac2b;}function extractCalleridNumber(_0x58922f){var _0x24011a=_0x58922f[_0x9f26('0x166')](/<(.*?)>/);return _0x24011a?_0x24011a[0x1]:_0x58922f;}Dialer['prototype'][_0x9f26('0x167')]=function(_0x4384a2,_0x4b2ed5){var _0x2320a8=this;var _0x6e3965=uuid['v4']();this['actions'][_0x6e3965]=new Action(_0x4384a2,_0x4b2ed5,_0x6e3965);return new BPromise(function(_0x3e5aae,_0x2b43c6){if(_[_0x9f26('0x3c')](_0x4384a2)&&typeof _0x4384a2!=='object'){return _0x2b43c6(msgResponse(_0x9f26('0x168'),_0x9f26('0x141'),_0x9f26('0x169')));}if(_[_0x9f26('0x3c')](_0x4b2ed5['Contact'][_0x9f26('0x16a')])||_0x4b2ed5['Contact'][_0x9f26('0x16a')]===null){return _0x2b43c6(msgResponse(_0x9f26('0x168'),'Failure',_0x9f26('0x16b')));}var _0x2f8921={'XMD-CALLERID':_0x2320a8[_0x9f26('0x22')][_0x6e3965][_0x9f26('0x16c')](),'XMD-AGI':_0x4384a2[_0x9f26('0x104')]?util[_0x9f26('0x72')](_0x9f26('0x16d'),ipAgi,_0x4384a2[_0x9f26('0x104')]):_0x9f26('0x16e'),'XMD-AGIAFTER':_0x4384a2[_0x9f26('0x10d')]?util[_0x9f26('0x72')]('\x22agi://%s/square,%s\x22',ipAgi,_0x4384a2[_0x9f26('0x10d')]):_0x9f26('0x16e'),'XMD-QUEUE':_0x4384a2[_0x9f26('0x4d')]===_0x9f26('0x4e')?util[_0x9f26('0x72')](_0x9f26('0x16f'),_0x4384a2['name'],_0x4384a2['dialQueueOptions']||'',_0x4384a2['dialAgiAfterHangupAgent']?'c':'',_0x4384a2[_0x9f26('0x170')]||0x3):_0x9f26('0x16e'),'XMD-CONTACTID':_0x4b2ed5[_0x9f26('0xcf')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x2320a8[_0x9f26('0x22')][_0x6e3965][_0x9f26('0x16c')](),'XMD-AMD':_0x4384a2[_0x9f26('0xe7')]?_0x9f26('0x171'):_0x9f26('0x16e'),'XMD-DESTINATION':_0x9f26('0xdf')};if(_0x4384a2['dialAMDActive']){_0x2f8921['XMD-AMDINITIALSILENCE']=_0x4384a2[_0x9f26('0x172')]||0x9c4;_0x2f8921[_0x9f26('0x173')]=_0x4384a2[_0x9f26('0x174')]||0x5dc;_0x2f8921[_0x9f26('0x175')]=_0x4384a2[_0x9f26('0x176')]||0x320;_0x2f8921[_0x9f26('0x177')]=_0x4384a2['dialAMDTotalAnalysisTime']||0x1388;_0x2f8921[_0x9f26('0x178')]=_0x4384a2[_0x9f26('0x179')]||0x64;_0x2f8921[_0x9f26('0x17a')]=_0x4384a2['dialAMDBetweenWordsSilence']||0x32;_0x2f8921[_0x9f26('0x17b')]=_0x4384a2[_0x9f26('0x17c')]||0x3;_0x2f8921['XMD-AMDSILENCETHRESHOLD']=_0x4384a2['dialAMDSilenceThreshold']||0x100;_0x2f8921['XMD-AMDMAXIMUMWORDLENGTH']=_0x4384a2[_0x9f26('0x17d')]||0x1388;}if(_0x4384a2[_0x9f26('0x4d')]===_0x9f26('0x4e')){_0x2f8921[_0x9f26('0x17e')]=_0x4b2ed5[_0x9f26('0xd1')];}else{_0x2f8921[_0x9f26('0x17f')]=_0x4b2ed5['CampaignId'];}for(var _0x5d49d9 in _0x4b2ed5[_0x9f26('0x180')]){if(typeof _0x4b2ed5[_0x9f26('0x180')][_0x5d49d9]!==_0x9f26('0x97')){if(isNotNull(_0x4b2ed5[_0x9f26('0x180')][_0x5d49d9])&&_0x5d49d9!=='id'&&_0x5d49d9!==_0x9f26('0x181')&&_0x5d49d9!=='createdAt'&&_0x5d49d9!==_0x9f26('0x182')){_0x2f8921[util[_0x9f26('0x72')](_0x9f26('0x183'),'XMD-',_['toUpper'](_0x5d49d9))]=_0x4b2ed5['Contact'][_0x5d49d9];}}}var _0x18016e=_0x2320a8['isTrunkReachable'](_0x4384a2[_0x9f26('0x6e')])?getCallerId(_0x4384a2['Trunk'][_0x9f26('0x70')],_0x4384a2[_0x9f26('0x59')],_0x4384a2[_0x9f26('0x184')]>0x0?getCallerIdRandom(_0x4384a2[_0x9f26('0x185')],_0x4384a2[_0x9f26('0x184')]):_0x4384a2[_0x9f26('0x185')]):getCallerId(_[_0x9f26('0xaa')](_0x4384a2[_0x9f26('0x186')])?_0x4384a2['Trunk'][_0x9f26('0x70')]:_0x4384a2[_0x9f26('0x186')][_0x9f26('0x70')],_0x4384a2[_0x9f26('0x59')],_0x4384a2[_0x9f26('0x184')]>0x0?getCallerIdRandom(_0x4384a2[_0x9f26('0x185')],_0x4384a2[_0x9f26('0x184')]):_0x4384a2[_0x9f26('0x185')]);if(_0x18016e){_0x2f8921[_0x9f26('0x187')]=_0x2320a8[_0x9f26('0x22')][_0x6e3965]['originatecalleridname']=extractCalleridName(_0x18016e);_0x2f8921[_0x9f26('0x188')]=_0x2320a8['actions'][_0x6e3965][_0x9f26('0x189')]=extractCalleridNumber(_0x18016e);}return ami[_0x9f26('0xab')]({'actionid':_0x6e3965,'action':_0x9f26('0x168'),'channel':_0x2320a8[_0x9f26('0xd7')](_0x4384a2[_0x9f26('0x6e')])?util[_0x9f26('0x72')]('SIP/%s/%s%s',_0x4384a2['Trunk'][_0x9f26('0x3f')],isNotNull(_0x4384a2['dialPrefix'])?_0x4384a2['dialPrefix'][_0x9f26('0x18a')]()||'':'',_0x4384a2['dialCutDigit']>0x0?_0x4b2ed5[_0x9f26('0x180')][_0x9f26('0x16a')]['substring'](_0x4384a2[_0x9f26('0x18b')]):_0x4b2ed5[_0x9f26('0x180')][_0x9f26('0x16a')]):util[_0x9f26('0x72')](_0x9f26('0x18c'),_[_0x9f26('0xaa')](_0x4384a2[_0x9f26('0x186')])?_0x4384a2[_0x9f26('0x6e')][_0x9f26('0x3f')]:_0x4384a2['TrunkBackup'][_0x9f26('0x3f')],isNotNull(_0x4384a2[_0x9f26('0x5a')])?_0x4384a2[_0x9f26('0x5a')][_0x9f26('0x18a')]()||'':'',_0x4384a2[_0x9f26('0x18b')]>0x0?_0x4b2ed5[_0x9f26('0x180')][_0x9f26('0x16a')]['substring'](_0x4384a2[_0x9f26('0x18b')]):_0x4b2ed5[_0x9f26('0x180')][_0x9f26('0x16a')]),'callerid':_0x18016e,'Exten':'xcally-motion-dialer','Context':_0x9f26('0x18d'),'Priority':'1','variable':_0x2f8921,'timeout':(_0x4384a2['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x6e3965})[_0x9f26('0xb4')](function(_0x169d70){return _0x3e5aae(_0x169d70);})[_0x9f26('0xae')](function(_0xd796ff){_0x4384a2[_0x9f26('0x18e')]+=0x1;var _0xe79558=new History(_0x2320a8[_0x9f26('0x22')][_0x6e3965]);logger[_0x9f26('0x93')](util[_0x9f26('0x72')]('[originateError]:\x20%s',JSON['stringify'](_0xd796ff)));_0xe79558[_0x9f26('0xa4')]=0xe;_0xe79558[_0x9f26('0xa5')]=_0x9f26('0x18f');_0xe79558[_0x9f26('0xa6')]=moment()[_0x9f26('0x72')](_0x9f26('0xf8'));_0xe79558[_0x9f26('0x123')]=_0xe79558[_0x9f26('0xa6')];_0x2320a8['createHistory'](_0xe79558)[_0x9f26('0xae')](loggerCatch(_0x9f26('0x190')));_0x2320a8[_0x9f26('0xda')](_0xe79558)[_0x9f26('0xae')](loggerCatch('[originate][error]'))[_0x9f26('0x1a')](function(){delete _0x2320a8[_0x9f26('0x22')][_0x6e3965];return _0x2b43c6(msgResponse(_0x9f26('0x168'),_0x9f26('0x48'),'originate\x20action\x20Error'));});});});};Dialer[_0x9f26('0x17')][_0x9f26('0x30')]=function(_0x195393){var _0x1d54dd=this['actions'][_0x195393[_0x9f26('0x126')]];if(_0x1d54dd){delete this[_0x9f26('0x22')][_0x195393[_0x9f26('0x126')]];_0x1d54dd[_0x9f26('0x115')]=moment()[_0x9f26('0x72')]('YYYY-MM-DD\x20HH:mm:ss');var _0x3fa235=_0x1d54dd[_0x9f26('0x4d')]==='ivr'?this[_0x9f26('0x1d')][_0x1d54dd['queue']]:this[_0x9f26('0x1c')][_0x1d54dd['getQueue']()];if(!this[_0x9f26('0xd5')](_0x195393[_0x9f26('0x191')])){this[_0x9f26('0xaf')](_0x3fa235);return this[_0x9f26('0x192')](_0x1d54dd,_0x3fa235,_0x195393)['catch'](loggerCatch(_0x9f26('0x193')));}this[_0x9f26('0x24')][_0x195393[_0x9f26('0xdc')]]=_0x1d54dd;}};Dialer[_0x9f26('0x17')][_0x9f26('0x194')]=function(_0x51b88a,_0x331fc4,_0x290b11){var _0x101621=new History(_0x331fc4);if(_0x101621[_0x9f26('0xed')]+_0x101621[_0x9f26('0xfe')]+_0x101621[_0x9f26('0xff')]+_0x101621[_0x9f26('0xee')]+_0x101621[_0x9f26('0xef')]+_0x101621[_0x9f26('0x11f')]+_0x101621['countmachineretry']+_0x101621['countagentrejectretry']>=_0x290b11[_0x9f26('0xf1')]-0x1){return!![];}switch(_0x51b88a){case 0x3:if(_0x101621[_0x9f26('0xff')]>=_0x290b11[_0x9f26('0x195')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x101621[_0x9f26('0xff')]+=0x1,'scheduledat':moment()['add'](_0x290b11[_0x9f26('0x196')],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x101621['ContactId'],'ListId':_0x101621[_0x9f26('0xd0')],'VoiceQueueId':_0x101621['VoiceQueueId']||undefined,'CampaignId':_0x101621[_0x9f26('0xd2')]||undefined})[_0x9f26('0xae')](loggerCatch(_0x9f26('0x197')));break;case 0x5:if(_0x101621[_0x9f26('0xed')]>=_0x290b11[_0x9f26('0x198')]-0x1){return!![];}this[_0x9f26('0xbc')]({'active':![],'countbusyretry':_0x101621[_0x9f26('0xed')]+=0x1,'scheduledat':moment()[_0x9f26('0xf6')](_0x290b11[_0x9f26('0x199')],'minutes')['format'](_0x9f26('0xf8')),'ContactId':_0x101621[_0x9f26('0xcf')],'ListId':_0x101621[_0x9f26('0xd0')],'VoiceQueueId':_0x101621['VoiceQueueId']||undefined,'CampaignId':_0x101621['CampaignId']||undefined})['catch'](loggerCatch(_0x9f26('0x19a')));break;case 0x8:if(_0x101621[_0x9f26('0xfe')]>=_0x290b11[_0x9f26('0x19b')]-0x1){return!![];}this[_0x9f26('0xbc')]({'active':![],'countcongestionretry':_0x101621['countcongestionretry']+=0x1,'scheduledat':moment()[_0x9f26('0xf6')](_0x290b11[_0x9f26('0x19c')],_0x9f26('0xf7'))[_0x9f26('0x72')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x101621['ContactId'],'ListId':_0x101621[_0x9f26('0xd0')],'VoiceQueueId':_0x101621[_0x9f26('0xd1')]||undefined,'CampaignId':_0x101621[_0x9f26('0xd2')]||undefined})['catch'](loggerCatch(_0x9f26('0x19d')));break;case 0x0:if(_0x101621['countnosuchnumberretry']>=_0x290b11[_0x9f26('0x19e')]-0x1){return!![];}else{this[_0x9f26('0xbc')]({'active':![],'countnosuchnumberretry':_0x101621['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0x9f26('0xf6')](_0x290b11[_0x9f26('0x19f')],_0x9f26('0xf7'))[_0x9f26('0x72')](_0x9f26('0xf8')),'ContactId':_0x101621['ContactId'],'ListId':_0x101621[_0x9f26('0xd0')],'VoiceQueueId':_0x101621[_0x9f26('0xd1')]||undefined,'CampaignId':_0x101621[_0x9f26('0xd2')]||undefined})[_0x9f26('0xae')](loggerCatch(_0x9f26('0x1a0')));}break;case 0xa:if(_0x101621['countdropretry']>=_0x290b11[_0x9f26('0x118')]-0x1){return!![];}this[_0x9f26('0xbc')]({'active':![],'countdropretry':_0x101621[_0x9f26('0xef')]+=0x1,'scheduledat':moment()[_0x9f26('0xf6')](_0x290b11[_0x9f26('0x119')],_0x9f26('0xf7'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x101621[_0x9f26('0xcf')],'ListId':_0x101621['ListId'],'VoiceQueueId':_0x101621[_0x9f26('0xd1')]||undefined,'CampaignId':_0x101621[_0x9f26('0xd2')]||undefined})[_0x9f26('0xae')](loggerCatch(_0x9f26('0x11a')));break;case 0xb:if(_0x101621['countabandonedretry']>=_0x290b11['dialAbandonedMaxRetry']-0x1){return!![];}this[_0x9f26('0xbc')]({'active':![],'countabandonedretry':_0x101621[_0x9f26('0x11f')]+=0x1,'scheduledat':moment()[_0x9f26('0xf6')](_0x290b11[_0x9f26('0x121')],_0x9f26('0xf7'))[_0x9f26('0x72')](_0x9f26('0xf8')),'ContactId':_0x101621[_0x9f26('0xcf')],'ListId':_0x101621[_0x9f26('0xd0')],'VoiceQueueId':_0x101621[_0x9f26('0xd1')]||undefined,'CampaignId':_0x101621[_0x9f26('0xd2')]||undefined})[_0x9f26('0xae')](loggerCatch(_0x9f26('0x122')));break;case 0x13:if(_0x101621[_0x9f26('0xea')]>=_0x290b11[_0x9f26('0xf4')]-0x1){return!![];}this[_0x9f26('0xbc')]({'active':![],'countmachineretry':_0x101621[_0x9f26('0xea')]+=0x1,'scheduledat':moment()[_0x9f26('0xf6')](_0x290b11[_0x9f26('0x100')],_0x9f26('0xf7'))[_0x9f26('0x72')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x101621[_0x9f26('0xcf')],'ListId':_0x101621['ListId'],'VoiceQueueId':_0x101621[_0x9f26('0xd1')]||undefined,'CampaignId':_0x101621[_0x9f26('0xd2')]||undefined})[_0x9f26('0xae')](loggerCatch(_0x9f26('0x101')));break;case 0x14:if(_0x101621[_0x9f26('0xf0')]>=_0x290b11[_0x9f26('0x1a1')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countagentrejectretry':_0x101621[_0x9f26('0xf0')]+=0x1,'scheduledat':moment()[_0x9f26('0xf6')](_0x290b11[_0x9f26('0x1a2')],'minutes')[_0x9f26('0x72')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x101621['ContactId'],'ListId':_0x101621[_0x9f26('0xd0')],'VoiceQueueId':_0x101621[_0x9f26('0xd1')]||undefined,'CampaignId':_0x101621[_0x9f26('0xd2')]||undefined})[_0x9f26('0xae')](loggerCatch(_0x9f26('0x1a3')));break;default:return!![];}};Dialer[_0x9f26('0x17')][_0x9f26('0x192')]=function(_0x186ab2,_0x361597,_0x354db1){var _0x445b4b=this;var _0x471d17=new History(_0x186ab2);return new BPromise(function(_0x31c066,_0x50e7e9){if(_[_0x9f26('0x3c')](_0x361597)&&typeof _0x361597!==_0x9f26('0x1a4')){return _0x50e7e9(msgResponse(_0x9f26('0x1a5'),_0x9f26('0x141'),_0x9f26('0x1a6')));}if(_['isUndefined'](_0x354db1)&&typeof _0x354db1!==_0x9f26('0x1a4')){return _0x50e7e9(msgResponse('[callProgressDetecting]',_0x9f26('0x141'),'evt\x20is\x20undefine'));}switch(_0x354db1[_0x9f26('0x10a')]){case'0':_0x361597[_0x9f26('0x62')]+=0x1;_0x471d17[_0x9f26('0xa4')]=0x0;_0x471d17[_0x9f26('0xa5')]='NoSuchNumber';_0x471d17['countnosuchnumberretry']+=0x1;_0x471d17[_0x9f26('0xeb')]+=0x1;ami[_0x9f26('0x4c')](_0x9f26('0x1a7'),ut['buildObj'](_0x186ab2,_0x9f26('0x1a8')));_0x445b4b['createHistory'](_0x471d17)[_0x9f26('0xae')](loggerCatch(_0x9f26('0xec')));if(_0x445b4b['checkRetriveMax'](0x0,_0x186ab2,_0x361597)){if(_0x471d17[_0x9f26('0xee')]>=_0x361597['dialNoSuchNumberMaxRetry']){_0x445b4b[_0x9f26('0x1a9')](_0x471d17,_0x31c066,_0x50e7e9,_0x9f26('0x1aa'));}else{_0x445b4b['stateGlobal'](_0x471d17,_0x31c066,_0x50e7e9,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x361597[_0x9f26('0x1ab')]+=0x1;_0x471d17['state']=0x3;_0x471d17['statedesc']=_0x9f26('0x1ac');_0x471d17['countnoanswerretry']+=0x1;_0x471d17[_0x9f26('0xeb')]+=0x1;ami['emit'](_0x9f26('0x1ad'),ut[_0x9f26('0xe3')](_0x186ab2,_0x9f26('0x1ae')));_0x445b4b[_0x9f26('0xc6')](_0x471d17)[_0x9f26('0xae')](loggerCatch(_0x9f26('0x1af')));if(_0x445b4b[_0x9f26('0x194')](0x3,_0x186ab2,_0x361597)){if(_0x471d17[_0x9f26('0xff')]>=_0x361597[_0x9f26('0x195')]){_0x445b4b[_0x9f26('0x1a9')](_0x471d17,_0x31c066,_0x50e7e9,'reason\x203\x20ringing\x20no\x20answer');}else{_0x445b4b[_0x9f26('0xf2')](_0x471d17,_0x31c066,_0x50e7e9,_0x9f26('0x1b0'));}}break;case'5':_0x361597[_0x9f26('0x1b1')]+=0x1;_0x471d17['state']=0x5;_0x471d17['statedesc']='Busy';_0x471d17['countbusyretry']+=0x1;_0x471d17['countglobal']+=0x1;ami[_0x9f26('0x4c')]('custom:agentbusy',ut[_0x9f26('0xe3')](_0x186ab2,'busy'));_0x445b4b[_0x9f26('0xc6')](_0x471d17)[_0x9f26('0xae')](loggerCatch(_0x9f26('0x1b2')));if(_0x445b4b[_0x9f26('0x194')](0x5,_0x186ab2,_0x361597)){if(_0x471d17['countbusyretry']>=_0x361597[_0x9f26('0x198')]){_0x445b4b['createStateFinal'](_0x471d17,_0x31c066,_0x50e7e9,'reason\x205\x20busy');}else{_0x445b4b['stateGlobal'](_0x471d17,_0x31c066,_0x50e7e9,_0x9f26('0x1b3'));}}break;case'8':_0x361597['outboundCongestionCallsDay']+=0x1;_0x471d17['state']=0x8;_0x471d17[_0x9f26('0xa5')]=_0x9f26('0x1b4');_0x471d17[_0x9f26('0xfe')]+=0x1;_0x471d17[_0x9f26('0xeb')]+=0x1;ami['emit'](_0x9f26('0x1b5'),ut[_0x9f26('0xe3')](_0x186ab2,_0x9f26('0x1b6')));_0x445b4b[_0x9f26('0xc6')](_0x471d17)['catch'](loggerCatch(_0x9f26('0x1b7')));if(_0x445b4b[_0x9f26('0x194')](0x8,_0x186ab2,_0x361597)){if(_0x471d17[_0x9f26('0xfe')]>=_0x361597[_0x9f26('0x19b')]){_0x445b4b[_0x9f26('0x1a9')](_0x471d17,_0x31c066,_0x50e7e9,_0x9f26('0x1b8'));}else{_0x445b4b['stateGlobal'](_0x471d17,_0x31c066,_0x50e7e9,'reason\x208\x20congestion');}}break;case'11':_0x361597[_0x9f26('0x1b9')]+=0x1;_0x471d17[_0x9f26('0xa4')]=0xb;_0x471d17[_0x9f26('0xa5')]=_0x9f26('0x11e');_0x471d17[_0x9f26('0x11f')]+=0x1;_0x471d17['countglobal']+=0x1;_0x445b4b[_0x9f26('0xc6')](_0x471d17)[_0x9f26('0xae')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x445b4b[_0x9f26('0x194')](0xb,_0x186ab2,_0x361597)){if(_0x471d17[_0x9f26('0x11f')]>=_0x361597[_0x9f26('0x120')]){_0x445b4b[_0x9f26('0x1a9')](_0x471d17,_0x31c066,_0x50e7e9,'reason\x2011\x20abandoned');}else{_0x445b4b[_0x9f26('0xf2')](_0x471d17,_0x31c066,_0x50e7e9,'reason\x2011\x20abandoned');}}break;case'20':_0x361597[_0x9f26('0x1ba')]+=0x1;_0x471d17[_0x9f26('0xa4')]=0x14;_0x471d17[_0x9f26('0xa5')]=_0x9f26('0x1bb');_0x471d17[_0x9f26('0xf0')]+=0x1;_0x471d17[_0x9f26('0xeb')]+=0x1;ami['emit']('custom:agentreject',ut['buildObj'](_0x186ab2,'agentreject'));_0x445b4b[_0x9f26('0xc6')](_0x471d17)[_0x9f26('0xae')](loggerCatch(_0x9f26('0x1bc')));if(_0x445b4b['checkRetriveMax'](0x14,_0x186ab2,_0x361597)){if(_0x471d17[_0x9f26('0xf0')]>=_0x361597[_0x9f26('0x1a1')]){_0x445b4b['createStateFinal'](_0x471d17,_0x31c066,_0x50e7e9,_0x9f26('0x1bd'));}else{_0x445b4b[_0x9f26('0xf2')](_0x471d17,_0x31c066,_0x50e7e9,'reason\x2020\x20agentreject');}}break;default:_0x361597['outboundUnknownCallsDay']+=0x1;_0x471d17[_0x9f26('0xa4')]=0xc;_0x471d17[_0x9f26('0xa5')]=_0x354db1[_0x9f26('0x10a')];_0x445b4b[_0x9f26('0xc6')](_0x471d17)[_0x9f26('0xae')](loggerCatch(_0x9f26('0x1be')));if(_0x445b4b[_0x9f26('0x194')](_0x354db1[_0x9f26('0x10a')],_0x186ab2,_0x361597)){if(_0x471d17['countbusyretry']+_0x471d17[_0x9f26('0xfe')]+_0x471d17[_0x9f26('0xff')]+_0x471d17['countnosuchnumberretry']+_0x471d17[_0x9f26('0xef')]+_0x471d17[_0x9f26('0x11f')]+_0x471d17['countmachineretry']+_0x471d17[_0x9f26('0xf0')]>=_0x361597[_0x9f26('0xf1')]){_0x445b4b[_0x9f26('0xf2')](_0x471d17,_0x31c066,_0x50e7e9,_0x354db1[_0x9f26('0x10a')]);}else{_0x445b4b[_0x9f26('0x1a9')](_0x471d17,_0x31c066,_0x50e7e9,_0x354db1[_0x9f26('0x10a')]);}}}});};Dialer[_0x9f26('0x17')][_0x9f26('0xf2')]=function(_0x2b54af,_0x444b82,_0x45ed31,_0x31ebfa){var _0x140772=new Final(_0x2b54af);_0x140772[_0x9f26('0xa4')]=0xf;_0x140772['statedesc']='Global';this[_0x9f26('0x1a9')](_0x140772,_0x444b82,_0x45ed31,_0x31ebfa);};Dialer[_0x9f26('0x17')][_0x9f26('0x1a9')]=function(_0x585555,_0x2caaba,_0x28d71e,_0x2b8ea3){this['moveContactManagedDialer'](_0x585555)[_0x9f26('0xb4')](function(){return _0x2caaba(msgResponse('[callProgressDetecting]',_0x9f26('0xd6'),_0x2b8ea3));})[_0x9f26('0xae')](function(){return _0x28d71e(msgResponse(_0x9f26('0x1bf'),'Failure',_0x9f26('0x1c0')));});};Dialer[_0x9f26('0x17')]['predictive']=function(_0x2d8c83){var _0x14352e=_0x2d8c83['dialPredictiveOptimizationPercentage']/0x64;var _0x1e05da=_0x2d8c83[_0x9f26('0x61')]/(_0x2d8c83[_0x9f26('0x61')]+_0x2d8c83['outboundAnswerCallsDay']);var _0x35e79f=Math[_0x9f26('0x1c1')](_0x2d8c83[_0x9f26('0x68')]*(_0x2d8c83[_0x9f26('0x1c2')]/0x64));var _0x536484=Math[_0x9f26('0x1c1')](_0x2d8c83[_0x9f26('0x68')]*(_0x2d8c83[_0x9f26('0x1c3')]/0x64));var _0x2b1379=_0x2d8c83['available']+_0x2d8c83[_0x9f26('0x53')];var _0x43e879=Math[_0x9f26('0x1c4')](_0x2d8c83[_0x9f26('0x6b')]*_0x2d8c83['erlangAbandonmentRate']*_0x2d8c83[_0x9f26('0x1c5')]*_0x2d8c83['predictiveIntervalMultiplicativeFactor']);if(_[_0x9f26('0x3c')](_0x2d8c83['startProgressive'])){if(!_[_0x9f26('0x3c')](_0x2d8c83[_0x9f26('0x26')])){_0x2d8c83[_0x9f26('0x26')]=undefined;loggerPredictive[_0x9f26('0x93')](_0x9f26('0x1c6'),_0x9f26('0x1c7'));}if(!_['isUndefined'](_0x2d8c83['handlePredictive'])){loggerPredictive[_0x9f26('0x93')](_0x9f26('0x1c6'),_0x9f26('0x1c8'));clearInterval(_0x2d8c83['handlePredictive']);_0x2d8c83[_0x9f26('0x8f')]=undefined;}_0x2d8c83[_0x9f26('0x6d')]=moment()[_0x9f26('0x72')](_0x9f26('0xf8'));loggerPredictive[_0x9f26('0x78')](_0x2d8c83[_0x9f26('0x3f')],_0x9f26('0x1c9'),_0x2d8c83['startProgressive']);this[_0x9f26('0x155')](_0x2d8c83,0x1);}else if(ifInterval(_0x2d8c83[_0x9f26('0x1ca')],_0x2d8c83['startProgressive'])){this[_0x9f26('0x155')](_0x2d8c83,0x1);loggerPredictiveCalls['info'](_0x9f26('0x1cb'),_0x2d8c83[_0x9f26('0x6d')],_0x2d8c83[_0x9f26('0x3f')]);_0x2d8c83[_0x9f26('0x6b')]=0x0;_0x2d8c83[_0x9f26('0x1cc')]=0x0;}else if(_0x14352e<_0x1e05da&&_0x2d8c83['dialPredictiveOptimization']===_0x9f26('0x1cd')){freeVariablesPredictive(_0x2d8c83);loggerPredictive['info']('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0x9f26('0x1ce'),_0x1e05da,'startProgressive',_0x2d8c83[_0x9f26('0x3f')]);}else if(_0x43e879<_0x2d8c83[_0x9f26('0x1cc')]&&_0x2d8c83[_0x9f26('0x1cf')]===_0x9f26('0x1cd')){freeVariablesPredictive(_0x2d8c83);loggerPredictive[_0x9f26('0x78')](_0x9f26('0x1d0'),_0x9f26('0x1d1'),_0x43e879,_0x9f26('0x1d2'),_0x2d8c83[_0x9f26('0x1cc')],_0x9f26('0x6d'),_0x2d8c83[_0x9f26('0x3f')]);}else if(!ifInterval(_0x2d8c83[_0x9f26('0x1ca')],_0x2d8c83[_0x9f26('0x6d')])&&_[_0x9f26('0x3c')](_0x2d8c83['startPredictive'])&&!_[_0x9f26('0x3c')](_0x2d8c83[_0x9f26('0x6d')])){_0x2d8c83['startPredictive']=moment()[_0x9f26('0x72')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x9f26('0x78')](_0x2d8c83[_0x9f26('0x3f')],_0x9f26('0x1d3'),_0x2d8c83[_0x9f26('0x26')]);this['averageHandleTime'](_0x2d8c83[_0x9f26('0x1ca')])[_0x9f26('0xb4')](this['getDataPredictive'](_0x2d8c83))['then'](mergeDataErlangB(_0x2d8c83))['then'](this[_0x9f26('0x1d4')](_0x2d8c83))[_0x9f26('0xae')](loggerCatchPredictive(_0x9f26('0x1d5'),_0x2d8c83));}else if(!ifInterval(_0x2d8c83['dialPredictiveInterval'],_0x2d8c83[_0x9f26('0x26')])){_0x2d8c83[_0x9f26('0x1cc')]=0x0;_0x2d8c83[_0x9f26('0x26')]=moment()['format'](_0x9f26('0xf8'));loggerPredictive[_0x9f26('0x78')](_0x2d8c83[_0x9f26('0x3f')],_0x9f26('0x1d6'),_0x2d8c83[_0x9f26('0x26')]);clearInterval(_0x2d8c83['handlePredictive']);_0x2d8c83[_0x9f26('0x8f')]=undefined;this['averageHandleTime'](_0x2d8c83[_0x9f26('0x1ca')])[_0x9f26('0xb4')](this[_0x9f26('0x1d7')](_0x2d8c83))['then'](mergeDataErlangB(_0x2d8c83))[_0x9f26('0xb4')](this['startMethodPredictive'](_0x2d8c83))[_0x9f26('0xae')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x2d8c83));}else if(_0x2d8c83[_0x9f26('0x68')]&&_0x2b1379<_0x2d8c83[_0x9f26('0x68')]-_0x536484){freeVariablesPredictive(_0x2d8c83);loggerPredictive[_0x9f26('0x78')](_0x2d8c83[_0x9f26('0x3f')],_0x9f26('0x1d8'),_0x2b1379,_0x9f26('0x1d9'),_0x2d8c83[_0x9f26('0x68')],'-',_0x536484,'=',_0x2d8c83[_0x9f26('0x68')]-_0x536484,')');}else if(_0x2d8c83['predictiveIntervalAvailable']&&_0x2b1379>_0x2d8c83[_0x9f26('0x68')]+_0x35e79f){freeVariablesPredictive(_0x2d8c83);loggerPredictive[_0x9f26('0x78')](_0x2d8c83[_0x9f26('0x3f')],_0x9f26('0x1d8'),_0x2b1379,')\x20are\x20more\x20than\x20threshold\x20(',_0x2d8c83['predictiveIntervalAvailable'],'+',_0x35e79f,'=',_0x2d8c83[_0x9f26('0x68')]+_0x35e79f,')');}};Dialer['prototype'][_0x9f26('0x1d7')]=function(_0x459674){var _0x11f2b6=this;return function(_0x2a530b){return new BPromise(function(_0x83403b,_0xd53a60){_[_0x9f26('0x8c')](_0x459674,_0x2a530b[0x0]);if(checkGetDataPredictive(_0x2a530b[0x0])){var _0x43fad6=_0x459674[_0x9f26('0x68')]=_0x459674[_0x9f26('0x53')]+_0x459674[_0x9f26('0x50')];var _0x435636=_0x459674['dialPredictiveInterval']*0x3c;var _0x56bc54=_0x2a530b[0x0][_0x9f26('0x65')]+_0x2a530b[0x0][_0x9f26('0x64')];var _0x18e429=(_0x2a530b[0x0][_0x9f26('0x63')]+_0x2a530b[0x0][_0x9f26('0x7d')]+_0x2a530b[0x0][_0x9f26('0x7f')])/_0x2a530b[0x0]['predictiveIntervalTotalCalls'];_0x459674[_0x9f26('0x1c5')]=_0x18e429>0x0?_0x18e429:0x1;switch(_0x459674[_0x9f26('0x1cf')]){case _0x9f26('0x1cd'):var _0x106ff6=_0x459674[_0x9f26('0x1da')]/0x64;return _0x11f2b6[_0x9f26('0x1db')](_0x43fad6,_0x435636,_0x56bc54,_0x18e429,_0x106ff6)[_0x9f26('0xb4')](function(_0x408bfd){return _0x83403b(_0x408bfd);});case _0x9f26('0x1dc'):var _0x5016df=_0x459674[_0x9f26('0x1da')]/0x64;return _0x11f2b6[_0x9f26('0x1dd')](_0x43fad6,_0x435636,_0x56bc54,_0x18e429,_0x5016df)[_0x9f26('0xb4')](function(_0x52e7f6){return _0x83403b(_0x52e7f6);});default:return _0xd53a60(msgResponse(_0x9f26('0x1de'),_0x9f26('0x141'),_0x9f26('0x1df')));}}else{return _0xd53a60(msgResponse('[getDataPredictive]',_0x9f26('0x141'),_0x9f26('0x1e0')));}});};};Dialer['prototype'][_0x9f26('0x1e1')]=function(_0x57b309){var _0xa43f8=this;return function(_0x468f37){return new BPromise(function(_0x5245ed,_0x591466){_[_0x9f26('0x8c')](_0x57b309,_0x468f37[0x0]);if(checkGetDataPredictive(_0x468f37[0x0])){loggerPredictive[_0x9f26('0x78')](JSON[_0x9f26('0x71')](_0x468f37[0x0]));if(_0x57b309[_0x9f26('0x1cf')]===_0x9f26('0x1cd')){return _0xa43f8[_0x9f26('0xc3')](_0x57b309['id'])[_0x9f26('0xb4')](function(_0x2bb08c){var _0x2b1b3c=_0x57b309[_0x9f26('0x15d')]-_0x2bb08c[0x0][_0x9f26('0x1e2')];var _0x58027b=_0x57b309[_0x9f26('0x1ca')]*0x3c;var _0x2180bb=_0x468f37[0x0][_0x9f26('0x65')]+_0x468f37[0x0][_0x9f26('0x64')];var _0x9c6545=(_0x468f37[0x0][_0x9f26('0x63')]+_0x468f37[0x0][_0x9f26('0x7d')]+_0x468f37[0x0][_0x9f26('0x7f')])/_0x468f37[0x0][_0x9f26('0x69')];var _0x5cda53=_0x57b309[_0x9f26('0x1da')]/0x64;_0x57b309[_0x9f26('0x67')]=_0x2bb08c[0x0][_0x9f26('0x1e2')]||0x0;_0x57b309[_0x9f26('0x1c5')]=_0x9c6545>0x0?_0x9c6545:0x1;return _0xa43f8[_0x9f26('0x1db')](_0x2b1b3c,_0x58027b,_0x2180bb,_0x9c6545,_0x5cda53);})[_0x9f26('0xb4')](function(_0x4d46e0){return _0x5245ed(_0x4d46e0);})[_0x9f26('0xae')](function(_0x22ad54){return _0x591466(msgResponse(_0x9f26('0x1e3'),'Failure',JSON[_0x9f26('0x71')](_0x22ad54)));});}if(_0x57b309[_0x9f26('0x1cf')]===_0x9f26('0x1dc')){return _0xa43f8[_0x9f26('0xc3')](_0x57b309['id'])[_0x9f26('0xb4')](function(_0x5c0e45){var _0x7e1986=_0x57b309[_0x9f26('0x15d')]-_0x5c0e45[0x0][_0x9f26('0x1e2')];var _0x3929d2=_0x57b309['dialPredictiveInterval']*0x3c;var _0x30dd81=_0x468f37[0x0][_0x9f26('0x65')]+_0x468f37[0x0]['predictiveIntervalAvgHoldtime'];var _0x42e979=(_0x468f37[0x0]['predictiveIntervalAnsweredCalls']+_0x468f37[0x0][_0x9f26('0x7d')]+_0x468f37[0x0][_0x9f26('0x7f')])/_0x468f37[0x0]['predictiveIntervalTotalCalls'];var _0x37d2cb=_0x57b309['dialPredictiveOptimizationPercentage']/0x64;_0x57b309[_0x9f26('0x67')]=_0x5c0e45[0x0][_0x9f26('0x1e2')]||0x0;_0x57b309['predictiveIntervalHitRate']=_0x42e979>0x0?_0x42e979:0x1;return _0xa43f8[_0x9f26('0x1dd')](_0x7e1986,_0x3929d2,_0x30dd81,_0x42e979,_0x37d2cb);})[_0x9f26('0xb4')](function(_0x316161){return _0x5245ed(_0x316161);})[_0x9f26('0xae')](function(_0x1c98e2){return _0x591466(msgResponse('[CatchErlangB]',_0x9f26('0x141'),JSON[_0x9f26('0x71')](_0x1c98e2)));});}}else{return _0x591466(msgResponse(_0x9f26('0x1de'),_0x9f26('0x141'),_0x9f26('0x1e0')));}});};};Dialer['prototype'][_0x9f26('0x1d4')]=function(_0x14e013){var _0x46d6cd=this;return function(){var _0x5a583f=0x0;var _0x53f25d=Math[_0x9f26('0x1c4')](_0x14e013[_0x9f26('0x88')]*0x3e8);if(_0x53f25d>0x0){_0x53f25d=_0x53f25d<0x64?0x64:_0x53f25d;loggerPredictive['info'](_0x14e013[_0x9f26('0x3f')],_0x9f26('0x1e4'),_0x53f25d,'milliseconds');_0x14e013[_0x9f26('0x8f')]=setInterval(function(){_0x46d6cd[_0x9f26('0x8f')](_0x14e013);loggerPredictiveCalls['info'](_0x9f26('0x1e5'),_0x5a583f+=0x1);},_0x53f25d);}else{loggerPredictive[_0x9f26('0x78')](_0x14e013[_0x9f26('0x3f')],_0x9f26('0x1e6'));}};};Dialer[_0x9f26('0x17')][_0x9f26('0x1e7')]=function(_0x1ed402,_0x69a3ca){var _0x2bc132=this;return function(_0x37f41a){if(_[_0x9f26('0x47')](_0x37f41a)){if(_[_0x9f26('0xaa')](_0x69a3ca['UserId'])||!_0x69a3ca['recallme']){if(_0x1ed402[_0x9f26('0x58')]===_0x9f26('0x8')){_0x1ed402['queueStatusComplete']=_['isUndefined'](_0x1ed402[_0x9f26('0x12e')])?!![]:_0x1ed402[_0x9f26('0x12e')];var _0x4d768e=uuid['v4']();_0x2bc132[_0x9f26('0x22')][_0x4d768e]=new Action(_0x1ed402,_0x69a3ca,_0x4d768e);loggerBooked[_0x9f26('0x78')]('[booked][checkContactBlack]',_0x4d768e,'queueStatusComplete:\x20',JSON[_0x9f26('0x71')](_0x1ed402['queueStatusComplete']),'Queue:\x20',_0x1ed402['name']);if(_0x1ed402[_0x9f26('0x12e')]){_0x1ed402['queueStatusComplete']=![];_0x2bc132[_0x9f26('0x28')][_0x2bc132[_0x9f26('0x22')][_0x4d768e][_0x9f26('0xb0')]]=[];ami['Action']({'actionid':_0x4d768e,'action':_0x9f26('0x1e8'),'queue':_0x1ed402[_0x9f26('0x3f')]})['catch'](function(){_0x2bc132[_0x9f26('0xaf')](_0x1ed402);_0x2bc132[_0x9f26('0xbc')]({'active':![],'ContactId':_0x2bc132['actions'][_0x4d768e][_0x9f26('0xcf')],'ListId':_0x2bc132[_0x9f26('0x22')][_0x4d768e][_0x9f26('0xd0')],'VoiceQueueId':_0x2bc132[_0x9f26('0x22')][_0x4d768e]['VoiceQueueId']||undefined,'CampaignId':_0x2bc132[_0x9f26('0x22')][_0x4d768e][_0x9f26('0xd2')]||undefined})[_0x9f26('0xae')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x2bc132[_0x9f26('0x22')][_0x4d768e];});}else{loggerBooked[_0x9f26('0x78')](_0x9f26('0x1e9'),JSON['stringify'](_0x1ed402['queueStatusComplete']),_0x9f26('0x1ea'),_0x1ed402[_0x9f26('0x3f')]);_0x2bc132[_0x9f26('0xaf')](_0x1ed402);_0x2bc132['rescheduleContact']({'active':![],'ContactId':_0x2bc132[_0x9f26('0x22')][_0x4d768e][_0x9f26('0xcf')],'ListId':_0x2bc132['actions'][_0x4d768e]['ListId'],'VoiceQueueId':_0x2bc132['actions'][_0x4d768e][_0x9f26('0xd1')]||undefined,'CampaignId':_0x2bc132[_0x9f26('0x22')][_0x4d768e][_0x9f26('0xd2')]||undefined})[_0x9f26('0xae')](loggerCatch(_0x9f26('0x1eb')));delete _0x2bc132[_0x9f26('0x22')][_0x4d768e];}}else{return _0x2bc132[_0x9f26('0x167')](_0x1ed402,_0x69a3ca);}}else{if(getDiff(_0x69a3ca['scheduledat'])<_0x1ed402[_0x9f26('0x1ec')]*0x3c){if(_0x69a3ca[_0x9f26('0x1ed')]&&!_0x69a3ca[_0x9f26('0x1ed')]['voicePause']){_0x2bc132[_0x9f26('0x1b')][_0x9f26('0x131')](_0x69a3ca['id'])['finally'](function(){_0x2bc132[_0x9f26('0xaf')](_0x1ed402);});}else{_0x2bc132[_0x9f26('0xbe')]({'active':![]},_0x69a3ca['id'],0x1)[_0x9f26('0x1a')](function(){_0x2bc132['updateOriginated'](_0x1ed402);});}}else{_0x1ed402[_0x9f26('0x1ee')]+=0x1;_0x2bc132[_0x9f26('0xaf')](_0x1ed402);if(_0x1ed402['dialRecallInQueue']){_0x2bc132[_0x9f26('0xbc')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x69a3ca[_0x9f26('0xcf')],'ListId':_0x69a3ca[_0x9f26('0xd0')],'VoiceQueueId':_0x69a3ca['VoiceQueueId']||undefined,'CampaignId':_0x69a3ca[_0x9f26('0xd2')]||undefined})[_0x9f26('0xae')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x2bc132[_0x9f26('0xc6')](createObjHistory(_0x1ed402,_0x69a3ca,_0x9f26('0x1ef'),0x17,'RecallInQueue'))['catch'](loggerCatch(_0x9f26('0x1f0')));}else{_0x2bc132[_0x9f26('0xcd')](createObjHistory(_0x1ed402,_0x69a3ca,_0x9f26('0x1f1'),0x16,_0x9f26('0x1f2')),_0x9f26('0x1f3'),_0x9f26('0x1f4'));}}}}else{_0x1ed402[_0x9f26('0x5d')]+=0x1;_0x2bc132[_0x9f26('0xcd')](createObjHistory(_0x1ed402,_0x69a3ca,_0x9f26('0x1f5'),0xd,'Blacklist'),_0x9f26('0x1f6'),_0x9f26('0x1f7'));throw _0x9f26('0x1f8');}};};Dialer[_0x9f26('0x17')]['handleIvr']=function(_0x3c7288){var _0x2897bf=this;var _0x46f946=_0x3c7288[_0x9f26('0x1f9')]-_0x3c7288['originated']-_0x3c7288['temp'];emitCampaignSummary(_0x3c7288);if(_0x46f946>0x0){if(_0x46f946>this[_0x9f26('0x20')]){_0x46f946=this[_0x9f26('0x20')];}_0x3c7288[_0x9f26('0x1fa')]+=_0x46f946;this['getContactDialerIvr'](_0x3c7288['id'],_0x46f946,_0x3c7288[_0x9f26('0x1fb')])[_0x9f26('0xb4')](function(_0x3e46d6){_0x3c7288[_0x9f26('0x1fa')]-=_0x46f946;_0x3c7288[_0x9f26('0x1fa')]=_0x3c7288['temp']>0x0?_0x3c7288[_0x9f26('0x1fa')]:0x0;if(!checkContactEmpty(_0x3e46d6)){_0x3c7288[_0x9f26('0x3d')]=_0x9f26('0x9d');logger[_0x9f26('0x78')](_0x9f26('0x1fc')+_0x3c7288[_0x9f26('0x3f')]);}else{_0x3c7288[_0x9f26('0x6a')]+=_0x3e46d6[_0x9f26('0x96')];_0x3c7288[_0x9f26('0x3d')]=_0x9f26('0x1fd');for(var _0x4ab1c0=0x0;_0x4ab1c0<_0x3e46d6[_0x9f26('0x96')];_0x4ab1c0+=0x1){_0x3c7288[_0x9f26('0x1fe')]+=0x1;if(_[_0x9f26('0xaa')](_0x3e46d6[_0x4ab1c0])||_[_0x9f26('0xaa')](_0x3e46d6[_0x4ab1c0][_0x9f26('0x180')])||_['isNil'](_0x3e46d6[_0x4ab1c0][_0x9f26('0x180')][_0x9f26('0x16a')])){_0x2897bf[_0x9f26('0xcb')](_0x9f26('0x1ff'),_0x3c7288,_0x3e46d6[_0x4ab1c0]);}else{_0x2897bf['checkIsBlackListIvr'](_['pick'](_0x3e46d6[_0x4ab1c0],[_0x9f26('0xd2'),_0x9f26('0x200')]))[_0x9f26('0xb4')](_0x2897bf[_0x9f26('0x1e7')](_0x3c7288,_0x3e46d6[_0x4ab1c0]))[_0x9f26('0xae')](_0x2897bf[_0x9f26('0xca')](_0x9f26('0x201'),_0x3c7288));}}}})[_0x9f26('0xae')](loggerGetContactDialer('[getContactCampaign2]',_0x3c7288,_0x46f946));}};Dialer[_0x9f26('0x17')]['handlePower']=function(_0x9a5d14,_0x105262){var _0x57686f=this;var _0x353deb=[];var _0x7176d8=_0x105262>=0x1?_0x105262:0x1;if(_0x9a5d14[_0x9f26('0x58')]===_0x9f26('0x8')){_0x7176d8=0x1;}var _0x258154=Math[_0x9f26('0x1c4')](_0x9a5d14[_0x9f26('0x50')]*_0x7176d8)-_0x9a5d14[_0x9f26('0x6a')]-_0x9a5d14[_0x9f26('0x1fa')];emitVoiceQueueSummary(_0x9a5d14);if(_0x9a5d14[_0x9f26('0x202')]>0x0){var _0x139377=_0x9a5d14['dialLimitQueue']-_0x9a5d14[_0x9f26('0x6a')]-_0x9a5d14[_0x9f26('0x53')]-_0x9a5d14[_0x9f26('0x1fa')]-_0x9a5d14['pTalking'];if(_0x258154>_0x139377){_0x258154=_0x139377;}}if(_0x258154>0x0){if(_0x9a5d14['dialMethod']===_0x9f26('0x8')){_0x258154=0x1;}if(_0x258154>this[_0x9f26('0x20')]){_0x258154=this['maxNumberOriginate'];}_0x9a5d14[_0x9f26('0x1fa')]+=_0x258154;for(var _0x1ce7fd in this[_0x9f26('0x1e')]){if(typeof this[_0x9f26('0x1e')][_0x1ce7fd]!=='undefined'){if(this[_0x9f26('0x1e')][_0x1ce7fd][_0x9f26('0xa4')]===_0x9f26('0x203')&&this[_0x9f26('0x1e')][_0x1ce7fd][_0x9f26('0xac')]===_0x9f26('0xd8')){_0x353deb[_0x9f26('0x12c')](this['agents'][_0x1ce7fd]['id']);}}}this['getContactDialer'](_0x9a5d14['id'],_0x353deb,_0x258154,_0x9a5d14[_0x9f26('0x1fb')])[_0x9f26('0xb4')](function(_0x6059e4){_0x9a5d14[_0x9f26('0x1fa')]-=_0x258154;_0x9a5d14['temp']=_0x9a5d14['temp']>0x0?_0x9a5d14[_0x9f26('0x1fa')]:0x0;if(!checkContactEmpty(_0x6059e4)){_0x57686f['countReScheduled'](_0x9a5d14)[_0x9f26('0xb4')](sendMessageReschedule(_0x9a5d14))[_0x9f26('0xae')](loggerCatch('[countReScheduled]\x20'));}else{_0x9a5d14[_0x9f26('0x6a')]+=_0x6059e4[_0x9f26('0x96')];_0x9a5d14[_0x9f26('0x3d')]=_0x9a5d14['dialMethod']==='booked'?'ACTIVE':_0x9f26('0x1fd');for(var _0x12b9a2=0x0;_0x12b9a2<_0x6059e4[_0x9f26('0x96')];_0x12b9a2+=0x1){if(_[_0x9f26('0xaa')](_0x6059e4[_0x12b9a2])||_[_0x9f26('0xaa')](_0x6059e4[_0x12b9a2][_0x9f26('0x180')])||_[_0x9f26('0xaa')](_0x6059e4[_0x12b9a2][_0x9f26('0x180')]['phone'])){_0x57686f['emptyContact'](_0x9f26('0x1ff'),_0x9a5d14,_0x6059e4[_0x12b9a2]);}else{_0x57686f['checkIsBlackList'](_[_0x9f26('0xce')](_0x6059e4[_0x12b9a2],[_0x9f26('0xd1'),_0x9f26('0x200')]))[_0x9f26('0xb4')](_0x57686f[_0x9f26('0x1e7')](_0x9a5d14,_0x6059e4[_0x12b9a2]))[_0x9f26('0xae')](_0x57686f[_0x9f26('0xca')](_0x9f26('0x1ff'),_0x9a5d14));}}}})[_0x9f26('0xae')](loggerGetContactDialer(_0x9f26('0x204'),_0x9a5d14,_0x258154));}};Dialer[_0x9f26('0x17')][_0x9f26('0x8f')]=function(_0x4fc3d0){if(_0x4fc3d0['dialLimitQueue']>0x0){var _0x384d2a=_0x4fc3d0[_0x9f26('0x202')]-_0x4fc3d0[_0x9f26('0x6a')]-_0x4fc3d0['talking'];if(_0x384d2a>0x0){this[_0x9f26('0x205')](_0x4fc3d0);}else{loggerPredictiveCalls[_0x9f26('0x78')](_0x9f26('0x206'));}}else{this['tryOriginatePredictive'](_0x4fc3d0);}};Dialer[_0x9f26('0x17')]['tryOriginatePredictive']=function(_0xea68d4){var _0x19b8e7=this;var _0x41f1a9=[];_0xea68d4[_0x9f26('0x6a')]+=0x1;for(var _0x5d1c2a in this['agents']){if(typeof this[_0x9f26('0x1e')][_0x5d1c2a]!=='undefined'){if(this['agents'][_0x5d1c2a][_0x9f26('0xa4')]===_0x9f26('0x203')&&this[_0x9f26('0x1e')][_0x5d1c2a][_0x9f26('0xac')]===_0x9f26('0xd8')){_0x41f1a9[_0x9f26('0x12c')](this[_0x9f26('0x1e')][_0x5d1c2a]['id']);}}}this[_0x9f26('0xc0')](_0xea68d4['id'],_0x41f1a9,0x1,_0xea68d4[_0x9f26('0x1fb')])[_0x9f26('0xb4')](function(_0x144dba){if(!checkContactEmpty(_0x144dba)){checkContactLowerLimitOriginate(_0xea68d4,0x1,0x0);_0x19b8e7['countReScheduled'](_0xea68d4)['then'](sendMessageReschedule(_0xea68d4))[_0x9f26('0xae')](loggerCatch(_0x9f26('0x207')));}else{_0xea68d4[_0x9f26('0x3d')]='RUNNING';if(_['isNil'](_0x144dba[0x0])||_[_0x9f26('0xaa')](_0x144dba[0x0][_0x9f26('0x180')])||_['isNil'](_0x144dba[0x0][_0x9f26('0x180')]['phone'])){_0x19b8e7[_0x9f26('0xcb')](_0x9f26('0x1ff'),_0xea68d4,_0x144dba[0x0]);}else{_0x19b8e7[_0x9f26('0xb5')](_['pick'](_0x144dba[0x0],[_0x9f26('0xd1'),'Contact.phone']))['then'](_0x19b8e7[_0x9f26('0x1e7')](_0xea68d4,_0x144dba[0x0]))[_0x9f26('0xae')](_0x19b8e7[_0x9f26('0xca')]('[actionOriginatePredictive]\x20',_0xea68d4));}}})[_0x9f26('0xae')](loggerGetContactDialer(_0x9f26('0x208'),_0xea68d4,0x1));emitVoiceQueueSummary(_0xea68d4);};Dialer[_0x9f26('0x17')][_0x9f26('0x1db')]=function(_0x1912a0,_0x353d90,_0x284608,_0x2fd144,_0x149597,_0x5a8fe6){loggerPredictive[_0x9f26('0x78')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0x9f26('0x78')](_0x9f26('0x209'),_0x1912a0);loggerPredictive['info']('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x353d90);loggerPredictive['info']('Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x284608);loggerPredictive['info']('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',_0x2fd144);loggerPredictive[_0x9f26('0x78')](_0x9f26('0x20a'),_0x149597);loggerPredictive['info']('---------------------------');return new BPromise(function(_0x44bb17,_0x56f392){if(_0x1912a0<=0x0||isNaN(_0x1912a0)){return _0x56f392(msgResponse(_0x9f26('0x20b'),_0x9f26('0x48'),_0x9f26('0x20c')+_0x1912a0));}if(_0x284608<=0x0||isNaN(_0x284608)){return _0x56f392(msgResponse(_0x9f26('0x20b'),_0x9f26('0x48'),_0x9f26('0x20d')+_0x284608));}if(_0x2fd144<=0x0||isNaN(_0x2fd144)){return _0x56f392(msgResponse(_0x9f26('0x20b'),'Error',_0x9f26('0x20e')+_0x2fd144));}if(_0x353d90<=0x0||isNaN(_0x353d90)){return _0x56f392(msgResponse(_0x9f26('0x20b'),'Error','interval\x20=\x20'+_0x353d90));}if(_0x149597<=0x0||isNaN(_0x149597)){return _0x56f392(msgResponse(_0x9f26('0x20b'),'Error',_0x9f26('0x20f')+_0x149597));}_0x5a8fe6=_0x5a8fe6||0x0;var _0x47c1bc=0x1/_0x284608;var _0x4b33ad=0x0;var _0x3b735f=0x0;var _0x218864=0x0;var _0x78367=0x0;for(var _0xf2d440=0x0;_0x218864<_0x149597;_0xf2d440+=0x1){_0x3b735f=_0xf2d440/_0x353d90;_0x4b33ad=(_0x2fd144*_0x3b735f+_0x5a8fe6)/_0x47c1bc;_0x218864=erlangb(_0x4b33ad,_0x1912a0);_0x78367=_0x4b33ad/_0x1912a0*(0x1-erlangb(_0x4b33ad,_0x1912a0));}return _0x44bb17({'erlangCalls':_0xf2d440,'erlangCallToSecond':_0x353d90/_0xf2d440,'erlangAbandonmentRate':_0x218864,'erlangBusyFactor':_0x78367});});};Dialer['prototype']['busyFactor']=function(_0x23a4a7,_0xa228fa,_0x3fb66d,_0x2fd88c,_0x36cd69,_0x30a3e2){loggerPredictive['info'](_0x9f26('0x210'));loggerPredictive[_0x9f26('0x78')]('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',_0x23a4a7);loggerPredictive[_0x9f26('0x78')](_0x9f26('0x211'),_0xa228fa);loggerPredictive[_0x9f26('0x78')](_0x9f26('0x212'),_0x3fb66d);loggerPredictive[_0x9f26('0x78')](_0x9f26('0x213'),_0x2fd88c);loggerPredictive['info'](_0x9f26('0x214'),_0x36cd69);loggerPredictive[_0x9f26('0x78')](_0x9f26('0x82'));return new BPromise(function(_0x571a00,_0x482b7c){if(_0x23a4a7<=0x0||isNaN(_0x23a4a7)){return _0x482b7c(msgResponse('[busyFactor]',_0x9f26('0x48'),_0x9f26('0x20c')+_0x23a4a7));}if(_0x3fb66d<=0x0||isNaN(_0x3fb66d)){return _0x482b7c(msgResponse('[busyFactor]',_0x9f26('0x48'),_0x9f26('0x20d')+_0x3fb66d));}if(_0x2fd88c<=0x0||isNaN(_0x2fd88c)){return _0x482b7c(msgResponse('[busyFactor]','Error',_0x9f26('0x20e')+_0x2fd88c));}if(_0xa228fa<=0x0||isNaN(_0xa228fa)){return _0x482b7c(msgResponse(_0x9f26('0x215'),'Error','interval\x20=\x20'+_0xa228fa));}if(_0x36cd69<=0x0||isNaN(_0x36cd69)){return _0x482b7c(msgResponse(_0x9f26('0x215'),_0x9f26('0x48'),_0x9f26('0x216')+_0x36cd69));}_0x30a3e2=_0x30a3e2||0x0;var _0x440b51=0x1/_0x3fb66d;var _0x4c33c8=0x0;var _0x2c5450=0x0;var _0x5daae4=0x0;var _0x22e7a9=0x0;for(var _0x2f95d1=0x0;_0x22e7a9<_0x36cd69;_0x2f95d1+=0x1){_0x2c5450=_0x2f95d1/_0xa228fa;_0x4c33c8=(_0x2fd88c*_0x2c5450+_0x30a3e2)/_0x440b51;_0x5daae4=erlangb(_0x4c33c8,_0x23a4a7);_0x22e7a9=_0x4c33c8/_0x23a4a7*(0x1-erlangb(_0x4c33c8,_0x23a4a7));}return _0x571a00({'erlangCalls':_0x2f95d1,'erlangCallToSecond':_0xa228fa/_0x2f95d1,'erlangAbandonmentRate':_0x5daae4,'erlangBusyFactor':_0x22e7a9});});};module['exports']=Dialer;