Built motion from commit (unavailable).|2.5.21
[motion2.git] / server / services / ami / dialer / index.js
index 0cca549..80f8184 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8bc9=['dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialDropMaxRetry','[rescheduleContact][Abandoned]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','NoAnswer','custom:agentnoanswer','buildObj','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','[syncAgentComplete][createHistory][5]','dialBusyMaxRetry','reason\x205\x20busy','Congestion','congestion','checkRetriveMax','dialCongestionMaxRetry','reason\x208\x20congestion','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','outboundUnknownCallsDay','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','round','predictiveIntervalMaxThreshold','predictiveIntervalAvailable','predictiveIntervalMinThreshold','floor','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','dialPredictiveInterval','startMethodPredictive','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','getDataPredictive','abandonmentRate','agentBusyFactor','dialPredictiveOptimizationPercentage','busyFactor','Unknown\x20Predictive','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','predictiveIntervalAnsweredCalls','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','scheduledat','Agent','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','RECALLFAILEDTIMEOUT','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','temp','[getContactCampaign2][Empty]','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','dialOrderByScheduledAt','ACTIVE','RUNNING','tryOriginatePredictive','not_inuse','[getContactDialerPredictive]','--------\x20Drop\x20Rate\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','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','exports','lodash','uuid','moment','md5','../preview/util/util','../../../config/environment/','dialer','../../../config/logger','booked','predictive','predictiveCalls','syncQueueSummary','../ami','defaults','localhost','redis','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','env','127.0.0.1','rrmemory','enqueue','tail','finally','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncOriginateResponse','agentcomplete','hangup','syncHangup','newexten','syncNewExten','syncVarSet','queuemember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','name','NOT_ACTIVE','\x20NOT\x20Active','Interval','\x20INTERVAL_IS_NULL','Intervals','INTERVAL_IS_NULL','isEmpty','[ifTime][Action]','Error','stringify','seconds','emit','type','outbound','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalDroppedCallsTimeout','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','voice:queue:%s','voice_queue:save','ivr','format','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','milliseconds','diff','clearing\x20variable\x20start\x20progressive','handlePredictive','clearing\x20variable\x20handle\x20predictive','preview','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','undefined','[decremetOriginate]\x20is\x20null\x20or\x20undefined','[getContactDialer2][ReScheduled]','contactsRescheduled','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','IS_DISACTIVED','state','endtime','prototype','clearZombieChannels','uniqueId','[uniqueid]','isNil','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','countReScheduled','resolve','[countReScheduled]\x20','checkIsBlackList','then','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','unlockContact','[unlockContact]\x20','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','emptyContact','notFound','saveInDb','ContactId','ListId','UserId','CampaignId','[emptyContact][createHistory]','[emptyContact]','Success','isTrunkReachable','status','reachable','SIP/%s','unmonitored','uniqueid','variable','amdstatus','exten','dialAMDActive','value','HANGUP','statedesc','HangupInAMD','[syncHangupInAMD]','MACHINE','Machine','countmachineretry','countglobal','amd','countbusyretry','countcongestionretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','AMD','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','membername','countnoanswerretry','countnosuchnumberretry','VoiceQueueId','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','cause-txt','Unknow','syncAgentComplete','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete]','answertime','[syncAgentComplete][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','syncQueueCallerAbandon','droptime','dialQueueTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','TIMEOUT','dialDropRetryFrequency','[rescheduleContact][Drop]','starttime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','predictiveIntervalDroppedCallsCallersExit','Abandoned','dropreason','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[syncAgentComplete][createHistory][11]','channel','syncQueueMember','actionid','roundrobin','locked','paused','stateinterface','push','pick','idHopper','[unlockQueueStatus][undefined]','queueStatusComplete','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','length','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','TrunkBackup','TRUNK_IS_NOT_REACHABLE','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','timezones','\x20Timezone\x20unknow\x20','isArray','Action','command','interval','content','indexOf','true','iftime\x20%s,%s','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','progressive','handlePower','power','dialPowerLevel','Queue','handleIvr','dialMethod','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','syncCampaigns','launchHandleIvr','pow','match','actionOriginate','object','voiceQueue\x20is\x20undefine','Contact','phone','originate','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','getCaller','xcally-motion-dialer','dialAMDInitialSilence','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','callerid','XMD-ORIGINATECALLERIDNAME','originatecalleridname','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','outboundOriginateFailureCallsDay','[originate][error]','responsetime','getQueue','response','callProgressDetecting'];(function(_0x11e1b5,_0x170d84){var _0x9bd7c1=function(_0x3f728a){while(--_0x3f728a){_0x11e1b5['push'](_0x11e1b5['shift']());}};_0x9bd7c1(++_0x170d84);}(_0x8bc9,0x89));var _0x98bc=function(_0x57a379,_0x4424d5){_0x57a379=_0x57a379-0x0;var _0x39bb1f=_0x8bc9[_0x57a379];return _0x39bb1f;};'use strict';var util=require('util');var _=require(_0x98bc('0x0'));var BPromise=require('bluebird');var uuid=require(_0x98bc('0x1'));var moment=require(_0x98bc('0x2'));var rr=require('rr');var md5=require(_0x98bc('0x3'));var Redis=require('ioredis');var ut=require(_0x98bc('0x4'));var config=require(_0x98bc('0x5'));var logger=require('../../../config/logger')(_0x98bc('0x6'));var loggerBooked=require(_0x98bc('0x7'))(_0x98bc('0x8'));var loggerPredictive=require(_0x98bc('0x7'))(_0x98bc('0x9'));var loggerPredictiveCalls=require(_0x98bc('0x7'))(_0x98bc('0xa'));var loggerSyncQueueSummary=require('../../../config/logger')(_0x98bc('0xb'));var ami=require(_0x98bc('0xc'));config['redis']=_[_0x98bc('0xd')](config['redis'],{'host':_0x98bc('0xe'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x98bc('0xf')]));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x98bc('0x10'));var voiceQueueRt=require(_0x98bc('0x11'));var Action=require(_0x98bc('0x12'));var History=require(_0x98bc('0x13'));var Final=require(_0x98bc('0x14'));var AgentComplete=require(_0x98bc('0x15'));var QueueCallerAbandon=require(_0x98bc('0x16'));var Hangup=require(_0x98bc('0x17'));var ipAgi=process[_0x98bc('0x18')]['XCALLY_IP_AGI']||_0x98bc('0x19');var strategy={'rrmemory':_0x98bc('0x1a'),'roundrobin':'roundrobin'};var Sequence=function(){};Sequence['prototype'][_0x98bc('0x1b')]=function(_0x4279b4){this['tail']=this['tail']?this[_0x98bc('0x1c')][_0x98bc('0x1d')](_0x4279b4):_0x4279b4();};function Dialer(_0x2f9595,_0x59b55a){this[_0x98bc('0x1e')]=new Sequence();this['preview']=_0x59b55a;this[_0x98bc('0x1f')]=_0x2f9595[_0x98bc('0x1f')];this[_0x98bc('0x20')]=_0x2f9595['campaigns'];this['agents']=_0x2f9595[_0x98bc('0x21')];this['trunks']=_0x2f9595[_0x98bc('0x22')];this[_0x98bc('0x23')]=config[_0x98bc('0x23')]||0x2;this[_0x98bc('0x24')]={};this[_0x98bc('0x25')]={};this[_0x98bc('0x26')]={};this['uniqueId']={};this[_0x98bc('0x27')]={};this[_0x98bc('0x28')]={};this[_0x98bc('0x29')]={};this[_0x98bc('0x2a')]={};this[_0x98bc('0x2b')]={};this[_0x98bc('0x2c')]={};ami['on'](_0x98bc('0x2d'),this[_0x98bc('0x2e')][_0x98bc('0x2f')](this));ami['on'](_0x98bc('0x30'),this['syncQueueCallerAbandon']['bind'](this));ami['on']('originateresponse',this[_0x98bc('0x31')][_0x98bc('0x2f')](this));ami['on'](_0x98bc('0x32'),this['syncAgentComplete']['bind'](this));ami['on']('custom:queuesummary',this[_0x98bc('0xb')][_0x98bc('0x2f')](this));ami['on'](_0x98bc('0x33'),this[_0x98bc('0x34')]['bind'](this));ami['on'](_0x98bc('0x35'),this[_0x98bc('0x36')][_0x98bc('0x2f')](this));ami['on']('varset',this[_0x98bc('0x37')]['bind'](this));ami['on'](_0x98bc('0x38'),this['syncQueueMember'][_0x98bc('0x2f')](this));ami['on'](_0x98bc('0x39'),this[_0x98bc('0x3a')][_0x98bc('0x2f')](this));this[_0x98bc('0x3b')]();this[_0x98bc('0x3c')]();}function isNotNull(_0x1a2232){return _0x1a2232!==null&&!_[_0x98bc('0x3d')](_0x1a2232);}function checkIsLoggedIn(_0x249967,_0x495a18){return function(){if(_0x495a18<=0x0){_0x249967[_0x98bc('0x3e')]=_0x98bc('0x3f');throw _0x249967[_0x98bc('0x40')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x4386bf){return _0x4386bf;}function checkIsActive(_0x329068,_0x11b0ed){return function(){if(!isActive(_0x11b0ed)){_0x329068['message']=_0x98bc('0x41');throw _0x329068['name']+_0x98bc('0x42');}};}function checkInterval(_0x5607cc){return function(){if(!isNotNull(_0x5607cc[_0x98bc('0x43')])){_0x5607cc[_0x98bc('0x3e')]='INTERVAL_IS_NULL';throw _0x5607cc['name']+_0x98bc('0x44');}if(!isNotNull(_0x5607cc[_0x98bc('0x43')][_0x98bc('0x45')])){_0x5607cc[_0x98bc('0x3e')]=_0x98bc('0x46');throw _0x5607cc[_0x98bc('0x40')]+_0x98bc('0x44');}if(!isNotNull(_[_0x98bc('0x47')](_0x5607cc[_0x98bc('0x43')][_0x98bc('0x45')]))){_0x5607cc['message']=_0x98bc('0x46');throw _0x5607cc['name']+_0x98bc('0x44');}};}function msgResponse(_0x23e3ae,_0x21e4eb,_0x28a7e3){return{'action':_0x23e3ae,'response':_0x21e4eb,'message':_0x28a7e3,'stack':_0x28a7e3};}function myreject(_0x2eb670){return function(_0x5adcfb){return _0x2eb670(msgResponse(_0x98bc('0x48'),_0x98bc('0x49'),JSON[_0x98bc('0x4a')](_0x5adcfb)));};}function getSeconds(_0xcfb0fa,_0x46aa5f){var _0x2eb12b=moment(_0xcfb0fa)['milliseconds'](0x0);var _0xa7ef1d=moment(_0x46aa5f)['milliseconds'](0x0);return _0x2eb12b['diff'](_0xa7ef1d,_0x98bc('0x4b'));}function emit(_0x381c13,_0x552e89,_0x22d324){io['to'](_0x381c13)[_0x98bc('0x4c')](_0x552e89,_0x22d324);}function emitVoiceQueueSummary(_0x1096ed){if(_0x1096ed[_0x98bc('0x4d')]===_0x98bc('0x4e')){var _0x2552d7={'id':_0x1096ed['id'],'name':_0x1096ed[_0x98bc('0x40')],'strategy':_0x1096ed[_0x98bc('0x4f')],'answered':_0x1096ed[_0x98bc('0x50')],'available':_0x1096ed[_0x98bc('0x51')],'loggedIn':_0x1096ed[_0x98bc('0x52')],'pTalking':_0x1096ed[_0x98bc('0x53')],'sumBillable':_0x1096ed[_0x98bc('0x54')],'sumDuration':_0x1096ed[_0x98bc('0x55')],'sumHoldTime':_0x1096ed[_0x98bc('0x56')]||0x0,'talking':_0x1096ed[_0x98bc('0x57')],'total':_0x1096ed[_0x98bc('0x58')],'type':_0x1096ed[_0x98bc('0x4d')],'unmanaged':_0x1096ed['unmanaged'],'abandoned':_0x1096ed[_0x98bc('0x59')],'waiting':_0x1096ed[_0x98bc('0x5a')],'loggedInDb':_0x1096ed[_0x98bc('0x5b')],'dialActive':_0x1096ed[_0x98bc('0x5c')],'dialMethod':_0x1096ed['dialMethod'],'dialOriginateCallerIdName':_0x1096ed[_0x98bc('0x5d')],'dialOriginateCallerIdNumber':_0x1096ed[_0x98bc('0x5e')],'dialOriginateTimeout':_0x1096ed[_0x98bc('0x5f')],'dialPrefix':_0x1096ed[_0x98bc('0x60')],'outboundAnswerAgiCallsDay':_0x1096ed[_0x98bc('0x61')],'outboundAnswerCallsDay':_0x1096ed[_0x98bc('0x62')],'outboundBlacklistCallsDay':_0x1096ed[_0x98bc('0x63')],'outboundBusyCallsDay':_0x1096ed['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x1096ed[_0x98bc('0x64')],'outboundDropCallsDayACS':_0x1096ed[_0x98bc('0x65')],'outboundDropCallsDayCallersExit':_0x1096ed[_0x98bc('0x66')],'outboundDropCallsDayTimeout':_0x1096ed[_0x98bc('0x67')],'outboundNoAnswerCallsDay':_0x1096ed[_0x98bc('0x68')],'outboundNoSuchCallsDay':_0x1096ed['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x1096ed['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x1096ed[_0x98bc('0x69')],'outboundRejectCallsDay':_0x1096ed[_0x98bc('0x6a')],'outboundUnknownCallsDay':_0x1096ed['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x1096ed['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x1096ed['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x1096ed['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x1096ed['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x1096ed[_0x98bc('0x6b')],'predictiveIntervalErlangCalls':_0x1096ed['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x1096ed['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x1096ed[_0x98bc('0x6c')],'predictiveIntervalMultiplicativeFactor':_0x1096ed['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x1096ed[_0x98bc('0x6d')],'predictiveIntervalAvailable':_0x1096ed['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x1096ed[_0x98bc('0x6e')],'message':_0x1096ed[_0x98bc('0x3e')],'originated':_0x1096ed[_0x98bc('0x6f')],'erlangCalls':_0x1096ed['erlangCalls'],'erlangCallToSecond':_0x1096ed[_0x98bc('0x70')],'erlangAbandonmentRate':_0x1096ed[_0x98bc('0x71')],'erlangBusyFactor':_0x1096ed[_0x98bc('0x72')],'startPredictive':_0x1096ed[_0x98bc('0x28')],'startProgressive':_0x1096ed[_0x98bc('0x29')]};if(_0x1096ed[_0x98bc('0x73')]){_0x2552d7['Trunk']={'id':_0x1096ed['Trunk']['id'],'name':_0x1096ed[_0x98bc('0x73')][_0x98bc('0x40')],'active':_0x1096ed['Trunk'][_0x98bc('0x74')],'callerid':_0x1096ed[_0x98bc('0x73')]['callerid']};}if(_0x1096ed[_0x98bc('0x43')]){_0x2552d7['Interval']={'id':_0x1096ed['Interval']['id'],'name':_0x1096ed['Interval'][_0x98bc('0x40')]};}var _0x22764d=md5(JSON[_0x98bc('0x4a')](_0x2552d7));if(_0x1096ed['md5']!==_0x22764d){_0x1096ed[_0x98bc('0x3')]=_0x22764d;emit(util['format'](_0x98bc('0x75'),_0x2552d7[_0x98bc('0x40')]),_0x98bc('0x76'),_0x2552d7);}}}function emitCampaignSummary(_0x48d42b){if(_0x48d42b[_0x98bc('0x4d')]===_0x98bc('0x77')){emit(util[_0x98bc('0x78')](_0x98bc('0x79'),_0x48d42b[_0x98bc('0x40')]),_0x98bc('0x7a'),_0x48d42b);}}function checkGetDataPredictive(_0xf5e560){if(isNotNull(_0xf5e560)&&!_[_0x98bc('0x47')](_0xf5e560)){loggerPredictive[_0x98bc('0x7b')](_0x98bc('0x7c'));loggerPredictive[_0x98bc('0x7b')](_0x98bc('0x7d'),_0xf5e560[_0x98bc('0x6e')]);loggerPredictive[_0x98bc('0x7b')](_0x98bc('0x7e'),_0xf5e560['predictiveIntervalAnsweredCalls']);loggerPredictive[_0x98bc('0x7b')](_0x98bc('0x7f'),_0xf5e560['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0x98bc('0x7b')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xf5e560['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x98bc('0x7b')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xf5e560[_0x98bc('0x80')]);loggerPredictive['info'](_0x98bc('0x81'),_0xf5e560[_0x98bc('0x82')]);loggerPredictive['info'](_0x98bc('0x83'));if(_0xf5e560[_0x98bc('0x6e')]>0x0){if(!_[_0x98bc('0x3d')](_0xf5e560['predictiveIntervalAvgTalktime'])&&_0xf5e560[_0x98bc('0x82')]>0x0){return!![];}loggerPredictive[_0x98bc('0x7b')](_0x98bc('0x84'));if(!_[_0x98bc('0x3d')](_0xf5e560['predictiveIntervalAvgHoldtime'])&&_0xf5e560[_0x98bc('0x80')]>0x0){return!![];}loggerPredictive[_0x98bc('0x7b')](_0x98bc('0x85'));}else{loggerPredictive['info'](_0x98bc('0x86'));}}else{loggerPredictive[_0x98bc('0x7b')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x2b998c){return function(_0x272a3c){loggerPredictive['info'](_0x98bc('0x87'));loggerPredictive[_0x98bc('0x7b')](_0x98bc('0x88'),_0x272a3c[_0x98bc('0x89')]);loggerPredictive[_0x98bc('0x7b')](_0x98bc('0x8a'),_0x272a3c[_0x98bc('0x70')]);loggerPredictive[_0x98bc('0x7b')](_0x98bc('0x8b'),_0x272a3c[_0x98bc('0x71')]);loggerPredictive['info'](_0x98bc('0x8c'),_0x272a3c[_0x98bc('0x72')]);loggerPredictive[_0x98bc('0x7b')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x272a3c[_0x98bc('0x71')]);loggerPredictive[_0x98bc('0x7b')](_0x98bc('0x83'));_[_0x98bc('0x8d')](_0x2b998c,_0x272a3c);};}function getDiff(_0x1675df){var _0x4253b9=moment()[_0x98bc('0x8e')](0x0);var _0x314272=moment(_0x1675df)[_0x98bc('0x8e')](0x0);return _0x4253b9[_0x98bc('0x8f')](_0x314272,'seconds');}function ifInterval(_0x21e24a,_0x1aad83){if(_[_0x98bc('0x3d')](_0x1aad83)){return![];}return getDiff(_0x1aad83)<_0x21e24a*0x3c;}function freeVariablesPredictive(_0x22d389){if(isNotNull(_0x22d389)){if(!_[_0x98bc('0x3d')](_0x22d389['startProgressive'])){_0x22d389['startProgressive']=undefined;loggerPredictive[_0x98bc('0x7b')](_0x22d389[_0x98bc('0x40')],_0x98bc('0x90'));}if(!_[_0x98bc('0x3d')](_0x22d389[_0x98bc('0x28')])){_0x22d389[_0x98bc('0x28')]=undefined;loggerPredictive[_0x98bc('0x7b')](_0x22d389[_0x98bc('0x40')],'clearing\x20variable\x20start\x20predictive');}if(!_['isUndefined'](_0x22d389[_0x98bc('0x91')])){clearInterval(_0x22d389[_0x98bc('0x91')]);_0x22d389['handlePredictive']=undefined;loggerPredictive[_0x98bc('0x7b')](_0x22d389[_0x98bc('0x40')],_0x98bc('0x92'));}}}function erlangb(_0x7675e,_0x1ece3a){if(_0x1ece3a===0x0){return 0x0;}var _0x123712=0x1;for(var _0x5301e=0x1;_0x5301e<=_0x1ece3a;_0x5301e+=0x1){_0x123712=0x1+_0x123712*_0x5301e/_0x7675e;}return 0x1/_0x123712;}function isVoiceQueueOutbound(_0x2f2728){return _0x2f2728==='outbound';}function isNotPreview(_0x3de4b3){return _0x3de4b3!==_0x98bc('0x93');}function isCampaignIvr(_0x5a944d){return _0x5a944d===_0x98bc('0x77');}function getCallerId(_0x3ef9f7,_0x26f26c,_0x26ca09){if(!_[_0x98bc('0x3d')](_0x26ca09)&&typeof _0x26ca09==='string'&&!_['isEmpty'](_0x26ca09)){if(!_[_0x98bc('0x3d')](_0x26f26c)&&typeof _0x26f26c===_0x98bc('0x94')&&!_[_0x98bc('0x47')](_0x26f26c)){return util[_0x98bc('0x78')](_0x98bc('0x95'),_0x26f26c,_0x26ca09);}return util[_0x98bc('0x78')](_0x98bc('0x95'),_0x26ca09,_0x26ca09);}if(!_[_0x98bc('0x3d')](_0x3ef9f7)&&typeof _0x3ef9f7===_0x98bc('0x94')&&!_[_0x98bc('0x47')](_0x3ef9f7)){return _0x3ef9f7;}return _0x98bc('0x96');}function loggerCatchQueueSummary(_0x1046f6,_0x3fe852){return function(_0x3947c1){freeVariablesPredictive(_0x3fe852);emitVoiceQueueSummary(_0x3fe852);emitCampaignSummary(_0x3fe852);loggerSyncQueueSummary[_0x98bc('0x97')](_0x1046f6,util[_0x98bc('0x98')](_0x3947c1,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0xed82e6,_0x2dd1db){return function(_0x34c916){loggerPredictive[_0x98bc('0x97')](_0x2dd1db[_0x98bc('0x40')],_0xed82e6);loggerPredictive[_0x98bc('0x97')](_0x34c916[_0x98bc('0x99')]);freeVariablesPredictive(_0x2dd1db);};}function loggerCatch(_0x1f164d){return function(_0x5f3930){logger[_0x98bc('0x97')](_0x1f164d,util['inspect'](_0x5f3930,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x53ff21){return _0x53ff21&&!_[_0x98bc('0x3d')](_0x53ff21)&&_0x53ff21['length']>0x0;}function decremetOriginate(_0x2118f9){if(!_[_0x98bc('0x3d')](_0x2118f9)&&_0x2118f9!==null){if(typeof _0x2118f9[_0x98bc('0x6f')]!==_0x98bc('0x9a')){if(_0x2118f9['originated']>0x0){_0x2118f9[_0x98bc('0x6f')]-=0x1;}else{logger[_0x98bc('0x97')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger['error'](_0x98bc('0x9b'));}}function checkContactLowerLimitOriginate(_0x2e7f03,_0x464cab,_0x5e9a6f){if(_0x464cab>_0x5e9a6f){for(var _0x36549d=0x0;_0x36549d<_0x464cab-_0x5e9a6f;_0x36549d+=0x1){decremetOriginate(_0x2e7f03);}}}function loggerGetContactDialer(_0x158b2f,_0x7592aa,_0x32c106){return function(_0xfa8dd9){checkContactLowerLimitOriginate(_0x7592aa,_0x32c106,0x0);logger['error'](_0x158b2f,util[_0x98bc('0x98')](_0xfa8dd9,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x3c565e){return function(_0x4f9399){if(isNotNull(_0x4f9399)&&isNotNull(_0x4f9399[0x0])){if(_0x4f9399[0x0]['contactsRescheduled']>0x0){_0x3c565e[_0x98bc('0x3e')]='RESCHEDULED_CONTACTS';logger[_0x98bc('0x7b')](_0x98bc('0x9c')+_0x3c565e[_0x98bc('0x40')],_0x4f9399[0x0][_0x98bc('0x9d')],'contacts');}else{_0x3c565e[_0x98bc('0x3e')]=_0x98bc('0x9e');logger['info'](_0x98bc('0x9f')+_0x3c565e[_0x98bc('0x40')]);}}};}function notSendMessagesQueue(_0xe8b125){if(_0xe8b125['sendMessageOneNotActive']){freeVariablesPredictive(_0xe8b125);if(_0xe8b125['originated']===0x0&&_0xe8b125[_0x98bc('0x57')]===0x0&&_0xe8b125[_0x98bc('0x5a')]===0x0&&(_0xe8b125['pTalking']||0x0)===0x0){_0xe8b125[_0x98bc('0xa0')]=![];_0xe8b125[_0x98bc('0x51')]=0x0;_0xe8b125['message']=_0x98bc('0x41');loggerSyncQueueSummary['error'](_0x98bc('0xa1'),_0xe8b125[_0x98bc('0x40')],'is\x20not\x20active');}else{_0xe8b125['message']='IS_DISACTIVED';loggerSyncQueueSummary[_0x98bc('0x97')](_0x98bc('0xa1'),_0xe8b125['name'],_0x98bc('0xa2'));}emitVoiceQueueSummary(_0xe8b125);}}function notSendMessagesCampaign(_0x5b0cc4){if(_0x5b0cc4[_0x98bc('0xa0')]){if(_0x5b0cc4[_0x98bc('0x6f')]===0x0){_0x5b0cc4[_0x98bc('0xa0')]=![];_0x5b0cc4[_0x98bc('0x3e')]='NOT_ACTIVE';loggerSyncQueueSummary[_0x98bc('0x97')](_0x98bc('0xa3'),_0x5b0cc4[_0x98bc('0x40')],_0x98bc('0xa4'));}else{_0x5b0cc4['message']=_0x98bc('0xa5');loggerSyncQueueSummary[_0x98bc('0x97')](_0x98bc('0xa3'),_0x5b0cc4[_0x98bc('0x40')],_0x98bc('0xa2'));}emitCampaignSummary(_0x5b0cc4);}}function createObjHistory(_0x33e5b2,_0x2ddbd9,_0x48ad72,_0x1c9ff9,_0xd9357a){_0x33e5b2['message']=_0x48ad72;var _0x2422d9=new Action(_0x33e5b2,_0x2ddbd9);var _0x1fd8bb=new History(_0x2422d9);_0x1fd8bb[_0x98bc('0xa6')]=_0x1c9ff9;_0x1fd8bb['statedesc']=_0xd9357a;_0x1fd8bb[_0x98bc('0xa7')]=_0x2422d9['starttime'];return _0x1fd8bb;}Dialer[_0x98bc('0xa8')][_0x98bc('0x3c')]=function(){var _0x5554da=this;setInterval(function(){_0x5554da[_0x98bc('0xa9')](_0x5554da[_0x98bc('0xaa')],_0x98bc('0xab'));_0x5554da[_0x98bc('0xa9')](_0x5554da[_0x98bc('0x25')],'[actions]');},0x32c8);};Dialer[_0x98bc('0xa8')][_0x98bc('0xa9')]=function(_0x31bace,_0xf1c71b){var _0x3f4091=this;for(var _0x14c4bf in _0x31bace){if(typeof _0x31bace[_0x14c4bf]!==_0x98bc('0x9a')){this['sequence'][_0x98bc('0x1b')](function(){if(!_[_0x98bc('0xac')](_0x31bace[_0x14c4bf])){return ami['Action']({'action':'status','channel':_0x31bace[_0x14c4bf]['channel']})[_0x98bc('0xad')](function(_0x651939){if(_0x651939[_0x98bc('0x3e')]===_0x98bc('0xae')){setTimeout(function(){if(_0x31bace[_0x14c4bf]&&_0x31bace[_0x14c4bf][_0x98bc('0x4d')]!==_0x98bc('0x77')){_0x3f4091[_0x98bc('0xaf')](_0x3f4091['voiceQueues'][_0x31bace[_0x14c4bf][_0x98bc('0xb0')]]);logger[_0x98bc('0x97')](_0x98bc('0xb1'),_0xf1c71b,_0x14c4bf,_0x31bace[_0x14c4bf]['queue']);delete _0x31bace[_0x14c4bf];}if(_0x31bace[_0x14c4bf]&&_0x31bace[_0x14c4bf]['type']===_0x98bc('0x77')){_0x3f4091[_0x98bc('0xaf')](_0x3f4091[_0x98bc('0x20')][_0x31bace[_0x14c4bf][_0x98bc('0xb0')]]);logger[_0x98bc('0x97')]('[Dialer][checkChannel][ivr]',_0xf1c71b,_0x14c4bf,_0x31bace[_0x14c4bf][_0x98bc('0xb0')]);delete _0x31bace[_0x14c4bf];}},0x2328);}});}});}}};Dialer['prototype'][_0x98bc('0xb2')]=function(_0xb9740c){return BPromise[_0x98bc('0xb3')]()['then'](cmHopper[_0x98bc('0xb2')](_0xb9740c))[_0x98bc('0xad')](loggerCatch(_0x98bc('0xb4')));};Dialer[_0x98bc('0xa8')][_0x98bc('0xb5')]=function(_0x28b68b){return BPromise[_0x98bc('0xb3')]()[_0x98bc('0xb6')](cmHopperBlack[_0x98bc('0xb5')](_0x28b68b))[_0x98bc('0xad')](loggerCatch(_0x98bc('0xb7')));};Dialer['prototype']['checkIsBlackListIvr']=function(_0x2e62d6){return BPromise[_0x98bc('0xb3')]()[_0x98bc('0xb6')](cmHopperBlack[_0x98bc('0xb8')](_0x2e62d6))[_0x98bc('0xad')](loggerCatch(_0x98bc('0xb9')));};Dialer[_0x98bc('0xa8')][_0x98bc('0xba')]=function(_0x250843){return BPromise[_0x98bc('0xb3')]()[_0x98bc('0xb6')](cmHopperHistory[_0x98bc('0xbb')](_0x250843))[_0x98bc('0xad')](loggerCatch(_0x98bc('0xbc')));};Dialer['prototype'][_0x98bc('0xbd')]=function(_0x3de2a2){return BPromise[_0x98bc('0xb3')]()['then'](cmHopper[_0x98bc('0xbd')](_0x3de2a2))[_0x98bc('0xad')](loggerCatch('[rescheduleContact]\x20'));};Dialer[_0x98bc('0xa8')]['unlockContact']=function(_0x5da30a,_0x2df147,_0x2515e8){return BPromise['resolve']()[_0x98bc('0xb6')](cmHopper[_0x98bc('0xbe')](_0x5da30a,_0x2df147,_0x2515e8))[_0x98bc('0xad')](loggerCatch(_0x98bc('0xbf')));};Dialer['prototype'][_0x98bc('0xc0')]=function(_0x4bb8fb,_0x51339c,_0x2faf50,_0x240603){return BPromise[_0x98bc('0xb3')]()['then'](cmHopper[_0x98bc('0xc0')](_0x4bb8fb,_0x51339c,_0x2faf50,_0x240603))[_0x98bc('0xad')](loggerCatch(_0x98bc('0xc1')));};Dialer[_0x98bc('0xa8')][_0x98bc('0xc2')]=function(_0x3bb557,_0x21f7ae,_0x42377c){return BPromise[_0x98bc('0xb3')]()[_0x98bc('0xb6')](cmHopper[_0x98bc('0xc2')](_0x3bb557,_0x21f7ae,_0x42377c))[_0x98bc('0xad')](loggerCatch(_0x98bc('0xc1')));};Dialer['prototype'][_0x98bc('0xc3')]=function(_0x37637a){return BPromise[_0x98bc('0xb3')]()[_0x98bc('0xb6')](voiceQueueRt['getVoiceQueueRtPauses'](_0x37637a))['catch'](loggerCatch(_0x98bc('0xc4')));};Dialer[_0x98bc('0xa8')][_0x98bc('0xc5')]=function(_0x3237f0){return BPromise['resolve']()['then'](cmHopper['moveContactManagedDialer'](_0x3237f0))[_0x98bc('0xad')](loggerCatch(_0x98bc('0xc6')));};Dialer[_0x98bc('0xa8')][_0x98bc('0xc7')]=function(_0x1611de){return BPromise[_0x98bc('0xb3')]()[_0x98bc('0xb6')](cmHopperHistory['createHistory'](_0x1611de))[_0x98bc('0xad')](loggerCatch('[createHistory]\x20'));};Dialer[_0x98bc('0xa8')][_0x98bc('0xaf')]=function(_0x5604b4){if(!_[_0x98bc('0x3d')](_0x5604b4)&&_0x5604b4!==null){if(typeof _0x5604b4[_0x98bc('0x6f')]!=='undefined'){if(_0x5604b4[_0x98bc('0x6f')]>0x0){_0x5604b4['originated']-=0x1;}else{logger[_0x98bc('0x97')](_0x98bc('0xc8'));}}}else{logger['error']('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0x98bc('0xa8')][_0x98bc('0xc9')]=function(_0x59a4b7,_0x292bda){var _0x401dfd=this;return function(_0x236e26){_0x401dfd['updateOriginated'](_0x292bda);logger[_0x98bc('0x97')](_0x59a4b7,util[_0x98bc('0x98')](_0x236e26,{'showHidden':![],'depth':null}));};};Dialer[_0x98bc('0xa8')][_0x98bc('0xca')]=function(_0x338f83,_0x3f0187,_0x1cf24e){var _0x485ed1={'state':0x19,'statedesc':_0x98bc('0xcb')};this[_0x98bc('0xaf')](_0x3f0187);this[_0x98bc('0xcc')](_['merge'](_0x485ed1,_['pick'](_0x1cf24e,[_0x98bc('0xcd'),_0x98bc('0xce'),_0x98bc('0xcf'),'VoiceQueueId',_0x98bc('0xd0')])),_0x98bc('0xd1'),_0x98bc('0xd2'));logger[_0x98bc('0x97')](_0x338f83);};Dialer[_0x98bc('0xa8')]['isSuccess']=function(_0x1da0f8){return _0x1da0f8===_0x98bc('0xd3');};Dialer['prototype'][_0x98bc('0xd4')]=function(_0x49efe0){return!_['isUndefined'](_0x49efe0)&&_0x49efe0&&!_['isUndefined'](_0x49efe0[_0x98bc('0x40')])&&!_[_0x98bc('0x3d')](_0x49efe0[_0x98bc('0x74')])&&_0x49efe0[_0x98bc('0x74')]&&(this[_0x98bc('0x22')][util[_0x98bc('0x78')]('SIP/%s',_0x49efe0[_0x98bc('0x40')])][_0x98bc('0xd5')]===_0x98bc('0xd6')||this['trunks'][util['format'](_0x98bc('0xd7'),_0x49efe0[_0x98bc('0x40')])]['status']===_0x98bc('0xd8'));};Dialer[_0x98bc('0xa8')]['saveInDb']=function(_0xf48ec2,_0x545a9a,_0x169fd7){this['createHistory'](_0xf48ec2)[_0x98bc('0xad')](loggerCatch(_0x545a9a));this[_0x98bc('0xc5')](_0xf48ec2)[_0x98bc('0xad')](loggerCatch(_0x169fd7));};Dialer[_0x98bc('0xa8')][_0x98bc('0x37')]=function(_0x2b7100){var _0x52bd3d=this[_0x98bc('0xaa')][_0x2b7100[_0x98bc('0xd9')]];var _0x18cac;if(!_['isNil'](_0x2b7100)&&!_[_0x98bc('0xac')](_0x2b7100[_0x98bc('0xda')])&&!_[_0x98bc('0xac')](_0x2b7100[_0x98bc('0xda')][_0x98bc('0xdb')])&&_0x2b7100[_0x98bc('0xdc')]==='xcally-motion-dialer'&&_0x52bd3d){if(_0x52bd3d['type']!==_0x98bc('0x77')&&this[_0x98bc('0x1f')][_0x52bd3d['queue']][_0x98bc('0xdd')]&&_0x2b7100[_0x98bc('0xde')]===_0x98bc('0xdf')){delete this[_0x98bc('0xaa')][_0x2b7100[_0x98bc('0xd9')]];this[_0x98bc('0xaf')](this[_0x98bc('0x1f')][_0x52bd3d[_0x98bc('0xb0')]]);this['voiceQueues'][_0x52bd3d['queue']][_0x98bc('0x62')]+=0x1;this[_0x98bc('0x1f')][_0x52bd3d[_0x98bc('0xb0')]][_0x98bc('0x61')]+=0x1;_0x18cac=new Hangup(_0x52bd3d,_0x2b7100);_0x18cac[_0x98bc('0xa6')]=0x12;_0x18cac[_0x98bc('0xe0')]=_0x98bc('0xe1');_0x18cac['membername']='AMD';this[_0x98bc('0xcc')](_0x18cac,'[syncHangupInAMD][createHistory]',_0x98bc('0xe2'));}if(_0x52bd3d['type']!=='ivr'&&this['voiceQueues'][_0x52bd3d[_0x98bc('0xb0')]][_0x98bc('0xdd')]&&_0x2b7100[_0x98bc('0xde')]===_0x98bc('0xe3')){var _0x59dae9=this;return new BPromise(function(_0x567f8a,_0x28d338){delete _0x59dae9[_0x98bc('0xaa')][_0x2b7100[_0x98bc('0xd9')]];_0x59dae9[_0x98bc('0xaf')](_0x59dae9[_0x98bc('0x1f')][_0x52bd3d[_0x98bc('0xb0')]]);_0x59dae9[_0x98bc('0x1f')][_0x52bd3d['queue']][_0x98bc('0x62')]+=0x1;_0x59dae9[_0x98bc('0x1f')][_0x52bd3d[_0x98bc('0xb0')]][_0x98bc('0x61')]+=0x1;var _0x59c81c=_0x59dae9[_0x98bc('0x1f')][_0x52bd3d[_0x98bc('0xb0')]];var _0x16fd50=new Hangup(_0x52bd3d,_0x2b7100);_0x16fd50[_0x98bc('0xa6')]=0x13;_0x16fd50[_0x98bc('0xe0')]=_0x98bc('0xe4');_0x16fd50['membername']='AMD';_0x16fd50[_0x98bc('0xe5')]+=0x1;_0x16fd50[_0x98bc('0xe6')]+=0x1;_0x16fd50[_0x98bc('0xe7')]=!![];_0x59dae9[_0x98bc('0xc7')](_0x16fd50)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x16fd50[_0x98bc('0xe8')]+_0x16fd50[_0x98bc('0xe9')]+_0x16fd50['countnoanswerretry']+_0x16fd50['countnosuchnumberretry']+_0x16fd50[_0x98bc('0xea')]+_0x16fd50[_0x98bc('0xeb')]+_0x16fd50[_0x98bc('0xe5')]+_0x16fd50[_0x98bc('0xec')]>=_0x59c81c[_0x98bc('0xed')]){_0x59dae9[_0x98bc('0xee')](_0x16fd50,_0x567f8a,_0x28d338,_0x98bc('0xef'));}else{if(_0x16fd50[_0x98bc('0xe5')]>=_0x59c81c[_0x98bc('0xf0')]){_0x59dae9[_0x98bc('0xf1')](_0x16fd50,_0x567f8a,_0x28d338,'reason\x2019\x20machine....');}else{_0x59dae9[_0x98bc('0xbd')]({'active':![],'countmachineretry':_0x16fd50[_0x98bc('0xe5')],'scheduledat':moment()[_0x98bc('0xf2')](_0x59c81c[_0x98bc('0xf3')],_0x98bc('0xf4'))[_0x98bc('0x78')](_0x98bc('0xf5')),'ContactId':_0x16fd50['ContactId'],'ListId':_0x16fd50[_0x98bc('0xce')],'VoiceQueueId':_0x16fd50['VoiceQueueId']||undefined,'CampaignId':_0x16fd50['CampaignId']||undefined})[_0x98bc('0xad')](loggerCatch(_0x98bc('0xf6')));_0x567f8a({'reschedule':0x1});}}});}if(_0x52bd3d[_0x98bc('0x4d')]===_0x98bc('0x77')&&this[_0x98bc('0x20')][_0x52bd3d[_0x98bc('0xb0')]][_0x98bc('0xdd')]&&_0x2b7100['value']===_0x98bc('0xdf')){delete this['uniqueId'][_0x2b7100['uniqueid']];this[_0x98bc('0xaf')](this[_0x98bc('0x20')][_0x52bd3d[_0x98bc('0xb0')]]);_0x18cac=new Hangup(_0x52bd3d,_0x2b7100);_0x18cac['state']=0x12;_0x18cac['statedesc']=_0x98bc('0xe1');_0x18cac['membername']=_0x98bc('0xf7');this['saveInDb'](_0x18cac,_0x98bc('0xf8'),_0x98bc('0xf9'));}if(_0x52bd3d[_0x98bc('0x4d')]===_0x98bc('0x77')&&this[_0x98bc('0x20')][_0x52bd3d['queue']][_0x98bc('0xdd')]&&_0x2b7100[_0x98bc('0xde')]===_0x98bc('0xe3')){var _0x59dae9=this;return new BPromise(function(_0x186f74,_0x1aba6e){delete _0x59dae9[_0x98bc('0xaa')][_0x2b7100[_0x98bc('0xd9')]];_0x59dae9['updateOriginated'](_0x59dae9['campaigns'][_0x52bd3d[_0x98bc('0xb0')]]);_0x59dae9[_0x98bc('0x20')][_0x52bd3d[_0x98bc('0xb0')]][_0x98bc('0x62')]+=0x1;_0x59dae9[_0x98bc('0x20')][_0x52bd3d[_0x98bc('0xb0')]]['outboundAnswerAgiCallsDay']+=0x1;var _0xec57b6=_0x59dae9[_0x98bc('0x20')][_0x52bd3d['queue']];var _0x22af67=new Hangup(_0x52bd3d,_0x2b7100);_0x22af67[_0x98bc('0xa6')]=0x13;_0x22af67[_0x98bc('0xe0')]='Machine';_0x22af67[_0x98bc('0xfa')]=_0x98bc('0xf7');_0x22af67[_0x98bc('0xe5')]+=0x1;_0x22af67[_0x98bc('0xe6')]+=0x1;_0x22af67['amd']=!![];_0x59dae9['createHistory'](_0x22af67)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x22af67[_0x98bc('0xe8')]+_0x22af67[_0x98bc('0xe9')]+_0x22af67[_0x98bc('0xfb')]+_0x22af67[_0x98bc('0xfc')]+_0x22af67['countdropretry']+_0x22af67['countabandonedretry']+_0x22af67[_0x98bc('0xe5')]+_0x22af67[_0x98bc('0xec')]>=_0xec57b6[_0x98bc('0xed')]){_0x59dae9['stateGlobal'](_0x22af67,_0x186f74,_0x1aba6e,'reason19\x20machine....');}else{if(_0x22af67['countmachineretry']>=_0xec57b6[_0x98bc('0xf0')]){_0x59dae9['createStateFinal'](_0x22af67,_0x186f74,_0x1aba6e,'reason\x2019\x20machine....');}else{_0x59dae9[_0x98bc('0xbd')]({'active':![],'countmachineretry':_0x22af67[_0x98bc('0xe5')],'scheduledat':moment()[_0x98bc('0xf2')](_0xec57b6[_0x98bc('0xf3')],_0x98bc('0xf4'))['format'](_0x98bc('0xf5')),'ContactId':_0x22af67[_0x98bc('0xcd')],'ListId':_0x22af67[_0x98bc('0xce')],'VoiceQueueId':_0x22af67[_0x98bc('0xfd')]||undefined,'CampaignId':_0x22af67['CampaignId']||undefined})[_0x98bc('0xad')](loggerCatch(_0x98bc('0xf6')));_0x186f74({'reschedule':0x1});}}});}}};Dialer[_0x98bc('0xa8')][_0x98bc('0x34')]=function(_0xc4ffff){var _0x4d876e=this['uniqueId'][_0xc4ffff['uniqueid']];var _0x30ae5e=this;var _0x19ae17;if(_0x4d876e&&_0x4d876e[_0x98bc('0x4d')]===_0x98bc('0x77')){delete this[_0x98bc('0xaa')][_0xc4ffff[_0x98bc('0xd9')]];this[_0x98bc('0xaf')](this[_0x98bc('0x20')][_0x4d876e[_0x98bc('0xb0')]]);this['campaigns'][_0x4d876e[_0x98bc('0xb0')]][_0x98bc('0xfe')]+=0x1;_0x19ae17=new Hangup(_0x4d876e,_0xc4ffff);this[_0x98bc('0xc7')](_0x19ae17)['catch'](loggerCatch(_0x98bc('0xff')));this[_0x98bc('0xc5')](_0x19ae17)['catch'](loggerCatch(_0x98bc('0x100')));}if(_0x4d876e&&_0x4d876e[_0x98bc('0x4d')]!==_0x98bc('0x77')&&isNotNull(this[_0x98bc('0x1f')][_0x4d876e['queue']][_0x98bc('0x101')])){delete this[_0x98bc('0xaa')][_0xc4ffff[_0x98bc('0xd9')]];this[_0x98bc('0xaf')](this[_0x98bc('0x1f')][_0x4d876e[_0x98bc('0xb0')]]);this[_0x98bc('0x1f')][_0x4d876e[_0x98bc('0xb0')]][_0x98bc('0x62')]+=0x1;this[_0x98bc('0x1f')][_0x4d876e['queue']]['outboundAnswerAgiCallsDay']+=0x1;_0x19ae17=new Hangup(_0x4d876e,_0xc4ffff);_0x19ae17['state']=0x10;_0x19ae17[_0x98bc('0xe0')]=_0x98bc('0x102');_0x19ae17[_0x98bc('0xfa')]=_0x98bc('0x103');this['createHistory'](_0x19ae17)['catch'](loggerCatch(_0x98bc('0xff')));this[_0x98bc('0xc5')](_0x19ae17)[_0x98bc('0xad')](loggerCatch(_0x98bc('0x100')));}if(_0x4d876e&&_0x4d876e[_0x98bc('0x4d')]!==_0x98bc('0x77')&&!isNotNull(this['voiceQueues'][_0x4d876e['queue']][_0x98bc('0x101')])){delete this[_0x98bc('0xaa')][_0xc4ffff[_0x98bc('0xd9')]];this[_0x98bc('0xaf')](this[_0x98bc('0x1f')][_0x4d876e[_0x98bc('0xb0')]]);this[_0x98bc('0x1f')][_0x4d876e[_0x98bc('0xb0')]]['outboundUnknownCallsDay']+=0x1;_0x19ae17=new Hangup(_0x4d876e,_0xc4ffff);_0x19ae17[_0x98bc('0xa6')]=0xc;_0x19ae17[_0x98bc('0xe0')]=_0xc4ffff[_0x98bc('0x104')];_0x19ae17[_0x98bc('0xfa')]=_0x98bc('0x105');this[_0x98bc('0xc7')](_0x19ae17)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x98bc('0xc5')](_0x19ae17)[_0x98bc('0xad')](loggerCatch(_0x98bc('0x100')));}};Dialer[_0x98bc('0xa8')][_0x98bc('0x106')]=function(_0x45d3ff){var _0x113857=this[_0x98bc('0xaa')][_0x45d3ff['uniqueid']];var _0x12c472=this;if(this[_0x98bc('0x1f')][_0x45d3ff[_0x98bc('0xb0')]]){if(_0x113857&&_0x113857[_0x98bc('0x4d')]!=='ivr'){delete this['uniqueId'][_0x45d3ff[_0x98bc('0xd9')]];this['voiceQueues'][_0x45d3ff[_0x98bc('0xb0')]]['outboundAnswerCallsDay']+=0x1;var _0x148f62=new AgentComplete(_0x113857,_0x45d3ff);if(_0x45d3ff[_0x98bc('0x107')]===_0x98bc('0x108')){_0x148f62[_0x98bc('0x109')]=this[_0x98bc('0x1f')][_0x45d3ff[_0x98bc('0xb0')]][_0x98bc('0x10a')]&&this[_0x98bc('0x1f')][_0x45d3ff[_0x98bc('0xb0')]][_0x98bc('0x10b')]?moment()[_0x98bc('0x78')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this[_0x98bc('0xc7')](_0x148f62)[_0x98bc('0xad')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x98bc('0xc5')](_0x148f62)[_0x98bc('0xad')](loggerCatch(_0x98bc('0x10c')));}}};Dialer[_0x98bc('0xa8')][_0x98bc('0x2e')]=function(_0x56bf62){if(this[_0x98bc('0x1f')][_0x56bf62[_0x98bc('0xb0')]]){if(this[_0x98bc('0xaa')][_0x56bf62[_0x98bc('0xd9')]]&&this[_0x98bc('0xaa')][_0x56bf62[_0x98bc('0xd9')]][_0x98bc('0x4d')]!=='ivr'){this[_0x98bc('0xaf')](this[_0x98bc('0x1f')][_0x56bf62[_0x98bc('0xb0')]]);this[_0x98bc('0xaa')][_0x56bf62['uniqueid']][_0x98bc('0x10d')]=moment()[_0x98bc('0x78')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0x98bc('0xa8')]['queueCallerAbandonCreateState']=function(_0x2c21f7){this[_0x98bc('0xc7')](_0x2c21f7)['catch'](loggerCatch(_0x98bc('0x10e')));this[_0x98bc('0xc5')](_0x2c21f7)['catch'](loggerCatch(_0x98bc('0x10f')));};Dialer[_0x98bc('0xa8')][_0x98bc('0x110')]=function(_0x2baf35){var _0xadc83f=this[_0x98bc('0xaa')][_0x2baf35['uniqueid']];var _0x50c378=this;if(this[_0x98bc('0x1f')][_0x2baf35[_0x98bc('0xb0')]]){if(_0xadc83f&&_0xadc83f[_0x98bc('0x4d')]!=='ivr'){delete this[_0x98bc('0xaa')][_0x2baf35['uniqueid']];this[_0x98bc('0xaf')](this[_0x98bc('0x1f')][_0x2baf35[_0x98bc('0xb0')]]);_0xadc83f[_0x98bc('0x111')]=moment()[_0x98bc('0x78')](_0x98bc('0xf5'));var _0x18fc52=new QueueCallerAbandon(_0xadc83f,_0x2baf35);if(getSeconds(_0xadc83f[_0x98bc('0x111')],_0xadc83f['responsetime'])>=_0xadc83f[_0x98bc('0x112')]){this['voiceQueues'][_0x2baf35['queue']][_0x98bc('0x6b')]+=0x1;this[_0x98bc('0x1f')][_0x2baf35['queue']]['outboundDropCallsDayTimeout']+=0x1;this[_0x98bc('0x1f')][_0x2baf35[_0x98bc('0xb0')]][_0x98bc('0x113')]+=0x1;_0x18fc52[_0x98bc('0xa6')]=0xa;_0x18fc52[_0x98bc('0xe0')]=_0x98bc('0x114');_0x18fc52['dropreason']=_0x98bc('0x115');_0x18fc52[_0x98bc('0x109')]=this['voiceQueues'][_0x2baf35[_0x98bc('0xb0')]][_0x98bc('0x10a')]?moment()[_0x98bc('0x78')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x18fc52[_0x98bc('0xea')]+=0x1;_0x18fc52[_0x98bc('0xe6')]+=0x1;if(_0x18fc52['countdropretry']>=this[_0x98bc('0x1f')][_0x2baf35['queue']]['dialDropMaxRetry']){this['queueCallerAbandonCreateState'](_0x18fc52);}else{this['rescheduleContact']({'active':![],'countdropretry':_0x18fc52[_0x98bc('0xea')],'scheduledat':moment()['add'](this[_0x98bc('0x1f')][_0x2baf35['queue']][_0x98bc('0x116')],'minutes')[_0x98bc('0x78')](_0x98bc('0xf5')),'ContactId':_0xadc83f['ContactId'],'ListId':_0xadc83f[_0x98bc('0xce')],'VoiceQueueId':_0xadc83f[_0x98bc('0xfd')]||undefined,'CampaignId':_0xadc83f[_0x98bc('0xd0')]||undefined})[_0x98bc('0xad')](loggerCatch(_0x98bc('0x117')));var _0x14d27e=new History(_0x18fc52);_0x14d27e['state']=0xa;_0x14d27e['statedesc']=_0x98bc('0x114');_0x14d27e[_0x98bc('0x118')]=moment()['format'](_0x98bc('0xf5'));_0x14d27e['endtime']=_0x14d27e[_0x98bc('0x118')];_0x14d27e[_0x98bc('0x119')]=_0x18fc52[_0x98bc('0x119')];_0x14d27e['calleridnum']=_0x18fc52[_0x98bc('0x11a')];this['createHistory'](_0x14d27e)[_0x98bc('0xad')](loggerCatch(_0x98bc('0x11b')));}}else{this['voiceQueues'][_0x2baf35[_0x98bc('0xb0')]][_0x98bc('0x11c')]+=0x1;this[_0x98bc('0x1f')][_0x2baf35['queue']][_0x98bc('0x66')]+=0x1;_0x18fc52['state']=0xb;_0x18fc52[_0x98bc('0xe0')]=_0x98bc('0x11d');_0x18fc52[_0x98bc('0x11e')]=_0x98bc('0x11f');_0x18fc52[_0x98bc('0xeb')]+=0x1;_0x18fc52[_0x98bc('0xe6')]+=0x1;if(_0x18fc52[_0x98bc('0xeb')]>=this[_0x98bc('0x1f')][_0x2baf35[_0x98bc('0xb0')]][_0x98bc('0x120')]){this['queueCallerAbandonCreateState'](_0x18fc52);}else{this[_0x98bc('0xbd')]({'active':![],'countabandonedretry':_0x18fc52[_0x98bc('0xeb')],'scheduledat':moment()['add'](this[_0x98bc('0x1f')][_0x2baf35['queue']][_0x98bc('0x121')],_0x98bc('0xf4'))[_0x98bc('0x78')](_0x98bc('0xf5')),'ContactId':_0xadc83f[_0x98bc('0xcd')],'ListId':_0xadc83f[_0x98bc('0xce')],'VoiceQueueId':_0xadc83f[_0x98bc('0xfd')]||undefined,'CampaignId':_0xadc83f[_0x98bc('0xd0')]||undefined})['catch'](loggerCatch('[rescheduleContact][Abandoned]'));var _0x14d27e=new History(_0x18fc52);_0x14d27e[_0x98bc('0xa6')]=0xb;_0x14d27e[_0x98bc('0xe0')]=_0x98bc('0x11d');_0x14d27e[_0x98bc('0x118')]=moment()[_0x98bc('0x78')](_0x98bc('0xf5'));_0x14d27e[_0x98bc('0xa7')]=_0x14d27e[_0x98bc('0x118')];_0x14d27e['calleridname']=_0x18fc52[_0x98bc('0x119')];_0x14d27e[_0x98bc('0x11a')]=_0x18fc52[_0x98bc('0x11a')];this[_0x98bc('0xc7')](_0x14d27e)[_0x98bc('0xad')](loggerCatch(_0x98bc('0x122')));}}}}};Dialer[_0x98bc('0xa8')][_0x98bc('0x36')]=function(_0x59578c){if(this[_0x98bc('0x25')][_0x59578c['uniqueid']]){this[_0x98bc('0x25')][_0x59578c['uniqueid']]['channel']=_0x59578c[_0x98bc('0x123')];}if(this['uniqueId'][_0x59578c[_0x98bc('0xd9')]]){this['uniqueId'][_0x59578c[_0x98bc('0xd9')]][_0x98bc('0x123')]=_0x59578c[_0x98bc('0x123')];}};Dialer[_0x98bc('0xa8')][_0x98bc('0x124')]=function(_0xb50017){if(strategy[this[_0x98bc('0x1f')][this[_0x98bc('0x25')][_0xb50017[_0x98bc('0x125')]]['queue']][_0x98bc('0x4f')]]===_0x98bc('0x126')){if(this['actions'][_0xb50017[_0x98bc('0x125')]]&&_[_0x98bc('0xac')](this[_0x98bc('0x25')][_0xb50017[_0x98bc('0x125')]][_0x98bc('0x127')])&&_0xb50017['status']==='1'&&_0xb50017[_0x98bc('0x128')]==='0'){if(this['agents'][_0xb50017['stateinterface']]){if(!this[_0x98bc('0x21')][_0xb50017['stateinterface']]['locked']){this[_0x98bc('0x21')][_0xb50017['stateinterface']][_0x98bc('0x127')]=!![];this[_0x98bc('0x25')][_0xb50017[_0x98bc('0x125')]][_0x98bc('0x127')]=!![];this[_0x98bc('0x25')][_0xb50017[_0x98bc('0x125')]][_0x98bc('0x129')]=_0xb50017[_0x98bc('0x129')];}}}}else if((strategy[this[_0x98bc('0x1f')][this['actions'][_0xb50017[_0x98bc('0x125')]][_0x98bc('0xb0')]][_0x98bc('0x4f')]]||_0x98bc('0x1a'))===_0x98bc('0x1a')){if(this[_0x98bc('0x25')][_0xb50017[_0x98bc('0x125')]]){if(this[_0x98bc('0x21')][_0xb50017['stateinterface']]){this['actions'][_0xb50017[_0x98bc('0x125')]][_0x98bc('0x129')]=_0xb50017[_0x98bc('0x129')];if(_[_0x98bc('0xac')](this['queueBooked'][this['actions'][_0xb50017[_0x98bc('0x125')]][_0x98bc('0xb0')]])){this[_0x98bc('0x2b')][this['actions'][_0xb50017[_0x98bc('0x125')]][_0x98bc('0xb0')]]=[];}this[_0x98bc('0x2b')][this[_0x98bc('0x25')][_0xb50017[_0x98bc('0x125')]][_0x98bc('0xb0')]][_0x98bc('0x12a')](_[_0x98bc('0x8d')](_[_0x98bc('0x12b')](this[_0x98bc('0x25')][_0xb50017[_0x98bc('0x125')]],[_0x98bc('0x12c'),_0x98bc('0x129')]),{'status':_0xb50017[_0x98bc('0xd5')],'paused':_0xb50017[_0x98bc('0x128')]}));}}}};function unlockQueueStatus(_0xaaaa61,_0x52bb0a){setTimeout(function(){if(_['isUndefined'](_0xaaaa61['queueStatusComplete'])){loggerBooked['error'](_0x98bc('0x12d'),_0x52bb0a);}_0xaaaa61[_0x98bc('0x12e')]=!![];loggerBooked[_0x98bc('0x7b')](_0x98bc('0x12f'),_0x52bb0a,JSON[_0x98bc('0x4a')](_[_0x98bc('0x12b')](_0xaaaa61,['name',_0x98bc('0x12e')])));},0x1f3);}Dialer[_0x98bc('0xa8')]['syncQueueStatusComplete']=function(_0x2d79ff){var _0xa5c4c5=this;var _0x5422c9=_0xa5c4c5['voiceQueues'][_0xa5c4c5[_0x98bc('0x25')][_0x2d79ff[_0x98bc('0x125')]]['queue']];if(strategy[this[_0x98bc('0x1f')][this[_0x98bc('0x25')][_0x2d79ff[_0x98bc('0x125')]]['queue']][_0x98bc('0x4f')]]===_0x98bc('0x126')){if(this[_0x98bc('0x25')][_0x2d79ff[_0x98bc('0x125')]]&&this[_0x98bc('0x25')][_0x2d79ff[_0x98bc('0x125')]][_0x98bc('0x129')]){this[_0x98bc('0x93')][_0x98bc('0x130')](this[_0x98bc('0x25')][_0x2d79ff[_0x98bc('0x125')]]['idHopper'],this['actions'][_0x2d79ff['actionid']][_0x98bc('0x129')])[_0x98bc('0xad')](function(_0x426fae){logger[_0x98bc('0x97')](_0x98bc('0x131'),util[_0x98bc('0x98')](_0x426fae,{'showHidden':![],'depth':null}));})[_0x98bc('0x1d')](function(){_0xa5c4c5[_0x98bc('0xaf')](_0xa5c4c5[_0x98bc('0x1f')][_0xa5c4c5[_0x98bc('0x25')][_0x2d79ff[_0x98bc('0x125')]]['queue']]);_0xa5c4c5['agents'][_0xa5c4c5[_0x98bc('0x25')][_0x2d79ff[_0x98bc('0x125')]][_0x98bc('0x129')]]['locked']=![];delete _0xa5c4c5['actions'][_0x2d79ff[_0x98bc('0x125')]];unlockQueueStatus(_0x5422c9);});}else{this['updateOriginated'](this['voiceQueues'][this[_0x98bc('0x25')][_0x2d79ff[_0x98bc('0x125')]][_0x98bc('0xb0')]]);this[_0x98bc('0xbd')]({'active':![],'ContactId':this[_0x98bc('0x25')][_0x2d79ff[_0x98bc('0x125')]][_0x98bc('0xcd')],'ListId':this[_0x98bc('0x25')][_0x2d79ff[_0x98bc('0x125')]][_0x98bc('0xce')],'VoiceQueueId':this[_0x98bc('0x25')][_0x2d79ff[_0x98bc('0x125')]][_0x98bc('0xfd')]||undefined,'CampaignId':this[_0x98bc('0x25')][_0x2d79ff['actionid']][_0x98bc('0xd0')]||undefined})['catch'](loggerCatch(_0x98bc('0x132')));delete this[_0x98bc('0x25')][_0x2d79ff[_0x98bc('0x125')]];unlockQueueStatus(_0x5422c9);}}else if((strategy[this[_0x98bc('0x1f')][this[_0x98bc('0x25')][_0x2d79ff['actionid']][_0x98bc('0xb0')]][_0x98bc('0x4f')]]||_0x98bc('0x1a'))===_0x98bc('0x1a')){var _0x2a40c2;if(this[_0x98bc('0x25')][_0x2d79ff[_0x98bc('0x125')]]&&!_['isEmpty'](this[_0x98bc('0x2b')][this[_0x98bc('0x25')][_0x2d79ff['actionid']][_0x98bc('0xb0')]])){if(this[_0x98bc('0x2c')][_0xa5c4c5[_0x98bc('0x25')][_0x2d79ff['actionid']]['queue']]){this[_0x98bc('0x2c')][_0xa5c4c5[_0x98bc('0x25')][_0x2d79ff[_0x98bc('0x125')]][_0x98bc('0xb0')]]=this[_0x98bc('0x2c')][this[_0x98bc('0x25')][_0x2d79ff[_0x98bc('0x125')]][_0x98bc('0xb0')]]?this[_0x98bc('0x2c')][this[_0x98bc('0x25')][_0x2d79ff['actionid']]['queue']]:this[_0x98bc('0x2b')][this[_0x98bc('0x25')][_0x2d79ff[_0x98bc('0x125')]][_0x98bc('0xb0')]]?this[_0x98bc('0x2b')][this['actions'][_0x2d79ff[_0x98bc('0x125')]][_0x98bc('0xb0')]][_0x98bc('0x133')]||0x0:0x0;}this[_0x98bc('0x2b')][this[_0x98bc('0x25')][_0x2d79ff[_0x98bc('0x125')]]['queue']][_0x98bc('0x133')]=this['queueBookedRR'][this[_0x98bc('0x25')][_0x2d79ff[_0x98bc('0x125')]][_0x98bc('0xb0')]];for(var _0x1e4682=0x0;_0x1e4682<this[_0x98bc('0x2b')][this[_0x98bc('0x25')][_0x2d79ff['actionid']][_0x98bc('0xb0')]][_0x98bc('0x134')];_0x1e4682+=0x1){_0x2a40c2=rr(this[_0x98bc('0x2b')][this[_0x98bc('0x25')][_0x2d79ff['actionid']][_0x98bc('0xb0')]]);this['queueBookedRR'][_0xa5c4c5['actions'][_0x2d79ff['actionid']][_0x98bc('0xb0')]]=this['queueBooked'][this[_0x98bc('0x25')][_0x2d79ff[_0x98bc('0x125')]][_0x98bc('0xb0')]]['_rr'];if(_0x2a40c2[_0x98bc('0xd5')]==='1'&&_0x2a40c2[_0x98bc('0x128')]==='0'){break;}}if(!_[_0x98bc('0xac')](_0x2a40c2)){this['agents'][_0x2a40c2[_0x98bc('0x129')]][_0x98bc('0x135')]=_[_0x98bc('0x3d')](this[_0x98bc('0x21')][_0x2a40c2[_0x98bc('0x129')]][_0x98bc('0x135')])?!![]:this['agents'][_0x2a40c2[_0x98bc('0x129')]][_0x98bc('0x135')];}loggerBooked[_0x98bc('0x7b')](_0x98bc('0x136'),_0x2d79ff['actionid'],_0x98bc('0x137'),JSON['stringify'](_['pick'](this[_0x98bc('0x21')][_0x2a40c2[_0x98bc('0x129')]],[_0x98bc('0x40'),'unlockRR'])),_0x98bc('0x138'),JSON[_0x98bc('0x4a')](_0x2a40c2[_0x98bc('0x12c')]));if(!_['isNil'](_0x2a40c2)&&_0x2a40c2[_0x98bc('0xd5')]==='1'&&_0x2a40c2[_0x98bc('0x128')]==='0'&&this[_0x98bc('0x21')][_0x2a40c2[_0x98bc('0x129')]][_0x98bc('0x135')]){this[_0x98bc('0x21')][_0x2a40c2[_0x98bc('0x129')]][_0x98bc('0x135')]=![];this['queueBooked'][_0xa5c4c5['actions'][_0x2d79ff['actionid']]['queue']]=[];this[_0x98bc('0x93')][_0x98bc('0x130')](_0x2a40c2['idHopper'],_0x2a40c2[_0x98bc('0x129')])[_0x98bc('0xad')](function(_0x1ab316){logger['error']('[Catch][Preview][syncQueueStatusComplete]',util[_0x98bc('0x98')](_0x1ab316,{'showHidden':![],'depth':null}));})['finally'](function(){_0xa5c4c5[_0x98bc('0xaf')](_0xa5c4c5[_0x98bc('0x1f')][_0xa5c4c5[_0x98bc('0x25')][_0x2d79ff['actionid']][_0x98bc('0xb0')]]);setTimeout(function(){_0xa5c4c5[_0x98bc('0x21')][_0x2a40c2[_0x98bc('0x129')]]['unlockRR']=!![];loggerBooked[_0x98bc('0x7b')](_0x98bc('0x139'),_0x2d79ff[_0x98bc('0x125')],_0x98bc('0x137'),JSON[_0x98bc('0x4a')](_[_0x98bc('0x12b')](_0xa5c4c5[_0x98bc('0x21')][_0x2a40c2[_0x98bc('0x129')]],[_0x98bc('0x40'),_0x98bc('0x135')])),_0x98bc('0x138'),JSON[_0x98bc('0x4a')](_0x2a40c2[_0x98bc('0x12c')]));},0xc7);delete _0xa5c4c5[_0x98bc('0x25')][_0x2d79ff[_0x98bc('0x125')]];unlockQueueStatus(_0x5422c9,_0x2d79ff[_0x98bc('0x125')]);});}else{loggerBooked[_0x98bc('0x7b')](_0x98bc('0x13a'));this[_0x98bc('0xaf')](this[_0x98bc('0x1f')][this[_0x98bc('0x25')][_0x2d79ff['actionid']][_0x98bc('0xb0')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0x98bc('0x25')][_0x2d79ff[_0x98bc('0x125')]]['ContactId'],'ListId':this['actions'][_0x2d79ff['actionid']]['ListId'],'VoiceQueueId':this['actions'][_0x2d79ff[_0x98bc('0x125')]][_0x98bc('0xfd')]||undefined,'CampaignId':this['actions'][_0x2d79ff['actionid']][_0x98bc('0xd0')]||undefined})[_0x98bc('0xad')](loggerCatch(_0x98bc('0x132')));delete this[_0x98bc('0x25')][_0x2d79ff['actionid']];unlockQueueStatus(_0x5422c9);}}else{loggerBooked[_0x98bc('0x7b')](_0x98bc('0x13b'));this['updateOriginated'](this['voiceQueues'][this[_0x98bc('0x25')][_0x2d79ff[_0x98bc('0x125')]][_0x98bc('0xb0')]]);this['rescheduleContact']({'active':![],'ContactId':this['actions'][_0x2d79ff[_0x98bc('0x125')]][_0x98bc('0xcd')],'ListId':this['actions'][_0x2d79ff['actionid']][_0x98bc('0xce')],'VoiceQueueId':this[_0x98bc('0x25')][_0x2d79ff[_0x98bc('0x125')]][_0x98bc('0xfd')]||undefined,'CampaignId':this['actions'][_0x2d79ff[_0x98bc('0x125')]][_0x98bc('0xd0')]||undefined})[_0x98bc('0xad')](loggerCatch(_0x98bc('0x13c')));delete this[_0x98bc('0x25')][_0x2d79ff[_0x98bc('0x125')]];unlockQueueStatus(_0x5422c9);}}else{loggerBooked[_0x98bc('0x7b')](_0x98bc('0x13d'));this[_0x98bc('0xaf')](this[_0x98bc('0x1f')][this[_0x98bc('0x25')][_0x2d79ff[_0x98bc('0x125')]]['queue']]);this['rescheduleContact']({'active':![],'ContactId':this[_0x98bc('0x25')][_0x2d79ff['actionid']]['ContactId'],'ListId':this[_0x98bc('0x25')][_0x2d79ff[_0x98bc('0x125')]][_0x98bc('0xce')],'VoiceQueueId':this[_0x98bc('0x25')][_0x2d79ff[_0x98bc('0x125')]][_0x98bc('0xfd')]||undefined,'CampaignId':this[_0x98bc('0x25')][_0x2d79ff['actionid']][_0x98bc('0xd0')]||undefined})[_0x98bc('0xad')](loggerCatch(_0x98bc('0x13e')));delete this[_0x98bc('0x25')][_0x2d79ff[_0x98bc('0x125')]];unlockQueueStatus(_0x5422c9);}};Dialer['prototype'][_0x98bc('0x3b')]=function(){var _0x1d3663=this;setInterval(function(){_0x1d3663['syncCampaigns']();},0x3e8);};Dialer[_0x98bc('0xa8')]['checkIsTrunkReachable']=function(_0x225fde){var _0x3036e2=this;return function(){if(!_0x3036e2[_0x98bc('0xd4')](_0x225fde['Trunk'])){if(!_0x3036e2[_0x98bc('0xd4')](_0x225fde[_0x98bc('0x13f')])){_0x225fde[_0x98bc('0x3e')]=_0x98bc('0x140');throw _0x225fde['name']+'\x20trunk\x20is\x20not\x20reachable';}}};};Dialer[_0x98bc('0xa8')][_0x98bc('0x141')]=function(_0x2733cb,_0x9b3174,_0x5730e8,_0x365b91){var _0x41dd63=this;return function(){var _0x2f26c1=!![];return _0x41dd63[_0x98bc('0x142')](_0x2733cb,_0x9b3174,_0x5730e8,_0x365b91,_0x2f26c1);};};Dialer[_0x98bc('0xa8')][_0x98bc('0x143')]=function(_0x590f76,_0x159653,_0x455264,_0x27be36){var _0x56cb9d=this;return function(){var _0x109709=![];return _0x56cb9d['ifTime'](_0x590f76[_0x98bc('0x45')],_0x159653,_0x455264,_0x27be36,_0x109709);};};Dialer[_0x98bc('0xa8')][_0x98bc('0x142')]=function(_0x45296c,_0x3a39b7,_0x364dfa,_0x26d900,_0x14089d){var _0x4c3172=[];return new BPromise(function(_0xdbf2d5,_0x253d27){if(!isNotNull(_0x45296c)){_0x26d900[_0x98bc('0x3e')]=_0x98bc('0x46');return _0x253d27(msgResponse(_0x98bc('0x142'),_0x98bc('0x144'),_0x364dfa+_0x98bc('0x145')));}if(_[_0x98bc('0x47')](_0x45296c)){_0x26d900['message']='INTERVAL_IS_EMPTY';return _0x253d27(msgResponse(_0x98bc('0x142'),_0x98bc('0x144'),_0x364dfa+'\x20Intervals\x20is\x20empty\x20'));}if(_0x3a39b7&&_['isUndefined'](config[_0x98bc('0x146')][_0x3a39b7])){_0x26d900['message']='TIMEZONE_UNKNOW';return _0x253d27(msgResponse(_0x98bc('0x142'),'Failure',_0x364dfa+_0x98bc('0x147')+_0x3a39b7));}if(_[_0x98bc('0x148')](_0x45296c)){for(var _0x9d4890=0x0;_0x9d4890<_0x45296c['length'];_0x9d4890+=0x1){_0x4c3172[_0x98bc('0x12a')](ami[_0x98bc('0x149')]({'action':_0x98bc('0x14a'),'command':util[_0x98bc('0x78')]('iftime\x20%s,%s',_0x45296c[_0x9d4890][_0x98bc('0x14b')],!_[_0x98bc('0x3d')](config[_0x98bc('0x146')][_0x3a39b7])?_0x3a39b7:'')})[_0x98bc('0xb6')](function(_0x29ff3c){return _0x29ff3c[_0x98bc('0x14c')][_0x98bc('0x14d')](_0x98bc('0x14e'))>=0x0;})[_0x98bc('0xad')](myreject(_0x253d27)));}}else{_0x4c3172[_0x98bc('0x12a')](ami[_0x98bc('0x149')]({'action':_0x98bc('0x14a'),'command':util[_0x98bc('0x78')](_0x98bc('0x14f'),_0x45296c,!_[_0x98bc('0x3d')](config[_0x98bc('0x146')][_0x3a39b7])?_0x3a39b7:'')})[_0x98bc('0xb6')](function(_0x4f2be5){return _0x4f2be5[_0x98bc('0x14c')][_0x98bc('0x14d')](_0x98bc('0x14e'))>=0x0;})['catch'](myreject(_0x253d27)));}BPromise[_0x98bc('0x150')](_0x4c3172)[_0x98bc('0xb6')](function(_0xee406c){var _0x569c13=_[_0x98bc('0x151')](_0xee406c);if(_0x569c13){return _0xdbf2d5(_0x569c13);}else{_0x26d900[_0x98bc('0x3e')]=_0x14089d?_0x98bc('0x152'):_0x98bc('0x153');return _0x253d27(msgResponse(_0x98bc('0x154'),_0x98bc('0x144'),_0x98bc('0x155')+_0x14089d+'\x20'+_0x364dfa+_0x98bc('0x156')+util[_0x98bc('0x98')](_0x45296c,{'showHidden':![],'depth':null})+_0x98bc('0x157')+_0x3a39b7));}})['catch'](function(_0x19df2d){return _0x253d27(msgResponse('ifTime','Failure',JSON[_0x98bc('0x4a')](_0x19df2d)));});});};Dialer[_0x98bc('0xa8')]['checkDialMethod']=function(_0x70c6f0){var _0x25b93b=this;return function(){switch(_0x70c6f0['dialMethod']){case _0x98bc('0x158'):freeVariablesPredictive(_0x70c6f0);_0x25b93b[_0x98bc('0x159')](_0x70c6f0,0x1);break;case _0x98bc('0x15a'):freeVariablesPredictive(_0x70c6f0);_0x25b93b['handlePower'](_0x70c6f0,_0x70c6f0[_0x98bc('0x15b')]);break;case _0x98bc('0x9'):_0x25b93b[_0x98bc('0x9')](_0x70c6f0);break;case _0x98bc('0x8'):freeVariablesPredictive(_0x70c6f0);_0x25b93b[_0x98bc('0x159')](_0x70c6f0,0x1);break;default:freeVariablesPredictive(_0x70c6f0);logger[_0x98bc('0x97')](_0x98bc('0x15c'),_0x70c6f0[_0x98bc('0x40')],'method\x20not\x20recognized');}};};Dialer[_0x98bc('0xa8')]['launchHandleIvr']=function(_0x2e2ec5){var _0x1154cd=this;return function(){_0x1154cd[_0x98bc('0x15d')](_0x2e2ec5);};};Dialer[_0x98bc('0xa8')][_0x98bc('0xb')]=function(_0x56acc2){var _0x28762d=this;if(isNotPreview(_0x56acc2[_0x98bc('0x15e')])){if(isVoiceQueueOutbound(_0x56acc2[_0x98bc('0x4d')])&&isActive(_0x56acc2['dialActive'])){_0x56acc2[_0x98bc('0xa0')]=!![];BPromise[_0x98bc('0xb3')]()[_0x98bc('0xb6')](checkIsLoggedIn(_0x56acc2,_0x56acc2['loggedIn']))['then'](checkIsActive(_0x56acc2,_0x56acc2[_0x98bc('0x5c')]))['then'](checkInterval(_0x56acc2))[_0x98bc('0xb6')](_0x28762d[_0x98bc('0x15f')](_0x56acc2))[_0x98bc('0xb6')](_0x28762d[_0x98bc('0x141')](_0x56acc2[_0x98bc('0x160')],_0x56acc2[_0x98bc('0x161')],_0x56acc2[_0x98bc('0x40')],_0x56acc2))[_0x98bc('0xb6')](_0x28762d[_0x98bc('0x143')](_0x56acc2[_0x98bc('0x43')],_0x56acc2[_0x98bc('0x161')],_0x56acc2['name'],_0x56acc2))[_0x98bc('0xb6')](_0x28762d['checkDialMethod'](_0x56acc2))[_0x98bc('0xad')](loggerCatchQueueSummary('[syncQueueSummary]',_0x56acc2));}else{notSendMessagesQueue(_0x56acc2);}}else{freeVariablesPredictive(_0x56acc2);}};Dialer[_0x98bc('0xa8')][_0x98bc('0x162')]=function(){var _0x26a4ee=this;var _0x1fc09c;for(var _0x597eb9 in this[_0x98bc('0x20')]){if(typeof this['campaigns'][_0x597eb9]!==_0x98bc('0x9a')){_0x1fc09c=this[_0x98bc('0x20')][_0x597eb9];if(isCampaignIvr(_0x1fc09c[_0x98bc('0x4d')])&&isActive(_0x1fc09c[_0x98bc('0x74')])){_0x1fc09c['sendMessageOneNotActive']=!![];BPromise[_0x98bc('0xb3')]()[_0x98bc('0xb6')](checkIsActive(_0x1fc09c,_0x1fc09c[_0x98bc('0x74')]))['then'](checkInterval(_0x1fc09c))[_0x98bc('0xb6')](_0x26a4ee[_0x98bc('0x15f')](_0x1fc09c))[_0x98bc('0xb6')](_0x26a4ee[_0x98bc('0x141')](_0x1fc09c[_0x98bc('0x160')],_0x1fc09c[_0x98bc('0x161')],_0x1fc09c['name'],_0x1fc09c))['then'](_0x26a4ee[_0x98bc('0x143')](_0x1fc09c[_0x98bc('0x43')],_0x1fc09c['dialTimezone'],_0x1fc09c[_0x98bc('0x40')],_0x1fc09c))['then'](_0x26a4ee[_0x98bc('0x163')](_0x1fc09c))[_0x98bc('0xad')](loggerCatchQueueSummary('[syncCampaigns]',_0x1fc09c));}else{notSendMessagesCampaign(_0x1fc09c);}}}};function getCallerIdRandom(_0x3e7a2d,_0x40d9dd){var _0x8aa905;var _0x5ee06b;var _0x36180a;if(_0x40d9dd<=0x0){_0x40d9dd=0x1;}_0x8aa905=new RegExp('\x5cw{0,'+_0x40d9dd+'}$');_0x5ee06b=Math[_0x98bc('0x164')](0xa,_0x40d9dd-0x1);_0x36180a=Math['pow'](0xa,_0x40d9dd)-0x1;return util[_0x98bc('0x78')]('%s',_['replace'](_0x3e7a2d,_0x8aa905,_['random'](_0x5ee06b,_0x36180a)));}function extractCalleridName(_0x207423){var _0x331d88=_0x207423[_0x98bc('0x165')](/"(.*?)"/);return _0x331d88?_0x331d88[0x1]:_0x207423;}function extractCalleridNumber(_0x7b3844){var _0x2ec225=_0x7b3844[_0x98bc('0x165')](/<(.*?)>/);return _0x2ec225?_0x2ec225[0x1]:_0x7b3844;}Dialer[_0x98bc('0xa8')][_0x98bc('0x166')]=function(_0xc4990c,_0x184ff1){var _0x263138=this;var _0x756549=uuid['v4']();this['actions'][_0x756549]=new Action(_0xc4990c,_0x184ff1,_0x756549);return new BPromise(function(_0x1d290b,_0x4f1348){if(_[_0x98bc('0x3d')](_0xc4990c)&&typeof _0xc4990c!==_0x98bc('0x167')){return _0x4f1348(msgResponse('originate','Failure',_0x98bc('0x168')));}if(_['isUndefined'](_0x184ff1[_0x98bc('0x169')][_0x98bc('0x16a')])||_0x184ff1[_0x98bc('0x169')]['phone']===null){return _0x4f1348(msgResponse(_0x98bc('0x16b'),_0x98bc('0x144'),_0x98bc('0x16c')));}var _0x1c767a={'XMD-CALLERID':_0x263138[_0x98bc('0x25')][_0x756549]['getCaller'](),'XMD-AGI':_0xc4990c[_0x98bc('0x101')]?util[_0x98bc('0x78')](_0x98bc('0x16d'),ipAgi,_0xc4990c[_0x98bc('0x101')]):'NONE','XMD-AGIAFTER':_0xc4990c[_0x98bc('0x10a')]?util[_0x98bc('0x78')]('\x22agi://%s/square,%s\x22',ipAgi,_0xc4990c[_0x98bc('0x10a')]):_0x98bc('0x16e'),'XMD-QUEUE':_0xc4990c[_0x98bc('0x4d')]==='outbound'?util['format'](_0x98bc('0x16f'),_0xc4990c[_0x98bc('0x40')],_0xc4990c[_0x98bc('0x170')]||'',_0xc4990c[_0x98bc('0x10b')]?'c':'',_0xc4990c[_0x98bc('0x112')]||0x3):_0x98bc('0x16e'),'XMD-CONTACTID':_0x184ff1[_0x98bc('0xcd')],'XMD-CDRTYPE':_0x98bc('0x6'),'CALLERID(all)':_0x263138[_0x98bc('0x25')][_0x756549][_0x98bc('0x171')](),'XMD-AMD':_0xc4990c[_0x98bc('0xdd')]?'ACTIVE':_0x98bc('0x16e'),'XMD-DESTINATION':_0x98bc('0x172')};if(_0xc4990c[_0x98bc('0xdd')]){_0x1c767a['XMD-AMDINITIALSILENCE']=_0xc4990c[_0x98bc('0x173')]||0x9c4;_0x1c767a['XMD-AMDGREETING']=_0xc4990c[_0x98bc('0x174')]||0x5dc;_0x1c767a[_0x98bc('0x175')]=_0xc4990c[_0x98bc('0x176')]||0x320;_0x1c767a[_0x98bc('0x177')]=_0xc4990c[_0x98bc('0x178')]||0x1388;_0x1c767a[_0x98bc('0x179')]=_0xc4990c[_0x98bc('0x17a')]||0x64;_0x1c767a['XMD-AMDBETWEENWORDSSILENCE']=_0xc4990c[_0x98bc('0x17b')]||0x32;_0x1c767a[_0x98bc('0x17c')]=_0xc4990c[_0x98bc('0x17d')]||0x3;_0x1c767a[_0x98bc('0x17e')]=_0xc4990c[_0x98bc('0x17f')]||0x100;_0x1c767a['XMD-AMDMAXIMUMWORDLENGTH']=_0xc4990c[_0x98bc('0x180')]||0x1388;}if(_0xc4990c[_0x98bc('0x4d')]===_0x98bc('0x4e')){_0x1c767a[_0x98bc('0x181')]=_0x184ff1[_0x98bc('0xfd')];}else{_0x1c767a[_0x98bc('0x182')]=_0x184ff1[_0x98bc('0xd0')];}for(var _0x21fd7b in _0x184ff1[_0x98bc('0x169')]){if(typeof _0x184ff1[_0x98bc('0x169')][_0x21fd7b]!==_0x98bc('0x9a')){if(isNotNull(_0x184ff1[_0x98bc('0x169')][_0x21fd7b])&&_0x21fd7b!=='id'&&_0x21fd7b!==_0x98bc('0x183')&&_0x21fd7b!==_0x98bc('0x184')&&_0x21fd7b!==_0x98bc('0x185')){_0x1c767a[util[_0x98bc('0x78')](_0x98bc('0x186'),_0x98bc('0x187'),_[_0x98bc('0x188')](_0x21fd7b))]=_0x184ff1['Contact'][_0x21fd7b];}}}var _0x31dd69=_0x263138[_0x98bc('0xd4')](_0xc4990c['Trunk'])?getCallerId(_0xc4990c['Trunk']['callerid'],_0xc4990c['dialOriginateCallerIdName'],_0xc4990c[_0x98bc('0x189')]>0x0?getCallerIdRandom(_0xc4990c['dialOriginateCallerIdNumber'],_0xc4990c[_0x98bc('0x189')]):_0xc4990c['dialOriginateCallerIdNumber']):getCallerId(_[_0x98bc('0xac')](_0xc4990c[_0x98bc('0x13f')])?_0xc4990c[_0x98bc('0x73')][_0x98bc('0x18a')]:_0xc4990c[_0x98bc('0x13f')][_0x98bc('0x18a')],_0xc4990c[_0x98bc('0x5d')],_0xc4990c[_0x98bc('0x189')]>0x0?getCallerIdRandom(_0xc4990c[_0x98bc('0x5e')],_0xc4990c['dialRandomLastDigitCallerIdNumber']):_0xc4990c[_0x98bc('0x5e')]);if(_0x31dd69){_0x1c767a[_0x98bc('0x18b')]=_0x263138[_0x98bc('0x25')][_0x756549][_0x98bc('0x18c')]=extractCalleridName(_0x31dd69);_0x1c767a['XMD-ORIGINATECALLERIDNUM']=_0x263138[_0x98bc('0x25')][_0x756549][_0x98bc('0x18d')]=extractCalleridNumber(_0x31dd69);}return ami[_0x98bc('0x149')]({'actionid':_0x756549,'action':_0x98bc('0x16b'),'channel':_0x263138[_0x98bc('0xd4')](_0xc4990c[_0x98bc('0x73')])?util[_0x98bc('0x78')](_0x98bc('0x18e'),_0xc4990c[_0x98bc('0x73')][_0x98bc('0x40')],isNotNull(_0xc4990c['dialPrefix'])?_0xc4990c[_0x98bc('0x60')][_0x98bc('0x18f')]()||'':'',_0xc4990c[_0x98bc('0x190')]>0x0?_0x184ff1['Contact'][_0x98bc('0x16a')][_0x98bc('0x191')](_0xc4990c[_0x98bc('0x190')]):_0x184ff1[_0x98bc('0x169')][_0x98bc('0x16a')]):util[_0x98bc('0x78')](_0x98bc('0x18e'),_[_0x98bc('0xac')](_0xc4990c[_0x98bc('0x13f')])?_0xc4990c[_0x98bc('0x73')][_0x98bc('0x40')]:_0xc4990c['TrunkBackup'][_0x98bc('0x40')],isNotNull(_0xc4990c[_0x98bc('0x60')])?_0xc4990c[_0x98bc('0x60')]['trim']()||'':'',_0xc4990c[_0x98bc('0x190')]>0x0?_0x184ff1['Contact'][_0x98bc('0x16a')][_0x98bc('0x191')](_0xc4990c['dialCutDigit']):_0x184ff1['Contact'][_0x98bc('0x16a')]),'callerid':_0x31dd69,'Exten':_0x98bc('0x172'),'Context':_0x98bc('0x192'),'Priority':'1','variable':_0x1c767a,'timeout':(_0xc4990c[_0x98bc('0x5f')]||0x1e)*0x3e8,'async':!![],'channelid':_0x756549})['then'](function(_0x5e9d96){return _0x1d290b(_0x5e9d96);})[_0x98bc('0xad')](function(_0x1fbb99){_0xc4990c[_0x98bc('0x193')]+=0x1;var _0x7187b1=new History(_0x263138[_0x98bc('0x25')][_0x756549]);logger[_0x98bc('0x97')](util[_0x98bc('0x78')]('[originateError]:\x20%s',JSON[_0x98bc('0x4a')](_0x1fbb99)));_0x7187b1[_0x98bc('0xa6')]=0xe;_0x7187b1[_0x98bc('0xe0')]='OriginateError';_0x7187b1[_0x98bc('0x118')]=moment()[_0x98bc('0x78')](_0x98bc('0xf5'));_0x7187b1[_0x98bc('0xa7')]=_0x7187b1[_0x98bc('0x118')];_0x263138['createHistory'](_0x7187b1)['catch'](loggerCatch(_0x98bc('0x194')));_0x263138[_0x98bc('0xc5')](_0x7187b1)[_0x98bc('0xad')](loggerCatch('[originate][error]'))[_0x98bc('0x1d')](function(){delete _0x263138[_0x98bc('0x25')][_0x756549];return _0x4f1348(msgResponse('originate',_0x98bc('0x49'),'originate\x20action\x20Error'));});});});};Dialer[_0x98bc('0xa8')][_0x98bc('0x31')]=function(_0x22df7c){var _0x45fd56=this['actions'][_0x22df7c[_0x98bc('0x125')]];if(_0x45fd56){delete this[_0x98bc('0x25')][_0x22df7c[_0x98bc('0x125')]];_0x45fd56[_0x98bc('0x195')]=moment()['format'](_0x98bc('0xf5'));var _0x28fabd=_0x45fd56[_0x98bc('0x4d')]==='ivr'?this[_0x98bc('0x20')][_0x45fd56['queue']]:this['voiceQueues'][_0x45fd56[_0x98bc('0x196')]()];if(!this['isSuccess'](_0x22df7c[_0x98bc('0x197')])){this[_0x98bc('0xaf')](_0x28fabd);return this[_0x98bc('0x198')](_0x45fd56,_0x28fabd,_0x22df7c)[_0x98bc('0xad')](loggerCatch('[callProgressDetecting]\x20'));}this[_0x98bc('0xaa')][_0x22df7c[_0x98bc('0xd9')]]=_0x45fd56;}};Dialer[_0x98bc('0xa8')]['checkRetriveMax']=function(_0x2f7b1f,_0x3ed009,_0x393662){var _0x479a89=new History(_0x3ed009);if(_0x479a89[_0x98bc('0xe8')]+_0x479a89['countcongestionretry']+_0x479a89[_0x98bc('0xfb')]+_0x479a89[_0x98bc('0xfc')]+_0x479a89['countdropretry']+_0x479a89[_0x98bc('0xeb')]+_0x479a89[_0x98bc('0xe5')]+_0x479a89[_0x98bc('0xec')]>=_0x393662[_0x98bc('0xed')]-0x1){return!![];}switch(_0x2f7b1f){case 0x3:if(_0x479a89[_0x98bc('0xfb')]>=_0x393662[_0x98bc('0x199')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x479a89['countnoanswerretry']+=0x1,'scheduledat':moment()[_0x98bc('0xf2')](_0x393662[_0x98bc('0x19a')],'minutes')[_0x98bc('0x78')](_0x98bc('0xf5')),'ContactId':_0x479a89[_0x98bc('0xcd')],'ListId':_0x479a89[_0x98bc('0xce')],'VoiceQueueId':_0x479a89[_0x98bc('0xfd')]||undefined,'CampaignId':_0x479a89[_0x98bc('0xd0')]||undefined})['catch'](loggerCatch(_0x98bc('0x19b')));break;case 0x5:if(_0x479a89['countbusyretry']>=_0x393662['dialBusyMaxRetry']-0x1){return!![];}this[_0x98bc('0xbd')]({'active':![],'countbusyretry':_0x479a89['countbusyretry']+=0x1,'scheduledat':moment()[_0x98bc('0xf2')](_0x393662[_0x98bc('0x19c')],_0x98bc('0xf4'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x479a89[_0x98bc('0xcd')],'ListId':_0x479a89[_0x98bc('0xce')],'VoiceQueueId':_0x479a89['VoiceQueueId']||undefined,'CampaignId':_0x479a89[_0x98bc('0xd0')]||undefined})[_0x98bc('0xad')](loggerCatch(_0x98bc('0x19d')));break;case 0x8:if(_0x479a89['countcongestionretry']>=_0x393662['dialCongestionMaxRetry']-0x1){return!![];}this[_0x98bc('0xbd')]({'active':![],'countcongestionretry':_0x479a89['countcongestionretry']+=0x1,'scheduledat':moment()[_0x98bc('0xf2')](_0x393662['dialCongestionRetryFrequency'],_0x98bc('0xf4'))[_0x98bc('0x78')](_0x98bc('0xf5')),'ContactId':_0x479a89[_0x98bc('0xcd')],'ListId':_0x479a89[_0x98bc('0xce')],'VoiceQueueId':_0x479a89[_0x98bc('0xfd')]||undefined,'CampaignId':_0x479a89[_0x98bc('0xd0')]||undefined})[_0x98bc('0xad')](loggerCatch(_0x98bc('0x19e')));break;case 0x0:if(_0x479a89['countnosuchnumberretry']>=_0x393662[_0x98bc('0x19f')]-0x1){return!![];}else{this[_0x98bc('0xbd')]({'active':![],'countnosuchnumberretry':_0x479a89[_0x98bc('0xfc')]+=0x1,'scheduledat':moment()[_0x98bc('0xf2')](_0x393662[_0x98bc('0x1a0')],_0x98bc('0xf4'))[_0x98bc('0x78')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x479a89[_0x98bc('0xcd')],'ListId':_0x479a89[_0x98bc('0xce')],'VoiceQueueId':_0x479a89['VoiceQueueId']||undefined,'CampaignId':_0x479a89['CampaignId']||undefined})[_0x98bc('0xad')](loggerCatch(_0x98bc('0x1a1')));}break;case 0xa:if(_0x479a89[_0x98bc('0xea')]>=_0x393662[_0x98bc('0x1a2')]-0x1){return!![];}this[_0x98bc('0xbd')]({'active':![],'countdropretry':_0x479a89[_0x98bc('0xea')]+=0x1,'scheduledat':moment()[_0x98bc('0xf2')](_0x393662['dialDropRetryFrequency'],_0x98bc('0xf4'))['format'](_0x98bc('0xf5')),'ContactId':_0x479a89[_0x98bc('0xcd')],'ListId':_0x479a89['ListId'],'VoiceQueueId':_0x479a89['VoiceQueueId']||undefined,'CampaignId':_0x479a89[_0x98bc('0xd0')]||undefined})['catch'](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x479a89[_0x98bc('0xeb')]>=_0x393662['dialAbandonedMaxRetry']-0x1){return!![];}this[_0x98bc('0xbd')]({'active':![],'countabandonedretry':_0x479a89[_0x98bc('0xeb')]+=0x1,'scheduledat':moment()[_0x98bc('0xf2')](_0x393662['dialAbandonedRetryFrequency'],_0x98bc('0xf4'))[_0x98bc('0x78')](_0x98bc('0xf5')),'ContactId':_0x479a89[_0x98bc('0xcd')],'ListId':_0x479a89[_0x98bc('0xce')],'VoiceQueueId':_0x479a89[_0x98bc('0xfd')]||undefined,'CampaignId':_0x479a89[_0x98bc('0xd0')]||undefined})[_0x98bc('0xad')](loggerCatch(_0x98bc('0x1a3')));break;case 0x13:if(_0x479a89[_0x98bc('0xe5')]>=_0x393662[_0x98bc('0xf0')]-0x1){return!![];}this[_0x98bc('0xbd')]({'active':![],'countmachineretry':_0x479a89[_0x98bc('0xe5')]+=0x1,'scheduledat':moment()[_0x98bc('0xf2')](_0x393662[_0x98bc('0xf3')],_0x98bc('0xf4'))[_0x98bc('0x78')](_0x98bc('0xf5')),'ContactId':_0x479a89['ContactId'],'ListId':_0x479a89['ListId'],'VoiceQueueId':_0x479a89[_0x98bc('0xfd')]||undefined,'CampaignId':_0x479a89[_0x98bc('0xd0')]||undefined})[_0x98bc('0xad')](loggerCatch(_0x98bc('0xf6')));break;case 0x14:if(_0x479a89[_0x98bc('0xec')]>=_0x393662[_0x98bc('0x1a4')]-0x1){return!![];}this[_0x98bc('0xbd')]({'active':![],'countagentrejectretry':_0x479a89[_0x98bc('0xec')]+=0x1,'scheduledat':moment()['add'](_0x393662[_0x98bc('0x1a5')],_0x98bc('0xf4'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x479a89[_0x98bc('0xcd')],'ListId':_0x479a89[_0x98bc('0xce')],'VoiceQueueId':_0x479a89['VoiceQueueId']||undefined,'CampaignId':_0x479a89[_0x98bc('0xd0')]||undefined})['catch'](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0x98bc('0xa8')]['callProgressDetecting']=function(_0x5a9de5,_0x476ba4,_0x1361b2){var _0x63a7ea=this;var _0x6dc28e=new History(_0x5a9de5);return new BPromise(function(_0x150bdd,_0x14e2a8){if(_[_0x98bc('0x3d')](_0x476ba4)&&typeof _0x476ba4!==_0x98bc('0x167')){return _0x14e2a8(msgResponse(_0x98bc('0x1a6'),_0x98bc('0x144'),_0x98bc('0x1a7')));}if(_[_0x98bc('0x3d')](_0x1361b2)&&typeof _0x1361b2!==_0x98bc('0x167')){return _0x14e2a8(msgResponse(_0x98bc('0x1a6'),_0x98bc('0x144'),_0x98bc('0x1a8')));}switch(_0x1361b2['reason']){case'0':_0x476ba4[_0x98bc('0x1a9')]+=0x1;_0x6dc28e['state']=0x0;_0x6dc28e['statedesc']=_0x98bc('0x1aa');_0x6dc28e['countnosuchnumberretry']+=0x1;_0x6dc28e[_0x98bc('0xe6')]+=0x1;ami[_0x98bc('0x4c')](_0x98bc('0x1ab'),ut['buildObj'](_0x5a9de5,_0x98bc('0x1ac')));_0x63a7ea['createHistory'](_0x6dc28e)[_0x98bc('0xad')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x63a7ea['checkRetriveMax'](0x0,_0x5a9de5,_0x476ba4)){if(_0x6dc28e[_0x98bc('0xfc')]>=_0x476ba4[_0x98bc('0x19f')]){_0x63a7ea[_0x98bc('0xf1')](_0x6dc28e,_0x150bdd,_0x14e2a8,'reason\x200\x20no\x20such\x20number....');}else{_0x63a7ea[_0x98bc('0xee')](_0x6dc28e,_0x150bdd,_0x14e2a8,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x476ba4['outboundNoAnswerCallsDay']+=0x1;_0x6dc28e['state']=0x3;_0x6dc28e[_0x98bc('0xe0')]=_0x98bc('0x1ad');_0x6dc28e[_0x98bc('0xfb')]+=0x1;_0x6dc28e['countglobal']+=0x1;ami[_0x98bc('0x4c')](_0x98bc('0x1ae'),ut[_0x98bc('0x1af')](_0x5a9de5,_0x98bc('0x1b0')));_0x63a7ea[_0x98bc('0xc7')](_0x6dc28e)[_0x98bc('0xad')](loggerCatch(_0x98bc('0x1b1')));if(_0x63a7ea['checkRetriveMax'](0x3,_0x5a9de5,_0x476ba4)){if(_0x6dc28e[_0x98bc('0xfb')]>=_0x476ba4[_0x98bc('0x199')]){_0x63a7ea['createStateFinal'](_0x6dc28e,_0x150bdd,_0x14e2a8,_0x98bc('0x1b2'));}else{_0x63a7ea[_0x98bc('0xee')](_0x6dc28e,_0x150bdd,_0x14e2a8,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x476ba4[_0x98bc('0x1b3')]+=0x1;_0x6dc28e[_0x98bc('0xa6')]=0x5;_0x6dc28e[_0x98bc('0xe0')]=_0x98bc('0x1b4');_0x6dc28e[_0x98bc('0xe8')]+=0x1;_0x6dc28e['countglobal']+=0x1;ami[_0x98bc('0x4c')](_0x98bc('0x1b5'),ut[_0x98bc('0x1af')](_0x5a9de5,'busy'));_0x63a7ea[_0x98bc('0xc7')](_0x6dc28e)[_0x98bc('0xad')](loggerCatch(_0x98bc('0x1b6')));if(_0x63a7ea['checkRetriveMax'](0x5,_0x5a9de5,_0x476ba4)){if(_0x6dc28e['countbusyretry']>=_0x476ba4[_0x98bc('0x1b7')]){_0x63a7ea['createStateFinal'](_0x6dc28e,_0x150bdd,_0x14e2a8,_0x98bc('0x1b8'));}else{_0x63a7ea['stateGlobal'](_0x6dc28e,_0x150bdd,_0x14e2a8,_0x98bc('0x1b8'));}}break;case'8':_0x476ba4[_0x98bc('0x64')]+=0x1;_0x6dc28e[_0x98bc('0xa6')]=0x8;_0x6dc28e[_0x98bc('0xe0')]=_0x98bc('0x1b9');_0x6dc28e[_0x98bc('0xe9')]+=0x1;_0x6dc28e[_0x98bc('0xe6')]+=0x1;ami[_0x98bc('0x4c')]('custom:agentcongestion',ut['buildObj'](_0x5a9de5,_0x98bc('0x1ba')));_0x63a7ea['createHistory'](_0x6dc28e)[_0x98bc('0xad')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x63a7ea[_0x98bc('0x1bb')](0x8,_0x5a9de5,_0x476ba4)){if(_0x6dc28e[_0x98bc('0xe9')]>=_0x476ba4[_0x98bc('0x1bc')]){_0x63a7ea[_0x98bc('0xf1')](_0x6dc28e,_0x150bdd,_0x14e2a8,_0x98bc('0x1bd'));}else{_0x63a7ea['stateGlobal'](_0x6dc28e,_0x150bdd,_0x14e2a8,_0x98bc('0x1bd'));}}break;case'11':_0x476ba4['outboundAbandonedCallsDay']+=0x1;_0x6dc28e[_0x98bc('0xa6')]=0xb;_0x6dc28e['statedesc']=_0x98bc('0x11d');_0x6dc28e[_0x98bc('0xeb')]+=0x1;_0x6dc28e[_0x98bc('0xe6')]+=0x1;_0x63a7ea['createHistory'](_0x6dc28e)['catch'](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x63a7ea[_0x98bc('0x1bb')](0xb,_0x5a9de5,_0x476ba4)){if(_0x6dc28e[_0x98bc('0xeb')]>=_0x476ba4[_0x98bc('0x120')]){_0x63a7ea['createStateFinal'](_0x6dc28e,_0x150bdd,_0x14e2a8,'reason\x2011\x20abandoned');}else{_0x63a7ea[_0x98bc('0xee')](_0x6dc28e,_0x150bdd,_0x14e2a8,_0x98bc('0x1be'));}}break;case'20':_0x476ba4['outboundRejectCallsDay']+=0x1;_0x6dc28e[_0x98bc('0xa6')]=0x14;_0x6dc28e[_0x98bc('0xe0')]=_0x98bc('0x1bf');_0x6dc28e[_0x98bc('0xec')]+=0x1;_0x6dc28e['countglobal']+=0x1;ami[_0x98bc('0x4c')](_0x98bc('0x1c0'),ut[_0x98bc('0x1af')](_0x5a9de5,_0x98bc('0x1c1')));_0x63a7ea[_0x98bc('0xc7')](_0x6dc28e)[_0x98bc('0xad')](loggerCatch(_0x98bc('0x1c2')));if(_0x63a7ea[_0x98bc('0x1bb')](0x14,_0x5a9de5,_0x476ba4)){if(_0x6dc28e['countagentrejectretry']>=_0x476ba4['dialAgentRejectMaxRetry']){_0x63a7ea['createStateFinal'](_0x6dc28e,_0x150bdd,_0x14e2a8,_0x98bc('0x1c3'));}else{_0x63a7ea[_0x98bc('0xee')](_0x6dc28e,_0x150bdd,_0x14e2a8,_0x98bc('0x1c3'));}}break;default:_0x476ba4[_0x98bc('0x1c4')]+=0x1;_0x6dc28e['state']=0xc;_0x6dc28e[_0x98bc('0xe0')]=_0x1361b2['reason'];_0x63a7ea[_0x98bc('0xc7')](_0x6dc28e)[_0x98bc('0xad')](loggerCatch(_0x98bc('0x1c5')));if(_0x63a7ea[_0x98bc('0x1bb')](_0x1361b2['reason'],_0x5a9de5,_0x476ba4)){if(_0x6dc28e['countbusyretry']+_0x6dc28e['countcongestionretry']+_0x6dc28e['countnoanswerretry']+_0x6dc28e[_0x98bc('0xfc')]+_0x6dc28e['countdropretry']+_0x6dc28e[_0x98bc('0xeb')]+_0x6dc28e[_0x98bc('0xe5')]+_0x6dc28e['countagentrejectretry']>=_0x476ba4[_0x98bc('0xed')]){_0x63a7ea['stateGlobal'](_0x6dc28e,_0x150bdd,_0x14e2a8,_0x1361b2[_0x98bc('0x107')]);}else{_0x63a7ea['createStateFinal'](_0x6dc28e,_0x150bdd,_0x14e2a8,_0x1361b2['reason']);}}}});};Dialer[_0x98bc('0xa8')][_0x98bc('0xee')]=function(_0x263a20,_0x46e6ce,_0x248f08,_0x36de5d){var _0x53f59e=new Final(_0x263a20);_0x53f59e['state']=0xf;_0x53f59e[_0x98bc('0xe0')]=_0x98bc('0x1c6');this[_0x98bc('0xf1')](_0x53f59e,_0x46e6ce,_0x248f08,_0x36de5d);};Dialer[_0x98bc('0xa8')][_0x98bc('0xf1')]=function(_0x5cad7b,_0x14dd56,_0x5be293,_0x54e621){this['moveContactManagedDialer'](_0x5cad7b)['then'](function(){return _0x14dd56(msgResponse('[callProgressDetecting]',_0x98bc('0xd3'),_0x54e621));})[_0x98bc('0xad')](function(){return _0x5be293(msgResponse(_0x98bc('0x1c7'),_0x98bc('0x144'),_0x98bc('0x1c8')));});};Dialer['prototype'][_0x98bc('0x9')]=function(_0x16e20d){var _0x5ec49b=_0x16e20d['dialPredictiveOptimizationPercentage']/0x64;var _0x26ab68=_0x16e20d['outboundDropCallsDayTimeout']/(_0x16e20d[_0x98bc('0x67')]+_0x16e20d[_0x98bc('0x62')]);var _0x576546=Math[_0x98bc('0x1c9')](_0x16e20d['predictiveIntervalAvailable']*(_0x16e20d[_0x98bc('0x1ca')]/0x64));var _0x3c0b44=Math[_0x98bc('0x1c9')](_0x16e20d[_0x98bc('0x1cb')]*(_0x16e20d[_0x98bc('0x1cc')]/0x64));var _0x288ae5=_0x16e20d[_0x98bc('0x51')]+_0x16e20d[_0x98bc('0x57')];var _0x23b320=Math[_0x98bc('0x1cd')](_0x16e20d[_0x98bc('0x89')]*_0x16e20d[_0x98bc('0x71')]*_0x16e20d[_0x98bc('0x6c')]*_0x16e20d[_0x98bc('0x1ce')]);if(_[_0x98bc('0x3d')](_0x16e20d[_0x98bc('0x29')])){if(!_['isUndefined'](_0x16e20d[_0x98bc('0x28')])){_0x16e20d[_0x98bc('0x28')]=undefined;loggerPredictive[_0x98bc('0x97')](_0x98bc('0x1cf'),_0x98bc('0x1d0'));}if(!_[_0x98bc('0x3d')](_0x16e20d[_0x98bc('0x91')])){loggerPredictive['error'](_0x98bc('0x1cf'),_0x98bc('0x1d1'));clearInterval(_0x16e20d['handlePredictive']);_0x16e20d[_0x98bc('0x91')]=undefined;}_0x16e20d[_0x98bc('0x29')]=moment()[_0x98bc('0x78')](_0x98bc('0xf5'));loggerPredictive[_0x98bc('0x7b')](_0x16e20d[_0x98bc('0x40')],_0x98bc('0x1d2'),_0x16e20d[_0x98bc('0x29')]);this['handlePower'](_0x16e20d,0x1);}else if(ifInterval(_0x16e20d['dialPredictiveInterval'],_0x16e20d[_0x98bc('0x29')])){this[_0x98bc('0x159')](_0x16e20d,0x1);loggerPredictiveCalls[_0x98bc('0x7b')](_0x98bc('0x1d3'),_0x16e20d[_0x98bc('0x29')],_0x16e20d['name']);_0x16e20d[_0x98bc('0x89')]=0x0;_0x16e20d[_0x98bc('0x113')]=0x0;}else if(_0x5ec49b<_0x26ab68&&_0x16e20d[_0x98bc('0x1d4')]==='dropRate'){freeVariablesPredictive(_0x16e20d);loggerPredictive['info'](_0x98bc('0x1d5'),_0x98bc('0x1d6'),_0x26ab68,_0x98bc('0x29'),_0x16e20d[_0x98bc('0x40')]);}else if(_0x23b320<_0x16e20d['predictiveIntervalErlangCallsDroppedCalls']&&_0x16e20d[_0x98bc('0x1d4')]===_0x98bc('0x1d7')){freeVariablesPredictive(_0x16e20d);loggerPredictive[_0x98bc('0x7b')](_0x98bc('0x1d8'),_0x98bc('0x1d9'),_0x23b320,_0x98bc('0x1da'),_0x16e20d[_0x98bc('0x113')],_0x98bc('0x29'),_0x16e20d[_0x98bc('0x40')]);}else if(!ifInterval(_0x16e20d[_0x98bc('0x1db')],_0x16e20d[_0x98bc('0x29')])&&_[_0x98bc('0x3d')](_0x16e20d['startPredictive'])&&!_[_0x98bc('0x3d')](_0x16e20d[_0x98bc('0x29')])){_0x16e20d['startPredictive']=moment()['format'](_0x98bc('0xf5'));loggerPredictive['info'](_0x16e20d['name'],'started\x20in\x20predictive\x20at',_0x16e20d[_0x98bc('0x28')]);this[_0x98bc('0xba')](_0x16e20d[_0x98bc('0x1db')])[_0x98bc('0xb6')](this['getDataPredictive'](_0x16e20d))['then'](mergeDataErlangB(_0x16e20d))[_0x98bc('0xb6')](this[_0x98bc('0x1dc')](_0x16e20d))[_0x98bc('0xad')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x16e20d));}else if(!ifInterval(_0x16e20d[_0x98bc('0x1db')],_0x16e20d[_0x98bc('0x28')])){_0x16e20d[_0x98bc('0x113')]=0x0;_0x16e20d['startPredictive']=moment()[_0x98bc('0x78')](_0x98bc('0xf5'));loggerPredictive[_0x98bc('0x7b')](_0x16e20d[_0x98bc('0x40')],_0x98bc('0x1dd'),_0x16e20d[_0x98bc('0x28')]);clearInterval(_0x16e20d[_0x98bc('0x91')]);_0x16e20d['handlePredictive']=undefined;this[_0x98bc('0xba')](_0x16e20d['dialPredictiveInterval'])[_0x98bc('0xb6')](this['getDataPredictive'](_0x16e20d))[_0x98bc('0xb6')](mergeDataErlangB(_0x16e20d))['then'](this[_0x98bc('0x1dc')](_0x16e20d))['catch'](loggerCatchPredictive(_0x98bc('0x1de'),_0x16e20d));}else if(_0x16e20d[_0x98bc('0x1cb')]&&_0x288ae5<_0x16e20d[_0x98bc('0x1cb')]-_0x3c0b44){freeVariablesPredictive(_0x16e20d);loggerPredictive[_0x98bc('0x7b')](_0x16e20d[_0x98bc('0x40')],_0x98bc('0x1df'),_0x288ae5,_0x98bc('0x1e0'),_0x16e20d['predictiveIntervalAvailable'],'-',_0x3c0b44,'=',_0x16e20d[_0x98bc('0x1cb')]-_0x3c0b44,')');}else if(_0x16e20d['predictiveIntervalAvailable']&&_0x288ae5>_0x16e20d[_0x98bc('0x1cb')]+_0x576546){freeVariablesPredictive(_0x16e20d);loggerPredictive[_0x98bc('0x7b')](_0x16e20d['name'],_0x98bc('0x1df'),_0x288ae5,_0x98bc('0x1e1'),_0x16e20d['predictiveIntervalAvailable'],'+',_0x576546,'=',_0x16e20d[_0x98bc('0x1cb')]+_0x576546,')');}};Dialer[_0x98bc('0xa8')][_0x98bc('0x1e2')]=function(_0x41b615){var _0x212a1a=this;return function(_0x40dd73){return new BPromise(function(_0x2e9a35,_0x4018cf){_['merge'](_0x41b615,_0x40dd73[0x0]);if(checkGetDataPredictive(_0x40dd73[0x0])){var _0x25dbcf=_0x41b615[_0x98bc('0x1cb')]=_0x41b615[_0x98bc('0x57')]+_0x41b615['available'];var _0x56d779=_0x41b615[_0x98bc('0x1db')]*0x3c;var _0x40f06d=_0x40dd73[0x0]['predictiveIntervalAvgTalktime']+_0x40dd73[0x0][_0x98bc('0x80')];var _0x1a56a0=(_0x40dd73[0x0]['predictiveIntervalAnsweredCalls']+_0x40dd73[0x0][_0x98bc('0x6b')]+_0x40dd73[0x0][_0x98bc('0x11c')])/_0x40dd73[0x0][_0x98bc('0x6e')];_0x41b615[_0x98bc('0x6c')]=_0x1a56a0>0x0?_0x1a56a0:0x1;switch(_0x41b615[_0x98bc('0x1d4')]){case _0x98bc('0x1d7'):var _0x171b1a=_0x41b615['dialPredictiveOptimizationPercentage']/0x64;return _0x212a1a[_0x98bc('0x1e3')](_0x25dbcf,_0x56d779,_0x40f06d,_0x1a56a0,_0x171b1a)[_0x98bc('0xb6')](function(_0x23a06a){return _0x2e9a35(_0x23a06a);});case _0x98bc('0x1e4'):var _0x2c1d70=_0x41b615[_0x98bc('0x1e5')]/0x64;return _0x212a1a[_0x98bc('0x1e6')](_0x25dbcf,_0x56d779,_0x40f06d,_0x1a56a0,_0x2c1d70)[_0x98bc('0xb6')](function(_0x3b2278){return _0x2e9a35(_0x3b2278);});default:return _0x4018cf(msgResponse('[getDataPredictive]',_0x98bc('0x144'),_0x98bc('0x1e7')));}}else{return _0x4018cf(msgResponse(_0x98bc('0x1e8'),_0x98bc('0x144'),_0x98bc('0x1e9')));}});};};Dialer[_0x98bc('0xa8')][_0x98bc('0x1ea')]=function(_0x5bf8ca){var _0x9b72ec=this;return function(_0x24ef05){return new BPromise(function(_0x448ea9,_0x172f93){_[_0x98bc('0x8d')](_0x5bf8ca,_0x24ef05[0x0]);if(checkGetDataPredictive(_0x24ef05[0x0])){loggerPredictive['info'](JSON[_0x98bc('0x4a')](_0x24ef05[0x0]));if(_0x5bf8ca[_0x98bc('0x1d4')]===_0x98bc('0x1d7')){return _0x9b72ec[_0x98bc('0xc3')](_0x5bf8ca['id'])[_0x98bc('0xb6')](function(_0x4035c0){var _0x28ba79=_0x5bf8ca[_0x98bc('0x52')]-_0x4035c0[0x0][_0x98bc('0x1eb')];var _0x837c5=_0x5bf8ca[_0x98bc('0x1db')]*0x3c;var _0x2a68cf=_0x24ef05[0x0][_0x98bc('0x82')]+_0x24ef05[0x0][_0x98bc('0x80')];var _0x381b5a=(_0x24ef05[0x0]['predictiveIntervalAnsweredCalls']+_0x24ef05[0x0][_0x98bc('0x6b')]+_0x24ef05[0x0][_0x98bc('0x11c')])/_0x24ef05[0x0][_0x98bc('0x6e')];var _0x19f32c=_0x5bf8ca[_0x98bc('0x1e5')]/0x64;_0x5bf8ca[_0x98bc('0x6d')]=_0x4035c0[0x0][_0x98bc('0x1eb')]||0x0;_0x5bf8ca[_0x98bc('0x6c')]=_0x381b5a>0x0?_0x381b5a:0x1;return _0x9b72ec[_0x98bc('0x1e3')](_0x28ba79,_0x837c5,_0x2a68cf,_0x381b5a,_0x19f32c);})[_0x98bc('0xb6')](function(_0x34d77f){return _0x448ea9(_0x34d77f);})['catch'](function(_0x94ecea){return _0x172f93(msgResponse(_0x98bc('0x1ec'),_0x98bc('0x144'),JSON[_0x98bc('0x4a')](_0x94ecea)));});}if(_0x5bf8ca[_0x98bc('0x1d4')]===_0x98bc('0x1e4')){return _0x9b72ec[_0x98bc('0xc3')](_0x5bf8ca['id'])[_0x98bc('0xb6')](function(_0xe73dc4){var _0x5ac6f7=_0x5bf8ca[_0x98bc('0x52')]-_0xe73dc4[0x0][_0x98bc('0x1eb')];var _0x417d65=_0x5bf8ca[_0x98bc('0x1db')]*0x3c;var _0x39317c=_0x24ef05[0x0]['predictiveIntervalAvgTalktime']+_0x24ef05[0x0]['predictiveIntervalAvgHoldtime'];var _0x280871=(_0x24ef05[0x0][_0x98bc('0x1ed')]+_0x24ef05[0x0][_0x98bc('0x6b')]+_0x24ef05[0x0][_0x98bc('0x11c')])/_0x24ef05[0x0]['predictiveIntervalTotalCalls'];var _0x2a7b8c=_0x5bf8ca[_0x98bc('0x1e5')]/0x64;_0x5bf8ca[_0x98bc('0x6d')]=_0xe73dc4[0x0][_0x98bc('0x1eb')]||0x0;_0x5bf8ca[_0x98bc('0x6c')]=_0x280871>0x0?_0x280871:0x1;return _0x9b72ec[_0x98bc('0x1e6')](_0x5ac6f7,_0x417d65,_0x39317c,_0x280871,_0x2a7b8c);})[_0x98bc('0xb6')](function(_0x25efed){return _0x448ea9(_0x25efed);})['catch'](function(_0x49d27f){return _0x172f93(msgResponse(_0x98bc('0x1ec'),_0x98bc('0x144'),JSON[_0x98bc('0x4a')](_0x49d27f)));});}}else{return _0x172f93(msgResponse(_0x98bc('0x1e8'),_0x98bc('0x144'),_0x98bc('0x1e9')));}});};};Dialer[_0x98bc('0xa8')][_0x98bc('0x1dc')]=function(_0x32c75a){var _0x2bb709=this;return function(){var _0x4cadd4=0x0;var _0xd1120a=Math[_0x98bc('0x1cd')](_0x32c75a[_0x98bc('0x70')]*0x3e8);if(_0xd1120a>0x0){_0xd1120a=_0xd1120a<0x64?0x64:_0xd1120a;loggerPredictive[_0x98bc('0x7b')](_0x32c75a[_0x98bc('0x40')],_0x98bc('0x1ee'),_0xd1120a,_0x98bc('0x8e'));_0x32c75a['handlePredictive']=setInterval(function(){_0x2bb709['handlePredictive'](_0x32c75a);loggerPredictiveCalls['info'](_0x98bc('0x1ef'),_0x4cadd4+=0x1);},_0xd1120a);}else{loggerPredictive[_0x98bc('0x7b')](_0x32c75a[_0x98bc('0x40')],_0x98bc('0x1f0'));}};};Dialer[_0x98bc('0xa8')][_0x98bc('0x1f1')]=function(_0x287de4,_0x1c6027){var _0x4f2fe6=this;return function(_0x379110){if(_[_0x98bc('0x47')](_0x379110)){if(_['isNil'](_0x1c6027[_0x98bc('0xcf')])||!_0x1c6027[_0x98bc('0x1f2')]){if(_0x287de4[_0x98bc('0x15e')]===_0x98bc('0x8')){_0x287de4[_0x98bc('0x12e')]=_[_0x98bc('0x3d')](_0x287de4[_0x98bc('0x12e')])?!![]:_0x287de4[_0x98bc('0x12e')];var _0x465fd0=uuid['v4']();_0x4f2fe6['actions'][_0x465fd0]=new Action(_0x287de4,_0x1c6027,_0x465fd0);loggerBooked[_0x98bc('0x7b')](_0x98bc('0x1f3'),_0x465fd0,_0x98bc('0x1f4'),JSON[_0x98bc('0x4a')](_0x287de4[_0x98bc('0x12e')]),_0x98bc('0x1f5'),_0x287de4[_0x98bc('0x40')]);if(_0x287de4[_0x98bc('0x12e')]){_0x287de4[_0x98bc('0x12e')]=![];_0x4f2fe6['queueBooked'][_0x4f2fe6[_0x98bc('0x25')][_0x465fd0][_0x98bc('0xb0')]]=[];ami[_0x98bc('0x149')]({'actionid':_0x465fd0,'action':'queuestatus','queue':_0x287de4[_0x98bc('0x40')]})[_0x98bc('0xad')](function(){_0x4f2fe6['updateOriginated'](_0x287de4);_0x4f2fe6[_0x98bc('0xbd')]({'active':![],'ContactId':_0x4f2fe6[_0x98bc('0x25')][_0x465fd0]['ContactId'],'ListId':_0x4f2fe6[_0x98bc('0x25')][_0x465fd0][_0x98bc('0xce')],'VoiceQueueId':_0x4f2fe6[_0x98bc('0x25')][_0x465fd0][_0x98bc('0xfd')]||undefined,'CampaignId':_0x4f2fe6[_0x98bc('0x25')][_0x465fd0][_0x98bc('0xd0')]||undefined})[_0x98bc('0xad')](loggerCatch(_0x98bc('0x1f6')));delete _0x4f2fe6[_0x98bc('0x25')][_0x465fd0];});}else{loggerBooked[_0x98bc('0x7b')]('[booked][checkContactBlack][else]',JSON['stringify'](_0x287de4[_0x98bc('0x12e')]),_0x98bc('0x1f5'),_0x287de4['name']);_0x4f2fe6[_0x98bc('0xaf')](_0x287de4);_0x4f2fe6[_0x98bc('0xbd')]({'active':![],'ContactId':_0x4f2fe6[_0x98bc('0x25')][_0x465fd0][_0x98bc('0xcd')],'ListId':_0x4f2fe6[_0x98bc('0x25')][_0x465fd0][_0x98bc('0xce')],'VoiceQueueId':_0x4f2fe6[_0x98bc('0x25')][_0x465fd0][_0x98bc('0xfd')]||undefined,'CampaignId':_0x4f2fe6[_0x98bc('0x25')][_0x465fd0][_0x98bc('0xd0')]||undefined})[_0x98bc('0xad')](loggerCatch(_0x98bc('0x1f6')));delete _0x4f2fe6[_0x98bc('0x25')][_0x465fd0];}}else{return _0x4f2fe6[_0x98bc('0x166')](_0x287de4,_0x1c6027);}}else{if(getDiff(_0x1c6027[_0x98bc('0x1f7')])<_0x287de4['dialRecallMeTimeout']*0x3c){if(_0x1c6027[_0x98bc('0x1f8')]&&!_0x1c6027[_0x98bc('0x1f8')]['voicePause']){_0x4f2fe6[_0x98bc('0x93')][_0x98bc('0x130')](_0x1c6027['id'])['finally'](function(){_0x4f2fe6['updateOriginated'](_0x287de4);});}else{_0x4f2fe6[_0x98bc('0xbe')]({'active':![]},_0x1c6027['id'],0x1)[_0x98bc('0x1d')](function(){_0x4f2fe6[_0x98bc('0xaf')](_0x287de4);});}}else{_0x287de4[_0x98bc('0x69')]+=0x1;_0x4f2fe6[_0x98bc('0xaf')](_0x287de4);if(_0x287de4['dialRecallInQueue']){_0x4f2fe6[_0x98bc('0xbd')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x1c6027[_0x98bc('0xcd')],'ListId':_0x1c6027[_0x98bc('0xce')],'VoiceQueueId':_0x1c6027[_0x98bc('0xfd')]||undefined,'CampaignId':_0x1c6027['CampaignId']||undefined})[_0x98bc('0xad')](loggerCatch(_0x98bc('0x1f9')));_0x4f2fe6[_0x98bc('0xc7')](createObjHistory(_0x287de4,_0x1c6027,_0x98bc('0x1fa'),0x17,_0x98bc('0x1fb')))['catch'](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x4f2fe6[_0x98bc('0xcc')](createObjHistory(_0x287de4,_0x1c6027,_0x98bc('0x1fc'),0x16,'RecallFailedTimeout'),_0x98bc('0x1fd'),_0x98bc('0x1fe'));}}}}else{_0x287de4['outboundBlacklistCallsDay']+=0x1;_0x4f2fe6[_0x98bc('0xcc')](createObjHistory(_0x287de4,_0x1c6027,_0x98bc('0x1ff'),0xd,_0x98bc('0x200')),_0x98bc('0x201'),_0x98bc('0x202'));throw _0x98bc('0x203');}};};Dialer['prototype'][_0x98bc('0x15d')]=function(_0x1d2bc3){var _0x46f51d=this;var _0x473e8a=_0x1d2bc3['limitCalls']-_0x1d2bc3[_0x98bc('0x6f')]-_0x1d2bc3[_0x98bc('0x204')];emitCampaignSummary(_0x1d2bc3);if(_0x473e8a>0x0){if(_0x473e8a>this[_0x98bc('0x23')]){_0x473e8a=this[_0x98bc('0x23')];}_0x1d2bc3['temp']+=_0x473e8a;this['getContactDialerIvr'](_0x1d2bc3['id'],_0x473e8a,_0x1d2bc3['dialOrderByScheduledAt'])[_0x98bc('0xb6')](function(_0x7cbf56){_0x1d2bc3['temp']-=_0x473e8a;_0x1d2bc3[_0x98bc('0x204')]=_0x1d2bc3[_0x98bc('0x204')]>0x0?_0x1d2bc3[_0x98bc('0x204')]:0x0;if(!checkContactEmpty(_0x7cbf56)){_0x1d2bc3['message']=_0x98bc('0x9e');logger[_0x98bc('0x7b')](_0x98bc('0x205')+_0x1d2bc3[_0x98bc('0x40')]);}else{_0x1d2bc3[_0x98bc('0x6f')]+=_0x7cbf56[_0x98bc('0x134')];_0x1d2bc3[_0x98bc('0x3e')]='RUNNING';for(var _0x5efd57=0x0;_0x5efd57<_0x7cbf56[_0x98bc('0x134')];_0x5efd57+=0x1){_0x1d2bc3[_0x98bc('0x206')]+=0x1;if(_[_0x98bc('0xac')](_0x7cbf56[_0x5efd57])||_[_0x98bc('0xac')](_0x7cbf56[_0x5efd57][_0x98bc('0x169')])||_[_0x98bc('0xac')](_0x7cbf56[_0x5efd57][_0x98bc('0x169')][_0x98bc('0x16a')])){_0x46f51d[_0x98bc('0xca')](_0x98bc('0x207'),_0x1d2bc3,_0x7cbf56[_0x5efd57]);}else{_0x46f51d[_0x98bc('0xb8')](_['pick'](_0x7cbf56[_0x5efd57],[_0x98bc('0xd0'),_0x98bc('0x208')]))[_0x98bc('0xb6')](_0x46f51d[_0x98bc('0x1f1')](_0x1d2bc3,_0x7cbf56[_0x5efd57]))['catch'](_0x46f51d[_0x98bc('0xc9')](_0x98bc('0x209'),_0x1d2bc3));}}}})['catch'](loggerGetContactDialer(_0x98bc('0x20a'),_0x1d2bc3,_0x473e8a));}};Dialer[_0x98bc('0xa8')][_0x98bc('0x159')]=function(_0x5609a9,_0x5398f3){var _0xfd3ae6=this;var _0x55cc4f=[];var _0x2c0bac=_0x5398f3>=0x1?_0x5398f3:0x1;if(_0x5609a9[_0x98bc('0x15e')]===_0x98bc('0x8')){_0x2c0bac=0x1;}var _0xf695f=Math[_0x98bc('0x1cd')](_0x5609a9['available']*_0x2c0bac)-_0x5609a9[_0x98bc('0x6f')]-_0x5609a9[_0x98bc('0x204')];emitVoiceQueueSummary(_0x5609a9);if(_0x5609a9[_0x98bc('0x20b')]>0x0){var _0x260d66=_0x5609a9[_0x98bc('0x20b')]-_0x5609a9['originated']-_0x5609a9[_0x98bc('0x57')]-_0x5609a9['temp']-_0x5609a9['pTalking'];if(_0xf695f>_0x260d66){_0xf695f=_0x260d66;}}if(_0xf695f>0x0){if(_0x5609a9[_0x98bc('0x15e')]==='booked'){_0xf695f=0x1;}if(_0xf695f>this[_0x98bc('0x23')]){_0xf695f=this['maxNumberOriginate'];}_0x5609a9[_0x98bc('0x204')]+=_0xf695f;for(var _0x52285a in this[_0x98bc('0x21')]){if(typeof this['agents'][_0x52285a]!==_0x98bc('0x9a')){if(this[_0x98bc('0x21')][_0x52285a][_0x98bc('0xa6')]==='not_inuse'&&this['agents'][_0x52285a]['status']===_0x98bc('0xd6')){_0x55cc4f['push'](this[_0x98bc('0x21')][_0x52285a]['id']);}}}this['getContactDialer'](_0x5609a9['id'],_0x55cc4f,_0xf695f,_0x5609a9[_0x98bc('0x20c')])[_0x98bc('0xb6')](function(_0x3b4e1f){_0x5609a9[_0x98bc('0x204')]-=_0xf695f;_0x5609a9[_0x98bc('0x204')]=_0x5609a9[_0x98bc('0x204')]>0x0?_0x5609a9[_0x98bc('0x204')]:0x0;if(!checkContactEmpty(_0x3b4e1f)){_0xfd3ae6[_0x98bc('0xb2')](_0x5609a9)['then'](sendMessageReschedule(_0x5609a9))[_0x98bc('0xad')](loggerCatch(_0x98bc('0xb4')));}else{_0x5609a9[_0x98bc('0x6f')]+=_0x3b4e1f['length'];_0x5609a9['message']=_0x5609a9[_0x98bc('0x15e')]==='booked'?_0x98bc('0x20d'):_0x98bc('0x20e');for(var _0x2fedea=0x0;_0x2fedea<_0x3b4e1f[_0x98bc('0x134')];_0x2fedea+=0x1){if(_['isNil'](_0x3b4e1f[_0x2fedea])||_['isNil'](_0x3b4e1f[_0x2fedea][_0x98bc('0x169')])||_[_0x98bc('0xac')](_0x3b4e1f[_0x2fedea][_0x98bc('0x169')][_0x98bc('0x16a')])){_0xfd3ae6[_0x98bc('0xca')](_0x98bc('0x207'),_0x5609a9,_0x3b4e1f[_0x2fedea]);}else{_0xfd3ae6[_0x98bc('0xb5')](_['pick'](_0x3b4e1f[_0x2fedea],[_0x98bc('0xfd'),'Contact.phone']))[_0x98bc('0xb6')](_0xfd3ae6[_0x98bc('0x1f1')](_0x5609a9,_0x3b4e1f[_0x2fedea]))['catch'](_0xfd3ae6['loggerHandler'](_0x98bc('0x207'),_0x5609a9));}}}})[_0x98bc('0xad')](loggerGetContactDialer('[getContactDialer2]',_0x5609a9,_0xf695f));}};Dialer[_0x98bc('0xa8')][_0x98bc('0x91')]=function(_0xdc5185){if(_0xdc5185[_0x98bc('0x20b')]>0x0){var _0x17f400=_0xdc5185['dialLimitQueue']-_0xdc5185['originated']-_0xdc5185[_0x98bc('0x57')];if(_0x17f400>0x0){this['tryOriginatePredictive'](_0xdc5185);}else{loggerPredictiveCalls[_0x98bc('0x7b')]('[handlePredictive][limitChannel]');}}else{this[_0x98bc('0x20f')](_0xdc5185);}};Dialer[_0x98bc('0xa8')][_0x98bc('0x20f')]=function(_0x3fca4a){var _0x3dfd22=this;var _0x203b78=[];_0x3fca4a[_0x98bc('0x6f')]+=0x1;for(var _0x41268c in this['agents']){if(typeof this['agents'][_0x41268c]!=='undefined'){if(this[_0x98bc('0x21')][_0x41268c][_0x98bc('0xa6')]===_0x98bc('0x210')&&this[_0x98bc('0x21')][_0x41268c][_0x98bc('0xd5')]===_0x98bc('0xd6')){_0x203b78[_0x98bc('0x12a')](this[_0x98bc('0x21')][_0x41268c]['id']);}}}this[_0x98bc('0xc0')](_0x3fca4a['id'],_0x203b78,0x1,_0x3fca4a[_0x98bc('0x20c')])['then'](function(_0x288a4a){if(!checkContactEmpty(_0x288a4a)){checkContactLowerLimitOriginate(_0x3fca4a,0x1,0x0);_0x3dfd22[_0x98bc('0xb2')](_0x3fca4a)[_0x98bc('0xb6')](sendMessageReschedule(_0x3fca4a))[_0x98bc('0xad')](loggerCatch(_0x98bc('0xb4')));}else{_0x3fca4a['message']=_0x98bc('0x20e');if(_[_0x98bc('0xac')](_0x288a4a[0x0])||_['isNil'](_0x288a4a[0x0][_0x98bc('0x169')])||_['isNil'](_0x288a4a[0x0][_0x98bc('0x169')][_0x98bc('0x16a')])){_0x3dfd22['emptyContact']('[actionOriginate]\x20',_0x3fca4a,_0x288a4a[0x0]);}else{_0x3dfd22[_0x98bc('0xb5')](_[_0x98bc('0x12b')](_0x288a4a[0x0],[_0x98bc('0xfd'),_0x98bc('0x208')]))[_0x98bc('0xb6')](_0x3dfd22[_0x98bc('0x1f1')](_0x3fca4a,_0x288a4a[0x0]))[_0x98bc('0xad')](_0x3dfd22[_0x98bc('0xc9')]('[actionOriginatePredictive]\x20',_0x3fca4a));}}})[_0x98bc('0xad')](loggerGetContactDialer(_0x98bc('0x211'),_0x3fca4a,0x1));emitVoiceQueueSummary(_0x3fca4a);};Dialer[_0x98bc('0xa8')][_0x98bc('0x1e3')]=function(_0x2fcde8,_0x38ce67,_0x3b1194,_0x16c469,_0x115694,_0x4291dc){loggerPredictive[_0x98bc('0x7b')](_0x98bc('0x212'));loggerPredictive['info']('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',_0x2fcde8);loggerPredictive[_0x98bc('0x7b')](_0x98bc('0x213'),_0x38ce67);loggerPredictive[_0x98bc('0x7b')](_0x98bc('0x214'),_0x3b1194);loggerPredictive[_0x98bc('0x7b')](_0x98bc('0x215'),_0x16c469);loggerPredictive[_0x98bc('0x7b')](_0x98bc('0x216'),_0x115694);loggerPredictive[_0x98bc('0x7b')]('---------------------------');return new BPromise(function(_0x1afaea,_0x1a59ca){if(_0x2fcde8<=0x0||isNaN(_0x2fcde8)){return _0x1a59ca(msgResponse(_0x98bc('0x217'),_0x98bc('0x49'),_0x98bc('0x218')+_0x2fcde8));}if(_0x3b1194<=0x0||isNaN(_0x3b1194)){return _0x1a59ca(msgResponse('[abandonmentRate]',_0x98bc('0x49'),_0x98bc('0x219')+_0x3b1194));}if(_0x16c469<=0x0||isNaN(_0x16c469)){return _0x1a59ca(msgResponse(_0x98bc('0x217'),_0x98bc('0x49'),_0x98bc('0x21a')+_0x16c469));}if(_0x38ce67<=0x0||isNaN(_0x38ce67)){return _0x1a59ca(msgResponse('[abandonmentRate]',_0x98bc('0x49'),_0x98bc('0x21b')+_0x38ce67));}if(_0x115694<=0x0||isNaN(_0x115694)){return _0x1a59ca(msgResponse(_0x98bc('0x217'),'Error',_0x98bc('0x21c')+_0x115694));}_0x4291dc=_0x4291dc||0x0;var _0x4a7f93=0x1/_0x3b1194;var _0x41e691=0x0;var _0x2eae79=0x0;var _0xe9da0c=0x0;var _0x6cfbc0=0x0;for(var _0xbd31fc=0x0;_0xe9da0c<_0x115694;_0xbd31fc+=0x1){_0x2eae79=_0xbd31fc/_0x38ce67;_0x41e691=(_0x16c469*_0x2eae79+_0x4291dc)/_0x4a7f93;_0xe9da0c=erlangb(_0x41e691,_0x2fcde8);_0x6cfbc0=_0x41e691/_0x2fcde8*(0x1-erlangb(_0x41e691,_0x2fcde8));}return _0x1afaea({'erlangCalls':_0xbd31fc,'erlangCallToSecond':_0x38ce67/_0xbd31fc,'erlangAbandonmentRate':_0xe9da0c,'erlangBusyFactor':_0x6cfbc0});});};Dialer[_0x98bc('0xa8')][_0x98bc('0x1e6')]=function(_0x32cfe3,_0x2e92e4,_0x4a4a91,_0x449779,_0x4c60b3,_0x5e2313){loggerPredictive[_0x98bc('0x7b')](_0x98bc('0x21d'));loggerPredictive[_0x98bc('0x7b')](_0x98bc('0x21e'),_0x32cfe3);loggerPredictive['info'](_0x98bc('0x213'),_0x2e92e4);loggerPredictive[_0x98bc('0x7b')]('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',_0x4a4a91);loggerPredictive[_0x98bc('0x7b')]('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',_0x449779);loggerPredictive['info'](_0x98bc('0x21f'),_0x4c60b3);loggerPredictive['info'](_0x98bc('0x83'));return new BPromise(function(_0x49ea5c,_0x32911d){if(_0x32cfe3<=0x0||isNaN(_0x32cfe3)){return _0x32911d(msgResponse('[busyFactor]','Error',_0x98bc('0x218')+_0x32cfe3));}if(_0x4a4a91<=0x0||isNaN(_0x4a4a91)){return _0x32911d(msgResponse(_0x98bc('0x220'),_0x98bc('0x49'),_0x98bc('0x219')+_0x4a4a91));}if(_0x449779<=0x0||isNaN(_0x449779)){return _0x32911d(msgResponse('[busyFactor]','Error','p\x20=\x20'+_0x449779));}if(_0x2e92e4<=0x0||isNaN(_0x2e92e4)){return _0x32911d(msgResponse(_0x98bc('0x220'),_0x98bc('0x49'),_0x98bc('0x21b')+_0x2e92e4));}if(_0x4c60b3<=0x0||isNaN(_0x4c60b3)){return _0x32911d(msgResponse('[busyFactor]',_0x98bc('0x49'),'Umin\x20=\x20'+_0x4c60b3));}_0x5e2313=_0x5e2313||0x0;var _0x5b6b45=0x1/_0x4a4a91;var _0x5ca662=0x0;var _0x5a7e11=0x0;var _0x3638f7=0x0;var _0x676f74=0x0;for(var _0x561e08=0x0;_0x676f74<_0x4c60b3;_0x561e08+=0x1){_0x5a7e11=_0x561e08/_0x2e92e4;_0x5ca662=(_0x449779*_0x5a7e11+_0x5e2313)/_0x5b6b45;_0x3638f7=erlangb(_0x5ca662,_0x32cfe3);_0x676f74=_0x5ca662/_0x32cfe3*(0x1-erlangb(_0x5ca662,_0x32cfe3));}return _0x49ea5c({'erlangCalls':_0x561e08,'erlangCallToSecond':_0x2e92e4/_0x561e08,'erlangAbandonmentRate':_0x3638f7,'erlangBusyFactor':_0x676f74});});};module[_0x98bc('0x221')]=Dialer;
\ No newline at end of file
+var _0x01f6=['queueStatusComplete','[unlockQueueStatus][undefined]','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','contactAgent-idHopper:\x20','Agent:\x20','[booked][unlock]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','TrunkBackup','\x20trunk\x20is\x20not\x20reachable','ifTime','checkIfTimeIntervals','Failure','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','isArray','command','interval','indexOf','true','Action','all','some','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','progressive','handlePower','power','dialPowerLevel','predictive','booked','Queue','method\x20not\x20recognized','handleIvr','dialActive','loggedIn','dialGlobalInterval','dialTimezone','checkDialMethod','[syncQueueSummary]','syncCampaigns','checkIsTrunkReachable','checkIfTime','launchHandleIvr','[syncCampaigns]','\x5cw{0,','pow','replace','random','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','Contact','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','outbound','dialQueueOptions','dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','%s%s','toUpper','callerid','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','dialPrefix','trim','dialCutDigit','substring','from-sip','[originateError]:\x20%s','[originate][error]','originate\x20action\x20Error','responsetime','getQueue','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','countnosuchnumberretry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','dialAgentRejectMaxRetry','[rescheduleContact][AgentReject]','[callProgressDetecting]','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','buildObj','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','round','predictiveIntervalMaxThreshold','floor','predictiveIntervalHitRate','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dropRate','Dropped\x20calls\x20day','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','dialPredictiveInterval','started\x20in\x20predictive\x20at','startMethodPredictive','getDataPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dialPredictiveOptimizationPercentage','abandonmentRate','agentBusyFactor','[getDataPredictive]','Unknown\x20Predictive','getVoiceQueueRtPauses','outboundQueuePauses','[CatchErlangB]','busyFactor','check\x20failure','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','queueStatusComplete:\x20','[booked][checkContactBlack][else]','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RecallInQueue','RECALLFAILEDTIMEOUT','RecallFailedTimeout','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','temp','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','emptyContact','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','not_inuse','dialOrderByScheduledAt','ACTIVE','[getContactDialer2]','dialLimitQueue','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','[abandonmentRate]','m\x20=\x20','interval\x20=\x20','----\x20Agent\x20Busy\x20Factor\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','p\x20=\x20','Umin\x20=\x20','exports','bluebird','uuid','md5','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','syncQueueSummary','../ami','redis','defaults','../rpc/cmHopperHistory','../rpc/cmHopperBlack','./action','./history','./final','./agentComplete','./queueCallerAbandon','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','contactsId','uniqueId','startPredictive','startProgressive','ivrOriginated','queueBookedRR','agentconnect','queuecallerabandon','bind','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','loopClearZombieChannels','isUndefined','message','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','Intervals','\x20INTERVAL_IS_NULL','Error','stringify','milliseconds','diff','emit','type','answered','available','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','abandoned','waiting','loggedInDb','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','format','voice:queue:%s','voice_queue:save','campaign:ivr:%s','campaign:save','isEmpty','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','predictiveIntervalAvgTalktime','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','inspect','error','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','statedesc','starttime','clearZombieChannels','[actions]','enqueue','isNil','status','channel','catch','ivr','queue','updateOriginated','countReScheduled','resolve','then','[countReScheduled]\x20','checkIsBlackList','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','notFound','saveInDb','pick','ContactId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','active','SIP/%s','reachable','unmonitored','uniqueid','variable','amdstatus','xcally-motion-dialer','dialAMDActive','value','state','HangupInAMD','membername','AMD','[syncHangupInAMD]','Machine','amd','[syncAgentComplete][createHistory][0]','countbusyretry','countdropretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','dialMachineMaxRetry','createStateFinal','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','ListId','[rescheduleContact][Machine]','HANGUP','[syncHangupInAMDIvr]','MACHINE','countglobal','countcongestionretry','countnoanswerretry','countabandonedretry','reason19\x20machine....','reason\x2019\x20machine....','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AGI','cause-txt','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete]','syncAgentConnect','[syncAgentComplete][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','syncQueueCallerAbandon','droptime','dialQueueTimeout','Drop','dropreason','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','endtime','calleridname','calleridnum','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','queueCallerAbandonCreateState','[syncAgentComplete][createHistory][11]','actions','actionid','locked','paused','stateinterface','strategy','queueBooked','push','idHopper'];(function(_0x35035e,_0x26bc1d){var _0x3a042f=function(_0x38d4e3){while(--_0x38d4e3){_0x35035e['push'](_0x35035e['shift']());}};_0x3a042f(++_0x26bc1d);}(_0x01f6,0xea));var _0x601f=function(_0x1b4b01,_0x43eb55){_0x1b4b01=_0x1b4b01-0x0;var _0x521446=_0x01f6[_0x1b4b01];return _0x521446;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require(_0x601f('0x0'));var uuid=require(_0x601f('0x1'));var moment=require('moment');var rr=require('rr');var md5=require(_0x601f('0x2'));var Redis=require(_0x601f('0x3'));var ut=require(_0x601f('0x4'));var config=require(_0x601f('0x5'));var logger=require(_0x601f('0x6'))('dialer');var loggerBooked=require(_0x601f('0x6'))('booked');var loggerPredictive=require(_0x601f('0x6'))('predictive');var loggerPredictiveCalls=require(_0x601f('0x6'))('predictiveCalls');var loggerSyncQueueSummary=require(_0x601f('0x6'))(_0x601f('0x7'));var ami=require(_0x601f('0x8'));config[_0x601f('0x9')]=_[_0x601f('0xa')](config[_0x601f('0x9')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0x601f('0xb'));var cmHopperBlack=require(_0x601f('0xc'));var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require(_0x601f('0xd'));var History=require(_0x601f('0xe'));var Final=require(_0x601f('0xf'));var AgentComplete=require(_0x601f('0x10'));var QueueCallerAbandon=require(_0x601f('0x11'));var Hangup=require('./hangup');var ipAgi=process[_0x601f('0x12')][_0x601f('0x13')]||_0x601f('0x14');var strategy={'rrmemory':_0x601f('0x15'),'roundrobin':_0x601f('0x16')};var Sequence=function(){};Sequence[_0x601f('0x17')]['enqueue']=function(_0x483f91){this[_0x601f('0x18')]=this[_0x601f('0x18')]?this[_0x601f('0x18')][_0x601f('0x19')](_0x483f91):_0x483f91();};function Dialer(_0x1ce34e,_0x32d6f4){this[_0x601f('0x1a')]=new Sequence();this[_0x601f('0x1b')]=_0x32d6f4;this[_0x601f('0x1c')]=_0x1ce34e['voiceQueues'];this['campaigns']=_0x1ce34e[_0x601f('0x1d')];this[_0x601f('0x1e')]=_0x1ce34e[_0x601f('0x1e')];this[_0x601f('0x1f')]=_0x1ce34e[_0x601f('0x1f')];this[_0x601f('0x20')]=config[_0x601f('0x20')]||0x2;this[_0x601f('0x21')]={};this['actions']={};this[_0x601f('0x22')]={};this[_0x601f('0x23')]={};this['optionPredictive']={};this[_0x601f('0x24')]={};this[_0x601f('0x25')]={};this[_0x601f('0x26')]={};this['queueBooked']={};this[_0x601f('0x27')]={};ami['on'](_0x601f('0x28'),this['syncAgentConnect']['bind'](this));ami['on'](_0x601f('0x29'),this['syncQueueCallerAbandon'][_0x601f('0x2a')](this));ami['on']('originateresponse',this[_0x601f('0x2b')][_0x601f('0x2a')](this));ami['on'](_0x601f('0x2c'),this[_0x601f('0x2d')]['bind'](this));ami['on'](_0x601f('0x2e'),this['syncQueueSummary']['bind'](this));ami['on']('hangup',this[_0x601f('0x2f')][_0x601f('0x2a')](this));ami['on'](_0x601f('0x30'),this[_0x601f('0x31')][_0x601f('0x2a')](this));ami['on'](_0x601f('0x32'),this[_0x601f('0x33')][_0x601f('0x2a')](this));ami['on'](_0x601f('0x34'),this[_0x601f('0x35')][_0x601f('0x2a')](this));ami['on'](_0x601f('0x36'),this['syncQueueStatusComplete'][_0x601f('0x2a')](this));this['loopCampaigns']();this[_0x601f('0x37')]();}function isNotNull(_0x4fa51c){return _0x4fa51c!==null&&!_[_0x601f('0x38')](_0x4fa51c);}function checkIsLoggedIn(_0x371296,_0x48740d){return function(){if(_0x48740d<=0x0){_0x371296[_0x601f('0x39')]='AGENTS_NOT_LOGGED';throw _0x371296[_0x601f('0x3a')]+_0x601f('0x3b');}};}function isActive(_0x88b276){return _0x88b276;}function checkIsActive(_0x2f95a6,_0x122273){return function(){if(!isActive(_0x122273)){_0x2f95a6['message']=_0x601f('0x3c');throw _0x2f95a6[_0x601f('0x3a')]+_0x601f('0x3d');}};}function checkInterval(_0x5b4ef0){return function(){if(!isNotNull(_0x5b4ef0[_0x601f('0x3e')])){_0x5b4ef0[_0x601f('0x39')]=_0x601f('0x3f');throw _0x5b4ef0[_0x601f('0x3a')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x5b4ef0[_0x601f('0x3e')][_0x601f('0x40')])){_0x5b4ef0['message']=_0x601f('0x3f');throw _0x5b4ef0[_0x601f('0x3a')]+_0x601f('0x41');}if(!isNotNull(_['isEmpty'](_0x5b4ef0['Interval']['Intervals']))){_0x5b4ef0[_0x601f('0x39')]=_0x601f('0x3f');throw _0x5b4ef0['name']+_0x601f('0x41');}};}function msgResponse(_0xab59d9,_0x3cb6b4,_0x42461e){return{'action':_0xab59d9,'response':_0x3cb6b4,'message':_0x42461e,'stack':_0x42461e};}function myreject(_0x5c70bb){return function(_0x1ae5ca){return _0x5c70bb(msgResponse('[ifTime][Action]',_0x601f('0x42'),JSON[_0x601f('0x43')](_0x1ae5ca)));};}function getSeconds(_0x24ed27,_0x27fbb7){var _0x907e17=moment(_0x24ed27)[_0x601f('0x44')](0x0);var _0x1ba05f=moment(_0x27fbb7)[_0x601f('0x44')](0x0);return _0x907e17[_0x601f('0x45')](_0x1ba05f,'seconds');}function emit(_0xe085da,_0x3edc45,_0x4e8057){io['to'](_0xe085da)[_0x601f('0x46')](_0x3edc45,_0x4e8057);}function emitVoiceQueueSummary(_0x70f1b8){if(_0x70f1b8[_0x601f('0x47')]==='outbound'){var _0x2c9d81={'id':_0x70f1b8['id'],'name':_0x70f1b8[_0x601f('0x3a')],'strategy':_0x70f1b8['strategy'],'answered':_0x70f1b8[_0x601f('0x48')],'available':_0x70f1b8[_0x601f('0x49')],'loggedIn':_0x70f1b8['loggedIn'],'pTalking':_0x70f1b8[_0x601f('0x4a')],'sumBillable':_0x70f1b8[_0x601f('0x4b')],'sumDuration':_0x70f1b8[_0x601f('0x4c')],'sumHoldTime':_0x70f1b8[_0x601f('0x4d')]||0x0,'talking':_0x70f1b8[_0x601f('0x4e')],'total':_0x70f1b8[_0x601f('0x4f')],'type':_0x70f1b8[_0x601f('0x47')],'unmanaged':_0x70f1b8['unmanaged'],'abandoned':_0x70f1b8[_0x601f('0x50')],'waiting':_0x70f1b8[_0x601f('0x51')],'loggedInDb':_0x70f1b8[_0x601f('0x52')],'dialActive':_0x70f1b8['dialActive'],'dialMethod':_0x70f1b8[_0x601f('0x53')],'dialOriginateCallerIdName':_0x70f1b8[_0x601f('0x54')],'dialOriginateCallerIdNumber':_0x70f1b8[_0x601f('0x55')],'dialOriginateTimeout':_0x70f1b8[_0x601f('0x56')],'dialPrefix':_0x70f1b8['dialPrefix'],'outboundAnswerAgiCallsDay':_0x70f1b8[_0x601f('0x57')],'outboundAnswerCallsDay':_0x70f1b8[_0x601f('0x58')],'outboundBlacklistCallsDay':_0x70f1b8[_0x601f('0x59')],'outboundBusyCallsDay':_0x70f1b8[_0x601f('0x5a')],'outboundCongestionCallsDay':_0x70f1b8[_0x601f('0x5b')],'outboundDropCallsDayACS':_0x70f1b8['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x70f1b8['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x70f1b8[_0x601f('0x5c')],'outboundNoAnswerCallsDay':_0x70f1b8[_0x601f('0x5d')],'outboundNoSuchCallsDay':_0x70f1b8[_0x601f('0x5e')],'outboundOriginateFailureCallsDay':_0x70f1b8[_0x601f('0x5f')],'outboundReCallsDay':_0x70f1b8[_0x601f('0x60')],'outboundRejectCallsDay':_0x70f1b8[_0x601f('0x61')],'outboundUnknownCallsDay':_0x70f1b8[_0x601f('0x62')],'predictiveIntervalAnsweredCalls':_0x70f1b8[_0x601f('0x63')],'predictiveIntervalAvgHoldtime':_0x70f1b8[_0x601f('0x64')],'predictiveIntervalAvgTalktime':_0x70f1b8['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x70f1b8[_0x601f('0x65')],'predictiveIntervalDroppedCallsTimeout':_0x70f1b8[_0x601f('0x66')],'predictiveIntervalErlangCalls':_0x70f1b8[_0x601f('0x67')],'predictiveIntervalErlangCallsDroppedCalls':_0x70f1b8[_0x601f('0x68')],'predictiveIntervalHitRate':_0x70f1b8['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x70f1b8[_0x601f('0x69')],'predictiveIntervalPauses':_0x70f1b8[_0x601f('0x6a')],'predictiveIntervalAvailable':_0x70f1b8[_0x601f('0x6b')],'predictiveIntervalTotalCalls':_0x70f1b8[_0x601f('0x6c')],'message':_0x70f1b8[_0x601f('0x39')],'originated':_0x70f1b8[_0x601f('0x6d')],'erlangCalls':_0x70f1b8[_0x601f('0x6e')],'erlangCallToSecond':_0x70f1b8[_0x601f('0x6f')],'erlangAbandonmentRate':_0x70f1b8[_0x601f('0x70')],'erlangBusyFactor':_0x70f1b8[_0x601f('0x71')],'startPredictive':_0x70f1b8[_0x601f('0x24')],'startProgressive':_0x70f1b8[_0x601f('0x25')]};if(_0x70f1b8['Trunk']){_0x2c9d81['Trunk']={'id':_0x70f1b8[_0x601f('0x72')]['id'],'name':_0x70f1b8[_0x601f('0x72')]['name'],'active':_0x70f1b8[_0x601f('0x72')]['active'],'callerid':_0x70f1b8[_0x601f('0x72')]['callerid']};}if(_0x70f1b8[_0x601f('0x3e')]){_0x2c9d81['Interval']={'id':_0x70f1b8[_0x601f('0x3e')]['id'],'name':_0x70f1b8[_0x601f('0x3e')][_0x601f('0x3a')]};}var _0x5a28bb=md5(JSON[_0x601f('0x43')](_0x2c9d81));if(_0x70f1b8[_0x601f('0x2')]!==_0x5a28bb){_0x70f1b8['md5']=_0x5a28bb;emit(util[_0x601f('0x73')](_0x601f('0x74'),_0x2c9d81['name']),_0x601f('0x75'),_0x2c9d81);}}}function emitCampaignSummary(_0x393a42){if(_0x393a42[_0x601f('0x47')]==='ivr'){emit(util[_0x601f('0x73')](_0x601f('0x76'),_0x393a42[_0x601f('0x3a')]),_0x601f('0x77'),_0x393a42);}}function checkGetDataPredictive(_0x4b3f2f){if(isNotNull(_0x4b3f2f)&&!_[_0x601f('0x78')](_0x4b3f2f)){loggerPredictive[_0x601f('0x79')](_0x601f('0x7a'));loggerPredictive[_0x601f('0x79')](_0x601f('0x7b'),_0x4b3f2f[_0x601f('0x6c')]);loggerPredictive['info'](_0x601f('0x7c'),_0x4b3f2f[_0x601f('0x63')]);loggerPredictive[_0x601f('0x79')](_0x601f('0x7d'),_0x4b3f2f[_0x601f('0x66')]);loggerPredictive['info'](_0x601f('0x7e'),_0x4b3f2f[_0x601f('0x65')]);loggerPredictive['info'](_0x601f('0x7f'),_0x4b3f2f['predictiveIntervalAvgHoldtime']);loggerPredictive['info']('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4b3f2f['predictiveIntervalAvgTalktime']);loggerPredictive['info'](_0x601f('0x80'));if(_0x4b3f2f[_0x601f('0x6c')]>0x0){if(!_[_0x601f('0x38')](_0x4b3f2f['predictiveIntervalAvgTalktime'])&&_0x4b3f2f[_0x601f('0x81')]>0x0){return!![];}loggerPredictive[_0x601f('0x79')](_0x601f('0x82'));if(!_['isUndefined'](_0x4b3f2f['predictiveIntervalAvgHoldtime'])&&_0x4b3f2f[_0x601f('0x64')]>0x0){return!![];}loggerPredictive[_0x601f('0x79')](_0x601f('0x83'));}else{loggerPredictive[_0x601f('0x79')](_0x601f('0x84'));}}else{loggerPredictive[_0x601f('0x79')](_0x601f('0x85'));}return![];}function mergeDataErlangB(_0xa7c556){return function(_0x528884){loggerPredictive[_0x601f('0x79')](_0x601f('0x86'));loggerPredictive[_0x601f('0x79')](_0x601f('0x87'),_0x528884['erlangCalls']);loggerPredictive['info'](_0x601f('0x88'),_0x528884[_0x601f('0x6f')]);loggerPredictive[_0x601f('0x79')](_0x601f('0x89'),_0x528884[_0x601f('0x70')]);loggerPredictive[_0x601f('0x79')](_0x601f('0x8a'),_0x528884[_0x601f('0x71')]);loggerPredictive[_0x601f('0x79')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x528884[_0x601f('0x70')]);loggerPredictive['info']('---------------------------');_[_0x601f('0x8b')](_0xa7c556,_0x528884);};}function getDiff(_0x55e56c){var _0xc8121=moment()[_0x601f('0x44')](0x0);var _0x228b07=moment(_0x55e56c)[_0x601f('0x44')](0x0);return _0xc8121[_0x601f('0x45')](_0x228b07,'seconds');}function ifInterval(_0x5f52da,_0x563f20){if(_['isUndefined'](_0x563f20)){return![];}return getDiff(_0x563f20)<_0x5f52da*0x3c;}function freeVariablesPredictive(_0x59af11){if(isNotNull(_0x59af11)){if(!_[_0x601f('0x38')](_0x59af11[_0x601f('0x25')])){_0x59af11[_0x601f('0x25')]=undefined;loggerPredictive['info'](_0x59af11['name'],_0x601f('0x8c'));}if(!_[_0x601f('0x38')](_0x59af11[_0x601f('0x24')])){_0x59af11[_0x601f('0x24')]=undefined;loggerPredictive[_0x601f('0x79')](_0x59af11[_0x601f('0x3a')],_0x601f('0x8d'));}if(!_[_0x601f('0x38')](_0x59af11[_0x601f('0x8e')])){clearInterval(_0x59af11[_0x601f('0x8e')]);_0x59af11[_0x601f('0x8e')]=undefined;loggerPredictive['info'](_0x59af11[_0x601f('0x3a')],_0x601f('0x8f'));}}}function erlangb(_0x455152,_0x37669f){if(_0x37669f===0x0){return 0x0;}var _0x1f4962=0x1;for(var _0x591489=0x1;_0x591489<=_0x37669f;_0x591489+=0x1){_0x1f4962=0x1+_0x1f4962*_0x591489/_0x455152;}return 0x1/_0x1f4962;}function isVoiceQueueOutbound(_0x13ddf7){return _0x13ddf7==='outbound';}function isNotPreview(_0x80fffe){return _0x80fffe!=='preview';}function isCampaignIvr(_0xdeec08){return _0xdeec08==='ivr';}function getCallerId(_0x370817,_0x3a2efc,_0x52dd59){if(!_['isUndefined'](_0x52dd59)&&typeof _0x52dd59===_0x601f('0x90')&&!_[_0x601f('0x78')](_0x52dd59)){if(!_['isUndefined'](_0x3a2efc)&&typeof _0x3a2efc===_0x601f('0x90')&&!_['isEmpty'](_0x3a2efc)){return util[_0x601f('0x73')](_0x601f('0x91'),_0x3a2efc,_0x52dd59);}return util['format'](_0x601f('0x91'),_0x52dd59,_0x52dd59);}if(!_[_0x601f('0x38')](_0x370817)&&typeof _0x370817==='string'&&!_[_0x601f('0x78')](_0x370817)){return _0x370817;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x2e9d1a,_0x1b34f5){return function(_0x2ba769){freeVariablesPredictive(_0x1b34f5);emitVoiceQueueSummary(_0x1b34f5);emitCampaignSummary(_0x1b34f5);loggerSyncQueueSummary['error'](_0x2e9d1a,util[_0x601f('0x92')](_0x2ba769,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x2a1d09,_0x47c66d){return function(_0x243f81){loggerPredictive[_0x601f('0x93')](_0x47c66d[_0x601f('0x3a')],_0x2a1d09);loggerPredictive['error'](_0x243f81['stack']);freeVariablesPredictive(_0x47c66d);};}function loggerCatch(_0x10c0d3){return function(_0x210988){logger[_0x601f('0x93')](_0x10c0d3,util[_0x601f('0x92')](_0x210988,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x38e55a){return _0x38e55a&&!_[_0x601f('0x38')](_0x38e55a)&&_0x38e55a[_0x601f('0x94')]>0x0;}function decremetOriginate(_0x33c4e4){if(!_[_0x601f('0x38')](_0x33c4e4)&&_0x33c4e4!==null){if(typeof _0x33c4e4['originated']!==_0x601f('0x95')){if(_0x33c4e4[_0x601f('0x6d')]>0x0){_0x33c4e4[_0x601f('0x6d')]-=0x1;}else{logger[_0x601f('0x93')](_0x601f('0x96'));}}}else{logger['error'](_0x601f('0x97'));}}function checkContactLowerLimitOriginate(_0x508cfa,_0xd80ed0,_0x3ee089){if(_0xd80ed0>_0x3ee089){for(var _0x2534f0=0x0;_0x2534f0<_0xd80ed0-_0x3ee089;_0x2534f0+=0x1){decremetOriginate(_0x508cfa);}}}function loggerGetContactDialer(_0x8fd49a,_0x20086d,_0x34d894){return function(_0x567841){checkContactLowerLimitOriginate(_0x20086d,_0x34d894,0x0);logger[_0x601f('0x93')](_0x8fd49a,util[_0x601f('0x92')](_0x567841,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x2ddaea){return function(_0x202114){if(isNotNull(_0x202114)&&isNotNull(_0x202114[0x0])){if(_0x202114[0x0][_0x601f('0x98')]>0x0){_0x2ddaea[_0x601f('0x39')]=_0x601f('0x99');logger[_0x601f('0x79')](_0x601f('0x9a')+_0x2ddaea[_0x601f('0x3a')],_0x202114[0x0][_0x601f('0x98')],_0x601f('0x9b'));}else{_0x2ddaea[_0x601f('0x39')]=_0x601f('0x9c');logger[_0x601f('0x79')](_0x601f('0x9d')+_0x2ddaea[_0x601f('0x3a')]);}}};}function notSendMessagesQueue(_0x822a6f){if(_0x822a6f[_0x601f('0x9e')]){freeVariablesPredictive(_0x822a6f);if(_0x822a6f['originated']===0x0&&_0x822a6f[_0x601f('0x4e')]===0x0&&_0x822a6f[_0x601f('0x51')]===0x0&&(_0x822a6f[_0x601f('0x4a')]||0x0)===0x0){_0x822a6f[_0x601f('0x9e')]=![];_0x822a6f['available']=0x0;_0x822a6f[_0x601f('0x39')]=_0x601f('0x3c');loggerSyncQueueSummary[_0x601f('0x93')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x822a6f[_0x601f('0x3a')],_0x601f('0x9f'));}else{_0x822a6f[_0x601f('0x39')]=_0x601f('0xa0');loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x822a6f[_0x601f('0x3a')],_0x601f('0xa1'));}emitVoiceQueueSummary(_0x822a6f);}}function notSendMessagesCampaign(_0x5a4050){if(_0x5a4050[_0x601f('0x9e')]){if(_0x5a4050[_0x601f('0x6d')]===0x0){_0x5a4050['sendMessageOneNotActive']=![];_0x5a4050[_0x601f('0x39')]=_0x601f('0x3c');loggerSyncQueueSummary[_0x601f('0x93')](_0x601f('0xa2'),_0x5a4050[_0x601f('0x3a')],_0x601f('0x9f'));}else{_0x5a4050[_0x601f('0x39')]=_0x601f('0xa0');loggerSyncQueueSummary['error'](_0x601f('0xa2'),_0x5a4050[_0x601f('0x3a')],'is\x20disactive');}emitCampaignSummary(_0x5a4050);}}function createObjHistory(_0x594d0b,_0x510c29,_0x1711a1,_0x54ce96,_0x275066){_0x594d0b['message']=_0x1711a1;var _0x1e53e1=new Action(_0x594d0b,_0x510c29);var _0x3f778b=new History(_0x1e53e1);_0x3f778b['state']=_0x54ce96;_0x3f778b[_0x601f('0xa3')]=_0x275066;_0x3f778b['endtime']=_0x1e53e1[_0x601f('0xa4')];return _0x3f778b;}Dialer[_0x601f('0x17')][_0x601f('0x37')]=function(){var _0x4bf0ae=this;setInterval(function(){_0x4bf0ae[_0x601f('0xa5')](_0x4bf0ae['uniqueId'],'[uniqueid]');_0x4bf0ae[_0x601f('0xa5')](_0x4bf0ae['actions'],_0x601f('0xa6'));},0x32c8);};Dialer[_0x601f('0x17')]['clearZombieChannels']=function(_0x12e2b8,_0x2a7c5a){var _0x538e07=this;for(var _0x2df0c9 in _0x12e2b8){if(typeof _0x12e2b8[_0x2df0c9]!=='undefined'){this[_0x601f('0x1a')][_0x601f('0xa7')](function(){if(!_[_0x601f('0xa8')](_0x12e2b8[_0x2df0c9])){return ami['Action']({'action':_0x601f('0xa9'),'channel':_0x12e2b8[_0x2df0c9][_0x601f('0xaa')]})[_0x601f('0xab')](function(_0x4d8bdd){if(_0x4d8bdd['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0x12e2b8[_0x2df0c9]&&_0x12e2b8[_0x2df0c9]['type']!==_0x601f('0xac')){_0x538e07['updateOriginated'](_0x538e07['voiceQueues'][_0x12e2b8[_0x2df0c9][_0x601f('0xad')]]);logger[_0x601f('0x93')]('[Dialer][checkChannel]',_0x2a7c5a,_0x2df0c9,_0x12e2b8[_0x2df0c9][_0x601f('0xad')]);delete _0x12e2b8[_0x2df0c9];}if(_0x12e2b8[_0x2df0c9]&&_0x12e2b8[_0x2df0c9]['type']==='ivr'){_0x538e07[_0x601f('0xae')](_0x538e07[_0x601f('0x1d')][_0x12e2b8[_0x2df0c9][_0x601f('0xad')]]);logger[_0x601f('0x93')]('[Dialer][checkChannel][ivr]',_0x2a7c5a,_0x2df0c9,_0x12e2b8[_0x2df0c9][_0x601f('0xad')]);delete _0x12e2b8[_0x2df0c9];}},0x2328);}});}});}}};Dialer[_0x601f('0x17')][_0x601f('0xaf')]=function(_0x5816f0){return BPromise[_0x601f('0xb0')]()[_0x601f('0xb1')](cmHopper[_0x601f('0xaf')](_0x5816f0))['catch'](loggerCatch(_0x601f('0xb2')));};Dialer['prototype'][_0x601f('0xb3')]=function(_0x4fd622){return BPromise['resolve']()[_0x601f('0xb1')](cmHopperBlack[_0x601f('0xb3')](_0x4fd622))['catch'](loggerCatch('[checkIsBlackList]\x20'));};Dialer[_0x601f('0x17')][_0x601f('0xb4')]=function(_0x4b6bec){return BPromise[_0x601f('0xb0')]()[_0x601f('0xb1')](cmHopperBlack['checkIsBlackListIvr'](_0x4b6bec))[_0x601f('0xab')](loggerCatch(_0x601f('0xb5')));};Dialer[_0x601f('0x17')][_0x601f('0xb6')]=function(_0x507b30){return BPromise[_0x601f('0xb0')]()[_0x601f('0xb1')](cmHopperHistory[_0x601f('0xb7')](_0x507b30))[_0x601f('0xab')](loggerCatch(_0x601f('0xb8')));};Dialer[_0x601f('0x17')][_0x601f('0xb9')]=function(_0x31c2b5){return BPromise['resolve']()['then'](cmHopper['rescheduleContact'](_0x31c2b5))[_0x601f('0xab')](loggerCatch(_0x601f('0xba')));};Dialer['prototype'][_0x601f('0xbb')]=function(_0x28f8e8,_0x10a7fa,_0x3a7d37){return BPromise['resolve']()[_0x601f('0xb1')](cmHopper[_0x601f('0xbb')](_0x28f8e8,_0x10a7fa,_0x3a7d37))[_0x601f('0xab')](loggerCatch(_0x601f('0xbc')));};Dialer[_0x601f('0x17')][_0x601f('0xbd')]=function(_0x539770,_0x3691b3,_0x25a83f,_0x23a891){return BPromise['resolve']()[_0x601f('0xb1')](cmHopper[_0x601f('0xbd')](_0x539770,_0x3691b3,_0x25a83f,_0x23a891))[_0x601f('0xab')](loggerCatch(_0x601f('0xbe')));};Dialer[_0x601f('0x17')][_0x601f('0xbf')]=function(_0x165226,_0x27ace2,_0x54c791){return BPromise['resolve']()['then'](cmHopper[_0x601f('0xbf')](_0x165226,_0x27ace2,_0x54c791))[_0x601f('0xab')](loggerCatch('[getContactDialer]\x20'));};Dialer['prototype']['getVoiceQueueRtPauses']=function(_0x5244bb){return BPromise[_0x601f('0xb0')]()[_0x601f('0xb1')](voiceQueueRt['getVoiceQueueRtPauses'](_0x5244bb))[_0x601f('0xab')](loggerCatch(_0x601f('0xc0')));};Dialer['prototype'][_0x601f('0xc1')]=function(_0x415c96){return BPromise[_0x601f('0xb0')]()[_0x601f('0xb1')](cmHopper[_0x601f('0xc1')](_0x415c96))[_0x601f('0xab')](loggerCatch(_0x601f('0xc2')));};Dialer[_0x601f('0x17')][_0x601f('0xc3')]=function(_0x44e453){return BPromise[_0x601f('0xb0')]()['then'](cmHopperHistory[_0x601f('0xc3')](_0x44e453))[_0x601f('0xab')](loggerCatch(_0x601f('0xc4')));};Dialer[_0x601f('0x17')][_0x601f('0xae')]=function(_0x57ba57){if(!_['isUndefined'](_0x57ba57)&&_0x57ba57!==null){if(typeof _0x57ba57['originated']!==_0x601f('0x95')){if(_0x57ba57[_0x601f('0x6d')]>0x0){_0x57ba57['originated']-=0x1;}else{logger[_0x601f('0x93')](_0x601f('0xc5'));}}}else{logger[_0x601f('0x93')](_0x601f('0xc6'));}};Dialer['prototype'][_0x601f('0xc7')]=function(_0xf06835,_0x327933){var _0x656d=this;return function(_0x77e5c0){_0x656d[_0x601f('0xae')](_0x327933);logger[_0x601f('0x93')](_0xf06835,util[_0x601f('0x92')](_0x77e5c0,{'showHidden':![],'depth':null}));};};Dialer[_0x601f('0x17')]['emptyContact']=function(_0x1a14b0,_0x5c2d91,_0x56cb25){var _0xa2c87e={'state':0x19,'statedesc':_0x601f('0xc8')};this[_0x601f('0xae')](_0x5c2d91);this[_0x601f('0xc9')](_[_0x601f('0x8b')](_0xa2c87e,_[_0x601f('0xca')](_0x56cb25,[_0x601f('0xcb'),'ListId',_0x601f('0xcc'),_0x601f('0xcd'),_0x601f('0xce')])),_0x601f('0xcf'),_0x601f('0xd0'));logger[_0x601f('0x93')](_0x1a14b0);};Dialer[_0x601f('0x17')][_0x601f('0xd1')]=function(_0x3bfabf){return _0x3bfabf===_0x601f('0xd2');};Dialer[_0x601f('0x17')][_0x601f('0xd3')]=function(_0x8a24dc){return!_[_0x601f('0x38')](_0x8a24dc)&&_0x8a24dc&&!_['isUndefined'](_0x8a24dc[_0x601f('0x3a')])&&!_['isUndefined'](_0x8a24dc[_0x601f('0xd4')])&&_0x8a24dc[_0x601f('0xd4')]&&(this[_0x601f('0x1f')][util['format'](_0x601f('0xd5'),_0x8a24dc[_0x601f('0x3a')])][_0x601f('0xa9')]===_0x601f('0xd6')||this[_0x601f('0x1f')][util['format']('SIP/%s',_0x8a24dc[_0x601f('0x3a')])][_0x601f('0xa9')]===_0x601f('0xd7'));};Dialer[_0x601f('0x17')][_0x601f('0xc9')]=function(_0x1bbf17,_0x4cbd88,_0x2385b4){this['createHistory'](_0x1bbf17)[_0x601f('0xab')](loggerCatch(_0x4cbd88));this[_0x601f('0xc1')](_0x1bbf17)['catch'](loggerCatch(_0x2385b4));};Dialer[_0x601f('0x17')]['syncVarSet']=function(_0x4d734e){var _0x5c1224=this[_0x601f('0x23')][_0x4d734e[_0x601f('0xd8')]];var _0x5cbffa;if(!_['isNil'](_0x4d734e)&&!_['isNil'](_0x4d734e[_0x601f('0xd9')])&&!_[_0x601f('0xa8')](_0x4d734e[_0x601f('0xd9')][_0x601f('0xda')])&&_0x4d734e['exten']===_0x601f('0xdb')&&_0x5c1224){if(_0x5c1224['type']!==_0x601f('0xac')&&this[_0x601f('0x1c')][_0x5c1224[_0x601f('0xad')]][_0x601f('0xdc')]&&_0x4d734e[_0x601f('0xdd')]==='HANGUP'){delete this[_0x601f('0x23')][_0x4d734e[_0x601f('0xd8')]];this[_0x601f('0xae')](this[_0x601f('0x1c')][_0x5c1224[_0x601f('0xad')]]);this[_0x601f('0x1c')][_0x5c1224[_0x601f('0xad')]][_0x601f('0x58')]+=0x1;this[_0x601f('0x1c')][_0x5c1224[_0x601f('0xad')]][_0x601f('0x57')]+=0x1;_0x5cbffa=new Hangup(_0x5c1224,_0x4d734e);_0x5cbffa[_0x601f('0xde')]=0x12;_0x5cbffa[_0x601f('0xa3')]=_0x601f('0xdf');_0x5cbffa[_0x601f('0xe0')]=_0x601f('0xe1');this['saveInDb'](_0x5cbffa,'[syncHangupInAMD][createHistory]',_0x601f('0xe2'));}if(_0x5c1224[_0x601f('0x47')]!==_0x601f('0xac')&&this[_0x601f('0x1c')][_0x5c1224[_0x601f('0xad')]][_0x601f('0xdc')]&&_0x4d734e['value']==='MACHINE'){var _0x1f4a89=this;return new BPromise(function(_0x43423e,_0x193a2f){delete _0x1f4a89[_0x601f('0x23')][_0x4d734e['uniqueid']];_0x1f4a89[_0x601f('0xae')](_0x1f4a89[_0x601f('0x1c')][_0x5c1224['queue']]);_0x1f4a89[_0x601f('0x1c')][_0x5c1224['queue']][_0x601f('0x58')]+=0x1;_0x1f4a89[_0x601f('0x1c')][_0x5c1224[_0x601f('0xad')]][_0x601f('0x57')]+=0x1;var _0x15f300=_0x1f4a89['voiceQueues'][_0x5c1224[_0x601f('0xad')]];var _0x3d0b9e=new Hangup(_0x5c1224,_0x4d734e);_0x3d0b9e[_0x601f('0xde')]=0x13;_0x3d0b9e[_0x601f('0xa3')]=_0x601f('0xe3');_0x3d0b9e[_0x601f('0xe0')]='AMD';_0x3d0b9e['countmachineretry']+=0x1;_0x3d0b9e['countglobal']+=0x1;_0x3d0b9e[_0x601f('0xe4')]=!![];_0x1f4a89[_0x601f('0xc3')](_0x3d0b9e)['catch'](loggerCatch(_0x601f('0xe5')));if(_0x3d0b9e[_0x601f('0xe6')]+_0x3d0b9e['countcongestionretry']+_0x3d0b9e['countnoanswerretry']+_0x3d0b9e['countnosuchnumberretry']+_0x3d0b9e[_0x601f('0xe7')]+_0x3d0b9e['countabandonedretry']+_0x3d0b9e[_0x601f('0xe8')]+_0x3d0b9e[_0x601f('0xe9')]>=_0x15f300[_0x601f('0xea')]){_0x1f4a89[_0x601f('0xeb')](_0x3d0b9e,_0x43423e,_0x193a2f,'reason19\x20machine....');}else{if(_0x3d0b9e[_0x601f('0xe8')]>=_0x15f300[_0x601f('0xec')]){_0x1f4a89[_0x601f('0xed')](_0x3d0b9e,_0x43423e,_0x193a2f,'reason\x2019\x20machine....');}else{_0x1f4a89['rescheduleContact']({'active':![],'countmachineretry':_0x3d0b9e[_0x601f('0xe8')],'scheduledat':moment()[_0x601f('0xee')](_0x15f300[_0x601f('0xef')],_0x601f('0xf0'))[_0x601f('0x73')](_0x601f('0xf1')),'ContactId':_0x3d0b9e[_0x601f('0xcb')],'ListId':_0x3d0b9e[_0x601f('0xf2')],'VoiceQueueId':_0x3d0b9e[_0x601f('0xcd')]||undefined,'CampaignId':_0x3d0b9e['CampaignId']||undefined})[_0x601f('0xab')](loggerCatch(_0x601f('0xf3')));_0x43423e({'reschedule':0x1});}}});}if(_0x5c1224[_0x601f('0x47')]===_0x601f('0xac')&&this[_0x601f('0x1d')][_0x5c1224[_0x601f('0xad')]][_0x601f('0xdc')]&&_0x4d734e[_0x601f('0xdd')]===_0x601f('0xf4')){delete this['uniqueId'][_0x4d734e['uniqueid']];this[_0x601f('0xae')](this['campaigns'][_0x5c1224[_0x601f('0xad')]]);_0x5cbffa=new Hangup(_0x5c1224,_0x4d734e);_0x5cbffa[_0x601f('0xde')]=0x12;_0x5cbffa['statedesc']=_0x601f('0xdf');_0x5cbffa[_0x601f('0xe0')]='AMD';this[_0x601f('0xc9')](_0x5cbffa,'[syncHangupInAMDIvr][createHistory]',_0x601f('0xf5'));}if(_0x5c1224['type']==='ivr'&&this[_0x601f('0x1d')][_0x5c1224[_0x601f('0xad')]][_0x601f('0xdc')]&&_0x4d734e[_0x601f('0xdd')]===_0x601f('0xf6')){var _0x1f4a89=this;return new BPromise(function(_0x5e2faf,_0x5e3d1d){delete _0x1f4a89[_0x601f('0x23')][_0x4d734e['uniqueid']];_0x1f4a89[_0x601f('0xae')](_0x1f4a89[_0x601f('0x1d')][_0x5c1224[_0x601f('0xad')]]);_0x1f4a89['campaigns'][_0x5c1224['queue']]['outboundAnswerCallsDay']+=0x1;_0x1f4a89[_0x601f('0x1d')][_0x5c1224[_0x601f('0xad')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x298b52=_0x1f4a89[_0x601f('0x1d')][_0x5c1224[_0x601f('0xad')]];var _0x3a5f9a=new Hangup(_0x5c1224,_0x4d734e);_0x3a5f9a[_0x601f('0xde')]=0x13;_0x3a5f9a[_0x601f('0xa3')]=_0x601f('0xe3');_0x3a5f9a[_0x601f('0xe0')]=_0x601f('0xe1');_0x3a5f9a['countmachineretry']+=0x1;_0x3a5f9a[_0x601f('0xf7')]+=0x1;_0x3a5f9a[_0x601f('0xe4')]=!![];_0x1f4a89[_0x601f('0xc3')](_0x3a5f9a)[_0x601f('0xab')](loggerCatch(_0x601f('0xe5')));if(_0x3a5f9a[_0x601f('0xe6')]+_0x3a5f9a[_0x601f('0xf8')]+_0x3a5f9a[_0x601f('0xf9')]+_0x3a5f9a['countnosuchnumberretry']+_0x3a5f9a[_0x601f('0xe7')]+_0x3a5f9a[_0x601f('0xfa')]+_0x3a5f9a[_0x601f('0xe8')]+_0x3a5f9a[_0x601f('0xe9')]>=_0x298b52['dialGlobalMaxRetry']){_0x1f4a89[_0x601f('0xeb')](_0x3a5f9a,_0x5e2faf,_0x5e3d1d,_0x601f('0xfb'));}else{if(_0x3a5f9a['countmachineretry']>=_0x298b52[_0x601f('0xec')]){_0x1f4a89[_0x601f('0xed')](_0x3a5f9a,_0x5e2faf,_0x5e3d1d,_0x601f('0xfc'));}else{_0x1f4a89[_0x601f('0xb9')]({'active':![],'countmachineretry':_0x3a5f9a[_0x601f('0xe8')],'scheduledat':moment()[_0x601f('0xee')](_0x298b52[_0x601f('0xef')],_0x601f('0xf0'))[_0x601f('0x73')](_0x601f('0xf1')),'ContactId':_0x3a5f9a['ContactId'],'ListId':_0x3a5f9a['ListId'],'VoiceQueueId':_0x3a5f9a[_0x601f('0xcd')]||undefined,'CampaignId':_0x3a5f9a[_0x601f('0xce')]||undefined})[_0x601f('0xab')](loggerCatch(_0x601f('0xf3')));_0x5e2faf({'reschedule':0x1});}}});}}};Dialer['prototype'][_0x601f('0x2f')]=function(_0x3b72b5){var _0x1574ba=this[_0x601f('0x23')][_0x3b72b5[_0x601f('0xd8')]];var _0x392944=this;var _0x43d8ec;if(_0x1574ba&&_0x1574ba[_0x601f('0x47')]===_0x601f('0xac')){delete this['uniqueId'][_0x3b72b5[_0x601f('0xd8')]];this[_0x601f('0xae')](this[_0x601f('0x1d')][_0x1574ba[_0x601f('0xad')]]);this[_0x601f('0x1d')][_0x1574ba[_0x601f('0xad')]][_0x601f('0xfd')]+=0x1;_0x43d8ec=new Hangup(_0x1574ba,_0x3b72b5);this[_0x601f('0xc3')](_0x43d8ec)[_0x601f('0xab')](loggerCatch(_0x601f('0xfe')));this[_0x601f('0xc1')](_0x43d8ec)[_0x601f('0xab')](loggerCatch(_0x601f('0xff')));}if(_0x1574ba&&_0x1574ba[_0x601f('0x47')]!=='ivr'&&isNotNull(this[_0x601f('0x1c')][_0x1574ba[_0x601f('0xad')]][_0x601f('0x100')])){delete this[_0x601f('0x23')][_0x3b72b5[_0x601f('0xd8')]];this[_0x601f('0xae')](this[_0x601f('0x1c')][_0x1574ba['queue']]);this[_0x601f('0x1c')][_0x1574ba[_0x601f('0xad')]][_0x601f('0x58')]+=0x1;this[_0x601f('0x1c')][_0x1574ba[_0x601f('0xad')]][_0x601f('0x57')]+=0x1;_0x43d8ec=new Hangup(_0x1574ba,_0x3b72b5);_0x43d8ec[_0x601f('0xde')]=0x10;_0x43d8ec[_0x601f('0xa3')]='AnswerAGI';_0x43d8ec[_0x601f('0xe0')]=_0x601f('0x101');this[_0x601f('0xc3')](_0x43d8ec)[_0x601f('0xab')](loggerCatch(_0x601f('0xfe')));this['moveContactManagedDialer'](_0x43d8ec)['catch'](loggerCatch(_0x601f('0xff')));}if(_0x1574ba&&_0x1574ba[_0x601f('0x47')]!==_0x601f('0xac')&&!isNotNull(this[_0x601f('0x1c')][_0x1574ba[_0x601f('0xad')]][_0x601f('0x100')])){delete this['uniqueId'][_0x3b72b5[_0x601f('0xd8')]];this['updateOriginated'](this[_0x601f('0x1c')][_0x1574ba[_0x601f('0xad')]]);this['voiceQueues'][_0x1574ba[_0x601f('0xad')]][_0x601f('0x62')]+=0x1;_0x43d8ec=new Hangup(_0x1574ba,_0x3b72b5);_0x43d8ec[_0x601f('0xde')]=0xc;_0x43d8ec['statedesc']=_0x3b72b5[_0x601f('0x102')];_0x43d8ec['membername']='Unknow';this[_0x601f('0xc3')](_0x43d8ec)[_0x601f('0xab')](loggerCatch(_0x601f('0xfe')));this[_0x601f('0xc1')](_0x43d8ec)[_0x601f('0xab')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0x601f('0x17')][_0x601f('0x2d')]=function(_0x5df715){var _0x355d2d=this['uniqueId'][_0x5df715[_0x601f('0xd8')]];var _0x532313=this;if(this[_0x601f('0x1c')][_0x5df715[_0x601f('0xad')]]){if(_0x355d2d&&_0x355d2d[_0x601f('0x47')]!==_0x601f('0xac')){delete this[_0x601f('0x23')][_0x5df715[_0x601f('0xd8')]];this[_0x601f('0x1c')][_0x5df715['queue']][_0x601f('0x58')]+=0x1;var _0x1b0a85=new AgentComplete(_0x355d2d,_0x5df715);if(_0x5df715[_0x601f('0x103')]===_0x601f('0x104')){_0x1b0a85[_0x601f('0x105')]=this['voiceQueues'][_0x5df715['queue']][_0x601f('0x106')]&&this[_0x601f('0x1c')][_0x5df715[_0x601f('0xad')]][_0x601f('0x107')]?moment()[_0x601f('0x73')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this[_0x601f('0xc3')](_0x1b0a85)[_0x601f('0xab')](loggerCatch('[syncAgentComplete][createHistory]'));this['moveContactManagedDialer'](_0x1b0a85)['catch'](loggerCatch(_0x601f('0x108')));}}};Dialer[_0x601f('0x17')][_0x601f('0x109')]=function(_0x3de669){if(this[_0x601f('0x1c')][_0x3de669[_0x601f('0xad')]]){if(this[_0x601f('0x23')][_0x3de669[_0x601f('0xd8')]]&&this['uniqueId'][_0x3de669[_0x601f('0xd8')]][_0x601f('0x47')]!==_0x601f('0xac')){this[_0x601f('0xae')](this[_0x601f('0x1c')][_0x3de669['queue']]);this[_0x601f('0x23')][_0x3de669[_0x601f('0xd8')]]['answertime']=moment()[_0x601f('0x73')](_0x601f('0xf1'));}}};Dialer[_0x601f('0x17')]['queueCallerAbandonCreateState']=function(_0x4a106b){this['createHistory'](_0x4a106b)[_0x601f('0xab')](loggerCatch(_0x601f('0x10a')));this[_0x601f('0xc1')](_0x4a106b)['catch'](loggerCatch(_0x601f('0x10b')));};Dialer[_0x601f('0x17')][_0x601f('0x10c')]=function(_0x1c3eec){var _0x2844d2=this[_0x601f('0x23')][_0x1c3eec[_0x601f('0xd8')]];var _0x223fcb=this;if(this[_0x601f('0x1c')][_0x1c3eec[_0x601f('0xad')]]){if(_0x2844d2&&_0x2844d2[_0x601f('0x47')]!==_0x601f('0xac')){delete this[_0x601f('0x23')][_0x1c3eec[_0x601f('0xd8')]];this[_0x601f('0xae')](this[_0x601f('0x1c')][_0x1c3eec['queue']]);_0x2844d2[_0x601f('0x10d')]=moment()[_0x601f('0x73')]('YYYY-MM-DD\x20HH:mm:ss');var _0x4982de=new QueueCallerAbandon(_0x2844d2,_0x1c3eec);if(getSeconds(_0x2844d2[_0x601f('0x10d')],_0x2844d2['responsetime'])>=_0x2844d2[_0x601f('0x10e')]){this[_0x601f('0x1c')][_0x1c3eec['queue']][_0x601f('0x66')]+=0x1;this[_0x601f('0x1c')][_0x1c3eec[_0x601f('0xad')]][_0x601f('0x5c')]+=0x1;this['voiceQueues'][_0x1c3eec[_0x601f('0xad')]][_0x601f('0x68')]+=0x1;_0x4982de[_0x601f('0xde')]=0xa;_0x4982de[_0x601f('0xa3')]=_0x601f('0x10f');_0x4982de[_0x601f('0x110')]='TIMEOUT';_0x4982de[_0x601f('0x105')]=this[_0x601f('0x1c')][_0x1c3eec[_0x601f('0xad')]][_0x601f('0x106')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x4982de[_0x601f('0xe7')]+=0x1;_0x4982de['countglobal']+=0x1;if(_0x4982de[_0x601f('0xe7')]>=this[_0x601f('0x1c')][_0x1c3eec[_0x601f('0xad')]][_0x601f('0x111')]){this['queueCallerAbandonCreateState'](_0x4982de);}else{this[_0x601f('0xb9')]({'active':![],'countdropretry':_0x4982de[_0x601f('0xe7')],'scheduledat':moment()[_0x601f('0xee')](this[_0x601f('0x1c')][_0x1c3eec[_0x601f('0xad')]][_0x601f('0x112')],_0x601f('0xf0'))['format'](_0x601f('0xf1')),'ContactId':_0x2844d2[_0x601f('0xcb')],'ListId':_0x2844d2[_0x601f('0xf2')],'VoiceQueueId':_0x2844d2[_0x601f('0xcd')]||undefined,'CampaignId':_0x2844d2[_0x601f('0xce')]||undefined})[_0x601f('0xab')](loggerCatch(_0x601f('0x113')));var _0x1cdc04=new History(_0x4982de);_0x1cdc04['state']=0xa;_0x1cdc04[_0x601f('0xa3')]=_0x601f('0x10f');_0x1cdc04[_0x601f('0xa4')]=moment()[_0x601f('0x73')]('YYYY-MM-DD\x20HH:mm:ss');_0x1cdc04[_0x601f('0x114')]=_0x1cdc04[_0x601f('0xa4')];_0x1cdc04[_0x601f('0x115')]=_0x4982de['calleridname'];_0x1cdc04['calleridnum']=_0x4982de[_0x601f('0x116')];this[_0x601f('0xc3')](_0x1cdc04)[_0x601f('0xab')](loggerCatch('[syncAgentComplete][createHistory][10]'));}}else{this[_0x601f('0x1c')][_0x1c3eec['queue']][_0x601f('0x65')]+=0x1;this[_0x601f('0x1c')][_0x1c3eec[_0x601f('0xad')]]['outboundDropCallsDayCallersExit']+=0x1;_0x4982de[_0x601f('0xde')]=0xb;_0x4982de[_0x601f('0xa3')]=_0x601f('0x117');_0x4982de[_0x601f('0x110')]=_0x601f('0x118');_0x4982de[_0x601f('0xfa')]+=0x1;_0x4982de[_0x601f('0xf7')]+=0x1;if(_0x4982de['countabandonedretry']>=this['voiceQueues'][_0x1c3eec[_0x601f('0xad')]][_0x601f('0x119')]){this[_0x601f('0x11a')](_0x4982de);}else{this[_0x601f('0xb9')]({'active':![],'countabandonedretry':_0x4982de['countabandonedretry'],'scheduledat':moment()[_0x601f('0xee')](this[_0x601f('0x1c')][_0x1c3eec[_0x601f('0xad')]]['dialAbandonedRetryFrequency'],_0x601f('0xf0'))[_0x601f('0x73')](_0x601f('0xf1')),'ContactId':_0x2844d2[_0x601f('0xcb')],'ListId':_0x2844d2[_0x601f('0xf2')],'VoiceQueueId':_0x2844d2[_0x601f('0xcd')]||undefined,'CampaignId':_0x2844d2[_0x601f('0xce')]||undefined})[_0x601f('0xab')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x1cdc04=new History(_0x4982de);_0x1cdc04['state']=0xb;_0x1cdc04[_0x601f('0xa3')]='Abandoned';_0x1cdc04[_0x601f('0xa4')]=moment()['format'](_0x601f('0xf1'));_0x1cdc04['endtime']=_0x1cdc04[_0x601f('0xa4')];_0x1cdc04[_0x601f('0x115')]=_0x4982de[_0x601f('0x115')];_0x1cdc04[_0x601f('0x116')]=_0x4982de[_0x601f('0x116')];this['createHistory'](_0x1cdc04)[_0x601f('0xab')](loggerCatch(_0x601f('0x11b')));}}}}};Dialer['prototype'][_0x601f('0x31')]=function(_0x1277ff){if(this['actions'][_0x1277ff[_0x601f('0xd8')]]){this['actions'][_0x1277ff['uniqueid']][_0x601f('0xaa')]=_0x1277ff[_0x601f('0xaa')];}if(this['uniqueId'][_0x1277ff['uniqueid']]){this[_0x601f('0x23')][_0x1277ff[_0x601f('0xd8')]][_0x601f('0xaa')]=_0x1277ff[_0x601f('0xaa')];}};Dialer['prototype'][_0x601f('0x35')]=function(_0xc7d6dc){if(strategy[this[_0x601f('0x1c')][this['actions'][_0xc7d6dc['actionid']][_0x601f('0xad')]]['strategy']]===_0x601f('0x16')){if(this[_0x601f('0x11c')][_0xc7d6dc[_0x601f('0x11d')]]&&_[_0x601f('0xa8')](this[_0x601f('0x11c')][_0xc7d6dc['actionid']][_0x601f('0x11e')])&&_0xc7d6dc[_0x601f('0xa9')]==='1'&&_0xc7d6dc[_0x601f('0x11f')]==='0'){if(this[_0x601f('0x1e')][_0xc7d6dc[_0x601f('0x120')]]){if(!this[_0x601f('0x1e')][_0xc7d6dc[_0x601f('0x120')]][_0x601f('0x11e')]){this[_0x601f('0x1e')][_0xc7d6dc[_0x601f('0x120')]]['locked']=!![];this[_0x601f('0x11c')][_0xc7d6dc[_0x601f('0x11d')]][_0x601f('0x11e')]=!![];this['actions'][_0xc7d6dc[_0x601f('0x11d')]][_0x601f('0x120')]=_0xc7d6dc['stateinterface'];}}}}else if((strategy[this['voiceQueues'][this[_0x601f('0x11c')][_0xc7d6dc[_0x601f('0x11d')]][_0x601f('0xad')]][_0x601f('0x121')]]||_0x601f('0x15'))==='rrmemory'){if(this[_0x601f('0x11c')][_0xc7d6dc[_0x601f('0x11d')]]){if(this[_0x601f('0x1e')][_0xc7d6dc['stateinterface']]){this[_0x601f('0x11c')][_0xc7d6dc[_0x601f('0x11d')]][_0x601f('0x120')]=_0xc7d6dc['stateinterface'];if(_[_0x601f('0xa8')](this[_0x601f('0x122')][this[_0x601f('0x11c')][_0xc7d6dc[_0x601f('0x11d')]][_0x601f('0xad')]])){this['queueBooked'][this[_0x601f('0x11c')][_0xc7d6dc[_0x601f('0x11d')]]['queue']]=[];}this[_0x601f('0x122')][this[_0x601f('0x11c')][_0xc7d6dc[_0x601f('0x11d')]]['queue']][_0x601f('0x123')](_[_0x601f('0x8b')](_[_0x601f('0xca')](this[_0x601f('0x11c')][_0xc7d6dc[_0x601f('0x11d')]],[_0x601f('0x124'),_0x601f('0x120')]),{'status':_0xc7d6dc[_0x601f('0xa9')],'paused':_0xc7d6dc[_0x601f('0x11f')]}));}}}};function unlockQueueStatus(_0xcb34ce,_0x9cbf9e){setTimeout(function(){if(_['isUndefined'](_0xcb34ce[_0x601f('0x125')])){loggerBooked[_0x601f('0x93')](_0x601f('0x126'),_0x9cbf9e);}_0xcb34ce[_0x601f('0x125')]=!![];loggerBooked[_0x601f('0x79')]('[booked][unlockQueueStatus]',_0x9cbf9e,JSON[_0x601f('0x43')](_[_0x601f('0xca')](_0xcb34ce,[_0x601f('0x3a'),_0x601f('0x125')])));},0x1f3);}Dialer[_0x601f('0x17')]['syncQueueStatusComplete']=function(_0x2bfdf5){var _0x2a61a0=this;var _0x8d73b1=_0x2a61a0[_0x601f('0x1c')][_0x2a61a0[_0x601f('0x11c')][_0x2bfdf5[_0x601f('0x11d')]][_0x601f('0xad')]];if(strategy[this[_0x601f('0x1c')][this['actions'][_0x2bfdf5[_0x601f('0x11d')]][_0x601f('0xad')]]['strategy']]===_0x601f('0x16')){if(this['actions'][_0x2bfdf5[_0x601f('0x11d')]]&&this[_0x601f('0x11c')][_0x2bfdf5[_0x601f('0x11d')]]['stateinterface']){this[_0x601f('0x1b')][_0x601f('0x127')](this[_0x601f('0x11c')][_0x2bfdf5[_0x601f('0x11d')]][_0x601f('0x124')],this[_0x601f('0x11c')][_0x2bfdf5[_0x601f('0x11d')]][_0x601f('0x120')])[_0x601f('0xab')](function(_0x16f978){logger['error'](_0x601f('0x128'),util[_0x601f('0x92')](_0x16f978,{'showHidden':![],'depth':null}));})['finally'](function(){_0x2a61a0[_0x601f('0xae')](_0x2a61a0['voiceQueues'][_0x2a61a0[_0x601f('0x11c')][_0x2bfdf5[_0x601f('0x11d')]][_0x601f('0xad')]]);_0x2a61a0['agents'][_0x2a61a0[_0x601f('0x11c')][_0x2bfdf5[_0x601f('0x11d')]][_0x601f('0x120')]][_0x601f('0x11e')]=![];delete _0x2a61a0[_0x601f('0x11c')][_0x2bfdf5[_0x601f('0x11d')]];unlockQueueStatus(_0x8d73b1);});}else{this[_0x601f('0xae')](this[_0x601f('0x1c')][this[_0x601f('0x11c')][_0x2bfdf5[_0x601f('0x11d')]][_0x601f('0xad')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0x601f('0x11c')][_0x2bfdf5['actionid']][_0x601f('0xcb')],'ListId':this[_0x601f('0x11c')][_0x2bfdf5[_0x601f('0x11d')]]['ListId'],'VoiceQueueId':this[_0x601f('0x11c')][_0x2bfdf5[_0x601f('0x11d')]][_0x601f('0xcd')]||undefined,'CampaignId':this[_0x601f('0x11c')][_0x2bfdf5[_0x601f('0x11d')]][_0x601f('0xce')]||undefined})[_0x601f('0xab')](loggerCatch(_0x601f('0x129')));delete this[_0x601f('0x11c')][_0x2bfdf5[_0x601f('0x11d')]];unlockQueueStatus(_0x8d73b1);}}else if((strategy[this[_0x601f('0x1c')][this[_0x601f('0x11c')][_0x2bfdf5[_0x601f('0x11d')]][_0x601f('0xad')]][_0x601f('0x121')]]||_0x601f('0x15'))==='rrmemory'){var _0x33095c;if(this[_0x601f('0x11c')][_0x2bfdf5[_0x601f('0x11d')]]&&!_[_0x601f('0x78')](this[_0x601f('0x122')][this[_0x601f('0x11c')][_0x2bfdf5[_0x601f('0x11d')]][_0x601f('0xad')]])){if(this[_0x601f('0x27')][_0x2a61a0['actions'][_0x2bfdf5[_0x601f('0x11d')]][_0x601f('0xad')]]){this['queueBookedRR'][_0x2a61a0[_0x601f('0x11c')][_0x2bfdf5[_0x601f('0x11d')]][_0x601f('0xad')]]=this[_0x601f('0x27')][this[_0x601f('0x11c')][_0x2bfdf5[_0x601f('0x11d')]]['queue']]?this[_0x601f('0x27')][this[_0x601f('0x11c')][_0x2bfdf5['actionid']][_0x601f('0xad')]]:this['queueBooked'][this[_0x601f('0x11c')][_0x2bfdf5['actionid']][_0x601f('0xad')]]?this[_0x601f('0x122')][this[_0x601f('0x11c')][_0x2bfdf5['actionid']]['queue']][_0x601f('0x12a')]||0x0:0x0;}this[_0x601f('0x122')][this['actions'][_0x2bfdf5[_0x601f('0x11d')]][_0x601f('0xad')]][_0x601f('0x12a')]=this[_0x601f('0x27')][this[_0x601f('0x11c')][_0x2bfdf5[_0x601f('0x11d')]][_0x601f('0xad')]];for(var _0x42734a=0x0;_0x42734a<this['queueBooked'][this['actions'][_0x2bfdf5[_0x601f('0x11d')]][_0x601f('0xad')]]['length'];_0x42734a+=0x1){_0x33095c=rr(this['queueBooked'][this['actions'][_0x2bfdf5[_0x601f('0x11d')]][_0x601f('0xad')]]);this[_0x601f('0x27')][_0x2a61a0[_0x601f('0x11c')][_0x2bfdf5['actionid']]['queue']]=this[_0x601f('0x122')][this[_0x601f('0x11c')][_0x2bfdf5[_0x601f('0x11d')]]['queue']][_0x601f('0x12a')];if(_0x33095c[_0x601f('0xa9')]==='1'&&_0x33095c[_0x601f('0x11f')]==='0'){break;}}if(!_[_0x601f('0xa8')](_0x33095c)){this['agents'][_0x33095c['stateinterface']][_0x601f('0x12b')]=_[_0x601f('0x38')](this[_0x601f('0x1e')][_0x33095c[_0x601f('0x120')]][_0x601f('0x12b')])?!![]:this['agents'][_0x33095c[_0x601f('0x120')]]['unlockRR'];}loggerBooked[_0x601f('0x79')](_0x601f('0x12c'),_0x2bfdf5['actionid'],'Agent:\x20',JSON[_0x601f('0x43')](_['pick'](this[_0x601f('0x1e')][_0x33095c[_0x601f('0x120')]],['name',_0x601f('0x12b')])),_0x601f('0x12d'),JSON[_0x601f('0x43')](_0x33095c[_0x601f('0x124')]));if(!_['isNil'](_0x33095c)&&_0x33095c[_0x601f('0xa9')]==='1'&&_0x33095c['paused']==='0'&&this[_0x601f('0x1e')][_0x33095c[_0x601f('0x120')]][_0x601f('0x12b')]){this[_0x601f('0x1e')][_0x33095c[_0x601f('0x120')]][_0x601f('0x12b')]=![];this[_0x601f('0x122')][_0x2a61a0[_0x601f('0x11c')][_0x2bfdf5['actionid']][_0x601f('0xad')]]=[];this[_0x601f('0x1b')]['run'](_0x33095c[_0x601f('0x124')],_0x33095c[_0x601f('0x120')])[_0x601f('0xab')](function(_0x3592bc){logger[_0x601f('0x93')](_0x601f('0x128'),util['inspect'](_0x3592bc,{'showHidden':![],'depth':null}));})[_0x601f('0x19')](function(){_0x2a61a0[_0x601f('0xae')](_0x2a61a0[_0x601f('0x1c')][_0x2a61a0[_0x601f('0x11c')][_0x2bfdf5[_0x601f('0x11d')]][_0x601f('0xad')]]);setTimeout(function(){_0x2a61a0[_0x601f('0x1e')][_0x33095c[_0x601f('0x120')]][_0x601f('0x12b')]=!![];loggerBooked[_0x601f('0x79')]('[booked][RR][finaly]',_0x2bfdf5['actionid'],_0x601f('0x12e'),JSON[_0x601f('0x43')](_['pick'](_0x2a61a0[_0x601f('0x1e')][_0x33095c[_0x601f('0x120')]],['name',_0x601f('0x12b')])),_0x601f('0x12d'),JSON['stringify'](_0x33095c[_0x601f('0x124')]));},0xc7);delete _0x2a61a0[_0x601f('0x11c')][_0x2bfdf5[_0x601f('0x11d')]];unlockQueueStatus(_0x8d73b1,_0x2bfdf5[_0x601f('0x11d')]);});}else{loggerBooked[_0x601f('0x79')](_0x601f('0x12f'));this[_0x601f('0xae')](this['voiceQueues'][this[_0x601f('0x11c')][_0x2bfdf5[_0x601f('0x11d')]][_0x601f('0xad')]]);this[_0x601f('0xb9')]({'active':![],'ContactId':this['actions'][_0x2bfdf5['actionid']]['ContactId'],'ListId':this[_0x601f('0x11c')][_0x2bfdf5['actionid']][_0x601f('0xf2')],'VoiceQueueId':this['actions'][_0x2bfdf5['actionid']]['VoiceQueueId']||undefined,'CampaignId':this[_0x601f('0x11c')][_0x2bfdf5['actionid']][_0x601f('0xce')]||undefined})['catch'](loggerCatch(_0x601f('0x129')));delete this[_0x601f('0x11c')][_0x2bfdf5[_0x601f('0x11d')]];unlockQueueStatus(_0x8d73b1);}}else{loggerBooked[_0x601f('0x79')]('[booked][unlock2]');this[_0x601f('0xae')](this[_0x601f('0x1c')][this[_0x601f('0x11c')][_0x2bfdf5[_0x601f('0x11d')]][_0x601f('0xad')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0x601f('0x11c')][_0x2bfdf5[_0x601f('0x11d')]][_0x601f('0xcb')],'ListId':this[_0x601f('0x11c')][_0x2bfdf5['actionid']][_0x601f('0xf2')],'VoiceQueueId':this['actions'][_0x2bfdf5[_0x601f('0x11d')]][_0x601f('0xcd')]||undefined,'CampaignId':this[_0x601f('0x11c')][_0x2bfdf5[_0x601f('0x11d')]][_0x601f('0xce')]||undefined})[_0x601f('0xab')](loggerCatch(_0x601f('0x130')));delete this[_0x601f('0x11c')][_0x2bfdf5['actionid']];unlockQueueStatus(_0x8d73b1);}}else{loggerBooked['info'](_0x601f('0x131'));this[_0x601f('0xae')](this['voiceQueues'][this[_0x601f('0x11c')][_0x2bfdf5[_0x601f('0x11d')]][_0x601f('0xad')]]);this[_0x601f('0xb9')]({'active':![],'ContactId':this['actions'][_0x2bfdf5[_0x601f('0x11d')]]['ContactId'],'ListId':this[_0x601f('0x11c')][_0x2bfdf5['actionid']][_0x601f('0xf2')],'VoiceQueueId':this[_0x601f('0x11c')][_0x2bfdf5[_0x601f('0x11d')]][_0x601f('0xcd')]||undefined,'CampaignId':this['actions'][_0x2bfdf5['actionid']]['CampaignId']||undefined})['catch'](loggerCatch(_0x601f('0x132')));delete this[_0x601f('0x11c')][_0x2bfdf5[_0x601f('0x11d')]];unlockQueueStatus(_0x8d73b1);}};Dialer[_0x601f('0x17')]['loopCampaigns']=function(){var _0x3306aa=this;setInterval(function(){_0x3306aa['syncCampaigns']();},0x3e8);};Dialer['prototype']['checkIsTrunkReachable']=function(_0x44dcca){var _0x29f012=this;return function(){if(!_0x29f012[_0x601f('0xd3')](_0x44dcca[_0x601f('0x72')])){if(!_0x29f012[_0x601f('0xd3')](_0x44dcca[_0x601f('0x133')])){_0x44dcca[_0x601f('0x39')]='TRUNK_IS_NOT_REACHABLE';throw _0x44dcca[_0x601f('0x3a')]+_0x601f('0x134');}}};};Dialer['prototype']['checkIfTime']=function(_0x489665,_0x2b0f75,_0x48c8a2,_0x4ec7f8){var _0x6b6538=this;return function(){var _0x22f1bf=!![];return _0x6b6538[_0x601f('0x135')](_0x489665,_0x2b0f75,_0x48c8a2,_0x4ec7f8,_0x22f1bf);};};Dialer[_0x601f('0x17')][_0x601f('0x136')]=function(_0x43e1bc,_0x17a090,_0x171544,_0x5891bf){var _0x1c94db=this;return function(){var _0x271f29=![];return _0x1c94db[_0x601f('0x135')](_0x43e1bc[_0x601f('0x40')],_0x17a090,_0x171544,_0x5891bf,_0x271f29);};};Dialer[_0x601f('0x17')][_0x601f('0x135')]=function(_0xbbee20,_0x3712cb,_0x1df63e,_0x456a6d,_0x532523){var _0x5ea448=[];return new BPromise(function(_0x5571c7,_0x114a7e){if(!isNotNull(_0xbbee20)){_0x456a6d['message']=_0x601f('0x3f');return _0x114a7e(msgResponse(_0x601f('0x135'),_0x601f('0x137'),_0x1df63e+'\x20Intervals\x20is\x20null\x20'));}if(_[_0x601f('0x78')](_0xbbee20)){_0x456a6d['message']=_0x601f('0x138');return _0x114a7e(msgResponse(_0x601f('0x135'),_0x601f('0x137'),_0x1df63e+_0x601f('0x139')));}if(_0x3712cb&&_[_0x601f('0x38')](config[_0x601f('0x13a')][_0x3712cb])){_0x456a6d[_0x601f('0x39')]='TIMEZONE_UNKNOW';return _0x114a7e(msgResponse(_0x601f('0x135'),_0x601f('0x137'),_0x1df63e+'\x20Timezone\x20unknow\x20'+_0x3712cb));}if(_[_0x601f('0x13b')](_0xbbee20)){for(var _0x114af6=0x0;_0x114af6<_0xbbee20['length'];_0x114af6+=0x1){_0x5ea448[_0x601f('0x123')](ami['Action']({'action':_0x601f('0x13c'),'command':util[_0x601f('0x73')]('iftime\x20%s,%s',_0xbbee20[_0x114af6][_0x601f('0x13d')],!_[_0x601f('0x38')](config[_0x601f('0x13a')][_0x3712cb])?_0x3712cb:'')})[_0x601f('0xb1')](function(_0x54dfda){return _0x54dfda['content'][_0x601f('0x13e')](_0x601f('0x13f'))>=0x0;})[_0x601f('0xab')](myreject(_0x114a7e)));}}else{_0x5ea448[_0x601f('0x123')](ami[_0x601f('0x140')]({'action':_0x601f('0x13c'),'command':util['format']('iftime\x20%s,%s',_0xbbee20,!_[_0x601f('0x38')](config['timezones'][_0x3712cb])?_0x3712cb:'')})[_0x601f('0xb1')](function(_0x1e4595){return _0x1e4595['content'][_0x601f('0x13e')]('true')>=0x0;})[_0x601f('0xab')](myreject(_0x114a7e)));}BPromise[_0x601f('0x141')](_0x5ea448)[_0x601f('0xb1')](function(_0x9fd71d){var _0x4ae46a=_[_0x601f('0x142')](_0x9fd71d);if(_0x4ae46a){return _0x5571c7(_0x4ae46a);}else{_0x456a6d[_0x601f('0x39')]=_0x532523?'GLOBAL_INTERVAL_IS_OVERTIME':_0x601f('0x143');return _0x114a7e(msgResponse(_0x601f('0x144'),'Failure',_0x601f('0x145')+_0x532523+'\x20'+_0x1df63e+_0x601f('0x146')+util[_0x601f('0x92')](_0xbbee20,{'showHidden':![],'depth':null})+_0x601f('0x147')+_0x3712cb));}})['catch'](function(_0x56b186){return _0x114a7e(msgResponse(_0x601f('0x135'),_0x601f('0x137'),JSON[_0x601f('0x43')](_0x56b186)));});});};Dialer[_0x601f('0x17')]['checkDialMethod']=function(_0x4439b4){var _0x5b0c12=this;return function(){switch(_0x4439b4[_0x601f('0x53')]){case _0x601f('0x148'):freeVariablesPredictive(_0x4439b4);_0x5b0c12[_0x601f('0x149')](_0x4439b4,0x1);break;case _0x601f('0x14a'):freeVariablesPredictive(_0x4439b4);_0x5b0c12['handlePower'](_0x4439b4,_0x4439b4[_0x601f('0x14b')]);break;case _0x601f('0x14c'):_0x5b0c12[_0x601f('0x14c')](_0x4439b4);break;case _0x601f('0x14d'):freeVariablesPredictive(_0x4439b4);_0x5b0c12[_0x601f('0x149')](_0x4439b4,0x1);break;default:freeVariablesPredictive(_0x4439b4);logger['error'](_0x601f('0x14e'),_0x4439b4[_0x601f('0x3a')],_0x601f('0x14f'));}};};Dialer[_0x601f('0x17')]['launchHandleIvr']=function(_0x345e45){var _0x2c81ec=this;return function(){_0x2c81ec[_0x601f('0x150')](_0x345e45);};};Dialer[_0x601f('0x17')]['syncQueueSummary']=function(_0x42f4f9){var _0x5694ed=this;if(isNotPreview(_0x42f4f9['dialMethod'])){if(isVoiceQueueOutbound(_0x42f4f9[_0x601f('0x47')])&&isActive(_0x42f4f9[_0x601f('0x151')])){_0x42f4f9['sendMessageOneNotActive']=!![];BPromise[_0x601f('0xb0')]()[_0x601f('0xb1')](checkIsLoggedIn(_0x42f4f9,_0x42f4f9[_0x601f('0x152')]))[_0x601f('0xb1')](checkIsActive(_0x42f4f9,_0x42f4f9[_0x601f('0x151')]))[_0x601f('0xb1')](checkInterval(_0x42f4f9))[_0x601f('0xb1')](_0x5694ed['checkIsTrunkReachable'](_0x42f4f9))['then'](_0x5694ed['checkIfTime'](_0x42f4f9[_0x601f('0x153')],_0x42f4f9[_0x601f('0x154')],_0x42f4f9['name'],_0x42f4f9))[_0x601f('0xb1')](_0x5694ed['checkIfTimeIntervals'](_0x42f4f9[_0x601f('0x3e')],_0x42f4f9['dialTimezone'],_0x42f4f9['name'],_0x42f4f9))[_0x601f('0xb1')](_0x5694ed[_0x601f('0x155')](_0x42f4f9))[_0x601f('0xab')](loggerCatchQueueSummary(_0x601f('0x156'),_0x42f4f9));}else{notSendMessagesQueue(_0x42f4f9);}}else{freeVariablesPredictive(_0x42f4f9);}};Dialer['prototype'][_0x601f('0x157')]=function(){var _0xe456ea=this;var _0x2b4870;for(var _0x156d9b in this['campaigns']){if(typeof this[_0x601f('0x1d')][_0x156d9b]!=='undefined'){_0x2b4870=this[_0x601f('0x1d')][_0x156d9b];if(isCampaignIvr(_0x2b4870[_0x601f('0x47')])&&isActive(_0x2b4870[_0x601f('0xd4')])){_0x2b4870['sendMessageOneNotActive']=!![];BPromise[_0x601f('0xb0')]()[_0x601f('0xb1')](checkIsActive(_0x2b4870,_0x2b4870[_0x601f('0xd4')]))[_0x601f('0xb1')](checkInterval(_0x2b4870))[_0x601f('0xb1')](_0xe456ea[_0x601f('0x158')](_0x2b4870))[_0x601f('0xb1')](_0xe456ea[_0x601f('0x159')](_0x2b4870[_0x601f('0x153')],_0x2b4870['dialTimezone'],_0x2b4870[_0x601f('0x3a')],_0x2b4870))[_0x601f('0xb1')](_0xe456ea['checkIfTimeIntervals'](_0x2b4870[_0x601f('0x3e')],_0x2b4870['dialTimezone'],_0x2b4870[_0x601f('0x3a')],_0x2b4870))['then'](_0xe456ea[_0x601f('0x15a')](_0x2b4870))[_0x601f('0xab')](loggerCatchQueueSummary(_0x601f('0x15b'),_0x2b4870));}else{notSendMessagesCampaign(_0x2b4870);}}}};function getCallerIdRandom(_0x3c9a68,_0xa2fc8d){var _0x3429e2;var _0x2b46d1;var _0x55afcd;if(_0xa2fc8d<=0x0){_0xa2fc8d=0x1;}_0x3429e2=new RegExp(_0x601f('0x15c')+_0xa2fc8d+'}$');_0x2b46d1=Math[_0x601f('0x15d')](0xa,_0xa2fc8d-0x1);_0x55afcd=Math[_0x601f('0x15d')](0xa,_0xa2fc8d)-0x1;return util['format']('%s',_[_0x601f('0x15e')](_0x3c9a68,_0x3429e2,_[_0x601f('0x15f')](_0x2b46d1,_0x55afcd)));}function extractCalleridName(_0x5947ee){var _0x3a9c9d=_0x5947ee['match'](/"(.*?)"/);return _0x3a9c9d?_0x3a9c9d[0x1]:_0x5947ee;}function extractCalleridNumber(_0x47b47a){var _0x505eaa=_0x47b47a['match'](/<(.*?)>/);return _0x505eaa?_0x505eaa[0x1]:_0x47b47a;}Dialer[_0x601f('0x17')][_0x601f('0x160')]=function(_0x56e2ce,_0x1f94c9){var _0x164ba3=this;var _0x3db1c6=uuid['v4']();this[_0x601f('0x11c')][_0x3db1c6]=new Action(_0x56e2ce,_0x1f94c9,_0x3db1c6);return new BPromise(function(_0x58e936,_0x48146a){if(_['isUndefined'](_0x56e2ce)&&typeof _0x56e2ce!==_0x601f('0x161')){return _0x48146a(msgResponse(_0x601f('0x162'),_0x601f('0x137'),_0x601f('0x163')));}if(_[_0x601f('0x38')](_0x1f94c9['Contact'][_0x601f('0x164')])||_0x1f94c9[_0x601f('0x165')][_0x601f('0x164')]===null){return _0x48146a(msgResponse('originate','Failure',_0x601f('0x166')));}var _0x4ddb06={'XMD-CALLERID':_0x164ba3[_0x601f('0x11c')][_0x3db1c6][_0x601f('0x167')](),'XMD-AGI':_0x56e2ce[_0x601f('0x100')]?util['format'](_0x601f('0x168'),ipAgi,_0x56e2ce[_0x601f('0x100')]):_0x601f('0x169'),'XMD-AGIAFTER':_0x56e2ce['dialQueueProject2']?util['format'](_0x601f('0x168'),ipAgi,_0x56e2ce[_0x601f('0x106')]):_0x601f('0x169'),'XMD-QUEUE':_0x56e2ce[_0x601f('0x47')]===_0x601f('0x16a')?util['format']('\x22%s,%s%s,,,%s\x22',_0x56e2ce['name'],_0x56e2ce[_0x601f('0x16b')]||'',_0x56e2ce['dialAgiAfterHangupAgent']?'c':'',_0x56e2ce[_0x601f('0x10e')]||0x3):_0x601f('0x169'),'XMD-CONTACTID':_0x1f94c9['ContactId'],'XMD-CDRTYPE':_0x601f('0x16c'),'CALLERID(all)':_0x164ba3[_0x601f('0x11c')][_0x3db1c6]['getCaller'](),'XMD-AMD':_0x56e2ce[_0x601f('0xdc')]?'ACTIVE':'NONE','XMD-DESTINATION':_0x601f('0xdb')};if(_0x56e2ce['dialAMDActive']){_0x4ddb06[_0x601f('0x16d')]=_0x56e2ce[_0x601f('0x16e')]||0x9c4;_0x4ddb06[_0x601f('0x16f')]=_0x56e2ce[_0x601f('0x170')]||0x5dc;_0x4ddb06[_0x601f('0x171')]=_0x56e2ce[_0x601f('0x172')]||0x320;_0x4ddb06['XMD-AMDTOTALANALYSISTIME']=_0x56e2ce[_0x601f('0x173')]||0x1388;_0x4ddb06[_0x601f('0x174')]=_0x56e2ce[_0x601f('0x175')]||0x64;_0x4ddb06['XMD-AMDBETWEENWORDSSILENCE']=_0x56e2ce[_0x601f('0x176')]||0x32;_0x4ddb06['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x56e2ce[_0x601f('0x177')]||0x3;_0x4ddb06[_0x601f('0x178')]=_0x56e2ce[_0x601f('0x179')]||0x100;_0x4ddb06[_0x601f('0x17a')]=_0x56e2ce[_0x601f('0x17b')]||0x1388;}if(_0x56e2ce[_0x601f('0x47')]===_0x601f('0x16a')){_0x4ddb06[_0x601f('0x17c')]=_0x1f94c9[_0x601f('0xcd')];}else{_0x4ddb06[_0x601f('0x17d')]=_0x1f94c9[_0x601f('0xce')];}for(var _0x5d5c4f in _0x1f94c9['Contact']){if(typeof _0x1f94c9[_0x601f('0x165')][_0x5d5c4f]!==_0x601f('0x95')){if(isNotNull(_0x1f94c9[_0x601f('0x165')][_0x5d5c4f])&&_0x5d5c4f!=='id'&&_0x5d5c4f!=='tags'&&_0x5d5c4f!=='createdAt'&&_0x5d5c4f!=='updatedAt'){_0x4ddb06[util[_0x601f('0x73')](_0x601f('0x17e'),'XMD-',_[_0x601f('0x17f')](_0x5d5c4f))]=_0x1f94c9[_0x601f('0x165')][_0x5d5c4f];}}}var _0x3baa0e=_0x164ba3[_0x601f('0xd3')](_0x56e2ce[_0x601f('0x72')])?getCallerId(_0x56e2ce[_0x601f('0x72')][_0x601f('0x180')],_0x56e2ce['dialOriginateCallerIdName'],_0x56e2ce[_0x601f('0x181')]>0x0?getCallerIdRandom(_0x56e2ce[_0x601f('0x55')],_0x56e2ce[_0x601f('0x181')]):_0x56e2ce[_0x601f('0x55')]):getCallerId(_[_0x601f('0xa8')](_0x56e2ce[_0x601f('0x133')])?_0x56e2ce[_0x601f('0x72')]['callerid']:_0x56e2ce[_0x601f('0x133')]['callerid'],_0x56e2ce[_0x601f('0x54')],_0x56e2ce[_0x601f('0x181')]>0x0?getCallerIdRandom(_0x56e2ce[_0x601f('0x55')],_0x56e2ce[_0x601f('0x181')]):_0x56e2ce[_0x601f('0x55')]);if(_0x3baa0e){_0x4ddb06[_0x601f('0x182')]=_0x164ba3[_0x601f('0x11c')][_0x3db1c6][_0x601f('0x183')]=extractCalleridName(_0x3baa0e);_0x4ddb06[_0x601f('0x184')]=_0x164ba3[_0x601f('0x11c')][_0x3db1c6][_0x601f('0x185')]=extractCalleridNumber(_0x3baa0e);}return ami[_0x601f('0x140')]({'actionid':_0x3db1c6,'action':_0x601f('0x162'),'channel':_0x164ba3[_0x601f('0xd3')](_0x56e2ce[_0x601f('0x72')])?util[_0x601f('0x73')]('SIP/%s/%s%s',_0x56e2ce[_0x601f('0x72')][_0x601f('0x3a')],isNotNull(_0x56e2ce[_0x601f('0x186')])?_0x56e2ce[_0x601f('0x186')][_0x601f('0x187')]()||'':'',_0x56e2ce[_0x601f('0x188')]>0x0?_0x1f94c9[_0x601f('0x165')][_0x601f('0x164')][_0x601f('0x189')](_0x56e2ce[_0x601f('0x188')]):_0x1f94c9[_0x601f('0x165')][_0x601f('0x164')]):util[_0x601f('0x73')]('SIP/%s/%s%s',_[_0x601f('0xa8')](_0x56e2ce['TrunkBackup'])?_0x56e2ce['Trunk'][_0x601f('0x3a')]:_0x56e2ce[_0x601f('0x133')][_0x601f('0x3a')],isNotNull(_0x56e2ce[_0x601f('0x186')])?_0x56e2ce['dialPrefix'][_0x601f('0x187')]()||'':'',_0x56e2ce['dialCutDigit']>0x0?_0x1f94c9[_0x601f('0x165')]['phone'][_0x601f('0x189')](_0x56e2ce[_0x601f('0x188')]):_0x1f94c9[_0x601f('0x165')][_0x601f('0x164')]),'callerid':_0x3baa0e,'Exten':_0x601f('0xdb'),'Context':_0x601f('0x18a'),'Priority':'1','variable':_0x4ddb06,'timeout':(_0x56e2ce[_0x601f('0x56')]||0x1e)*0x3e8,'async':!![],'channelid':_0x3db1c6})[_0x601f('0xb1')](function(_0x38c0c7){return _0x58e936(_0x38c0c7);})[_0x601f('0xab')](function(_0x4e5a04){_0x56e2ce[_0x601f('0x5f')]+=0x1;var _0x100603=new History(_0x164ba3[_0x601f('0x11c')][_0x3db1c6]);logger['error'](util[_0x601f('0x73')](_0x601f('0x18b'),JSON[_0x601f('0x43')](_0x4e5a04)));_0x100603[_0x601f('0xde')]=0xe;_0x100603[_0x601f('0xa3')]='OriginateError';_0x100603[_0x601f('0xa4')]=moment()['format'](_0x601f('0xf1'));_0x100603[_0x601f('0x114')]=_0x100603[_0x601f('0xa4')];_0x164ba3[_0x601f('0xc3')](_0x100603)[_0x601f('0xab')](loggerCatch('[originate][error]'));_0x164ba3[_0x601f('0xc1')](_0x100603)[_0x601f('0xab')](loggerCatch(_0x601f('0x18c')))[_0x601f('0x19')](function(){delete _0x164ba3[_0x601f('0x11c')][_0x3db1c6];return _0x48146a(msgResponse(_0x601f('0x162'),_0x601f('0x42'),_0x601f('0x18d')));});});});};Dialer[_0x601f('0x17')][_0x601f('0x2b')]=function(_0xe2ef97){var _0x132503=this[_0x601f('0x11c')][_0xe2ef97[_0x601f('0x11d')]];if(_0x132503){delete this[_0x601f('0x11c')][_0xe2ef97[_0x601f('0x11d')]];_0x132503[_0x601f('0x18e')]=moment()[_0x601f('0x73')](_0x601f('0xf1'));var _0x2c47a6=_0x132503[_0x601f('0x47')]===_0x601f('0xac')?this['campaigns'][_0x132503[_0x601f('0xad')]]:this[_0x601f('0x1c')][_0x132503[_0x601f('0x18f')]()];if(!this[_0x601f('0xd1')](_0xe2ef97['response'])){this[_0x601f('0xae')](_0x2c47a6);return this[_0x601f('0x190')](_0x132503,_0x2c47a6,_0xe2ef97)['catch'](loggerCatch(_0x601f('0x191')));}this[_0x601f('0x23')][_0xe2ef97['uniqueid']]=_0x132503;}};Dialer['prototype'][_0x601f('0x192')]=function(_0x1efda9,_0x709e6,_0x1fc499){var _0x4ab07d=new History(_0x709e6);if(_0x4ab07d[_0x601f('0xe6')]+_0x4ab07d[_0x601f('0xf8')]+_0x4ab07d['countnoanswerretry']+_0x4ab07d[_0x601f('0x193')]+_0x4ab07d[_0x601f('0xe7')]+_0x4ab07d[_0x601f('0xfa')]+_0x4ab07d['countmachineretry']+_0x4ab07d['countagentrejectretry']>=_0x1fc499['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x1efda9){case 0x3:if(_0x4ab07d[_0x601f('0xf9')]>=_0x1fc499['dialNoAnswerMaxRetry']-0x1){return!![];}this[_0x601f('0xb9')]({'active':![],'countnoanswerretry':_0x4ab07d[_0x601f('0xf9')]+=0x1,'scheduledat':moment()['add'](_0x1fc499[_0x601f('0x194')],_0x601f('0xf0'))['format'](_0x601f('0xf1')),'ContactId':_0x4ab07d[_0x601f('0xcb')],'ListId':_0x4ab07d[_0x601f('0xf2')],'VoiceQueueId':_0x4ab07d[_0x601f('0xcd')]||undefined,'CampaignId':_0x4ab07d[_0x601f('0xce')]||undefined})['catch'](loggerCatch(_0x601f('0x195')));break;case 0x5:if(_0x4ab07d[_0x601f('0xe6')]>=_0x1fc499[_0x601f('0x196')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x4ab07d[_0x601f('0xe6')]+=0x1,'scheduledat':moment()[_0x601f('0xee')](_0x1fc499[_0x601f('0x197')],_0x601f('0xf0'))[_0x601f('0x73')](_0x601f('0xf1')),'ContactId':_0x4ab07d['ContactId'],'ListId':_0x4ab07d[_0x601f('0xf2')],'VoiceQueueId':_0x4ab07d['VoiceQueueId']||undefined,'CampaignId':_0x4ab07d[_0x601f('0xce')]||undefined})[_0x601f('0xab')](loggerCatch(_0x601f('0x198')));break;case 0x8:if(_0x4ab07d[_0x601f('0xf8')]>=_0x1fc499[_0x601f('0x199')]-0x1){return!![];}this[_0x601f('0xb9')]({'active':![],'countcongestionretry':_0x4ab07d[_0x601f('0xf8')]+=0x1,'scheduledat':moment()[_0x601f('0xee')](_0x1fc499[_0x601f('0x19a')],'minutes')[_0x601f('0x73')](_0x601f('0xf1')),'ContactId':_0x4ab07d[_0x601f('0xcb')],'ListId':_0x4ab07d[_0x601f('0xf2')],'VoiceQueueId':_0x4ab07d['VoiceQueueId']||undefined,'CampaignId':_0x4ab07d[_0x601f('0xce')]||undefined})['catch'](loggerCatch(_0x601f('0x19b')));break;case 0x0:if(_0x4ab07d[_0x601f('0x193')]>=_0x1fc499[_0x601f('0x19c')]-0x1){return!![];}else{this[_0x601f('0xb9')]({'active':![],'countnosuchnumberretry':_0x4ab07d[_0x601f('0x193')]+=0x1,'scheduledat':moment()[_0x601f('0xee')](_0x1fc499['dialNoSuchNumberRetryFrequency'],_0x601f('0xf0'))[_0x601f('0x73')](_0x601f('0xf1')),'ContactId':_0x4ab07d[_0x601f('0xcb')],'ListId':_0x4ab07d['ListId'],'VoiceQueueId':_0x4ab07d[_0x601f('0xcd')]||undefined,'CampaignId':_0x4ab07d[_0x601f('0xce')]||undefined})[_0x601f('0xab')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x4ab07d['countdropretry']>=_0x1fc499['dialDropMaxRetry']-0x1){return!![];}this[_0x601f('0xb9')]({'active':![],'countdropretry':_0x4ab07d[_0x601f('0xe7')]+=0x1,'scheduledat':moment()[_0x601f('0xee')](_0x1fc499[_0x601f('0x112')],_0x601f('0xf0'))[_0x601f('0x73')](_0x601f('0xf1')),'ContactId':_0x4ab07d['ContactId'],'ListId':_0x4ab07d[_0x601f('0xf2')],'VoiceQueueId':_0x4ab07d['VoiceQueueId']||undefined,'CampaignId':_0x4ab07d[_0x601f('0xce')]||undefined})['catch'](loggerCatch(_0x601f('0x113')));break;case 0xb:if(_0x4ab07d[_0x601f('0xfa')]>=_0x1fc499[_0x601f('0x119')]-0x1){return!![];}this[_0x601f('0xb9')]({'active':![],'countabandonedretry':_0x4ab07d['countabandonedretry']+=0x1,'scheduledat':moment()[_0x601f('0xee')](_0x1fc499[_0x601f('0x19d')],_0x601f('0xf0'))[_0x601f('0x73')](_0x601f('0xf1')),'ContactId':_0x4ab07d['ContactId'],'ListId':_0x4ab07d['ListId'],'VoiceQueueId':_0x4ab07d[_0x601f('0xcd')]||undefined,'CampaignId':_0x4ab07d[_0x601f('0xce')]||undefined})[_0x601f('0xab')](loggerCatch(_0x601f('0x19e')));break;case 0x13:if(_0x4ab07d['countmachineretry']>=_0x1fc499[_0x601f('0xec')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countmachineretry':_0x4ab07d[_0x601f('0xe8')]+=0x1,'scheduledat':moment()[_0x601f('0xee')](_0x1fc499[_0x601f('0xef')],_0x601f('0xf0'))[_0x601f('0x73')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4ab07d[_0x601f('0xcb')],'ListId':_0x4ab07d[_0x601f('0xf2')],'VoiceQueueId':_0x4ab07d[_0x601f('0xcd')]||undefined,'CampaignId':_0x4ab07d[_0x601f('0xce')]||undefined})[_0x601f('0xab')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x4ab07d['countagentrejectretry']>=_0x1fc499[_0x601f('0x19f')]-0x1){return!![];}this[_0x601f('0xb9')]({'active':![],'countagentrejectretry':_0x4ab07d[_0x601f('0xe9')]+=0x1,'scheduledat':moment()['add'](_0x1fc499['dialAgentRejectRetryFrequency'],_0x601f('0xf0'))[_0x601f('0x73')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4ab07d['ContactId'],'ListId':_0x4ab07d[_0x601f('0xf2')],'VoiceQueueId':_0x4ab07d[_0x601f('0xcd')]||undefined,'CampaignId':_0x4ab07d[_0x601f('0xce')]||undefined})['catch'](loggerCatch(_0x601f('0x1a0')));break;default:return!![];}};Dialer[_0x601f('0x17')][_0x601f('0x190')]=function(_0x9894d2,_0x34df06,_0x5a43ec){var _0x4c59e7=this;var _0x1eeee1=new History(_0x9894d2);return new BPromise(function(_0x2fdfe4,_0x5f3bea){if(_[_0x601f('0x38')](_0x34df06)&&typeof _0x34df06!==_0x601f('0x161')){return _0x5f3bea(msgResponse('[callProgressDetecting]','Failure','entity\x20is\x20undefine'));}if(_[_0x601f('0x38')](_0x5a43ec)&&typeof _0x5a43ec!==_0x601f('0x161')){return _0x5f3bea(msgResponse(_0x601f('0x1a1'),'Failure',_0x601f('0x1a2')));}switch(_0x5a43ec[_0x601f('0x103')]){case'0':_0x34df06[_0x601f('0x5e')]+=0x1;_0x1eeee1[_0x601f('0xde')]=0x0;_0x1eeee1['statedesc']=_0x601f('0x1a3');_0x1eeee1[_0x601f('0x193')]+=0x1;_0x1eeee1[_0x601f('0xf7')]+=0x1;ami[_0x601f('0x46')](_0x601f('0x1a4'),ut[_0x601f('0x1a5')](_0x9894d2,'nosuchnumber'));_0x4c59e7[_0x601f('0xc3')](_0x1eeee1)[_0x601f('0xab')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x4c59e7['checkRetriveMax'](0x0,_0x9894d2,_0x34df06)){if(_0x1eeee1['countnosuchnumberretry']>=_0x34df06[_0x601f('0x19c')]){_0x4c59e7[_0x601f('0xed')](_0x1eeee1,_0x2fdfe4,_0x5f3bea,_0x601f('0x1a6'));}else{_0x4c59e7[_0x601f('0xeb')](_0x1eeee1,_0x2fdfe4,_0x5f3bea,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x34df06[_0x601f('0x5d')]+=0x1;_0x1eeee1['state']=0x3;_0x1eeee1[_0x601f('0xa3')]=_0x601f('0x1a7');_0x1eeee1[_0x601f('0xf9')]+=0x1;_0x1eeee1[_0x601f('0xf7')]+=0x1;ami[_0x601f('0x46')](_0x601f('0x1a8'),ut[_0x601f('0x1a5')](_0x9894d2,_0x601f('0x1a9')));_0x4c59e7[_0x601f('0xc3')](_0x1eeee1)[_0x601f('0xab')](loggerCatch(_0x601f('0x1aa')));if(_0x4c59e7['checkRetriveMax'](0x3,_0x9894d2,_0x34df06)){if(_0x1eeee1[_0x601f('0xf9')]>=_0x34df06[_0x601f('0x1ab')]){_0x4c59e7[_0x601f('0xed')](_0x1eeee1,_0x2fdfe4,_0x5f3bea,_0x601f('0x1ac'));}else{_0x4c59e7['stateGlobal'](_0x1eeee1,_0x2fdfe4,_0x5f3bea,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x34df06[_0x601f('0x5a')]+=0x1;_0x1eeee1['state']=0x5;_0x1eeee1[_0x601f('0xa3')]=_0x601f('0x1ad');_0x1eeee1[_0x601f('0xe6')]+=0x1;_0x1eeee1[_0x601f('0xf7')]+=0x1;ami['emit'](_0x601f('0x1ae'),ut[_0x601f('0x1a5')](_0x9894d2,_0x601f('0x1af')));_0x4c59e7[_0x601f('0xc3')](_0x1eeee1)['catch'](loggerCatch(_0x601f('0x1b0')));if(_0x4c59e7[_0x601f('0x192')](0x5,_0x9894d2,_0x34df06)){if(_0x1eeee1[_0x601f('0xe6')]>=_0x34df06['dialBusyMaxRetry']){_0x4c59e7[_0x601f('0xed')](_0x1eeee1,_0x2fdfe4,_0x5f3bea,_0x601f('0x1b1'));}else{_0x4c59e7['stateGlobal'](_0x1eeee1,_0x2fdfe4,_0x5f3bea,_0x601f('0x1b1'));}}break;case'8':_0x34df06[_0x601f('0x5b')]+=0x1;_0x1eeee1['state']=0x8;_0x1eeee1[_0x601f('0xa3')]=_0x601f('0x1b2');_0x1eeee1[_0x601f('0xf8')]+=0x1;_0x1eeee1['countglobal']+=0x1;ami['emit'](_0x601f('0x1b3'),ut[_0x601f('0x1a5')](_0x9894d2,'congestion'));_0x4c59e7[_0x601f('0xc3')](_0x1eeee1)[_0x601f('0xab')](loggerCatch(_0x601f('0x1b4')));if(_0x4c59e7['checkRetriveMax'](0x8,_0x9894d2,_0x34df06)){if(_0x1eeee1[_0x601f('0xf8')]>=_0x34df06[_0x601f('0x199')]){_0x4c59e7[_0x601f('0xed')](_0x1eeee1,_0x2fdfe4,_0x5f3bea,_0x601f('0x1b5'));}else{_0x4c59e7[_0x601f('0xeb')](_0x1eeee1,_0x2fdfe4,_0x5f3bea,_0x601f('0x1b5'));}}break;case'11':_0x34df06[_0x601f('0x1b6')]+=0x1;_0x1eeee1['state']=0xb;_0x1eeee1[_0x601f('0xa3')]=_0x601f('0x117');_0x1eeee1[_0x601f('0xfa')]+=0x1;_0x1eeee1[_0x601f('0xf7')]+=0x1;_0x4c59e7[_0x601f('0xc3')](_0x1eeee1)[_0x601f('0xab')](loggerCatch(_0x601f('0x11b')));if(_0x4c59e7[_0x601f('0x192')](0xb,_0x9894d2,_0x34df06)){if(_0x1eeee1['countabandonedretry']>=_0x34df06[_0x601f('0x119')]){_0x4c59e7[_0x601f('0xed')](_0x1eeee1,_0x2fdfe4,_0x5f3bea,'reason\x2011\x20abandoned');}else{_0x4c59e7[_0x601f('0xeb')](_0x1eeee1,_0x2fdfe4,_0x5f3bea,_0x601f('0x1b7'));}}break;case'20':_0x34df06[_0x601f('0x61')]+=0x1;_0x1eeee1[_0x601f('0xde')]=0x14;_0x1eeee1[_0x601f('0xa3')]='AgentReject';_0x1eeee1[_0x601f('0xe9')]+=0x1;_0x1eeee1[_0x601f('0xf7')]+=0x1;ami[_0x601f('0x46')]('custom:agentreject',ut[_0x601f('0x1a5')](_0x9894d2,'agentreject'));_0x4c59e7[_0x601f('0xc3')](_0x1eeee1)[_0x601f('0xab')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x4c59e7['checkRetriveMax'](0x14,_0x9894d2,_0x34df06)){if(_0x1eeee1[_0x601f('0xe9')]>=_0x34df06[_0x601f('0x19f')]){_0x4c59e7[_0x601f('0xed')](_0x1eeee1,_0x2fdfe4,_0x5f3bea,'reason\x2020\x20agentreject');}else{_0x4c59e7[_0x601f('0xeb')](_0x1eeee1,_0x2fdfe4,_0x5f3bea,_0x601f('0x1b8'));}}break;default:_0x34df06['outboundUnknownCallsDay']+=0x1;_0x1eeee1[_0x601f('0xde')]=0xc;_0x1eeee1[_0x601f('0xa3')]=_0x5a43ec[_0x601f('0x103')];_0x4c59e7[_0x601f('0xc3')](_0x1eeee1)[_0x601f('0xab')](loggerCatch(_0x601f('0x1b9')));if(_0x4c59e7[_0x601f('0x192')](_0x5a43ec[_0x601f('0x103')],_0x9894d2,_0x34df06)){if(_0x1eeee1[_0x601f('0xe6')]+_0x1eeee1[_0x601f('0xf8')]+_0x1eeee1[_0x601f('0xf9')]+_0x1eeee1[_0x601f('0x193')]+_0x1eeee1[_0x601f('0xe7')]+_0x1eeee1[_0x601f('0xfa')]+_0x1eeee1[_0x601f('0xe8')]+_0x1eeee1[_0x601f('0xe9')]>=_0x34df06[_0x601f('0xea')]){_0x4c59e7[_0x601f('0xeb')](_0x1eeee1,_0x2fdfe4,_0x5f3bea,_0x5a43ec[_0x601f('0x103')]);}else{_0x4c59e7['createStateFinal'](_0x1eeee1,_0x2fdfe4,_0x5f3bea,_0x5a43ec[_0x601f('0x103')]);}}}});};Dialer[_0x601f('0x17')][_0x601f('0xeb')]=function(_0x57c5a6,_0x398916,_0x122031,_0x53cb18){var _0xb12325=new Final(_0x57c5a6);_0xb12325[_0x601f('0xde')]=0xf;_0xb12325[_0x601f('0xa3')]=_0x601f('0x1ba');this['createStateFinal'](_0xb12325,_0x398916,_0x122031,_0x53cb18);};Dialer['prototype'][_0x601f('0xed')]=function(_0x22d388,_0x3478d4,_0x10480e,_0x1db639){this[_0x601f('0xc1')](_0x22d388)[_0x601f('0xb1')](function(){return _0x3478d4(msgResponse(_0x601f('0x1a1'),_0x601f('0xd2'),_0x1db639));})[_0x601f('0xab')](function(){return _0x10480e(msgResponse(_0x601f('0x1bb'),'Failure',_0x601f('0x1bc')));});};Dialer[_0x601f('0x17')]['predictive']=function(_0x579620){var _0x5e23b8=_0x579620['dialPredictiveOptimizationPercentage']/0x64;var _0x5a609f=_0x579620[_0x601f('0x5c')]/(_0x579620[_0x601f('0x5c')]+_0x579620[_0x601f('0x58')]);var _0x34ca5b=Math[_0x601f('0x1bd')](_0x579620[_0x601f('0x6b')]*(_0x579620[_0x601f('0x1be')]/0x64));var _0x3c16b7=Math[_0x601f('0x1bd')](_0x579620[_0x601f('0x6b')]*(_0x579620['predictiveIntervalMinThreshold']/0x64));var _0x431bab=_0x579620[_0x601f('0x49')]+_0x579620[_0x601f('0x4e')];var _0x3c70be=Math[_0x601f('0x1bf')](_0x579620[_0x601f('0x6e')]*_0x579620[_0x601f('0x70')]*_0x579620[_0x601f('0x1c0')]*_0x579620[_0x601f('0x69')]);if(_[_0x601f('0x38')](_0x579620[_0x601f('0x25')])){if(!_[_0x601f('0x38')](_0x579620[_0x601f('0x24')])){_0x579620[_0x601f('0x24')]=undefined;loggerPredictive[_0x601f('0x93')](_0x601f('0x1c1'),_0x601f('0x1c2'));}if(!_['isUndefined'](_0x579620[_0x601f('0x8e')])){loggerPredictive[_0x601f('0x93')]('[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x579620['handlePredictive']);_0x579620['handlePredictive']=undefined;}_0x579620['startProgressive']=moment()['format'](_0x601f('0xf1'));loggerPredictive[_0x601f('0x79')](_0x579620[_0x601f('0x3a')],_0x601f('0x1c3'),_0x579620[_0x601f('0x25')]);this[_0x601f('0x149')](_0x579620,0x1);}else if(ifInterval(_0x579620['dialPredictiveInterval'],_0x579620[_0x601f('0x25')])){this[_0x601f('0x149')](_0x579620,0x1);loggerPredictiveCalls[_0x601f('0x79')](_0x601f('0x1c4'),_0x579620[_0x601f('0x25')],_0x579620[_0x601f('0x3a')]);_0x579620[_0x601f('0x6e')]=0x0;_0x579620[_0x601f('0x68')]=0x0;}else if(_0x5e23b8<_0x5a609f&&_0x579620['dialPredictiveOptimization']===_0x601f('0x1c5')){freeVariablesPredictive(_0x579620);loggerPredictive[_0x601f('0x79')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0x601f('0x1c6'),_0x5a609f,'startProgressive',_0x579620['name']);}else if(_0x3c70be<_0x579620[_0x601f('0x68')]&&_0x579620[_0x601f('0x1c7')]===_0x601f('0x1c5')){freeVariablesPredictive(_0x579620);loggerPredictive[_0x601f('0x79')](_0x601f('0x1c8'),'Max\x20Drop\x20',_0x3c70be,_0x601f('0x1c9'),_0x579620[_0x601f('0x68')],'startProgressive',_0x579620[_0x601f('0x3a')]);}else if(!ifInterval(_0x579620[_0x601f('0x1ca')],_0x579620[_0x601f('0x25')])&&_[_0x601f('0x38')](_0x579620[_0x601f('0x24')])&&!_[_0x601f('0x38')](_0x579620[_0x601f('0x25')])){_0x579620['startPredictive']=moment()[_0x601f('0x73')](_0x601f('0xf1'));loggerPredictive['info'](_0x579620[_0x601f('0x3a')],_0x601f('0x1cb'),_0x579620[_0x601f('0x24')]);this[_0x601f('0xb6')](_0x579620[_0x601f('0x1ca')])[_0x601f('0xb1')](this['getDataPredictive'](_0x579620))[_0x601f('0xb1')](mergeDataErlangB(_0x579620))['then'](this[_0x601f('0x1cc')](_0x579620))[_0x601f('0xab')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x579620));}else if(!ifInterval(_0x579620[_0x601f('0x1ca')],_0x579620[_0x601f('0x24')])){_0x579620[_0x601f('0x68')]=0x0;_0x579620[_0x601f('0x24')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x579620['name'],'recalculate\x20predictive\x20at',_0x579620[_0x601f('0x24')]);clearInterval(_0x579620['handlePredictive']);_0x579620[_0x601f('0x8e')]=undefined;this[_0x601f('0xb6')](_0x579620['dialPredictiveInterval'])[_0x601f('0xb1')](this[_0x601f('0x1cd')](_0x579620))[_0x601f('0xb1')](mergeDataErlangB(_0x579620))[_0x601f('0xb1')](this[_0x601f('0x1cc')](_0x579620))['catch'](loggerCatchPredictive(_0x601f('0x1ce'),_0x579620));}else if(_0x579620['predictiveIntervalAvailable']&&_0x431bab<_0x579620[_0x601f('0x6b')]-_0x3c16b7){freeVariablesPredictive(_0x579620);loggerPredictive[_0x601f('0x79')](_0x579620['name'],_0x601f('0x1cf'),_0x431bab,')\x20are\x20less\x20than\x20threshold\x20(',_0x579620[_0x601f('0x6b')],'-',_0x3c16b7,'=',_0x579620[_0x601f('0x6b')]-_0x3c16b7,')');}else if(_0x579620[_0x601f('0x6b')]&&_0x431bab>_0x579620[_0x601f('0x6b')]+_0x34ca5b){freeVariablesPredictive(_0x579620);loggerPredictive[_0x601f('0x79')](_0x579620['name'],_0x601f('0x1cf'),_0x431bab,_0x601f('0x1d0'),_0x579620['predictiveIntervalAvailable'],'+',_0x34ca5b,'=',_0x579620['predictiveIntervalAvailable']+_0x34ca5b,')');}};Dialer['prototype'][_0x601f('0x1cd')]=function(_0x3c4f88){var _0x2459a9=this;return function(_0xd47773){return new BPromise(function(_0x1a7428,_0x2fa1e4){_[_0x601f('0x8b')](_0x3c4f88,_0xd47773[0x0]);if(checkGetDataPredictive(_0xd47773[0x0])){var _0x4851fe=_0x3c4f88[_0x601f('0x6b')]=_0x3c4f88[_0x601f('0x4e')]+_0x3c4f88[_0x601f('0x49')];var _0x29eb42=_0x3c4f88[_0x601f('0x1ca')]*0x3c;var _0x2f259c=_0xd47773[0x0][_0x601f('0x81')]+_0xd47773[0x0][_0x601f('0x64')];var _0x2fb8f9=(_0xd47773[0x0]['predictiveIntervalAnsweredCalls']+_0xd47773[0x0][_0x601f('0x66')]+_0xd47773[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0xd47773[0x0]['predictiveIntervalTotalCalls'];_0x3c4f88[_0x601f('0x1c0')]=_0x2fb8f9>0x0?_0x2fb8f9:0x1;switch(_0x3c4f88[_0x601f('0x1c7')]){case _0x601f('0x1c5'):var _0x3bf33f=_0x3c4f88[_0x601f('0x1d1')]/0x64;return _0x2459a9[_0x601f('0x1d2')](_0x4851fe,_0x29eb42,_0x2f259c,_0x2fb8f9,_0x3bf33f)['then'](function(_0x2a7be4){return _0x1a7428(_0x2a7be4);});case _0x601f('0x1d3'):var _0x36e434=_0x3c4f88[_0x601f('0x1d1')]/0x64;return _0x2459a9['busyFactor'](_0x4851fe,_0x29eb42,_0x2f259c,_0x2fb8f9,_0x36e434)[_0x601f('0xb1')](function(_0x3d54d2){return _0x1a7428(_0x3d54d2);});default:return _0x2fa1e4(msgResponse(_0x601f('0x1d4'),'Failure',_0x601f('0x1d5')));}}else{return _0x2fa1e4(msgResponse('[getDataPredictive]',_0x601f('0x137'),'check\x20failure'));}});};};Dialer[_0x601f('0x17')]['getDataPredictiveOld']=function(_0x311f0e){var _0x5c0bbd=this;return function(_0xf09d34){return new BPromise(function(_0x142426,_0x50ba38){_['merge'](_0x311f0e,_0xf09d34[0x0]);if(checkGetDataPredictive(_0xf09d34[0x0])){loggerPredictive[_0x601f('0x79')](JSON[_0x601f('0x43')](_0xf09d34[0x0]));if(_0x311f0e['dialPredictiveOptimization']===_0x601f('0x1c5')){return _0x5c0bbd[_0x601f('0x1d6')](_0x311f0e['id'])[_0x601f('0xb1')](function(_0x3d9be2){var _0x2763c4=_0x311f0e[_0x601f('0x152')]-_0x3d9be2[0x0][_0x601f('0x1d7')];var _0x375f07=_0x311f0e['dialPredictiveInterval']*0x3c;var _0x21306c=_0xf09d34[0x0][_0x601f('0x81')]+_0xf09d34[0x0][_0x601f('0x64')];var _0xca68f1=(_0xf09d34[0x0][_0x601f('0x63')]+_0xf09d34[0x0][_0x601f('0x66')]+_0xf09d34[0x0][_0x601f('0x65')])/_0xf09d34[0x0][_0x601f('0x6c')];var _0x2d15b7=_0x311f0e[_0x601f('0x1d1')]/0x64;_0x311f0e[_0x601f('0x6a')]=_0x3d9be2[0x0]['outboundQueuePauses']||0x0;_0x311f0e['predictiveIntervalHitRate']=_0xca68f1>0x0?_0xca68f1:0x1;return _0x5c0bbd[_0x601f('0x1d2')](_0x2763c4,_0x375f07,_0x21306c,_0xca68f1,_0x2d15b7);})[_0x601f('0xb1')](function(_0x12274e){return _0x142426(_0x12274e);})[_0x601f('0xab')](function(_0xff825c){return _0x50ba38(msgResponse(_0x601f('0x1d8'),_0x601f('0x137'),JSON[_0x601f('0x43')](_0xff825c)));});}if(_0x311f0e[_0x601f('0x1c7')]===_0x601f('0x1d3')){return _0x5c0bbd[_0x601f('0x1d6')](_0x311f0e['id'])[_0x601f('0xb1')](function(_0x291f28){var _0x401a6d=_0x311f0e[_0x601f('0x152')]-_0x291f28[0x0][_0x601f('0x1d7')];var _0x326e5e=_0x311f0e[_0x601f('0x1ca')]*0x3c;var _0x12b2ae=_0xf09d34[0x0][_0x601f('0x81')]+_0xf09d34[0x0]['predictiveIntervalAvgHoldtime'];var _0x50c6cc=(_0xf09d34[0x0][_0x601f('0x63')]+_0xf09d34[0x0]['predictiveIntervalDroppedCallsTimeout']+_0xf09d34[0x0][_0x601f('0x65')])/_0xf09d34[0x0][_0x601f('0x6c')];var _0x1924c7=_0x311f0e[_0x601f('0x1d1')]/0x64;_0x311f0e[_0x601f('0x6a')]=_0x291f28[0x0][_0x601f('0x1d7')]||0x0;_0x311f0e[_0x601f('0x1c0')]=_0x50c6cc>0x0?_0x50c6cc:0x1;return _0x5c0bbd[_0x601f('0x1d9')](_0x401a6d,_0x326e5e,_0x12b2ae,_0x50c6cc,_0x1924c7);})[_0x601f('0xb1')](function(_0x38813a){return _0x142426(_0x38813a);})[_0x601f('0xab')](function(_0xc21b53){return _0x50ba38(msgResponse('[CatchErlangB]','Failure',JSON[_0x601f('0x43')](_0xc21b53)));});}}else{return _0x50ba38(msgResponse(_0x601f('0x1d4'),_0x601f('0x137'),_0x601f('0x1da')));}});};};Dialer[_0x601f('0x17')][_0x601f('0x1cc')]=function(_0x50568c){var _0x36a51b=this;return function(){var _0x162ae5=0x0;var _0x340002=Math[_0x601f('0x1bf')](_0x50568c[_0x601f('0x6f')]*0x3e8);if(_0x340002>0x0){_0x340002=_0x340002<0x64?0x64:_0x340002;loggerPredictive[_0x601f('0x79')](_0x50568c[_0x601f('0x3a')],'one\x20call\x20every:',_0x340002,'milliseconds');_0x50568c[_0x601f('0x8e')]=setInterval(function(){_0x36a51b['handlePredictive'](_0x50568c);loggerPredictiveCalls[_0x601f('0x79')]('[handlePredictive]',_0x162ae5+=0x1);},_0x340002);}else{loggerPredictive[_0x601f('0x79')](_0x50568c[_0x601f('0x3a')],_0x601f('0x1db'));}};};Dialer[_0x601f('0x17')][_0x601f('0x1dc')]=function(_0x3018b1,_0xb8bab5){var _0x369512=this;return function(_0x446bee){if(_['isEmpty'](_0x446bee)){if(_['isNil'](_0xb8bab5[_0x601f('0xcc')])||!_0xb8bab5[_0x601f('0x1dd')]){if(_0x3018b1[_0x601f('0x53')]===_0x601f('0x14d')){_0x3018b1['queueStatusComplete']=_[_0x601f('0x38')](_0x3018b1[_0x601f('0x125')])?!![]:_0x3018b1[_0x601f('0x125')];var _0x1c6253=uuid['v4']();_0x369512['actions'][_0x1c6253]=new Action(_0x3018b1,_0xb8bab5,_0x1c6253);loggerBooked[_0x601f('0x79')]('[booked][checkContactBlack]',_0x1c6253,_0x601f('0x1de'),JSON[_0x601f('0x43')](_0x3018b1[_0x601f('0x125')]),'Queue:\x20',_0x3018b1[_0x601f('0x3a')]);if(_0x3018b1[_0x601f('0x125')]){_0x3018b1[_0x601f('0x125')]=![];_0x369512[_0x601f('0x122')][_0x369512['actions'][_0x1c6253]['queue']]=[];ami['Action']({'actionid':_0x1c6253,'action':'queuestatus','queue':_0x3018b1['name']})[_0x601f('0xab')](function(){_0x369512[_0x601f('0xae')](_0x3018b1);_0x369512['rescheduleContact']({'active':![],'ContactId':_0x369512[_0x601f('0x11c')][_0x1c6253][_0x601f('0xcb')],'ListId':_0x369512[_0x601f('0x11c')][_0x1c6253][_0x601f('0xf2')],'VoiceQueueId':_0x369512[_0x601f('0x11c')][_0x1c6253][_0x601f('0xcd')]||undefined,'CampaignId':_0x369512[_0x601f('0x11c')][_0x1c6253][_0x601f('0xce')]||undefined})[_0x601f('0xab')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x369512['actions'][_0x1c6253];});}else{loggerBooked[_0x601f('0x79')](_0x601f('0x1df'),JSON[_0x601f('0x43')](_0x3018b1[_0x601f('0x125')]),_0x601f('0x1e0'),_0x3018b1[_0x601f('0x3a')]);_0x369512[_0x601f('0xae')](_0x3018b1);_0x369512['rescheduleContact']({'active':![],'ContactId':_0x369512[_0x601f('0x11c')][_0x1c6253][_0x601f('0xcb')],'ListId':_0x369512['actions'][_0x1c6253][_0x601f('0xf2')],'VoiceQueueId':_0x369512['actions'][_0x1c6253][_0x601f('0xcd')]||undefined,'CampaignId':_0x369512[_0x601f('0x11c')][_0x1c6253]['CampaignId']||undefined})['catch'](loggerCatch(_0x601f('0x1e1')));delete _0x369512[_0x601f('0x11c')][_0x1c6253];}}else{return _0x369512['actionOriginate'](_0x3018b1,_0xb8bab5);}}else{if(getDiff(_0xb8bab5[_0x601f('0x1e2')])<_0x3018b1[_0x601f('0x1e3')]*0x3c){if(_0xb8bab5['Agent']&&!_0xb8bab5['Agent'][_0x601f('0x1e4')]){_0x369512[_0x601f('0x1b')][_0x601f('0x127')](_0xb8bab5['id'])[_0x601f('0x19')](function(){_0x369512[_0x601f('0xae')](_0x3018b1);});}else{_0x369512[_0x601f('0xbb')]({'active':![]},_0xb8bab5['id'],0x1)[_0x601f('0x19')](function(){_0x369512[_0x601f('0xae')](_0x3018b1);});}}else{_0x3018b1['outboundReCallsDay']+=0x1;_0x369512[_0x601f('0xae')](_0x3018b1);if(_0x3018b1[_0x601f('0x1e5')]){_0x369512[_0x601f('0xb9')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0xb8bab5[_0x601f('0xcb')],'ListId':_0xb8bab5[_0x601f('0xf2')],'VoiceQueueId':_0xb8bab5[_0x601f('0xcd')]||undefined,'CampaignId':_0xb8bab5[_0x601f('0xce')]||undefined})[_0x601f('0xab')](loggerCatch(_0x601f('0x1e6')));_0x369512[_0x601f('0xc3')](createObjHistory(_0x3018b1,_0xb8bab5,'RECALLINQUEUE',0x17,_0x601f('0x1e7')))[_0x601f('0xab')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x369512[_0x601f('0xc9')](createObjHistory(_0x3018b1,_0xb8bab5,_0x601f('0x1e8'),0x16,_0x601f('0x1e9')),'[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]');}}}}else{_0x3018b1[_0x601f('0x59')]+=0x1;_0x369512[_0x601f('0xc9')](createObjHistory(_0x3018b1,_0xb8bab5,_0x601f('0x1ea'),0xd,_0x601f('0x1eb')),_0x601f('0x1ec'),_0x601f('0x1ed'));throw'inBlackList';}};};Dialer[_0x601f('0x17')]['handleIvr']=function(_0x521f86){var _0x2c7b88=this;var _0x40db24=_0x521f86['limitCalls']-_0x521f86[_0x601f('0x6d')]-_0x521f86[_0x601f('0x1ee')];emitCampaignSummary(_0x521f86);if(_0x40db24>0x0){if(_0x40db24>this[_0x601f('0x20')]){_0x40db24=this[_0x601f('0x20')];}_0x521f86['temp']+=_0x40db24;this[_0x601f('0xbf')](_0x521f86['id'],_0x40db24,_0x521f86['dialOrderByScheduledAt'])['then'](function(_0x6c711b){_0x521f86['temp']-=_0x40db24;_0x521f86[_0x601f('0x1ee')]=_0x521f86[_0x601f('0x1ee')]>0x0?_0x521f86[_0x601f('0x1ee')]:0x0;if(!checkContactEmpty(_0x6c711b)){_0x521f86['message']=_0x601f('0x9c');logger[_0x601f('0x79')](_0x601f('0x1ef')+_0x521f86['name']);}else{_0x521f86[_0x601f('0x6d')]+=_0x6c711b[_0x601f('0x94')];_0x521f86['message']=_0x601f('0x1f0');for(var _0x50f3b4=0x0;_0x50f3b4<_0x6c711b['length'];_0x50f3b4+=0x1){_0x521f86[_0x601f('0x1f1')]+=0x1;if(_[_0x601f('0xa8')](_0x6c711b[_0x50f3b4])||_[_0x601f('0xa8')](_0x6c711b[_0x50f3b4][_0x601f('0x165')])||_['isNil'](_0x6c711b[_0x50f3b4][_0x601f('0x165')][_0x601f('0x164')])){_0x2c7b88[_0x601f('0x1f2')](_0x601f('0x1f3'),_0x521f86,_0x6c711b[_0x50f3b4]);}else{_0x2c7b88[_0x601f('0xb4')](_[_0x601f('0xca')](_0x6c711b[_0x50f3b4],['CampaignId',_0x601f('0x1f4')]))[_0x601f('0xb1')](_0x2c7b88[_0x601f('0x1dc')](_0x521f86,_0x6c711b[_0x50f3b4]))['catch'](_0x2c7b88['loggerHandler'](_0x601f('0x1f5'),_0x521f86));}}}})[_0x601f('0xab')](loggerGetContactDialer(_0x601f('0x1f6'),_0x521f86,_0x40db24));}};Dialer[_0x601f('0x17')][_0x601f('0x149')]=function(_0x4182b1,_0x505710){var _0x5123af=this;var _0x1cb9df=[];var _0x3e3d18=_0x505710>=0x1?_0x505710:0x1;if(_0x4182b1[_0x601f('0x53')]===_0x601f('0x14d')){_0x3e3d18=0x1;}var _0x473e19=Math[_0x601f('0x1bf')](_0x4182b1[_0x601f('0x49')]*_0x3e3d18)-_0x4182b1[_0x601f('0x6d')]-_0x4182b1[_0x601f('0x1ee')];emitVoiceQueueSummary(_0x4182b1);if(_0x4182b1['dialLimitQueue']>0x0){var _0x44398d=_0x4182b1['dialLimitQueue']-_0x4182b1['originated']-_0x4182b1[_0x601f('0x4e')]-_0x4182b1[_0x601f('0x1ee')]-_0x4182b1[_0x601f('0x4a')];if(_0x473e19>_0x44398d){_0x473e19=_0x44398d;}}if(_0x473e19>0x0){if(_0x4182b1[_0x601f('0x53')]===_0x601f('0x14d')){_0x473e19=0x1;}if(_0x473e19>this[_0x601f('0x20')]){_0x473e19=this[_0x601f('0x20')];}_0x4182b1[_0x601f('0x1ee')]+=_0x473e19;for(var _0x2a98fa in this[_0x601f('0x1e')]){if(typeof this['agents'][_0x2a98fa]!==_0x601f('0x95')){if(this[_0x601f('0x1e')][_0x2a98fa][_0x601f('0xde')]===_0x601f('0x1f7')&&this[_0x601f('0x1e')][_0x2a98fa][_0x601f('0xa9')]===_0x601f('0xd6')){_0x1cb9df['push'](this[_0x601f('0x1e')][_0x2a98fa]['id']);}}}this[_0x601f('0xbd')](_0x4182b1['id'],_0x1cb9df,_0x473e19,_0x4182b1[_0x601f('0x1f8')])['then'](function(_0x3a9d74){_0x4182b1[_0x601f('0x1ee')]-=_0x473e19;_0x4182b1[_0x601f('0x1ee')]=_0x4182b1[_0x601f('0x1ee')]>0x0?_0x4182b1['temp']:0x0;if(!checkContactEmpty(_0x3a9d74)){_0x5123af[_0x601f('0xaf')](_0x4182b1)[_0x601f('0xb1')](sendMessageReschedule(_0x4182b1))[_0x601f('0xab')](loggerCatch(_0x601f('0xb2')));}else{_0x4182b1['originated']+=_0x3a9d74[_0x601f('0x94')];_0x4182b1[_0x601f('0x39')]=_0x4182b1[_0x601f('0x53')]===_0x601f('0x14d')?_0x601f('0x1f9'):_0x601f('0x1f0');for(var _0x48a4d4=0x0;_0x48a4d4<_0x3a9d74[_0x601f('0x94')];_0x48a4d4+=0x1){if(_[_0x601f('0xa8')](_0x3a9d74[_0x48a4d4])||_[_0x601f('0xa8')](_0x3a9d74[_0x48a4d4]['Contact'])||_[_0x601f('0xa8')](_0x3a9d74[_0x48a4d4][_0x601f('0x165')][_0x601f('0x164')])){_0x5123af[_0x601f('0x1f2')]('[actionOriginate]\x20',_0x4182b1,_0x3a9d74[_0x48a4d4]);}else{_0x5123af[_0x601f('0xb3')](_['pick'](_0x3a9d74[_0x48a4d4],[_0x601f('0xcd'),_0x601f('0x1f4')]))[_0x601f('0xb1')](_0x5123af[_0x601f('0x1dc')](_0x4182b1,_0x3a9d74[_0x48a4d4]))[_0x601f('0xab')](_0x5123af['loggerHandler']('[actionOriginate]\x20',_0x4182b1));}}}})[_0x601f('0xab')](loggerGetContactDialer(_0x601f('0x1fa'),_0x4182b1,_0x473e19));}};Dialer[_0x601f('0x17')][_0x601f('0x8e')]=function(_0x2a2184){if(_0x2a2184['dialLimitQueue']>0x0){var _0x1340a8=_0x2a2184[_0x601f('0x1fb')]-_0x2a2184[_0x601f('0x6d')]-_0x2a2184['talking'];if(_0x1340a8>0x0){this[_0x601f('0x1fc')](_0x2a2184);}else{loggerPredictiveCalls[_0x601f('0x79')](_0x601f('0x1fd'));}}else{this[_0x601f('0x1fc')](_0x2a2184);}};Dialer['prototype']['tryOriginatePredictive']=function(_0x1696a7){var _0x172639=this;var _0x5e75cd=[];_0x1696a7[_0x601f('0x6d')]+=0x1;for(var _0x3e6bba in this[_0x601f('0x1e')]){if(typeof this['agents'][_0x3e6bba]!==_0x601f('0x95')){if(this['agents'][_0x3e6bba]['state']===_0x601f('0x1f7')&&this['agents'][_0x3e6bba]['status']===_0x601f('0xd6')){_0x5e75cd[_0x601f('0x123')](this[_0x601f('0x1e')][_0x3e6bba]['id']);}}}this['getContactDialer'](_0x1696a7['id'],_0x5e75cd,0x1,_0x1696a7[_0x601f('0x1f8')])[_0x601f('0xb1')](function(_0x24740d){if(!checkContactEmpty(_0x24740d)){checkContactLowerLimitOriginate(_0x1696a7,0x1,0x0);_0x172639['countReScheduled'](_0x1696a7)[_0x601f('0xb1')](sendMessageReschedule(_0x1696a7))[_0x601f('0xab')](loggerCatch('[countReScheduled]\x20'));}else{_0x1696a7[_0x601f('0x39')]=_0x601f('0x1f0');if(_['isNil'](_0x24740d[0x0])||_[_0x601f('0xa8')](_0x24740d[0x0][_0x601f('0x165')])||_['isNil'](_0x24740d[0x0]['Contact'][_0x601f('0x164')])){_0x172639[_0x601f('0x1f2')](_0x601f('0x1f3'),_0x1696a7,_0x24740d[0x0]);}else{_0x172639['checkIsBlackList'](_['pick'](_0x24740d[0x0],['VoiceQueueId',_0x601f('0x1f4')]))[_0x601f('0xb1')](_0x172639[_0x601f('0x1dc')](_0x1696a7,_0x24740d[0x0]))[_0x601f('0xab')](_0x172639[_0x601f('0xc7')](_0x601f('0x1fe'),_0x1696a7));}}})[_0x601f('0xab')](loggerGetContactDialer(_0x601f('0x1ff'),_0x1696a7,0x1));emitVoiceQueueSummary(_0x1696a7);};Dialer[_0x601f('0x17')][_0x601f('0x1d2')]=function(_0x4de0da,_0x59f38e,_0x344f09,_0x3a17a3,_0x301988,_0xa17319){loggerPredictive[_0x601f('0x79')](_0x601f('0x200'));loggerPredictive[_0x601f('0x79')](_0x601f('0x201'),_0x4de0da);loggerPredictive['info'](_0x601f('0x202'),_0x59f38e);loggerPredictive[_0x601f('0x79')](_0x601f('0x203'),_0x344f09);loggerPredictive['info'](_0x601f('0x204'),_0x3a17a3);loggerPredictive[_0x601f('0x79')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x301988);loggerPredictive[_0x601f('0x79')](_0x601f('0x80'));return new BPromise(function(_0x22f8b7,_0xd63a41){if(_0x4de0da<=0x0||isNaN(_0x4de0da)){return _0xd63a41(msgResponse(_0x601f('0x205'),_0x601f('0x42'),_0x601f('0x206')+_0x4de0da));}if(_0x344f09<=0x0||isNaN(_0x344f09)){return _0xd63a41(msgResponse(_0x601f('0x205'),_0x601f('0x42'),'Ts\x20=\x20'+_0x344f09));}if(_0x3a17a3<=0x0||isNaN(_0x3a17a3)){return _0xd63a41(msgResponse(_0x601f('0x205'),'Error','p\x20=\x20'+_0x3a17a3));}if(_0x59f38e<=0x0||isNaN(_0x59f38e)){return _0xd63a41(msgResponse('[abandonmentRate]',_0x601f('0x42'),_0x601f('0x207')+_0x59f38e));}if(_0x301988<=0x0||isNaN(_0x301988)){return _0xd63a41(msgResponse(_0x601f('0x205'),_0x601f('0x42'),'Amax\x20=\x20'+_0x301988));}_0xa17319=_0xa17319||0x0;var _0x24be8d=0x1/_0x344f09;var _0x45243e=0x0;var _0x177a6c=0x0;var _0x5a7ece=0x0;var _0x559aed=0x0;for(var _0x26ac11=0x0;_0x5a7ece<_0x301988;_0x26ac11+=0x1){_0x177a6c=_0x26ac11/_0x59f38e;_0x45243e=(_0x3a17a3*_0x177a6c+_0xa17319)/_0x24be8d;_0x5a7ece=erlangb(_0x45243e,_0x4de0da);_0x559aed=_0x45243e/_0x4de0da*(0x1-erlangb(_0x45243e,_0x4de0da));}return _0x22f8b7({'erlangCalls':_0x26ac11,'erlangCallToSecond':_0x59f38e/_0x26ac11,'erlangAbandonmentRate':_0x5a7ece,'erlangBusyFactor':_0x559aed});});};Dialer[_0x601f('0x17')][_0x601f('0x1d9')]=function(_0x35849a,_0x5110b3,_0x43a60e,_0x4daf05,_0xfaca77,_0x836bd){loggerPredictive[_0x601f('0x79')](_0x601f('0x208'));loggerPredictive['info'](_0x601f('0x201'),_0x35849a);loggerPredictive[_0x601f('0x79')](_0x601f('0x202'),_0x5110b3);loggerPredictive[_0x601f('0x79')](_0x601f('0x203'),_0x43a60e);loggerPredictive['info'](_0x601f('0x204'),_0x4daf05);loggerPredictive[_0x601f('0x79')](_0x601f('0x209'),_0xfaca77);loggerPredictive['info']('---------------------------');return new BPromise(function(_0x55ec28,_0x4ecc83){if(_0x35849a<=0x0||isNaN(_0x35849a)){return _0x4ecc83(msgResponse(_0x601f('0x20a'),_0x601f('0x42'),_0x601f('0x206')+_0x35849a));}if(_0x43a60e<=0x0||isNaN(_0x43a60e)){return _0x4ecc83(msgResponse(_0x601f('0x20a'),_0x601f('0x42'),_0x601f('0x20b')+_0x43a60e));}if(_0x4daf05<=0x0||isNaN(_0x4daf05)){return _0x4ecc83(msgResponse(_0x601f('0x20a'),_0x601f('0x42'),_0x601f('0x20c')+_0x4daf05));}if(_0x5110b3<=0x0||isNaN(_0x5110b3)){return _0x4ecc83(msgResponse(_0x601f('0x20a'),'Error',_0x601f('0x207')+_0x5110b3));}if(_0xfaca77<=0x0||isNaN(_0xfaca77)){return _0x4ecc83(msgResponse(_0x601f('0x20a'),'Error',_0x601f('0x20d')+_0xfaca77));}_0x836bd=_0x836bd||0x0;var _0x19bbd1=0x1/_0x43a60e;var _0x2e0183=0x0;var _0x23fc08=0x0;var _0x5c3d12=0x0;var _0x487693=0x0;for(var _0x41789d=0x0;_0x487693<_0xfaca77;_0x41789d+=0x1){_0x23fc08=_0x41789d/_0x5110b3;_0x2e0183=(_0x4daf05*_0x23fc08+_0x836bd)/_0x19bbd1;_0x5c3d12=erlangb(_0x2e0183,_0x35849a);_0x487693=_0x2e0183/_0x35849a*(0x1-erlangb(_0x2e0183,_0x35849a));}return _0x55ec28({'erlangCalls':_0x41789d,'erlangCallToSecond':_0x5110b3/_0x41789d,'erlangAbandonmentRate':_0x5c3d12,'erlangBusyFactor':_0x487693});});};module[_0x601f('0x20e')]=Dialer;
\ No newline at end of file