40d1d75e424b247153188ee072d6505832f3aa0a
[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 _0x9c44=['status','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','countReScheduled','[countReScheduled]\x20','checkIsBlackList','resolve','then','[checkIsBlackList]\x20','[swapAdditionalPhone]\x20','averageHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','emptyContact','pick','ContactId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','isTrunkReachable','SIP/%s','reachable','unmonitored','saveInDb','uniqueid','variable','amdstatus','exten','dialAMDActive','value','statedesc','HangupInAMD','membername','AMD','buildObj','amd','[syncHangupInAMD]','MACHINE','countglobal','custom:amd','[syncAgentComplete][createHistory][0]','countcongestionretry','countdropretry','countabandonedretry','countmachineretry','dialGlobalMaxRetry','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','HANGUP','[syncHangupInAMDIvr]','Machine','countnoanswerretry','countnosuchnumberretry','countagentrejectretry','stateGlobal','ListId','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','AnswerAGI','AGI','dialQueueProject','outboundUnknownCallsDay','cause-txt','Unknow','syncAgentComplete','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','Drop','dropreason','TIMEOUT','dialDropRetryFrequency','callAdditionalPhoneAfterMin','verifyAdditionalPhones','voiceQueue','additional','dialDropMaxRetry','add','[rescheduleContact][Drop]','endtime','calleridname','swapAdditionalPhones','Abandoned','CALLEREXIT','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','calleridnum','[syncAgentComplete][createHistory][11]','actionid','paused','stateinterface','locked','queueBooked','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','contactAgent-idHopper:\x20','[booked][RR][finaly]','Agent:\x20','[booked][unlock]','[unlock2][syncQueueStatusComplete]','resetActiveCalls','syncCampaigns','TRUNK_IS_NOT_REACHABLE','ifTime','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','Failure','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','push','command','iftime\x20%s,%s','interval','content','indexOf','true','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','power','dialPowerLevel','method\x20not\x20recognized','launchHandleIvr','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','[syncQueueSummary]','syncQueueSummaryComplete','throttle','dialPreviewRecallmeReminder','filter','map','Agent','user:%s','user:dialPreviewRecallReminder','checkIfTime','[syncCampaigns]','pow','random','match','actionOriginate','object','voiceQueue\x20is\x20undefine','phone','originate','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueTimeout','ACTIVE','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','Contact','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','TrunkBackup','callerid','XMD-ORIGINATECALLERIDNAME','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','dialOriginateTimeout','[originateError]:\x20%s','[originate][error]','originate\x20action\x20Error','syncOriginateResponse','response','[callProgressDetecting]\x20','checkRetriveMax','countbusyretry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','[rescheduleContact][AgentReject]','callProgressDetecting','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','noanswer','dialNoAnswerRetryFrequency','reason\x203\x20ringing\x20no\x20answer','Busy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','dialAgentRejectRetryFrequency','agentreject','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','[callProgressDetecting]','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','predictiveIntervalHitRate','handlePredictive','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dialPredictiveOptimization','Max\x20Drop\x20','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','one\x20call\x20every:','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','voicePause','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','handleIvr','limitCalls','dialOrderByScheduledAt','AVAILABLE_CONTACTS_FINISHED','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','checkIsBlackListIvr','Contact.phone','loggerHandler','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','p\x20=\x20','Amax\x20=\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Ts\x20=\x20','interval\x20=\x20','Umin\x20=\x20','exports','bluebird','uuid','moment','md5','ioredis','../preview/util/util','dialer','booked','../../../config/logger','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','socket.io-emitter','../rpc/cmHopperHistory','../rpc/cmHopperFinal','../rpc/voiceQueueRt','../rpc/setting','./history','./final','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','tail','finally','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','queueBookedRR','bind','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','custom:queuesummary','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','previewRecallmeReminderInterval','isUndefined','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','message','NOT_ACTIVE','\x20NOT\x20Active','INTERVAL_IS_NULL','Intervals','\x20INTERVAL_IS_NULL','isEmpty','Interval','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','emit','type','outbound','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangAbandonmentRate','startProgressive','Trunk','active','format','voice:queue:%s','voice_queue:save','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','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','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','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','merge','clearing\x20variable\x20start\x20predictive','clearing\x20variable\x20handle\x20predictive','preview','ivr','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','debug','inspect','error','stack','length','undefined','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','IS_DISACTIVED','state','starttime','clearZombieChannels','[actions]','enqueue','isNil','Action'];(function(_0x2e9d2c,_0x2e97ad){var _0x233caa=function(_0x44a814){while(--_0x44a814){_0x2e9d2c['push'](_0x2e9d2c['shift']());}};_0x233caa(++_0x2e97ad);}(_0x9c44,0x178));var _0x49c4=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x9c44[_0x1969a7];return _0x3d665f;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require(_0x49c4('0x0'));var uuid=require(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var rr=require('rr');var md5=require(_0x49c4('0x3'));var Redis=require(_0x49c4('0x4'));var ut=require(_0x49c4('0x5'));var config=require('../../../config/environment/');var logger=require('../../../config/logger')(_0x49c4('0x6'));var loggerBooked=require('../../../config/logger')(_0x49c4('0x7'));var loggerPredictive=require(_0x49c4('0x8'))(_0x49c4('0x9'));var loggerPredictiveCalls=require(_0x49c4('0x8'))(_0x49c4('0xa'));var loggerSyncQueueSummary=require('../../../config/logger')(_0x49c4('0xb'));var ami=require(_0x49c4('0xc'));config[_0x49c4('0xd')]=_[_0x49c4('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x49c4('0xf'))(new Redis(config[_0x49c4('0xd')]));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0x49c4('0x10'));var cmHopperFinal=require(_0x49c4('0x11'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x49c4('0x12'));var RpcSetting=require(_0x49c4('0x13'));var Action=require('./action');var History=require(_0x49c4('0x14'));var Final=require(_0x49c4('0x15'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0x49c4('0x16'));var Hangup=require(_0x49c4('0x17'));var ipAgi=process[_0x49c4('0x18')][_0x49c4('0x19')]||_0x49c4('0x1a');var strategy={'rrmemory':_0x49c4('0x1b'),'roundrobin':_0x49c4('0x1c')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x49c4('0x1d')]['enqueue']=function(_0x3acd06){this[_0x49c4('0x1e')]=this[_0x49c4('0x1e')]?this[_0x49c4('0x1e')][_0x49c4('0x1f')](_0x3acd06):_0x3acd06();};function Dialer(_0x53e3a2,_0x44e607){this[_0x49c4('0x20')]=new Sequence();this['preview']=_0x44e607;this['voiceQueues']=_0x53e3a2[_0x49c4('0x21')];this[_0x49c4('0x22')]=_0x53e3a2[_0x49c4('0x22')];this['agents']=_0x53e3a2[_0x49c4('0x23')];this['trunks']=_0x53e3a2[_0x49c4('0x24')];this[_0x49c4('0x25')]=config[_0x49c4('0x25')]||0x2;this[_0x49c4('0x26')]={};this[_0x49c4('0x27')]={};this[_0x49c4('0x28')]={};this[_0x49c4('0x29')]={};this[_0x49c4('0x2a')]={};this[_0x49c4('0x2b')]={};this['startProgressive']={};this['ivrOriginated']={};this['queueBooked']={};this[_0x49c4('0x2c')]={};ami['on']('agentconnect',this['syncAgentConnect'][_0x49c4('0x2d')](this));ami['on'](_0x49c4('0x2e'),this[_0x49c4('0x2f')][_0x49c4('0x2d')](this));ami['on']('originateresponse',this['syncOriginateResponse'][_0x49c4('0x2d')](this));ami['on'](_0x49c4('0x30'),this['syncAgentComplete'][_0x49c4('0x2d')](this));ami['on'](_0x49c4('0x31'),this[_0x49c4('0xb')][_0x49c4('0x2d')](this));ami['on']('custom:queuesummarycomplete',this['syncQueueSummaryComplete'][_0x49c4('0x2d')](this));ami['on']('hangup',this[_0x49c4('0x32')][_0x49c4('0x2d')](this));ami['on'](_0x49c4('0x33'),this[_0x49c4('0x34')]['bind'](this));ami['on'](_0x49c4('0x35'),this[_0x49c4('0x36')][_0x49c4('0x2d')](this));ami['on'](_0x49c4('0x37'),this[_0x49c4('0x38')][_0x49c4('0x2d')](this));ami['on'](_0x49c4('0x39'),this[_0x49c4('0x3a')][_0x49c4('0x2d')](this));this[_0x49c4('0x3b')]();this[_0x49c4('0x3c')]();RpcSetting['getSettings']()['then'](function(_0x59eb84){previewRecallmeReminderInterval=_0x59eb84[_0x49c4('0x3d')];});}function isNotNull(_0x7ee704){return _0x7ee704!==null&&!_[_0x49c4('0x3e')](_0x7ee704);}function checkIsLoggedIn(_0x27e467,_0x28eb47){return function(){if(_0x28eb47<=0x0){_0x27e467['message']=_0x49c4('0x3f');throw _0x27e467[_0x49c4('0x40')]+_0x49c4('0x41');}};}function isActive(_0x24bba9){return _0x24bba9;}function checkIsActive(_0x58e252,_0x57a29c){return function(){if(!isActive(_0x57a29c)){_0x58e252[_0x49c4('0x42')]=_0x49c4('0x43');throw _0x58e252[_0x49c4('0x40')]+_0x49c4('0x44');}};}function checkInterval(_0xd38540){return function(){if(!isNotNull(_0xd38540['Interval'])){_0xd38540[_0x49c4('0x42')]=_0x49c4('0x45');throw _0xd38540[_0x49c4('0x40')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0xd38540['Interval'][_0x49c4('0x46')])){_0xd38540[_0x49c4('0x42')]=_0x49c4('0x45');throw _0xd38540[_0x49c4('0x40')]+_0x49c4('0x47');}if(!isNotNull(_[_0x49c4('0x48')](_0xd38540[_0x49c4('0x49')][_0x49c4('0x46')]))){_0xd38540[_0x49c4('0x42')]='INTERVAL_IS_NULL';throw _0xd38540[_0x49c4('0x40')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0xdda586,_0x349791,_0x2625a6){return{'action':_0xdda586,'response':_0x349791,'message':_0x2625a6,'stack':_0x2625a6};}function myreject(_0x1c2830){return function(_0x4ed4f8){return _0x1c2830(msgResponse(_0x49c4('0x4a'),_0x49c4('0x4b'),JSON[_0x49c4('0x4c')](_0x4ed4f8)));};}function getSeconds(_0x4e913a,_0x3b4feb){var _0x21d8c7=moment(_0x4e913a)[_0x49c4('0x4d')](0x0);var _0x5e5366=moment(_0x3b4feb)[_0x49c4('0x4d')](0x0);return _0x21d8c7[_0x49c4('0x4e')](_0x5e5366,_0x49c4('0x4f'));}function emit(_0x2ba76a,_0x70e552,_0x2f1105){io['to'](_0x2ba76a)[_0x49c4('0x50')](_0x70e552,_0x2f1105);}function emitVoiceQueueSummary(_0x4e0663){if(_0x4e0663[_0x49c4('0x51')]===_0x49c4('0x52')){var _0x32b172={'id':_0x4e0663['id'],'name':_0x4e0663[_0x49c4('0x40')],'strategy':_0x4e0663[_0x49c4('0x53')],'answered':_0x4e0663[_0x49c4('0x54')],'available':_0x4e0663[_0x49c4('0x55')],'loggedIn':_0x4e0663[_0x49c4('0x56')],'pTalking':_0x4e0663[_0x49c4('0x57')],'sumBillable':_0x4e0663[_0x49c4('0x58')],'sumDuration':_0x4e0663[_0x49c4('0x59')],'sumHoldTime':_0x4e0663[_0x49c4('0x5a')]||0x0,'talking':_0x4e0663[_0x49c4('0x5b')],'total':_0x4e0663['total'],'type':_0x4e0663[_0x49c4('0x51')],'unmanaged':_0x4e0663['unmanaged'],'abandoned':_0x4e0663[_0x49c4('0x5c')],'waiting':_0x4e0663[_0x49c4('0x5d')],'loggedInDb':_0x4e0663[_0x49c4('0x5e')],'dialActive':_0x4e0663[_0x49c4('0x5f')],'dialMethod':_0x4e0663[_0x49c4('0x60')],'dialOriginateCallerIdName':_0x4e0663[_0x49c4('0x61')],'dialOriginateCallerIdNumber':_0x4e0663['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x4e0663['dialOriginateTimeout'],'dialPrefix':_0x4e0663[_0x49c4('0x62')],'outboundAnswerAgiCallsDay':_0x4e0663[_0x49c4('0x63')],'outboundAnswerCallsDay':_0x4e0663[_0x49c4('0x64')],'outboundBlacklistCallsDay':_0x4e0663[_0x49c4('0x65')],'outboundBusyCallsDay':_0x4e0663['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x4e0663[_0x49c4('0x66')],'outboundDropCallsDayACS':_0x4e0663[_0x49c4('0x67')],'outboundDropCallsDayCallersExit':_0x4e0663[_0x49c4('0x68')],'outboundDropCallsDayTimeout':_0x4e0663[_0x49c4('0x69')],'outboundNoAnswerCallsDay':_0x4e0663[_0x49c4('0x6a')],'outboundNoSuchCallsDay':_0x4e0663[_0x49c4('0x6b')],'outboundOriginateFailureCallsDay':_0x4e0663[_0x49c4('0x6c')],'outboundReCallsDay':_0x4e0663[_0x49c4('0x6d')],'outboundRejectCallsDay':_0x4e0663[_0x49c4('0x6e')],'outboundUnknownCallsDay':_0x4e0663['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x4e0663[_0x49c4('0x6f')],'predictiveIntervalAvgHoldtime':_0x4e0663['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x4e0663[_0x49c4('0x70')],'predictiveIntervalDroppedCallsCallersExit':_0x4e0663[_0x49c4('0x71')],'predictiveIntervalDroppedCallsTimeout':_0x4e0663[_0x49c4('0x72')],'predictiveIntervalErlangCalls':_0x4e0663[_0x49c4('0x73')],'predictiveIntervalErlangCallsDroppedCalls':_0x4e0663[_0x49c4('0x74')],'predictiveIntervalHitRate':_0x4e0663['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x4e0663[_0x49c4('0x75')],'predictiveIntervalPauses':_0x4e0663[_0x49c4('0x76')],'predictiveIntervalAvailable':_0x4e0663[_0x49c4('0x77')],'predictiveIntervalTotalCalls':_0x4e0663[_0x49c4('0x78')],'message':_0x4e0663[_0x49c4('0x42')],'originated':_0x4e0663[_0x49c4('0x79')],'erlangCalls':_0x4e0663[_0x49c4('0x7a')],'erlangCallToSecond':_0x4e0663['erlangCallToSecond'],'erlangAbandonmentRate':_0x4e0663[_0x49c4('0x7b')],'erlangBusyFactor':_0x4e0663['erlangBusyFactor'],'startPredictive':_0x4e0663[_0x49c4('0x2b')],'startProgressive':_0x4e0663[_0x49c4('0x7c')]};if(_0x4e0663[_0x49c4('0x7d')]){_0x32b172[_0x49c4('0x7d')]={'id':_0x4e0663[_0x49c4('0x7d')]['id'],'name':_0x4e0663[_0x49c4('0x7d')][_0x49c4('0x40')],'active':_0x4e0663['Trunk'][_0x49c4('0x7e')],'callerid':_0x4e0663[_0x49c4('0x7d')]['callerid']};}if(_0x4e0663[_0x49c4('0x49')]){_0x32b172[_0x49c4('0x49')]={'id':_0x4e0663[_0x49c4('0x49')]['id'],'name':_0x4e0663[_0x49c4('0x49')]['name']};}var _0x5d8bf0=md5(JSON[_0x49c4('0x4c')](_0x32b172));if(_0x4e0663['md5']!==_0x5d8bf0){_0x4e0663[_0x49c4('0x3')]=_0x5d8bf0;emit(util[_0x49c4('0x7f')](_0x49c4('0x80'),_0x32b172[_0x49c4('0x40')]),_0x49c4('0x81'),_0x32b172);}}}function emitCampaignSummary(_0x286651){if(_0x286651[_0x49c4('0x51')]==='ivr'){emit(util[_0x49c4('0x7f')](_0x49c4('0x82'),_0x286651[_0x49c4('0x40')]),_0x49c4('0x83'),_0x286651);}}function checkGetDataPredictive(_0x17ef75){if(isNotNull(_0x17ef75)&&!_[_0x49c4('0x48')](_0x17ef75)){loggerPredictive[_0x49c4('0x84')](_0x49c4('0x85'));loggerPredictive[_0x49c4('0x84')](_0x49c4('0x86'),_0x17ef75['predictiveIntervalTotalCalls']);loggerPredictive['info'](_0x49c4('0x87'),_0x17ef75[_0x49c4('0x6f')]);loggerPredictive['info']('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x17ef75[_0x49c4('0x72')]);loggerPredictive['info']('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x17ef75[_0x49c4('0x71')]);loggerPredictive[_0x49c4('0x84')](_0x49c4('0x88'),_0x17ef75[_0x49c4('0x89')]);loggerPredictive[_0x49c4('0x84')](_0x49c4('0x8a'),_0x17ef75[_0x49c4('0x70')]);loggerPredictive['info'](_0x49c4('0x8b'));if(_0x17ef75[_0x49c4('0x78')]>0x0){if(!_[_0x49c4('0x3e')](_0x17ef75[_0x49c4('0x70')])&&_0x17ef75[_0x49c4('0x70')]>0x0){return!![];}loggerPredictive[_0x49c4('0x84')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_['isUndefined'](_0x17ef75[_0x49c4('0x89')])&&_0x17ef75[_0x49c4('0x89')]>0x0){return!![];}loggerPredictive[_0x49c4('0x84')](_0x49c4('0x8c'));}else{loggerPredictive[_0x49c4('0x84')](_0x49c4('0x8d'));}}else{loggerPredictive[_0x49c4('0x84')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x45d715){return function(_0x33c9a6){loggerPredictive['info'](_0x49c4('0x8e'));loggerPredictive['info'](_0x49c4('0x8f'),_0x33c9a6[_0x49c4('0x7a')]);loggerPredictive[_0x49c4('0x84')](_0x49c4('0x90'),_0x33c9a6[_0x49c4('0x91')]);loggerPredictive[_0x49c4('0x84')](_0x49c4('0x92'),_0x33c9a6[_0x49c4('0x7b')]);loggerPredictive['info'](_0x49c4('0x93'),_0x33c9a6[_0x49c4('0x94')]);loggerPredictive['info'](_0x49c4('0x92'),_0x33c9a6[_0x49c4('0x7b')]);loggerPredictive['info'](_0x49c4('0x8b'));_[_0x49c4('0x95')](_0x45d715,_0x33c9a6);};}function getDiff(_0x4f50bf){var _0x4dc54d=moment()['milliseconds'](0x0);var _0x513879=moment(_0x4f50bf)[_0x49c4('0x4d')](0x0);return _0x4dc54d['diff'](_0x513879,_0x49c4('0x4f'));}function ifInterval(_0x32f344,_0x515240){if(_[_0x49c4('0x3e')](_0x515240)){return![];}return getDiff(_0x515240)<_0x32f344*0x3c;}function freeVariablesPredictive(_0xdb2b33){if(isNotNull(_0xdb2b33)){if(!_['isUndefined'](_0xdb2b33[_0x49c4('0x7c')])){_0xdb2b33[_0x49c4('0x7c')]=undefined;loggerPredictive[_0x49c4('0x84')](_0xdb2b33[_0x49c4('0x40')],'clearing\x20variable\x20start\x20progressive');}if(!_[_0x49c4('0x3e')](_0xdb2b33[_0x49c4('0x2b')])){_0xdb2b33[_0x49c4('0x2b')]=undefined;loggerPredictive[_0x49c4('0x84')](_0xdb2b33['name'],_0x49c4('0x96'));}if(!_['isUndefined'](_0xdb2b33['handlePredictive'])){clearInterval(_0xdb2b33['handlePredictive']);_0xdb2b33['handlePredictive']=undefined;loggerPredictive[_0x49c4('0x84')](_0xdb2b33[_0x49c4('0x40')],_0x49c4('0x97'));}}}function erlangb(_0x28bbf3,_0x5b056e){if(_0x5b056e===0x0){return 0x0;}var _0x4daa6d=0x1;for(var _0x340523=0x1;_0x340523<=_0x5b056e;_0x340523+=0x1){_0x4daa6d=0x1+_0x4daa6d*_0x340523/_0x28bbf3;}return 0x1/_0x4daa6d;}function isVoiceQueueOutbound(_0x109b81){return _0x109b81===_0x49c4('0x52');}function isNotPreview(_0x295ad0){return _0x295ad0!==_0x49c4('0x98');}function isCampaignIvr(_0x404f98){return _0x404f98===_0x49c4('0x99');}function getCallerId(_0x3b949d,_0x4d49e0,_0x2276db){if(!_['isUndefined'](_0x2276db)&&typeof _0x2276db===_0x49c4('0x9a')&&!_[_0x49c4('0x48')](_0x2276db)){if(!_[_0x49c4('0x3e')](_0x4d49e0)&&typeof _0x4d49e0===_0x49c4('0x9a')&&!_[_0x49c4('0x48')](_0x4d49e0)){return util[_0x49c4('0x7f')](_0x49c4('0x9b'),_0x4d49e0,_0x2276db);}return util[_0x49c4('0x7f')](_0x49c4('0x9b'),_0x2276db,_0x2276db);}if(!_[_0x49c4('0x3e')](_0x3b949d)&&typeof _0x3b949d===_0x49c4('0x9a')&&!_[_0x49c4('0x48')](_0x3b949d)){return _0x3b949d;}return _0x49c4('0x9c');}function loggerCatchQueueSummary(_0x14bd09,_0x2d5f63){return function(_0x453cf2){freeVariablesPredictive(_0x2d5f63);emitVoiceQueueSummary(_0x2d5f63);emitCampaignSummary(_0x2d5f63);loggerSyncQueueSummary[_0x49c4('0x9d')](_0x14bd09,util[_0x49c4('0x9e')](_0x453cf2,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x4e1544,_0x5ec201){return function(_0x10f2ec){loggerPredictive[_0x49c4('0x9f')](_0x5ec201['name'],_0x4e1544);loggerPredictive[_0x49c4('0x9f')](_0x10f2ec[_0x49c4('0xa0')]);freeVariablesPredictive(_0x5ec201);};}function loggerCatch(_0x2939fd){return function(_0x16e7b1){logger['error'](_0x2939fd,util['inspect'](_0x16e7b1,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x4a85d4){return _0x4a85d4&&!_[_0x49c4('0x3e')](_0x4a85d4)&&_0x4a85d4[_0x49c4('0xa1')]>0x0;}function decremetOriginate(_0x1b912a){if(!_[_0x49c4('0x3e')](_0x1b912a)&&_0x1b912a!==null){if(typeof _0x1b912a[_0x49c4('0x79')]!==_0x49c4('0xa2')){if(_0x1b912a[_0x49c4('0x79')]>0x0){_0x1b912a[_0x49c4('0x79')]-=0x1;}else{logger[_0x49c4('0x9f')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x49c4('0x9f')](_0x49c4('0xa3'));}}function checkContactLowerLimitOriginate(_0x342f8f,_0x4b759b,_0x4448b9){if(_0x4b759b>_0x4448b9){for(var _0x46d94a=0x0;_0x46d94a<_0x4b759b-_0x4448b9;_0x46d94a+=0x1){decremetOriginate(_0x342f8f);}}}function loggerGetContactDialer(_0x1fa0a6,_0xb6031b,_0x1f25be){return function(_0x2fd749){checkContactLowerLimitOriginate(_0xb6031b,_0x1f25be,0x0);logger[_0x49c4('0x9f')](_0x1fa0a6,util[_0x49c4('0x9e')](_0x2fd749,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x4ba198){return function(_0x1bc683){if(isNotNull(_0x1bc683)&&isNotNull(_0x1bc683[0x0])){if(_0x1bc683[0x0][_0x49c4('0xa4')]>0x0){_0x4ba198[_0x49c4('0x42')]=_0x49c4('0xa5');logger[_0x49c4('0x84')]('[getContactDialer2][ReScheduled]'+_0x4ba198['name'],_0x1bc683[0x0][_0x49c4('0xa4')],'contacts');}else{_0x4ba198[_0x49c4('0x42')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x49c4('0x84')](_0x49c4('0xa6')+_0x4ba198[_0x49c4('0x40')]);}}};}function notSendMessagesQueue(_0x34870e){if(_0x34870e['sendMessageOneNotActive']){freeVariablesPredictive(_0x34870e);if(_0x34870e[_0x49c4('0x79')]===0x0&&_0x34870e[_0x49c4('0x5b')]===0x0&&_0x34870e[_0x49c4('0x5d')]===0x0&&(_0x34870e[_0x49c4('0x57')]||0x0)===0x0){_0x34870e[_0x49c4('0xa7')]=![];_0x34870e[_0x49c4('0x55')]=0x0;_0x34870e[_0x49c4('0x42')]=_0x49c4('0x43');loggerSyncQueueSummary[_0x49c4('0x9d')](_0x49c4('0xa8'),_0x34870e['name'],_0x49c4('0xa9'));}else{_0x34870e[_0x49c4('0x42')]='IS_DISACTIVED';loggerSyncQueueSummary[_0x49c4('0x9d')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x34870e[_0x49c4('0x40')],_0x49c4('0xaa'));}emitVoiceQueueSummary(_0x34870e);}}function notSendMessagesCampaign(_0x1f14a6){if(_0x1f14a6[_0x49c4('0xa7')]){if(_0x1f14a6[_0x49c4('0x79')]===0x0){_0x1f14a6['sendMessageOneNotActive']=![];_0x1f14a6[_0x49c4('0x42')]=_0x49c4('0x43');loggerSyncQueueSummary['debug'](_0x49c4('0xab'),_0x1f14a6[_0x49c4('0x40')],'is\x20not\x20active');}else{_0x1f14a6[_0x49c4('0x42')]=_0x49c4('0xac');loggerSyncQueueSummary['debug'](_0x49c4('0xab'),_0x1f14a6[_0x49c4('0x40')],_0x49c4('0xaa'));}emitCampaignSummary(_0x1f14a6);}}function createObjHistory(_0x33dc39,_0x4e1364,_0x999ae2,_0x7212ce,_0x4c2fed){_0x33dc39[_0x49c4('0x42')]=_0x999ae2;var _0x5f0188=new Action(_0x33dc39,_0x4e1364);var _0x4a4cb7=new History(_0x5f0188);_0x4a4cb7[_0x49c4('0xad')]=_0x7212ce;_0x4a4cb7['statedesc']=_0x4c2fed;_0x4a4cb7['endtime']=_0x5f0188[_0x49c4('0xae')];return _0x4a4cb7;}Dialer[_0x49c4('0x1d')]['loopClearZombieChannels']=function(){var _0x23e684=this;setInterval(function(){_0x23e684['clearZombieChannels'](_0x23e684['uniqueId'],'[uniqueid]');_0x23e684[_0x49c4('0xaf')](_0x23e684[_0x49c4('0x27')],_0x49c4('0xb0'));},0x32c8);};Dialer[_0x49c4('0x1d')]['clearZombieChannels']=function(_0x5b751a,_0x348693){var _0x48705c=this;for(var _0x2c560e in _0x5b751a){if(typeof _0x5b751a[_0x2c560e]!=='undefined'){this[_0x49c4('0x20')][_0x49c4('0xb1')](function(){if(!_[_0x49c4('0xb2')](_0x5b751a[_0x2c560e])){return ami[_0x49c4('0xb3')]({'action':_0x49c4('0xb4'),'channel':_0x5b751a[_0x2c560e][_0x49c4('0xb5')]})[_0x49c4('0xb6')](function(_0x5bb0e9){if(_0x5bb0e9[_0x49c4('0x42')]===_0x49c4('0xb7')){setTimeout(function(){if(_0x5b751a[_0x2c560e]&&_0x5b751a[_0x2c560e][_0x49c4('0x51')]!==_0x49c4('0x99')){_0x48705c[_0x49c4('0xb8')](_0x48705c['voiceQueues'][_0x5b751a[_0x2c560e][_0x49c4('0xb9')]]);logger[_0x49c4('0x9f')](_0x49c4('0xba'),_0x348693,_0x2c560e,_0x5b751a[_0x2c560e]['queue']);delete _0x5b751a[_0x2c560e];}if(_0x5b751a[_0x2c560e]&&_0x5b751a[_0x2c560e]['type']===_0x49c4('0x99')){_0x48705c[_0x49c4('0xb8')](_0x48705c[_0x49c4('0x22')][_0x5b751a[_0x2c560e][_0x49c4('0xb9')]]);logger[_0x49c4('0x9f')]('[Dialer][checkChannel][ivr]',_0x348693,_0x2c560e,_0x5b751a[_0x2c560e][_0x49c4('0xb9')]);delete _0x5b751a[_0x2c560e];}},0x2328);}});}});}}};Dialer[_0x49c4('0x1d')][_0x49c4('0xbb')]=function(_0x2aae0f){return BPromise['resolve']()['then'](cmHopper[_0x49c4('0xbb')](_0x2aae0f))[_0x49c4('0xb6')](loggerCatch(_0x49c4('0xbc')));};Dialer[_0x49c4('0x1d')][_0x49c4('0xbd')]=function(_0x5413d8){return BPromise[_0x49c4('0xbe')]()[_0x49c4('0xbf')](cmHopperBlack[_0x49c4('0xbd')](_0x5413d8))[_0x49c4('0xb6')](loggerCatch(_0x49c4('0xc0')));};Dialer[_0x49c4('0x1d')]['verifyAdditionalPhones']=function(_0x21a4fb,_0x1c90ba,_0x2ed90e){return BPromise[_0x49c4('0xbe')]()['then'](cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x21a4fb,_0x1c90ba,_0x2ed90e))[_0x49c4('0xb6')](loggerCatch('[verifyAdditionalPhone]\x20'));};Dialer[_0x49c4('0x1d')]['swapAdditionalPhones']=function(_0x303d49,_0xc77d25,_0x25afc3){return BPromise[_0x49c4('0xbe')]()['then'](cmHopperAdditionalPhone['swapAdditionalPhones'](_0x303d49,_0xc77d25,_0x25afc3))[_0x49c4('0xb6')](loggerCatch(_0x49c4('0xc1')));};Dialer[_0x49c4('0x1d')]['checkIsBlackListIvr']=function(_0x4c0e9c){return BPromise[_0x49c4('0xbe')]()['then'](cmHopperBlack['checkIsBlackListIvr'](_0x4c0e9c))[_0x49c4('0xb6')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer[_0x49c4('0x1d')][_0x49c4('0xc2')]=function(_0x4fc419){return BPromise[_0x49c4('0xbe')]()[_0x49c4('0xbf')](cmHopperHistory['avgHandleTime'](_0x4fc419))['catch'](loggerCatch(_0x49c4('0xc3')));};Dialer['prototype'][_0x49c4('0xc4')]=function(_0x3b577b){return BPromise[_0x49c4('0xbe')]()[_0x49c4('0xbf')](cmHopper[_0x49c4('0xc4')](_0x3b577b))[_0x49c4('0xb6')](loggerCatch(_0x49c4('0xc5')));};Dialer['prototype'][_0x49c4('0xc6')]=function(_0x12afa1,_0x85418e,_0xcc42bf){return BPromise[_0x49c4('0xbe')]()['then'](cmHopper[_0x49c4('0xc6')](_0x12afa1,_0x85418e,_0xcc42bf))['catch'](loggerCatch(_0x49c4('0xc7')));};Dialer[_0x49c4('0x1d')][_0x49c4('0xc8')]=function(_0x3d662c,_0x5acbf7,_0x293e47,_0x139696,_0x312b02){return BPromise[_0x49c4('0xbe')]()[_0x49c4('0xbf')](cmHopper[_0x49c4('0xc8')](_0x3d662c,_0x5acbf7,_0x293e47,_0x139696))['catch'](function(_0x8c5de0){_0x312b02['temp']-=_0x293e47;_0x312b02[_0x49c4('0xc9')]=_0x312b02[_0x49c4('0xc9')]>0x0?_0x312b02[_0x49c4('0xc9')]:0x0;loggerCatch(_0x49c4('0xca'))(_0x8c5de0);});};Dialer['prototype'][_0x49c4('0xcb')]=function(_0x17e7c6,_0x5829bc,_0x1e0b7d,_0x3c321f){return BPromise['resolve']()['then'](cmHopper[_0x49c4('0xcb')](_0x17e7c6,_0x5829bc,_0x1e0b7d))[_0x49c4('0xb6')](function(_0x35b7e6){_0x3c321f[_0x49c4('0xc9')]-=_0x5829bc;_0x3c321f[_0x49c4('0xc9')]=_0x3c321f[_0x49c4('0xc9')]>0x0?_0x3c321f[_0x49c4('0xc9')]:0x0;loggerCatch(_0x49c4('0xcc'))(_0x35b7e6);});};Dialer[_0x49c4('0x1d')][_0x49c4('0xcd')]=function(_0x269613){return BPromise['resolve']()['then'](voiceQueueRt[_0x49c4('0xcd')](_0x269613))[_0x49c4('0xb6')](loggerCatch(_0x49c4('0xce')));};Dialer['prototype'][_0x49c4('0xcf')]=function(_0x326ca8){return BPromise['resolve']()[_0x49c4('0xbf')](cmHopper['moveContactManagedDialer'](_0x326ca8))[_0x49c4('0xb6')](loggerCatch(_0x49c4('0xd0')));};Dialer[_0x49c4('0x1d')][_0x49c4('0xd1')]=function(_0x572433){return BPromise[_0x49c4('0xbe')]()[_0x49c4('0xbf')](cmHopperHistory[_0x49c4('0xd1')](_0x572433))[_0x49c4('0xb6')](loggerCatch(_0x49c4('0xd2')));};Dialer['prototype']['updateOriginated']=function(_0x5f4d82){if(!_[_0x49c4('0x3e')](_0x5f4d82)&&_0x5f4d82!==null){if(typeof _0x5f4d82[_0x49c4('0x79')]!==_0x49c4('0xa2')){if(_0x5f4d82[_0x49c4('0x79')]>0x0){_0x5f4d82[_0x49c4('0x79')]-=0x1;}else{logger['error'](_0x49c4('0xd3'));}}}else{logger[_0x49c4('0x9f')](_0x49c4('0xd4'));}};Dialer[_0x49c4('0x1d')]['loggerHandler']=function(_0x26ddfc,_0x5bfccd){var _0x10fa42=this;return function(_0x27d17b){_0x10fa42[_0x49c4('0xb8')](_0x5bfccd);logger['error'](_0x26ddfc,util[_0x49c4('0x9e')](_0x27d17b,{'showHidden':![],'depth':null}));};};Dialer[_0x49c4('0x1d')][_0x49c4('0xd5')]=function(_0x494c7f,_0x182d2f,_0x11f47f){var _0xa1954a={'state':0x19,'statedesc':'notFound'};this[_0x49c4('0xb8')](_0x182d2f);this['saveInDb'](_['merge'](_0xa1954a,_[_0x49c4('0xd6')](_0x11f47f,[_0x49c4('0xd7'),'ListId',_0x49c4('0xd8'),_0x49c4('0xd9'),_0x49c4('0xda')])),_0x49c4('0xdb'),_0x49c4('0xdc'));logger[_0x49c4('0x9f')](_0x494c7f);};Dialer[_0x49c4('0x1d')][_0x49c4('0xdd')]=function(_0x59dbef){return _0x59dbef==='Success';};Dialer[_0x49c4('0x1d')][_0x49c4('0xde')]=function(_0x42f2db){return!_['isUndefined'](_0x42f2db)&&_0x42f2db&&!_['isUndefined'](_0x42f2db[_0x49c4('0x40')])&&!_[_0x49c4('0x3e')](_0x42f2db[_0x49c4('0x7e')])&&_0x42f2db[_0x49c4('0x7e')]&&(this[_0x49c4('0x24')][util[_0x49c4('0x7f')](_0x49c4('0xdf'),_0x42f2db[_0x49c4('0x40')])][_0x49c4('0xb4')]===_0x49c4('0xe0')||this[_0x49c4('0x24')][util[_0x49c4('0x7f')](_0x49c4('0xdf'),_0x42f2db[_0x49c4('0x40')])]['status']===_0x49c4('0xe1'));};Dialer[_0x49c4('0x1d')][_0x49c4('0xe2')]=function(_0x318aaf,_0x4fc4c9,_0x53b6c3){this[_0x49c4('0xd1')](_0x318aaf)['catch'](loggerCatch(_0x4fc4c9));this[_0x49c4('0xcf')](_0x318aaf)[_0x49c4('0xb6')](loggerCatch(_0x53b6c3));};Dialer[_0x49c4('0x1d')][_0x49c4('0x36')]=function(_0x2bcc8c){var _0x45a2ef=this[_0x49c4('0x29')][_0x2bcc8c[_0x49c4('0xe3')]];var _0x31ba95;if(!_[_0x49c4('0xb2')](_0x2bcc8c)&&!_[_0x49c4('0xb2')](_0x2bcc8c[_0x49c4('0xe4')])&&!_['isNil'](_0x2bcc8c[_0x49c4('0xe4')][_0x49c4('0xe5')])&&_0x2bcc8c[_0x49c4('0xe6')]==='xcally-motion-dialer'&&_0x45a2ef){if(_0x45a2ef[_0x49c4('0x51')]!=='ivr'&&this[_0x49c4('0x21')][_0x45a2ef[_0x49c4('0xb9')]][_0x49c4('0xe7')]&&_0x2bcc8c[_0x49c4('0xe8')]==='HANGUP'){delete this[_0x49c4('0x29')][_0x2bcc8c['uniqueid']];this['updateOriginated'](this[_0x49c4('0x21')][_0x45a2ef[_0x49c4('0xb9')]]);this[_0x49c4('0x21')][_0x45a2ef['queue']]['outboundAnswerCallsDay']+=0x1;this[_0x49c4('0x21')][_0x45a2ef[_0x49c4('0xb9')]][_0x49c4('0x63')]+=0x1;_0x31ba95=new Hangup(_0x45a2ef,_0x2bcc8c);_0x31ba95[_0x49c4('0xad')]=0x12;_0x31ba95[_0x49c4('0xe9')]=_0x49c4('0xea');_0x31ba95[_0x49c4('0xeb')]=_0x49c4('0xec');ami[_0x49c4('0x50')]('custom:amd',ut[_0x49c4('0xed')](_0x31ba95,_0x49c4('0xee')));this['saveInDb'](_0x31ba95,'[syncHangupInAMD][createHistory]',_0x49c4('0xef'));}if(_0x45a2ef['type']!==_0x49c4('0x99')&&this['voiceQueues'][_0x45a2ef[_0x49c4('0xb9')]]['dialAMDActive']&&_0x2bcc8c[_0x49c4('0xe8')]===_0x49c4('0xf0')){var _0x55da39=this;return new BPromise(function(_0x1ab574,_0x5b1e3d){delete _0x55da39['uniqueId'][_0x2bcc8c[_0x49c4('0xe3')]];_0x55da39[_0x49c4('0xb8')](_0x55da39[_0x49c4('0x21')][_0x45a2ef['queue']]);_0x55da39[_0x49c4('0x21')][_0x45a2ef[_0x49c4('0xb9')]]['outboundAnswerCallsDay']+=0x1;_0x55da39['voiceQueues'][_0x45a2ef[_0x49c4('0xb9')]][_0x49c4('0x63')]+=0x1;var _0xa0698d=_0x55da39['voiceQueues'][_0x45a2ef[_0x49c4('0xb9')]];var _0x3da1a3=new Hangup(_0x45a2ef,_0x2bcc8c);_0x3da1a3[_0x49c4('0xad')]=0x13;_0x3da1a3[_0x49c4('0xe9')]='Machine';_0x3da1a3[_0x49c4('0xeb')]='AMD';_0x3da1a3['countmachineretry']+=0x1;_0x3da1a3[_0x49c4('0xf1')]+=0x1;_0x3da1a3[_0x49c4('0xee')]=!![];ami[_0x49c4('0x50')](_0x49c4('0xf2'),ut['buildObj'](_0x3da1a3,_0x49c4('0xee')));_0x55da39[_0x49c4('0xd1')](_0x3da1a3)[_0x49c4('0xb6')](loggerCatch(_0x49c4('0xf3')));if(_0x3da1a3['countbusyretry']+_0x3da1a3[_0x49c4('0xf4')]+_0x3da1a3['countnoanswerretry']+_0x3da1a3['countnosuchnumberretry']+_0x3da1a3[_0x49c4('0xf5')]+_0x3da1a3[_0x49c4('0xf6')]+_0x3da1a3[_0x49c4('0xf7')]+_0x3da1a3['countagentrejectretry']>=_0xa0698d[_0x49c4('0xf8')]){_0x55da39['stateGlobal'](_0x3da1a3,_0x1ab574,_0x5b1e3d,_0x49c4('0xf9'));}else{if(_0x3da1a3[_0x49c4('0xf7')]>=_0xa0698d[_0x49c4('0xfa')]){_0x55da39[_0x49c4('0xfb')](_0x3da1a3,_0x1ab574,_0x5b1e3d,_0x49c4('0xfc'));}else{_0x55da39[_0x49c4('0xc4')]({'active':![],'countmachineretry':_0x3da1a3[_0x49c4('0xf7')],'scheduledat':moment()['add'](_0xa0698d[_0x49c4('0xfd')],_0x49c4('0xfe'))[_0x49c4('0x7f')](_0x49c4('0xff')),'ContactId':_0x3da1a3['ContactId'],'ListId':_0x3da1a3['ListId'],'VoiceQueueId':_0x3da1a3['VoiceQueueId']||undefined,'CampaignId':_0x3da1a3[_0x49c4('0xda')]||undefined})[_0x49c4('0xb6')](loggerCatch(_0x49c4('0x100')));_0x1ab574({'reschedule':0x1});}}});}if(_0x45a2ef[_0x49c4('0x51')]===_0x49c4('0x99')&&this[_0x49c4('0x22')][_0x45a2ef[_0x49c4('0xb9')]]['dialAMDActive']&&_0x2bcc8c[_0x49c4('0xe8')]===_0x49c4('0x101')){delete this['uniqueId'][_0x2bcc8c['uniqueid']];this['updateOriginated'](this[_0x49c4('0x22')][_0x45a2ef[_0x49c4('0xb9')]]);_0x31ba95=new Hangup(_0x45a2ef,_0x2bcc8c);_0x31ba95[_0x49c4('0xad')]=0x12;_0x31ba95[_0x49c4('0xe9')]=_0x49c4('0xea');_0x31ba95[_0x49c4('0xeb')]=_0x49c4('0xec');ami['emit'](_0x49c4('0xf2'),ut[_0x49c4('0xed')](_0x31ba95,_0x49c4('0xee')));this[_0x49c4('0xe2')](_0x31ba95,'[syncHangupInAMDIvr][createHistory]',_0x49c4('0x102'));}if(_0x45a2ef[_0x49c4('0x51')]===_0x49c4('0x99')&&this[_0x49c4('0x22')][_0x45a2ef[_0x49c4('0xb9')]]['dialAMDActive']&&_0x2bcc8c[_0x49c4('0xe8')]==='MACHINE'){var _0x55da39=this;return new BPromise(function(_0x306faf,_0x1eeaed){delete _0x55da39[_0x49c4('0x29')][_0x2bcc8c[_0x49c4('0xe3')]];_0x55da39[_0x49c4('0xb8')](_0x55da39['campaigns'][_0x45a2ef[_0x49c4('0xb9')]]);_0x55da39[_0x49c4('0x22')][_0x45a2ef[_0x49c4('0xb9')]]['outboundAnswerCallsDay']+=0x1;_0x55da39[_0x49c4('0x22')][_0x45a2ef[_0x49c4('0xb9')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x369304=_0x55da39[_0x49c4('0x22')][_0x45a2ef[_0x49c4('0xb9')]];var _0x600420=new Hangup(_0x45a2ef,_0x2bcc8c);_0x600420[_0x49c4('0xad')]=0x13;_0x600420[_0x49c4('0xe9')]=_0x49c4('0x103');_0x600420['membername']=_0x49c4('0xec');_0x600420[_0x49c4('0xf7')]+=0x1;_0x600420[_0x49c4('0xf1')]+=0x1;_0x600420[_0x49c4('0xee')]=!![];ami[_0x49c4('0x50')]('custom:amd',ut[_0x49c4('0xed')](_0x600420,_0x49c4('0xee')));_0x55da39[_0x49c4('0xd1')](_0x600420)[_0x49c4('0xb6')](loggerCatch(_0x49c4('0xf3')));if(_0x600420['countbusyretry']+_0x600420[_0x49c4('0xf4')]+_0x600420[_0x49c4('0x104')]+_0x600420[_0x49c4('0x105')]+_0x600420[_0x49c4('0xf5')]+_0x600420[_0x49c4('0xf6')]+_0x600420[_0x49c4('0xf7')]+_0x600420[_0x49c4('0x106')]>=_0x369304[_0x49c4('0xf8')]){_0x55da39[_0x49c4('0x107')](_0x600420,_0x306faf,_0x1eeaed,_0x49c4('0xf9'));}else{if(_0x600420['countmachineretry']>=_0x369304[_0x49c4('0xfa')]){_0x55da39[_0x49c4('0xfb')](_0x600420,_0x306faf,_0x1eeaed,_0x49c4('0xfc'));}else{_0x55da39[_0x49c4('0xc4')]({'active':![],'countmachineretry':_0x600420[_0x49c4('0xf7')],'scheduledat':moment()['add'](_0x369304['dialMachineRetryFrequency'],_0x49c4('0xfe'))[_0x49c4('0x7f')](_0x49c4('0xff')),'ContactId':_0x600420[_0x49c4('0xd7')],'ListId':_0x600420[_0x49c4('0x108')],'VoiceQueueId':_0x600420[_0x49c4('0xd9')]||undefined,'CampaignId':_0x600420['CampaignId']||undefined})[_0x49c4('0xb6')](loggerCatch(_0x49c4('0x100')));_0x306faf({'reschedule':0x1});}}});}}};Dialer['prototype'][_0x49c4('0x32')]=function(_0x55d0ac){var _0x30d99a=this[_0x49c4('0x29')][_0x55d0ac[_0x49c4('0xe3')]];var _0x5db4a1=this;var _0x1e30d7;if(_0x30d99a&&_0x30d99a['type']===_0x49c4('0x99')){delete this['uniqueId'][_0x55d0ac['uniqueid']];this[_0x49c4('0xb8')](this[_0x49c4('0x22')][_0x30d99a[_0x49c4('0xb9')]]);this[_0x49c4('0x22')][_0x30d99a[_0x49c4('0xb9')]][_0x49c4('0x109')]+=0x1;_0x1e30d7=new Hangup(_0x30d99a,_0x55d0ac);this['createHistory'](_0x1e30d7)['catch'](loggerCatch(_0x49c4('0x10a')));this[_0x49c4('0xcf')](_0x1e30d7)[_0x49c4('0xb6')](loggerCatch(_0x49c4('0x10b')));}if(_0x30d99a&&_0x30d99a[_0x49c4('0x51')]!==_0x49c4('0x99')&&isNotNull(this[_0x49c4('0x21')][_0x30d99a['queue']]['dialQueueProject'])){delete this['uniqueId'][_0x55d0ac['uniqueid']];this[_0x49c4('0xb8')](this['voiceQueues'][_0x30d99a[_0x49c4('0xb9')]]);this[_0x49c4('0x21')][_0x30d99a[_0x49c4('0xb9')]]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x30d99a[_0x49c4('0xb9')]][_0x49c4('0x63')]+=0x1;_0x1e30d7=new Hangup(_0x30d99a,_0x55d0ac);_0x1e30d7['state']=0x10;_0x1e30d7[_0x49c4('0xe9')]=_0x49c4('0x10c');_0x1e30d7[_0x49c4('0xeb')]=_0x49c4('0x10d');this[_0x49c4('0xd1')](_0x1e30d7)[_0x49c4('0xb6')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x49c4('0xcf')](_0x1e30d7)[_0x49c4('0xb6')](loggerCatch(_0x49c4('0x10b')));}if(_0x30d99a&&_0x30d99a['type']!==_0x49c4('0x99')&&!isNotNull(this[_0x49c4('0x21')][_0x30d99a[_0x49c4('0xb9')]][_0x49c4('0x10e')])){delete this[_0x49c4('0x29')][_0x55d0ac[_0x49c4('0xe3')]];this[_0x49c4('0xb8')](this[_0x49c4('0x21')][_0x30d99a['queue']]);this[_0x49c4('0x21')][_0x30d99a[_0x49c4('0xb9')]][_0x49c4('0x10f')]+=0x1;_0x1e30d7=new Hangup(_0x30d99a,_0x55d0ac);_0x1e30d7[_0x49c4('0xad')]=0xc;_0x1e30d7[_0x49c4('0xe9')]=_0x55d0ac[_0x49c4('0x110')];_0x1e30d7['membername']=_0x49c4('0x111');this[_0x49c4('0xd1')](_0x1e30d7)[_0x49c4('0xb6')](loggerCatch(_0x49c4('0x10a')));this[_0x49c4('0xcf')](_0x1e30d7)[_0x49c4('0xb6')](loggerCatch(_0x49c4('0x10b')));}};Dialer[_0x49c4('0x1d')][_0x49c4('0x112')]=function(_0xc641bc){var _0xcec186=this[_0x49c4('0x29')][_0xc641bc[_0x49c4('0xe3')]];var _0x43bd6e=this;if(this['voiceQueues'][_0xc641bc['queue']]){if(_0xcec186&&_0xcec186[_0x49c4('0x51')]!==_0x49c4('0x99')){delete this['uniqueId'][_0xc641bc['uniqueid']];this[_0x49c4('0x21')][_0xc641bc['queue']][_0x49c4('0x64')]+=0x1;var _0x8a4230=new AgentComplete(_0xcec186,_0xc641bc);if(_0xc641bc[_0x49c4('0x113')]===_0x49c4('0x114')){_0x8a4230[_0x49c4('0x115')]=this[_0x49c4('0x21')][_0xc641bc[_0x49c4('0xb9')]][_0x49c4('0x116')]&&this['voiceQueues'][_0xc641bc[_0x49c4('0xb9')]][_0x49c4('0x117')]?moment()[_0x49c4('0x7f')](_0x49c4('0xff')):undefined;}this[_0x49c4('0xd1')](_0x8a4230)['catch'](loggerCatch(_0x49c4('0x118')));this[_0x49c4('0xcf')](_0x8a4230)['catch'](loggerCatch(_0x49c4('0x119')));}}};Dialer[_0x49c4('0x1d')]['syncAgentConnect']=function(_0x3ff81c){if(this[_0x49c4('0x21')][_0x3ff81c[_0x49c4('0xb9')]]){if(this['uniqueId'][_0x3ff81c[_0x49c4('0xe3')]]&&this[_0x49c4('0x29')][_0x3ff81c[_0x49c4('0xe3')]][_0x49c4('0x51')]!=='ivr'){this[_0x49c4('0xb8')](this['voiceQueues'][_0x3ff81c[_0x49c4('0xb9')]]);this[_0x49c4('0x29')][_0x3ff81c[_0x49c4('0xe3')]][_0x49c4('0x11a')]=moment()['format'](_0x49c4('0xff'));}}};Dialer[_0x49c4('0x1d')][_0x49c4('0x11b')]=function(_0x114519,_0x4fb101){this[_0x49c4('0xd1')](_0x114519)['catch'](loggerCatch('[syncAgentComplete][createHistory]'));if(_0x4fb101==0x0){this[_0x49c4('0xcf')](_0x114519)[_0x49c4('0xb6')](loggerCatch(_0x49c4('0x11c')));}};Dialer[_0x49c4('0x1d')][_0x49c4('0x2f')]=function(_0x131384){var _0x21916c=this[_0x49c4('0x29')][_0x131384[_0x49c4('0xe3')]];var _0x37dbbf=this;var _0x300bea=![];var _0x32501e;var _0x527c76;if(this[_0x49c4('0x21')][_0x131384[_0x49c4('0xb9')]]){if(_0x21916c&&_0x21916c['type']!==_0x49c4('0x99')){delete this['uniqueId'][_0x131384[_0x49c4('0xe3')]];this[_0x49c4('0xb8')](this['voiceQueues'][_0x131384[_0x49c4('0xb9')]]);_0x21916c[_0x49c4('0x11d')]=moment()[_0x49c4('0x7f')](_0x49c4('0xff'));var _0x29ae49=new QueueCallerAbandon(_0x21916c,_0x131384);if(getSeconds(_0x21916c['droptime'],_0x21916c[_0x49c4('0x11e')])>=_0x21916c['dialQueueTimeout']){this[_0x49c4('0x21')][_0x131384[_0x49c4('0xb9')]][_0x49c4('0x72')]+=0x1;this['voiceQueues'][_0x131384[_0x49c4('0xb9')]][_0x49c4('0x69')]+=0x1;this[_0x49c4('0x21')][_0x131384['queue']]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x29ae49[_0x49c4('0xad')]=0xa;_0x29ae49[_0x49c4('0xe9')]=_0x49c4('0x11f');_0x29ae49[_0x49c4('0x120')]=_0x49c4('0x121');_0x29ae49[_0x49c4('0x115')]=this['voiceQueues'][_0x131384['queue']]['dialQueueProject2']?moment()[_0x49c4('0x7f')](_0x49c4('0xff')):undefined;_0x29ae49[_0x49c4('0xf5')]+=0x1;_0x29ae49[_0x49c4('0xf1')]+=0x1;_0x32501e=this['voiceQueues'][_0x131384[_0x49c4('0xb9')]][_0x49c4('0x122')];_0x527c76=this[_0x49c4('0x21')][_0x131384[_0x49c4('0xb9')]][_0x49c4('0x123')];_0x37dbbf[_0x49c4('0x124')](_0x29ae49,_0x29ae49[_0x49c4('0xad')],_0x21916c[_0x49c4('0x125')])[_0x49c4('0xbf')](function(_0x39e6f5){_0x300bea=_0x39e6f5[_0x49c4('0x126')]==0x1;if(_0x29ae49['countdropretry']>=_0x37dbbf[_0x49c4('0x21')][_0x131384['queue']][_0x49c4('0x127')]){_0x37dbbf[_0x49c4('0x11b')](_0x29ae49,_0x39e6f5[_0x49c4('0x126')]);}else{_0x37dbbf[_0x49c4('0xc4')]({'active':![],'countdropretry':_0x29ae49['countdropretry'],'scheduledat':moment()[_0x49c4('0x128')](_0x37dbbf['voiceQueues'][_0x131384['queue']]['dialDropRetryFrequency'],_0x49c4('0xfe'))[_0x49c4('0x7f')](_0x49c4('0xff')),'ContactId':_0x21916c['ContactId'],'ListId':_0x21916c[_0x49c4('0x108')],'VoiceQueueId':_0x21916c['VoiceQueueId']||undefined,'CampaignId':_0x21916c[_0x49c4('0xda')]||undefined})[_0x49c4('0xb6')](loggerCatch(_0x49c4('0x129')));var _0x54cf88=new History(_0x29ae49);_0x54cf88[_0x49c4('0xad')]=0xa;_0x54cf88[_0x49c4('0xe9')]=_0x49c4('0x11f');_0x54cf88[_0x49c4('0xae')]=moment()[_0x49c4('0x7f')]('YYYY-MM-DD\x20HH:mm:ss');_0x54cf88[_0x49c4('0x12a')]=_0x54cf88[_0x49c4('0xae')];_0x54cf88[_0x49c4('0x12b')]=_0x29ae49[_0x49c4('0x12b')];_0x54cf88['calleridnum']=_0x29ae49['calleridnum'];_0x37dbbf[_0x49c4('0xd1')](_0x54cf88)[_0x49c4('0xb6')](loggerCatch('[syncAgentComplete][createHistory][10]'));}})[_0x49c4('0xbf')](function(_0x2fd09b){if(_0x300bea)_0x37dbbf[_0x49c4('0x12c')](_0x29ae49,_0x32501e,_0x527c76)[_0x49c4('0xbf')](function(_0x512d87){return 0x1;});});}else{this[_0x49c4('0x21')][_0x131384[_0x49c4('0xb9')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this['voiceQueues'][_0x131384[_0x49c4('0xb9')]][_0x49c4('0x68')]+=0x1;_0x29ae49[_0x49c4('0xad')]=0xb;_0x29ae49[_0x49c4('0xe9')]=_0x49c4('0x12d');_0x29ae49['dropreason']=_0x49c4('0x12e');_0x29ae49['countabandonedretry']+=0x1;_0x29ae49[_0x49c4('0xf1')]+=0x1;_0x32501e=this[_0x49c4('0x21')][_0x131384[_0x49c4('0xb9')]][_0x49c4('0x12f')];_0x527c76=this['voiceQueues'][_0x131384['queue']]['callAdditionalPhoneAfterMin'];_0x37dbbf[_0x49c4('0x124')](_0x29ae49,_0x29ae49[_0x49c4('0xad')],_0x21916c[_0x49c4('0x125')])[_0x49c4('0xbf')](function(_0x4e38ed){if(_0x29ae49['countabandonedretry']>=_0x37dbbf[_0x49c4('0x21')][_0x131384['queue']][_0x49c4('0x130')]){_0x37dbbf[_0x49c4('0x11b')](_0x29ae49,_0x4e38ed['additional']);}else{_0x37dbbf[_0x49c4('0xc4')]({'active':![],'countabandonedretry':_0x29ae49[_0x49c4('0xf6')],'scheduledat':moment()[_0x49c4('0x128')](_0x37dbbf['voiceQueues'][_0x131384[_0x49c4('0xb9')]][_0x49c4('0x12f')],_0x49c4('0xfe'))['format'](_0x49c4('0xff')),'ContactId':_0x21916c[_0x49c4('0xd7')],'ListId':_0x21916c['ListId'],'VoiceQueueId':_0x21916c[_0x49c4('0xd9')]||undefined,'CampaignId':_0x21916c[_0x49c4('0xda')]||undefined})['catch'](loggerCatch(_0x49c4('0x131')));var _0x37bb11=new History(_0x29ae49);_0x37bb11[_0x49c4('0xad')]=0xb;_0x37bb11[_0x49c4('0xe9')]=_0x49c4('0x12d');_0x37bb11['starttime']=moment()[_0x49c4('0x7f')](_0x49c4('0xff'));_0x37bb11['endtime']=_0x37bb11[_0x49c4('0xae')];_0x37bb11[_0x49c4('0x12b')]=_0x29ae49[_0x49c4('0x12b')];_0x37bb11['calleridnum']=_0x29ae49[_0x49c4('0x132')];_0x37dbbf['createHistory'](_0x37bb11)[_0x49c4('0xb6')](loggerCatch(_0x49c4('0x133')));}})['then'](function(_0x3811f6){if(_0x300bea)_0x37dbbf['swapAdditionalPhones'](_0x29ae49,_0x32501e,_0x527c76)[_0x49c4('0xbf')](function(_0x17ab2c){return 0x1;});});}}}};Dialer['prototype'][_0x49c4('0x34')]=function(_0x122024){if(this['actions'][_0x122024['uniqueid']]){this[_0x49c4('0x27')][_0x122024[_0x49c4('0xe3')]][_0x49c4('0xb5')]=_0x122024[_0x49c4('0xb5')];}if(this[_0x49c4('0x29')][_0x122024['uniqueid']]){this[_0x49c4('0x29')][_0x122024[_0x49c4('0xe3')]][_0x49c4('0xb5')]=_0x122024[_0x49c4('0xb5')];}};Dialer[_0x49c4('0x1d')]['syncQueueMember']=function(_0x5617c9){if(strategy[this[_0x49c4('0x21')][this[_0x49c4('0x27')][_0x5617c9[_0x49c4('0x134')]][_0x49c4('0xb9')]][_0x49c4('0x53')]]===_0x49c4('0x1c')){if(this[_0x49c4('0x27')][_0x5617c9['actionid']]&&_[_0x49c4('0xb2')](this[_0x49c4('0x27')][_0x5617c9[_0x49c4('0x134')]]['locked'])&&_0x5617c9['status']==='1'&&_0x5617c9[_0x49c4('0x135')]==='0'){if(this['agents'][_0x5617c9[_0x49c4('0x136')]]){if(!this[_0x49c4('0x23')][_0x5617c9[_0x49c4('0x136')]][_0x49c4('0x137')]){this['agents'][_0x5617c9[_0x49c4('0x136')]][_0x49c4('0x137')]=!![];this[_0x49c4('0x27')][_0x5617c9[_0x49c4('0x134')]]['locked']=!![];this[_0x49c4('0x27')][_0x5617c9[_0x49c4('0x134')]]['stateinterface']=_0x5617c9[_0x49c4('0x136')];}}}}else if((strategy[this[_0x49c4('0x21')][this[_0x49c4('0x27')][_0x5617c9[_0x49c4('0x134')]][_0x49c4('0xb9')]][_0x49c4('0x53')]]||_0x49c4('0x1b'))===_0x49c4('0x1b')){if(this['actions'][_0x5617c9['actionid']]){if(this['agents'][_0x5617c9[_0x49c4('0x136')]]){this[_0x49c4('0x27')][_0x5617c9[_0x49c4('0x134')]][_0x49c4('0x136')]=_0x5617c9[_0x49c4('0x136')];if(_['isNil'](this[_0x49c4('0x138')][this[_0x49c4('0x27')][_0x5617c9[_0x49c4('0x134')]][_0x49c4('0xb9')]])){this['queueBooked'][this['actions'][_0x5617c9[_0x49c4('0x134')]][_0x49c4('0xb9')]]=[];}this[_0x49c4('0x138')][this[_0x49c4('0x27')][_0x5617c9[_0x49c4('0x134')]][_0x49c4('0xb9')]]['push'](_['merge'](_[_0x49c4('0xd6')](this[_0x49c4('0x27')][_0x5617c9[_0x49c4('0x134')]],[_0x49c4('0x139'),_0x49c4('0x136')]),{'status':_0x5617c9['status'],'paused':_0x5617c9[_0x49c4('0x135')]}));}}}};function unlockQueueStatus(_0x2b6617,_0x3e1e48){setTimeout(function(){if(_[_0x49c4('0x3e')](_0x2b6617[_0x49c4('0x13a')])){loggerBooked[_0x49c4('0x9f')](_0x49c4('0x13b'),_0x3e1e48);}_0x2b6617[_0x49c4('0x13a')]=!![];loggerBooked[_0x49c4('0x84')]('[booked][unlockQueueStatus]',_0x3e1e48,JSON[_0x49c4('0x4c')](_[_0x49c4('0xd6')](_0x2b6617,[_0x49c4('0x40'),_0x49c4('0x13a')])));},0x1f3);}Dialer[_0x49c4('0x1d')]['syncQueueStatusComplete']=function(_0xbd96eb){var _0x2122e0=this;var _0x485c2d=_0x2122e0[_0x49c4('0x21')][_0x2122e0['actions'][_0xbd96eb[_0x49c4('0x134')]]['queue']];if(strategy[this[_0x49c4('0x21')][this[_0x49c4('0x27')][_0xbd96eb['actionid']][_0x49c4('0xb9')]]['strategy']]===_0x49c4('0x1c')){if(this[_0x49c4('0x27')][_0xbd96eb[_0x49c4('0x134')]]&&this[_0x49c4('0x27')][_0xbd96eb[_0x49c4('0x134')]]['stateinterface']){this[_0x49c4('0x98')][_0x49c4('0x13c')](this[_0x49c4('0x27')][_0xbd96eb[_0x49c4('0x134')]][_0x49c4('0x139')],this[_0x49c4('0x27')][_0xbd96eb[_0x49c4('0x134')]][_0x49c4('0x136')])['catch'](function(_0x428b20){logger[_0x49c4('0x9f')](_0x49c4('0x13d'),util[_0x49c4('0x9e')](_0x428b20,{'showHidden':![],'depth':null}));})[_0x49c4('0x1f')](function(){_0x2122e0[_0x49c4('0xb8')](_0x2122e0[_0x49c4('0x21')][_0x2122e0[_0x49c4('0x27')][_0xbd96eb[_0x49c4('0x134')]][_0x49c4('0xb9')]]);_0x2122e0[_0x49c4('0x23')][_0x2122e0[_0x49c4('0x27')][_0xbd96eb['actionid']][_0x49c4('0x136')]]['locked']=![];delete _0x2122e0[_0x49c4('0x27')][_0xbd96eb[_0x49c4('0x134')]];unlockQueueStatus(_0x485c2d);});}else{this[_0x49c4('0xb8')](this[_0x49c4('0x21')][this[_0x49c4('0x27')][_0xbd96eb[_0x49c4('0x134')]][_0x49c4('0xb9')]]);this[_0x49c4('0xc4')]({'active':![],'ContactId':this[_0x49c4('0x27')][_0xbd96eb[_0x49c4('0x134')]][_0x49c4('0xd7')],'ListId':this[_0x49c4('0x27')][_0xbd96eb[_0x49c4('0x134')]][_0x49c4('0x108')],'VoiceQueueId':this[_0x49c4('0x27')][_0xbd96eb['actionid']][_0x49c4('0xd9')]||undefined,'CampaignId':this[_0x49c4('0x27')][_0xbd96eb['actionid']][_0x49c4('0xda')]||undefined})['catch'](loggerCatch(_0x49c4('0x13e')));delete this[_0x49c4('0x27')][_0xbd96eb[_0x49c4('0x134')]];unlockQueueStatus(_0x485c2d);}}else if((strategy[this[_0x49c4('0x21')][this[_0x49c4('0x27')][_0xbd96eb['actionid']]['queue']][_0x49c4('0x53')]]||_0x49c4('0x1b'))===_0x49c4('0x1b')){var _0x54659b;if(this[_0x49c4('0x27')][_0xbd96eb[_0x49c4('0x134')]]&&!_['isEmpty'](this[_0x49c4('0x138')][this['actions'][_0xbd96eb['actionid']]['queue']])){if(this[_0x49c4('0x2c')][_0x2122e0[_0x49c4('0x27')][_0xbd96eb[_0x49c4('0x134')]][_0x49c4('0xb9')]]){this[_0x49c4('0x2c')][_0x2122e0['actions'][_0xbd96eb[_0x49c4('0x134')]][_0x49c4('0xb9')]]=this[_0x49c4('0x2c')][this['actions'][_0xbd96eb[_0x49c4('0x134')]][_0x49c4('0xb9')]]?this[_0x49c4('0x2c')][this[_0x49c4('0x27')][_0xbd96eb[_0x49c4('0x134')]][_0x49c4('0xb9')]]:this[_0x49c4('0x138')][this[_0x49c4('0x27')][_0xbd96eb[_0x49c4('0x134')]][_0x49c4('0xb9')]]?this[_0x49c4('0x138')][this['actions'][_0xbd96eb[_0x49c4('0x134')]][_0x49c4('0xb9')]][_0x49c4('0x13f')]||0x0:0x0;}this[_0x49c4('0x138')][this[_0x49c4('0x27')][_0xbd96eb[_0x49c4('0x134')]][_0x49c4('0xb9')]]['_rr']=this[_0x49c4('0x2c')][this['actions'][_0xbd96eb[_0x49c4('0x134')]]['queue']];for(var _0x4a35a3=0x0;_0x4a35a3<this[_0x49c4('0x138')][this[_0x49c4('0x27')][_0xbd96eb[_0x49c4('0x134')]][_0x49c4('0xb9')]]['length'];_0x4a35a3+=0x1){_0x54659b=rr(this['queueBooked'][this['actions'][_0xbd96eb['actionid']][_0x49c4('0xb9')]]);this['queueBookedRR'][_0x2122e0['actions'][_0xbd96eb[_0x49c4('0x134')]][_0x49c4('0xb9')]]=this[_0x49c4('0x138')][this[_0x49c4('0x27')][_0xbd96eb['actionid']][_0x49c4('0xb9')]][_0x49c4('0x13f')];if(_0x54659b['status']==='1'&&_0x54659b[_0x49c4('0x135')]==='0'){break;}}if(!_[_0x49c4('0xb2')](_0x54659b)){this[_0x49c4('0x23')][_0x54659b[_0x49c4('0x136')]][_0x49c4('0x140')]=_['isUndefined'](this[_0x49c4('0x23')][_0x54659b[_0x49c4('0x136')]][_0x49c4('0x140')])?!![]:this[_0x49c4('0x23')][_0x54659b[_0x49c4('0x136')]][_0x49c4('0x140')];}loggerBooked[_0x49c4('0x84')](_0x49c4('0x141'),_0xbd96eb[_0x49c4('0x134')],'Agent:\x20',JSON['stringify'](_[_0x49c4('0xd6')](this[_0x49c4('0x23')][_0x54659b[_0x49c4('0x136')]],[_0x49c4('0x40'),'unlockRR'])),_0x49c4('0x142'),JSON[_0x49c4('0x4c')](_0x54659b[_0x49c4('0x139')]));if(!_[_0x49c4('0xb2')](_0x54659b)&&_0x54659b[_0x49c4('0xb4')]==='1'&&_0x54659b[_0x49c4('0x135')]==='0'&&this[_0x49c4('0x23')][_0x54659b[_0x49c4('0x136')]][_0x49c4('0x140')]){this[_0x49c4('0x23')][_0x54659b[_0x49c4('0x136')]]['unlockRR']=![];this['queueBooked'][_0x2122e0['actions'][_0xbd96eb['actionid']][_0x49c4('0xb9')]]=[];this[_0x49c4('0x98')][_0x49c4('0x13c')](_0x54659b[_0x49c4('0x139')],_0x54659b[_0x49c4('0x136')])[_0x49c4('0xb6')](function(_0x4a93b9){logger['error'](_0x49c4('0x13d'),util[_0x49c4('0x9e')](_0x4a93b9,{'showHidden':![],'depth':null}));})['finally'](function(){_0x2122e0['updateOriginated'](_0x2122e0[_0x49c4('0x21')][_0x2122e0[_0x49c4('0x27')][_0xbd96eb[_0x49c4('0x134')]][_0x49c4('0xb9')]]);setTimeout(function(){_0x2122e0[_0x49c4('0x23')][_0x54659b[_0x49c4('0x136')]]['unlockRR']=!![];loggerBooked['info'](_0x49c4('0x143'),_0xbd96eb['actionid'],_0x49c4('0x144'),JSON['stringify'](_[_0x49c4('0xd6')](_0x2122e0[_0x49c4('0x23')][_0x54659b['stateinterface']],[_0x49c4('0x40'),_0x49c4('0x140')])),'contactAgent-idHopper:\x20',JSON['stringify'](_0x54659b[_0x49c4('0x139')]));},0xc7);delete _0x2122e0['actions'][_0xbd96eb['actionid']];unlockQueueStatus(_0x485c2d,_0xbd96eb['actionid']);});}else{loggerBooked[_0x49c4('0x84')](_0x49c4('0x145'));this[_0x49c4('0xb8')](this['voiceQueues'][this[_0x49c4('0x27')][_0xbd96eb['actionid']][_0x49c4('0xb9')]]);this[_0x49c4('0xc4')]({'active':![],'ContactId':this['actions'][_0xbd96eb['actionid']]['ContactId'],'ListId':this[_0x49c4('0x27')][_0xbd96eb[_0x49c4('0x134')]][_0x49c4('0x108')],'VoiceQueueId':this['actions'][_0xbd96eb['actionid']][_0x49c4('0xd9')]||undefined,'CampaignId':this[_0x49c4('0x27')][_0xbd96eb[_0x49c4('0x134')]]['CampaignId']||undefined})[_0x49c4('0xb6')](loggerCatch(_0x49c4('0x13e')));delete this[_0x49c4('0x27')][_0xbd96eb['actionid']];unlockQueueStatus(_0x485c2d);}}else{loggerBooked[_0x49c4('0x84')]('[booked][unlock2]');this['updateOriginated'](this[_0x49c4('0x21')][this[_0x49c4('0x27')][_0xbd96eb[_0x49c4('0x134')]]['queue']]);this['rescheduleContact']({'active':![],'ContactId':this[_0x49c4('0x27')][_0xbd96eb[_0x49c4('0x134')]][_0x49c4('0xd7')],'ListId':this['actions'][_0xbd96eb['actionid']][_0x49c4('0x108')],'VoiceQueueId':this[_0x49c4('0x27')][_0xbd96eb[_0x49c4('0x134')]][_0x49c4('0xd9')]||undefined,'CampaignId':this[_0x49c4('0x27')][_0xbd96eb[_0x49c4('0x134')]][_0x49c4('0xda')]||undefined})[_0x49c4('0xb6')](loggerCatch(_0x49c4('0x146')));delete this[_0x49c4('0x27')][_0xbd96eb[_0x49c4('0x134')]];unlockQueueStatus(_0x485c2d);}}else{loggerBooked[_0x49c4('0x84')]('[booked][unlock3]');this[_0x49c4('0xb8')](this['voiceQueues'][this[_0x49c4('0x27')][_0xbd96eb['actionid']][_0x49c4('0xb9')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0x49c4('0x27')][_0xbd96eb[_0x49c4('0x134')]]['ContactId'],'ListId':this['actions'][_0xbd96eb[_0x49c4('0x134')]][_0x49c4('0x108')],'VoiceQueueId':this[_0x49c4('0x27')][_0xbd96eb[_0x49c4('0x134')]][_0x49c4('0xd9')]||undefined,'CampaignId':this['actions'][_0xbd96eb[_0x49c4('0x134')]][_0x49c4('0xda')]||undefined})[_0x49c4('0xb6')](loggerCatch('[unlock3][syncQueueStatusComplete]'));delete this[_0x49c4('0x27')][_0xbd96eb[_0x49c4('0x134')]];unlockQueueStatus(_0x485c2d);}};Dialer[_0x49c4('0x1d')][_0x49c4('0x3b')]=function(){var _0x5f2267=this;return BPromise[_0x49c4('0xbe')]()['then'](cmHopper[_0x49c4('0x147')]({}))[_0x49c4('0xbf')](function(){setInterval(function(){_0x5f2267[_0x49c4('0x148')]();},0x3e8);});};Dialer[_0x49c4('0x1d')]['checkIsTrunkReachable']=function(_0x4a6cf9){var _0x3ecb87=this;return function(){if(!_0x3ecb87[_0x49c4('0xde')](_0x4a6cf9[_0x49c4('0x7d')])){if(!_0x3ecb87[_0x49c4('0xde')](_0x4a6cf9['TrunkBackup'])){_0x4a6cf9[_0x49c4('0x42')]=_0x49c4('0x149');throw _0x4a6cf9['name']+'\x20trunk\x20is\x20not\x20reachable';}}};};Dialer[_0x49c4('0x1d')]['checkIfTime']=function(_0x42e0f8,_0x423cc0,_0x4b4ee8,_0x4b4d0f){var _0x458d07=this;return function(){var _0x49f732=!![];return _0x458d07['ifTime'](_0x42e0f8,_0x423cc0,_0x4b4ee8,_0x4b4d0f,_0x49f732);};};Dialer[_0x49c4('0x1d')]['checkIfTimeIntervals']=function(_0x91fb8a,_0x3ca4ba,_0x461cfe,_0x814212){var _0x2e44df=this;return function(){var _0x17ac6d=![];return _0x2e44df[_0x49c4('0x14a')](_0x91fb8a[_0x49c4('0x46')],_0x3ca4ba,_0x461cfe,_0x814212,_0x17ac6d);};};Dialer[_0x49c4('0x1d')][_0x49c4('0x14a')]=function(_0x5b1985,_0x4ac47c,_0x21dd6d,_0x27eeda,_0x456307){var _0xfcf36d=[];return new BPromise(function(_0x1b8dfb,_0x5684ce){if(!isNotNull(_0x5b1985)){_0x27eeda[_0x49c4('0x42')]=_0x49c4('0x45');return _0x5684ce(msgResponse(_0x49c4('0x14a'),'Failure',_0x21dd6d+_0x49c4('0x14b')));}if(_[_0x49c4('0x48')](_0x5b1985)){_0x27eeda[_0x49c4('0x42')]=_0x49c4('0x14c');return _0x5684ce(msgResponse('ifTime',_0x49c4('0x14d'),_0x21dd6d+_0x49c4('0x14e')));}if(_0x4ac47c&&_[_0x49c4('0x3e')](config[_0x49c4('0x14f')][_0x4ac47c])){_0x27eeda[_0x49c4('0x42')]=_0x49c4('0x150');return _0x5684ce(msgResponse(_0x49c4('0x14a'),_0x49c4('0x14d'),_0x21dd6d+_0x49c4('0x151')+_0x4ac47c));}if(_['isArray'](_0x5b1985)){for(var _0x44a7e1=0x0;_0x44a7e1<_0x5b1985[_0x49c4('0xa1')];_0x44a7e1+=0x1){_0xfcf36d[_0x49c4('0x152')](ami[_0x49c4('0xb3')]({'action':_0x49c4('0x153'),'command':util[_0x49c4('0x7f')](_0x49c4('0x154'),_0x5b1985[_0x44a7e1][_0x49c4('0x155')],!_['isUndefined'](config[_0x49c4('0x14f')][_0x4ac47c])?_0x4ac47c:'')})[_0x49c4('0xbf')](function(_0x289016){return _0x289016[_0x49c4('0x156')][_0x49c4('0x157')](_0x49c4('0x158'))>=0x0;})[_0x49c4('0xb6')](myreject(_0x5684ce)));}}else{_0xfcf36d[_0x49c4('0x152')](ami['Action']({'action':_0x49c4('0x153'),'command':util[_0x49c4('0x7f')]('iftime\x20%s,%s',_0x5b1985,!_[_0x49c4('0x3e')](config[_0x49c4('0x14f')][_0x4ac47c])?_0x4ac47c:'')})[_0x49c4('0xbf')](function(_0x6dd9ca){return _0x6dd9ca['content'][_0x49c4('0x157')]('true')>=0x0;})[_0x49c4('0xb6')](myreject(_0x5684ce)));}BPromise['all'](_0xfcf36d)[_0x49c4('0xbf')](function(_0x12f947){var _0x467370=_[_0x49c4('0x159')](_0x12f947);if(_0x467370){return _0x1b8dfb(_0x467370);}else{_0x27eeda[_0x49c4('0x42')]=_0x456307?_0x49c4('0x15a'):_0x49c4('0x15b');return _0x5684ce(msgResponse(_0x49c4('0x15c'),_0x49c4('0x14d'),_0x49c4('0x15d')+_0x456307+'\x20'+_0x21dd6d+_0x49c4('0x15e')+util['inspect'](_0x5b1985,{'showHidden':![],'depth':null})+_0x49c4('0x15f')+_0x4ac47c));}})['catch'](function(_0x377592){return _0x5684ce(msgResponse(_0x49c4('0x14a'),_0x49c4('0x14d'),JSON[_0x49c4('0x4c')](_0x377592)));});});};Dialer[_0x49c4('0x1d')][_0x49c4('0x160')]=function(_0x1fc936){var _0x3827c1=this;return function(){switch(_0x1fc936[_0x49c4('0x60')]){case _0x49c4('0x161'):freeVariablesPredictive(_0x1fc936);_0x3827c1[_0x49c4('0x162')](_0x1fc936,0x1);break;case _0x49c4('0x163'):freeVariablesPredictive(_0x1fc936);_0x3827c1[_0x49c4('0x162')](_0x1fc936,_0x1fc936[_0x49c4('0x164')]);break;case _0x49c4('0x9'):_0x3827c1['predictive'](_0x1fc936);break;case _0x49c4('0x7'):freeVariablesPredictive(_0x1fc936);_0x3827c1['handlePower'](_0x1fc936,0x1);break;default:freeVariablesPredictive(_0x1fc936);logger['error']('Queue',_0x1fc936[_0x49c4('0x40')],_0x49c4('0x165'));}};};Dialer[_0x49c4('0x1d')][_0x49c4('0x166')]=function(_0x3ec261){var _0x55ed90=this;return function(){_0x55ed90['handleIvr'](_0x3ec261);};};Dialer[_0x49c4('0x1d')][_0x49c4('0xb')]=function(_0x558304){var _0x17e278=this;if(isNotPreview(_0x558304[_0x49c4('0x60')])){if(isVoiceQueueOutbound(_0x558304[_0x49c4('0x51')])&&isActive(_0x558304[_0x49c4('0x5f')])){_0x558304[_0x49c4('0xa7')]=!![];BPromise[_0x49c4('0xbe')]()[_0x49c4('0xbf')](checkIsLoggedIn(_0x558304,_0x558304[_0x49c4('0x56')]))[_0x49c4('0xbf')](checkIsActive(_0x558304,_0x558304[_0x49c4('0x5f')]))[_0x49c4('0xbf')](checkInterval(_0x558304))['then'](_0x17e278[_0x49c4('0x167')](_0x558304))[_0x49c4('0xbf')](_0x17e278['checkIfTime'](_0x558304[_0x49c4('0x168')],_0x558304[_0x49c4('0x169')],_0x558304[_0x49c4('0x40')],_0x558304))[_0x49c4('0xbf')](_0x17e278[_0x49c4('0x16a')](_0x558304[_0x49c4('0x49')],_0x558304[_0x49c4('0x169')],_0x558304[_0x49c4('0x40')],_0x558304))[_0x49c4('0xbf')](_0x17e278[_0x49c4('0x160')](_0x558304))[_0x49c4('0xb6')](loggerCatchQueueSummary(_0x49c4('0x16b'),_0x558304));}else{notSendMessagesQueue(_0x558304);}}else{freeVariablesPredictive(_0x558304);}};Dialer[_0x49c4('0x1d')][_0x49c4('0x16c')]=_[_0x49c4('0x16d')](function(){var _0x17a1be=_['filter'](this[_0x49c4('0x21')],function(_0x47b50c){return _0x47b50c[_0x49c4('0x16e')];});var _0x49dd6d=_[_0x49c4('0x16f')](this[_0x49c4('0x23')],function(_0x4d86ba){return _0x4d86ba['online']&&_0x4d86ba[_0x49c4('0xb4')]===_0x49c4('0xe0');});if(_0x17a1be['length']>0x0&&_0x49dd6d[_0x49c4('0xa1')]>0x0){return BPromise[_0x49c4('0xbe')]()[_0x49c4('0xbf')](cmHopper['handlePreviewRecallNotifications'](_[_0x49c4('0x170')](_0x17a1be,'id'),previewRecallmeReminderInterval,_[_0x49c4('0x170')](_0x49dd6d,'id')))[_0x49c4('0xbf')](function(_0x4add25){for(var _0x116f71=0x0;_0x116f71<_0x4add25['length'];_0x116f71++){var _0x1526d7=_0x4add25[_0x116f71][_0x49c4('0x171')][_0x49c4('0x40')];if(_0x1526d7)io['to'](util[_0x49c4('0x7f')](_0x49c4('0x172'),_0x1526d7))[_0x49c4('0x50')](_0x49c4('0x173'),{'hopper':_0x4add25[_0x116f71]});}})[_0x49c4('0xb6')](function(_0x46eba5){logger[_0x49c4('0x9f')]('checkPreviewRecallReminder',_0x46eba5);});}},0x3c*0x3e8,{'leading':!![]});Dialer['prototype'][_0x49c4('0x148')]=function(){var _0x3bbfc4=this;var _0x1ac600;for(var _0x1dfddf in this[_0x49c4('0x22')]){if(typeof this[_0x49c4('0x22')][_0x1dfddf]!=='undefined'){_0x1ac600=this[_0x49c4('0x22')][_0x1dfddf];if(isCampaignIvr(_0x1ac600['type'])&&isActive(_0x1ac600[_0x49c4('0x7e')])){_0x1ac600[_0x49c4('0xa7')]=!![];BPromise[_0x49c4('0xbe')]()[_0x49c4('0xbf')](checkIsActive(_0x1ac600,_0x1ac600['active']))[_0x49c4('0xbf')](checkInterval(_0x1ac600))[_0x49c4('0xbf')](_0x3bbfc4['checkIsTrunkReachable'](_0x1ac600))[_0x49c4('0xbf')](_0x3bbfc4[_0x49c4('0x174')](_0x1ac600['dialGlobalInterval'],_0x1ac600['dialTimezone'],_0x1ac600['name'],_0x1ac600))[_0x49c4('0xbf')](_0x3bbfc4[_0x49c4('0x16a')](_0x1ac600[_0x49c4('0x49')],_0x1ac600[_0x49c4('0x169')],_0x1ac600['name'],_0x1ac600))[_0x49c4('0xbf')](_0x3bbfc4[_0x49c4('0x166')](_0x1ac600))[_0x49c4('0xb6')](loggerCatchQueueSummary(_0x49c4('0x175'),_0x1ac600));}else{notSendMessagesCampaign(_0x1ac600);}}}};function getCallerIdRandom(_0x3593df,_0x3c3150){var _0x3a9a51;var _0xa14085;var _0x4d9c7d;if(_0x3c3150<=0x0){_0x3c3150=0x1;}_0x3a9a51=new RegExp('\x5cw{0,'+_0x3c3150+'}$');_0xa14085=Math[_0x49c4('0x176')](0xa,_0x3c3150-0x1);_0x4d9c7d=Math[_0x49c4('0x176')](0xa,_0x3c3150)-0x1;return util['format']('%s',_['replace'](_0x3593df,_0x3a9a51,_[_0x49c4('0x177')](_0xa14085,_0x4d9c7d)));}function extractCalleridName(_0x38c9c5){var _0x2d5b14=_0x38c9c5[_0x49c4('0x178')](/"(.*?)"/);return _0x2d5b14?_0x2d5b14[0x1]:_0x38c9c5;}function extractCalleridNumber(_0x33a5f9){var _0x299d2d=_0x33a5f9['match'](/<(.*?)>/);return _0x299d2d?_0x299d2d[0x1]:_0x33a5f9;}Dialer[_0x49c4('0x1d')][_0x49c4('0x179')]=function(_0x4f5bbb,_0x3c0d96){var _0xe880b3=this;var _0x4cd867=uuid['v4']();this[_0x49c4('0x27')][_0x4cd867]=new Action(_0x4f5bbb,_0x3c0d96,_0x4cd867);return new BPromise(function(_0x1c352f,_0x5c6df3){if(_[_0x49c4('0x3e')](_0x4f5bbb)&&typeof _0x4f5bbb!==_0x49c4('0x17a')){return _0x5c6df3(msgResponse('originate',_0x49c4('0x14d'),_0x49c4('0x17b')));}if(_['isUndefined'](_0x3c0d96[_0x49c4('0x17c')])||_0x3c0d96[_0x49c4('0x17c')]===null){return _0x5c6df3(msgResponse(_0x49c4('0x17d'),_0x49c4('0x14d'),'contact\x20is\x20undefine'));}var _0x3d28a3={'XMD-CALLERID':_0xe880b3[_0x49c4('0x27')][_0x4cd867][_0x49c4('0x17e')](),'XMD-AGI':_0x4f5bbb[_0x49c4('0x10e')]?util[_0x49c4('0x7f')]('\x22agi://%s/square,%s\x22',ipAgi,_0x4f5bbb['dialQueueProject']):'NONE','XMD-AGIAFTER':_0x4f5bbb[_0x49c4('0x116')]?util[_0x49c4('0x7f')](_0x49c4('0x17f'),ipAgi,_0x4f5bbb[_0x49c4('0x116')]):_0x49c4('0x180'),'XMD-QUEUE':_0x4f5bbb[_0x49c4('0x51')]===_0x49c4('0x52')?util[_0x49c4('0x7f')](_0x49c4('0x181'),_0x4f5bbb[_0x49c4('0x40')],_0x4f5bbb['dialQueueOptions']||'',_0x4f5bbb[_0x49c4('0x117')]?'c':'',_0x4f5bbb[_0x49c4('0x182')]||0x3):_0x49c4('0x180'),'XMD-CONTACTID':_0x3c0d96[_0x49c4('0xd7')],'XMD-CDRTYPE':_0x49c4('0x6'),'CALLERID(all)':_0xe880b3[_0x49c4('0x27')][_0x4cd867][_0x49c4('0x17e')](),'XMD-AMD':_0x4f5bbb[_0x49c4('0xe7')]?_0x49c4('0x183'):_0x49c4('0x180'),'XMD-DESTINATION':_0x49c4('0x184')};if(_0x4f5bbb['dialAMDActive']){_0x3d28a3[_0x49c4('0x185')]=_0x4f5bbb[_0x49c4('0x186')]||0x9c4;_0x3d28a3['XMD-AMDGREETING']=_0x4f5bbb['dialAMDGreeting']||0x5dc;_0x3d28a3[_0x49c4('0x187')]=_0x4f5bbb[_0x49c4('0x188')]||0x320;_0x3d28a3[_0x49c4('0x189')]=_0x4f5bbb[_0x49c4('0x18a')]||0x1388;_0x3d28a3['XMD-AMDMINWORDLENGTH']=_0x4f5bbb[_0x49c4('0x18b')]||0x64;_0x3d28a3['XMD-AMDBETWEENWORDSSILENCE']=_0x4f5bbb[_0x49c4('0x18c')]||0x32;_0x3d28a3[_0x49c4('0x18d')]=_0x4f5bbb[_0x49c4('0x18e')]||0x3;_0x3d28a3[_0x49c4('0x18f')]=_0x4f5bbb[_0x49c4('0x190')]||0x100;_0x3d28a3['XMD-AMDMAXIMUMWORDLENGTH']=_0x4f5bbb['dialAMDMaximumWordLength']||0x1388;}if(_0x4f5bbb[_0x49c4('0x51')]===_0x49c4('0x52')){_0x3d28a3['XMD-VOICEQUEUEID']=_0x3c0d96['VoiceQueueId'];}else{_0x3d28a3['XMD-CAMPAIGNID']=_0x3c0d96[_0x49c4('0xda')];}for(var _0x249170 in _0x3c0d96[_0x49c4('0x191')]){if(typeof _0x3c0d96['Contact'][_0x249170]!==_0x49c4('0xa2')){if(isNotNull(_0x3c0d96[_0x49c4('0x191')][_0x249170])&&_0x249170!=='id'&&_0x249170!==_0x49c4('0x192')&&_0x249170!==_0x49c4('0x193')&&_0x249170!==_0x49c4('0x194')){_0x3d28a3[util['format'](_0x49c4('0x195'),_0x49c4('0x196'),_[_0x49c4('0x197')](_0x249170))]=_0x3c0d96['Contact'][_0x249170];}}}var _0x3880ad=_0xe880b3[_0x49c4('0xde')](_0x4f5bbb[_0x49c4('0x7d')])?getCallerId(_0x4f5bbb[_0x49c4('0x7d')]['callerid'],_0x4f5bbb[_0x49c4('0x61')],_0x4f5bbb[_0x49c4('0x198')]>0x0?getCallerIdRandom(_0x4f5bbb[_0x49c4('0x199')],_0x4f5bbb['dialRandomLastDigitCallerIdNumber']):_0x4f5bbb[_0x49c4('0x199')]):getCallerId(_['isNil'](_0x4f5bbb[_0x49c4('0x19a')])?_0x4f5bbb['Trunk'][_0x49c4('0x19b')]:_0x4f5bbb[_0x49c4('0x19a')][_0x49c4('0x19b')],_0x4f5bbb['dialOriginateCallerIdName'],_0x4f5bbb[_0x49c4('0x198')]>0x0?getCallerIdRandom(_0x4f5bbb[_0x49c4('0x199')],_0x4f5bbb['dialRandomLastDigitCallerIdNumber']):_0x4f5bbb['dialOriginateCallerIdNumber']);if(_0x3880ad){_0x3d28a3[_0x49c4('0x19c')]=_0xe880b3[_0x49c4('0x27')][_0x4cd867]['originatecalleridname']=extractCalleridName(_0x3880ad);_0x3d28a3[_0x49c4('0x19d')]=_0x3c0d96[_0x49c4('0x17c')];}return ami['Action']({'actionid':_0x4cd867,'action':_0x49c4('0x17d'),'channel':_0xe880b3[_0x49c4('0xde')](_0x4f5bbb[_0x49c4('0x7d')])?util[_0x49c4('0x7f')](_0x49c4('0x19e'),_0x4f5bbb[_0x49c4('0x7d')][_0x49c4('0x40')],isNotNull(_0x4f5bbb[_0x49c4('0x62')])?_0x4f5bbb[_0x49c4('0x62')][_0x49c4('0x19f')]()||'':'',_0x4f5bbb[_0x49c4('0x1a0')]>0x0?_0x3c0d96[_0x49c4('0x17c')][_0x49c4('0x1a1')](_0x4f5bbb['dialCutDigit']):_0x3c0d96[_0x49c4('0x17c')]):util['format']('SIP/%s/%s%s',_[_0x49c4('0xb2')](_0x4f5bbb[_0x49c4('0x19a')])?_0x4f5bbb['Trunk'][_0x49c4('0x40')]:_0x4f5bbb[_0x49c4('0x19a')][_0x49c4('0x40')],isNotNull(_0x4f5bbb[_0x49c4('0x62')])?_0x4f5bbb[_0x49c4('0x62')][_0x49c4('0x19f')]()||'':'',_0x4f5bbb[_0x49c4('0x1a0')]>0x0?_0x3c0d96['phone'][_0x49c4('0x1a1')](_0x4f5bbb[_0x49c4('0x1a0')]):_0x3c0d96[_0x49c4('0x17c')]),'callerid':_0x3880ad,'Exten':_0x49c4('0x184'),'Context':_0x49c4('0x1a2'),'Priority':'1','variable':_0x3d28a3,'timeout':(_0x4f5bbb[_0x49c4('0x1a3')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4cd867})[_0x49c4('0xbf')](function(_0x2d1f54){return _0x1c352f(_0x2d1f54);})[_0x49c4('0xb6')](function(_0x5c166e){_0x4f5bbb[_0x49c4('0x6c')]+=0x1;var _0xcb1169=new History(_0xe880b3[_0x49c4('0x27')][_0x4cd867]);logger[_0x49c4('0x9f')](util[_0x49c4('0x7f')](_0x49c4('0x1a4'),JSON[_0x49c4('0x4c')](_0x5c166e)));_0xcb1169['state']=0xe;_0xcb1169[_0x49c4('0xe9')]='OriginateError';_0xcb1169[_0x49c4('0xae')]=moment()[_0x49c4('0x7f')](_0x49c4('0xff'));_0xcb1169[_0x49c4('0x12a')]=_0xcb1169[_0x49c4('0xae')];_0xe880b3[_0x49c4('0xd1')](_0xcb1169)['catch'](loggerCatch('[originate][error]'));_0xe880b3['moveContactManagedDialer'](_0xcb1169)[_0x49c4('0xb6')](loggerCatch(_0x49c4('0x1a5')))[_0x49c4('0x1f')](function(){delete _0xe880b3[_0x49c4('0x27')][_0x4cd867];return _0x5c6df3(msgResponse('originate','Error',_0x49c4('0x1a6')));});});});};Dialer['prototype'][_0x49c4('0x1a7')]=function(_0xdb57b7){var _0x5ea0e0=this[_0x49c4('0x27')][_0xdb57b7[_0x49c4('0x134')]];if(_0x5ea0e0){delete this['actions'][_0xdb57b7['actionid']];_0x5ea0e0[_0x49c4('0x11e')]=moment()['format'](_0x49c4('0xff'));var _0x5a7815=_0x5ea0e0[_0x49c4('0x51')]===_0x49c4('0x99')?this[_0x49c4('0x22')][_0x5ea0e0[_0x49c4('0xb9')]]:this[_0x49c4('0x21')][_0x5ea0e0['getQueue']()];if(!this[_0x49c4('0xdd')](_0xdb57b7[_0x49c4('0x1a8')])){this[_0x49c4('0xb8')](_0x5a7815);return this['callProgressDetecting'](_0x5ea0e0,_0x5a7815,_0xdb57b7)[_0x49c4('0xb6')](loggerCatch(_0x49c4('0x1a9')));}this['uniqueId'][_0xdb57b7[_0x49c4('0xe3')]]=_0x5ea0e0;}};Dialer[_0x49c4('0x1d')][_0x49c4('0x1aa')]=function(_0x490963,_0x42e852,_0x3e4764){var _0x1d49c8=new History(_0x42e852);if(_0x1d49c8[_0x49c4('0x1ab')]+_0x1d49c8['countcongestionretry']+_0x1d49c8[_0x49c4('0x104')]+_0x1d49c8[_0x49c4('0x105')]+_0x1d49c8[_0x49c4('0xf5')]+_0x1d49c8['countabandonedretry']+_0x1d49c8[_0x49c4('0xf7')]+_0x1d49c8['countagentrejectretry']>=_0x3e4764[_0x49c4('0xf8')]-0x1){return!![];}switch(_0x490963){case 0x3:if(_0x1d49c8[_0x49c4('0x104')]>=_0x3e4764['dialNoAnswerMaxRetry']-0x1){return!![];}this[_0x49c4('0xc4')]({'active':![],'countnoanswerretry':_0x1d49c8[_0x49c4('0x104')]+=0x1,'scheduledat':moment()[_0x49c4('0x128')](_0x3e4764['dialNoAnswerRetryFrequency'],_0x49c4('0xfe'))[_0x49c4('0x7f')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1d49c8[_0x49c4('0xd7')],'ListId':_0x1d49c8[_0x49c4('0x108')],'VoiceQueueId':_0x1d49c8['VoiceQueueId']||undefined,'CampaignId':_0x1d49c8[_0x49c4('0xda')]||undefined})[_0x49c4('0xb6')](loggerCatch(_0x49c4('0x1ac')));break;case 0x5:if(_0x1d49c8[_0x49c4('0x1ab')]>=_0x3e4764[_0x49c4('0x1ad')]-0x1){return!![];}this[_0x49c4('0xc4')]({'active':![],'countbusyretry':_0x1d49c8[_0x49c4('0x1ab')]+=0x1,'scheduledat':moment()[_0x49c4('0x128')](_0x3e4764['dialBusyRetryFrequency'],'minutes')[_0x49c4('0x7f')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1d49c8[_0x49c4('0xd7')],'ListId':_0x1d49c8[_0x49c4('0x108')],'VoiceQueueId':_0x1d49c8[_0x49c4('0xd9')]||undefined,'CampaignId':_0x1d49c8[_0x49c4('0xda')]||undefined})['catch'](loggerCatch(_0x49c4('0x1ae')));break;case 0x8:if(_0x1d49c8[_0x49c4('0xf4')]>=_0x3e4764[_0x49c4('0x1af')]-0x1){return!![];}this[_0x49c4('0xc4')]({'active':![],'countcongestionretry':_0x1d49c8[_0x49c4('0xf4')]+=0x1,'scheduledat':moment()[_0x49c4('0x128')](_0x3e4764[_0x49c4('0x1b0')],'minutes')['format'](_0x49c4('0xff')),'ContactId':_0x1d49c8[_0x49c4('0xd7')],'ListId':_0x1d49c8[_0x49c4('0x108')],'VoiceQueueId':_0x1d49c8[_0x49c4('0xd9')]||undefined,'CampaignId':_0x1d49c8[_0x49c4('0xda')]||undefined})[_0x49c4('0xb6')](loggerCatch(_0x49c4('0x1b1')));break;case 0x0:if(_0x1d49c8[_0x49c4('0x105')]>=_0x3e4764[_0x49c4('0x1b2')]-0x1){return!![];}else{this[_0x49c4('0xc4')]({'active':![],'countnosuchnumberretry':_0x1d49c8[_0x49c4('0x105')]+=0x1,'scheduledat':moment()[_0x49c4('0x128')](_0x3e4764[_0x49c4('0x1b3')],'minutes')[_0x49c4('0x7f')](_0x49c4('0xff')),'ContactId':_0x1d49c8[_0x49c4('0xd7')],'ListId':_0x1d49c8[_0x49c4('0x108')],'VoiceQueueId':_0x1d49c8[_0x49c4('0xd9')]||undefined,'CampaignId':_0x1d49c8[_0x49c4('0xda')]||undefined})[_0x49c4('0xb6')](loggerCatch(_0x49c4('0x1b4')));}break;case 0xa:if(_0x1d49c8[_0x49c4('0xf5')]>=_0x3e4764[_0x49c4('0x127')]-0x1){return!![];}this[_0x49c4('0xc4')]({'active':![],'countdropretry':_0x1d49c8[_0x49c4('0xf5')]+=0x1,'scheduledat':moment()[_0x49c4('0x128')](_0x3e4764[_0x49c4('0x122')],_0x49c4('0xfe'))[_0x49c4('0x7f')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1d49c8[_0x49c4('0xd7')],'ListId':_0x1d49c8[_0x49c4('0x108')],'VoiceQueueId':_0x1d49c8[_0x49c4('0xd9')]||undefined,'CampaignId':_0x1d49c8[_0x49c4('0xda')]||undefined})[_0x49c4('0xb6')](loggerCatch(_0x49c4('0x129')));break;case 0xb:if(_0x1d49c8['countabandonedretry']>=_0x3e4764['dialAbandonedMaxRetry']-0x1){return!![];}this[_0x49c4('0xc4')]({'active':![],'countabandonedretry':_0x1d49c8[_0x49c4('0xf6')]+=0x1,'scheduledat':moment()[_0x49c4('0x128')](_0x3e4764[_0x49c4('0x12f')],_0x49c4('0xfe'))[_0x49c4('0x7f')](_0x49c4('0xff')),'ContactId':_0x1d49c8[_0x49c4('0xd7')],'ListId':_0x1d49c8['ListId'],'VoiceQueueId':_0x1d49c8['VoiceQueueId']||undefined,'CampaignId':_0x1d49c8[_0x49c4('0xda')]||undefined})['catch'](loggerCatch(_0x49c4('0x131')));break;case 0x13:if(_0x1d49c8[_0x49c4('0xf7')]>=_0x3e4764[_0x49c4('0xfa')]-0x1){return!![];}this[_0x49c4('0xc4')]({'active':![],'countmachineretry':_0x1d49c8['countmachineretry']+=0x1,'scheduledat':moment()[_0x49c4('0x128')](_0x3e4764[_0x49c4('0xfd')],_0x49c4('0xfe'))['format'](_0x49c4('0xff')),'ContactId':_0x1d49c8[_0x49c4('0xd7')],'ListId':_0x1d49c8[_0x49c4('0x108')],'VoiceQueueId':_0x1d49c8[_0x49c4('0xd9')]||undefined,'CampaignId':_0x1d49c8[_0x49c4('0xda')]||undefined})[_0x49c4('0xb6')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x1d49c8[_0x49c4('0x106')]>=_0x3e4764['dialAgentRejectMaxRetry']-0x1){return!![];}this[_0x49c4('0xc4')]({'active':![],'countagentrejectretry':_0x1d49c8[_0x49c4('0x106')]+=0x1,'scheduledat':moment()['add'](_0x3e4764['dialAgentRejectRetryFrequency'],_0x49c4('0xfe'))['format'](_0x49c4('0xff')),'ContactId':_0x1d49c8[_0x49c4('0xd7')],'ListId':_0x1d49c8[_0x49c4('0x108')],'VoiceQueueId':_0x1d49c8[_0x49c4('0xd9')]||undefined,'CampaignId':_0x1d49c8[_0x49c4('0xda')]||undefined})[_0x49c4('0xb6')](loggerCatch(_0x49c4('0x1b5')));break;default:return!![];}};Dialer[_0x49c4('0x1d')][_0x49c4('0x1b6')]=function(_0x3d605c,_0x410df1,_0x58cc6d){var _0x23e4ff=this;var _0x3733ed=new History(_0x3d605c);var _0x34792d=![];var _0x4c8afb;var _0x231fbf;return new BPromise(function(_0x229b49,_0x3c68bc){if(_['isUndefined'](_0x410df1)&&typeof _0x410df1!=='object'){return _0x3c68bc(msgResponse('[callProgressDetecting]',_0x49c4('0x14d'),_0x49c4('0x1b7')));}if(_[_0x49c4('0x3e')](_0x58cc6d)&&typeof _0x58cc6d!==_0x49c4('0x17a')){return _0x3c68bc(msgResponse('[callProgressDetecting]',_0x49c4('0x14d'),_0x49c4('0x1b8')));}_0x23e4ff[_0x49c4('0x124')](_0x3733ed,_0x58cc6d[_0x49c4('0x113')],_0x410df1)[_0x49c4('0xbf')](function(_0x436020){if(_0x436020[_0x49c4('0x126')]==0x1)_0x34792d=!![];switch(_0x58cc6d['reason']){case'0':_0x410df1[_0x49c4('0x6b')]+=0x1;_0x3733ed[_0x49c4('0xad')]=0x0;_0x3733ed['statedesc']=_0x49c4('0x1b9');_0x3733ed['countnosuchnumberretry']+=0x1;_0x3733ed[_0x49c4('0xf1')]+=0x1;ami[_0x49c4('0x50')](_0x49c4('0x1ba'),ut[_0x49c4('0xed')](_0x3d605c,'nosuchnumber'));_0x4c8afb=_0x410df1['dialNoSuchNumberRetryFrequency'];_0x231fbf=_0x410df1[_0x49c4('0x123')];_0x23e4ff['createHistory'](_0x3733ed)['catch'](loggerCatch(_0x49c4('0xf3')));if(_0x23e4ff[_0x49c4('0x1aa')](0x0,_0x3d605c,_0x410df1)&&!_0x34792d){if(_0x3733ed[_0x49c4('0x105')]>=_0x410df1[_0x49c4('0x1b2')]){_0x23e4ff[_0x49c4('0xfb')](_0x3733ed,_0x229b49,_0x3c68bc,'reason\x200\x20no\x20such\x20number....');}else{_0x23e4ff['stateGlobal'](_0x3733ed,_0x229b49,_0x3c68bc,_0x49c4('0x1bb'));}}break;case'3':_0x410df1[_0x49c4('0x6a')]+=0x1;_0x3733ed[_0x49c4('0xad')]=0x3;_0x3733ed['statedesc']=_0x49c4('0x1bc');_0x3733ed[_0x49c4('0x104')]+=0x1;_0x3733ed['countglobal']+=0x1;ami[_0x49c4('0x50')](_0x49c4('0x1bd'),ut['buildObj'](_0x3d605c,_0x49c4('0x1be')));_0x4c8afb=_0x410df1[_0x49c4('0x1bf')];_0x231fbf=_0x410df1[_0x49c4('0x123')];_0x23e4ff['createHistory'](_0x3733ed)[_0x49c4('0xb6')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x23e4ff[_0x49c4('0x1aa')](0x3,_0x3d605c,_0x410df1)&&!_0x34792d){if(_0x3733ed[_0x49c4('0x104')]>=_0x410df1['dialNoAnswerMaxRetry']){_0x23e4ff[_0x49c4('0xfb')](_0x3733ed,_0x229b49,_0x3c68bc,_0x49c4('0x1c0'));}else{_0x23e4ff[_0x49c4('0x107')](_0x3733ed,_0x229b49,_0x3c68bc,_0x49c4('0x1c0'));}}break;case'5':_0x410df1['outboundBusyCallsDay']+=0x1;_0x3733ed[_0x49c4('0xad')]=0x5;_0x3733ed['statedesc']=_0x49c4('0x1c1');_0x3733ed[_0x49c4('0x1ab')]+=0x1;_0x3733ed[_0x49c4('0xf1')]+=0x1;ami['emit']('custom:agentbusy',ut[_0x49c4('0xed')](_0x3d605c,_0x49c4('0x1c2')));_0x4c8afb=_0x410df1['dialBusyRetryFrequency'];_0x231fbf=_0x410df1[_0x49c4('0x123')];_0x23e4ff[_0x49c4('0xd1')](_0x3733ed)[_0x49c4('0xb6')](loggerCatch(_0x49c4('0x1c3')));if(_0x23e4ff['checkRetriveMax'](0x5,_0x3d605c,_0x410df1)&&!_0x34792d){if(_0x3733ed['countbusyretry']>=_0x410df1['dialBusyMaxRetry']){_0x23e4ff[_0x49c4('0xfb')](_0x3733ed,_0x229b49,_0x3c68bc,_0x49c4('0x1c4'));}else{_0x23e4ff[_0x49c4('0x107')](_0x3733ed,_0x229b49,_0x3c68bc,_0x49c4('0x1c4'));}}break;case'8':_0x410df1[_0x49c4('0x66')]+=0x1;_0x3733ed[_0x49c4('0xad')]=0x8;_0x3733ed[_0x49c4('0xe9')]=_0x49c4('0x1c5');_0x3733ed[_0x49c4('0xf4')]+=0x1;_0x3733ed[_0x49c4('0xf1')]+=0x1;_0x4c8afb=_0x410df1[_0x49c4('0x1b0')];_0x231fbf=_0x410df1[_0x49c4('0x123')];ami[_0x49c4('0x50')](_0x49c4('0x1c6'),ut[_0x49c4('0xed')](_0x3d605c,_0x49c4('0x1c7')));_0x23e4ff[_0x49c4('0xd1')](_0x3733ed)['catch'](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x23e4ff[_0x49c4('0x1aa')](0x8,_0x3d605c,_0x410df1)&&!_0x34792d){if(_0x3733ed[_0x49c4('0xf4')]>=_0x410df1['dialCongestionMaxRetry']){_0x23e4ff[_0x49c4('0xfb')](_0x3733ed,_0x229b49,_0x3c68bc,_0x49c4('0x1c8'));}else{_0x23e4ff[_0x49c4('0x107')](_0x3733ed,_0x229b49,_0x3c68bc,_0x49c4('0x1c8'));}}break;case'11':_0x410df1[_0x49c4('0x1c9')]+=0x1;_0x3733ed[_0x49c4('0xad')]=0xb;_0x3733ed[_0x49c4('0xe9')]=_0x49c4('0x12d');_0x3733ed['countabandonedretry']+=0x1;_0x3733ed[_0x49c4('0xf1')]+=0x1;_0x4c8afb=_0x410df1[_0x49c4('0x12f')];_0x231fbf=_0x410df1['callAdditionalPhoneAfterMin'];_0x23e4ff[_0x49c4('0xd1')](_0x3733ed)['catch'](loggerCatch(_0x49c4('0x133')));if(_0x23e4ff[_0x49c4('0x1aa')](0xb,_0x3d605c,_0x410df1)&&!_0x34792d){if(_0x3733ed[_0x49c4('0xf6')]>=_0x410df1[_0x49c4('0x130')]){_0x23e4ff[_0x49c4('0xfb')](_0x3733ed,_0x229b49,_0x3c68bc,_0x49c4('0x1ca'));}else{_0x23e4ff['stateGlobal'](_0x3733ed,_0x229b49,_0x3c68bc,_0x49c4('0x1ca'));}}break;case'20':_0x410df1[_0x49c4('0x6e')]+=0x1;_0x3733ed['state']=0x14;_0x3733ed['statedesc']=_0x49c4('0x1cb');_0x3733ed[_0x49c4('0x106')]+=0x1;_0x3733ed[_0x49c4('0xf1')]+=0x1;_0x4c8afb=_0x410df1[_0x49c4('0x1cc')];_0x231fbf=_0x410df1[_0x49c4('0x123')];ami[_0x49c4('0x50')]('custom:agentreject',ut[_0x49c4('0xed')](_0x3d605c,_0x49c4('0x1cd')));_0x23e4ff['createHistory'](_0x3733ed)[_0x49c4('0xb6')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x23e4ff[_0x49c4('0x1aa')](0x14,_0x3d605c,_0x410df1)&&!_0x34792d){if(_0x3733ed[_0x49c4('0x106')]>=_0x410df1[_0x49c4('0x1ce')]){_0x23e4ff['createStateFinal'](_0x3733ed,_0x229b49,_0x3c68bc,_0x49c4('0x1cf'));}else{_0x23e4ff[_0x49c4('0x107')](_0x3733ed,_0x229b49,_0x3c68bc,_0x49c4('0x1cf'));}}break;default:_0x410df1[_0x49c4('0x10f')]+=0x1;_0x3733ed[_0x49c4('0xad')]=0xc;_0x3733ed[_0x49c4('0xe9')]=_0x58cc6d[_0x49c4('0x113')];_0x4c8afb=_0x410df1['dialAgentRejectRetryFrequency'];_0x231fbf=_0x410df1[_0x49c4('0x123')];_0x23e4ff['createHistory'](_0x3733ed)[_0x49c4('0xb6')](loggerCatch(_0x49c4('0x1d0')));if(_0x23e4ff[_0x49c4('0x1aa')](_0x58cc6d[_0x49c4('0x113')],_0x3d605c,_0x410df1)&&!_0x34792d){if(_0x3733ed[_0x49c4('0x1ab')]+_0x3733ed[_0x49c4('0xf4')]+_0x3733ed['countnoanswerretry']+_0x3733ed[_0x49c4('0x105')]+_0x3733ed['countdropretry']+_0x3733ed[_0x49c4('0xf6')]+_0x3733ed[_0x49c4('0xf7')]+_0x3733ed[_0x49c4('0x106')]>=_0x410df1['dialGlobalMaxRetry']){_0x23e4ff[_0x49c4('0x107')](_0x3733ed,_0x229b49,_0x3c68bc,_0x58cc6d['reason']);}else{_0x23e4ff[_0x49c4('0xfb')](_0x3733ed,_0x229b49,_0x3c68bc,_0x58cc6d[_0x49c4('0x113')]);}}}})['then'](function(_0x2a4dfa){if(_0x34792d){_0x23e4ff[_0x49c4('0x12c')](_0x3733ed,_0x4c8afb,_0x231fbf)['then'](function(_0x35a39c){return _0x229b49(0x1);});}});});};Dialer[_0x49c4('0x1d')][_0x49c4('0x107')]=function(_0x3a3125,_0x3bf3a8,_0x2ad95f,_0xdd02ca){var _0x4ed899=new Final(_0x3a3125);_0x4ed899[_0x49c4('0xad')]=0xf;_0x4ed899[_0x49c4('0xe9')]='Global';this['createStateFinal'](_0x4ed899,_0x3bf3a8,_0x2ad95f,_0xdd02ca);};Dialer['prototype']['createStateFinal']=function(_0x424223,_0x114808,_0x291c51,_0x2841db){this[_0x49c4('0xcf')](_0x424223)['then'](function(){return _0x114808(msgResponse(_0x49c4('0x1d1'),'Success',_0x2841db));})[_0x49c4('0xb6')](function(){return _0x291c51(msgResponse(_0x49c4('0x1d2'),_0x49c4('0x14d'),'contact\x20not\x20moved'));});};Dialer[_0x49c4('0x1d')][_0x49c4('0x9')]=function(_0xa14512){var _0xe8849a=_0xa14512[_0x49c4('0x1d3')]/0x64;var _0x24dd7c=_0xa14512[_0x49c4('0x69')]/(_0xa14512[_0x49c4('0x69')]+_0xa14512['outboundAnswerCallsDay']);var _0x215003=Math[_0x49c4('0x1d4')](_0xa14512['predictiveIntervalAvailable']*(_0xa14512[_0x49c4('0x1d5')]/0x64));var _0x5585e8=Math['round'](_0xa14512[_0x49c4('0x77')]*(_0xa14512[_0x49c4('0x1d6')]/0x64));var _0x4a83fe=_0xa14512[_0x49c4('0x55')]+_0xa14512[_0x49c4('0x5b')];var _0x15f7a5=Math[_0x49c4('0x1d7')](_0xa14512[_0x49c4('0x7a')]*_0xa14512['erlangAbandonmentRate']*_0xa14512[_0x49c4('0x1d8')]*_0xa14512[_0x49c4('0x75')]);if(_[_0x49c4('0x3e')](_0xa14512['startProgressive'])){if(!_['isUndefined'](_0xa14512['startPredictive'])){_0xa14512[_0x49c4('0x2b')]=undefined;loggerPredictive['error']('[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0x49c4('0x3e')](_0xa14512[_0x49c4('0x1d9')])){loggerPredictive[_0x49c4('0x9f')](_0x49c4('0x1da'),_0x49c4('0x1db'));clearInterval(_0xa14512['handlePredictive']);_0xa14512[_0x49c4('0x1d9')]=undefined;}_0xa14512[_0x49c4('0x7c')]=moment()[_0x49c4('0x7f')](_0x49c4('0xff'));loggerPredictive[_0x49c4('0x84')](_0xa14512[_0x49c4('0x40')],_0x49c4('0x1dc'),_0xa14512[_0x49c4('0x7c')]);this['handlePower'](_0xa14512,0x1);}else if(ifInterval(_0xa14512[_0x49c4('0x1dd')],_0xa14512[_0x49c4('0x7c')])){this[_0x49c4('0x162')](_0xa14512,0x1);loggerPredictiveCalls[_0x49c4('0x84')](_0x49c4('0x1de'),_0xa14512['startProgressive'],_0xa14512[_0x49c4('0x40')]);_0xa14512[_0x49c4('0x7a')]=0x0;_0xa14512[_0x49c4('0x74')]=0x0;}else if(_0xe8849a<_0x24dd7c&&_0xa14512['dialPredictiveOptimization']===_0x49c4('0x1df')){freeVariablesPredictive(_0xa14512);loggerPredictive[_0x49c4('0x84')](_0x49c4('0x1e0'),_0x49c4('0x1e1'),_0x24dd7c,_0x49c4('0x7c'),_0xa14512[_0x49c4('0x40')]);}else if(_0x15f7a5<_0xa14512[_0x49c4('0x74')]&&_0xa14512[_0x49c4('0x1e2')]===_0x49c4('0x1df')){freeVariablesPredictive(_0xa14512);loggerPredictive[_0x49c4('0x84')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0x49c4('0x1e3'),_0x15f7a5,'Drop\x20in\x20this\x20interval',_0xa14512['predictiveIntervalErlangCallsDroppedCalls'],_0x49c4('0x7c'),_0xa14512[_0x49c4('0x40')]);}else if(!ifInterval(_0xa14512[_0x49c4('0x1dd')],_0xa14512[_0x49c4('0x7c')])&&_[_0x49c4('0x3e')](_0xa14512['startPredictive'])&&!_[_0x49c4('0x3e')](_0xa14512['startProgressive'])){_0xa14512[_0x49c4('0x2b')]=moment()['format'](_0x49c4('0xff'));loggerPredictive['info'](_0xa14512[_0x49c4('0x40')],'started\x20in\x20predictive\x20at',_0xa14512[_0x49c4('0x2b')]);this[_0x49c4('0xc2')](_0xa14512[_0x49c4('0x1dd')])[_0x49c4('0xbf')](this[_0x49c4('0x1e4')](_0xa14512))[_0x49c4('0xbf')](mergeDataErlangB(_0xa14512))['then'](this[_0x49c4('0x1e5')](_0xa14512))[_0x49c4('0xb6')](loggerCatchPredictive(_0x49c4('0x1e6'),_0xa14512));}else if(!ifInterval(_0xa14512['dialPredictiveInterval'],_0xa14512[_0x49c4('0x2b')])){_0xa14512[_0x49c4('0x74')]=0x0;_0xa14512['startPredictive']=moment()[_0x49c4('0x7f')](_0x49c4('0xff'));loggerPredictive[_0x49c4('0x84')](_0xa14512[_0x49c4('0x40')],_0x49c4('0x1e7'),_0xa14512[_0x49c4('0x2b')]);clearInterval(_0xa14512[_0x49c4('0x1d9')]);_0xa14512[_0x49c4('0x1d9')]=undefined;this['averageHandleTime'](_0xa14512['dialPredictiveInterval'])['then'](this[_0x49c4('0x1e4')](_0xa14512))[_0x49c4('0xbf')](mergeDataErlangB(_0xa14512))[_0x49c4('0xbf')](this[_0x49c4('0x1e5')](_0xa14512))[_0x49c4('0xb6')](loggerCatchPredictive(_0x49c4('0x1e8'),_0xa14512));}else if(_0xa14512['predictiveIntervalAvailable']&&_0x4a83fe<_0xa14512[_0x49c4('0x77')]-_0x5585e8){freeVariablesPredictive(_0xa14512);loggerPredictive['info'](_0xa14512['name'],_0x49c4('0x1e9'),_0x4a83fe,_0x49c4('0x1ea'),_0xa14512[_0x49c4('0x77')],'-',_0x5585e8,'=',_0xa14512[_0x49c4('0x77')]-_0x5585e8,')');}else if(_0xa14512[_0x49c4('0x77')]&&_0x4a83fe>_0xa14512['predictiveIntervalAvailable']+_0x215003){freeVariablesPredictive(_0xa14512);loggerPredictive[_0x49c4('0x84')](_0xa14512['name'],_0x49c4('0x1e9'),_0x4a83fe,_0x49c4('0x1eb'),_0xa14512[_0x49c4('0x77')],'+',_0x215003,'=',_0xa14512[_0x49c4('0x77')]+_0x215003,')');}};Dialer[_0x49c4('0x1d')][_0x49c4('0x1e4')]=function(_0x254d98){var _0x1e75a0=this;return function(_0x1b30fb){return new BPromise(function(_0x13a7bf,_0x37f980){_[_0x49c4('0x95')](_0x254d98,_0x1b30fb[0x0]);if(checkGetDataPredictive(_0x1b30fb[0x0])){var _0x5004b3=_0x254d98['predictiveIntervalAvailable']=_0x254d98[_0x49c4('0x5b')]+_0x254d98['available'];var _0x4c44cd=_0x254d98[_0x49c4('0x1dd')]*0x3c;var _0x3cd20d=_0x1b30fb[0x0][_0x49c4('0x70')]+_0x1b30fb[0x0][_0x49c4('0x89')];var _0xdcffa8=(_0x1b30fb[0x0][_0x49c4('0x6f')]+_0x1b30fb[0x0][_0x49c4('0x72')]+_0x1b30fb[0x0][_0x49c4('0x71')])/_0x1b30fb[0x0][_0x49c4('0x78')];_0x254d98['predictiveIntervalHitRate']=_0xdcffa8>0x0?_0xdcffa8:0x1;switch(_0x254d98['dialPredictiveOptimization']){case _0x49c4('0x1df'):var _0x365c1a=_0x254d98[_0x49c4('0x1d3')]/0x64;return _0x1e75a0[_0x49c4('0x1ec')](_0x5004b3,_0x4c44cd,_0x3cd20d,_0xdcffa8,_0x365c1a)[_0x49c4('0xbf')](function(_0xd41e54){return _0x13a7bf(_0xd41e54);});case _0x49c4('0x1ed'):var _0xe2bd2d=_0x254d98['dialPredictiveOptimizationPercentage']/0x64;return _0x1e75a0[_0x49c4('0x1ee')](_0x5004b3,_0x4c44cd,_0x3cd20d,_0xdcffa8,_0xe2bd2d)[_0x49c4('0xbf')](function(_0x321575){return _0x13a7bf(_0x321575);});default:return _0x37f980(msgResponse('[getDataPredictive]',_0x49c4('0x14d'),'Unknown\x20Predictive'));}}else{return _0x37f980(msgResponse(_0x49c4('0x1ef'),_0x49c4('0x14d'),_0x49c4('0x1f0')));}});};};Dialer[_0x49c4('0x1d')][_0x49c4('0x1f1')]=function(_0x938728){var _0x41b759=this;return function(_0x3382c4){return new BPromise(function(_0x30a351,_0x31d60a){_[_0x49c4('0x95')](_0x938728,_0x3382c4[0x0]);if(checkGetDataPredictive(_0x3382c4[0x0])){loggerPredictive[_0x49c4('0x84')](JSON[_0x49c4('0x4c')](_0x3382c4[0x0]));if(_0x938728['dialPredictiveOptimization']===_0x49c4('0x1df')){return _0x41b759[_0x49c4('0xcd')](_0x938728['id'])[_0x49c4('0xbf')](function(_0x5f42a6){var _0x522ed0=_0x938728[_0x49c4('0x56')]-_0x5f42a6[0x0][_0x49c4('0x1f2')];var _0x274a1e=_0x938728[_0x49c4('0x1dd')]*0x3c;var _0x4daf5d=_0x3382c4[0x0][_0x49c4('0x70')]+_0x3382c4[0x0]['predictiveIntervalAvgHoldtime'];var _0x29e866=(_0x3382c4[0x0][_0x49c4('0x6f')]+_0x3382c4[0x0][_0x49c4('0x72')]+_0x3382c4[0x0][_0x49c4('0x71')])/_0x3382c4[0x0][_0x49c4('0x78')];var _0x2b5d7d=_0x938728[_0x49c4('0x1d3')]/0x64;_0x938728[_0x49c4('0x76')]=_0x5f42a6[0x0][_0x49c4('0x1f2')]||0x0;_0x938728[_0x49c4('0x1d8')]=_0x29e866>0x0?_0x29e866:0x1;return _0x41b759[_0x49c4('0x1ec')](_0x522ed0,_0x274a1e,_0x4daf5d,_0x29e866,_0x2b5d7d);})[_0x49c4('0xbf')](function(_0x2dc805){return _0x30a351(_0x2dc805);})[_0x49c4('0xb6')](function(_0x1b18ea){return _0x31d60a(msgResponse(_0x49c4('0x1f3'),_0x49c4('0x14d'),JSON[_0x49c4('0x4c')](_0x1b18ea)));});}if(_0x938728[_0x49c4('0x1e2')]===_0x49c4('0x1ed')){return _0x41b759['getVoiceQueueRtPauses'](_0x938728['id'])[_0x49c4('0xbf')](function(_0x10c43a){var _0x388f69=_0x938728[_0x49c4('0x56')]-_0x10c43a[0x0][_0x49c4('0x1f2')];var _0x386863=_0x938728[_0x49c4('0x1dd')]*0x3c;var _0x27e9d4=_0x3382c4[0x0][_0x49c4('0x70')]+_0x3382c4[0x0][_0x49c4('0x89')];var _0x3c9770=(_0x3382c4[0x0]['predictiveIntervalAnsweredCalls']+_0x3382c4[0x0][_0x49c4('0x72')]+_0x3382c4[0x0][_0x49c4('0x71')])/_0x3382c4[0x0]['predictiveIntervalTotalCalls'];var _0x2c9cf7=_0x938728[_0x49c4('0x1d3')]/0x64;_0x938728[_0x49c4('0x76')]=_0x10c43a[0x0][_0x49c4('0x1f2')]||0x0;_0x938728[_0x49c4('0x1d8')]=_0x3c9770>0x0?_0x3c9770:0x1;return _0x41b759[_0x49c4('0x1ee')](_0x388f69,_0x386863,_0x27e9d4,_0x3c9770,_0x2c9cf7);})['then'](function(_0x58d166){return _0x30a351(_0x58d166);})[_0x49c4('0xb6')](function(_0x33624f){return _0x31d60a(msgResponse(_0x49c4('0x1f3'),'Failure',JSON[_0x49c4('0x4c')](_0x33624f)));});}}else{return _0x31d60a(msgResponse(_0x49c4('0x1ef'),'Failure','check\x20failure'));}});};};Dialer[_0x49c4('0x1d')][_0x49c4('0x1e5')]=function(_0x1c5c95){var _0x5c15ff=this;return function(){var _0x43207c=0x0;var _0xd69438=Math[_0x49c4('0x1d7')](_0x1c5c95['erlangCallToSecond']*0x3e8);if(_0xd69438>0x0){_0xd69438=_0xd69438<0x64?0x64:_0xd69438;loggerPredictive[_0x49c4('0x84')](_0x1c5c95[_0x49c4('0x40')],_0x49c4('0x1f4'),_0xd69438,_0x49c4('0x4d'));_0x1c5c95[_0x49c4('0x1d9')]=setInterval(function(){_0x5c15ff[_0x49c4('0x1d9')](_0x1c5c95);loggerPredictiveCalls[_0x49c4('0x84')]('[handlePredictive]',_0x43207c+=0x1);},_0xd69438);}else{loggerPredictive[_0x49c4('0x84')](_0x1c5c95['name'],_0x49c4('0x1f5'));}};};Dialer[_0x49c4('0x1d')][_0x49c4('0x1f6')]=function(_0x3d8453,_0x54e3ea){var _0x22afcd=this;return function(_0x5f575f){if(_[_0x49c4('0x48')](_0x5f575f)){if(_[_0x49c4('0xb2')](_0x54e3ea[_0x49c4('0xd8')])||!_0x54e3ea[_0x49c4('0x1f7')]){if(_0x3d8453[_0x49c4('0x60')]===_0x49c4('0x7')){_0x3d8453['queueStatusComplete']=_[_0x49c4('0x3e')](_0x3d8453[_0x49c4('0x13a')])?!![]:_0x3d8453[_0x49c4('0x13a')];var _0x9bd48b=uuid['v4']();_0x22afcd[_0x49c4('0x27')][_0x9bd48b]=new Action(_0x3d8453,_0x54e3ea,_0x9bd48b);loggerBooked['info'](_0x49c4('0x1f8'),_0x9bd48b,_0x49c4('0x1f9'),JSON[_0x49c4('0x4c')](_0x3d8453[_0x49c4('0x13a')]),_0x49c4('0x1fa'),_0x3d8453[_0x49c4('0x40')]);if(_0x3d8453[_0x49c4('0x13a')]){_0x3d8453[_0x49c4('0x13a')]=![];_0x22afcd['queueBooked'][_0x22afcd[_0x49c4('0x27')][_0x9bd48b][_0x49c4('0xb9')]]=[];ami[_0x49c4('0xb3')]({'actionid':_0x9bd48b,'action':_0x49c4('0x1fb'),'queue':_0x3d8453[_0x49c4('0x40')]})[_0x49c4('0xb6')](function(){_0x22afcd[_0x49c4('0xb8')](_0x3d8453);_0x22afcd[_0x49c4('0xc4')]({'active':![],'ContactId':_0x22afcd[_0x49c4('0x27')][_0x9bd48b][_0x49c4('0xd7')],'ListId':_0x22afcd[_0x49c4('0x27')][_0x9bd48b][_0x49c4('0x108')],'VoiceQueueId':_0x22afcd[_0x49c4('0x27')][_0x9bd48b]['VoiceQueueId']||undefined,'CampaignId':_0x22afcd[_0x49c4('0x27')][_0x9bd48b]['CampaignId']||undefined})[_0x49c4('0xb6')](loggerCatch(_0x49c4('0x1fc')));delete _0x22afcd[_0x49c4('0x27')][_0x9bd48b];});}else{loggerBooked[_0x49c4('0x84')](_0x49c4('0x1fd'),JSON['stringify'](_0x3d8453[_0x49c4('0x13a')]),_0x49c4('0x1fa'),_0x3d8453[_0x49c4('0x40')]);_0x22afcd['updateOriginated'](_0x3d8453);_0x22afcd[_0x49c4('0xc4')]({'active':![],'ContactId':_0x22afcd['actions'][_0x9bd48b][_0x49c4('0xd7')],'ListId':_0x22afcd[_0x49c4('0x27')][_0x9bd48b]['ListId'],'VoiceQueueId':_0x22afcd[_0x49c4('0x27')][_0x9bd48b][_0x49c4('0xd9')]||undefined,'CampaignId':_0x22afcd[_0x49c4('0x27')][_0x9bd48b][_0x49c4('0xda')]||undefined})[_0x49c4('0xb6')](loggerCatch(_0x49c4('0x1fc')));delete _0x22afcd['actions'][_0x9bd48b];}}else{return _0x22afcd[_0x49c4('0x179')](_0x3d8453,_0x54e3ea);}}else{if(getDiff(_0x54e3ea[_0x49c4('0x1fe')])<_0x3d8453['dialRecallMeTimeout']*0x3c){if(_0x54e3ea[_0x49c4('0x171')]&&!_0x54e3ea[_0x49c4('0x171')][_0x49c4('0x1ff')]){_0x22afcd[_0x49c4('0x98')][_0x49c4('0x13c')](_0x54e3ea['id'])[_0x49c4('0x1f')](function(){_0x22afcd['updateOriginated'](_0x3d8453);});}else{_0x22afcd[_0x49c4('0xc6')]({'active':![]},_0x54e3ea['id'],0x1)[_0x49c4('0x1f')](function(){_0x22afcd[_0x49c4('0xb8')](_0x3d8453);});}}else{_0x3d8453[_0x49c4('0x6d')]+=0x1;_0x22afcd[_0x49c4('0xb8')](_0x3d8453);if(_0x3d8453['dialRecallInQueue']){_0x22afcd['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x54e3ea[_0x49c4('0xd7')],'ListId':_0x54e3ea['ListId'],'VoiceQueueId':_0x54e3ea[_0x49c4('0xd9')]||undefined,'CampaignId':_0x54e3ea[_0x49c4('0xda')]||undefined})[_0x49c4('0xb6')](loggerCatch(_0x49c4('0x200')));_0x22afcd[_0x49c4('0xd1')](createObjHistory(_0x3d8453,_0x54e3ea,_0x49c4('0x201'),0x17,_0x49c4('0x202')))['catch'](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x22afcd[_0x49c4('0xe2')](createObjHistory(_0x3d8453,_0x54e3ea,_0x49c4('0x203'),0x16,_0x49c4('0x204')),_0x49c4('0x205'),'[Originate][HistoryRecallClose]');}}}}else{_0x3d8453[_0x49c4('0x65')]+=0x1;_0x22afcd[_0x49c4('0xe2')](createObjHistory(_0x3d8453,_0x54e3ea,_0x49c4('0x206'),0xd,_0x49c4('0x207')),_0x49c4('0x208'),_0x49c4('0x209'));throw'inBlackList';}};};Dialer[_0x49c4('0x1d')][_0x49c4('0x20a')]=function(_0x73e425){var _0x7d7708=this;var _0x23ec6e=_0x73e425[_0x49c4('0x20b')]-_0x73e425[_0x49c4('0x79')]-_0x73e425['temp'];emitCampaignSummary(_0x73e425);if(_0x23ec6e>0x0){if(_0x23ec6e>this[_0x49c4('0x25')]){_0x23ec6e=this[_0x49c4('0x25')];}_0x73e425[_0x49c4('0xc9')]+=_0x23ec6e;this[_0x49c4('0xcb')](_0x73e425['id'],_0x23ec6e,_0x73e425[_0x49c4('0x20c')],_0x73e425)[_0x49c4('0xbf')](function(_0x5f26a2){_0x73e425[_0x49c4('0xc9')]-=_0x23ec6e;_0x73e425[_0x49c4('0xc9')]=_0x73e425[_0x49c4('0xc9')]>0x0?_0x73e425[_0x49c4('0xc9')]:0x0;if(!checkContactEmpty(_0x5f26a2)){_0x73e425['message']=_0x49c4('0x20d');logger[_0x49c4('0x84')](_0x49c4('0x20e')+_0x73e425[_0x49c4('0x40')]);}else{_0x73e425['originated']+=_0x5f26a2['length'];_0x73e425[_0x49c4('0x42')]=_0x49c4('0x20f');for(var _0x53723f=0x0;_0x53723f<_0x5f26a2[_0x49c4('0xa1')];_0x53723f+=0x1){_0x73e425[_0x49c4('0x210')]+=0x1;if(_[_0x49c4('0xb2')](_0x5f26a2[_0x53723f])||_[_0x49c4('0xb2')](_0x5f26a2[_0x53723f][_0x49c4('0x191')])||_[_0x49c4('0xb2')](_0x5f26a2[_0x53723f][_0x49c4('0x17c')])){_0x7d7708['emptyContact'](_0x49c4('0x211'),_0x73e425,_0x5f26a2[_0x53723f]);}else{_0x7d7708[_0x49c4('0x212')](_[_0x49c4('0xd6')](_0x5f26a2[_0x53723f],[_0x49c4('0xda'),_0x49c4('0x213')]))[_0x49c4('0xbf')](_0x7d7708['checkContactBlack'](_0x73e425,_0x5f26a2[_0x53723f]))[_0x49c4('0xb6')](_0x7d7708[_0x49c4('0x214')](_0x49c4('0x215'),_0x73e425));}}}})['catch'](loggerGetContactDialer(_0x49c4('0x216'),_0x73e425,_0x23ec6e));}};Dialer['prototype'][_0x49c4('0x162')]=function(_0x31d896,_0x1f207d){var _0x5bb062=this;var _0x15d8d0=[];var _0x4b8401=_0x1f207d>=0x1?_0x1f207d:0x1;if(_0x31d896[_0x49c4('0x60')]===_0x49c4('0x7')){_0x4b8401=0x1;}var _0x5cf229=Math[_0x49c4('0x1d7')](_0x31d896[_0x49c4('0x55')]*_0x4b8401)-_0x31d896[_0x49c4('0x79')]-_0x31d896[_0x49c4('0xc9')];emitVoiceQueueSummary(_0x31d896);if(_0x31d896['dialLimitQueue']>0x0){var _0x8cc12c=_0x31d896[_0x49c4('0x217')]-_0x31d896[_0x49c4('0x79')]-_0x31d896['talking']-_0x31d896[_0x49c4('0xc9')]-_0x31d896[_0x49c4('0x57')];if(_0x5cf229>_0x8cc12c){_0x5cf229=_0x8cc12c;}}if(_0x5cf229>0x0){if(_0x31d896[_0x49c4('0x60')]==='booked'){_0x5cf229=0x1;}if(_0x5cf229>this[_0x49c4('0x25')]){_0x5cf229=this['maxNumberOriginate'];}_0x31d896['temp']+=_0x5cf229;for(var _0xc88ee5 in this[_0x49c4('0x23')]){if(typeof this[_0x49c4('0x23')][_0xc88ee5]!==_0x49c4('0xa2')){if(this[_0x49c4('0x23')][_0xc88ee5]['state']===_0x49c4('0x218')&&this[_0x49c4('0x23')][_0xc88ee5]['status']===_0x49c4('0xe0')){_0x15d8d0[_0x49c4('0x152')](this[_0x49c4('0x23')][_0xc88ee5]['id']);}}}this['getContactDialer'](_0x31d896['id'],_0x15d8d0,_0x5cf229,_0x31d896[_0x49c4('0x20c')],_0x31d896)[_0x49c4('0xbf')](function(_0x17fe83){_0x31d896[_0x49c4('0xc9')]-=_0x5cf229;_0x31d896[_0x49c4('0xc9')]=_0x31d896[_0x49c4('0xc9')]>0x0?_0x31d896[_0x49c4('0xc9')]:0x0;if(!checkContactEmpty(_0x17fe83)){_0x5bb062[_0x49c4('0xbb')](_0x31d896)['then'](sendMessageReschedule(_0x31d896))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x31d896[_0x49c4('0x79')]+=_0x17fe83[_0x49c4('0xa1')];_0x31d896[_0x49c4('0x42')]=_0x31d896[_0x49c4('0x60')]===_0x49c4('0x7')?_0x49c4('0x183'):_0x49c4('0x20f');for(var _0x35ed46=0x0;_0x35ed46<_0x17fe83['length'];_0x35ed46+=0x1){if(_[_0x49c4('0xb2')](_0x17fe83[_0x35ed46])||_[_0x49c4('0xb2')](_0x17fe83[_0x35ed46]['Contact'])||_['isNil'](_0x17fe83[_0x35ed46][_0x49c4('0x17c')])){_0x5bb062['emptyContact'](_0x49c4('0x211'),_0x31d896,_0x17fe83[_0x35ed46]);}else{_0x5bb062[_0x49c4('0xbd')](_['pick'](_0x17fe83[_0x35ed46],['VoiceQueueId',_0x49c4('0x213')]))['then'](_0x5bb062[_0x49c4('0x1f6')](_0x31d896,_0x17fe83[_0x35ed46]))[_0x49c4('0xb6')](_0x5bb062[_0x49c4('0x214')](_0x49c4('0x211'),_0x31d896));}}}})['catch'](loggerGetContactDialer('[getContactDialer2]',_0x31d896,_0x5cf229));}};Dialer[_0x49c4('0x1d')][_0x49c4('0x1d9')]=function(_0x305854){if(_0x305854[_0x49c4('0x217')]>0x0){var _0x4af897=_0x305854[_0x49c4('0x217')]-_0x305854[_0x49c4('0x79')]-_0x305854[_0x49c4('0x5b')];if(_0x4af897>0x0){this[_0x49c4('0x219')](_0x305854);}else{loggerPredictiveCalls[_0x49c4('0x84')](_0x49c4('0x21a'));}}else{this[_0x49c4('0x219')](_0x305854);}};Dialer[_0x49c4('0x1d')]['tryOriginatePredictive']=function(_0x7f7b69){var _0x331875=this;var _0x45d437=[];_0x7f7b69['originated']+=0x1;for(var _0x1237f1 in this[_0x49c4('0x23')]){if(typeof this[_0x49c4('0x23')][_0x1237f1]!==_0x49c4('0xa2')){if(this['agents'][_0x1237f1]['state']===_0x49c4('0x218')&&this[_0x49c4('0x23')][_0x1237f1]['status']==='reachable'){_0x45d437[_0x49c4('0x152')](this[_0x49c4('0x23')][_0x1237f1]['id']);}}}this[_0x49c4('0xc8')](_0x7f7b69['id'],_0x45d437,0x1,_0x7f7b69[_0x49c4('0x20c')],_0x7f7b69)['then'](function(_0xb97665){if(!checkContactEmpty(_0xb97665)){checkContactLowerLimitOriginate(_0x7f7b69,0x1,0x0);_0x331875[_0x49c4('0xbb')](_0x7f7b69)[_0x49c4('0xbf')](sendMessageReschedule(_0x7f7b69))[_0x49c4('0xb6')](loggerCatch(_0x49c4('0xbc')));}else{_0x7f7b69[_0x49c4('0x42')]='RUNNING';if(_[_0x49c4('0xb2')](_0xb97665[0x0])||_[_0x49c4('0xb2')](_0xb97665[0x0][_0x49c4('0x191')])||_[_0x49c4('0xb2')](_0xb97665[0x0]['phone'])){_0x331875[_0x49c4('0xd5')](_0x49c4('0x211'),_0x7f7b69,_0xb97665[0x0]);}else{_0x331875[_0x49c4('0xbd')](_[_0x49c4('0xd6')](_0xb97665[0x0],[_0x49c4('0xd9'),_0x49c4('0x213')]))[_0x49c4('0xbf')](_0x331875[_0x49c4('0x1f6')](_0x7f7b69,_0xb97665[0x0]))[_0x49c4('0xb6')](_0x331875['loggerHandler'](_0x49c4('0x21b'),_0x7f7b69));}}})[_0x49c4('0xb6')](loggerGetContactDialer(_0x49c4('0x21c'),_0x7f7b69,0x1));emitVoiceQueueSummary(_0x7f7b69);};Dialer['prototype']['abandonmentRate']=function(_0xb3de93,_0xf69075,_0x442918,_0x4c68b7,_0x5e8198,_0x3a0fd2){loggerPredictive[_0x49c4('0x84')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive['info'](_0x49c4('0x21d'),_0xb3de93);loggerPredictive[_0x49c4('0x84')](_0x49c4('0x21e'),_0xf69075);loggerPredictive[_0x49c4('0x84')](_0x49c4('0x21f'),_0x442918);loggerPredictive[_0x49c4('0x84')](_0x49c4('0x220'),_0x4c68b7);loggerPredictive[_0x49c4('0x84')](_0x49c4('0x221'),_0x5e8198);loggerPredictive[_0x49c4('0x84')]('---------------------------');return new BPromise(function(_0x3b8f18,_0x2eba0b){if(_0xb3de93<=0x0||isNaN(_0xb3de93)){return _0x2eba0b(msgResponse(_0x49c4('0x222'),_0x49c4('0x4b'),_0x49c4('0x223')+_0xb3de93));}if(_0x442918<=0x0||isNaN(_0x442918)){return _0x2eba0b(msgResponse(_0x49c4('0x222'),_0x49c4('0x4b'),'Ts\x20=\x20'+_0x442918));}if(_0x4c68b7<=0x0||isNaN(_0x4c68b7)){return _0x2eba0b(msgResponse(_0x49c4('0x222'),_0x49c4('0x4b'),_0x49c4('0x224')+_0x4c68b7));}if(_0xf69075<=0x0||isNaN(_0xf69075)){return _0x2eba0b(msgResponse(_0x49c4('0x222'),_0x49c4('0x4b'),'interval\x20=\x20'+_0xf69075));}if(_0x5e8198<=0x0||isNaN(_0x5e8198)){return _0x2eba0b(msgResponse(_0x49c4('0x222'),'Error',_0x49c4('0x225')+_0x5e8198));}_0x3a0fd2=_0x3a0fd2||0x0;var _0x175cbe=0x1/_0x442918;var _0x57f6f0=0x0;var _0x3239f1=0x0;var _0x471d22=0x0;var _0x2a8994=0x0;for(var _0x25a2dc=0x0;_0x471d22<_0x5e8198;_0x25a2dc+=0x1){_0x3239f1=_0x25a2dc/_0xf69075;_0x57f6f0=(_0x4c68b7*_0x3239f1+_0x3a0fd2)/_0x175cbe;_0x471d22=erlangb(_0x57f6f0,_0xb3de93);_0x2a8994=_0x57f6f0/_0xb3de93*(0x1-erlangb(_0x57f6f0,_0xb3de93));}return _0x3b8f18({'erlangCalls':_0x25a2dc,'erlangCallToSecond':_0xf69075/_0x25a2dc,'erlangAbandonmentRate':_0x471d22,'erlangBusyFactor':_0x2a8994});});};Dialer['prototype'][_0x49c4('0x1ee')]=function(_0x377a61,_0x2c367d,_0x25ea2e,_0x24ec44,_0x28b74b,_0xc8608b){loggerPredictive[_0x49c4('0x84')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x49c4('0x84')]('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',_0x377a61);loggerPredictive[_0x49c4('0x84')](_0x49c4('0x21e'),_0x2c367d);loggerPredictive[_0x49c4('0x84')](_0x49c4('0x21f'),_0x25ea2e);loggerPredictive[_0x49c4('0x84')](_0x49c4('0x220'),_0x24ec44);loggerPredictive[_0x49c4('0x84')](_0x49c4('0x226'),_0x28b74b);loggerPredictive[_0x49c4('0x84')]('---------------------------');return new BPromise(function(_0x503148,_0x441721){if(_0x377a61<=0x0||isNaN(_0x377a61)){return _0x441721(msgResponse(_0x49c4('0x227'),_0x49c4('0x4b'),_0x49c4('0x223')+_0x377a61));}if(_0x25ea2e<=0x0||isNaN(_0x25ea2e)){return _0x441721(msgResponse('[busyFactor]',_0x49c4('0x4b'),_0x49c4('0x228')+_0x25ea2e));}if(_0x24ec44<=0x0||isNaN(_0x24ec44)){return _0x441721(msgResponse(_0x49c4('0x227'),'Error',_0x49c4('0x224')+_0x24ec44));}if(_0x2c367d<=0x0||isNaN(_0x2c367d)){return _0x441721(msgResponse(_0x49c4('0x227'),'Error',_0x49c4('0x229')+_0x2c367d));}if(_0x28b74b<=0x0||isNaN(_0x28b74b)){return _0x441721(msgResponse(_0x49c4('0x227'),_0x49c4('0x4b'),_0x49c4('0x22a')+_0x28b74b));}_0xc8608b=_0xc8608b||0x0;var _0x5cad70=0x1/_0x25ea2e;var _0x4bec9f=0x0;var _0x11f563=0x0;var _0x2a8255=0x0;var _0x4e2872=0x0;for(var _0x101243=0x0;_0x4e2872<_0x28b74b;_0x101243+=0x1){_0x11f563=_0x101243/_0x2c367d;_0x4bec9f=(_0x24ec44*_0x11f563+_0xc8608b)/_0x5cad70;_0x2a8255=erlangb(_0x4bec9f,_0x377a61);_0x4e2872=_0x4bec9f/_0x377a61*(0x1-erlangb(_0x4bec9f,_0x377a61));}return _0x503148({'erlangCalls':_0x101243,'erlangCallToSecond':_0x2c367d/_0x101243,'erlangAbandonmentRate':_0x2a8255,'erlangBusyFactor':_0x4e2872});});};module[_0x49c4('0x22b')]=Dialer;