Built motion from commit (unavailable).|2.5.31
[motion2.git] / server / services / ami / dialer / index.js
index c8ea963..08e7aa9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa8f0=['XMD-AMDGREETING','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-CAMPAIGNID','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','trim','substring','dialCutDigit','SIP/%s/%s%s','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','getQueue','[callProgressDetecting]\x20','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','entity\x20is\x20undefine','evt\x20is\x20undefine','reason','NoSuchNumber','custom:agentnosuchnumber','checkRetriveMax','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','dialBusyMaxRetry','reason\x205\x20busy','congestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','outboundAbandonedCallsDay','dialAbandonedMaxRetry','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','dialPredictiveInterval','dialPredictiveOptimization','dropRate','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','busyFactor','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','abandonmentRate','[CatchErlangB]','agentBusyFactor','[getDataPredictive]','one\x20call\x20every:','[handlePredictive]','checkContactBlack','recallme','queueStatusComplete:\x20','queuestatus','[booked][checkContactBlack][else]','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','actionOriginate','scheduledat','dialRecallMeTimeout','Agent','voicePause','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','loggerHandler','[getContactCampaign2]','dialLimitQueue','not_inuse','emptyContact','[getContactDialer2]','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','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','----\x20Agent\x20Busy\x20Factor\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','[busyFactor]','m\x20=\x20','Umin\x20=\x20','uuid','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','syncQueueSummary','../ami','localhost','socket.io-emitter','redis','../rpc/cmHopper','./action','./final','./agentComplete','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','enqueue','tail','finally','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','custom:queuesummary','hangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','seconds','type','outbound','answered','available','loggedIn','pTalking','sumDuration','sumHoldTime','total','unmanaged','abandoned','loggedInDb','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','md5','format','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\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','merge','diff','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','\x22%s\x22\x20<%s>','error','stack','inspect','length','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','talking','waiting','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','starttime','prototype','[uniqueid]','[actions]','clearZombieChannels','undefined','sequence','isNil','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','notFound','saveInDb','pick','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','status','reachable','SIP/%s','unmonitored','uniqueId','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HangupInAMD','membername','AMD','custom:amd','buildObj','[syncHangupInAMD][createHistory]','MACHINE','Machine','countmachineretry','countglobal','amd','emit','[syncAgentComplete][createHistory][0]','countnoanswerretry','countdropretry','countabandonedretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','ContactId','[rescheduleContact][Machine]','[syncHangupInAMDIvr]','countbusyretry','countcongestionretry','countnosuchnumberretry','countagentrejectretry','dialMachineMaxRetry','syncHangup','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AGI','cause-txt','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete]','syncAgentConnect','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','Drop','dropreason','TIMEOUT','agiafterat','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','actionid','strategy','roundrobin','locked','paused','stateinterface','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[Catch][Preview][syncQueueStatusComplete]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','loopCampaigns','syncCampaigns','checkIsTrunkReachable','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','interval','indexOf','Action','content','true','some','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','dialMethod','progressive','handlePower','dialPowerLevel','predictive','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','dialActive','checkIfTime','dialGlobalInterval','dialTimezone','checkDialMethod','[syncQueueSummary]','[syncCampaigns]','pow','replace','random','match','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','getCaller','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence'];(function(_0x486b0f,_0x23a0ff){var _0x436ee9=function(_0x24cbcb){while(--_0x24cbcb){_0x486b0f['push'](_0x486b0f['shift']());}};_0x436ee9(++_0x23a0ff);}(_0xa8f0,0xa1));var _0x0a8f=function(_0x33f9c6,_0x24cc4f){_0x33f9c6=_0x33f9c6-0x0;var _0x1edc0d=_0xa8f0[_0x33f9c6];return _0x1edc0d;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require('bluebird');var uuid=require(_0x0a8f('0x0'));var moment=require('moment');var rr=require('rr');var md5=require('md5');var Redis=require(_0x0a8f('0x1'));var ut=require(_0x0a8f('0x2'));var config=require(_0x0a8f('0x3'));var logger=require(_0x0a8f('0x4'))(_0x0a8f('0x5'));var loggerBooked=require(_0x0a8f('0x4'))(_0x0a8f('0x6'));var loggerPredictive=require(_0x0a8f('0x4'))('predictive');var loggerPredictiveCalls=require('../../../config/logger')('predictiveCalls');var loggerSyncQueueSummary=require(_0x0a8f('0x4'))(_0x0a8f('0x7'));var ami=require(_0x0a8f('0x8'));config['redis']=_['defaults'](config['redis'],{'host':_0x0a8f('0x9'),'port':0x18eb});var io=require(_0x0a8f('0xa'))(new Redis(config[_0x0a8f('0xb')]));var cmHopper=require(_0x0a8f('0xc'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require(_0x0a8f('0xd'));var History=require('./history');var Final=require(_0x0a8f('0xe'));var AgentComplete=require(_0x0a8f('0xf'));var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require(_0x0a8f('0x10'));var ipAgi=process[_0x0a8f('0x11')][_0x0a8f('0x12')]||_0x0a8f('0x13');var strategy={'rrmemory':_0x0a8f('0x14'),'roundrobin':'roundrobin'};var Sequence=function(){};Sequence['prototype'][_0x0a8f('0x15')]=function(_0x1a215b){this[_0x0a8f('0x16')]=this['tail']?this[_0x0a8f('0x16')][_0x0a8f('0x17')](_0x1a215b):_0x1a215b();};function Dialer(_0x4dbfea,_0x202184){this['sequence']=new Sequence();this[_0x0a8f('0x18')]=_0x202184;this['voiceQueues']=_0x4dbfea[_0x0a8f('0x19')];this[_0x0a8f('0x1a')]=_0x4dbfea[_0x0a8f('0x1a')];this[_0x0a8f('0x1b')]=_0x4dbfea[_0x0a8f('0x1b')];this[_0x0a8f('0x1c')]=_0x4dbfea[_0x0a8f('0x1c')];this[_0x0a8f('0x1d')]=config[_0x0a8f('0x1d')]||0x2;this[_0x0a8f('0x1e')]={};this[_0x0a8f('0x1f')]={};this[_0x0a8f('0x20')]={};this['uniqueId']={};this[_0x0a8f('0x21')]={};this[_0x0a8f('0x22')]={};this[_0x0a8f('0x23')]={};this[_0x0a8f('0x24')]={};this[_0x0a8f('0x25')]={};this[_0x0a8f('0x26')]={};ami['on']('agentconnect',this['syncAgentConnect'][_0x0a8f('0x27')](this));ami['on'](_0x0a8f('0x28'),this[_0x0a8f('0x29')][_0x0a8f('0x27')](this));ami['on'](_0x0a8f('0x2a'),this[_0x0a8f('0x2b')][_0x0a8f('0x27')](this));ami['on']('agentcomplete',this['syncAgentComplete'][_0x0a8f('0x27')](this));ami['on'](_0x0a8f('0x2c'),this[_0x0a8f('0x7')][_0x0a8f('0x27')](this));ami['on'](_0x0a8f('0x2d'),this['syncHangup']['bind'](this));ami['on'](_0x0a8f('0x2e'),this[_0x0a8f('0x2f')][_0x0a8f('0x27')](this));ami['on'](_0x0a8f('0x30'),this[_0x0a8f('0x31')][_0x0a8f('0x27')](this));ami['on'](_0x0a8f('0x32'),this[_0x0a8f('0x33')][_0x0a8f('0x27')](this));ami['on'](_0x0a8f('0x34'),this[_0x0a8f('0x35')][_0x0a8f('0x27')](this));this['loopCampaigns']();this[_0x0a8f('0x36')]();}function isNotNull(_0x1f7a25){return _0x1f7a25!==null&&!_[_0x0a8f('0x37')](_0x1f7a25);}function checkIsLoggedIn(_0x1e6b49,_0x5b7d69){return function(){if(_0x5b7d69<=0x0){_0x1e6b49[_0x0a8f('0x38')]=_0x0a8f('0x39');throw _0x1e6b49[_0x0a8f('0x3a')]+_0x0a8f('0x3b');}};}function isActive(_0x22b56e){return _0x22b56e;}function checkIsActive(_0x2e6dea,_0x4f148f){return function(){if(!isActive(_0x4f148f)){_0x2e6dea[_0x0a8f('0x38')]=_0x0a8f('0x3c');throw _0x2e6dea['name']+_0x0a8f('0x3d');}};}function checkInterval(_0x1c7b09){return function(){if(!isNotNull(_0x1c7b09[_0x0a8f('0x3e')])){_0x1c7b09['message']=_0x0a8f('0x3f');throw _0x1c7b09[_0x0a8f('0x3a')]+_0x0a8f('0x40');}if(!isNotNull(_0x1c7b09[_0x0a8f('0x3e')][_0x0a8f('0x41')])){_0x1c7b09[_0x0a8f('0x38')]=_0x0a8f('0x3f');throw _0x1c7b09[_0x0a8f('0x3a')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x0a8f('0x42')](_0x1c7b09[_0x0a8f('0x3e')][_0x0a8f('0x41')]))){_0x1c7b09[_0x0a8f('0x38')]=_0x0a8f('0x3f');throw _0x1c7b09['name']+_0x0a8f('0x40');}};}function msgResponse(_0x10baed,_0xe16b4b,_0x243bfd){return{'action':_0x10baed,'response':_0xe16b4b,'message':_0x243bfd,'stack':_0x243bfd};}function myreject(_0x160b2f){return function(_0x5360dc){return _0x160b2f(msgResponse(_0x0a8f('0x43'),_0x0a8f('0x44'),JSON[_0x0a8f('0x45')](_0x5360dc)));};}function getSeconds(_0x3831ca,_0x1b52ad){var _0x447bc3=moment(_0x3831ca)[_0x0a8f('0x46')](0x0);var _0xbcd05e=moment(_0x1b52ad)[_0x0a8f('0x46')](0x0);return _0x447bc3['diff'](_0xbcd05e,_0x0a8f('0x47'));}function emit(_0x554b64,_0x3a0134,_0x335f5f){io['to'](_0x554b64)['emit'](_0x3a0134,_0x335f5f);}function emitVoiceQueueSummary(_0x159882){if(_0x159882[_0x0a8f('0x48')]===_0x0a8f('0x49')){var _0x2fb3c1={'id':_0x159882['id'],'name':_0x159882[_0x0a8f('0x3a')],'strategy':_0x159882['strategy'],'answered':_0x159882[_0x0a8f('0x4a')],'available':_0x159882[_0x0a8f('0x4b')],'loggedIn':_0x159882[_0x0a8f('0x4c')],'pTalking':_0x159882[_0x0a8f('0x4d')],'sumBillable':_0x159882['sumBillable'],'sumDuration':_0x159882[_0x0a8f('0x4e')],'sumHoldTime':_0x159882[_0x0a8f('0x4f')]||0x0,'talking':_0x159882['talking'],'total':_0x159882[_0x0a8f('0x50')],'type':_0x159882['type'],'unmanaged':_0x159882[_0x0a8f('0x51')],'abandoned':_0x159882[_0x0a8f('0x52')],'waiting':_0x159882['waiting'],'loggedInDb':_0x159882[_0x0a8f('0x53')],'dialActive':_0x159882['dialActive'],'dialMethod':_0x159882['dialMethod'],'dialOriginateCallerIdName':_0x159882[_0x0a8f('0x54')],'dialOriginateCallerIdNumber':_0x159882[_0x0a8f('0x55')],'dialOriginateTimeout':_0x159882[_0x0a8f('0x56')],'dialPrefix':_0x159882[_0x0a8f('0x57')],'outboundAnswerAgiCallsDay':_0x159882[_0x0a8f('0x58')],'outboundAnswerCallsDay':_0x159882[_0x0a8f('0x59')],'outboundBlacklistCallsDay':_0x159882[_0x0a8f('0x5a')],'outboundBusyCallsDay':_0x159882[_0x0a8f('0x5b')],'outboundCongestionCallsDay':_0x159882[_0x0a8f('0x5c')],'outboundDropCallsDayACS':_0x159882['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x159882[_0x0a8f('0x5d')],'outboundDropCallsDayTimeout':_0x159882[_0x0a8f('0x5e')],'outboundNoAnswerCallsDay':_0x159882[_0x0a8f('0x5f')],'outboundNoSuchCallsDay':_0x159882[_0x0a8f('0x60')],'outboundOriginateFailureCallsDay':_0x159882[_0x0a8f('0x61')],'outboundReCallsDay':_0x159882['outboundReCallsDay'],'outboundRejectCallsDay':_0x159882[_0x0a8f('0x62')],'outboundUnknownCallsDay':_0x159882[_0x0a8f('0x63')],'predictiveIntervalAnsweredCalls':_0x159882[_0x0a8f('0x64')],'predictiveIntervalAvgHoldtime':_0x159882[_0x0a8f('0x65')],'predictiveIntervalAvgTalktime':_0x159882[_0x0a8f('0x66')],'predictiveIntervalDroppedCallsCallersExit':_0x159882[_0x0a8f('0x67')],'predictiveIntervalDroppedCallsTimeout':_0x159882[_0x0a8f('0x68')],'predictiveIntervalErlangCalls':_0x159882[_0x0a8f('0x69')],'predictiveIntervalErlangCallsDroppedCalls':_0x159882[_0x0a8f('0x6a')],'predictiveIntervalHitRate':_0x159882[_0x0a8f('0x6b')],'predictiveIntervalMultiplicativeFactor':_0x159882[_0x0a8f('0x6c')],'predictiveIntervalPauses':_0x159882[_0x0a8f('0x6d')],'predictiveIntervalAvailable':_0x159882['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x159882[_0x0a8f('0x6e')],'message':_0x159882[_0x0a8f('0x38')],'originated':_0x159882[_0x0a8f('0x6f')],'erlangCalls':_0x159882['erlangCalls'],'erlangCallToSecond':_0x159882[_0x0a8f('0x70')],'erlangAbandonmentRate':_0x159882[_0x0a8f('0x71')],'erlangBusyFactor':_0x159882[_0x0a8f('0x72')],'startPredictive':_0x159882[_0x0a8f('0x22')],'startProgressive':_0x159882[_0x0a8f('0x23')]};if(_0x159882[_0x0a8f('0x73')]){_0x2fb3c1[_0x0a8f('0x73')]={'id':_0x159882[_0x0a8f('0x73')]['id'],'name':_0x159882[_0x0a8f('0x73')][_0x0a8f('0x3a')],'active':_0x159882[_0x0a8f('0x73')][_0x0a8f('0x74')],'callerid':_0x159882[_0x0a8f('0x73')][_0x0a8f('0x75')]};}if(_0x159882[_0x0a8f('0x3e')]){_0x2fb3c1[_0x0a8f('0x3e')]={'id':_0x159882[_0x0a8f('0x3e')]['id'],'name':_0x159882[_0x0a8f('0x3e')][_0x0a8f('0x3a')]};}var _0x4b7849=md5(JSON[_0x0a8f('0x45')](_0x2fb3c1));if(_0x159882[_0x0a8f('0x76')]!==_0x4b7849){_0x159882['md5']=_0x4b7849;emit(util[_0x0a8f('0x77')]('voice:queue:%s',_0x2fb3c1[_0x0a8f('0x3a')]),_0x0a8f('0x78'),_0x2fb3c1);}}}function emitCampaignSummary(_0x360ef1){if(_0x360ef1[_0x0a8f('0x48')]===_0x0a8f('0x79')){emit(util[_0x0a8f('0x77')](_0x0a8f('0x7a'),_0x360ef1['name']),_0x0a8f('0x7b'),_0x360ef1);}}function checkGetDataPredictive(_0x16b284){if(isNotNull(_0x16b284)&&!_[_0x0a8f('0x42')](_0x16b284)){loggerPredictive[_0x0a8f('0x7c')](_0x0a8f('0x7d'));loggerPredictive[_0x0a8f('0x7c')](_0x0a8f('0x7e'),_0x16b284[_0x0a8f('0x6e')]);loggerPredictive[_0x0a8f('0x7c')](_0x0a8f('0x7f'),_0x16b284['predictiveIntervalAnsweredCalls']);loggerPredictive[_0x0a8f('0x7c')](_0x0a8f('0x80'),_0x16b284[_0x0a8f('0x68')]);loggerPredictive[_0x0a8f('0x7c')](_0x0a8f('0x81'),_0x16b284['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive['info']('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x16b284['predictiveIntervalAvgHoldtime']);loggerPredictive[_0x0a8f('0x7c')](_0x0a8f('0x82'),_0x16b284['predictiveIntervalAvgTalktime']);loggerPredictive[_0x0a8f('0x7c')](_0x0a8f('0x83'));if(_0x16b284[_0x0a8f('0x6e')]>0x0){if(!_[_0x0a8f('0x37')](_0x16b284['predictiveIntervalAvgTalktime'])&&_0x16b284[_0x0a8f('0x66')]>0x0){return!![];}loggerPredictive[_0x0a8f('0x7c')](_0x0a8f('0x84'));if(!_['isUndefined'](_0x16b284[_0x0a8f('0x65')])&&_0x16b284['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0x0a8f('0x7c')](_0x0a8f('0x85'));}else{loggerPredictive[_0x0a8f('0x7c')](_0x0a8f('0x86'));}}else{loggerPredictive['info'](_0x0a8f('0x87'));}return![];}function mergeDataErlangB(_0x4a5d38){return function(_0x540d08){loggerPredictive[_0x0a8f('0x7c')](_0x0a8f('0x88'));loggerPredictive[_0x0a8f('0x7c')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x540d08[_0x0a8f('0x89')]);loggerPredictive['info'](_0x0a8f('0x8a'),_0x540d08['erlangCallToSecond']);loggerPredictive['info']('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x540d08[_0x0a8f('0x71')]);loggerPredictive[_0x0a8f('0x7c')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x540d08[_0x0a8f('0x72')]);loggerPredictive['info'](_0x0a8f('0x8b'),_0x540d08['erlangAbandonmentRate']);loggerPredictive['info']('---------------------------');_[_0x0a8f('0x8c')](_0x4a5d38,_0x540d08);};}function getDiff(_0x1244be){var _0x294896=moment()[_0x0a8f('0x46')](0x0);var _0x41e5dd=moment(_0x1244be)[_0x0a8f('0x46')](0x0);return _0x294896[_0x0a8f('0x8d')](_0x41e5dd,_0x0a8f('0x47'));}function ifInterval(_0x2c0c92,_0xca7337){if(_[_0x0a8f('0x37')](_0xca7337)){return![];}return getDiff(_0xca7337)<_0x2c0c92*0x3c;}function freeVariablesPredictive(_0x1bb972){if(isNotNull(_0x1bb972)){if(!_[_0x0a8f('0x37')](_0x1bb972[_0x0a8f('0x23')])){_0x1bb972[_0x0a8f('0x23')]=undefined;loggerPredictive[_0x0a8f('0x7c')](_0x1bb972['name'],_0x0a8f('0x8e'));}if(!_['isUndefined'](_0x1bb972[_0x0a8f('0x22')])){_0x1bb972['startPredictive']=undefined;loggerPredictive['info'](_0x1bb972[_0x0a8f('0x3a')],_0x0a8f('0x8f'));}if(!_['isUndefined'](_0x1bb972[_0x0a8f('0x90')])){clearInterval(_0x1bb972[_0x0a8f('0x90')]);_0x1bb972[_0x0a8f('0x90')]=undefined;loggerPredictive[_0x0a8f('0x7c')](_0x1bb972[_0x0a8f('0x3a')],_0x0a8f('0x91'));}}}function erlangb(_0x3943ae,_0x552ab7){if(_0x552ab7===0x0){return 0x0;}var _0x4b47fd=0x1;for(var _0x321326=0x1;_0x321326<=_0x552ab7;_0x321326+=0x1){_0x4b47fd=0x1+_0x4b47fd*_0x321326/_0x3943ae;}return 0x1/_0x4b47fd;}function isVoiceQueueOutbound(_0x306fda){return _0x306fda===_0x0a8f('0x49');}function isNotPreview(_0xe4b67e){return _0xe4b67e!==_0x0a8f('0x18');}function isCampaignIvr(_0x5496a6){return _0x5496a6===_0x0a8f('0x79');}function getCallerId(_0x1c8e9b,_0x5227f8,_0x47354c){if(!_['isUndefined'](_0x47354c)&&typeof _0x47354c==='string'&&!_[_0x0a8f('0x42')](_0x47354c)){if(!_['isUndefined'](_0x5227f8)&&typeof _0x5227f8==='string'&&!_['isEmpty'](_0x5227f8)){return util['format'](_0x0a8f('0x92'),_0x5227f8,_0x47354c);}return util[_0x0a8f('0x77')]('\x22%s\x22\x20<%s>',_0x47354c,_0x47354c);}if(!_[_0x0a8f('0x37')](_0x1c8e9b)&&typeof _0x1c8e9b==='string'&&!_[_0x0a8f('0x42')](_0x1c8e9b)){return _0x1c8e9b;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x1c3480,_0x43903f){return function(_0x3d923d){freeVariablesPredictive(_0x43903f);emitVoiceQueueSummary(_0x43903f);emitCampaignSummary(_0x43903f);loggerSyncQueueSummary['error'](_0x1c3480,util['inspect'](_0x3d923d,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x483e9f,_0x3becd6){return function(_0x9ec64){loggerPredictive[_0x0a8f('0x93')](_0x3becd6[_0x0a8f('0x3a')],_0x483e9f);loggerPredictive[_0x0a8f('0x93')](_0x9ec64[_0x0a8f('0x94')]);freeVariablesPredictive(_0x3becd6);};}function loggerCatch(_0x24cec8){return function(_0x57a74f){logger[_0x0a8f('0x93')](_0x24cec8,util[_0x0a8f('0x95')](_0x57a74f,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x43d189){return _0x43d189&&!_['isUndefined'](_0x43d189)&&_0x43d189[_0x0a8f('0x96')]>0x0;}function decremetOriginate(_0x3205eb){if(!_[_0x0a8f('0x37')](_0x3205eb)&&_0x3205eb!==null){if(typeof _0x3205eb['originated']!=='undefined'){if(_0x3205eb[_0x0a8f('0x6f')]>0x0){_0x3205eb['originated']-=0x1;}else{logger['error'](_0x0a8f('0x97'));}}}else{logger[_0x0a8f('0x93')](_0x0a8f('0x98'));}}function checkContactLowerLimitOriginate(_0x2276f1,_0x5caf63,_0x11cad7){if(_0x5caf63>_0x11cad7){for(var _0x144f72=0x0;_0x144f72<_0x5caf63-_0x11cad7;_0x144f72+=0x1){decremetOriginate(_0x2276f1);}}}function loggerGetContactDialer(_0x49f01f,_0x31ea58,_0x27305b){return function(_0x2f21bb){checkContactLowerLimitOriginate(_0x31ea58,_0x27305b,0x0);logger[_0x0a8f('0x93')](_0x49f01f,util[_0x0a8f('0x95')](_0x2f21bb,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x42291c){return function(_0xe71ff5){if(isNotNull(_0xe71ff5)&&isNotNull(_0xe71ff5[0x0])){if(_0xe71ff5[0x0][_0x0a8f('0x99')]>0x0){_0x42291c[_0x0a8f('0x38')]=_0x0a8f('0x9a');logger[_0x0a8f('0x7c')](_0x0a8f('0x9b')+_0x42291c[_0x0a8f('0x3a')],_0xe71ff5[0x0][_0x0a8f('0x99')],_0x0a8f('0x9c'));}else{_0x42291c[_0x0a8f('0x38')]=_0x0a8f('0x9d');logger[_0x0a8f('0x7c')](_0x0a8f('0x9e')+_0x42291c[_0x0a8f('0x3a')]);}}};}function notSendMessagesQueue(_0x4077c8){if(_0x4077c8[_0x0a8f('0x9f')]){freeVariablesPredictive(_0x4077c8);if(_0x4077c8[_0x0a8f('0x6f')]===0x0&&_0x4077c8[_0x0a8f('0xa0')]===0x0&&_0x4077c8[_0x0a8f('0xa1')]===0x0&&(_0x4077c8['pTalking']||0x0)===0x0){_0x4077c8['sendMessageOneNotActive']=![];_0x4077c8['available']=0x0;_0x4077c8[_0x0a8f('0x38')]=_0x0a8f('0x3c');loggerSyncQueueSummary[_0x0a8f('0x93')](_0x0a8f('0xa2'),_0x4077c8['name'],_0x0a8f('0xa3'));}else{_0x4077c8[_0x0a8f('0x38')]=_0x0a8f('0xa4');loggerSyncQueueSummary['error'](_0x0a8f('0xa2'),_0x4077c8['name'],_0x0a8f('0xa5'));}emitVoiceQueueSummary(_0x4077c8);}}function notSendMessagesCampaign(_0x5430c3){if(_0x5430c3[_0x0a8f('0x9f')]){if(_0x5430c3[_0x0a8f('0x6f')]===0x0){_0x5430c3['sendMessageOneNotActive']=![];_0x5430c3['message']=_0x0a8f('0x3c');loggerSyncQueueSummary[_0x0a8f('0x93')](_0x0a8f('0xa6'),_0x5430c3[_0x0a8f('0x3a')],_0x0a8f('0xa3'));}else{_0x5430c3[_0x0a8f('0x38')]=_0x0a8f('0xa4');loggerSyncQueueSummary[_0x0a8f('0x93')](_0x0a8f('0xa6'),_0x5430c3[_0x0a8f('0x3a')],_0x0a8f('0xa5'));}emitCampaignSummary(_0x5430c3);}}function createObjHistory(_0x3e020d,_0x22e73e,_0x282027,_0x4df0d2,_0x19d691){_0x3e020d[_0x0a8f('0x38')]=_0x282027;var _0x26143a=new Action(_0x3e020d,_0x22e73e);var _0x3d5ff8=new History(_0x26143a);_0x3d5ff8[_0x0a8f('0xa7')]=_0x4df0d2;_0x3d5ff8[_0x0a8f('0xa8')]=_0x19d691;_0x3d5ff8[_0x0a8f('0xa9')]=_0x26143a[_0x0a8f('0xaa')];return _0x3d5ff8;}Dialer[_0x0a8f('0xab')][_0x0a8f('0x36')]=function(){var _0x34bdda=this;setInterval(function(){_0x34bdda['clearZombieChannels'](_0x34bdda['uniqueId'],_0x0a8f('0xac'));_0x34bdda['clearZombieChannels'](_0x34bdda['actions'],_0x0a8f('0xad'));},0x32c8);};Dialer[_0x0a8f('0xab')][_0x0a8f('0xae')]=function(_0x1744e1,_0x514ae0){var _0x17bfe7=this;for(var _0x2ccef3 in _0x1744e1){if(typeof _0x1744e1[_0x2ccef3]!==_0x0a8f('0xaf')){this[_0x0a8f('0xb0')][_0x0a8f('0x15')](function(){if(!_[_0x0a8f('0xb1')](_0x1744e1[_0x2ccef3])){return ami['Action']({'action':'status','channel':_0x1744e1[_0x2ccef3][_0x0a8f('0xb2')]})[_0x0a8f('0xb3')](function(_0x2cb76a){if(_0x2cb76a[_0x0a8f('0x38')]===_0x0a8f('0xb4')){setTimeout(function(){if(_0x1744e1[_0x2ccef3]&&_0x1744e1[_0x2ccef3][_0x0a8f('0x48')]!==_0x0a8f('0x79')){_0x17bfe7[_0x0a8f('0xb5')](_0x17bfe7[_0x0a8f('0x19')][_0x1744e1[_0x2ccef3][_0x0a8f('0xb6')]]);logger[_0x0a8f('0x93')]('[Dialer][checkChannel]',_0x514ae0,_0x2ccef3,_0x1744e1[_0x2ccef3][_0x0a8f('0xb6')]);delete _0x1744e1[_0x2ccef3];}if(_0x1744e1[_0x2ccef3]&&_0x1744e1[_0x2ccef3]['type']===_0x0a8f('0x79')){_0x17bfe7['updateOriginated'](_0x17bfe7[_0x0a8f('0x1a')][_0x1744e1[_0x2ccef3][_0x0a8f('0xb6')]]);logger[_0x0a8f('0x93')](_0x0a8f('0xb7'),_0x514ae0,_0x2ccef3,_0x1744e1[_0x2ccef3][_0x0a8f('0xb6')]);delete _0x1744e1[_0x2ccef3];}},0x2328);}});}});}}};Dialer[_0x0a8f('0xab')][_0x0a8f('0xb8')]=function(_0x244939){return BPromise[_0x0a8f('0xb9')]()[_0x0a8f('0xba')](cmHopper[_0x0a8f('0xb8')](_0x244939))[_0x0a8f('0xb3')](loggerCatch(_0x0a8f('0xbb')));};Dialer[_0x0a8f('0xab')][_0x0a8f('0xbc')]=function(_0x278ae9){return BPromise[_0x0a8f('0xb9')]()[_0x0a8f('0xba')](cmHopperBlack[_0x0a8f('0xbc')](_0x278ae9))[_0x0a8f('0xb3')](loggerCatch(_0x0a8f('0xbd')));};Dialer[_0x0a8f('0xab')]['checkIsBlackListIvr']=function(_0x168432){return BPromise['resolve']()[_0x0a8f('0xba')](cmHopperBlack[_0x0a8f('0xbe')](_0x168432))[_0x0a8f('0xb3')](loggerCatch(_0x0a8f('0xbf')));};Dialer[_0x0a8f('0xab')][_0x0a8f('0xc0')]=function(_0x2178fe){return BPromise[_0x0a8f('0xb9')]()[_0x0a8f('0xba')](cmHopperHistory[_0x0a8f('0xc1')](_0x2178fe))[_0x0a8f('0xb3')](loggerCatch(_0x0a8f('0xc2')));};Dialer[_0x0a8f('0xab')][_0x0a8f('0xc3')]=function(_0x3f6a04){return BPromise['resolve']()[_0x0a8f('0xba')](cmHopper['rescheduleContact'](_0x3f6a04))[_0x0a8f('0xb3')](loggerCatch(_0x0a8f('0xc4')));};Dialer['prototype'][_0x0a8f('0xc5')]=function(_0x50568a,_0x306f5d,_0x30e5d0){return BPromise['resolve']()['then'](cmHopper[_0x0a8f('0xc5')](_0x50568a,_0x306f5d,_0x30e5d0))[_0x0a8f('0xb3')](loggerCatch(_0x0a8f('0xc6')));};Dialer[_0x0a8f('0xab')]['getContactDialer']=function(_0x4803b8,_0x316237,_0x2c3576,_0x4620b6,_0x20de34){return BPromise[_0x0a8f('0xb9')]()['then'](cmHopper[_0x0a8f('0xc7')](_0x4803b8,_0x316237,_0x2c3576,_0x4620b6))[_0x0a8f('0xb3')](function(_0xda8d84){_0x20de34[_0x0a8f('0xc8')]-=_0x2c3576;_0x20de34[_0x0a8f('0xc8')]=_0x20de34[_0x0a8f('0xc8')]>0x0?_0x20de34['temp']:0x0;loggerCatch(_0x0a8f('0xc9'))(_0xda8d84);});};Dialer[_0x0a8f('0xab')][_0x0a8f('0xca')]=function(_0x10d74c,_0xb17ca0,_0x3486cd,_0x57f30a){return BPromise[_0x0a8f('0xb9')]()[_0x0a8f('0xba')](cmHopper[_0x0a8f('0xca')](_0x10d74c,_0xb17ca0,_0x3486cd))[_0x0a8f('0xb3')](function(_0x51e173){_0x57f30a[_0x0a8f('0xc8')]-=_0xb17ca0;_0x57f30a[_0x0a8f('0xc8')]=_0x57f30a[_0x0a8f('0xc8')]>0x0?_0x57f30a[_0x0a8f('0xc8')]:0x0;loggerCatch(_0x0a8f('0xcb'))(_0x51e173);});};Dialer['prototype'][_0x0a8f('0xcc')]=function(_0x3d10d3){return BPromise['resolve']()[_0x0a8f('0xba')](voiceQueueRt[_0x0a8f('0xcc')](_0x3d10d3))[_0x0a8f('0xb3')](loggerCatch(_0x0a8f('0xcd')));};Dialer['prototype'][_0x0a8f('0xce')]=function(_0x121bf7){return BPromise[_0x0a8f('0xb9')]()[_0x0a8f('0xba')](cmHopper[_0x0a8f('0xce')](_0x121bf7))[_0x0a8f('0xb3')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer['prototype'][_0x0a8f('0xcf')]=function(_0x4d295c){return BPromise[_0x0a8f('0xb9')]()[_0x0a8f('0xba')](cmHopperHistory[_0x0a8f('0xcf')](_0x4d295c))['catch'](loggerCatch(_0x0a8f('0xd0')));};Dialer['prototype'][_0x0a8f('0xb5')]=function(_0x39156c){if(!_['isUndefined'](_0x39156c)&&_0x39156c!==null){if(typeof _0x39156c['originated']!=='undefined'){if(_0x39156c[_0x0a8f('0x6f')]>0x0){_0x39156c['originated']-=0x1;}else{logger['error'](_0x0a8f('0xd1'));}}}else{logger[_0x0a8f('0x93')](_0x0a8f('0xd2'));}};Dialer[_0x0a8f('0xab')]['loggerHandler']=function(_0x329ccf,_0x218c10){var _0x17af43=this;return function(_0x337609){_0x17af43['updateOriginated'](_0x218c10);logger[_0x0a8f('0x93')](_0x329ccf,util[_0x0a8f('0x95')](_0x337609,{'showHidden':![],'depth':null}));};};Dialer['prototype']['emptyContact']=function(_0x1e83a6,_0x24d456,_0x5e7fbf){var _0x360644={'state':0x19,'statedesc':_0x0a8f('0xd3')};this[_0x0a8f('0xb5')](_0x24d456);this[_0x0a8f('0xd4')](_[_0x0a8f('0x8c')](_0x360644,_[_0x0a8f('0xd5')](_0x5e7fbf,['ContactId',_0x0a8f('0xd6'),_0x0a8f('0xd7'),_0x0a8f('0xd8'),_0x0a8f('0xd9')])),_0x0a8f('0xda'),_0x0a8f('0xdb'));logger['error'](_0x1e83a6);};Dialer['prototype'][_0x0a8f('0xdc')]=function(_0x46cfe4){return _0x46cfe4===_0x0a8f('0xdd');};Dialer['prototype']['isTrunkReachable']=function(_0x5ac2c4){return!_['isUndefined'](_0x5ac2c4)&&_0x5ac2c4&&!_[_0x0a8f('0x37')](_0x5ac2c4[_0x0a8f('0x3a')])&&!_[_0x0a8f('0x37')](_0x5ac2c4[_0x0a8f('0x74')])&&_0x5ac2c4[_0x0a8f('0x74')]&&(this[_0x0a8f('0x1c')][util['format']('SIP/%s',_0x5ac2c4[_0x0a8f('0x3a')])][_0x0a8f('0xde')]===_0x0a8f('0xdf')||this['trunks'][util['format'](_0x0a8f('0xe0'),_0x5ac2c4[_0x0a8f('0x3a')])][_0x0a8f('0xde')]===_0x0a8f('0xe1'));};Dialer[_0x0a8f('0xab')]['saveInDb']=function(_0x19e037,_0x28b028,_0x21a8f0){this['createHistory'](_0x19e037)[_0x0a8f('0xb3')](loggerCatch(_0x28b028));this[_0x0a8f('0xce')](_0x19e037)['catch'](loggerCatch(_0x21a8f0));};Dialer['prototype']['syncVarSet']=function(_0x2d9f2d){var _0x583f29=this[_0x0a8f('0xe2')][_0x2d9f2d[_0x0a8f('0xe3')]];var _0x311eae;if(!_[_0x0a8f('0xb1')](_0x2d9f2d)&&!_[_0x0a8f('0xb1')](_0x2d9f2d[_0x0a8f('0xe4')])&&!_[_0x0a8f('0xb1')](_0x2d9f2d['variable'][_0x0a8f('0xe5')])&&_0x2d9f2d[_0x0a8f('0xe6')]===_0x0a8f('0xe7')&&_0x583f29){if(_0x583f29['type']!==_0x0a8f('0x79')&&this['voiceQueues'][_0x583f29[_0x0a8f('0xb6')]][_0x0a8f('0xe8')]&&_0x2d9f2d[_0x0a8f('0xe9')]==='HANGUP'){delete this[_0x0a8f('0xe2')][_0x2d9f2d[_0x0a8f('0xe3')]];this[_0x0a8f('0xb5')](this['voiceQueues'][_0x583f29[_0x0a8f('0xb6')]]);this[_0x0a8f('0x19')][_0x583f29[_0x0a8f('0xb6')]][_0x0a8f('0x59')]+=0x1;this[_0x0a8f('0x19')][_0x583f29[_0x0a8f('0xb6')]][_0x0a8f('0x58')]+=0x1;_0x311eae=new Hangup(_0x583f29,_0x2d9f2d);_0x311eae[_0x0a8f('0xa7')]=0x12;_0x311eae[_0x0a8f('0xa8')]=_0x0a8f('0xea');_0x311eae[_0x0a8f('0xeb')]=_0x0a8f('0xec');ami['emit'](_0x0a8f('0xed'),ut[_0x0a8f('0xee')](_0x311eae,'amd'));this[_0x0a8f('0xd4')](_0x311eae,_0x0a8f('0xef'),'[syncHangupInAMD]');}if(_0x583f29['type']!==_0x0a8f('0x79')&&this[_0x0a8f('0x19')][_0x583f29[_0x0a8f('0xb6')]][_0x0a8f('0xe8')]&&_0x2d9f2d['value']===_0x0a8f('0xf0')){var _0x4f7cdd=this;return new BPromise(function(_0x55bb11,_0x2b071e){delete _0x4f7cdd['uniqueId'][_0x2d9f2d[_0x0a8f('0xe3')]];_0x4f7cdd['updateOriginated'](_0x4f7cdd[_0x0a8f('0x19')][_0x583f29[_0x0a8f('0xb6')]]);_0x4f7cdd[_0x0a8f('0x19')][_0x583f29[_0x0a8f('0xb6')]]['outboundAnswerCallsDay']+=0x1;_0x4f7cdd['voiceQueues'][_0x583f29['queue']]['outboundAnswerAgiCallsDay']+=0x1;var _0x2fb127=_0x4f7cdd['voiceQueues'][_0x583f29['queue']];var _0xb5517f=new Hangup(_0x583f29,_0x2d9f2d);_0xb5517f[_0x0a8f('0xa7')]=0x13;_0xb5517f[_0x0a8f('0xa8')]=_0x0a8f('0xf1');_0xb5517f[_0x0a8f('0xeb')]=_0x0a8f('0xec');_0xb5517f[_0x0a8f('0xf2')]+=0x1;_0xb5517f[_0x0a8f('0xf3')]+=0x1;_0xb5517f[_0x0a8f('0xf4')]=!![];ami[_0x0a8f('0xf5')](_0x0a8f('0xed'),ut[_0x0a8f('0xee')](_0xb5517f,_0x0a8f('0xf4')));_0x4f7cdd['createHistory'](_0xb5517f)[_0x0a8f('0xb3')](loggerCatch(_0x0a8f('0xf6')));if(_0xb5517f['countbusyretry']+_0xb5517f['countcongestionretry']+_0xb5517f[_0x0a8f('0xf7')]+_0xb5517f['countnosuchnumberretry']+_0xb5517f[_0x0a8f('0xf8')]+_0xb5517f[_0x0a8f('0xf9')]+_0xb5517f[_0x0a8f('0xf2')]+_0xb5517f['countagentrejectretry']>=_0x2fb127[_0x0a8f('0xfa')]){_0x4f7cdd[_0x0a8f('0xfb')](_0xb5517f,_0x55bb11,_0x2b071e,_0x0a8f('0xfc'));}else{if(_0xb5517f['countmachineretry']>=_0x2fb127['dialMachineMaxRetry']){_0x4f7cdd[_0x0a8f('0xfd')](_0xb5517f,_0x55bb11,_0x2b071e,_0x0a8f('0xfe'));}else{_0x4f7cdd[_0x0a8f('0xc3')]({'active':![],'countmachineretry':_0xb5517f[_0x0a8f('0xf2')],'scheduledat':moment()[_0x0a8f('0xff')](_0x2fb127[_0x0a8f('0x100')],_0x0a8f('0x101'))[_0x0a8f('0x77')](_0x0a8f('0x102')),'ContactId':_0xb5517f[_0x0a8f('0x103')],'ListId':_0xb5517f['ListId'],'VoiceQueueId':_0xb5517f['VoiceQueueId']||undefined,'CampaignId':_0xb5517f[_0x0a8f('0xd9')]||undefined})[_0x0a8f('0xb3')](loggerCatch(_0x0a8f('0x104')));_0x55bb11({'reschedule':0x1});}}});}if(_0x583f29['type']===_0x0a8f('0x79')&&this[_0x0a8f('0x1a')][_0x583f29[_0x0a8f('0xb6')]]['dialAMDActive']&&_0x2d9f2d[_0x0a8f('0xe9')]==='HANGUP'){delete this[_0x0a8f('0xe2')][_0x2d9f2d[_0x0a8f('0xe3')]];this['updateOriginated'](this[_0x0a8f('0x1a')][_0x583f29[_0x0a8f('0xb6')]]);_0x311eae=new Hangup(_0x583f29,_0x2d9f2d);_0x311eae[_0x0a8f('0xa7')]=0x12;_0x311eae[_0x0a8f('0xa8')]=_0x0a8f('0xea');_0x311eae[_0x0a8f('0xeb')]='AMD';ami[_0x0a8f('0xf5')](_0x0a8f('0xed'),ut[_0x0a8f('0xee')](_0x311eae,_0x0a8f('0xf4')));this[_0x0a8f('0xd4')](_0x311eae,'[syncHangupInAMDIvr][createHistory]',_0x0a8f('0x105'));}if(_0x583f29[_0x0a8f('0x48')]===_0x0a8f('0x79')&&this[_0x0a8f('0x1a')][_0x583f29[_0x0a8f('0xb6')]][_0x0a8f('0xe8')]&&_0x2d9f2d[_0x0a8f('0xe9')]==='MACHINE'){var _0x4f7cdd=this;return new BPromise(function(_0x3a3d69,_0x235b50){delete _0x4f7cdd[_0x0a8f('0xe2')][_0x2d9f2d['uniqueid']];_0x4f7cdd[_0x0a8f('0xb5')](_0x4f7cdd[_0x0a8f('0x1a')][_0x583f29[_0x0a8f('0xb6')]]);_0x4f7cdd['campaigns'][_0x583f29[_0x0a8f('0xb6')]]['outboundAnswerCallsDay']+=0x1;_0x4f7cdd[_0x0a8f('0x1a')][_0x583f29[_0x0a8f('0xb6')]][_0x0a8f('0x58')]+=0x1;var _0x14c6da=_0x4f7cdd[_0x0a8f('0x1a')][_0x583f29[_0x0a8f('0xb6')]];var _0x303da1=new Hangup(_0x583f29,_0x2d9f2d);_0x303da1[_0x0a8f('0xa7')]=0x13;_0x303da1[_0x0a8f('0xa8')]='Machine';_0x303da1[_0x0a8f('0xeb')]=_0x0a8f('0xec');_0x303da1[_0x0a8f('0xf2')]+=0x1;_0x303da1[_0x0a8f('0xf3')]+=0x1;_0x303da1[_0x0a8f('0xf4')]=!![];ami[_0x0a8f('0xf5')]('custom:amd',ut['buildObj'](_0x303da1,_0x0a8f('0xf4')));_0x4f7cdd[_0x0a8f('0xcf')](_0x303da1)[_0x0a8f('0xb3')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x303da1[_0x0a8f('0x106')]+_0x303da1[_0x0a8f('0x107')]+_0x303da1[_0x0a8f('0xf7')]+_0x303da1[_0x0a8f('0x108')]+_0x303da1[_0x0a8f('0xf8')]+_0x303da1['countabandonedretry']+_0x303da1[_0x0a8f('0xf2')]+_0x303da1[_0x0a8f('0x109')]>=_0x14c6da['dialGlobalMaxRetry']){_0x4f7cdd[_0x0a8f('0xfb')](_0x303da1,_0x3a3d69,_0x235b50,_0x0a8f('0xfc'));}else{if(_0x303da1[_0x0a8f('0xf2')]>=_0x14c6da[_0x0a8f('0x10a')]){_0x4f7cdd['createStateFinal'](_0x303da1,_0x3a3d69,_0x235b50,_0x0a8f('0xfe'));}else{_0x4f7cdd['rescheduleContact']({'active':![],'countmachineretry':_0x303da1['countmachineretry'],'scheduledat':moment()[_0x0a8f('0xff')](_0x14c6da[_0x0a8f('0x100')],'minutes')['format'](_0x0a8f('0x102')),'ContactId':_0x303da1[_0x0a8f('0x103')],'ListId':_0x303da1[_0x0a8f('0xd6')],'VoiceQueueId':_0x303da1[_0x0a8f('0xd8')]||undefined,'CampaignId':_0x303da1['CampaignId']||undefined})[_0x0a8f('0xb3')](loggerCatch(_0x0a8f('0x104')));_0x3a3d69({'reschedule':0x1});}}});}}};Dialer['prototype'][_0x0a8f('0x10b')]=function(_0x4cb879){var _0xd463f6=this[_0x0a8f('0xe2')][_0x4cb879['uniqueid']];var _0xa2fbc7=this;var _0x358eb9;if(_0xd463f6&&_0xd463f6[_0x0a8f('0x48')]==='ivr'){delete this[_0x0a8f('0xe2')][_0x4cb879['uniqueid']];this[_0x0a8f('0xb5')](this[_0x0a8f('0x1a')][_0xd463f6[_0x0a8f('0xb6')]]);this[_0x0a8f('0x1a')][_0xd463f6[_0x0a8f('0xb6')]][_0x0a8f('0x10c')]+=0x1;_0x358eb9=new Hangup(_0xd463f6,_0x4cb879);this[_0x0a8f('0xcf')](_0x358eb9)[_0x0a8f('0xb3')](loggerCatch(_0x0a8f('0x10d')));this[_0x0a8f('0xce')](_0x358eb9)['catch'](loggerCatch(_0x0a8f('0x10e')));}if(_0xd463f6&&_0xd463f6[_0x0a8f('0x48')]!==_0x0a8f('0x79')&&isNotNull(this[_0x0a8f('0x19')][_0xd463f6[_0x0a8f('0xb6')]][_0x0a8f('0x10f')])){delete this[_0x0a8f('0xe2')][_0x4cb879[_0x0a8f('0xe3')]];this[_0x0a8f('0xb5')](this[_0x0a8f('0x19')][_0xd463f6['queue']]);this['voiceQueues'][_0xd463f6[_0x0a8f('0xb6')]][_0x0a8f('0x59')]+=0x1;this[_0x0a8f('0x19')][_0xd463f6[_0x0a8f('0xb6')]][_0x0a8f('0x58')]+=0x1;_0x358eb9=new Hangup(_0xd463f6,_0x4cb879);_0x358eb9['state']=0x10;_0x358eb9[_0x0a8f('0xa8')]='AnswerAGI';_0x358eb9[_0x0a8f('0xeb')]=_0x0a8f('0x110');this[_0x0a8f('0xcf')](_0x358eb9)[_0x0a8f('0xb3')](loggerCatch(_0x0a8f('0x10d')));this[_0x0a8f('0xce')](_0x358eb9)[_0x0a8f('0xb3')](loggerCatch(_0x0a8f('0x10e')));}if(_0xd463f6&&_0xd463f6['type']!=='ivr'&&!isNotNull(this['voiceQueues'][_0xd463f6[_0x0a8f('0xb6')]]['dialQueueProject'])){delete this[_0x0a8f('0xe2')][_0x4cb879['uniqueid']];this['updateOriginated'](this[_0x0a8f('0x19')][_0xd463f6[_0x0a8f('0xb6')]]);this[_0x0a8f('0x19')][_0xd463f6['queue']][_0x0a8f('0x63')]+=0x1;_0x358eb9=new Hangup(_0xd463f6,_0x4cb879);_0x358eb9['state']=0xc;_0x358eb9[_0x0a8f('0xa8')]=_0x4cb879[_0x0a8f('0x111')];_0x358eb9[_0x0a8f('0xeb')]='Unknow';this['createHistory'](_0x358eb9)[_0x0a8f('0xb3')](loggerCatch(_0x0a8f('0x10d')));this[_0x0a8f('0xce')](_0x358eb9)[_0x0a8f('0xb3')](loggerCatch(_0x0a8f('0x10e')));}};Dialer['prototype']['syncAgentComplete']=function(_0x2bafb4){var _0x5a3b11=this[_0x0a8f('0xe2')][_0x2bafb4['uniqueid']];var _0x423f70=this;if(this['voiceQueues'][_0x2bafb4['queue']]){if(_0x5a3b11&&_0x5a3b11[_0x0a8f('0x48')]!==_0x0a8f('0x79')){delete this[_0x0a8f('0xe2')][_0x2bafb4[_0x0a8f('0xe3')]];this[_0x0a8f('0x19')][_0x2bafb4[_0x0a8f('0xb6')]][_0x0a8f('0x59')]+=0x1;var _0xda4a84=new AgentComplete(_0x5a3b11,_0x2bafb4);if(_0x2bafb4['reason']==='agent'){_0xda4a84['agiafterat']=this['voiceQueues'][_0x2bafb4['queue']][_0x0a8f('0x112')]&&this[_0x0a8f('0x19')][_0x2bafb4[_0x0a8f('0xb6')]][_0x0a8f('0x113')]?moment()[_0x0a8f('0x77')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this[_0x0a8f('0xcf')](_0xda4a84)[_0x0a8f('0xb3')](loggerCatch('[syncAgentComplete][createHistory]'));this['moveContactManagedDialer'](_0xda4a84)[_0x0a8f('0xb3')](loggerCatch(_0x0a8f('0x114')));}}};Dialer['prototype'][_0x0a8f('0x115')]=function(_0x5c2e4f){if(this['voiceQueues'][_0x5c2e4f[_0x0a8f('0xb6')]]){if(this[_0x0a8f('0xe2')][_0x5c2e4f[_0x0a8f('0xe3')]]&&this[_0x0a8f('0xe2')][_0x5c2e4f[_0x0a8f('0xe3')]][_0x0a8f('0x48')]!==_0x0a8f('0x79')){this[_0x0a8f('0xb5')](this[_0x0a8f('0x19')][_0x5c2e4f[_0x0a8f('0xb6')]]);this['uniqueId'][_0x5c2e4f[_0x0a8f('0xe3')]][_0x0a8f('0x116')]=moment()[_0x0a8f('0x77')](_0x0a8f('0x102'));}}};Dialer[_0x0a8f('0xab')][_0x0a8f('0x117')]=function(_0x494aee){this[_0x0a8f('0xcf')](_0x494aee)['catch'](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x0a8f('0xce')](_0x494aee)[_0x0a8f('0xb3')](loggerCatch(_0x0a8f('0x118')));};Dialer[_0x0a8f('0xab')][_0x0a8f('0x29')]=function(_0x3eaa8e){var _0x364575=this[_0x0a8f('0xe2')][_0x3eaa8e[_0x0a8f('0xe3')]];var _0x22b1e1=this;if(this[_0x0a8f('0x19')][_0x3eaa8e[_0x0a8f('0xb6')]]){if(_0x364575&&_0x364575[_0x0a8f('0x48')]!==_0x0a8f('0x79')){delete this[_0x0a8f('0xe2')][_0x3eaa8e[_0x0a8f('0xe3')]];this[_0x0a8f('0xb5')](this[_0x0a8f('0x19')][_0x3eaa8e[_0x0a8f('0xb6')]]);_0x364575[_0x0a8f('0x119')]=moment()[_0x0a8f('0x77')](_0x0a8f('0x102'));var _0x322483=new QueueCallerAbandon(_0x364575,_0x3eaa8e);if(getSeconds(_0x364575[_0x0a8f('0x119')],_0x364575[_0x0a8f('0x11a')])>=_0x364575[_0x0a8f('0x11b')]){this[_0x0a8f('0x19')][_0x3eaa8e[_0x0a8f('0xb6')]][_0x0a8f('0x68')]+=0x1;this[_0x0a8f('0x19')][_0x3eaa8e['queue']][_0x0a8f('0x5e')]+=0x1;this[_0x0a8f('0x19')][_0x3eaa8e[_0x0a8f('0xb6')]][_0x0a8f('0x6a')]+=0x1;_0x322483[_0x0a8f('0xa7')]=0xa;_0x322483[_0x0a8f('0xa8')]=_0x0a8f('0x11c');_0x322483[_0x0a8f('0x11d')]=_0x0a8f('0x11e');_0x322483[_0x0a8f('0x11f')]=this['voiceQueues'][_0x3eaa8e[_0x0a8f('0xb6')]][_0x0a8f('0x112')]?moment()[_0x0a8f('0x77')](_0x0a8f('0x102')):undefined;_0x322483['countdropretry']+=0x1;_0x322483[_0x0a8f('0xf3')]+=0x1;if(_0x322483[_0x0a8f('0xf8')]>=this[_0x0a8f('0x19')][_0x3eaa8e[_0x0a8f('0xb6')]][_0x0a8f('0x120')]){this[_0x0a8f('0x117')](_0x322483);}else{this[_0x0a8f('0xc3')]({'active':![],'countdropretry':_0x322483[_0x0a8f('0xf8')],'scheduledat':moment()[_0x0a8f('0xff')](this[_0x0a8f('0x19')][_0x3eaa8e[_0x0a8f('0xb6')]][_0x0a8f('0x121')],_0x0a8f('0x101'))['format'](_0x0a8f('0x102')),'ContactId':_0x364575[_0x0a8f('0x103')],'ListId':_0x364575['ListId'],'VoiceQueueId':_0x364575[_0x0a8f('0xd8')]||undefined,'CampaignId':_0x364575['CampaignId']||undefined})['catch'](loggerCatch(_0x0a8f('0x122')));var _0x321131=new History(_0x322483);_0x321131[_0x0a8f('0xa7')]=0xa;_0x321131[_0x0a8f('0xa8')]='Drop';_0x321131['starttime']=moment()[_0x0a8f('0x77')](_0x0a8f('0x102'));_0x321131[_0x0a8f('0xa9')]=_0x321131[_0x0a8f('0xaa')];_0x321131[_0x0a8f('0x123')]=_0x322483['calleridname'];_0x321131[_0x0a8f('0x124')]=_0x322483[_0x0a8f('0x124')];this[_0x0a8f('0xcf')](_0x321131)['catch'](loggerCatch(_0x0a8f('0x125')));}}else{this['voiceQueues'][_0x3eaa8e[_0x0a8f('0xb6')]][_0x0a8f('0x67')]+=0x1;this['voiceQueues'][_0x3eaa8e[_0x0a8f('0xb6')]]['outboundDropCallsDayCallersExit']+=0x1;_0x322483[_0x0a8f('0xa7')]=0xb;_0x322483['statedesc']=_0x0a8f('0x126');_0x322483[_0x0a8f('0x11d')]=_0x0a8f('0x127');_0x322483[_0x0a8f('0xf9')]+=0x1;_0x322483[_0x0a8f('0xf3')]+=0x1;if(_0x322483[_0x0a8f('0xf9')]>=this[_0x0a8f('0x19')][_0x3eaa8e[_0x0a8f('0xb6')]]['dialAbandonedMaxRetry']){this[_0x0a8f('0x117')](_0x322483);}else{this[_0x0a8f('0xc3')]({'active':![],'countabandonedretry':_0x322483['countabandonedretry'],'scheduledat':moment()[_0x0a8f('0xff')](this[_0x0a8f('0x19')][_0x3eaa8e[_0x0a8f('0xb6')]][_0x0a8f('0x128')],_0x0a8f('0x101'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x364575[_0x0a8f('0x103')],'ListId':_0x364575[_0x0a8f('0xd6')],'VoiceQueueId':_0x364575[_0x0a8f('0xd8')]||undefined,'CampaignId':_0x364575[_0x0a8f('0xd9')]||undefined})['catch'](loggerCatch(_0x0a8f('0x129')));var _0x321131=new History(_0x322483);_0x321131[_0x0a8f('0xa7')]=0xb;_0x321131['statedesc']='Abandoned';_0x321131['starttime']=moment()[_0x0a8f('0x77')]('YYYY-MM-DD\x20HH:mm:ss');_0x321131[_0x0a8f('0xa9')]=_0x321131[_0x0a8f('0xaa')];_0x321131[_0x0a8f('0x123')]=_0x322483[_0x0a8f('0x123')];_0x321131['calleridnum']=_0x322483[_0x0a8f('0x124')];this[_0x0a8f('0xcf')](_0x321131)[_0x0a8f('0xb3')](loggerCatch(_0x0a8f('0x12a')));}}}}};Dialer[_0x0a8f('0xab')]['syncNewExten']=function(_0xad0270){if(this[_0x0a8f('0x1f')][_0xad0270[_0x0a8f('0xe3')]]){this[_0x0a8f('0x1f')][_0xad0270[_0x0a8f('0xe3')]][_0x0a8f('0xb2')]=_0xad0270[_0x0a8f('0xb2')];}if(this[_0x0a8f('0xe2')][_0xad0270[_0x0a8f('0xe3')]]){this[_0x0a8f('0xe2')][_0xad0270[_0x0a8f('0xe3')]][_0x0a8f('0xb2')]=_0xad0270[_0x0a8f('0xb2')];}};Dialer['prototype'][_0x0a8f('0x33')]=function(_0x16fa77){if(strategy[this[_0x0a8f('0x19')][this['actions'][_0x16fa77[_0x0a8f('0x12b')]][_0x0a8f('0xb6')]][_0x0a8f('0x12c')]]===_0x0a8f('0x12d')){if(this['actions'][_0x16fa77[_0x0a8f('0x12b')]]&&_['isNil'](this[_0x0a8f('0x1f')][_0x16fa77[_0x0a8f('0x12b')]][_0x0a8f('0x12e')])&&_0x16fa77[_0x0a8f('0xde')]==='1'&&_0x16fa77[_0x0a8f('0x12f')]==='0'){if(this[_0x0a8f('0x1b')][_0x16fa77[_0x0a8f('0x130')]]){if(!this['agents'][_0x16fa77[_0x0a8f('0x130')]][_0x0a8f('0x12e')]){this[_0x0a8f('0x1b')][_0x16fa77[_0x0a8f('0x130')]][_0x0a8f('0x12e')]=!![];this['actions'][_0x16fa77['actionid']][_0x0a8f('0x12e')]=!![];this[_0x0a8f('0x1f')][_0x16fa77[_0x0a8f('0x12b')]][_0x0a8f('0x130')]=_0x16fa77[_0x0a8f('0x130')];}}}}else if((strategy[this['voiceQueues'][this[_0x0a8f('0x1f')][_0x16fa77[_0x0a8f('0x12b')]][_0x0a8f('0xb6')]][_0x0a8f('0x12c')]]||_0x0a8f('0x14'))===_0x0a8f('0x14')){if(this['actions'][_0x16fa77[_0x0a8f('0x12b')]]){if(this[_0x0a8f('0x1b')][_0x16fa77[_0x0a8f('0x130')]]){this['actions'][_0x16fa77['actionid']][_0x0a8f('0x130')]=_0x16fa77['stateinterface'];if(_['isNil'](this[_0x0a8f('0x25')][this[_0x0a8f('0x1f')][_0x16fa77[_0x0a8f('0x12b')]][_0x0a8f('0xb6')]])){this[_0x0a8f('0x25')][this[_0x0a8f('0x1f')][_0x16fa77[_0x0a8f('0x12b')]]['queue']]=[];}this['queueBooked'][this['actions'][_0x16fa77['actionid']]['queue']][_0x0a8f('0x131')](_[_0x0a8f('0x8c')](_[_0x0a8f('0xd5')](this[_0x0a8f('0x1f')][_0x16fa77['actionid']],[_0x0a8f('0x132'),_0x0a8f('0x130')]),{'status':_0x16fa77[_0x0a8f('0xde')],'paused':_0x16fa77[_0x0a8f('0x12f')]}));}}}};function unlockQueueStatus(_0x84a6bf,_0x2d7fe8){setTimeout(function(){if(_[_0x0a8f('0x37')](_0x84a6bf[_0x0a8f('0x133')])){loggerBooked[_0x0a8f('0x93')](_0x0a8f('0x134'),_0x2d7fe8);}_0x84a6bf['queueStatusComplete']=!![];loggerBooked['info'](_0x0a8f('0x135'),_0x2d7fe8,JSON[_0x0a8f('0x45')](_[_0x0a8f('0xd5')](_0x84a6bf,[_0x0a8f('0x3a'),_0x0a8f('0x133')])));},0x1f3);}Dialer[_0x0a8f('0xab')]['syncQueueStatusComplete']=function(_0x239602){var _0x2647ac=this;var _0x52c712=_0x2647ac[_0x0a8f('0x19')][_0x2647ac[_0x0a8f('0x1f')][_0x239602[_0x0a8f('0x12b')]][_0x0a8f('0xb6')]];if(strategy[this[_0x0a8f('0x19')][this[_0x0a8f('0x1f')][_0x239602[_0x0a8f('0x12b')]][_0x0a8f('0xb6')]][_0x0a8f('0x12c')]]===_0x0a8f('0x12d')){if(this[_0x0a8f('0x1f')][_0x239602['actionid']]&&this[_0x0a8f('0x1f')][_0x239602[_0x0a8f('0x12b')]][_0x0a8f('0x130')]){this[_0x0a8f('0x18')][_0x0a8f('0x136')](this[_0x0a8f('0x1f')][_0x239602[_0x0a8f('0x12b')]][_0x0a8f('0x132')],this[_0x0a8f('0x1f')][_0x239602[_0x0a8f('0x12b')]][_0x0a8f('0x130')])[_0x0a8f('0xb3')](function(_0xfcb746){logger[_0x0a8f('0x93')]('[Catch][Preview][syncQueueStatusComplete]',util['inspect'](_0xfcb746,{'showHidden':![],'depth':null}));})[_0x0a8f('0x17')](function(){_0x2647ac[_0x0a8f('0xb5')](_0x2647ac[_0x0a8f('0x19')][_0x2647ac[_0x0a8f('0x1f')][_0x239602[_0x0a8f('0x12b')]]['queue']]);_0x2647ac[_0x0a8f('0x1b')][_0x2647ac[_0x0a8f('0x1f')][_0x239602[_0x0a8f('0x12b')]][_0x0a8f('0x130')]][_0x0a8f('0x12e')]=![];delete _0x2647ac[_0x0a8f('0x1f')][_0x239602[_0x0a8f('0x12b')]];unlockQueueStatus(_0x52c712);});}else{this[_0x0a8f('0xb5')](this['voiceQueues'][this[_0x0a8f('0x1f')][_0x239602['actionid']][_0x0a8f('0xb6')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0x0a8f('0x1f')][_0x239602['actionid']][_0x0a8f('0x103')],'ListId':this[_0x0a8f('0x1f')][_0x239602['actionid']][_0x0a8f('0xd6')],'VoiceQueueId':this['actions'][_0x239602[_0x0a8f('0x12b')]]['VoiceQueueId']||undefined,'CampaignId':this['actions'][_0x239602[_0x0a8f('0x12b')]][_0x0a8f('0xd9')]||undefined})[_0x0a8f('0xb3')](loggerCatch(_0x0a8f('0x137')));delete this['actions'][_0x239602[_0x0a8f('0x12b')]];unlockQueueStatus(_0x52c712);}}else if((strategy[this[_0x0a8f('0x19')][this[_0x0a8f('0x1f')][_0x239602[_0x0a8f('0x12b')]]['queue']][_0x0a8f('0x12c')]]||_0x0a8f('0x14'))==='rrmemory'){var _0x2d20ac;if(this[_0x0a8f('0x1f')][_0x239602[_0x0a8f('0x12b')]]&&!_[_0x0a8f('0x42')](this[_0x0a8f('0x25')][this['actions'][_0x239602[_0x0a8f('0x12b')]][_0x0a8f('0xb6')]])){if(this[_0x0a8f('0x26')][_0x2647ac[_0x0a8f('0x1f')][_0x239602[_0x0a8f('0x12b')]]['queue']]){this['queueBookedRR'][_0x2647ac[_0x0a8f('0x1f')][_0x239602['actionid']][_0x0a8f('0xb6')]]=this['queueBookedRR'][this[_0x0a8f('0x1f')][_0x239602[_0x0a8f('0x12b')]][_0x0a8f('0xb6')]]?this[_0x0a8f('0x26')][this['actions'][_0x239602[_0x0a8f('0x12b')]][_0x0a8f('0xb6')]]:this[_0x0a8f('0x25')][this[_0x0a8f('0x1f')][_0x239602[_0x0a8f('0x12b')]][_0x0a8f('0xb6')]]?this[_0x0a8f('0x25')][this[_0x0a8f('0x1f')][_0x239602[_0x0a8f('0x12b')]][_0x0a8f('0xb6')]][_0x0a8f('0x138')]||0x0:0x0;}this[_0x0a8f('0x25')][this[_0x0a8f('0x1f')][_0x239602['actionid']][_0x0a8f('0xb6')]][_0x0a8f('0x138')]=this[_0x0a8f('0x26')][this[_0x0a8f('0x1f')][_0x239602['actionid']]['queue']];for(var _0x2eecd6=0x0;_0x2eecd6<this[_0x0a8f('0x25')][this[_0x0a8f('0x1f')][_0x239602[_0x0a8f('0x12b')]][_0x0a8f('0xb6')]]['length'];_0x2eecd6+=0x1){_0x2d20ac=rr(this[_0x0a8f('0x25')][this[_0x0a8f('0x1f')][_0x239602[_0x0a8f('0x12b')]][_0x0a8f('0xb6')]]);this[_0x0a8f('0x26')][_0x2647ac['actions'][_0x239602[_0x0a8f('0x12b')]][_0x0a8f('0xb6')]]=this[_0x0a8f('0x25')][this[_0x0a8f('0x1f')][_0x239602['actionid']][_0x0a8f('0xb6')]][_0x0a8f('0x138')];if(_0x2d20ac['status']==='1'&&_0x2d20ac['paused']==='0'){break;}}if(!_['isNil'](_0x2d20ac)){this[_0x0a8f('0x1b')][_0x2d20ac[_0x0a8f('0x130')]]['unlockRR']=_[_0x0a8f('0x37')](this['agents'][_0x2d20ac[_0x0a8f('0x130')]][_0x0a8f('0x139')])?!![]:this['agents'][_0x2d20ac[_0x0a8f('0x130')]][_0x0a8f('0x139')];}loggerBooked[_0x0a8f('0x7c')](_0x0a8f('0x13a'),_0x239602[_0x0a8f('0x12b')],_0x0a8f('0x13b'),JSON[_0x0a8f('0x45')](_['pick'](this[_0x0a8f('0x1b')][_0x2d20ac[_0x0a8f('0x130')]],[_0x0a8f('0x3a'),'unlockRR'])),_0x0a8f('0x13c'),JSON[_0x0a8f('0x45')](_0x2d20ac['idHopper']));if(!_[_0x0a8f('0xb1')](_0x2d20ac)&&_0x2d20ac[_0x0a8f('0xde')]==='1'&&_0x2d20ac[_0x0a8f('0x12f')]==='0'&&this[_0x0a8f('0x1b')][_0x2d20ac[_0x0a8f('0x130')]][_0x0a8f('0x139')]){this[_0x0a8f('0x1b')][_0x2d20ac[_0x0a8f('0x130')]]['unlockRR']=![];this[_0x0a8f('0x25')][_0x2647ac[_0x0a8f('0x1f')][_0x239602['actionid']][_0x0a8f('0xb6')]]=[];this[_0x0a8f('0x18')][_0x0a8f('0x136')](_0x2d20ac[_0x0a8f('0x132')],_0x2d20ac[_0x0a8f('0x130')])[_0x0a8f('0xb3')](function(_0x3c8a72){logger[_0x0a8f('0x93')](_0x0a8f('0x13d'),util['inspect'](_0x3c8a72,{'showHidden':![],'depth':null}));})[_0x0a8f('0x17')](function(){_0x2647ac[_0x0a8f('0xb5')](_0x2647ac[_0x0a8f('0x19')][_0x2647ac['actions'][_0x239602[_0x0a8f('0x12b')]][_0x0a8f('0xb6')]]);setTimeout(function(){_0x2647ac[_0x0a8f('0x1b')][_0x2d20ac['stateinterface']]['unlockRR']=!![];loggerBooked[_0x0a8f('0x7c')]('[booked][RR][finaly]',_0x239602[_0x0a8f('0x12b')],_0x0a8f('0x13b'),JSON[_0x0a8f('0x45')](_['pick'](_0x2647ac[_0x0a8f('0x1b')][_0x2d20ac[_0x0a8f('0x130')]],[_0x0a8f('0x3a'),_0x0a8f('0x139')])),'contactAgent-idHopper:\x20',JSON[_0x0a8f('0x45')](_0x2d20ac[_0x0a8f('0x132')]));},0xc7);delete _0x2647ac[_0x0a8f('0x1f')][_0x239602['actionid']];unlockQueueStatus(_0x52c712,_0x239602[_0x0a8f('0x12b')]);});}else{loggerBooked[_0x0a8f('0x7c')](_0x0a8f('0x13e'));this['updateOriginated'](this[_0x0a8f('0x19')][this[_0x0a8f('0x1f')][_0x239602[_0x0a8f('0x12b')]][_0x0a8f('0xb6')]]);this[_0x0a8f('0xc3')]({'active':![],'ContactId':this[_0x0a8f('0x1f')][_0x239602[_0x0a8f('0x12b')]][_0x0a8f('0x103')],'ListId':this[_0x0a8f('0x1f')][_0x239602['actionid']][_0x0a8f('0xd6')],'VoiceQueueId':this[_0x0a8f('0x1f')][_0x239602[_0x0a8f('0x12b')]][_0x0a8f('0xd8')]||undefined,'CampaignId':this['actions'][_0x239602['actionid']]['CampaignId']||undefined})['catch'](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0x0a8f('0x1f')][_0x239602[_0x0a8f('0x12b')]];unlockQueueStatus(_0x52c712);}}else{loggerBooked[_0x0a8f('0x7c')](_0x0a8f('0x13f'));this[_0x0a8f('0xb5')](this['voiceQueues'][this[_0x0a8f('0x1f')][_0x239602[_0x0a8f('0x12b')]]['queue']]);this[_0x0a8f('0xc3')]({'active':![],'ContactId':this[_0x0a8f('0x1f')][_0x239602[_0x0a8f('0x12b')]]['ContactId'],'ListId':this[_0x0a8f('0x1f')][_0x239602['actionid']][_0x0a8f('0xd6')],'VoiceQueueId':this[_0x0a8f('0x1f')][_0x239602['actionid']][_0x0a8f('0xd8')]||undefined,'CampaignId':this[_0x0a8f('0x1f')][_0x239602[_0x0a8f('0x12b')]]['CampaignId']||undefined})[_0x0a8f('0xb3')](loggerCatch(_0x0a8f('0x140')));delete this[_0x0a8f('0x1f')][_0x239602[_0x0a8f('0x12b')]];unlockQueueStatus(_0x52c712);}}else{loggerBooked[_0x0a8f('0x7c')](_0x0a8f('0x141'));this[_0x0a8f('0xb5')](this['voiceQueues'][this['actions'][_0x239602[_0x0a8f('0x12b')]]['queue']]);this[_0x0a8f('0xc3')]({'active':![],'ContactId':this[_0x0a8f('0x1f')][_0x239602[_0x0a8f('0x12b')]][_0x0a8f('0x103')],'ListId':this[_0x0a8f('0x1f')][_0x239602[_0x0a8f('0x12b')]][_0x0a8f('0xd6')],'VoiceQueueId':this[_0x0a8f('0x1f')][_0x239602[_0x0a8f('0x12b')]][_0x0a8f('0xd8')]||undefined,'CampaignId':this[_0x0a8f('0x1f')][_0x239602[_0x0a8f('0x12b')]][_0x0a8f('0xd9')]||undefined})['catch'](loggerCatch(_0x0a8f('0x142')));delete this['actions'][_0x239602['actionid']];unlockQueueStatus(_0x52c712);}};Dialer[_0x0a8f('0xab')][_0x0a8f('0x143')]=function(){var _0x4c678f=this;setInterval(function(){_0x4c678f[_0x0a8f('0x144')]();},0x3e8);};Dialer[_0x0a8f('0xab')][_0x0a8f('0x145')]=function(_0x209da2){var _0x57e2a2=this;return function(){if(!_0x57e2a2[_0x0a8f('0x146')](_0x209da2[_0x0a8f('0x73')])){if(!_0x57e2a2['isTrunkReachable'](_0x209da2[_0x0a8f('0x147')])){_0x209da2[_0x0a8f('0x38')]=_0x0a8f('0x148');throw _0x209da2[_0x0a8f('0x3a')]+_0x0a8f('0x149');}}};};Dialer[_0x0a8f('0xab')]['checkIfTime']=function(_0x57c993,_0x2cfaa6,_0x1ea1c3,_0x3c40d0){var _0xd25dac=this;return function(){var _0x6b1373=!![];return _0xd25dac[_0x0a8f('0x14a')](_0x57c993,_0x2cfaa6,_0x1ea1c3,_0x3c40d0,_0x6b1373);};};Dialer[_0x0a8f('0xab')][_0x0a8f('0x14b')]=function(_0x7d3091,_0x4f97b0,_0x3b4bed,_0x35cece){var _0x5c7b22=this;return function(){var _0x2f86f7=![];return _0x5c7b22[_0x0a8f('0x14a')](_0x7d3091['Intervals'],_0x4f97b0,_0x3b4bed,_0x35cece,_0x2f86f7);};};Dialer['prototype'][_0x0a8f('0x14a')]=function(_0x1be1a2,_0x544758,_0x151d7d,_0x18599d,_0x13ddef){var _0x9a30f1=[];return new BPromise(function(_0x55aa0f,_0x40f91c){if(!isNotNull(_0x1be1a2)){_0x18599d[_0x0a8f('0x38')]='INTERVAL_IS_NULL';return _0x40f91c(msgResponse(_0x0a8f('0x14a'),_0x0a8f('0x14c'),_0x151d7d+_0x0a8f('0x14d')));}if(_[_0x0a8f('0x42')](_0x1be1a2)){_0x18599d[_0x0a8f('0x38')]=_0x0a8f('0x14e');return _0x40f91c(msgResponse('ifTime',_0x0a8f('0x14c'),_0x151d7d+_0x0a8f('0x14f')));}if(_0x544758&&_[_0x0a8f('0x37')](config[_0x0a8f('0x150')][_0x544758])){_0x18599d[_0x0a8f('0x38')]=_0x0a8f('0x151');return _0x40f91c(msgResponse('ifTime',_0x0a8f('0x14c'),_0x151d7d+_0x0a8f('0x152')+_0x544758));}if(_[_0x0a8f('0x153')](_0x1be1a2)){for(var _0x47ac91=0x0;_0x47ac91<_0x1be1a2['length'];_0x47ac91+=0x1){_0x9a30f1['push'](ami['Action']({'action':_0x0a8f('0x154'),'command':util[_0x0a8f('0x77')](_0x0a8f('0x155'),_0x1be1a2[_0x47ac91][_0x0a8f('0x156')],!_['isUndefined'](config['timezones'][_0x544758])?_0x544758:'')})[_0x0a8f('0xba')](function(_0x5c5a73){return _0x5c5a73['content'][_0x0a8f('0x157')]('true')>=0x0;})[_0x0a8f('0xb3')](myreject(_0x40f91c)));}}else{_0x9a30f1[_0x0a8f('0x131')](ami[_0x0a8f('0x158')]({'action':'command','command':util[_0x0a8f('0x77')]('iftime\x20%s,%s',_0x1be1a2,!_['isUndefined'](config[_0x0a8f('0x150')][_0x544758])?_0x544758:'')})[_0x0a8f('0xba')](function(_0x17d0c5){return _0x17d0c5[_0x0a8f('0x159')][_0x0a8f('0x157')](_0x0a8f('0x15a'))>=0x0;})[_0x0a8f('0xb3')](myreject(_0x40f91c)));}BPromise['all'](_0x9a30f1)[_0x0a8f('0xba')](function(_0x1ceb9b){var _0x15bfb8=_[_0x0a8f('0x15b')](_0x1ceb9b);if(_0x15bfb8){return _0x55aa0f(_0x15bfb8);}else{_0x18599d['message']=_0x13ddef?'GLOBAL_INTERVAL_IS_OVERTIME':_0x0a8f('0x15c');return _0x40f91c(msgResponse(_0x0a8f('0x15d'),_0x0a8f('0x14c'),_0x0a8f('0x15e')+_0x13ddef+'\x20'+_0x151d7d+_0x0a8f('0x15f')+util['inspect'](_0x1be1a2,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x544758));}})[_0x0a8f('0xb3')](function(_0x269ef0){return _0x40f91c(msgResponse('ifTime','Failure',JSON['stringify'](_0x269ef0)));});});};Dialer['prototype']['checkDialMethod']=function(_0x20ca95){var _0x1e78c7=this;return function(){switch(_0x20ca95[_0x0a8f('0x160')]){case _0x0a8f('0x161'):freeVariablesPredictive(_0x20ca95);_0x1e78c7['handlePower'](_0x20ca95,0x1);break;case'power':freeVariablesPredictive(_0x20ca95);_0x1e78c7[_0x0a8f('0x162')](_0x20ca95,_0x20ca95[_0x0a8f('0x163')]);break;case'predictive':_0x1e78c7[_0x0a8f('0x164')](_0x20ca95);break;case'booked':freeVariablesPredictive(_0x20ca95);_0x1e78c7[_0x0a8f('0x162')](_0x20ca95,0x1);break;default:freeVariablesPredictive(_0x20ca95);logger[_0x0a8f('0x93')](_0x0a8f('0x165'),_0x20ca95[_0x0a8f('0x3a')],_0x0a8f('0x166'));}};};Dialer['prototype'][_0x0a8f('0x167')]=function(_0x515c55){var _0x25ebb8=this;return function(){_0x25ebb8[_0x0a8f('0x168')](_0x515c55);};};Dialer['prototype']['syncQueueSummary']=function(_0xcb7990){var _0x5ae55a=this;if(isNotPreview(_0xcb7990[_0x0a8f('0x160')])){if(isVoiceQueueOutbound(_0xcb7990['type'])&&isActive(_0xcb7990[_0x0a8f('0x169')])){_0xcb7990[_0x0a8f('0x9f')]=!![];BPromise['resolve']()['then'](checkIsLoggedIn(_0xcb7990,_0xcb7990[_0x0a8f('0x4c')]))[_0x0a8f('0xba')](checkIsActive(_0xcb7990,_0xcb7990[_0x0a8f('0x169')]))[_0x0a8f('0xba')](checkInterval(_0xcb7990))['then'](_0x5ae55a[_0x0a8f('0x145')](_0xcb7990))['then'](_0x5ae55a[_0x0a8f('0x16a')](_0xcb7990[_0x0a8f('0x16b')],_0xcb7990[_0x0a8f('0x16c')],_0xcb7990[_0x0a8f('0x3a')],_0xcb7990))['then'](_0x5ae55a[_0x0a8f('0x14b')](_0xcb7990[_0x0a8f('0x3e')],_0xcb7990[_0x0a8f('0x16c')],_0xcb7990[_0x0a8f('0x3a')],_0xcb7990))['then'](_0x5ae55a[_0x0a8f('0x16d')](_0xcb7990))[_0x0a8f('0xb3')](loggerCatchQueueSummary(_0x0a8f('0x16e'),_0xcb7990));}else{notSendMessagesQueue(_0xcb7990);}}else{freeVariablesPredictive(_0xcb7990);}};Dialer['prototype']['syncCampaigns']=function(){var _0x1bbae9=this;var _0x40b86a;for(var _0x254b2f in this[_0x0a8f('0x1a')]){if(typeof this[_0x0a8f('0x1a')][_0x254b2f]!==_0x0a8f('0xaf')){_0x40b86a=this[_0x0a8f('0x1a')][_0x254b2f];if(isCampaignIvr(_0x40b86a['type'])&&isActive(_0x40b86a[_0x0a8f('0x74')])){_0x40b86a[_0x0a8f('0x9f')]=!![];BPromise[_0x0a8f('0xb9')]()[_0x0a8f('0xba')](checkIsActive(_0x40b86a,_0x40b86a[_0x0a8f('0x74')]))[_0x0a8f('0xba')](checkInterval(_0x40b86a))[_0x0a8f('0xba')](_0x1bbae9[_0x0a8f('0x145')](_0x40b86a))['then'](_0x1bbae9['checkIfTime'](_0x40b86a[_0x0a8f('0x16b')],_0x40b86a[_0x0a8f('0x16c')],_0x40b86a[_0x0a8f('0x3a')],_0x40b86a))[_0x0a8f('0xba')](_0x1bbae9[_0x0a8f('0x14b')](_0x40b86a[_0x0a8f('0x3e')],_0x40b86a['dialTimezone'],_0x40b86a[_0x0a8f('0x3a')],_0x40b86a))[_0x0a8f('0xba')](_0x1bbae9[_0x0a8f('0x167')](_0x40b86a))[_0x0a8f('0xb3')](loggerCatchQueueSummary(_0x0a8f('0x16f'),_0x40b86a));}else{notSendMessagesCampaign(_0x40b86a);}}}};function getCallerIdRandom(_0x6a03da,_0x36e65e){var _0x67a52e;var _0x2b1974;var _0x5580d0;if(_0x36e65e<=0x0){_0x36e65e=0x1;}_0x67a52e=new RegExp('\x5cw{0,'+_0x36e65e+'}$');_0x2b1974=Math[_0x0a8f('0x170')](0xa,_0x36e65e-0x1);_0x5580d0=Math[_0x0a8f('0x170')](0xa,_0x36e65e)-0x1;return util[_0x0a8f('0x77')]('%s',_[_0x0a8f('0x171')](_0x6a03da,_0x67a52e,_[_0x0a8f('0x172')](_0x2b1974,_0x5580d0)));}function extractCalleridName(_0x4cbe18){var _0x3f988d=_0x4cbe18['match'](/"(.*?)"/);return _0x3f988d?_0x3f988d[0x1]:_0x4cbe18;}function extractCalleridNumber(_0x557a16){var _0xc5c63c=_0x557a16[_0x0a8f('0x173')](/<(.*?)>/);return _0xc5c63c?_0xc5c63c[0x1]:_0x557a16;}Dialer[_0x0a8f('0xab')]['actionOriginate']=function(_0x2054b4,_0x3579c5){var _0x2dd291=this;var _0x4bee3c=uuid['v4']();this[_0x0a8f('0x1f')][_0x4bee3c]=new Action(_0x2054b4,_0x3579c5,_0x4bee3c);return new BPromise(function(_0x3ae9ad,_0x28ca3a){if(_[_0x0a8f('0x37')](_0x2054b4)&&typeof _0x2054b4!==_0x0a8f('0x174')){return _0x28ca3a(msgResponse(_0x0a8f('0x175'),_0x0a8f('0x14c'),_0x0a8f('0x176')));}if(_[_0x0a8f('0x37')](_0x3579c5[_0x0a8f('0x177')]['phone'])||_0x3579c5[_0x0a8f('0x177')][_0x0a8f('0x178')]===null){return _0x28ca3a(msgResponse(_0x0a8f('0x175'),'Failure',_0x0a8f('0x179')));}var _0x2e119b={'XMD-CALLERID':_0x2dd291[_0x0a8f('0x1f')][_0x4bee3c]['getCaller'](),'XMD-AGI':_0x2054b4['dialQueueProject']?util[_0x0a8f('0x77')](_0x0a8f('0x17a'),ipAgi,_0x2054b4['dialQueueProject']):'NONE','XMD-AGIAFTER':_0x2054b4['dialQueueProject2']?util[_0x0a8f('0x77')](_0x0a8f('0x17a'),ipAgi,_0x2054b4[_0x0a8f('0x112')]):_0x0a8f('0x17b'),'XMD-QUEUE':_0x2054b4[_0x0a8f('0x48')]==='outbound'?util[_0x0a8f('0x77')]('\x22%s,%s%s,,,%s\x22',_0x2054b4['name'],_0x2054b4['dialQueueOptions']||'',_0x2054b4[_0x0a8f('0x113')]?'c':'',_0x2054b4[_0x0a8f('0x11b')]||0x3):_0x0a8f('0x17b'),'XMD-CONTACTID':_0x3579c5[_0x0a8f('0x103')],'XMD-CDRTYPE':_0x0a8f('0x5'),'CALLERID(all)':_0x2dd291[_0x0a8f('0x1f')][_0x4bee3c][_0x0a8f('0x17c')](),'XMD-AMD':_0x2054b4[_0x0a8f('0xe8')]?_0x0a8f('0x17d'):_0x0a8f('0x17b'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x2054b4['dialAMDActive']){_0x2e119b[_0x0a8f('0x17e')]=_0x2054b4[_0x0a8f('0x17f')]||0x9c4;_0x2e119b[_0x0a8f('0x180')]=_0x2054b4['dialAMDGreeting']||0x5dc;_0x2e119b['XMD-AMDAFTERGREETINGSILENCE']=_0x2054b4[_0x0a8f('0x181')]||0x320;_0x2e119b[_0x0a8f('0x182')]=_0x2054b4['dialAMDTotalAnalysisTime']||0x1388;_0x2e119b[_0x0a8f('0x183')]=_0x2054b4[_0x0a8f('0x184')]||0x64;_0x2e119b['XMD-AMDBETWEENWORDSSILENCE']=_0x2054b4['dialAMDBetweenWordsSilence']||0x32;_0x2e119b[_0x0a8f('0x185')]=_0x2054b4[_0x0a8f('0x186')]||0x3;_0x2e119b['XMD-AMDSILENCETHRESHOLD']=_0x2054b4[_0x0a8f('0x187')]||0x100;_0x2e119b[_0x0a8f('0x188')]=_0x2054b4[_0x0a8f('0x189')]||0x1388;}if(_0x2054b4[_0x0a8f('0x48')]===_0x0a8f('0x49')){_0x2e119b['XMD-VOICEQUEUEID']=_0x3579c5['VoiceQueueId'];}else{_0x2e119b[_0x0a8f('0x18a')]=_0x3579c5[_0x0a8f('0xd9')];}for(var _0x5d73af in _0x3579c5[_0x0a8f('0x177')]){if(typeof _0x3579c5[_0x0a8f('0x177')][_0x5d73af]!==_0x0a8f('0xaf')){if(isNotNull(_0x3579c5['Contact'][_0x5d73af])&&_0x5d73af!=='id'&&_0x5d73af!==_0x0a8f('0x18b')&&_0x5d73af!==_0x0a8f('0x18c')&&_0x5d73af!==_0x0a8f('0x18d')){_0x2e119b[util[_0x0a8f('0x77')](_0x0a8f('0x18e'),_0x0a8f('0x18f'),_[_0x0a8f('0x190')](_0x5d73af))]=_0x3579c5[_0x0a8f('0x177')][_0x5d73af];}}}var _0x311c3c=_0x2dd291['isTrunkReachable'](_0x2054b4[_0x0a8f('0x73')])?getCallerId(_0x2054b4[_0x0a8f('0x73')][_0x0a8f('0x75')],_0x2054b4[_0x0a8f('0x54')],_0x2054b4[_0x0a8f('0x191')]>0x0?getCallerIdRandom(_0x2054b4[_0x0a8f('0x55')],_0x2054b4[_0x0a8f('0x191')]):_0x2054b4[_0x0a8f('0x55')]):getCallerId(_[_0x0a8f('0xb1')](_0x2054b4[_0x0a8f('0x147')])?_0x2054b4[_0x0a8f('0x73')][_0x0a8f('0x75')]:_0x2054b4[_0x0a8f('0x147')]['callerid'],_0x2054b4[_0x0a8f('0x54')],_0x2054b4[_0x0a8f('0x191')]>0x0?getCallerIdRandom(_0x2054b4['dialOriginateCallerIdNumber'],_0x2054b4[_0x0a8f('0x191')]):_0x2054b4[_0x0a8f('0x55')]);if(_0x311c3c){_0x2e119b[_0x0a8f('0x192')]=_0x2dd291[_0x0a8f('0x1f')][_0x4bee3c][_0x0a8f('0x193')]=extractCalleridName(_0x311c3c);_0x2e119b[_0x0a8f('0x194')]=_0x2dd291[_0x0a8f('0x1f')][_0x4bee3c][_0x0a8f('0x195')]=extractCalleridNumber(_0x311c3c);}return ami[_0x0a8f('0x158')]({'actionid':_0x4bee3c,'action':_0x0a8f('0x175'),'channel':_0x2dd291[_0x0a8f('0x146')](_0x2054b4[_0x0a8f('0x73')])?util[_0x0a8f('0x77')]('SIP/%s/%s%s',_0x2054b4[_0x0a8f('0x73')][_0x0a8f('0x3a')],isNotNull(_0x2054b4[_0x0a8f('0x57')])?_0x2054b4[_0x0a8f('0x57')][_0x0a8f('0x196')]()||'':'',_0x2054b4['dialCutDigit']>0x0?_0x3579c5[_0x0a8f('0x177')][_0x0a8f('0x178')][_0x0a8f('0x197')](_0x2054b4[_0x0a8f('0x198')]):_0x3579c5['Contact'][_0x0a8f('0x178')]):util['format'](_0x0a8f('0x199'),_[_0x0a8f('0xb1')](_0x2054b4['TrunkBackup'])?_0x2054b4[_0x0a8f('0x73')][_0x0a8f('0x3a')]:_0x2054b4[_0x0a8f('0x147')][_0x0a8f('0x3a')],isNotNull(_0x2054b4[_0x0a8f('0x57')])?_0x2054b4[_0x0a8f('0x57')][_0x0a8f('0x196')]()||'':'',_0x2054b4['dialCutDigit']>0x0?_0x3579c5['Contact']['phone'][_0x0a8f('0x197')](_0x2054b4['dialCutDigit']):_0x3579c5[_0x0a8f('0x177')][_0x0a8f('0x178')]),'callerid':_0x311c3c,'Exten':_0x0a8f('0xe7'),'Context':_0x0a8f('0x19a'),'Priority':'1','variable':_0x2e119b,'timeout':(_0x2054b4[_0x0a8f('0x56')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4bee3c})[_0x0a8f('0xba')](function(_0x242d6b){return _0x3ae9ad(_0x242d6b);})[_0x0a8f('0xb3')](function(_0x18905a){_0x2054b4[_0x0a8f('0x61')]+=0x1;var _0x349e1e=new History(_0x2dd291[_0x0a8f('0x1f')][_0x4bee3c]);logger[_0x0a8f('0x93')](util['format'](_0x0a8f('0x19b'),JSON['stringify'](_0x18905a)));_0x349e1e[_0x0a8f('0xa7')]=0xe;_0x349e1e[_0x0a8f('0xa8')]=_0x0a8f('0x19c');_0x349e1e[_0x0a8f('0xaa')]=moment()[_0x0a8f('0x77')](_0x0a8f('0x102'));_0x349e1e[_0x0a8f('0xa9')]=_0x349e1e[_0x0a8f('0xaa')];_0x2dd291[_0x0a8f('0xcf')](_0x349e1e)[_0x0a8f('0xb3')](loggerCatch('[originate][error]'));_0x2dd291[_0x0a8f('0xce')](_0x349e1e)[_0x0a8f('0xb3')](loggerCatch(_0x0a8f('0x19d')))['finally'](function(){delete _0x2dd291['actions'][_0x4bee3c];return _0x28ca3a(msgResponse(_0x0a8f('0x175'),_0x0a8f('0x44'),'originate\x20action\x20Error'));});});});};Dialer[_0x0a8f('0xab')][_0x0a8f('0x2b')]=function(_0x132dbf){var _0x1535a4=this[_0x0a8f('0x1f')][_0x132dbf[_0x0a8f('0x12b')]];if(_0x1535a4){delete this['actions'][_0x132dbf[_0x0a8f('0x12b')]];_0x1535a4['responsetime']=moment()[_0x0a8f('0x77')]('YYYY-MM-DD\x20HH:mm:ss');var _0x27f5c2=_0x1535a4[_0x0a8f('0x48')]===_0x0a8f('0x79')?this['campaigns'][_0x1535a4[_0x0a8f('0xb6')]]:this['voiceQueues'][_0x1535a4[_0x0a8f('0x19e')]()];if(!this[_0x0a8f('0xdc')](_0x132dbf['response'])){this[_0x0a8f('0xb5')](_0x27f5c2);return this['callProgressDetecting'](_0x1535a4,_0x27f5c2,_0x132dbf)[_0x0a8f('0xb3')](loggerCatch(_0x0a8f('0x19f')));}this[_0x0a8f('0xe2')][_0x132dbf[_0x0a8f('0xe3')]]=_0x1535a4;}};Dialer['prototype']['checkRetriveMax']=function(_0x2fb1f7,_0x31fb5c,_0x5ef412){var _0x59622b=new History(_0x31fb5c);if(_0x59622b[_0x0a8f('0x106')]+_0x59622b[_0x0a8f('0x107')]+_0x59622b['countnoanswerretry']+_0x59622b[_0x0a8f('0x108')]+_0x59622b[_0x0a8f('0xf8')]+_0x59622b[_0x0a8f('0xf9')]+_0x59622b['countmachineretry']+_0x59622b[_0x0a8f('0x109')]>=_0x5ef412[_0x0a8f('0xfa')]-0x1){return!![];}switch(_0x2fb1f7){case 0x3:if(_0x59622b['countnoanswerretry']>=_0x5ef412['dialNoAnswerMaxRetry']-0x1){return!![];}this[_0x0a8f('0xc3')]({'active':![],'countnoanswerretry':_0x59622b['countnoanswerretry']+=0x1,'scheduledat':moment()[_0x0a8f('0xff')](_0x5ef412[_0x0a8f('0x1a0')],_0x0a8f('0x101'))[_0x0a8f('0x77')](_0x0a8f('0x102')),'ContactId':_0x59622b[_0x0a8f('0x103')],'ListId':_0x59622b[_0x0a8f('0xd6')],'VoiceQueueId':_0x59622b[_0x0a8f('0xd8')]||undefined,'CampaignId':_0x59622b[_0x0a8f('0xd9')]||undefined})[_0x0a8f('0xb3')](loggerCatch(_0x0a8f('0x1a1')));break;case 0x5:if(_0x59622b[_0x0a8f('0x106')]>=_0x5ef412['dialBusyMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x59622b[_0x0a8f('0x106')]+=0x1,'scheduledat':moment()[_0x0a8f('0xff')](_0x5ef412['dialBusyRetryFrequency'],_0x0a8f('0x101'))['format'](_0x0a8f('0x102')),'ContactId':_0x59622b['ContactId'],'ListId':_0x59622b['ListId'],'VoiceQueueId':_0x59622b[_0x0a8f('0xd8')]||undefined,'CampaignId':_0x59622b[_0x0a8f('0xd9')]||undefined})[_0x0a8f('0xb3')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x59622b[_0x0a8f('0x107')]>=_0x5ef412['dialCongestionMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0x59622b['countcongestionretry']+=0x1,'scheduledat':moment()[_0x0a8f('0xff')](_0x5ef412[_0x0a8f('0x1a2')],_0x0a8f('0x101'))['format'](_0x0a8f('0x102')),'ContactId':_0x59622b['ContactId'],'ListId':_0x59622b['ListId'],'VoiceQueueId':_0x59622b[_0x0a8f('0xd8')]||undefined,'CampaignId':_0x59622b['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x59622b['countnosuchnumberretry']>=_0x5ef412[_0x0a8f('0x1a3')]-0x1){return!![];}else{this[_0x0a8f('0xc3')]({'active':![],'countnosuchnumberretry':_0x59622b[_0x0a8f('0x108')]+=0x1,'scheduledat':moment()[_0x0a8f('0xff')](_0x5ef412[_0x0a8f('0x1a4')],'minutes')[_0x0a8f('0x77')](_0x0a8f('0x102')),'ContactId':_0x59622b[_0x0a8f('0x103')],'ListId':_0x59622b[_0x0a8f('0xd6')],'VoiceQueueId':_0x59622b[_0x0a8f('0xd8')]||undefined,'CampaignId':_0x59622b[_0x0a8f('0xd9')]||undefined})['catch'](loggerCatch(_0x0a8f('0x1a5')));}break;case 0xa:if(_0x59622b[_0x0a8f('0xf8')]>=_0x5ef412[_0x0a8f('0x120')]-0x1){return!![];}this[_0x0a8f('0xc3')]({'active':![],'countdropretry':_0x59622b[_0x0a8f('0xf8')]+=0x1,'scheduledat':moment()[_0x0a8f('0xff')](_0x5ef412[_0x0a8f('0x121')],_0x0a8f('0x101'))[_0x0a8f('0x77')](_0x0a8f('0x102')),'ContactId':_0x59622b[_0x0a8f('0x103')],'ListId':_0x59622b['ListId'],'VoiceQueueId':_0x59622b['VoiceQueueId']||undefined,'CampaignId':_0x59622b[_0x0a8f('0xd9')]||undefined})[_0x0a8f('0xb3')](loggerCatch(_0x0a8f('0x122')));break;case 0xb:if(_0x59622b['countabandonedretry']>=_0x5ef412['dialAbandonedMaxRetry']-0x1){return!![];}this[_0x0a8f('0xc3')]({'active':![],'countabandonedretry':_0x59622b['countabandonedretry']+=0x1,'scheduledat':moment()['add'](_0x5ef412[_0x0a8f('0x128')],'minutes')[_0x0a8f('0x77')](_0x0a8f('0x102')),'ContactId':_0x59622b[_0x0a8f('0x103')],'ListId':_0x59622b['ListId'],'VoiceQueueId':_0x59622b['VoiceQueueId']||undefined,'CampaignId':_0x59622b[_0x0a8f('0xd9')]||undefined})[_0x0a8f('0xb3')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x59622b[_0x0a8f('0xf2')]>=_0x5ef412[_0x0a8f('0x10a')]-0x1){return!![];}this[_0x0a8f('0xc3')]({'active':![],'countmachineretry':_0x59622b[_0x0a8f('0xf2')]+=0x1,'scheduledat':moment()['add'](_0x5ef412[_0x0a8f('0x100')],_0x0a8f('0x101'))[_0x0a8f('0x77')](_0x0a8f('0x102')),'ContactId':_0x59622b[_0x0a8f('0x103')],'ListId':_0x59622b['ListId'],'VoiceQueueId':_0x59622b[_0x0a8f('0xd8')]||undefined,'CampaignId':_0x59622b[_0x0a8f('0xd9')]||undefined})[_0x0a8f('0xb3')](loggerCatch(_0x0a8f('0x104')));break;case 0x14:if(_0x59622b[_0x0a8f('0x109')]>=_0x5ef412['dialAgentRejectMaxRetry']-0x1){return!![];}this[_0x0a8f('0xc3')]({'active':![],'countagentrejectretry':_0x59622b[_0x0a8f('0x109')]+=0x1,'scheduledat':moment()[_0x0a8f('0xff')](_0x5ef412[_0x0a8f('0x1a6')],_0x0a8f('0x101'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x59622b[_0x0a8f('0x103')],'ListId':_0x59622b[_0x0a8f('0xd6')],'VoiceQueueId':_0x59622b[_0x0a8f('0xd8')]||undefined,'CampaignId':_0x59622b[_0x0a8f('0xd9')]||undefined})[_0x0a8f('0xb3')](loggerCatch(_0x0a8f('0x1a7')));break;default:return!![];}};Dialer[_0x0a8f('0xab')]['callProgressDetecting']=function(_0x346db8,_0x3c8dcf,_0x796bf){var _0x124628=this;var _0x19b80c=new History(_0x346db8);return new BPromise(function(_0x23f1e5,_0x550ea0){if(_['isUndefined'](_0x3c8dcf)&&typeof _0x3c8dcf!=='object'){return _0x550ea0(msgResponse('[callProgressDetecting]',_0x0a8f('0x14c'),_0x0a8f('0x1a8')));}if(_['isUndefined'](_0x796bf)&&typeof _0x796bf!==_0x0a8f('0x174')){return _0x550ea0(msgResponse('[callProgressDetecting]','Failure',_0x0a8f('0x1a9')));}switch(_0x796bf[_0x0a8f('0x1aa')]){case'0':_0x3c8dcf[_0x0a8f('0x60')]+=0x1;_0x19b80c['state']=0x0;_0x19b80c[_0x0a8f('0xa8')]=_0x0a8f('0x1ab');_0x19b80c[_0x0a8f('0x108')]+=0x1;_0x19b80c[_0x0a8f('0xf3')]+=0x1;ami['emit'](_0x0a8f('0x1ac'),ut[_0x0a8f('0xee')](_0x346db8,'nosuchnumber'));_0x124628['createHistory'](_0x19b80c)[_0x0a8f('0xb3')](loggerCatch(_0x0a8f('0xf6')));if(_0x124628[_0x0a8f('0x1ad')](0x0,_0x346db8,_0x3c8dcf)){if(_0x19b80c[_0x0a8f('0x108')]>=_0x3c8dcf[_0x0a8f('0x1a3')]){_0x124628[_0x0a8f('0xfd')](_0x19b80c,_0x23f1e5,_0x550ea0,'reason\x200\x20no\x20such\x20number....');}else{_0x124628['stateGlobal'](_0x19b80c,_0x23f1e5,_0x550ea0,_0x0a8f('0x1ae'));}}break;case'3':_0x3c8dcf[_0x0a8f('0x5f')]+=0x1;_0x19b80c[_0x0a8f('0xa7')]=0x3;_0x19b80c['statedesc']=_0x0a8f('0x1af');_0x19b80c[_0x0a8f('0xf7')]+=0x1;_0x19b80c['countglobal']+=0x1;ami[_0x0a8f('0xf5')](_0x0a8f('0x1b0'),ut[_0x0a8f('0xee')](_0x346db8,_0x0a8f('0x1b1')));_0x124628[_0x0a8f('0xcf')](_0x19b80c)[_0x0a8f('0xb3')](loggerCatch(_0x0a8f('0x1b2')));if(_0x124628['checkRetriveMax'](0x3,_0x346db8,_0x3c8dcf)){if(_0x19b80c['countnoanswerretry']>=_0x3c8dcf[_0x0a8f('0x1b3')]){_0x124628['createStateFinal'](_0x19b80c,_0x23f1e5,_0x550ea0,_0x0a8f('0x1b4'));}else{_0x124628[_0x0a8f('0xfb')](_0x19b80c,_0x23f1e5,_0x550ea0,_0x0a8f('0x1b4'));}}break;case'5':_0x3c8dcf[_0x0a8f('0x5b')]+=0x1;_0x19b80c['state']=0x5;_0x19b80c[_0x0a8f('0xa8')]=_0x0a8f('0x1b5');_0x19b80c[_0x0a8f('0x106')]+=0x1;_0x19b80c[_0x0a8f('0xf3')]+=0x1;ami['emit'](_0x0a8f('0x1b6'),ut[_0x0a8f('0xee')](_0x346db8,_0x0a8f('0x1b7')));_0x124628['createHistory'](_0x19b80c)[_0x0a8f('0xb3')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x124628[_0x0a8f('0x1ad')](0x5,_0x346db8,_0x3c8dcf)){if(_0x19b80c[_0x0a8f('0x106')]>=_0x3c8dcf[_0x0a8f('0x1b8')]){_0x124628['createStateFinal'](_0x19b80c,_0x23f1e5,_0x550ea0,_0x0a8f('0x1b9'));}else{_0x124628[_0x0a8f('0xfb')](_0x19b80c,_0x23f1e5,_0x550ea0,_0x0a8f('0x1b9'));}}break;case'8':_0x3c8dcf['outboundCongestionCallsDay']+=0x1;_0x19b80c[_0x0a8f('0xa7')]=0x8;_0x19b80c[_0x0a8f('0xa8')]='Congestion';_0x19b80c[_0x0a8f('0x107')]+=0x1;_0x19b80c[_0x0a8f('0xf3')]+=0x1;ami['emit']('custom:agentcongestion',ut[_0x0a8f('0xee')](_0x346db8,_0x0a8f('0x1ba')));_0x124628[_0x0a8f('0xcf')](_0x19b80c)[_0x0a8f('0xb3')](loggerCatch(_0x0a8f('0x1bb')));if(_0x124628[_0x0a8f('0x1ad')](0x8,_0x346db8,_0x3c8dcf)){if(_0x19b80c[_0x0a8f('0x107')]>=_0x3c8dcf[_0x0a8f('0x1bc')]){_0x124628[_0x0a8f('0xfd')](_0x19b80c,_0x23f1e5,_0x550ea0,_0x0a8f('0x1bd'));}else{_0x124628[_0x0a8f('0xfb')](_0x19b80c,_0x23f1e5,_0x550ea0,'reason\x208\x20congestion');}}break;case'11':_0x3c8dcf[_0x0a8f('0x1be')]+=0x1;_0x19b80c[_0x0a8f('0xa7')]=0xb;_0x19b80c[_0x0a8f('0xa8')]=_0x0a8f('0x126');_0x19b80c[_0x0a8f('0xf9')]+=0x1;_0x19b80c[_0x0a8f('0xf3')]+=0x1;_0x124628[_0x0a8f('0xcf')](_0x19b80c)[_0x0a8f('0xb3')](loggerCatch(_0x0a8f('0x12a')));if(_0x124628['checkRetriveMax'](0xb,_0x346db8,_0x3c8dcf)){if(_0x19b80c[_0x0a8f('0xf9')]>=_0x3c8dcf[_0x0a8f('0x1bf')]){_0x124628[_0x0a8f('0xfd')](_0x19b80c,_0x23f1e5,_0x550ea0,'reason\x2011\x20abandoned');}else{_0x124628[_0x0a8f('0xfb')](_0x19b80c,_0x23f1e5,_0x550ea0,'reason\x2011\x20abandoned');}}break;case'20':_0x3c8dcf[_0x0a8f('0x62')]+=0x1;_0x19b80c[_0x0a8f('0xa7')]=0x14;_0x19b80c[_0x0a8f('0xa8')]=_0x0a8f('0x1c0');_0x19b80c[_0x0a8f('0x109')]+=0x1;_0x19b80c[_0x0a8f('0xf3')]+=0x1;ami[_0x0a8f('0xf5')](_0x0a8f('0x1c1'),ut[_0x0a8f('0xee')](_0x346db8,_0x0a8f('0x1c2')));_0x124628[_0x0a8f('0xcf')](_0x19b80c)['catch'](loggerCatch(_0x0a8f('0x1c3')));if(_0x124628[_0x0a8f('0x1ad')](0x14,_0x346db8,_0x3c8dcf)){if(_0x19b80c[_0x0a8f('0x109')]>=_0x3c8dcf[_0x0a8f('0x1c4')]){_0x124628[_0x0a8f('0xfd')](_0x19b80c,_0x23f1e5,_0x550ea0,'reason\x2020\x20agentreject');}else{_0x124628[_0x0a8f('0xfb')](_0x19b80c,_0x23f1e5,_0x550ea0,_0x0a8f('0x1c5'));}}break;default:_0x3c8dcf[_0x0a8f('0x63')]+=0x1;_0x19b80c[_0x0a8f('0xa7')]=0xc;_0x19b80c['statedesc']=_0x796bf['reason'];_0x124628[_0x0a8f('0xcf')](_0x19b80c)[_0x0a8f('0xb3')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x124628[_0x0a8f('0x1ad')](_0x796bf[_0x0a8f('0x1aa')],_0x346db8,_0x3c8dcf)){if(_0x19b80c['countbusyretry']+_0x19b80c[_0x0a8f('0x107')]+_0x19b80c[_0x0a8f('0xf7')]+_0x19b80c[_0x0a8f('0x108')]+_0x19b80c['countdropretry']+_0x19b80c[_0x0a8f('0xf9')]+_0x19b80c[_0x0a8f('0xf2')]+_0x19b80c['countagentrejectretry']>=_0x3c8dcf[_0x0a8f('0xfa')]){_0x124628[_0x0a8f('0xfb')](_0x19b80c,_0x23f1e5,_0x550ea0,_0x796bf[_0x0a8f('0x1aa')]);}else{_0x124628[_0x0a8f('0xfd')](_0x19b80c,_0x23f1e5,_0x550ea0,_0x796bf[_0x0a8f('0x1aa')]);}}}});};Dialer['prototype'][_0x0a8f('0xfb')]=function(_0x5de072,_0x56b19a,_0x4dd03f,_0x31744b){var _0x51e198=new Final(_0x5de072);_0x51e198[_0x0a8f('0xa7')]=0xf;_0x51e198[_0x0a8f('0xa8')]=_0x0a8f('0x1c6');this[_0x0a8f('0xfd')](_0x51e198,_0x56b19a,_0x4dd03f,_0x31744b);};Dialer[_0x0a8f('0xab')][_0x0a8f('0xfd')]=function(_0x122a59,_0x4b93d3,_0x5cac00,_0x18f805){this[_0x0a8f('0xce')](_0x122a59)[_0x0a8f('0xba')](function(){return _0x4b93d3(msgResponse('[callProgressDetecting]','Success',_0x18f805));})['catch'](function(){return _0x5cac00(msgResponse(_0x0a8f('0x1c7'),_0x0a8f('0x14c'),_0x0a8f('0x1c8')));});};Dialer[_0x0a8f('0xab')][_0x0a8f('0x164')]=function(_0x4581df){var _0x53ff1b=_0x4581df[_0x0a8f('0x1c9')]/0x64;var _0x2ceb8=_0x4581df[_0x0a8f('0x5e')]/(_0x4581df[_0x0a8f('0x5e')]+_0x4581df[_0x0a8f('0x59')]);var _0x357acf=Math[_0x0a8f('0x1ca')](_0x4581df[_0x0a8f('0x1cb')]*(_0x4581df[_0x0a8f('0x1cc')]/0x64));var _0x5e1435=Math[_0x0a8f('0x1ca')](_0x4581df[_0x0a8f('0x1cb')]*(_0x4581df[_0x0a8f('0x1cd')]/0x64));var _0x53169f=_0x4581df['available']+_0x4581df[_0x0a8f('0xa0')];var _0x3d4557=Math[_0x0a8f('0x1ce')](_0x4581df[_0x0a8f('0x89')]*_0x4581df[_0x0a8f('0x71')]*_0x4581df[_0x0a8f('0x6b')]*_0x4581df[_0x0a8f('0x6c')]);if(_[_0x0a8f('0x37')](_0x4581df[_0x0a8f('0x23')])){if(!_[_0x0a8f('0x37')](_0x4581df[_0x0a8f('0x22')])){_0x4581df[_0x0a8f('0x22')]=undefined;loggerPredictive[_0x0a8f('0x93')](_0x0a8f('0x1cf'),_0x0a8f('0x1d0'));}if(!_[_0x0a8f('0x37')](_0x4581df['handlePredictive'])){loggerPredictive['error'](_0x0a8f('0x1cf'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x4581df[_0x0a8f('0x90')]);_0x4581df[_0x0a8f('0x90')]=undefined;}_0x4581df[_0x0a8f('0x23')]=moment()[_0x0a8f('0x77')](_0x0a8f('0x102'));loggerPredictive[_0x0a8f('0x7c')](_0x4581df[_0x0a8f('0x3a')],'collection\x20data\x20in\x20progressive\x20at',_0x4581df[_0x0a8f('0x23')]);this['handlePower'](_0x4581df,0x1);}else if(ifInterval(_0x4581df[_0x0a8f('0x1d1')],_0x4581df[_0x0a8f('0x23')])){this[_0x0a8f('0x162')](_0x4581df,0x1);loggerPredictiveCalls[_0x0a8f('0x7c')]('[startMethodPredictive][StartProgressive][Loop]',_0x4581df[_0x0a8f('0x23')],_0x4581df[_0x0a8f('0x3a')]);_0x4581df[_0x0a8f('0x89')]=0x0;_0x4581df['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x53ff1b<_0x2ceb8&&_0x4581df[_0x0a8f('0x1d2')]===_0x0a8f('0x1d3')){freeVariablesPredictive(_0x4581df);loggerPredictive[_0x0a8f('0x7c')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0x0a8f('0x1d4'),_0x2ceb8,_0x0a8f('0x23'),_0x4581df[_0x0a8f('0x3a')]);}else if(_0x3d4557<_0x4581df[_0x0a8f('0x6a')]&&_0x4581df[_0x0a8f('0x1d2')]===_0x0a8f('0x1d3')){freeVariablesPredictive(_0x4581df);loggerPredictive[_0x0a8f('0x7c')](_0x0a8f('0x1d5'),_0x0a8f('0x1d6'),_0x3d4557,_0x0a8f('0x1d7'),_0x4581df[_0x0a8f('0x6a')],_0x0a8f('0x23'),_0x4581df[_0x0a8f('0x3a')]);}else if(!ifInterval(_0x4581df[_0x0a8f('0x1d1')],_0x4581df[_0x0a8f('0x23')])&&_[_0x0a8f('0x37')](_0x4581df[_0x0a8f('0x22')])&&!_[_0x0a8f('0x37')](_0x4581df[_0x0a8f('0x23')])){_0x4581df[_0x0a8f('0x22')]=moment()[_0x0a8f('0x77')](_0x0a8f('0x102'));loggerPredictive[_0x0a8f('0x7c')](_0x4581df[_0x0a8f('0x3a')],_0x0a8f('0x1d8'),_0x4581df[_0x0a8f('0x22')]);this[_0x0a8f('0xc0')](_0x4581df[_0x0a8f('0x1d1')])[_0x0a8f('0xba')](this[_0x0a8f('0x1d9')](_0x4581df))['then'](mergeDataErlangB(_0x4581df))[_0x0a8f('0xba')](this[_0x0a8f('0x1da')](_0x4581df))[_0x0a8f('0xb3')](loggerCatchPredictive(_0x0a8f('0x1db'),_0x4581df));}else if(!ifInterval(_0x4581df['dialPredictiveInterval'],_0x4581df[_0x0a8f('0x22')])){_0x4581df[_0x0a8f('0x6a')]=0x0;_0x4581df['startPredictive']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x0a8f('0x7c')](_0x4581df['name'],_0x0a8f('0x1dc'),_0x4581df['startPredictive']);clearInterval(_0x4581df[_0x0a8f('0x90')]);_0x4581df['handlePredictive']=undefined;this[_0x0a8f('0xc0')](_0x4581df[_0x0a8f('0x1d1')])[_0x0a8f('0xba')](this['getDataPredictive'](_0x4581df))[_0x0a8f('0xba')](mergeDataErlangB(_0x4581df))[_0x0a8f('0xba')](this[_0x0a8f('0x1da')](_0x4581df))['catch'](loggerCatchPredictive(_0x0a8f('0x1dd'),_0x4581df));}else if(_0x4581df[_0x0a8f('0x1cb')]&&_0x53169f<_0x4581df[_0x0a8f('0x1cb')]-_0x5e1435){freeVariablesPredictive(_0x4581df);loggerPredictive[_0x0a8f('0x7c')](_0x4581df[_0x0a8f('0x3a')],_0x0a8f('0x1de'),_0x53169f,_0x0a8f('0x1df'),_0x4581df[_0x0a8f('0x1cb')],'-',_0x5e1435,'=',_0x4581df[_0x0a8f('0x1cb')]-_0x5e1435,')');}else if(_0x4581df[_0x0a8f('0x1cb')]&&_0x53169f>_0x4581df['predictiveIntervalAvailable']+_0x357acf){freeVariablesPredictive(_0x4581df);loggerPredictive[_0x0a8f('0x7c')](_0x4581df['name'],_0x0a8f('0x1de'),_0x53169f,')\x20are\x20more\x20than\x20threshold\x20(',_0x4581df[_0x0a8f('0x1cb')],'+',_0x357acf,'=',_0x4581df[_0x0a8f('0x1cb')]+_0x357acf,')');}};Dialer[_0x0a8f('0xab')][_0x0a8f('0x1d9')]=function(_0x227207){var _0x5b9cf8=this;return function(_0x35191d){return new BPromise(function(_0x57590e,_0x4c1cd3){_[_0x0a8f('0x8c')](_0x227207,_0x35191d[0x0]);if(checkGetDataPredictive(_0x35191d[0x0])){var _0x33967f=_0x227207[_0x0a8f('0x1cb')]=_0x227207[_0x0a8f('0xa0')]+_0x227207[_0x0a8f('0x4b')];var _0x3ed995=_0x227207[_0x0a8f('0x1d1')]*0x3c;var _0x43aa78=_0x35191d[0x0]['predictiveIntervalAvgTalktime']+_0x35191d[0x0][_0x0a8f('0x65')];var _0x1c86df=(_0x35191d[0x0][_0x0a8f('0x64')]+_0x35191d[0x0][_0x0a8f('0x68')]+_0x35191d[0x0][_0x0a8f('0x67')])/_0x35191d[0x0][_0x0a8f('0x6e')];_0x227207['predictiveIntervalHitRate']=_0x1c86df>0x0?_0x1c86df:0x1;switch(_0x227207['dialPredictiveOptimization']){case'dropRate':var _0x5a4fa5=_0x227207[_0x0a8f('0x1c9')]/0x64;return _0x5b9cf8['abandonmentRate'](_0x33967f,_0x3ed995,_0x43aa78,_0x1c86df,_0x5a4fa5)[_0x0a8f('0xba')](function(_0x2f3598){return _0x57590e(_0x2f3598);});case'agentBusyFactor':var _0x333851=_0x227207['dialPredictiveOptimizationPercentage']/0x64;return _0x5b9cf8[_0x0a8f('0x1e0')](_0x33967f,_0x3ed995,_0x43aa78,_0x1c86df,_0x333851)['then'](function(_0x35053c){return _0x57590e(_0x35053c);});default:return _0x4c1cd3(msgResponse('[getDataPredictive]',_0x0a8f('0x14c'),_0x0a8f('0x1e1')));}}else{return _0x4c1cd3(msgResponse('[getDataPredictive]',_0x0a8f('0x14c'),_0x0a8f('0x1e2')));}});};};Dialer[_0x0a8f('0xab')][_0x0a8f('0x1e3')]=function(_0x5f5859){var _0x421e05=this;return function(_0x2980aa){return new BPromise(function(_0x4bddf8,_0x17ae2e){_[_0x0a8f('0x8c')](_0x5f5859,_0x2980aa[0x0]);if(checkGetDataPredictive(_0x2980aa[0x0])){loggerPredictive[_0x0a8f('0x7c')](JSON[_0x0a8f('0x45')](_0x2980aa[0x0]));if(_0x5f5859['dialPredictiveOptimization']==='dropRate'){return _0x421e05[_0x0a8f('0xcc')](_0x5f5859['id'])[_0x0a8f('0xba')](function(_0x23e0df){var _0x1e3cfc=_0x5f5859[_0x0a8f('0x4c')]-_0x23e0df[0x0][_0x0a8f('0x1e4')];var _0x19fafd=_0x5f5859[_0x0a8f('0x1d1')]*0x3c;var _0x3f3f6e=_0x2980aa[0x0]['predictiveIntervalAvgTalktime']+_0x2980aa[0x0][_0x0a8f('0x65')];var _0xd2f477=(_0x2980aa[0x0][_0x0a8f('0x64')]+_0x2980aa[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x2980aa[0x0][_0x0a8f('0x67')])/_0x2980aa[0x0]['predictiveIntervalTotalCalls'];var _0x5c9b6d=_0x5f5859[_0x0a8f('0x1c9')]/0x64;_0x5f5859['predictiveIntervalPauses']=_0x23e0df[0x0][_0x0a8f('0x1e4')]||0x0;_0x5f5859[_0x0a8f('0x6b')]=_0xd2f477>0x0?_0xd2f477:0x1;return _0x421e05[_0x0a8f('0x1e5')](_0x1e3cfc,_0x19fafd,_0x3f3f6e,_0xd2f477,_0x5c9b6d);})['then'](function(_0x38c960){return _0x4bddf8(_0x38c960);})[_0x0a8f('0xb3')](function(_0x44a970){return _0x17ae2e(msgResponse(_0x0a8f('0x1e6'),'Failure',JSON[_0x0a8f('0x45')](_0x44a970)));});}if(_0x5f5859[_0x0a8f('0x1d2')]===_0x0a8f('0x1e7')){return _0x421e05[_0x0a8f('0xcc')](_0x5f5859['id'])[_0x0a8f('0xba')](function(_0xee0d9b){var _0x4b2b2c=_0x5f5859[_0x0a8f('0x4c')]-_0xee0d9b[0x0][_0x0a8f('0x1e4')];var _0x1b50c8=_0x5f5859[_0x0a8f('0x1d1')]*0x3c;var _0x52bbfa=_0x2980aa[0x0]['predictiveIntervalAvgTalktime']+_0x2980aa[0x0][_0x0a8f('0x65')];var _0x1ac198=(_0x2980aa[0x0][_0x0a8f('0x64')]+_0x2980aa[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x2980aa[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x2980aa[0x0][_0x0a8f('0x6e')];var _0xd8edaf=_0x5f5859[_0x0a8f('0x1c9')]/0x64;_0x5f5859[_0x0a8f('0x6d')]=_0xee0d9b[0x0][_0x0a8f('0x1e4')]||0x0;_0x5f5859[_0x0a8f('0x6b')]=_0x1ac198>0x0?_0x1ac198:0x1;return _0x421e05[_0x0a8f('0x1e0')](_0x4b2b2c,_0x1b50c8,_0x52bbfa,_0x1ac198,_0xd8edaf);})[_0x0a8f('0xba')](function(_0x4a48a8){return _0x4bddf8(_0x4a48a8);})[_0x0a8f('0xb3')](function(_0x88ec08){return _0x17ae2e(msgResponse(_0x0a8f('0x1e6'),_0x0a8f('0x14c'),JSON[_0x0a8f('0x45')](_0x88ec08)));});}}else{return _0x17ae2e(msgResponse(_0x0a8f('0x1e8'),_0x0a8f('0x14c'),_0x0a8f('0x1e2')));}});};};Dialer[_0x0a8f('0xab')]['startMethodPredictive']=function(_0x161a3c){var _0x159b87=this;return function(){var _0x895e28=0x0;var _0x1ca896=Math[_0x0a8f('0x1ce')](_0x161a3c[_0x0a8f('0x70')]*0x3e8);if(_0x1ca896>0x0){_0x1ca896=_0x1ca896<0x64?0x64:_0x1ca896;loggerPredictive[_0x0a8f('0x7c')](_0x161a3c['name'],_0x0a8f('0x1e9'),_0x1ca896,'milliseconds');_0x161a3c[_0x0a8f('0x90')]=setInterval(function(){_0x159b87[_0x0a8f('0x90')](_0x161a3c);loggerPredictiveCalls['info'](_0x0a8f('0x1ea'),_0x895e28+=0x1);},_0x1ca896);}else{loggerPredictive[_0x0a8f('0x7c')](_0x161a3c[_0x0a8f('0x3a')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x0a8f('0xab')][_0x0a8f('0x1eb')]=function(_0x556b09,_0x4e4a84){var _0x3b2554=this;return function(_0x532840){if(_['isEmpty'](_0x532840)){if(_[_0x0a8f('0xb1')](_0x4e4a84[_0x0a8f('0xd7')])||!_0x4e4a84[_0x0a8f('0x1ec')]){if(_0x556b09[_0x0a8f('0x160')]===_0x0a8f('0x6')){_0x556b09[_0x0a8f('0x133')]=_['isUndefined'](_0x556b09[_0x0a8f('0x133')])?!![]:_0x556b09[_0x0a8f('0x133')];var _0x367427=uuid['v4']();_0x3b2554[_0x0a8f('0x1f')][_0x367427]=new Action(_0x556b09,_0x4e4a84,_0x367427);loggerBooked[_0x0a8f('0x7c')]('[booked][checkContactBlack]',_0x367427,_0x0a8f('0x1ed'),JSON['stringify'](_0x556b09[_0x0a8f('0x133')]),'Queue:\x20',_0x556b09['name']);if(_0x556b09[_0x0a8f('0x133')]){_0x556b09[_0x0a8f('0x133')]=![];_0x3b2554[_0x0a8f('0x25')][_0x3b2554[_0x0a8f('0x1f')][_0x367427][_0x0a8f('0xb6')]]=[];ami['Action']({'actionid':_0x367427,'action':_0x0a8f('0x1ee'),'queue':_0x556b09[_0x0a8f('0x3a')]})['catch'](function(){_0x3b2554[_0x0a8f('0xb5')](_0x556b09);_0x3b2554[_0x0a8f('0xc3')]({'active':![],'ContactId':_0x3b2554[_0x0a8f('0x1f')][_0x367427]['ContactId'],'ListId':_0x3b2554['actions'][_0x367427][_0x0a8f('0xd6')],'VoiceQueueId':_0x3b2554[_0x0a8f('0x1f')][_0x367427]['VoiceQueueId']||undefined,'CampaignId':_0x3b2554[_0x0a8f('0x1f')][_0x367427][_0x0a8f('0xd9')]||undefined})[_0x0a8f('0xb3')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x3b2554[_0x0a8f('0x1f')][_0x367427];});}else{loggerBooked['info'](_0x0a8f('0x1ef'),JSON['stringify'](_0x556b09[_0x0a8f('0x133')]),_0x0a8f('0x1f0'),_0x556b09[_0x0a8f('0x3a')]);_0x3b2554[_0x0a8f('0xb5')](_0x556b09);_0x3b2554[_0x0a8f('0xc3')]({'active':![],'ContactId':_0x3b2554['actions'][_0x367427][_0x0a8f('0x103')],'ListId':_0x3b2554[_0x0a8f('0x1f')][_0x367427][_0x0a8f('0xd6')],'VoiceQueueId':_0x3b2554[_0x0a8f('0x1f')][_0x367427][_0x0a8f('0xd8')]||undefined,'CampaignId':_0x3b2554[_0x0a8f('0x1f')][_0x367427][_0x0a8f('0xd9')]||undefined})[_0x0a8f('0xb3')](loggerCatch(_0x0a8f('0x1f1')));delete _0x3b2554['actions'][_0x367427];}}else{return _0x3b2554[_0x0a8f('0x1f2')](_0x556b09,_0x4e4a84);}}else{if(getDiff(_0x4e4a84[_0x0a8f('0x1f3')])<_0x556b09[_0x0a8f('0x1f4')]*0x3c){if(_0x4e4a84[_0x0a8f('0x1f5')]&&!_0x4e4a84['Agent'][_0x0a8f('0x1f6')]){_0x3b2554['preview']['run'](_0x4e4a84['id'])[_0x0a8f('0x17')](function(){_0x3b2554[_0x0a8f('0xb5')](_0x556b09);});}else{_0x3b2554[_0x0a8f('0xc5')]({'active':![]},_0x4e4a84['id'],0x1)['finally'](function(){_0x3b2554[_0x0a8f('0xb5')](_0x556b09);});}}else{_0x556b09[_0x0a8f('0x1f7')]+=0x1;_0x3b2554[_0x0a8f('0xb5')](_0x556b09);if(_0x556b09[_0x0a8f('0x1f8')]){_0x3b2554[_0x0a8f('0xc3')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x4e4a84[_0x0a8f('0x103')],'ListId':_0x4e4a84['ListId'],'VoiceQueueId':_0x4e4a84['VoiceQueueId']||undefined,'CampaignId':_0x4e4a84[_0x0a8f('0xd9')]||undefined})[_0x0a8f('0xb3')](loggerCatch(_0x0a8f('0x1f9')));_0x3b2554[_0x0a8f('0xcf')](createObjHistory(_0x556b09,_0x4e4a84,'RECALLINQUEUE',0x17,_0x0a8f('0x1fa')))[_0x0a8f('0xb3')](loggerCatch(_0x0a8f('0x1fb')));}else{_0x3b2554[_0x0a8f('0xd4')](createObjHistory(_0x556b09,_0x4e4a84,_0x0a8f('0x1fc'),0x16,'RecallFailedTimeout'),_0x0a8f('0x1fd'),_0x0a8f('0x1fe'));}}}}else{_0x556b09[_0x0a8f('0x5a')]+=0x1;_0x3b2554[_0x0a8f('0xd4')](createObjHistory(_0x556b09,_0x4e4a84,'BLACKLIST',0xd,_0x0a8f('0x1ff')),_0x0a8f('0x200'),_0x0a8f('0x201'));throw _0x0a8f('0x202');}};};Dialer[_0x0a8f('0xab')][_0x0a8f('0x168')]=function(_0x1aa9f8){var _0x4eb444=this;var _0x1cf5a0=_0x1aa9f8[_0x0a8f('0x203')]-_0x1aa9f8['originated']-_0x1aa9f8[_0x0a8f('0xc8')];emitCampaignSummary(_0x1aa9f8);if(_0x1cf5a0>0x0){if(_0x1cf5a0>this[_0x0a8f('0x1d')]){_0x1cf5a0=this['maxNumberOriginate'];}_0x1aa9f8[_0x0a8f('0xc8')]+=_0x1cf5a0;this[_0x0a8f('0xca')](_0x1aa9f8['id'],_0x1cf5a0,_0x1aa9f8[_0x0a8f('0x204')],_0x1aa9f8)[_0x0a8f('0xba')](function(_0x4c0cae){_0x1aa9f8[_0x0a8f('0xc8')]-=_0x1cf5a0;_0x1aa9f8[_0x0a8f('0xc8')]=_0x1aa9f8[_0x0a8f('0xc8')]>0x0?_0x1aa9f8['temp']:0x0;if(!checkContactEmpty(_0x4c0cae)){_0x1aa9f8[_0x0a8f('0x38')]=_0x0a8f('0x9d');logger['info'](_0x0a8f('0x205')+_0x1aa9f8['name']);}else{_0x1aa9f8[_0x0a8f('0x6f')]+=_0x4c0cae[_0x0a8f('0x96')];_0x1aa9f8[_0x0a8f('0x38')]=_0x0a8f('0x206');for(var _0x52cb0b=0x0;_0x52cb0b<_0x4c0cae['length'];_0x52cb0b+=0x1){_0x1aa9f8[_0x0a8f('0x207')]+=0x1;if(_[_0x0a8f('0xb1')](_0x4c0cae[_0x52cb0b])||_[_0x0a8f('0xb1')](_0x4c0cae[_0x52cb0b]['Contact'])||_[_0x0a8f('0xb1')](_0x4c0cae[_0x52cb0b]['Contact'][_0x0a8f('0x178')])){_0x4eb444['emptyContact'](_0x0a8f('0x208'),_0x1aa9f8,_0x4c0cae[_0x52cb0b]);}else{_0x4eb444[_0x0a8f('0xbe')](_[_0x0a8f('0xd5')](_0x4c0cae[_0x52cb0b],[_0x0a8f('0xd9'),_0x0a8f('0x209')]))[_0x0a8f('0xba')](_0x4eb444['checkContactBlack'](_0x1aa9f8,_0x4c0cae[_0x52cb0b]))[_0x0a8f('0xb3')](_0x4eb444[_0x0a8f('0x20a')]('[actionOriginateIvr]\x20',_0x1aa9f8));}}}})[_0x0a8f('0xb3')](loggerGetContactDialer(_0x0a8f('0x20b'),_0x1aa9f8,_0x1cf5a0));}};Dialer[_0x0a8f('0xab')][_0x0a8f('0x162')]=function(_0x4bcd1c,_0x3d1fd6){var _0x28fefd=this;var _0x51bfea=[];var _0x2b6611=_0x3d1fd6>=0x1?_0x3d1fd6:0x1;if(_0x4bcd1c[_0x0a8f('0x160')]===_0x0a8f('0x6')){_0x2b6611=0x1;}var _0x38f413=Math[_0x0a8f('0x1ce')](_0x4bcd1c[_0x0a8f('0x4b')]*_0x2b6611)-_0x4bcd1c[_0x0a8f('0x6f')]-_0x4bcd1c[_0x0a8f('0xc8')];emitVoiceQueueSummary(_0x4bcd1c);if(_0x4bcd1c['dialLimitQueue']>0x0){var _0x2a3139=_0x4bcd1c[_0x0a8f('0x20c')]-_0x4bcd1c['originated']-_0x4bcd1c[_0x0a8f('0xa0')]-_0x4bcd1c[_0x0a8f('0xc8')]-_0x4bcd1c[_0x0a8f('0x4d')];if(_0x38f413>_0x2a3139){_0x38f413=_0x2a3139;}}if(_0x38f413>0x0){if(_0x4bcd1c['dialMethod']===_0x0a8f('0x6')){_0x38f413=0x1;}if(_0x38f413>this[_0x0a8f('0x1d')]){_0x38f413=this[_0x0a8f('0x1d')];}_0x4bcd1c[_0x0a8f('0xc8')]+=_0x38f413;for(var _0x581a9f in this[_0x0a8f('0x1b')]){if(typeof this['agents'][_0x581a9f]!==_0x0a8f('0xaf')){if(this[_0x0a8f('0x1b')][_0x581a9f][_0x0a8f('0xa7')]===_0x0a8f('0x20d')&&this['agents'][_0x581a9f][_0x0a8f('0xde')]===_0x0a8f('0xdf')){_0x51bfea[_0x0a8f('0x131')](this[_0x0a8f('0x1b')][_0x581a9f]['id']);}}}this[_0x0a8f('0xc7')](_0x4bcd1c['id'],_0x51bfea,_0x38f413,_0x4bcd1c[_0x0a8f('0x204')],_0x4bcd1c)['then'](function(_0x52731f){_0x4bcd1c[_0x0a8f('0xc8')]-=_0x38f413;_0x4bcd1c[_0x0a8f('0xc8')]=_0x4bcd1c[_0x0a8f('0xc8')]>0x0?_0x4bcd1c[_0x0a8f('0xc8')]:0x0;if(!checkContactEmpty(_0x52731f)){_0x28fefd[_0x0a8f('0xb8')](_0x4bcd1c)[_0x0a8f('0xba')](sendMessageReschedule(_0x4bcd1c))[_0x0a8f('0xb3')](loggerCatch(_0x0a8f('0xbb')));}else{_0x4bcd1c[_0x0a8f('0x6f')]+=_0x52731f[_0x0a8f('0x96')];_0x4bcd1c[_0x0a8f('0x38')]=_0x4bcd1c[_0x0a8f('0x160')]===_0x0a8f('0x6')?'ACTIVE':_0x0a8f('0x206');for(var _0x2eb116=0x0;_0x2eb116<_0x52731f['length'];_0x2eb116+=0x1){if(_[_0x0a8f('0xb1')](_0x52731f[_0x2eb116])||_['isNil'](_0x52731f[_0x2eb116]['Contact'])||_[_0x0a8f('0xb1')](_0x52731f[_0x2eb116][_0x0a8f('0x177')][_0x0a8f('0x178')])){_0x28fefd[_0x0a8f('0x20e')](_0x0a8f('0x208'),_0x4bcd1c,_0x52731f[_0x2eb116]);}else{_0x28fefd[_0x0a8f('0xbc')](_[_0x0a8f('0xd5')](_0x52731f[_0x2eb116],['VoiceQueueId',_0x0a8f('0x209')]))[_0x0a8f('0xba')](_0x28fefd[_0x0a8f('0x1eb')](_0x4bcd1c,_0x52731f[_0x2eb116]))[_0x0a8f('0xb3')](_0x28fefd[_0x0a8f('0x20a')]('[actionOriginate]\x20',_0x4bcd1c));}}}})['catch'](loggerGetContactDialer(_0x0a8f('0x20f'),_0x4bcd1c,_0x38f413));}};Dialer[_0x0a8f('0xab')][_0x0a8f('0x90')]=function(_0x9b91c7){if(_0x9b91c7[_0x0a8f('0x20c')]>0x0){var _0x310362=_0x9b91c7[_0x0a8f('0x20c')]-_0x9b91c7[_0x0a8f('0x6f')]-_0x9b91c7['talking'];if(_0x310362>0x0){this[_0x0a8f('0x210')](_0x9b91c7);}else{loggerPredictiveCalls['info'](_0x0a8f('0x211'));}}else{this[_0x0a8f('0x210')](_0x9b91c7);}};Dialer[_0x0a8f('0xab')][_0x0a8f('0x210')]=function(_0x153a33){var _0x2f5ad3=this;var _0x5a7627=[];_0x153a33[_0x0a8f('0x6f')]+=0x1;for(var _0x3e0daa in this[_0x0a8f('0x1b')]){if(typeof this['agents'][_0x3e0daa]!=='undefined'){if(this[_0x0a8f('0x1b')][_0x3e0daa]['state']==='not_inuse'&&this[_0x0a8f('0x1b')][_0x3e0daa][_0x0a8f('0xde')]===_0x0a8f('0xdf')){_0x5a7627[_0x0a8f('0x131')](this[_0x0a8f('0x1b')][_0x3e0daa]['id']);}}}this['getContactDialer'](_0x153a33['id'],_0x5a7627,0x1,_0x153a33[_0x0a8f('0x204')],_0x153a33)['then'](function(_0x291ad0){if(!checkContactEmpty(_0x291ad0)){checkContactLowerLimitOriginate(_0x153a33,0x1,0x0);_0x2f5ad3[_0x0a8f('0xb8')](_0x153a33)[_0x0a8f('0xba')](sendMessageReschedule(_0x153a33))[_0x0a8f('0xb3')](loggerCatch(_0x0a8f('0xbb')));}else{_0x153a33[_0x0a8f('0x38')]=_0x0a8f('0x206');if(_[_0x0a8f('0xb1')](_0x291ad0[0x0])||_[_0x0a8f('0xb1')](_0x291ad0[0x0][_0x0a8f('0x177')])||_[_0x0a8f('0xb1')](_0x291ad0[0x0][_0x0a8f('0x177')][_0x0a8f('0x178')])){_0x2f5ad3[_0x0a8f('0x20e')](_0x0a8f('0x208'),_0x153a33,_0x291ad0[0x0]);}else{_0x2f5ad3['checkIsBlackList'](_[_0x0a8f('0xd5')](_0x291ad0[0x0],[_0x0a8f('0xd8'),'Contact.phone']))[_0x0a8f('0xba')](_0x2f5ad3[_0x0a8f('0x1eb')](_0x153a33,_0x291ad0[0x0]))[_0x0a8f('0xb3')](_0x2f5ad3[_0x0a8f('0x20a')](_0x0a8f('0x212'),_0x153a33));}}})['catch'](loggerGetContactDialer(_0x0a8f('0x213'),_0x153a33,0x1));emitVoiceQueueSummary(_0x153a33);};Dialer['prototype']['abandonmentRate']=function(_0x2f9e1d,_0x2fa844,_0x293c76,_0x4d3ede,_0x2098b2,_0x4cd116){loggerPredictive[_0x0a8f('0x7c')](_0x0a8f('0x214'));loggerPredictive[_0x0a8f('0x7c')](_0x0a8f('0x215'),_0x2f9e1d);loggerPredictive[_0x0a8f('0x7c')](_0x0a8f('0x216'),_0x2fa844);loggerPredictive[_0x0a8f('0x7c')](_0x0a8f('0x217'),_0x293c76);loggerPredictive[_0x0a8f('0x7c')]('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',_0x4d3ede);loggerPredictive['info'](_0x0a8f('0x218'),_0x2098b2);loggerPredictive[_0x0a8f('0x7c')](_0x0a8f('0x83'));return new BPromise(function(_0x519ca0,_0x43999d){if(_0x2f9e1d<=0x0||isNaN(_0x2f9e1d)){return _0x43999d(msgResponse(_0x0a8f('0x219'),'Error','m\x20=\x20'+_0x2f9e1d));}if(_0x293c76<=0x0||isNaN(_0x293c76)){return _0x43999d(msgResponse(_0x0a8f('0x219'),'Error',_0x0a8f('0x21a')+_0x293c76));}if(_0x4d3ede<=0x0||isNaN(_0x4d3ede)){return _0x43999d(msgResponse(_0x0a8f('0x219'),'Error',_0x0a8f('0x21b')+_0x4d3ede));}if(_0x2fa844<=0x0||isNaN(_0x2fa844)){return _0x43999d(msgResponse(_0x0a8f('0x219'),_0x0a8f('0x44'),'interval\x20=\x20'+_0x2fa844));}if(_0x2098b2<=0x0||isNaN(_0x2098b2)){return _0x43999d(msgResponse(_0x0a8f('0x219'),_0x0a8f('0x44'),'Amax\x20=\x20'+_0x2098b2));}_0x4cd116=_0x4cd116||0x0;var _0x5dd567=0x1/_0x293c76;var _0xa43d87=0x0;var _0x486729=0x0;var _0x44d566=0x0;var _0x55925b=0x0;for(var _0x243708=0x0;_0x44d566<_0x2098b2;_0x243708+=0x1){_0x486729=_0x243708/_0x2fa844;_0xa43d87=(_0x4d3ede*_0x486729+_0x4cd116)/_0x5dd567;_0x44d566=erlangb(_0xa43d87,_0x2f9e1d);_0x55925b=_0xa43d87/_0x2f9e1d*(0x1-erlangb(_0xa43d87,_0x2f9e1d));}return _0x519ca0({'erlangCalls':_0x243708,'erlangCallToSecond':_0x2fa844/_0x243708,'erlangAbandonmentRate':_0x44d566,'erlangBusyFactor':_0x55925b});});};Dialer[_0x0a8f('0xab')][_0x0a8f('0x1e0')]=function(_0x2a75f9,_0x123d11,_0x550337,_0x5d3cb3,_0xc9dbc0,_0x1ba3a2){loggerPredictive[_0x0a8f('0x7c')](_0x0a8f('0x21c'));loggerPredictive[_0x0a8f('0x7c')](_0x0a8f('0x215'),_0x2a75f9);loggerPredictive['info'](_0x0a8f('0x216'),_0x123d11);loggerPredictive[_0x0a8f('0x7c')]('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',_0x550337);loggerPredictive['info'](_0x0a8f('0x21d'),_0x5d3cb3);loggerPredictive['info']('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xc9dbc0);loggerPredictive['info']('---------------------------');return new BPromise(function(_0x446090,_0x59fe35){if(_0x2a75f9<=0x0||isNaN(_0x2a75f9)){return _0x59fe35(msgResponse(_0x0a8f('0x21e'),'Error',_0x0a8f('0x21f')+_0x2a75f9));}if(_0x550337<=0x0||isNaN(_0x550337)){return _0x59fe35(msgResponse(_0x0a8f('0x21e'),'Error',_0x0a8f('0x21a')+_0x550337));}if(_0x5d3cb3<=0x0||isNaN(_0x5d3cb3)){return _0x59fe35(msgResponse(_0x0a8f('0x21e'),_0x0a8f('0x44'),_0x0a8f('0x21b')+_0x5d3cb3));}if(_0x123d11<=0x0||isNaN(_0x123d11)){return _0x59fe35(msgResponse(_0x0a8f('0x21e'),_0x0a8f('0x44'),'interval\x20=\x20'+_0x123d11));}if(_0xc9dbc0<=0x0||isNaN(_0xc9dbc0)){return _0x59fe35(msgResponse(_0x0a8f('0x21e'),_0x0a8f('0x44'),_0x0a8f('0x220')+_0xc9dbc0));}_0x1ba3a2=_0x1ba3a2||0x0;var _0x7d3cdc=0x1/_0x550337;var _0x3f3c3a=0x0;var _0x4f7924=0x0;var _0x8f63e8=0x0;var _0x804b13=0x0;for(var _0x46cf64=0x0;_0x804b13<_0xc9dbc0;_0x46cf64+=0x1){_0x4f7924=_0x46cf64/_0x123d11;_0x3f3c3a=(_0x5d3cb3*_0x4f7924+_0x1ba3a2)/_0x7d3cdc;_0x8f63e8=erlangb(_0x3f3c3a,_0x2a75f9);_0x804b13=_0x3f3c3a/_0x2a75f9*(0x1-erlangb(_0x3f3c3a,_0x2a75f9));}return _0x446090({'erlangCalls':_0x46cf64,'erlangCallToSecond':_0x123d11/_0x46cf64,'erlangAbandonmentRate':_0x8f63e8,'erlangBusyFactor':_0x804b13});});};module['exports']=Dialer;
\ No newline at end of file
+var _0x29d2=['dialCutDigit','substring','OriginateError','[originate][error]','originate\x20action\x20Error','syncOriginateResponse','getQueue','isSuccess','response','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','[rescheduleContact][AgentReject]','callProgressDetecting','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','reason','NoSuchNumber','custom:agentnosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','Success','[moveContactManagedDialer][0]','contact\x20not\x20moved','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','getDataPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dropRate','dialPredictiveOptimizationPercentage','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','[handlePredictive]','checkContactBlack','UserId','recallme','[booked][checkContactBlack]','Queue:\x20','queuestatus','[booked][checkContactBlack][else]','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','Agent','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','outboundBlacklistCallsDay','BLACKLIST','[Originate][historyBlacklist]','inBlackList','getContactDialerIvr','dialOrderByScheduledAt','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','dialLimitQueue','tryOriginatePredictive','not_inuse','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\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]','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','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','m\x20=\x20','Ts\x20=\x20','[busyFactor]','Umin\x20=\x20','exports','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/environment/','../../../config/logger','dialer','predictive','predictiveCalls','../ami','redis','defaults','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','./action','./final','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','actions','contactsId','uniqueId','optionPredictive','startPredictive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','syncQueueCallerAbandon','agentcomplete','custom:queuesummary','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopClearZombieChannels','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','isEmpty','Intervals','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','emit','type','outbound','strategy','answered','available','loggedIn','pTalking','sumBillable','sumHoldTime','talking','total','unmanaged','abandoned','waiting','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startProgressive','Trunk','active','callerid','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','info','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','isUndefined','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','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','merge','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','length','undefined','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','NOT_ACTIVE','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','statedesc','endtime','clearZombieChannels','[uniqueid]','[actions]','isNil','Action','catch','No\x20such\x20channel','queue','[Dialer][checkChannel]','updateOriginated','[Dialer][checkChannel][ivr]','countReScheduled','then','[countReScheduled]\x20','checkIsBlackList','resolve','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','emptyContact','notFound','saveInDb','pick','ContactId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isTrunkReachable','SIP/%s','status','reachable','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','value','HANGUP','state','HangupInAMD','AMD','custom:amd','buildObj','amd','[syncHangupInAMD]','dialAMDActive','MACHINE','Machine','membername','countmachineretry','countglobal','[syncAgentComplete][createHistory][0]','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','dialGlobalMaxRetry','stateGlobal','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','ListId','VoiceQueueId','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countbusyretry','countagentrejectretry','reason19\x20machine....','[rescheduleContact][Machine]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AGI','outboundUnknownCallsDay','cause-txt','Unknow','syncAgentComplete','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','answertime','YYYY-MM-DD\x20HH:mm:ss','queueCallerAbandonCreateState','[syncAgentComplete][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','Drop','dropreason','TIMEOUT','dialDropMaxRetry','dialDropRetryFrequency','minutes','[rescheduleContact][Drop]','starttime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','dialAbandonedRetryFrequency','[syncAgentComplete][createHistory][11]','channel','roundrobin','actionid','locked','stateinterface','push','idHopper','paused','queueStatusComplete','run','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','contactAgent-idHopper:\x20','[Catch][Preview][syncQueueStatusComplete]','Agent:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','loopCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','command','iftime\x20%s,%s','interval','content','indexOf','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','Timezone:\x20','progressive','handlePower','power','booked','Queue','method\x20not\x20recognized','launchHandleIvr','syncQueueSummary','dialTimezone','[syncQueueSummary]','syncCampaigns','dialGlobalInterval','[syncCampaigns]','\x5cw{0,','pow','replace','match','actionOriginate','object','voiceQueue\x20is\x20undefine','phone','originate','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','\x22%s,%s%s,,,%s\x22','NONE','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','Contact','tags','createdAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','dialPrefix','trim'];(function(_0x135018,_0x936e2c){var _0x1c8c1e=function(_0x226160){while(--_0x226160){_0x135018['push'](_0x135018['shift']());}};_0x1c8c1e(++_0x936e2c);}(_0x29d2,0x8e));var _0x229d=function(_0x2d65aa,_0x188805){_0x2d65aa=_0x2d65aa-0x0;var _0x46fecd=_0x29d2[_0x2d65aa];return _0x46fecd;};'use strict';var util=require('util');var _=require(_0x229d('0x0'));var BPromise=require(_0x229d('0x1'));var uuid=require(_0x229d('0x2'));var moment=require(_0x229d('0x3'));var rr=require('rr');var md5=require(_0x229d('0x4'));var Redis=require(_0x229d('0x5'));var ut=require('../preview/util/util');var config=require(_0x229d('0x6'));var logger=require(_0x229d('0x7'))(_0x229d('0x8'));var loggerBooked=require(_0x229d('0x7'))('booked');var loggerPredictive=require('../../../config/logger')(_0x229d('0x9'));var loggerPredictiveCalls=require('../../../config/logger')(_0x229d('0xa'));var loggerSyncQueueSummary=require('../../../config/logger')('syncQueueSummary');var ami=require(_0x229d('0xb'));config[_0x229d('0xc')]=_[_0x229d('0xd')](config[_0x229d('0xc')],{'host':'localhost','port':0x18eb});var io=require(_0x229d('0xe'))(new Redis(config[_0x229d('0xc')]));var cmHopper=require(_0x229d('0xf'));var cmHopperHistory=require(_0x229d('0x10'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require(_0x229d('0x11'));var History=require('./history');var Final=require(_0x229d('0x12'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require(_0x229d('0x13'));var ipAgi=process[_0x229d('0x14')][_0x229d('0x15')]||_0x229d('0x16');var strategy={'rrmemory':_0x229d('0x17'),'roundrobin':'roundrobin'};var Sequence=function(){};Sequence[_0x229d('0x18')][_0x229d('0x19')]=function(_0x4d9e4d){this['tail']=this['tail']?this[_0x229d('0x1a')][_0x229d('0x1b')](_0x4d9e4d):_0x4d9e4d();};function Dialer(_0x293a18,_0x348803){this[_0x229d('0x1c')]=new Sequence();this[_0x229d('0x1d')]=_0x348803;this[_0x229d('0x1e')]=_0x293a18[_0x229d('0x1e')];this[_0x229d('0x1f')]=_0x293a18[_0x229d('0x1f')];this[_0x229d('0x20')]=_0x293a18['agents'];this[_0x229d('0x21')]=_0x293a18[_0x229d('0x21')];this[_0x229d('0x22')]=config[_0x229d('0x22')]||0x2;this['channels']={};this[_0x229d('0x23')]={};this[_0x229d('0x24')]={};this[_0x229d('0x25')]={};this[_0x229d('0x26')]={};this[_0x229d('0x27')]={};this['startProgressive']={};this[_0x229d('0x28')]={};this[_0x229d('0x29')]={};this[_0x229d('0x2a')]={};ami['on'](_0x229d('0x2b'),this[_0x229d('0x2c')][_0x229d('0x2d')](this));ami['on']('queuecallerabandon',this[_0x229d('0x2e')]['bind'](this));ami['on']('originateresponse',this['syncOriginateResponse'][_0x229d('0x2d')](this));ami['on'](_0x229d('0x2f'),this['syncAgentComplete'][_0x229d('0x2d')](this));ami['on'](_0x229d('0x30'),this['syncQueueSummary'][_0x229d('0x2d')](this));ami['on'](_0x229d('0x31'),this[_0x229d('0x32')][_0x229d('0x2d')](this));ami['on'](_0x229d('0x33'),this[_0x229d('0x34')]['bind'](this));ami['on'](_0x229d('0x35'),this[_0x229d('0x36')][_0x229d('0x2d')](this));ami['on'](_0x229d('0x37'),this[_0x229d('0x38')]['bind'](this));ami['on'](_0x229d('0x39'),this[_0x229d('0x3a')]['bind'](this));this['loopCampaigns']();this[_0x229d('0x3b')]();}function isNotNull(_0xc41639){return _0xc41639!==null&&!_['isUndefined'](_0xc41639);}function checkIsLoggedIn(_0x5d9f3d,_0xfea0b2){return function(){if(_0xfea0b2<=0x0){_0x5d9f3d[_0x229d('0x3c')]=_0x229d('0x3d');throw _0x5d9f3d[_0x229d('0x3e')]+_0x229d('0x3f');}};}function isActive(_0x14ede0){return _0x14ede0;}function checkIsActive(_0x57a70a,_0x5b3a57){return function(){if(!isActive(_0x5b3a57)){_0x57a70a['message']='NOT_ACTIVE';throw _0x57a70a[_0x229d('0x3e')]+_0x229d('0x40');}};}function checkInterval(_0x28a540){return function(){if(!isNotNull(_0x28a540[_0x229d('0x41')])){_0x28a540['message']=_0x229d('0x42');throw _0x28a540['name']+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x28a540[_0x229d('0x41')]['Intervals'])){_0x28a540[_0x229d('0x3c')]=_0x229d('0x42');throw _0x28a540[_0x229d('0x3e')]+_0x229d('0x43');}if(!isNotNull(_[_0x229d('0x44')](_0x28a540[_0x229d('0x41')][_0x229d('0x45')]))){_0x28a540[_0x229d('0x3c')]=_0x229d('0x42');throw _0x28a540[_0x229d('0x3e')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x1ee311,_0x297646,_0x14e895){return{'action':_0x1ee311,'response':_0x297646,'message':_0x14e895,'stack':_0x14e895};}function myreject(_0x63860d){return function(_0x2a3fbe){return _0x63860d(msgResponse(_0x229d('0x46'),_0x229d('0x47'),JSON[_0x229d('0x48')](_0x2a3fbe)));};}function getSeconds(_0x2b6066,_0x1401ca){var _0x3ec774=moment(_0x2b6066)[_0x229d('0x49')](0x0);var _0x20fc46=moment(_0x1401ca)[_0x229d('0x49')](0x0);return _0x3ec774[_0x229d('0x4a')](_0x20fc46,_0x229d('0x4b'));}function emit(_0x233978,_0x159ba5,_0x11f05f){io['to'](_0x233978)[_0x229d('0x4c')](_0x159ba5,_0x11f05f);}function emitVoiceQueueSummary(_0x934264){if(_0x934264[_0x229d('0x4d')]===_0x229d('0x4e')){var _0x362ea9={'id':_0x934264['id'],'name':_0x934264[_0x229d('0x3e')],'strategy':_0x934264[_0x229d('0x4f')],'answered':_0x934264[_0x229d('0x50')],'available':_0x934264[_0x229d('0x51')],'loggedIn':_0x934264[_0x229d('0x52')],'pTalking':_0x934264[_0x229d('0x53')],'sumBillable':_0x934264[_0x229d('0x54')],'sumDuration':_0x934264['sumDuration'],'sumHoldTime':_0x934264[_0x229d('0x55')]||0x0,'talking':_0x934264[_0x229d('0x56')],'total':_0x934264[_0x229d('0x57')],'type':_0x934264[_0x229d('0x4d')],'unmanaged':_0x934264[_0x229d('0x58')],'abandoned':_0x934264[_0x229d('0x59')],'waiting':_0x934264[_0x229d('0x5a')],'loggedInDb':_0x934264['loggedInDb'],'dialActive':_0x934264[_0x229d('0x5b')],'dialMethod':_0x934264[_0x229d('0x5c')],'dialOriginateCallerIdName':_0x934264[_0x229d('0x5d')],'dialOriginateCallerIdNumber':_0x934264[_0x229d('0x5e')],'dialOriginateTimeout':_0x934264[_0x229d('0x5f')],'dialPrefix':_0x934264['dialPrefix'],'outboundAnswerAgiCallsDay':_0x934264[_0x229d('0x60')],'outboundAnswerCallsDay':_0x934264[_0x229d('0x61')],'outboundBlacklistCallsDay':_0x934264['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x934264['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x934264[_0x229d('0x62')],'outboundDropCallsDayACS':_0x934264[_0x229d('0x63')],'outboundDropCallsDayCallersExit':_0x934264[_0x229d('0x64')],'outboundDropCallsDayTimeout':_0x934264['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x934264[_0x229d('0x65')],'outboundNoSuchCallsDay':_0x934264[_0x229d('0x66')],'outboundOriginateFailureCallsDay':_0x934264['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x934264['outboundReCallsDay'],'outboundRejectCallsDay':_0x934264[_0x229d('0x67')],'outboundUnknownCallsDay':_0x934264['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x934264[_0x229d('0x68')],'predictiveIntervalAvgHoldtime':_0x934264['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x934264['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x934264[_0x229d('0x69')],'predictiveIntervalDroppedCallsTimeout':_0x934264['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x934264[_0x229d('0x6a')],'predictiveIntervalErlangCallsDroppedCalls':_0x934264[_0x229d('0x6b')],'predictiveIntervalHitRate':_0x934264[_0x229d('0x6c')],'predictiveIntervalMultiplicativeFactor':_0x934264['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x934264[_0x229d('0x6d')],'predictiveIntervalAvailable':_0x934264[_0x229d('0x6e')],'predictiveIntervalTotalCalls':_0x934264[_0x229d('0x6f')],'message':_0x934264[_0x229d('0x3c')],'originated':_0x934264[_0x229d('0x70')],'erlangCalls':_0x934264['erlangCalls'],'erlangCallToSecond':_0x934264[_0x229d('0x71')],'erlangAbandonmentRate':_0x934264[_0x229d('0x72')],'erlangBusyFactor':_0x934264[_0x229d('0x73')],'startPredictive':_0x934264[_0x229d('0x27')],'startProgressive':_0x934264[_0x229d('0x74')]};if(_0x934264['Trunk']){_0x362ea9[_0x229d('0x75')]={'id':_0x934264[_0x229d('0x75')]['id'],'name':_0x934264[_0x229d('0x75')][_0x229d('0x3e')],'active':_0x934264[_0x229d('0x75')][_0x229d('0x76')],'callerid':_0x934264['Trunk'][_0x229d('0x77')]};}if(_0x934264[_0x229d('0x41')]){_0x362ea9['Interval']={'id':_0x934264['Interval']['id'],'name':_0x934264[_0x229d('0x41')]['name']};}var _0x858340=md5(JSON['stringify'](_0x362ea9));if(_0x934264[_0x229d('0x4')]!==_0x858340){_0x934264['md5']=_0x858340;emit(util[_0x229d('0x78')](_0x229d('0x79'),_0x362ea9[_0x229d('0x3e')]),_0x229d('0x7a'),_0x362ea9);}}}function emitCampaignSummary(_0x3ea055){if(_0x3ea055[_0x229d('0x4d')]===_0x229d('0x7b')){emit(util[_0x229d('0x78')](_0x229d('0x7c'),_0x3ea055[_0x229d('0x3e')]),'campaign:save',_0x3ea055);}}function checkGetDataPredictive(_0x1755a9){if(isNotNull(_0x1755a9)&&!_[_0x229d('0x44')](_0x1755a9)){loggerPredictive[_0x229d('0x7d')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0x229d('0x7d')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1755a9[_0x229d('0x6f')]);loggerPredictive['info'](_0x229d('0x7e'),_0x1755a9[_0x229d('0x68')]);loggerPredictive[_0x229d('0x7d')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1755a9[_0x229d('0x7f')]);loggerPredictive[_0x229d('0x7d')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1755a9[_0x229d('0x69')]);loggerPredictive[_0x229d('0x7d')](_0x229d('0x80'),_0x1755a9[_0x229d('0x81')]);loggerPredictive[_0x229d('0x7d')](_0x229d('0x82'),_0x1755a9[_0x229d('0x83')]);loggerPredictive[_0x229d('0x7d')](_0x229d('0x84'));if(_0x1755a9['predictiveIntervalTotalCalls']>0x0){if(!_['isUndefined'](_0x1755a9[_0x229d('0x83')])&&_0x1755a9[_0x229d('0x83')]>0x0){return!![];}loggerPredictive[_0x229d('0x7d')](_0x229d('0x85'));if(!_[_0x229d('0x86')](_0x1755a9['predictiveIntervalAvgHoldtime'])&&_0x1755a9['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0x229d('0x7d')](_0x229d('0x87'));}else{loggerPredictive[_0x229d('0x7d')](_0x229d('0x88'));}}else{loggerPredictive['info'](_0x229d('0x89'));}return![];}function mergeDataErlangB(_0x36b820){return function(_0x562c9c){loggerPredictive[_0x229d('0x7d')](_0x229d('0x8a'));loggerPredictive[_0x229d('0x7d')](_0x229d('0x8b'),_0x562c9c[_0x229d('0x8c')]);loggerPredictive[_0x229d('0x7d')](_0x229d('0x8d'),_0x562c9c[_0x229d('0x71')]);loggerPredictive['info'](_0x229d('0x8e'),_0x562c9c[_0x229d('0x72')]);loggerPredictive[_0x229d('0x7d')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x562c9c['erlangBusyFactor']);loggerPredictive[_0x229d('0x7d')](_0x229d('0x8e'),_0x562c9c[_0x229d('0x72')]);loggerPredictive[_0x229d('0x7d')](_0x229d('0x84'));_[_0x229d('0x8f')](_0x36b820,_0x562c9c);};}function getDiff(_0x1b23c0){var _0x4be4cb=moment()[_0x229d('0x49')](0x0);var _0x413fa8=moment(_0x1b23c0)[_0x229d('0x49')](0x0);return _0x4be4cb[_0x229d('0x4a')](_0x413fa8,_0x229d('0x4b'));}function ifInterval(_0x4df998,_0x2cfcce){if(_[_0x229d('0x86')](_0x2cfcce)){return![];}return getDiff(_0x2cfcce)<_0x4df998*0x3c;}function freeVariablesPredictive(_0x3f3d83){if(isNotNull(_0x3f3d83)){if(!_[_0x229d('0x86')](_0x3f3d83[_0x229d('0x74')])){_0x3f3d83['startProgressive']=undefined;loggerPredictive['info'](_0x3f3d83[_0x229d('0x3e')],'clearing\x20variable\x20start\x20progressive');}if(!_[_0x229d('0x86')](_0x3f3d83[_0x229d('0x27')])){_0x3f3d83[_0x229d('0x27')]=undefined;loggerPredictive[_0x229d('0x7d')](_0x3f3d83[_0x229d('0x3e')],_0x229d('0x90'));}if(!_[_0x229d('0x86')](_0x3f3d83[_0x229d('0x91')])){clearInterval(_0x3f3d83[_0x229d('0x91')]);_0x3f3d83['handlePredictive']=undefined;loggerPredictive[_0x229d('0x7d')](_0x3f3d83[_0x229d('0x3e')],_0x229d('0x92'));}}}function erlangb(_0x49593c,_0x710c53){if(_0x710c53===0x0){return 0x0;}var _0x58ef45=0x1;for(var _0x2ef69d=0x1;_0x2ef69d<=_0x710c53;_0x2ef69d+=0x1){_0x58ef45=0x1+_0x58ef45*_0x2ef69d/_0x49593c;}return 0x1/_0x58ef45;}function isVoiceQueueOutbound(_0x223b89){return _0x223b89==='outbound';}function isNotPreview(_0x1dcbb1){return _0x1dcbb1!=='preview';}function isCampaignIvr(_0x4e48e1){return _0x4e48e1==='ivr';}function getCallerId(_0x5f4800,_0xcfe309,_0x1c2a2b){if(!_[_0x229d('0x86')](_0x1c2a2b)&&typeof _0x1c2a2b==='string'&&!_[_0x229d('0x44')](_0x1c2a2b)){if(!_[_0x229d('0x86')](_0xcfe309)&&typeof _0xcfe309===_0x229d('0x93')&&!_[_0x229d('0x44')](_0xcfe309)){return util[_0x229d('0x78')](_0x229d('0x94'),_0xcfe309,_0x1c2a2b);}return util[_0x229d('0x78')](_0x229d('0x94'),_0x1c2a2b,_0x1c2a2b);}if(!_[_0x229d('0x86')](_0x5f4800)&&typeof _0x5f4800===_0x229d('0x93')&&!_['isEmpty'](_0x5f4800)){return _0x5f4800;}return _0x229d('0x95');}function loggerCatchQueueSummary(_0x44bc23,_0x25a60e){return function(_0x2b3563){freeVariablesPredictive(_0x25a60e);emitVoiceQueueSummary(_0x25a60e);emitCampaignSummary(_0x25a60e);loggerSyncQueueSummary[_0x229d('0x96')](_0x44bc23,util[_0x229d('0x97')](_0x2b3563,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x22a6be,_0x24c585){return function(_0x4e7d88){loggerPredictive['error'](_0x24c585[_0x229d('0x3e')],_0x22a6be);loggerPredictive[_0x229d('0x96')](_0x4e7d88['stack']);freeVariablesPredictive(_0x24c585);};}function loggerCatch(_0xf7463c){return function(_0x812468){logger[_0x229d('0x96')](_0xf7463c,util['inspect'](_0x812468,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x2d0eb4){return _0x2d0eb4&&!_[_0x229d('0x86')](_0x2d0eb4)&&_0x2d0eb4[_0x229d('0x98')]>0x0;}function decremetOriginate(_0x1b3d68){if(!_['isUndefined'](_0x1b3d68)&&_0x1b3d68!==null){if(typeof _0x1b3d68[_0x229d('0x70')]!==_0x229d('0x99')){if(_0x1b3d68['originated']>0x0){_0x1b3d68['originated']-=0x1;}else{logger['error']('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger['error'](_0x229d('0x9a'));}}function checkContactLowerLimitOriginate(_0x4e9905,_0x3dd0d7,_0x40eb75){if(_0x3dd0d7>_0x40eb75){for(var _0x238fc0=0x0;_0x238fc0<_0x3dd0d7-_0x40eb75;_0x238fc0+=0x1){decremetOriginate(_0x4e9905);}}}function loggerGetContactDialer(_0x4ed743,_0x5e38ef,_0x3286bd){return function(_0x4ba59e){checkContactLowerLimitOriginate(_0x5e38ef,_0x3286bd,0x0);logger[_0x229d('0x96')](_0x4ed743,util['inspect'](_0x4ba59e,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x2ce2c4){return function(_0x214681){if(isNotNull(_0x214681)&&isNotNull(_0x214681[0x0])){if(_0x214681[0x0][_0x229d('0x9b')]>0x0){_0x2ce2c4[_0x229d('0x3c')]=_0x229d('0x9c');logger['info'](_0x229d('0x9d')+_0x2ce2c4['name'],_0x214681[0x0][_0x229d('0x9b')],_0x229d('0x9e'));}else{_0x2ce2c4[_0x229d('0x3c')]=_0x229d('0x9f');logger[_0x229d('0x7d')](_0x229d('0xa0')+_0x2ce2c4['name']);}}};}function notSendMessagesQueue(_0x490b0e){if(_0x490b0e[_0x229d('0xa1')]){freeVariablesPredictive(_0x490b0e);if(_0x490b0e[_0x229d('0x70')]===0x0&&_0x490b0e[_0x229d('0x56')]===0x0&&_0x490b0e[_0x229d('0x5a')]===0x0&&(_0x490b0e[_0x229d('0x53')]||0x0)===0x0){_0x490b0e['sendMessageOneNotActive']=![];_0x490b0e[_0x229d('0x51')]=0x0;_0x490b0e[_0x229d('0x3c')]=_0x229d('0xa2');loggerSyncQueueSummary[_0x229d('0x96')](_0x229d('0xa3'),_0x490b0e[_0x229d('0x3e')],_0x229d('0xa4'));}else{_0x490b0e[_0x229d('0x3c')]=_0x229d('0xa5');loggerSyncQueueSummary[_0x229d('0x96')](_0x229d('0xa3'),_0x490b0e[_0x229d('0x3e')],_0x229d('0xa6'));}emitVoiceQueueSummary(_0x490b0e);}}function notSendMessagesCampaign(_0xcc564e){if(_0xcc564e[_0x229d('0xa1')]){if(_0xcc564e[_0x229d('0x70')]===0x0){_0xcc564e[_0x229d('0xa1')]=![];_0xcc564e[_0x229d('0x3c')]=_0x229d('0xa2');loggerSyncQueueSummary[_0x229d('0x96')](_0x229d('0xa7'),_0xcc564e[_0x229d('0x3e')],'is\x20not\x20active');}else{_0xcc564e[_0x229d('0x3c')]=_0x229d('0xa5');loggerSyncQueueSummary[_0x229d('0x96')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0xcc564e[_0x229d('0x3e')],_0x229d('0xa6'));}emitCampaignSummary(_0xcc564e);}}function createObjHistory(_0x20484b,_0xf754d2,_0x2c5406,_0x515797,_0x2f977a){_0x20484b[_0x229d('0x3c')]=_0x2c5406;var _0x596a3d=new Action(_0x20484b,_0xf754d2);var _0x205361=new History(_0x596a3d);_0x205361['state']=_0x515797;_0x205361[_0x229d('0xa8')]=_0x2f977a;_0x205361[_0x229d('0xa9')]=_0x596a3d['starttime'];return _0x205361;}Dialer['prototype'][_0x229d('0x3b')]=function(){var _0x471994=this;setInterval(function(){_0x471994[_0x229d('0xaa')](_0x471994[_0x229d('0x25')],_0x229d('0xab'));_0x471994[_0x229d('0xaa')](_0x471994[_0x229d('0x23')],_0x229d('0xac'));},0x32c8);};Dialer['prototype'][_0x229d('0xaa')]=function(_0x249250,_0x244b40){var _0xccd3e=this;for(var _0x4f0431 in _0x249250){if(typeof _0x249250[_0x4f0431]!=='undefined'){this[_0x229d('0x1c')][_0x229d('0x19')](function(){if(!_[_0x229d('0xad')](_0x249250[_0x4f0431])){return ami[_0x229d('0xae')]({'action':'status','channel':_0x249250[_0x4f0431]['channel']})[_0x229d('0xaf')](function(_0x5b3858){if(_0x5b3858[_0x229d('0x3c')]===_0x229d('0xb0')){setTimeout(function(){if(_0x249250[_0x4f0431]&&_0x249250[_0x4f0431][_0x229d('0x4d')]!==_0x229d('0x7b')){_0xccd3e['updateOriginated'](_0xccd3e['voiceQueues'][_0x249250[_0x4f0431][_0x229d('0xb1')]]);logger['error'](_0x229d('0xb2'),_0x244b40,_0x4f0431,_0x249250[_0x4f0431][_0x229d('0xb1')]);delete _0x249250[_0x4f0431];}if(_0x249250[_0x4f0431]&&_0x249250[_0x4f0431][_0x229d('0x4d')]==='ivr'){_0xccd3e[_0x229d('0xb3')](_0xccd3e['campaigns'][_0x249250[_0x4f0431][_0x229d('0xb1')]]);logger[_0x229d('0x96')](_0x229d('0xb4'),_0x244b40,_0x4f0431,_0x249250[_0x4f0431][_0x229d('0xb1')]);delete _0x249250[_0x4f0431];}},0x2328);}});}});}}};Dialer[_0x229d('0x18')][_0x229d('0xb5')]=function(_0x2f9499){return BPromise['resolve']()[_0x229d('0xb6')](cmHopper[_0x229d('0xb5')](_0x2f9499))['catch'](loggerCatch(_0x229d('0xb7')));};Dialer[_0x229d('0x18')][_0x229d('0xb8')]=function(_0x4a78a3){return BPromise[_0x229d('0xb9')]()['then'](cmHopperBlack[_0x229d('0xb8')](_0x4a78a3))['catch'](loggerCatch(_0x229d('0xba')));};Dialer['prototype'][_0x229d('0xbb')]=function(_0xc801b){return BPromise[_0x229d('0xb9')]()[_0x229d('0xb6')](cmHopperBlack['checkIsBlackListIvr'](_0xc801b))[_0x229d('0xaf')](loggerCatch(_0x229d('0xbc')));};Dialer[_0x229d('0x18')][_0x229d('0xbd')]=function(_0x5a3335){return BPromise[_0x229d('0xb9')]()[_0x229d('0xb6')](cmHopperHistory[_0x229d('0xbe')](_0x5a3335))[_0x229d('0xaf')](loggerCatch(_0x229d('0xbf')));};Dialer['prototype'][_0x229d('0xc0')]=function(_0x8c6733){return BPromise[_0x229d('0xb9')]()[_0x229d('0xb6')](cmHopper['rescheduleContact'](_0x8c6733))['catch'](loggerCatch(_0x229d('0xc1')));};Dialer[_0x229d('0x18')]['unlockContact']=function(_0x85483b,_0x241064,_0x2fa85d){return BPromise[_0x229d('0xb9')]()[_0x229d('0xb6')](cmHopper[_0x229d('0xc2')](_0x85483b,_0x241064,_0x2fa85d))[_0x229d('0xaf')](loggerCatch(_0x229d('0xc3')));};Dialer[_0x229d('0x18')][_0x229d('0xc4')]=function(_0x2c1141,_0x126c1f,_0x52ef22,_0x40a501,_0x431ae1){return BPromise[_0x229d('0xb9')]()[_0x229d('0xb6')](cmHopper[_0x229d('0xc4')](_0x2c1141,_0x126c1f,_0x52ef22,_0x40a501))[_0x229d('0xaf')](function(_0x41f17b){_0x431ae1[_0x229d('0xc5')]-=_0x52ef22;_0x431ae1[_0x229d('0xc5')]=_0x431ae1['temp']>0x0?_0x431ae1[_0x229d('0xc5')]:0x0;loggerCatch(_0x229d('0xc6'))(_0x41f17b);});};Dialer[_0x229d('0x18')]['getContactDialerIvr']=function(_0xbb1728,_0x52a668,_0x256f40,_0x4e07c6){return BPromise[_0x229d('0xb9')]()[_0x229d('0xb6')](cmHopper['getContactDialerIvr'](_0xbb1728,_0x52a668,_0x256f40))[_0x229d('0xaf')](function(_0x4ecc72){_0x4e07c6['temp']-=_0x52a668;_0x4e07c6[_0x229d('0xc5')]=_0x4e07c6[_0x229d('0xc5')]>0x0?_0x4e07c6[_0x229d('0xc5')]:0x0;loggerCatch(_0x229d('0xc7'))(_0x4ecc72);});};Dialer[_0x229d('0x18')][_0x229d('0xc8')]=function(_0x317ee1){return BPromise[_0x229d('0xb9')]()[_0x229d('0xb6')](voiceQueueRt[_0x229d('0xc8')](_0x317ee1))['catch'](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0x229d('0x18')][_0x229d('0xc9')]=function(_0x41a3da){return BPromise[_0x229d('0xb9')]()[_0x229d('0xb6')](cmHopper['moveContactManagedDialer'](_0x41a3da))['catch'](loggerCatch(_0x229d('0xca')));};Dialer['prototype']['createHistory']=function(_0x5c69cb){return BPromise[_0x229d('0xb9')]()[_0x229d('0xb6')](cmHopperHistory[_0x229d('0xcb')](_0x5c69cb))[_0x229d('0xaf')](loggerCatch(_0x229d('0xcc')));};Dialer[_0x229d('0x18')]['updateOriginated']=function(_0xfcf96f){if(!_[_0x229d('0x86')](_0xfcf96f)&&_0xfcf96f!==null){if(typeof _0xfcf96f['originated']!==_0x229d('0x99')){if(_0xfcf96f[_0x229d('0x70')]>0x0){_0xfcf96f[_0x229d('0x70')]-=0x1;}else{logger['error'](_0x229d('0xcd'));}}}else{logger['error']('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0x229d('0x18')][_0x229d('0xce')]=function(_0x5159af,_0x28f8ef){var _0x185f72=this;return function(_0x57e498){_0x185f72[_0x229d('0xb3')](_0x28f8ef);logger[_0x229d('0x96')](_0x5159af,util[_0x229d('0x97')](_0x57e498,{'showHidden':![],'depth':null}));};};Dialer[_0x229d('0x18')][_0x229d('0xcf')]=function(_0x311e64,_0x1418fa,_0x3f95e3){var _0x57207d={'state':0x19,'statedesc':_0x229d('0xd0')};this[_0x229d('0xb3')](_0x1418fa);this[_0x229d('0xd1')](_['merge'](_0x57207d,_[_0x229d('0xd2')](_0x3f95e3,[_0x229d('0xd3'),'ListId','UserId','VoiceQueueId',_0x229d('0xd4')])),_0x229d('0xd5'),_0x229d('0xd6'));logger['error'](_0x311e64);};Dialer['prototype']['isSuccess']=function(_0x1df985){return _0x1df985==='Success';};Dialer[_0x229d('0x18')][_0x229d('0xd7')]=function(_0x516c1e){return!_[_0x229d('0x86')](_0x516c1e)&&_0x516c1e&&!_[_0x229d('0x86')](_0x516c1e[_0x229d('0x3e')])&&!_[_0x229d('0x86')](_0x516c1e[_0x229d('0x76')])&&_0x516c1e[_0x229d('0x76')]&&(this['trunks'][util[_0x229d('0x78')](_0x229d('0xd8'),_0x516c1e[_0x229d('0x3e')])][_0x229d('0xd9')]===_0x229d('0xda')||this['trunks'][util[_0x229d('0x78')](_0x229d('0xd8'),_0x516c1e[_0x229d('0x3e')])]['status']==='unmonitored');};Dialer[_0x229d('0x18')][_0x229d('0xd1')]=function(_0x10a6b9,_0x27f141,_0x10ebc7){this[_0x229d('0xcb')](_0x10a6b9)[_0x229d('0xaf')](loggerCatch(_0x27f141));this[_0x229d('0xc9')](_0x10a6b9)[_0x229d('0xaf')](loggerCatch(_0x10ebc7));};Dialer['prototype'][_0x229d('0x36')]=function(_0x27ab2f){var _0x1e3f25=this[_0x229d('0x25')][_0x27ab2f[_0x229d('0xdb')]];var _0x1c05e5;if(!_[_0x229d('0xad')](_0x27ab2f)&&!_['isNil'](_0x27ab2f[_0x229d('0xdc')])&&!_[_0x229d('0xad')](_0x27ab2f[_0x229d('0xdc')][_0x229d('0xdd')])&&_0x27ab2f[_0x229d('0xde')]===_0x229d('0xdf')&&_0x1e3f25){if(_0x1e3f25['type']!=='ivr'&&this[_0x229d('0x1e')][_0x1e3f25[_0x229d('0xb1')]]['dialAMDActive']&&_0x27ab2f[_0x229d('0xe0')]===_0x229d('0xe1')){delete this[_0x229d('0x25')][_0x27ab2f[_0x229d('0xdb')]];this[_0x229d('0xb3')](this['voiceQueues'][_0x1e3f25['queue']]);this['voiceQueues'][_0x1e3f25[_0x229d('0xb1')]]['outboundAnswerCallsDay']+=0x1;this[_0x229d('0x1e')][_0x1e3f25['queue']][_0x229d('0x60')]+=0x1;_0x1c05e5=new Hangup(_0x1e3f25,_0x27ab2f);_0x1c05e5[_0x229d('0xe2')]=0x12;_0x1c05e5[_0x229d('0xa8')]=_0x229d('0xe3');_0x1c05e5['membername']=_0x229d('0xe4');ami[_0x229d('0x4c')](_0x229d('0xe5'),ut[_0x229d('0xe6')](_0x1c05e5,_0x229d('0xe7')));this['saveInDb'](_0x1c05e5,'[syncHangupInAMD][createHistory]',_0x229d('0xe8'));}if(_0x1e3f25[_0x229d('0x4d')]!=='ivr'&&this[_0x229d('0x1e')][_0x1e3f25['queue']][_0x229d('0xe9')]&&_0x27ab2f[_0x229d('0xe0')]===_0x229d('0xea')){var _0x49e60c=this;return new BPromise(function(_0x439319,_0x51e95b){delete _0x49e60c[_0x229d('0x25')][_0x27ab2f[_0x229d('0xdb')]];_0x49e60c[_0x229d('0xb3')](_0x49e60c[_0x229d('0x1e')][_0x1e3f25[_0x229d('0xb1')]]);_0x49e60c['voiceQueues'][_0x1e3f25[_0x229d('0xb1')]][_0x229d('0x61')]+=0x1;_0x49e60c[_0x229d('0x1e')][_0x1e3f25[_0x229d('0xb1')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x4c45c8=_0x49e60c[_0x229d('0x1e')][_0x1e3f25[_0x229d('0xb1')]];var _0x4e31c7=new Hangup(_0x1e3f25,_0x27ab2f);_0x4e31c7['state']=0x13;_0x4e31c7[_0x229d('0xa8')]=_0x229d('0xeb');_0x4e31c7[_0x229d('0xec')]=_0x229d('0xe4');_0x4e31c7[_0x229d('0xed')]+=0x1;_0x4e31c7[_0x229d('0xee')]+=0x1;_0x4e31c7[_0x229d('0xe7')]=!![];ami[_0x229d('0x4c')](_0x229d('0xe5'),ut[_0x229d('0xe6')](_0x4e31c7,_0x229d('0xe7')));_0x49e60c[_0x229d('0xcb')](_0x4e31c7)[_0x229d('0xaf')](loggerCatch(_0x229d('0xef')));if(_0x4e31c7['countbusyretry']+_0x4e31c7[_0x229d('0xf0')]+_0x4e31c7[_0x229d('0xf1')]+_0x4e31c7[_0x229d('0xf2')]+_0x4e31c7[_0x229d('0xf3')]+_0x4e31c7[_0x229d('0xf4')]+_0x4e31c7['countmachineretry']+_0x4e31c7['countagentrejectretry']>=_0x4c45c8[_0x229d('0xf5')]){_0x49e60c[_0x229d('0xf6')](_0x4e31c7,_0x439319,_0x51e95b,'reason19\x20machine....');}else{if(_0x4e31c7[_0x229d('0xed')]>=_0x4c45c8[_0x229d('0xf7')]){_0x49e60c[_0x229d('0xf8')](_0x4e31c7,_0x439319,_0x51e95b,_0x229d('0xf9'));}else{_0x49e60c[_0x229d('0xc0')]({'active':![],'countmachineretry':_0x4e31c7[_0x229d('0xed')],'scheduledat':moment()[_0x229d('0xfa')](_0x4c45c8[_0x229d('0xfb')],'minutes')[_0x229d('0x78')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4e31c7[_0x229d('0xd3')],'ListId':_0x4e31c7[_0x229d('0xfc')],'VoiceQueueId':_0x4e31c7[_0x229d('0xfd')]||undefined,'CampaignId':_0x4e31c7['CampaignId']||undefined})[_0x229d('0xaf')](loggerCatch('[rescheduleContact][Machine]'));_0x439319({'reschedule':0x1});}}});}if(_0x1e3f25[_0x229d('0x4d')]===_0x229d('0x7b')&&this['campaigns'][_0x1e3f25[_0x229d('0xb1')]][_0x229d('0xe9')]&&_0x27ab2f['value']===_0x229d('0xe1')){delete this[_0x229d('0x25')][_0x27ab2f['uniqueid']];this['updateOriginated'](this['campaigns'][_0x1e3f25[_0x229d('0xb1')]]);_0x1c05e5=new Hangup(_0x1e3f25,_0x27ab2f);_0x1c05e5[_0x229d('0xe2')]=0x12;_0x1c05e5[_0x229d('0xa8')]=_0x229d('0xe3');_0x1c05e5[_0x229d('0xec')]='AMD';ami['emit'](_0x229d('0xe5'),ut[_0x229d('0xe6')](_0x1c05e5,_0x229d('0xe7')));this[_0x229d('0xd1')](_0x1c05e5,_0x229d('0xfe'),_0x229d('0xff'));}if(_0x1e3f25[_0x229d('0x4d')]===_0x229d('0x7b')&&this[_0x229d('0x1f')][_0x1e3f25[_0x229d('0xb1')]][_0x229d('0xe9')]&&_0x27ab2f[_0x229d('0xe0')]===_0x229d('0xea')){var _0x49e60c=this;return new BPromise(function(_0x373509,_0x5ac2c7){delete _0x49e60c[_0x229d('0x25')][_0x27ab2f[_0x229d('0xdb')]];_0x49e60c[_0x229d('0xb3')](_0x49e60c[_0x229d('0x1f')][_0x1e3f25['queue']]);_0x49e60c['campaigns'][_0x1e3f25['queue']][_0x229d('0x61')]+=0x1;_0x49e60c['campaigns'][_0x1e3f25[_0x229d('0xb1')]][_0x229d('0x60')]+=0x1;var _0x14d235=_0x49e60c[_0x229d('0x1f')][_0x1e3f25[_0x229d('0xb1')]];var _0x3256fd=new Hangup(_0x1e3f25,_0x27ab2f);_0x3256fd[_0x229d('0xe2')]=0x13;_0x3256fd[_0x229d('0xa8')]=_0x229d('0xeb');_0x3256fd['membername']=_0x229d('0xe4');_0x3256fd[_0x229d('0xed')]+=0x1;_0x3256fd['countglobal']+=0x1;_0x3256fd['amd']=!![];ami[_0x229d('0x4c')](_0x229d('0xe5'),ut[_0x229d('0xe6')](_0x3256fd,_0x229d('0xe7')));_0x49e60c[_0x229d('0xcb')](_0x3256fd)[_0x229d('0xaf')](loggerCatch(_0x229d('0xef')));if(_0x3256fd[_0x229d('0x100')]+_0x3256fd[_0x229d('0xf0')]+_0x3256fd['countnoanswerretry']+_0x3256fd[_0x229d('0xf2')]+_0x3256fd['countdropretry']+_0x3256fd[_0x229d('0xf4')]+_0x3256fd[_0x229d('0xed')]+_0x3256fd[_0x229d('0x101')]>=_0x14d235[_0x229d('0xf5')]){_0x49e60c[_0x229d('0xf6')](_0x3256fd,_0x373509,_0x5ac2c7,_0x229d('0x102'));}else{if(_0x3256fd[_0x229d('0xed')]>=_0x14d235[_0x229d('0xf7')]){_0x49e60c['createStateFinal'](_0x3256fd,_0x373509,_0x5ac2c7,_0x229d('0xf9'));}else{_0x49e60c['rescheduleContact']({'active':![],'countmachineretry':_0x3256fd[_0x229d('0xed')],'scheduledat':moment()[_0x229d('0xfa')](_0x14d235['dialMachineRetryFrequency'],'minutes')[_0x229d('0x78')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3256fd[_0x229d('0xd3')],'ListId':_0x3256fd[_0x229d('0xfc')],'VoiceQueueId':_0x3256fd['VoiceQueueId']||undefined,'CampaignId':_0x3256fd[_0x229d('0xd4')]||undefined})['catch'](loggerCatch(_0x229d('0x103')));_0x373509({'reschedule':0x1});}}});}}};Dialer[_0x229d('0x18')]['syncHangup']=function(_0x12b81f){var _0x55847b=this[_0x229d('0x25')][_0x12b81f[_0x229d('0xdb')]];var _0x56cf93=this;var _0x251a3e;if(_0x55847b&&_0x55847b[_0x229d('0x4d')]===_0x229d('0x7b')){delete this[_0x229d('0x25')][_0x12b81f[_0x229d('0xdb')]];this[_0x229d('0xb3')](this[_0x229d('0x1f')][_0x55847b[_0x229d('0xb1')]]);this[_0x229d('0x1f')][_0x55847b['queue']][_0x229d('0x104')]+=0x1;_0x251a3e=new Hangup(_0x55847b,_0x12b81f);this[_0x229d('0xcb')](_0x251a3e)[_0x229d('0xaf')](loggerCatch(_0x229d('0x105')));this[_0x229d('0xc9')](_0x251a3e)[_0x229d('0xaf')](loggerCatch(_0x229d('0x106')));}if(_0x55847b&&_0x55847b['type']!=='ivr'&&isNotNull(this[_0x229d('0x1e')][_0x55847b[_0x229d('0xb1')]][_0x229d('0x107')])){delete this[_0x229d('0x25')][_0x12b81f[_0x229d('0xdb')]];this[_0x229d('0xb3')](this['voiceQueues'][_0x55847b[_0x229d('0xb1')]]);this['voiceQueues'][_0x55847b['queue']]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x55847b[_0x229d('0xb1')]][_0x229d('0x60')]+=0x1;_0x251a3e=new Hangup(_0x55847b,_0x12b81f);_0x251a3e[_0x229d('0xe2')]=0x10;_0x251a3e[_0x229d('0xa8')]='AnswerAGI';_0x251a3e[_0x229d('0xec')]=_0x229d('0x108');this['createHistory'](_0x251a3e)[_0x229d('0xaf')](loggerCatch(_0x229d('0x105')));this[_0x229d('0xc9')](_0x251a3e)[_0x229d('0xaf')](loggerCatch('[syncHangupIvr]'));}if(_0x55847b&&_0x55847b[_0x229d('0x4d')]!==_0x229d('0x7b')&&!isNotNull(this[_0x229d('0x1e')][_0x55847b[_0x229d('0xb1')]][_0x229d('0x107')])){delete this[_0x229d('0x25')][_0x12b81f[_0x229d('0xdb')]];this[_0x229d('0xb3')](this['voiceQueues'][_0x55847b[_0x229d('0xb1')]]);this[_0x229d('0x1e')][_0x55847b[_0x229d('0xb1')]][_0x229d('0x109')]+=0x1;_0x251a3e=new Hangup(_0x55847b,_0x12b81f);_0x251a3e['state']=0xc;_0x251a3e['statedesc']=_0x12b81f[_0x229d('0x10a')];_0x251a3e[_0x229d('0xec')]=_0x229d('0x10b');this[_0x229d('0xcb')](_0x251a3e)[_0x229d('0xaf')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x229d('0xc9')](_0x251a3e)[_0x229d('0xaf')](loggerCatch(_0x229d('0x106')));}};Dialer[_0x229d('0x18')][_0x229d('0x10c')]=function(_0x19dd18){var _0x58cb09=this[_0x229d('0x25')][_0x19dd18[_0x229d('0xdb')]];var _0x126c8a=this;if(this['voiceQueues'][_0x19dd18['queue']]){if(_0x58cb09&&_0x58cb09[_0x229d('0x4d')]!=='ivr'){delete this[_0x229d('0x25')][_0x19dd18[_0x229d('0xdb')]];this[_0x229d('0x1e')][_0x19dd18[_0x229d('0xb1')]][_0x229d('0x61')]+=0x1;var _0x752c23=new AgentComplete(_0x58cb09,_0x19dd18);if(_0x19dd18['reason']===_0x229d('0x10d')){_0x752c23[_0x229d('0x10e')]=this[_0x229d('0x1e')][_0x19dd18[_0x229d('0xb1')]][_0x229d('0x10f')]&&this[_0x229d('0x1e')][_0x19dd18[_0x229d('0xb1')]][_0x229d('0x110')]?moment()[_0x229d('0x78')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this[_0x229d('0xcb')](_0x752c23)[_0x229d('0xaf')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x229d('0xc9')](_0x752c23)[_0x229d('0xaf')](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0x229d('0x18')][_0x229d('0x2c')]=function(_0x3e625e){if(this[_0x229d('0x1e')][_0x3e625e[_0x229d('0xb1')]]){if(this['uniqueId'][_0x3e625e[_0x229d('0xdb')]]&&this[_0x229d('0x25')][_0x3e625e[_0x229d('0xdb')]][_0x229d('0x4d')]!==_0x229d('0x7b')){this[_0x229d('0xb3')](this[_0x229d('0x1e')][_0x3e625e[_0x229d('0xb1')]]);this[_0x229d('0x25')][_0x3e625e[_0x229d('0xdb')]][_0x229d('0x111')]=moment()['format'](_0x229d('0x112'));}}};Dialer[_0x229d('0x18')][_0x229d('0x113')]=function(_0x58c476){this[_0x229d('0xcb')](_0x58c476)[_0x229d('0xaf')](loggerCatch(_0x229d('0x114')));this['moveContactManagedDialer'](_0x58c476)['catch'](loggerCatch(_0x229d('0x115')));};Dialer[_0x229d('0x18')][_0x229d('0x2e')]=function(_0x1d5436){var _0x147bbb=this[_0x229d('0x25')][_0x1d5436[_0x229d('0xdb')]];var _0x521433=this;if(this['voiceQueues'][_0x1d5436[_0x229d('0xb1')]]){if(_0x147bbb&&_0x147bbb['type']!==_0x229d('0x7b')){delete this[_0x229d('0x25')][_0x1d5436[_0x229d('0xdb')]];this[_0x229d('0xb3')](this[_0x229d('0x1e')][_0x1d5436[_0x229d('0xb1')]]);_0x147bbb[_0x229d('0x116')]=moment()[_0x229d('0x78')]('YYYY-MM-DD\x20HH:mm:ss');var _0x4c6c52=new QueueCallerAbandon(_0x147bbb,_0x1d5436);if(getSeconds(_0x147bbb[_0x229d('0x116')],_0x147bbb[_0x229d('0x117')])>=_0x147bbb[_0x229d('0x118')]){this[_0x229d('0x1e')][_0x1d5436[_0x229d('0xb1')]][_0x229d('0x7f')]+=0x1;this[_0x229d('0x1e')][_0x1d5436[_0x229d('0xb1')]][_0x229d('0x119')]+=0x1;this[_0x229d('0x1e')][_0x1d5436['queue']][_0x229d('0x6b')]+=0x1;_0x4c6c52[_0x229d('0xe2')]=0xa;_0x4c6c52['statedesc']=_0x229d('0x11a');_0x4c6c52[_0x229d('0x11b')]=_0x229d('0x11c');_0x4c6c52['agiafterat']=this[_0x229d('0x1e')][_0x1d5436['queue']]['dialQueueProject2']?moment()[_0x229d('0x78')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x4c6c52[_0x229d('0xf3')]+=0x1;_0x4c6c52['countglobal']+=0x1;if(_0x4c6c52[_0x229d('0xf3')]>=this[_0x229d('0x1e')][_0x1d5436['queue']][_0x229d('0x11d')]){this[_0x229d('0x113')](_0x4c6c52);}else{this[_0x229d('0xc0')]({'active':![],'countdropretry':_0x4c6c52[_0x229d('0xf3')],'scheduledat':moment()[_0x229d('0xfa')](this['voiceQueues'][_0x1d5436[_0x229d('0xb1')]][_0x229d('0x11e')],_0x229d('0x11f'))[_0x229d('0x78')](_0x229d('0x112')),'ContactId':_0x147bbb['ContactId'],'ListId':_0x147bbb['ListId'],'VoiceQueueId':_0x147bbb[_0x229d('0xfd')]||undefined,'CampaignId':_0x147bbb[_0x229d('0xd4')]||undefined})[_0x229d('0xaf')](loggerCatch(_0x229d('0x120')));var _0x309a20=new History(_0x4c6c52);_0x309a20[_0x229d('0xe2')]=0xa;_0x309a20[_0x229d('0xa8')]=_0x229d('0x11a');_0x309a20[_0x229d('0x121')]=moment()[_0x229d('0x78')](_0x229d('0x112'));_0x309a20[_0x229d('0xa9')]=_0x309a20[_0x229d('0x121')];_0x309a20[_0x229d('0x122')]=_0x4c6c52[_0x229d('0x122')];_0x309a20[_0x229d('0x123')]=_0x4c6c52[_0x229d('0x123')];this[_0x229d('0xcb')](_0x309a20)[_0x229d('0xaf')](loggerCatch(_0x229d('0x124')));}}else{this[_0x229d('0x1e')][_0x1d5436[_0x229d('0xb1')]][_0x229d('0x69')]+=0x1;this[_0x229d('0x1e')][_0x1d5436[_0x229d('0xb1')]]['outboundDropCallsDayCallersExit']+=0x1;_0x4c6c52[_0x229d('0xe2')]=0xb;_0x4c6c52[_0x229d('0xa8')]=_0x229d('0x125');_0x4c6c52['dropreason']='CALLEREXIT';_0x4c6c52[_0x229d('0xf4')]+=0x1;_0x4c6c52[_0x229d('0xee')]+=0x1;if(_0x4c6c52[_0x229d('0xf4')]>=this[_0x229d('0x1e')][_0x1d5436[_0x229d('0xb1')]]['dialAbandonedMaxRetry']){this[_0x229d('0x113')](_0x4c6c52);}else{this['rescheduleContact']({'active':![],'countabandonedretry':_0x4c6c52[_0x229d('0xf4')],'scheduledat':moment()[_0x229d('0xfa')](this[_0x229d('0x1e')][_0x1d5436[_0x229d('0xb1')]][_0x229d('0x126')],_0x229d('0x11f'))[_0x229d('0x78')](_0x229d('0x112')),'ContactId':_0x147bbb[_0x229d('0xd3')],'ListId':_0x147bbb['ListId'],'VoiceQueueId':_0x147bbb['VoiceQueueId']||undefined,'CampaignId':_0x147bbb[_0x229d('0xd4')]||undefined})[_0x229d('0xaf')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x309a20=new History(_0x4c6c52);_0x309a20['state']=0xb;_0x309a20[_0x229d('0xa8')]=_0x229d('0x125');_0x309a20['starttime']=moment()[_0x229d('0x78')](_0x229d('0x112'));_0x309a20[_0x229d('0xa9')]=_0x309a20[_0x229d('0x121')];_0x309a20[_0x229d('0x122')]=_0x4c6c52[_0x229d('0x122')];_0x309a20[_0x229d('0x123')]=_0x4c6c52[_0x229d('0x123')];this[_0x229d('0xcb')](_0x309a20)[_0x229d('0xaf')](loggerCatch(_0x229d('0x127')));}}}}};Dialer[_0x229d('0x18')][_0x229d('0x34')]=function(_0x1d7525){if(this[_0x229d('0x23')][_0x1d7525[_0x229d('0xdb')]]){this[_0x229d('0x23')][_0x1d7525[_0x229d('0xdb')]]['channel']=_0x1d7525['channel'];}if(this['uniqueId'][_0x1d7525[_0x229d('0xdb')]]){this[_0x229d('0x25')][_0x1d7525[_0x229d('0xdb')]][_0x229d('0x128')]=_0x1d7525[_0x229d('0x128')];}};Dialer[_0x229d('0x18')][_0x229d('0x38')]=function(_0x55511b){if(strategy[this['voiceQueues'][this[_0x229d('0x23')][_0x55511b['actionid']][_0x229d('0xb1')]][_0x229d('0x4f')]]===_0x229d('0x129')){if(this['actions'][_0x55511b[_0x229d('0x12a')]]&&_[_0x229d('0xad')](this['actions'][_0x55511b[_0x229d('0x12a')]][_0x229d('0x12b')])&&_0x55511b['status']==='1'&&_0x55511b['paused']==='0'){if(this[_0x229d('0x20')][_0x55511b[_0x229d('0x12c')]]){if(!this[_0x229d('0x20')][_0x55511b[_0x229d('0x12c')]]['locked']){this[_0x229d('0x20')][_0x55511b['stateinterface']][_0x229d('0x12b')]=!![];this['actions'][_0x55511b[_0x229d('0x12a')]][_0x229d('0x12b')]=!![];this[_0x229d('0x23')][_0x55511b[_0x229d('0x12a')]][_0x229d('0x12c')]=_0x55511b[_0x229d('0x12c')];}}}}else if((strategy[this['voiceQueues'][this[_0x229d('0x23')][_0x55511b['actionid']][_0x229d('0xb1')]]['strategy']]||_0x229d('0x17'))===_0x229d('0x17')){if(this[_0x229d('0x23')][_0x55511b['actionid']]){if(this[_0x229d('0x20')][_0x55511b['stateinterface']]){this[_0x229d('0x23')][_0x55511b[_0x229d('0x12a')]][_0x229d('0x12c')]=_0x55511b[_0x229d('0x12c')];if(_['isNil'](this[_0x229d('0x29')][this[_0x229d('0x23')][_0x55511b['actionid']][_0x229d('0xb1')]])){this['queueBooked'][this[_0x229d('0x23')][_0x55511b[_0x229d('0x12a')]][_0x229d('0xb1')]]=[];}this[_0x229d('0x29')][this[_0x229d('0x23')][_0x55511b['actionid']][_0x229d('0xb1')]][_0x229d('0x12d')](_[_0x229d('0x8f')](_[_0x229d('0xd2')](this[_0x229d('0x23')][_0x55511b[_0x229d('0x12a')]],[_0x229d('0x12e'),'stateinterface']),{'status':_0x55511b[_0x229d('0xd9')],'paused':_0x55511b[_0x229d('0x12f')]}));}}}};function unlockQueueStatus(_0x19be46,_0x32d1bd){setTimeout(function(){if(_[_0x229d('0x86')](_0x19be46[_0x229d('0x130')])){loggerBooked['error']('[unlockQueueStatus][undefined]',_0x32d1bd);}_0x19be46[_0x229d('0x130')]=!![];loggerBooked[_0x229d('0x7d')]('[booked][unlockQueueStatus]',_0x32d1bd,JSON[_0x229d('0x48')](_['pick'](_0x19be46,[_0x229d('0x3e'),'queueStatusComplete'])));},0x1f3);}Dialer[_0x229d('0x18')][_0x229d('0x3a')]=function(_0x2a579b){var _0x10b86a=this;var _0x1f21c4=_0x10b86a[_0x229d('0x1e')][_0x10b86a['actions'][_0x2a579b['actionid']]['queue']];if(strategy[this[_0x229d('0x1e')][this[_0x229d('0x23')][_0x2a579b[_0x229d('0x12a')]]['queue']][_0x229d('0x4f')]]===_0x229d('0x129')){if(this[_0x229d('0x23')][_0x2a579b[_0x229d('0x12a')]]&&this['actions'][_0x2a579b['actionid']][_0x229d('0x12c')]){this[_0x229d('0x1d')][_0x229d('0x131')](this['actions'][_0x2a579b[_0x229d('0x12a')]][_0x229d('0x12e')],this['actions'][_0x2a579b[_0x229d('0x12a')]][_0x229d('0x12c')])[_0x229d('0xaf')](function(_0x7d87cf){logger[_0x229d('0x96')]('[Catch][Preview][syncQueueStatusComplete]',util[_0x229d('0x97')](_0x7d87cf,{'showHidden':![],'depth':null}));})[_0x229d('0x1b')](function(){_0x10b86a[_0x229d('0xb3')](_0x10b86a[_0x229d('0x1e')][_0x10b86a['actions'][_0x2a579b[_0x229d('0x12a')]][_0x229d('0xb1')]]);_0x10b86a[_0x229d('0x20')][_0x10b86a[_0x229d('0x23')][_0x2a579b['actionid']]['stateinterface']][_0x229d('0x12b')]=![];delete _0x10b86a[_0x229d('0x23')][_0x2a579b[_0x229d('0x12a')]];unlockQueueStatus(_0x1f21c4);});}else{this[_0x229d('0xb3')](this[_0x229d('0x1e')][this[_0x229d('0x23')][_0x2a579b[_0x229d('0x12a')]][_0x229d('0xb1')]]);this[_0x229d('0xc0')]({'active':![],'ContactId':this[_0x229d('0x23')][_0x2a579b['actionid']][_0x229d('0xd3')],'ListId':this['actions'][_0x2a579b[_0x229d('0x12a')]]['ListId'],'VoiceQueueId':this[_0x229d('0x23')][_0x2a579b[_0x229d('0x12a')]][_0x229d('0xfd')]||undefined,'CampaignId':this['actions'][_0x2a579b[_0x229d('0x12a')]][_0x229d('0xd4')]||undefined})['catch'](loggerCatch(_0x229d('0x132')));delete this[_0x229d('0x23')][_0x2a579b[_0x229d('0x12a')]];unlockQueueStatus(_0x1f21c4);}}else if((strategy[this[_0x229d('0x1e')][this[_0x229d('0x23')][_0x2a579b[_0x229d('0x12a')]][_0x229d('0xb1')]][_0x229d('0x4f')]]||_0x229d('0x17'))===_0x229d('0x17')){var _0x208221;if(this['actions'][_0x2a579b[_0x229d('0x12a')]]&&!_[_0x229d('0x44')](this[_0x229d('0x29')][this[_0x229d('0x23')][_0x2a579b[_0x229d('0x12a')]][_0x229d('0xb1')]])){if(this[_0x229d('0x2a')][_0x10b86a[_0x229d('0x23')][_0x2a579b[_0x229d('0x12a')]][_0x229d('0xb1')]]){this[_0x229d('0x2a')][_0x10b86a[_0x229d('0x23')][_0x2a579b[_0x229d('0x12a')]][_0x229d('0xb1')]]=this['queueBookedRR'][this[_0x229d('0x23')][_0x2a579b[_0x229d('0x12a')]][_0x229d('0xb1')]]?this[_0x229d('0x2a')][this[_0x229d('0x23')][_0x2a579b['actionid']][_0x229d('0xb1')]]:this['queueBooked'][this[_0x229d('0x23')][_0x2a579b['actionid']][_0x229d('0xb1')]]?this[_0x229d('0x29')][this[_0x229d('0x23')][_0x2a579b['actionid']][_0x229d('0xb1')]][_0x229d('0x133')]||0x0:0x0;}this[_0x229d('0x29')][this['actions'][_0x2a579b[_0x229d('0x12a')]][_0x229d('0xb1')]][_0x229d('0x133')]=this[_0x229d('0x2a')][this[_0x229d('0x23')][_0x2a579b['actionid']][_0x229d('0xb1')]];for(var _0x270632=0x0;_0x270632<this[_0x229d('0x29')][this[_0x229d('0x23')][_0x2a579b[_0x229d('0x12a')]][_0x229d('0xb1')]][_0x229d('0x98')];_0x270632+=0x1){_0x208221=rr(this[_0x229d('0x29')][this[_0x229d('0x23')][_0x2a579b[_0x229d('0x12a')]][_0x229d('0xb1')]]);this[_0x229d('0x2a')][_0x10b86a['actions'][_0x2a579b[_0x229d('0x12a')]]['queue']]=this[_0x229d('0x29')][this[_0x229d('0x23')][_0x2a579b[_0x229d('0x12a')]][_0x229d('0xb1')]]['_rr'];if(_0x208221[_0x229d('0xd9')]==='1'&&_0x208221[_0x229d('0x12f')]==='0'){break;}}if(!_[_0x229d('0xad')](_0x208221)){this[_0x229d('0x20')][_0x208221[_0x229d('0x12c')]]['unlockRR']=_[_0x229d('0x86')](this[_0x229d('0x20')][_0x208221[_0x229d('0x12c')]][_0x229d('0x134')])?!![]:this[_0x229d('0x20')][_0x208221[_0x229d('0x12c')]][_0x229d('0x134')];}loggerBooked[_0x229d('0x7d')](_0x229d('0x135'),_0x2a579b[_0x229d('0x12a')],'Agent:\x20',JSON['stringify'](_['pick'](this[_0x229d('0x20')][_0x208221['stateinterface']],[_0x229d('0x3e'),_0x229d('0x134')])),_0x229d('0x136'),JSON['stringify'](_0x208221['idHopper']));if(!_['isNil'](_0x208221)&&_0x208221[_0x229d('0xd9')]==='1'&&_0x208221[_0x229d('0x12f')]==='0'&&this['agents'][_0x208221[_0x229d('0x12c')]][_0x229d('0x134')]){this[_0x229d('0x20')][_0x208221[_0x229d('0x12c')]]['unlockRR']=![];this[_0x229d('0x29')][_0x10b86a[_0x229d('0x23')][_0x2a579b[_0x229d('0x12a')]][_0x229d('0xb1')]]=[];this['preview'][_0x229d('0x131')](_0x208221['idHopper'],_0x208221['stateinterface'])['catch'](function(_0xabb155){logger['error'](_0x229d('0x137'),util[_0x229d('0x97')](_0xabb155,{'showHidden':![],'depth':null}));})[_0x229d('0x1b')](function(){_0x10b86a['updateOriginated'](_0x10b86a[_0x229d('0x1e')][_0x10b86a[_0x229d('0x23')][_0x2a579b['actionid']][_0x229d('0xb1')]]);setTimeout(function(){_0x10b86a[_0x229d('0x20')][_0x208221[_0x229d('0x12c')]][_0x229d('0x134')]=!![];loggerBooked[_0x229d('0x7d')]('[booked][RR][finaly]',_0x2a579b[_0x229d('0x12a')],_0x229d('0x138'),JSON[_0x229d('0x48')](_[_0x229d('0xd2')](_0x10b86a['agents'][_0x208221[_0x229d('0x12c')]],[_0x229d('0x3e'),_0x229d('0x134')])),'contactAgent-idHopper:\x20',JSON[_0x229d('0x48')](_0x208221[_0x229d('0x12e')]));},0xc7);delete _0x10b86a[_0x229d('0x23')][_0x2a579b[_0x229d('0x12a')]];unlockQueueStatus(_0x1f21c4,_0x2a579b[_0x229d('0x12a')]);});}else{loggerBooked[_0x229d('0x7d')](_0x229d('0x139'));this['updateOriginated'](this[_0x229d('0x1e')][this[_0x229d('0x23')][_0x2a579b['actionid']][_0x229d('0xb1')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0x229d('0x23')][_0x2a579b[_0x229d('0x12a')]]['ContactId'],'ListId':this[_0x229d('0x23')][_0x2a579b['actionid']][_0x229d('0xfc')],'VoiceQueueId':this[_0x229d('0x23')][_0x2a579b[_0x229d('0x12a')]][_0x229d('0xfd')]||undefined,'CampaignId':this[_0x229d('0x23')][_0x2a579b['actionid']]['CampaignId']||undefined})[_0x229d('0xaf')](loggerCatch(_0x229d('0x132')));delete this['actions'][_0x2a579b[_0x229d('0x12a')]];unlockQueueStatus(_0x1f21c4);}}else{loggerBooked[_0x229d('0x7d')](_0x229d('0x13a'));this[_0x229d('0xb3')](this[_0x229d('0x1e')][this[_0x229d('0x23')][_0x2a579b[_0x229d('0x12a')]][_0x229d('0xb1')]]);this[_0x229d('0xc0')]({'active':![],'ContactId':this[_0x229d('0x23')][_0x2a579b[_0x229d('0x12a')]][_0x229d('0xd3')],'ListId':this[_0x229d('0x23')][_0x2a579b[_0x229d('0x12a')]]['ListId'],'VoiceQueueId':this['actions'][_0x2a579b[_0x229d('0x12a')]][_0x229d('0xfd')]||undefined,'CampaignId':this[_0x229d('0x23')][_0x2a579b[_0x229d('0x12a')]][_0x229d('0xd4')]||undefined})[_0x229d('0xaf')](loggerCatch(_0x229d('0x13b')));delete this[_0x229d('0x23')][_0x2a579b[_0x229d('0x12a')]];unlockQueueStatus(_0x1f21c4);}}else{loggerBooked[_0x229d('0x7d')](_0x229d('0x13c'));this[_0x229d('0xb3')](this[_0x229d('0x1e')][this[_0x229d('0x23')][_0x2a579b['actionid']][_0x229d('0xb1')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0x229d('0x23')][_0x2a579b[_0x229d('0x12a')]][_0x229d('0xd3')],'ListId':this[_0x229d('0x23')][_0x2a579b[_0x229d('0x12a')]]['ListId'],'VoiceQueueId':this[_0x229d('0x23')][_0x2a579b[_0x229d('0x12a')]][_0x229d('0xfd')]||undefined,'CampaignId':this[_0x229d('0x23')][_0x2a579b[_0x229d('0x12a')]][_0x229d('0xd4')]||undefined})[_0x229d('0xaf')](loggerCatch(_0x229d('0x13d')));delete this[_0x229d('0x23')][_0x2a579b[_0x229d('0x12a')]];unlockQueueStatus(_0x1f21c4);}};Dialer[_0x229d('0x18')][_0x229d('0x13e')]=function(){var _0x4778d0=this;setInterval(function(){_0x4778d0['syncCampaigns']();},0x3e8);};Dialer[_0x229d('0x18')][_0x229d('0x13f')]=function(_0x5c2611){var _0x3c7616=this;return function(){if(!_0x3c7616[_0x229d('0xd7')](_0x5c2611['Trunk'])){if(!_0x3c7616[_0x229d('0xd7')](_0x5c2611[_0x229d('0x140')])){_0x5c2611['message']=_0x229d('0x141');throw _0x5c2611[_0x229d('0x3e')]+_0x229d('0x142');}}};};Dialer[_0x229d('0x18')][_0x229d('0x143')]=function(_0x2fbe8e,_0x1c2995,_0x4cf6f7,_0x4ed366){var _0x2824a8=this;return function(){var _0x26b251=!![];return _0x2824a8[_0x229d('0x144')](_0x2fbe8e,_0x1c2995,_0x4cf6f7,_0x4ed366,_0x26b251);};};Dialer['prototype'][_0x229d('0x145')]=function(_0x41254d,_0x382496,_0xb2fab4,_0x3963f3){var _0x334d00=this;return function(){var _0x402b96=![];return _0x334d00[_0x229d('0x144')](_0x41254d[_0x229d('0x45')],_0x382496,_0xb2fab4,_0x3963f3,_0x402b96);};};Dialer[_0x229d('0x18')][_0x229d('0x144')]=function(_0x50262d,_0x1aca84,_0x5d60f6,_0x27183f,_0xededd8){var _0x245510=[];return new BPromise(function(_0x42f822,_0x55590b){if(!isNotNull(_0x50262d)){_0x27183f[_0x229d('0x3c')]=_0x229d('0x42');return _0x55590b(msgResponse(_0x229d('0x144'),_0x229d('0x146'),_0x5d60f6+'\x20Intervals\x20is\x20null\x20'));}if(_[_0x229d('0x44')](_0x50262d)){_0x27183f[_0x229d('0x3c')]=_0x229d('0x147');return _0x55590b(msgResponse(_0x229d('0x144'),_0x229d('0x146'),_0x5d60f6+_0x229d('0x148')));}if(_0x1aca84&&_[_0x229d('0x86')](config[_0x229d('0x149')][_0x1aca84])){_0x27183f[_0x229d('0x3c')]=_0x229d('0x14a');return _0x55590b(msgResponse(_0x229d('0x144'),_0x229d('0x146'),_0x5d60f6+_0x229d('0x14b')+_0x1aca84));}if(_['isArray'](_0x50262d)){for(var _0x4ffe3b=0x0;_0x4ffe3b<_0x50262d[_0x229d('0x98')];_0x4ffe3b+=0x1){_0x245510[_0x229d('0x12d')](ami['Action']({'action':_0x229d('0x14c'),'command':util[_0x229d('0x78')](_0x229d('0x14d'),_0x50262d[_0x4ffe3b][_0x229d('0x14e')],!_[_0x229d('0x86')](config[_0x229d('0x149')][_0x1aca84])?_0x1aca84:'')})[_0x229d('0xb6')](function(_0x4ac921){return _0x4ac921[_0x229d('0x14f')][_0x229d('0x150')](_0x229d('0x151'))>=0x0;})[_0x229d('0xaf')](myreject(_0x55590b)));}}else{_0x245510[_0x229d('0x12d')](ami['Action']({'action':'command','command':util['format'](_0x229d('0x14d'),_0x50262d,!_['isUndefined'](config['timezones'][_0x1aca84])?_0x1aca84:'')})['then'](function(_0x2c24ee){return _0x2c24ee[_0x229d('0x14f')][_0x229d('0x150')](_0x229d('0x151'))>=0x0;})['catch'](myreject(_0x55590b)));}BPromise[_0x229d('0x152')](_0x245510)[_0x229d('0xb6')](function(_0x3b9da4){var _0x31ae93=_[_0x229d('0x153')](_0x3b9da4);if(_0x31ae93){return _0x42f822(_0x31ae93);}else{_0x27183f[_0x229d('0x3c')]=_0xededd8?_0x229d('0x154'):'INTERVAL_IS_OVERTIME';return _0x55590b(msgResponse(_0x229d('0x155'),'Failure',_0x229d('0x156')+_0xededd8+'\x20'+_0x5d60f6+'\x20Interval\x20is\x20overtime:\x20'+util[_0x229d('0x97')](_0x50262d,{'showHidden':![],'depth':null})+_0x229d('0x157')+_0x1aca84));}})[_0x229d('0xaf')](function(_0x2dba74){return _0x55590b(msgResponse('ifTime',_0x229d('0x146'),JSON[_0x229d('0x48')](_0x2dba74)));});});};Dialer[_0x229d('0x18')]['checkDialMethod']=function(_0x463fd0){var _0x59ed3a=this;return function(){switch(_0x463fd0[_0x229d('0x5c')]){case _0x229d('0x158'):freeVariablesPredictive(_0x463fd0);_0x59ed3a[_0x229d('0x159')](_0x463fd0,0x1);break;case _0x229d('0x15a'):freeVariablesPredictive(_0x463fd0);_0x59ed3a[_0x229d('0x159')](_0x463fd0,_0x463fd0['dialPowerLevel']);break;case _0x229d('0x9'):_0x59ed3a[_0x229d('0x9')](_0x463fd0);break;case _0x229d('0x15b'):freeVariablesPredictive(_0x463fd0);_0x59ed3a[_0x229d('0x159')](_0x463fd0,0x1);break;default:freeVariablesPredictive(_0x463fd0);logger['error'](_0x229d('0x15c'),_0x463fd0[_0x229d('0x3e')],_0x229d('0x15d'));}};};Dialer[_0x229d('0x18')][_0x229d('0x15e')]=function(_0x2bdfb2){var _0x4b2e69=this;return function(){_0x4b2e69['handleIvr'](_0x2bdfb2);};};Dialer['prototype'][_0x229d('0x15f')]=function(_0x44375d){var _0x12d0f9=this;if(isNotPreview(_0x44375d[_0x229d('0x5c')])){if(isVoiceQueueOutbound(_0x44375d['type'])&&isActive(_0x44375d[_0x229d('0x5b')])){_0x44375d['sendMessageOneNotActive']=!![];BPromise[_0x229d('0xb9')]()[_0x229d('0xb6')](checkIsLoggedIn(_0x44375d,_0x44375d[_0x229d('0x52')]))['then'](checkIsActive(_0x44375d,_0x44375d[_0x229d('0x5b')]))['then'](checkInterval(_0x44375d))[_0x229d('0xb6')](_0x12d0f9[_0x229d('0x13f')](_0x44375d))['then'](_0x12d0f9[_0x229d('0x143')](_0x44375d['dialGlobalInterval'],_0x44375d[_0x229d('0x160')],_0x44375d['name'],_0x44375d))[_0x229d('0xb6')](_0x12d0f9[_0x229d('0x145')](_0x44375d[_0x229d('0x41')],_0x44375d[_0x229d('0x160')],_0x44375d[_0x229d('0x3e')],_0x44375d))[_0x229d('0xb6')](_0x12d0f9['checkDialMethod'](_0x44375d))[_0x229d('0xaf')](loggerCatchQueueSummary(_0x229d('0x161'),_0x44375d));}else{notSendMessagesQueue(_0x44375d);}}else{freeVariablesPredictive(_0x44375d);}};Dialer[_0x229d('0x18')][_0x229d('0x162')]=function(){var _0x32a8f5=this;var _0x597bd1;for(var _0x3106e4 in this[_0x229d('0x1f')]){if(typeof this[_0x229d('0x1f')][_0x3106e4]!==_0x229d('0x99')){_0x597bd1=this['campaigns'][_0x3106e4];if(isCampaignIvr(_0x597bd1['type'])&&isActive(_0x597bd1[_0x229d('0x76')])){_0x597bd1['sendMessageOneNotActive']=!![];BPromise[_0x229d('0xb9')]()[_0x229d('0xb6')](checkIsActive(_0x597bd1,_0x597bd1[_0x229d('0x76')]))[_0x229d('0xb6')](checkInterval(_0x597bd1))[_0x229d('0xb6')](_0x32a8f5[_0x229d('0x13f')](_0x597bd1))['then'](_0x32a8f5[_0x229d('0x143')](_0x597bd1[_0x229d('0x163')],_0x597bd1['dialTimezone'],_0x597bd1[_0x229d('0x3e')],_0x597bd1))[_0x229d('0xb6')](_0x32a8f5[_0x229d('0x145')](_0x597bd1['Interval'],_0x597bd1[_0x229d('0x160')],_0x597bd1[_0x229d('0x3e')],_0x597bd1))[_0x229d('0xb6')](_0x32a8f5['launchHandleIvr'](_0x597bd1))[_0x229d('0xaf')](loggerCatchQueueSummary(_0x229d('0x164'),_0x597bd1));}else{notSendMessagesCampaign(_0x597bd1);}}}};function getCallerIdRandom(_0x53285d,_0x88ce38){var _0x2e5ad4;var _0x1b32a0;var _0x578928;if(_0x88ce38<=0x0){_0x88ce38=0x1;}_0x2e5ad4=new RegExp(_0x229d('0x165')+_0x88ce38+'}$');_0x1b32a0=Math['pow'](0xa,_0x88ce38-0x1);_0x578928=Math[_0x229d('0x166')](0xa,_0x88ce38)-0x1;return util[_0x229d('0x78')]('%s',_[_0x229d('0x167')](_0x53285d,_0x2e5ad4,_['random'](_0x1b32a0,_0x578928)));}function extractCalleridName(_0x522fb1){var _0x216da1=_0x522fb1[_0x229d('0x168')](/"(.*?)"/);return _0x216da1?_0x216da1[0x1]:_0x522fb1;}function extractCalleridNumber(_0x40ecbc){var _0x4b9b6c=_0x40ecbc[_0x229d('0x168')](/<(.*?)>/);return _0x4b9b6c?_0x4b9b6c[0x1]:_0x40ecbc;}Dialer[_0x229d('0x18')][_0x229d('0x169')]=function(_0x3076d7,_0x98bd15){var _0xbc270a=this;var _0x329b8b=uuid['v4']();this[_0x229d('0x23')][_0x329b8b]=new Action(_0x3076d7,_0x98bd15,_0x329b8b);return new BPromise(function(_0x291d8b,_0x14bf39){if(_[_0x229d('0x86')](_0x3076d7)&&typeof _0x3076d7!==_0x229d('0x16a')){return _0x14bf39(msgResponse('originate',_0x229d('0x146'),_0x229d('0x16b')));}if(_[_0x229d('0x86')](_0x98bd15['Contact'][_0x229d('0x16c')])||_0x98bd15['Contact'][_0x229d('0x16c')]===null){return _0x14bf39(msgResponse(_0x229d('0x16d'),'Failure',_0x229d('0x16e')));}var _0x4af52a={'XMD-CALLERID':_0xbc270a[_0x229d('0x23')][_0x329b8b][_0x229d('0x16f')](),'XMD-AGI':_0x3076d7[_0x229d('0x107')]?util[_0x229d('0x78')](_0x229d('0x170'),ipAgi,_0x3076d7['dialQueueProject']):'NONE','XMD-AGIAFTER':_0x3076d7[_0x229d('0x10f')]?util[_0x229d('0x78')](_0x229d('0x170'),ipAgi,_0x3076d7[_0x229d('0x10f')]):'NONE','XMD-QUEUE':_0x3076d7[_0x229d('0x4d')]==='outbound'?util[_0x229d('0x78')](_0x229d('0x171'),_0x3076d7[_0x229d('0x3e')],_0x3076d7['dialQueueOptions']||'',_0x3076d7[_0x229d('0x110')]?'c':'',_0x3076d7['dialQueueTimeout']||0x3):_0x229d('0x172'),'XMD-CONTACTID':_0x98bd15['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0xbc270a[_0x229d('0x23')][_0x329b8b][_0x229d('0x16f')](),'XMD-AMD':_0x3076d7['dialAMDActive']?_0x229d('0x173'):_0x229d('0x172'),'XMD-DESTINATION':_0x229d('0xdf')};if(_0x3076d7[_0x229d('0xe9')]){_0x4af52a[_0x229d('0x174')]=_0x3076d7[_0x229d('0x175')]||0x9c4;_0x4af52a[_0x229d('0x176')]=_0x3076d7[_0x229d('0x177')]||0x5dc;_0x4af52a[_0x229d('0x178')]=_0x3076d7[_0x229d('0x179')]||0x320;_0x4af52a['XMD-AMDTOTALANALYSISTIME']=_0x3076d7[_0x229d('0x17a')]||0x1388;_0x4af52a['XMD-AMDMINWORDLENGTH']=_0x3076d7[_0x229d('0x17b')]||0x64;_0x4af52a[_0x229d('0x17c')]=_0x3076d7[_0x229d('0x17d')]||0x32;_0x4af52a['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x3076d7[_0x229d('0x17e')]||0x3;_0x4af52a[_0x229d('0x17f')]=_0x3076d7['dialAMDSilenceThreshold']||0x100;_0x4af52a[_0x229d('0x180')]=_0x3076d7[_0x229d('0x181')]||0x1388;}if(_0x3076d7['type']===_0x229d('0x4e')){_0x4af52a[_0x229d('0x182')]=_0x98bd15[_0x229d('0xfd')];}else{_0x4af52a['XMD-CAMPAIGNID']=_0x98bd15[_0x229d('0xd4')];}for(var _0x5c791c in _0x98bd15[_0x229d('0x183')]){if(typeof _0x98bd15['Contact'][_0x5c791c]!==_0x229d('0x99')){if(isNotNull(_0x98bd15[_0x229d('0x183')][_0x5c791c])&&_0x5c791c!=='id'&&_0x5c791c!==_0x229d('0x184')&&_0x5c791c!==_0x229d('0x185')&&_0x5c791c!=='updatedAt'){_0x4af52a[util[_0x229d('0x78')](_0x229d('0x186'),_0x229d('0x187'),_[_0x229d('0x188')](_0x5c791c))]=_0x98bd15[_0x229d('0x183')][_0x5c791c];}}}var _0x5bf73c=_0xbc270a[_0x229d('0xd7')](_0x3076d7['Trunk'])?getCallerId(_0x3076d7[_0x229d('0x75')][_0x229d('0x77')],_0x3076d7[_0x229d('0x5d')],_0x3076d7['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x3076d7[_0x229d('0x5e')],_0x3076d7['dialRandomLastDigitCallerIdNumber']):_0x3076d7[_0x229d('0x5e')]):getCallerId(_[_0x229d('0xad')](_0x3076d7[_0x229d('0x140')])?_0x3076d7[_0x229d('0x75')]['callerid']:_0x3076d7[_0x229d('0x140')][_0x229d('0x77')],_0x3076d7[_0x229d('0x5d')],_0x3076d7[_0x229d('0x189')]>0x0?getCallerIdRandom(_0x3076d7[_0x229d('0x5e')],_0x3076d7[_0x229d('0x189')]):_0x3076d7[_0x229d('0x5e')]);if(_0x5bf73c){_0x4af52a['XMD-ORIGINATECALLERIDNAME']=_0xbc270a[_0x229d('0x23')][_0x329b8b][_0x229d('0x18a')]=extractCalleridName(_0x5bf73c);_0x4af52a[_0x229d('0x18b')]=_0xbc270a[_0x229d('0x23')][_0x329b8b][_0x229d('0x18c')]=extractCalleridNumber(_0x5bf73c);}return ami[_0x229d('0xae')]({'actionid':_0x329b8b,'action':'originate','channel':_0xbc270a[_0x229d('0xd7')](_0x3076d7[_0x229d('0x75')])?util[_0x229d('0x78')](_0x229d('0x18d'),_0x3076d7[_0x229d('0x75')][_0x229d('0x3e')],isNotNull(_0x3076d7['dialPrefix'])?_0x3076d7[_0x229d('0x18e')][_0x229d('0x18f')]()||'':'',_0x3076d7[_0x229d('0x190')]>0x0?_0x98bd15[_0x229d('0x183')][_0x229d('0x16c')][_0x229d('0x191')](_0x3076d7['dialCutDigit']):_0x98bd15['Contact'][_0x229d('0x16c')]):util['format']('SIP/%s/%s%s',_[_0x229d('0xad')](_0x3076d7['TrunkBackup'])?_0x3076d7['Trunk'][_0x229d('0x3e')]:_0x3076d7['TrunkBackup'][_0x229d('0x3e')],isNotNull(_0x3076d7[_0x229d('0x18e')])?_0x3076d7[_0x229d('0x18e')][_0x229d('0x18f')]()||'':'',_0x3076d7[_0x229d('0x190')]>0x0?_0x98bd15[_0x229d('0x183')][_0x229d('0x16c')][_0x229d('0x191')](_0x3076d7[_0x229d('0x190')]):_0x98bd15[_0x229d('0x183')][_0x229d('0x16c')]),'callerid':_0x5bf73c,'Exten':_0x229d('0xdf'),'Context':'from-sip','Priority':'1','variable':_0x4af52a,'timeout':(_0x3076d7['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x329b8b})[_0x229d('0xb6')](function(_0x440b40){return _0x291d8b(_0x440b40);})['catch'](function(_0x365d0c){_0x3076d7['outboundOriginateFailureCallsDay']+=0x1;var _0x23c3c5=new History(_0xbc270a['actions'][_0x329b8b]);logger[_0x229d('0x96')](util[_0x229d('0x78')]('[originateError]:\x20%s',JSON['stringify'](_0x365d0c)));_0x23c3c5[_0x229d('0xe2')]=0xe;_0x23c3c5[_0x229d('0xa8')]=_0x229d('0x192');_0x23c3c5[_0x229d('0x121')]=moment()[_0x229d('0x78')](_0x229d('0x112'));_0x23c3c5[_0x229d('0xa9')]=_0x23c3c5[_0x229d('0x121')];_0xbc270a[_0x229d('0xcb')](_0x23c3c5)[_0x229d('0xaf')](loggerCatch(_0x229d('0x193')));_0xbc270a[_0x229d('0xc9')](_0x23c3c5)[_0x229d('0xaf')](loggerCatch('[originate][error]'))[_0x229d('0x1b')](function(){delete _0xbc270a[_0x229d('0x23')][_0x329b8b];return _0x14bf39(msgResponse(_0x229d('0x16d'),_0x229d('0x47'),_0x229d('0x194')));});});});};Dialer[_0x229d('0x18')][_0x229d('0x195')]=function(_0x11f0a4){var _0x37ed30=this['actions'][_0x11f0a4[_0x229d('0x12a')]];if(_0x37ed30){delete this[_0x229d('0x23')][_0x11f0a4[_0x229d('0x12a')]];_0x37ed30[_0x229d('0x117')]=moment()[_0x229d('0x78')](_0x229d('0x112'));var _0x5f368f=_0x37ed30['type']===_0x229d('0x7b')?this[_0x229d('0x1f')][_0x37ed30[_0x229d('0xb1')]]:this[_0x229d('0x1e')][_0x37ed30[_0x229d('0x196')]()];if(!this[_0x229d('0x197')](_0x11f0a4[_0x229d('0x198')])){this[_0x229d('0xb3')](_0x5f368f);return this['callProgressDetecting'](_0x37ed30,_0x5f368f,_0x11f0a4)[_0x229d('0xaf')](loggerCatch(_0x229d('0x199')));}this[_0x229d('0x25')][_0x11f0a4[_0x229d('0xdb')]]=_0x37ed30;}};Dialer[_0x229d('0x18')][_0x229d('0x19a')]=function(_0x45b49b,_0x2e4227,_0x237be0){var _0x2bb444=new History(_0x2e4227);if(_0x2bb444[_0x229d('0x100')]+_0x2bb444[_0x229d('0xf0')]+_0x2bb444[_0x229d('0xf1')]+_0x2bb444[_0x229d('0xf2')]+_0x2bb444[_0x229d('0xf3')]+_0x2bb444[_0x229d('0xf4')]+_0x2bb444['countmachineretry']+_0x2bb444[_0x229d('0x101')]>=_0x237be0[_0x229d('0xf5')]-0x1){return!![];}switch(_0x45b49b){case 0x3:if(_0x2bb444[_0x229d('0xf1')]>=_0x237be0[_0x229d('0x19b')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x2bb444[_0x229d('0xf1')]+=0x1,'scheduledat':moment()[_0x229d('0xfa')](_0x237be0['dialNoAnswerRetryFrequency'],_0x229d('0x11f'))[_0x229d('0x78')](_0x229d('0x112')),'ContactId':_0x2bb444[_0x229d('0xd3')],'ListId':_0x2bb444['ListId'],'VoiceQueueId':_0x2bb444[_0x229d('0xfd')]||undefined,'CampaignId':_0x2bb444[_0x229d('0xd4')]||undefined})[_0x229d('0xaf')](loggerCatch(_0x229d('0x19c')));break;case 0x5:if(_0x2bb444['countbusyretry']>=_0x237be0[_0x229d('0x19d')]-0x1){return!![];}this[_0x229d('0xc0')]({'active':![],'countbusyretry':_0x2bb444['countbusyretry']+=0x1,'scheduledat':moment()[_0x229d('0xfa')](_0x237be0[_0x229d('0x19e')],'minutes')[_0x229d('0x78')](_0x229d('0x112')),'ContactId':_0x2bb444[_0x229d('0xd3')],'ListId':_0x2bb444['ListId'],'VoiceQueueId':_0x2bb444[_0x229d('0xfd')]||undefined,'CampaignId':_0x2bb444[_0x229d('0xd4')]||undefined})['catch'](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x2bb444[_0x229d('0xf0')]>=_0x237be0[_0x229d('0x19f')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0x2bb444[_0x229d('0xf0')]+=0x1,'scheduledat':moment()['add'](_0x237be0[_0x229d('0x1a0')],_0x229d('0x11f'))['format'](_0x229d('0x112')),'ContactId':_0x2bb444[_0x229d('0xd3')],'ListId':_0x2bb444[_0x229d('0xfc')],'VoiceQueueId':_0x2bb444[_0x229d('0xfd')]||undefined,'CampaignId':_0x2bb444[_0x229d('0xd4')]||undefined})[_0x229d('0xaf')](loggerCatch(_0x229d('0x1a1')));break;case 0x0:if(_0x2bb444['countnosuchnumberretry']>=_0x237be0[_0x229d('0x1a2')]-0x1){return!![];}else{this[_0x229d('0xc0')]({'active':![],'countnosuchnumberretry':_0x2bb444[_0x229d('0xf2')]+=0x1,'scheduledat':moment()[_0x229d('0xfa')](_0x237be0['dialNoSuchNumberRetryFrequency'],_0x229d('0x11f'))[_0x229d('0x78')](_0x229d('0x112')),'ContactId':_0x2bb444[_0x229d('0xd3')],'ListId':_0x2bb444['ListId'],'VoiceQueueId':_0x2bb444[_0x229d('0xfd')]||undefined,'CampaignId':_0x2bb444[_0x229d('0xd4')]||undefined})[_0x229d('0xaf')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x2bb444[_0x229d('0xf3')]>=_0x237be0[_0x229d('0x11d')]-0x1){return!![];}this[_0x229d('0xc0')]({'active':![],'countdropretry':_0x2bb444[_0x229d('0xf3')]+=0x1,'scheduledat':moment()['add'](_0x237be0[_0x229d('0x11e')],'minutes')[_0x229d('0x78')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2bb444[_0x229d('0xd3')],'ListId':_0x2bb444['ListId'],'VoiceQueueId':_0x2bb444['VoiceQueueId']||undefined,'CampaignId':_0x2bb444[_0x229d('0xd4')]||undefined})[_0x229d('0xaf')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x2bb444['countabandonedretry']>=_0x237be0[_0x229d('0x1a3')]-0x1){return!![];}this[_0x229d('0xc0')]({'active':![],'countabandonedretry':_0x2bb444['countabandonedretry']+=0x1,'scheduledat':moment()[_0x229d('0xfa')](_0x237be0['dialAbandonedRetryFrequency'],_0x229d('0x11f'))[_0x229d('0x78')](_0x229d('0x112')),'ContactId':_0x2bb444[_0x229d('0xd3')],'ListId':_0x2bb444[_0x229d('0xfc')],'VoiceQueueId':_0x2bb444[_0x229d('0xfd')]||undefined,'CampaignId':_0x2bb444['CampaignId']||undefined})[_0x229d('0xaf')](loggerCatch(_0x229d('0x1a4')));break;case 0x13:if(_0x2bb444[_0x229d('0xed')]>=_0x237be0[_0x229d('0xf7')]-0x1){return!![];}this[_0x229d('0xc0')]({'active':![],'countmachineretry':_0x2bb444[_0x229d('0xed')]+=0x1,'scheduledat':moment()['add'](_0x237be0[_0x229d('0xfb')],'minutes')[_0x229d('0x78')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2bb444[_0x229d('0xd3')],'ListId':_0x2bb444[_0x229d('0xfc')],'VoiceQueueId':_0x2bb444[_0x229d('0xfd')]||undefined,'CampaignId':_0x2bb444[_0x229d('0xd4')]||undefined})[_0x229d('0xaf')](loggerCatch(_0x229d('0x103')));break;case 0x14:if(_0x2bb444[_0x229d('0x101')]>=_0x237be0['dialAgentRejectMaxRetry']-0x1){return!![];}this[_0x229d('0xc0')]({'active':![],'countagentrejectretry':_0x2bb444[_0x229d('0x101')]+=0x1,'scheduledat':moment()[_0x229d('0xfa')](_0x237be0['dialAgentRejectRetryFrequency'],_0x229d('0x11f'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2bb444[_0x229d('0xd3')],'ListId':_0x2bb444[_0x229d('0xfc')],'VoiceQueueId':_0x2bb444[_0x229d('0xfd')]||undefined,'CampaignId':_0x2bb444[_0x229d('0xd4')]||undefined})[_0x229d('0xaf')](loggerCatch(_0x229d('0x1a5')));break;default:return!![];}};Dialer['prototype'][_0x229d('0x1a6')]=function(_0x36d2a1,_0x19b7e7,_0x584e8d){var _0x58e7f5=this;var _0x2e4e99=new History(_0x36d2a1);return new BPromise(function(_0x5dc4dc,_0x39d3a8){if(_['isUndefined'](_0x19b7e7)&&typeof _0x19b7e7!==_0x229d('0x16a')){return _0x39d3a8(msgResponse(_0x229d('0x1a7'),'Failure',_0x229d('0x1a8')));}if(_[_0x229d('0x86')](_0x584e8d)&&typeof _0x584e8d!==_0x229d('0x16a')){return _0x39d3a8(msgResponse(_0x229d('0x1a7'),_0x229d('0x146'),_0x229d('0x1a9')));}switch(_0x584e8d[_0x229d('0x1aa')]){case'0':_0x19b7e7[_0x229d('0x66')]+=0x1;_0x2e4e99[_0x229d('0xe2')]=0x0;_0x2e4e99['statedesc']=_0x229d('0x1ab');_0x2e4e99[_0x229d('0xf2')]+=0x1;_0x2e4e99['countglobal']+=0x1;ami[_0x229d('0x4c')](_0x229d('0x1ac'),ut['buildObj'](_0x36d2a1,'nosuchnumber'));_0x58e7f5[_0x229d('0xcb')](_0x2e4e99)[_0x229d('0xaf')](loggerCatch(_0x229d('0xef')));if(_0x58e7f5['checkRetriveMax'](0x0,_0x36d2a1,_0x19b7e7)){if(_0x2e4e99[_0x229d('0xf2')]>=_0x19b7e7['dialNoSuchNumberMaxRetry']){_0x58e7f5[_0x229d('0xf8')](_0x2e4e99,_0x5dc4dc,_0x39d3a8,_0x229d('0x1ad'));}else{_0x58e7f5[_0x229d('0xf6')](_0x2e4e99,_0x5dc4dc,_0x39d3a8,_0x229d('0x1ad'));}}break;case'3':_0x19b7e7[_0x229d('0x65')]+=0x1;_0x2e4e99[_0x229d('0xe2')]=0x3;_0x2e4e99[_0x229d('0xa8')]=_0x229d('0x1ae');_0x2e4e99['countnoanswerretry']+=0x1;_0x2e4e99[_0x229d('0xee')]+=0x1;ami[_0x229d('0x4c')]('custom:agentnoanswer',ut[_0x229d('0xe6')](_0x36d2a1,_0x229d('0x1af')));_0x58e7f5['createHistory'](_0x2e4e99)[_0x229d('0xaf')](loggerCatch(_0x229d('0x1b0')));if(_0x58e7f5['checkRetriveMax'](0x3,_0x36d2a1,_0x19b7e7)){if(_0x2e4e99['countnoanswerretry']>=_0x19b7e7[_0x229d('0x19b')]){_0x58e7f5[_0x229d('0xf8')](_0x2e4e99,_0x5dc4dc,_0x39d3a8,_0x229d('0x1b1'));}else{_0x58e7f5['stateGlobal'](_0x2e4e99,_0x5dc4dc,_0x39d3a8,_0x229d('0x1b1'));}}break;case'5':_0x19b7e7['outboundBusyCallsDay']+=0x1;_0x2e4e99[_0x229d('0xe2')]=0x5;_0x2e4e99['statedesc']=_0x229d('0x1b2');_0x2e4e99['countbusyretry']+=0x1;_0x2e4e99[_0x229d('0xee')]+=0x1;ami[_0x229d('0x4c')](_0x229d('0x1b3'),ut['buildObj'](_0x36d2a1,_0x229d('0x1b4')));_0x58e7f5['createHistory'](_0x2e4e99)[_0x229d('0xaf')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x58e7f5[_0x229d('0x19a')](0x5,_0x36d2a1,_0x19b7e7)){if(_0x2e4e99['countbusyretry']>=_0x19b7e7[_0x229d('0x19d')]){_0x58e7f5[_0x229d('0xf8')](_0x2e4e99,_0x5dc4dc,_0x39d3a8,_0x229d('0x1b5'));}else{_0x58e7f5['stateGlobal'](_0x2e4e99,_0x5dc4dc,_0x39d3a8,_0x229d('0x1b5'));}}break;case'8':_0x19b7e7[_0x229d('0x62')]+=0x1;_0x2e4e99[_0x229d('0xe2')]=0x8;_0x2e4e99[_0x229d('0xa8')]=_0x229d('0x1b6');_0x2e4e99[_0x229d('0xf0')]+=0x1;_0x2e4e99[_0x229d('0xee')]+=0x1;ami[_0x229d('0x4c')](_0x229d('0x1b7'),ut[_0x229d('0xe6')](_0x36d2a1,_0x229d('0x1b8')));_0x58e7f5[_0x229d('0xcb')](_0x2e4e99)['catch'](loggerCatch(_0x229d('0x1b9')));if(_0x58e7f5[_0x229d('0x19a')](0x8,_0x36d2a1,_0x19b7e7)){if(_0x2e4e99[_0x229d('0xf0')]>=_0x19b7e7[_0x229d('0x19f')]){_0x58e7f5[_0x229d('0xf8')](_0x2e4e99,_0x5dc4dc,_0x39d3a8,_0x229d('0x1ba'));}else{_0x58e7f5['stateGlobal'](_0x2e4e99,_0x5dc4dc,_0x39d3a8,_0x229d('0x1ba'));}}break;case'11':_0x19b7e7[_0x229d('0x1bb')]+=0x1;_0x2e4e99[_0x229d('0xe2')]=0xb;_0x2e4e99[_0x229d('0xa8')]=_0x229d('0x125');_0x2e4e99[_0x229d('0xf4')]+=0x1;_0x2e4e99[_0x229d('0xee')]+=0x1;_0x58e7f5[_0x229d('0xcb')](_0x2e4e99)[_0x229d('0xaf')](loggerCatch(_0x229d('0x127')));if(_0x58e7f5[_0x229d('0x19a')](0xb,_0x36d2a1,_0x19b7e7)){if(_0x2e4e99[_0x229d('0xf4')]>=_0x19b7e7[_0x229d('0x1a3')]){_0x58e7f5[_0x229d('0xf8')](_0x2e4e99,_0x5dc4dc,_0x39d3a8,_0x229d('0x1bc'));}else{_0x58e7f5[_0x229d('0xf6')](_0x2e4e99,_0x5dc4dc,_0x39d3a8,'reason\x2011\x20abandoned');}}break;case'20':_0x19b7e7['outboundRejectCallsDay']+=0x1;_0x2e4e99[_0x229d('0xe2')]=0x14;_0x2e4e99['statedesc']=_0x229d('0x1bd');_0x2e4e99[_0x229d('0x101')]+=0x1;_0x2e4e99[_0x229d('0xee')]+=0x1;ami[_0x229d('0x4c')](_0x229d('0x1be'),ut[_0x229d('0xe6')](_0x36d2a1,_0x229d('0x1bf')));_0x58e7f5[_0x229d('0xcb')](_0x2e4e99)[_0x229d('0xaf')](loggerCatch(_0x229d('0x1c0')));if(_0x58e7f5['checkRetriveMax'](0x14,_0x36d2a1,_0x19b7e7)){if(_0x2e4e99[_0x229d('0x101')]>=_0x19b7e7['dialAgentRejectMaxRetry']){_0x58e7f5['createStateFinal'](_0x2e4e99,_0x5dc4dc,_0x39d3a8,_0x229d('0x1c1'));}else{_0x58e7f5[_0x229d('0xf6')](_0x2e4e99,_0x5dc4dc,_0x39d3a8,_0x229d('0x1c1'));}}break;default:_0x19b7e7[_0x229d('0x109')]+=0x1;_0x2e4e99[_0x229d('0xe2')]=0xc;_0x2e4e99[_0x229d('0xa8')]=_0x584e8d[_0x229d('0x1aa')];_0x58e7f5[_0x229d('0xcb')](_0x2e4e99)[_0x229d('0xaf')](loggerCatch(_0x229d('0x1c2')));if(_0x58e7f5[_0x229d('0x19a')](_0x584e8d[_0x229d('0x1aa')],_0x36d2a1,_0x19b7e7)){if(_0x2e4e99[_0x229d('0x100')]+_0x2e4e99[_0x229d('0xf0')]+_0x2e4e99[_0x229d('0xf1')]+_0x2e4e99[_0x229d('0xf2')]+_0x2e4e99[_0x229d('0xf3')]+_0x2e4e99[_0x229d('0xf4')]+_0x2e4e99[_0x229d('0xed')]+_0x2e4e99[_0x229d('0x101')]>=_0x19b7e7[_0x229d('0xf5')]){_0x58e7f5[_0x229d('0xf6')](_0x2e4e99,_0x5dc4dc,_0x39d3a8,_0x584e8d['reason']);}else{_0x58e7f5[_0x229d('0xf8')](_0x2e4e99,_0x5dc4dc,_0x39d3a8,_0x584e8d[_0x229d('0x1aa')]);}}}});};Dialer[_0x229d('0x18')][_0x229d('0xf6')]=function(_0x119f51,_0x242136,_0x2f5f32,_0x542167){var _0x12ed65=new Final(_0x119f51);_0x12ed65['state']=0xf;_0x12ed65[_0x229d('0xa8')]=_0x229d('0x1c3');this[_0x229d('0xf8')](_0x12ed65,_0x242136,_0x2f5f32,_0x542167);};Dialer[_0x229d('0x18')]['createStateFinal']=function(_0x45a5df,_0x1aa1fe,_0x21ab99,_0x484351){this['moveContactManagedDialer'](_0x45a5df)[_0x229d('0xb6')](function(){return _0x1aa1fe(msgResponse('[callProgressDetecting]',_0x229d('0x1c4'),_0x484351));})[_0x229d('0xaf')](function(){return _0x21ab99(msgResponse(_0x229d('0x1c5'),_0x229d('0x146'),_0x229d('0x1c6')));});};Dialer[_0x229d('0x18')][_0x229d('0x9')]=function(_0x256e09){var _0x491432=_0x256e09['dialPredictiveOptimizationPercentage']/0x64;var _0x26dc92=_0x256e09[_0x229d('0x119')]/(_0x256e09['outboundDropCallsDayTimeout']+_0x256e09[_0x229d('0x61')]);var _0x438ac6=Math[_0x229d('0x1c7')](_0x256e09[_0x229d('0x6e')]*(_0x256e09[_0x229d('0x1c8')]/0x64));var _0x4ba5ff=Math[_0x229d('0x1c7')](_0x256e09[_0x229d('0x6e')]*(_0x256e09[_0x229d('0x1c9')]/0x64));var _0x318f0c=_0x256e09['available']+_0x256e09[_0x229d('0x56')];var _0x2e2e20=Math[_0x229d('0x1ca')](_0x256e09[_0x229d('0x8c')]*_0x256e09[_0x229d('0x72')]*_0x256e09[_0x229d('0x6c')]*_0x256e09[_0x229d('0x1cb')]);if(_[_0x229d('0x86')](_0x256e09[_0x229d('0x74')])){if(!_[_0x229d('0x86')](_0x256e09[_0x229d('0x27')])){_0x256e09[_0x229d('0x27')]=undefined;loggerPredictive[_0x229d('0x96')](_0x229d('0x1cc'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_['isUndefined'](_0x256e09['handlePredictive'])){loggerPredictive[_0x229d('0x96')]('[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x256e09[_0x229d('0x91')]);_0x256e09[_0x229d('0x91')]=undefined;}_0x256e09[_0x229d('0x74')]=moment()[_0x229d('0x78')](_0x229d('0x112'));loggerPredictive[_0x229d('0x7d')](_0x256e09[_0x229d('0x3e')],_0x229d('0x1cd'),_0x256e09[_0x229d('0x74')]);this[_0x229d('0x159')](_0x256e09,0x1);}else if(ifInterval(_0x256e09[_0x229d('0x1ce')],_0x256e09[_0x229d('0x74')])){this[_0x229d('0x159')](_0x256e09,0x1);loggerPredictiveCalls['info'](_0x229d('0x1cf'),_0x256e09[_0x229d('0x74')],_0x256e09[_0x229d('0x3e')]);_0x256e09['erlangCalls']=0x0;_0x256e09[_0x229d('0x6b')]=0x0;}else if(_0x491432<_0x26dc92&&_0x256e09[_0x229d('0x1d0')]==='dropRate'){freeVariablesPredictive(_0x256e09);loggerPredictive['info'](_0x229d('0x1d1'),_0x229d('0x1d2'),_0x26dc92,_0x229d('0x74'),_0x256e09[_0x229d('0x3e')]);}else if(_0x2e2e20<_0x256e09['predictiveIntervalErlangCallsDroppedCalls']&&_0x256e09['dialPredictiveOptimization']==='dropRate'){freeVariablesPredictive(_0x256e09);loggerPredictive['info'](_0x229d('0x1d3'),_0x229d('0x1d4'),_0x2e2e20,_0x229d('0x1d5'),_0x256e09['predictiveIntervalErlangCallsDroppedCalls'],_0x229d('0x74'),_0x256e09[_0x229d('0x3e')]);}else if(!ifInterval(_0x256e09[_0x229d('0x1ce')],_0x256e09[_0x229d('0x74')])&&_[_0x229d('0x86')](_0x256e09[_0x229d('0x27')])&&!_['isUndefined'](_0x256e09[_0x229d('0x74')])){_0x256e09[_0x229d('0x27')]=moment()[_0x229d('0x78')](_0x229d('0x112'));loggerPredictive['info'](_0x256e09['name'],_0x229d('0x1d6'),_0x256e09['startPredictive']);this[_0x229d('0xbd')](_0x256e09['dialPredictiveInterval'])['then'](this['getDataPredictive'](_0x256e09))[_0x229d('0xb6')](mergeDataErlangB(_0x256e09))['then'](this[_0x229d('0x1d7')](_0x256e09))[_0x229d('0xaf')](loggerCatchPredictive(_0x229d('0x1d8'),_0x256e09));}else if(!ifInterval(_0x256e09[_0x229d('0x1ce')],_0x256e09[_0x229d('0x27')])){_0x256e09[_0x229d('0x6b')]=0x0;_0x256e09['startPredictive']=moment()[_0x229d('0x78')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x256e09[_0x229d('0x3e')],_0x229d('0x1d9'),_0x256e09['startPredictive']);clearInterval(_0x256e09[_0x229d('0x91')]);_0x256e09[_0x229d('0x91')]=undefined;this['averageHandleTime'](_0x256e09[_0x229d('0x1ce')])[_0x229d('0xb6')](this[_0x229d('0x1da')](_0x256e09))['then'](mergeDataErlangB(_0x256e09))[_0x229d('0xb6')](this['startMethodPredictive'](_0x256e09))[_0x229d('0xaf')](loggerCatchPredictive(_0x229d('0x1db'),_0x256e09));}else if(_0x256e09[_0x229d('0x6e')]&&_0x318f0c<_0x256e09[_0x229d('0x6e')]-_0x4ba5ff){freeVariablesPredictive(_0x256e09);loggerPredictive[_0x229d('0x7d')](_0x256e09[_0x229d('0x3e')],_0x229d('0x1dc'),_0x318f0c,_0x229d('0x1dd'),_0x256e09['predictiveIntervalAvailable'],'-',_0x4ba5ff,'=',_0x256e09['predictiveIntervalAvailable']-_0x4ba5ff,')');}else if(_0x256e09[_0x229d('0x6e')]&&_0x318f0c>_0x256e09[_0x229d('0x6e')]+_0x438ac6){freeVariablesPredictive(_0x256e09);loggerPredictive[_0x229d('0x7d')](_0x256e09[_0x229d('0x3e')],_0x229d('0x1dc'),_0x318f0c,_0x229d('0x1de'),_0x256e09[_0x229d('0x6e')],'+',_0x438ac6,'=',_0x256e09[_0x229d('0x6e')]+_0x438ac6,')');}};Dialer[_0x229d('0x18')][_0x229d('0x1da')]=function(_0x202e5d){var _0x54bda5=this;return function(_0x244656){return new BPromise(function(_0x373ebe,_0xd8f081){_[_0x229d('0x8f')](_0x202e5d,_0x244656[0x0]);if(checkGetDataPredictive(_0x244656[0x0])){var _0x3cf3d1=_0x202e5d[_0x229d('0x6e')]=_0x202e5d[_0x229d('0x56')]+_0x202e5d['available'];var _0x132fcc=_0x202e5d[_0x229d('0x1ce')]*0x3c;var _0x5dd0a6=_0x244656[0x0][_0x229d('0x83')]+_0x244656[0x0]['predictiveIntervalAvgHoldtime'];var _0x2fe69b=(_0x244656[0x0][_0x229d('0x68')]+_0x244656[0x0][_0x229d('0x7f')]+_0x244656[0x0][_0x229d('0x69')])/_0x244656[0x0]['predictiveIntervalTotalCalls'];_0x202e5d[_0x229d('0x6c')]=_0x2fe69b>0x0?_0x2fe69b:0x1;switch(_0x202e5d['dialPredictiveOptimization']){case _0x229d('0x1df'):var _0x13af6=_0x202e5d[_0x229d('0x1e0')]/0x64;return _0x54bda5[_0x229d('0x1e1')](_0x3cf3d1,_0x132fcc,_0x5dd0a6,_0x2fe69b,_0x13af6)['then'](function(_0x5328ad){return _0x373ebe(_0x5328ad);});case _0x229d('0x1e2'):var _0x1aa593=_0x202e5d[_0x229d('0x1e0')]/0x64;return _0x54bda5[_0x229d('0x1e3')](_0x3cf3d1,_0x132fcc,_0x5dd0a6,_0x2fe69b,_0x1aa593)[_0x229d('0xb6')](function(_0x51ffc2){return _0x373ebe(_0x51ffc2);});default:return _0xd8f081(msgResponse(_0x229d('0x1e4'),_0x229d('0x146'),'Unknown\x20Predictive'));}}else{return _0xd8f081(msgResponse(_0x229d('0x1e4'),_0x229d('0x146'),_0x229d('0x1e5')));}});};};Dialer[_0x229d('0x18')][_0x229d('0x1e6')]=function(_0x57102d){var _0xfd6ebf=this;return function(_0xd7d8e3){return new BPromise(function(_0x2f69c8,_0x1eff2a){_[_0x229d('0x8f')](_0x57102d,_0xd7d8e3[0x0]);if(checkGetDataPredictive(_0xd7d8e3[0x0])){loggerPredictive[_0x229d('0x7d')](JSON[_0x229d('0x48')](_0xd7d8e3[0x0]));if(_0x57102d['dialPredictiveOptimization']===_0x229d('0x1df')){return _0xfd6ebf[_0x229d('0xc8')](_0x57102d['id'])[_0x229d('0xb6')](function(_0x44c938){var _0x54c63f=_0x57102d[_0x229d('0x52')]-_0x44c938[0x0][_0x229d('0x1e7')];var _0x6ff027=_0x57102d['dialPredictiveInterval']*0x3c;var _0x329065=_0xd7d8e3[0x0][_0x229d('0x83')]+_0xd7d8e3[0x0][_0x229d('0x81')];var _0x45499b=(_0xd7d8e3[0x0]['predictiveIntervalAnsweredCalls']+_0xd7d8e3[0x0][_0x229d('0x7f')]+_0xd7d8e3[0x0][_0x229d('0x69')])/_0xd7d8e3[0x0][_0x229d('0x6f')];var _0xb471d5=_0x57102d['dialPredictiveOptimizationPercentage']/0x64;_0x57102d[_0x229d('0x6d')]=_0x44c938[0x0][_0x229d('0x1e7')]||0x0;_0x57102d[_0x229d('0x6c')]=_0x45499b>0x0?_0x45499b:0x1;return _0xfd6ebf[_0x229d('0x1e1')](_0x54c63f,_0x6ff027,_0x329065,_0x45499b,_0xb471d5);})[_0x229d('0xb6')](function(_0x1f0f7f){return _0x2f69c8(_0x1f0f7f);})['catch'](function(_0xd16f0e){return _0x1eff2a(msgResponse(_0x229d('0x1e8'),_0x229d('0x146'),JSON[_0x229d('0x48')](_0xd16f0e)));});}if(_0x57102d['dialPredictiveOptimization']==='agentBusyFactor'){return _0xfd6ebf[_0x229d('0xc8')](_0x57102d['id'])[_0x229d('0xb6')](function(_0x436a39){var _0x3bddf5=_0x57102d[_0x229d('0x52')]-_0x436a39[0x0][_0x229d('0x1e7')];var _0x458557=_0x57102d[_0x229d('0x1ce')]*0x3c;var _0xace554=_0xd7d8e3[0x0]['predictiveIntervalAvgTalktime']+_0xd7d8e3[0x0]['predictiveIntervalAvgHoldtime'];var _0x2763ab=(_0xd7d8e3[0x0]['predictiveIntervalAnsweredCalls']+_0xd7d8e3[0x0]['predictiveIntervalDroppedCallsTimeout']+_0xd7d8e3[0x0][_0x229d('0x69')])/_0xd7d8e3[0x0][_0x229d('0x6f')];var _0x280a39=_0x57102d['dialPredictiveOptimizationPercentage']/0x64;_0x57102d[_0x229d('0x6d')]=_0x436a39[0x0][_0x229d('0x1e7')]||0x0;_0x57102d['predictiveIntervalHitRate']=_0x2763ab>0x0?_0x2763ab:0x1;return _0xfd6ebf[_0x229d('0x1e3')](_0x3bddf5,_0x458557,_0xace554,_0x2763ab,_0x280a39);})[_0x229d('0xb6')](function(_0x583182){return _0x2f69c8(_0x583182);})[_0x229d('0xaf')](function(_0xef8c0c){return _0x1eff2a(msgResponse('[CatchErlangB]',_0x229d('0x146'),JSON['stringify'](_0xef8c0c)));});}}else{return _0x1eff2a(msgResponse(_0x229d('0x1e4'),_0x229d('0x146'),'check\x20failure'));}});};};Dialer['prototype'][_0x229d('0x1d7')]=function(_0x196a5d){var _0x3123ec=this;return function(){var _0x139935=0x0;var _0x4af806=Math[_0x229d('0x1ca')](_0x196a5d[_0x229d('0x71')]*0x3e8);if(_0x4af806>0x0){_0x4af806=_0x4af806<0x64?0x64:_0x4af806;loggerPredictive[_0x229d('0x7d')](_0x196a5d[_0x229d('0x3e')],'one\x20call\x20every:',_0x4af806,_0x229d('0x49'));_0x196a5d['handlePredictive']=setInterval(function(){_0x3123ec[_0x229d('0x91')](_0x196a5d);loggerPredictiveCalls['info'](_0x229d('0x1e9'),_0x139935+=0x1);},_0x4af806);}else{loggerPredictive[_0x229d('0x7d')](_0x196a5d['name'],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x229d('0x18')][_0x229d('0x1ea')]=function(_0x57fb19,_0x650429){var _0x11568d=this;return function(_0x25ea2e){if(_[_0x229d('0x44')](_0x25ea2e)){if(_[_0x229d('0xad')](_0x650429[_0x229d('0x1eb')])||!_0x650429[_0x229d('0x1ec')]){if(_0x57fb19[_0x229d('0x5c')]===_0x229d('0x15b')){_0x57fb19['queueStatusComplete']=_['isUndefined'](_0x57fb19['queueStatusComplete'])?!![]:_0x57fb19['queueStatusComplete'];var _0x525ca0=uuid['v4']();_0x11568d['actions'][_0x525ca0]=new Action(_0x57fb19,_0x650429,_0x525ca0);loggerBooked[_0x229d('0x7d')](_0x229d('0x1ed'),_0x525ca0,'queueStatusComplete:\x20',JSON[_0x229d('0x48')](_0x57fb19[_0x229d('0x130')]),_0x229d('0x1ee'),_0x57fb19[_0x229d('0x3e')]);if(_0x57fb19[_0x229d('0x130')]){_0x57fb19[_0x229d('0x130')]=![];_0x11568d[_0x229d('0x29')][_0x11568d['actions'][_0x525ca0][_0x229d('0xb1')]]=[];ami['Action']({'actionid':_0x525ca0,'action':_0x229d('0x1ef'),'queue':_0x57fb19['name']})[_0x229d('0xaf')](function(){_0x11568d[_0x229d('0xb3')](_0x57fb19);_0x11568d['rescheduleContact']({'active':![],'ContactId':_0x11568d[_0x229d('0x23')][_0x525ca0][_0x229d('0xd3')],'ListId':_0x11568d[_0x229d('0x23')][_0x525ca0][_0x229d('0xfc')],'VoiceQueueId':_0x11568d[_0x229d('0x23')][_0x525ca0][_0x229d('0xfd')]||undefined,'CampaignId':_0x11568d[_0x229d('0x23')][_0x525ca0][_0x229d('0xd4')]||undefined})[_0x229d('0xaf')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x11568d[_0x229d('0x23')][_0x525ca0];});}else{loggerBooked['info'](_0x229d('0x1f0'),JSON[_0x229d('0x48')](_0x57fb19[_0x229d('0x130')]),_0x229d('0x1ee'),_0x57fb19[_0x229d('0x3e')]);_0x11568d['updateOriginated'](_0x57fb19);_0x11568d[_0x229d('0xc0')]({'active':![],'ContactId':_0x11568d[_0x229d('0x23')][_0x525ca0][_0x229d('0xd3')],'ListId':_0x11568d['actions'][_0x525ca0]['ListId'],'VoiceQueueId':_0x11568d[_0x229d('0x23')][_0x525ca0][_0x229d('0xfd')]||undefined,'CampaignId':_0x11568d['actions'][_0x525ca0]['CampaignId']||undefined})['catch'](loggerCatch(_0x229d('0x1f1')));delete _0x11568d['actions'][_0x525ca0];}}else{return _0x11568d[_0x229d('0x169')](_0x57fb19,_0x650429);}}else{if(getDiff(_0x650429[_0x229d('0x1f2')])<_0x57fb19[_0x229d('0x1f3')]*0x3c){if(_0x650429[_0x229d('0x1f4')]&&!_0x650429[_0x229d('0x1f4')][_0x229d('0x1f5')]){_0x11568d['preview'][_0x229d('0x131')](_0x650429['id'])[_0x229d('0x1b')](function(){_0x11568d[_0x229d('0xb3')](_0x57fb19);});}else{_0x11568d[_0x229d('0xc2')]({'active':![]},_0x650429['id'],0x1)[_0x229d('0x1b')](function(){_0x11568d[_0x229d('0xb3')](_0x57fb19);});}}else{_0x57fb19['outboundReCallsDay']+=0x1;_0x11568d[_0x229d('0xb3')](_0x57fb19);if(_0x57fb19[_0x229d('0x1f6')]){_0x11568d[_0x229d('0xc0')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x650429[_0x229d('0xd3')],'ListId':_0x650429['ListId'],'VoiceQueueId':_0x650429[_0x229d('0xfd')]||undefined,'CampaignId':_0x650429[_0x229d('0xd4')]||undefined})[_0x229d('0xaf')](loggerCatch(_0x229d('0x1f7')));_0x11568d[_0x229d('0xcb')](createObjHistory(_0x57fb19,_0x650429,_0x229d('0x1f8'),0x17,_0x229d('0x1f9')))[_0x229d('0xaf')](loggerCatch(_0x229d('0x1fa')));}else{_0x11568d[_0x229d('0xd1')](createObjHistory(_0x57fb19,_0x650429,'RECALLFAILEDTIMEOUT',0x16,_0x229d('0x1fb')),_0x229d('0x1fc'),'[Originate][HistoryRecallClose]');}}}}else{_0x57fb19[_0x229d('0x1fd')]+=0x1;_0x11568d[_0x229d('0xd1')](createObjHistory(_0x57fb19,_0x650429,_0x229d('0x1fe'),0xd,'Blacklist'),_0x229d('0x1ff'),'[Originate][MoveBlacklist]');throw _0x229d('0x200');}};};Dialer['prototype']['handleIvr']=function(_0x3f1c77){var _0xbc6716=this;var _0x4e6149=_0x3f1c77['limitCalls']-_0x3f1c77['originated']-_0x3f1c77['temp'];emitCampaignSummary(_0x3f1c77);if(_0x4e6149>0x0){if(_0x4e6149>this['maxNumberOriginate']){_0x4e6149=this[_0x229d('0x22')];}_0x3f1c77[_0x229d('0xc5')]+=_0x4e6149;this[_0x229d('0x201')](_0x3f1c77['id'],_0x4e6149,_0x3f1c77[_0x229d('0x202')],_0x3f1c77)[_0x229d('0xb6')](function(_0x45eb3d){_0x3f1c77[_0x229d('0xc5')]-=_0x4e6149;_0x3f1c77[_0x229d('0xc5')]=_0x3f1c77[_0x229d('0xc5')]>0x0?_0x3f1c77['temp']:0x0;if(!checkContactEmpty(_0x45eb3d)){_0x3f1c77['message']=_0x229d('0x9f');logger[_0x229d('0x7d')]('[getContactCampaign2][Empty]'+_0x3f1c77['name']);}else{_0x3f1c77[_0x229d('0x70')]+=_0x45eb3d[_0x229d('0x98')];_0x3f1c77[_0x229d('0x3c')]=_0x229d('0x203');for(var _0x24dae7=0x0;_0x24dae7<_0x45eb3d[_0x229d('0x98')];_0x24dae7+=0x1){_0x3f1c77[_0x229d('0x204')]+=0x1;if(_[_0x229d('0xad')](_0x45eb3d[_0x24dae7])||_[_0x229d('0xad')](_0x45eb3d[_0x24dae7]['Contact'])||_[_0x229d('0xad')](_0x45eb3d[_0x24dae7]['Contact'][_0x229d('0x16c')])){_0xbc6716[_0x229d('0xcf')](_0x229d('0x205'),_0x3f1c77,_0x45eb3d[_0x24dae7]);}else{_0xbc6716[_0x229d('0xbb')](_[_0x229d('0xd2')](_0x45eb3d[_0x24dae7],['CampaignId',_0x229d('0x206')]))[_0x229d('0xb6')](_0xbc6716['checkContactBlack'](_0x3f1c77,_0x45eb3d[_0x24dae7]))[_0x229d('0xaf')](_0xbc6716[_0x229d('0xce')](_0x229d('0x207'),_0x3f1c77));}}}})[_0x229d('0xaf')](loggerGetContactDialer('[getContactCampaign2]',_0x3f1c77,_0x4e6149));}};Dialer[_0x229d('0x18')][_0x229d('0x159')]=function(_0x5bfc73,_0x2504d4){var _0x7ede7e=this;var _0x4fa409=[];var _0x229f27=_0x2504d4>=0x1?_0x2504d4:0x1;if(_0x5bfc73[_0x229d('0x5c')]===_0x229d('0x15b')){_0x229f27=0x1;}var _0x10f174=Math[_0x229d('0x1ca')](_0x5bfc73[_0x229d('0x51')]*_0x229f27)-_0x5bfc73[_0x229d('0x70')]-_0x5bfc73[_0x229d('0xc5')];emitVoiceQueueSummary(_0x5bfc73);if(_0x5bfc73[_0x229d('0x208')]>0x0){var _0x366cdb=_0x5bfc73[_0x229d('0x208')]-_0x5bfc73[_0x229d('0x70')]-_0x5bfc73[_0x229d('0x56')]-_0x5bfc73[_0x229d('0xc5')]-_0x5bfc73[_0x229d('0x53')];if(_0x10f174>_0x366cdb){_0x10f174=_0x366cdb;}}if(_0x10f174>0x0){if(_0x5bfc73[_0x229d('0x5c')]===_0x229d('0x15b')){_0x10f174=0x1;}if(_0x10f174>this[_0x229d('0x22')]){_0x10f174=this[_0x229d('0x22')];}_0x5bfc73['temp']+=_0x10f174;for(var _0x375263 in this['agents']){if(typeof this[_0x229d('0x20')][_0x375263]!==_0x229d('0x99')){if(this['agents'][_0x375263][_0x229d('0xe2')]==='not_inuse'&&this['agents'][_0x375263][_0x229d('0xd9')]===_0x229d('0xda')){_0x4fa409[_0x229d('0x12d')](this[_0x229d('0x20')][_0x375263]['id']);}}}this[_0x229d('0xc4')](_0x5bfc73['id'],_0x4fa409,_0x10f174,_0x5bfc73[_0x229d('0x202')],_0x5bfc73)[_0x229d('0xb6')](function(_0x113243){_0x5bfc73['temp']-=_0x10f174;_0x5bfc73[_0x229d('0xc5')]=_0x5bfc73[_0x229d('0xc5')]>0x0?_0x5bfc73[_0x229d('0xc5')]:0x0;if(!checkContactEmpty(_0x113243)){_0x7ede7e[_0x229d('0xb5')](_0x5bfc73)[_0x229d('0xb6')](sendMessageReschedule(_0x5bfc73))[_0x229d('0xaf')](loggerCatch('[countReScheduled]\x20'));}else{_0x5bfc73[_0x229d('0x70')]+=_0x113243[_0x229d('0x98')];_0x5bfc73['message']=_0x5bfc73[_0x229d('0x5c')]===_0x229d('0x15b')?_0x229d('0x173'):_0x229d('0x203');for(var _0x887738=0x0;_0x887738<_0x113243[_0x229d('0x98')];_0x887738+=0x1){if(_[_0x229d('0xad')](_0x113243[_0x887738])||_[_0x229d('0xad')](_0x113243[_0x887738][_0x229d('0x183')])||_[_0x229d('0xad')](_0x113243[_0x887738][_0x229d('0x183')][_0x229d('0x16c')])){_0x7ede7e[_0x229d('0xcf')](_0x229d('0x205'),_0x5bfc73,_0x113243[_0x887738]);}else{_0x7ede7e[_0x229d('0xb8')](_[_0x229d('0xd2')](_0x113243[_0x887738],[_0x229d('0xfd'),_0x229d('0x206')]))[_0x229d('0xb6')](_0x7ede7e[_0x229d('0x1ea')](_0x5bfc73,_0x113243[_0x887738]))[_0x229d('0xaf')](_0x7ede7e['loggerHandler'](_0x229d('0x205'),_0x5bfc73));}}}})['catch'](loggerGetContactDialer('[getContactDialer2]',_0x5bfc73,_0x10f174));}};Dialer[_0x229d('0x18')]['handlePredictive']=function(_0xdf10d3){if(_0xdf10d3['dialLimitQueue']>0x0){var _0x4bbd06=_0xdf10d3['dialLimitQueue']-_0xdf10d3[_0x229d('0x70')]-_0xdf10d3[_0x229d('0x56')];if(_0x4bbd06>0x0){this[_0x229d('0x209')](_0xdf10d3);}else{loggerPredictiveCalls[_0x229d('0x7d')]('[handlePredictive][limitChannel]');}}else{this[_0x229d('0x209')](_0xdf10d3);}};Dialer['prototype']['tryOriginatePredictive']=function(_0x332e14){var _0x2f87d7=this;var _0x379cff=[];_0x332e14['originated']+=0x1;for(var _0x1c024a in this[_0x229d('0x20')]){if(typeof this[_0x229d('0x20')][_0x1c024a]!==_0x229d('0x99')){if(this['agents'][_0x1c024a][_0x229d('0xe2')]===_0x229d('0x20a')&&this[_0x229d('0x20')][_0x1c024a][_0x229d('0xd9')]===_0x229d('0xda')){_0x379cff[_0x229d('0x12d')](this[_0x229d('0x20')][_0x1c024a]['id']);}}}this[_0x229d('0xc4')](_0x332e14['id'],_0x379cff,0x1,_0x332e14[_0x229d('0x202')],_0x332e14)[_0x229d('0xb6')](function(_0x2d9c24){if(!checkContactEmpty(_0x2d9c24)){checkContactLowerLimitOriginate(_0x332e14,0x1,0x0);_0x2f87d7[_0x229d('0xb5')](_0x332e14)[_0x229d('0xb6')](sendMessageReschedule(_0x332e14))['catch'](loggerCatch(_0x229d('0xb7')));}else{_0x332e14[_0x229d('0x3c')]=_0x229d('0x203');if(_['isNil'](_0x2d9c24[0x0])||_[_0x229d('0xad')](_0x2d9c24[0x0][_0x229d('0x183')])||_[_0x229d('0xad')](_0x2d9c24[0x0][_0x229d('0x183')][_0x229d('0x16c')])){_0x2f87d7['emptyContact'](_0x229d('0x205'),_0x332e14,_0x2d9c24[0x0]);}else{_0x2f87d7['checkIsBlackList'](_[_0x229d('0xd2')](_0x2d9c24[0x0],[_0x229d('0xfd'),_0x229d('0x206')]))[_0x229d('0xb6')](_0x2f87d7['checkContactBlack'](_0x332e14,_0x2d9c24[0x0]))[_0x229d('0xaf')](_0x2f87d7[_0x229d('0xce')](_0x229d('0x20b'),_0x332e14));}}})[_0x229d('0xaf')](loggerGetContactDialer(_0x229d('0x20c'),_0x332e14,0x1));emitVoiceQueueSummary(_0x332e14);};Dialer[_0x229d('0x18')][_0x229d('0x1e1')]=function(_0x4c09df,_0x489dcc,_0x5e0f7c,_0x3d779a,_0x54f171,_0x2821fe){loggerPredictive['info'](_0x229d('0x20d'));loggerPredictive[_0x229d('0x7d')]('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',_0x4c09df);loggerPredictive['info']('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x489dcc);loggerPredictive['info'](_0x229d('0x20e'),_0x5e0f7c);loggerPredictive['info'](_0x229d('0x20f'),_0x3d779a);loggerPredictive['info'](_0x229d('0x210'),_0x54f171);loggerPredictive['info'](_0x229d('0x84'));return new BPromise(function(_0x18613b,_0x5129a1){if(_0x4c09df<=0x0||isNaN(_0x4c09df)){return _0x5129a1(msgResponse('[abandonmentRate]',_0x229d('0x47'),'m\x20=\x20'+_0x4c09df));}if(_0x5e0f7c<=0x0||isNaN(_0x5e0f7c)){return _0x5129a1(msgResponse('[abandonmentRate]',_0x229d('0x47'),'Ts\x20=\x20'+_0x5e0f7c));}if(_0x3d779a<=0x0||isNaN(_0x3d779a)){return _0x5129a1(msgResponse(_0x229d('0x211'),_0x229d('0x47'),_0x229d('0x212')+_0x3d779a));}if(_0x489dcc<=0x0||isNaN(_0x489dcc)){return _0x5129a1(msgResponse(_0x229d('0x211'),_0x229d('0x47'),_0x229d('0x213')+_0x489dcc));}if(_0x54f171<=0x0||isNaN(_0x54f171)){return _0x5129a1(msgResponse(_0x229d('0x211'),_0x229d('0x47'),_0x229d('0x214')+_0x54f171));}_0x2821fe=_0x2821fe||0x0;var _0x546cb7=0x1/_0x5e0f7c;var _0x6eee9=0x0;var _0x3ddb8a=0x0;var _0x1647eb=0x0;var _0x2e486f=0x0;for(var _0x3f4702=0x0;_0x1647eb<_0x54f171;_0x3f4702+=0x1){_0x3ddb8a=_0x3f4702/_0x489dcc;_0x6eee9=(_0x3d779a*_0x3ddb8a+_0x2821fe)/_0x546cb7;_0x1647eb=erlangb(_0x6eee9,_0x4c09df);_0x2e486f=_0x6eee9/_0x4c09df*(0x1-erlangb(_0x6eee9,_0x4c09df));}return _0x18613b({'erlangCalls':_0x3f4702,'erlangCallToSecond':_0x489dcc/_0x3f4702,'erlangAbandonmentRate':_0x1647eb,'erlangBusyFactor':_0x2e486f});});};Dialer[_0x229d('0x18')][_0x229d('0x1e3')]=function(_0x482ab1,_0x44a5ba,_0x10ee3f,_0x33fa24,_0x32d8e6,_0x1678f2){loggerPredictive[_0x229d('0x7d')](_0x229d('0x215'));loggerPredictive[_0x229d('0x7d')](_0x229d('0x216'),_0x482ab1);loggerPredictive[_0x229d('0x7d')](_0x229d('0x217'),_0x44a5ba);loggerPredictive[_0x229d('0x7d')](_0x229d('0x20e'),_0x10ee3f);loggerPredictive['info'](_0x229d('0x20f'),_0x33fa24);loggerPredictive[_0x229d('0x7d')](_0x229d('0x218'),_0x32d8e6);loggerPredictive[_0x229d('0x7d')](_0x229d('0x84'));return new BPromise(function(_0x38750c,_0x4c4347){if(_0x482ab1<=0x0||isNaN(_0x482ab1)){return _0x4c4347(msgResponse('[busyFactor]','Error',_0x229d('0x219')+_0x482ab1));}if(_0x10ee3f<=0x0||isNaN(_0x10ee3f)){return _0x4c4347(msgResponse('[busyFactor]','Error',_0x229d('0x21a')+_0x10ee3f));}if(_0x33fa24<=0x0||isNaN(_0x33fa24)){return _0x4c4347(msgResponse('[busyFactor]',_0x229d('0x47'),_0x229d('0x212')+_0x33fa24));}if(_0x44a5ba<=0x0||isNaN(_0x44a5ba)){return _0x4c4347(msgResponse(_0x229d('0x21b'),_0x229d('0x47'),_0x229d('0x213')+_0x44a5ba));}if(_0x32d8e6<=0x0||isNaN(_0x32d8e6)){return _0x4c4347(msgResponse(_0x229d('0x21b'),_0x229d('0x47'),_0x229d('0x21c')+_0x32d8e6));}_0x1678f2=_0x1678f2||0x0;var _0x55bb0c=0x1/_0x10ee3f;var _0x3a2435=0x0;var _0x5ca95a=0x0;var _0x37e3cf=0x0;var _0x51fc03=0x0;for(var _0x4ed755=0x0;_0x51fc03<_0x32d8e6;_0x4ed755+=0x1){_0x5ca95a=_0x4ed755/_0x44a5ba;_0x3a2435=(_0x33fa24*_0x5ca95a+_0x1678f2)/_0x55bb0c;_0x37e3cf=erlangb(_0x3a2435,_0x482ab1);_0x51fc03=_0x3a2435/_0x482ab1*(0x1-erlangb(_0x3a2435,_0x482ab1));}return _0x38750c({'erlangCalls':_0x4ed755,'erlangCallToSecond':_0x44a5ba/_0x4ed755,'erlangAbandonmentRate':_0x37e3cf,'erlangBusyFactor':_0x51fc03});});};module[_0x229d('0x21d')]=Dialer;
\ No newline at end of file