Built motion from commit (unavailable).|2.4.3
[motion2.git] / server / services / ami / dialer / index.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0xd5c2=['rrmemory','idHopper','[unlockQueueStatus][undefined]','queueStatusComplete','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','rescheduleContact','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','Agent:\x20','[booked][RR][finaly]','[booked][unlock]','[unlock2][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','syncCampaigns','TrunkBackup','TRUNK_IS_NOT_REACHABLE','checkIfTime','ifTime','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','push','command','iftime\x20%s,%s','interval','content','indexOf','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','loggedIn','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','[syncQueueSummary]','[syncCampaigns]','\x5cw{0,','pow','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','outbound','\x22%s,%s%s,,,%s\x22','dialQueueOptions','ACTIVE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','dialCutDigit','[originateError]:\x20%s','OriginateError','endtime','[originate][error]','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','countcongestionretry','countnoanswerretry','dialGlobalMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','minutes','[rescheduleContact][NoAnswer]','countbusyretry','dialBusyMaxRetry','add','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','[callProgressDetecting]','entity\x20is\x20undefine','reason','NoSuchNumber','[syncAgentComplete][createHistory][0]','stateGlobal','reason\x200\x20no\x20such\x20number....','createStateFinal','NoAnswer','reason\x203\x20ringing\x20no\x20answer','Busy','countglobal','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','[syncAgentComplete][createHistory][?]','round','predictiveIntervalMinThreshold','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','Dropped\x20calls\x20day','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','averageHandleTime','dialPredictiveInterval','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(','dialPredictiveOptimizationPercentage','agentBusyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','getVoiceQueueRtPauses','outboundQueuePauses','abandonmentRate','busyFactor','[CatchErlangB]','floor','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','inBlackList','limitCalls','temp','maxNumberOriginate','dialOrderByScheduledAt','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[getContactCampaign2]','dialLimitQueue','not_inuse','[getContactDialer2]','[handlePredictive][limitChannel]','tryOriginatePredictive','[actionOriginatePredictive]\x20','--------\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','[abandonmentRate]','m\x20=\x20','p\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','[busyFactor]','Ts\x20=\x20','interval\x20=\x20','Umin\x20=\x20','exports','util','moment','md5','ioredis','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./final','./agentComplete','./hangup','env','XCALLY_IP_AGI','127.0.0.1','prototype','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','actions','uniqueId','startPredictive','startProgressive','queueBooked','agentconnect','queuecallerabandon','syncQueueCallerAbandon','bind','originateresponse','syncOriginateResponse','agentcomplete','hangup','syncHangup','newexten','syncNewExten','varset','syncQueueStatusComplete','loopCampaigns','isUndefined','AGENTS_NOT_LOGGED','name','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','message','[ifTime][Action]','Error','stringify','milliseconds','seconds','emit','type','strategy','answered','available','pTalking','sumBillable','sumDuration','sumHoldTime','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','voice:queue:%s','voice_queue:save','ivr','format','campaign:save','isEmpty','info','-----\x20Stats\x20Predictive\x20---','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','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---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','diff','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','hasOwnProperty','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','talking','[syncQueueSummary]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','is\x20disactive','state','starttime','loopClearZombieChannels','clearZombieChannels','[uniqueid]','[actions]','isNil','Action','status','channel','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','[countReScheduled]\x20','checkIsBlackList','catch','[checkIsBlackList]\x20','checkIsBlackListIvr','avgHandleTime','[averageHandleTime]\x20','[rescheduleContact]\x20','getContactDialer','getContactDialerIvr','[getContactDialer]\x20','moveContactManagedDialer','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','saveInDb','pick','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','SIP/%s','reachable','unmonitored','syncVarSet','uniqueid','variable','exten','xcally-motion-dialer','dialAMDActive','HANGUP','statedesc','HangupInAMD','membername','AMD','[syncHangupInAMD]','value','MACHINE','Machine','amd','[syncMachine][createHistory]','[syncMachine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','[syncMachineIvr][createHistory]','[syncMachineIvr]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','dialQueueProject','AnswerAGI','AGI','[syncHangupIvr]','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete][createHistory]','[syncAgentComplete]','syncAgentConnect','answertime','queueCallerAbandonCreateState','droptime','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','Drop','dropreason','TIMEOUT','predictiveIntervalDroppedCallsCallersExit','Abandoned','actionid','roundrobin','locked','paused','stateinterface'];(function(_0x5f0bd7,_0x3ab5dc){var _0x38216a=function(_0x273d02){while(--_0x273d02){_0x5f0bd7['push'](_0x5f0bd7['shift']());}};_0x38216a(++_0x3ab5dc);}(_0xd5c2,0xe8));var _0x2d5c=function(_0x121f73,_0x5a9202){_0x121f73=_0x121f73-0x0;var _0x39d301=_0xd5c2[_0x121f73];return _0x39d301;};'use strict';var util=require(_0x2d5c('0x0'));var _=require('lodash');var BPromise=require('bluebird');var uuid=require('uuid');var moment=require(_0x2d5c('0x1'));var rr=require('rr');var md5=require(_0x2d5c('0x2'));var Redis=require(_0x2d5c('0x3'));var config=require('../../../config/environment/');var logger=require(_0x2d5c('0x4'))(_0x2d5c('0x5'));var loggerBooked=require(_0x2d5c('0x4'))(_0x2d5c('0x6'));var loggerPredictive=require(_0x2d5c('0x4'))(_0x2d5c('0x7'));var loggerPredictiveCalls=require(_0x2d5c('0x4'))(_0x2d5c('0x8'));var loggerSyncQueueSummary=require(_0x2d5c('0x4'))(_0x2d5c('0x9'));var ami=require(_0x2d5c('0xa'));config[_0x2d5c('0xb')]=_[_0x2d5c('0xc')](config[_0x2d5c('0xb')],{'host':_0x2d5c('0xd'),'port':0x18eb});var io=require(_0x2d5c('0xe'))(new Redis(config[_0x2d5c('0xb')]));var cmHopper=require(_0x2d5c('0xf'));var cmHopperFinal=require(_0x2d5c('0x10'));var cmHopperHistory=require(_0x2d5c('0x11'));var cmHopperBlack=require(_0x2d5c('0x12'));var voiceQueueRt=require(_0x2d5c('0x13'));var Action=require(_0x2d5c('0x14'));var History=require(_0x2d5c('0x15'));var Final=require(_0x2d5c('0x16'));var AgentComplete=require(_0x2d5c('0x17'));var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require(_0x2d5c('0x18'));var ipAgi=process[_0x2d5c('0x19')][_0x2d5c('0x1a')]||_0x2d5c('0x1b');var strategy={'rrmemory':'rrmemory','roundrobin':'roundrobin'};var Sequence=function(){};Sequence[_0x2d5c('0x1c')]['enqueue']=function(_0x5110e5){this['tail']=this[_0x2d5c('0x1d')]?this[_0x2d5c('0x1d')][_0x2d5c('0x1e')](_0x5110e5):_0x5110e5();};function Dialer(_0x1a5d87,_0xf9804b){this[_0x2d5c('0x1f')]=new Sequence();this[_0x2d5c('0x20')]=_0xf9804b;this[_0x2d5c('0x21')]=_0x1a5d87[_0x2d5c('0x21')];this[_0x2d5c('0x22')]=_0x1a5d87[_0x2d5c('0x22')];this[_0x2d5c('0x23')]=_0x1a5d87[_0x2d5c('0x23')];this[_0x2d5c('0x24')]=_0x1a5d87[_0x2d5c('0x24')];this['maxNumberOriginate']=config['maxNumberOriginate']||0x2;this['channels']={};this[_0x2d5c('0x25')]={};this['contactsId']={};this[_0x2d5c('0x26')]={};this['optionPredictive']={};this[_0x2d5c('0x27')]={};this[_0x2d5c('0x28')]={};this['ivrOriginated']={};this[_0x2d5c('0x29')]={};this['queueBookedRR']={};ami['on'](_0x2d5c('0x2a'),this['syncAgentConnect']['bind'](this));ami['on'](_0x2d5c('0x2b'),this[_0x2d5c('0x2c')][_0x2d5c('0x2d')](this));ami['on'](_0x2d5c('0x2e'),this[_0x2d5c('0x2f')][_0x2d5c('0x2d')](this));ami['on'](_0x2d5c('0x30'),this['syncAgentComplete'][_0x2d5c('0x2d')](this));ami['on']('custom:queuesummary',this[_0x2d5c('0x9')]['bind'](this));ami['on'](_0x2d5c('0x31'),this[_0x2d5c('0x32')][_0x2d5c('0x2d')](this));ami['on'](_0x2d5c('0x33'),this[_0x2d5c('0x34')][_0x2d5c('0x2d')](this));ami['on'](_0x2d5c('0x35'),this['syncVarSet'][_0x2d5c('0x2d')](this));ami['on']('queuemember',this['syncQueueMember'][_0x2d5c('0x2d')](this));ami['on']('queuestatuscomplete',this[_0x2d5c('0x36')][_0x2d5c('0x2d')](this));this[_0x2d5c('0x37')]();this['loopClearZombieChannels']();}function isNotNull(_0x114123){return _0x114123!==null&&!_[_0x2d5c('0x38')](_0x114123);}function checkIsLoggedIn(_0x5ee465,_0xbcbafa){return function(){if(_0xbcbafa<=0x0){_0x5ee465['message']=_0x2d5c('0x39');throw _0x5ee465[_0x2d5c('0x3a')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x12c27a){return _0x12c27a;}function checkIsActive(_0x3e37f5,_0x41180e){return function(){if(!isActive(_0x41180e)){_0x3e37f5['message']=_0x2d5c('0x3b');throw _0x3e37f5[_0x2d5c('0x3a')]+_0x2d5c('0x3c');}};}function checkInterval(_0x2c837d){return function(){if(!isNotNull(_0x2c837d[_0x2d5c('0x3d')])){_0x2c837d['message']=_0x2d5c('0x3e');throw _0x2c837d[_0x2d5c('0x3a')]+_0x2d5c('0x3f');}if(!isNotNull(_0x2c837d[_0x2d5c('0x3d')][_0x2d5c('0x40')])){_0x2c837d[_0x2d5c('0x41')]=_0x2d5c('0x3e');throw _0x2c837d[_0x2d5c('0x3a')]+_0x2d5c('0x3f');}if(!isNotNull(_['isEmpty'](_0x2c837d[_0x2d5c('0x3d')][_0x2d5c('0x40')]))){_0x2c837d[_0x2d5c('0x41')]='INTERVAL_IS_NULL';throw _0x2c837d[_0x2d5c('0x3a')]+_0x2d5c('0x3f');}};}function msgResponse(_0x4d0993,_0x3f6874,_0xd3c0e5){return{'action':_0x4d0993,'response':_0x3f6874,'message':_0xd3c0e5,'stack':_0xd3c0e5};}function myreject(_0xf7b0ec){return function(_0x156cd2){return _0xf7b0ec(msgResponse(_0x2d5c('0x42'),_0x2d5c('0x43'),JSON[_0x2d5c('0x44')](_0x156cd2)));};}function getSeconds(_0x2a2bf8,_0x215b7b){var _0x2d1c35=moment(_0x2a2bf8)[_0x2d5c('0x45')](0x0);var _0x84f5c1=moment(_0x215b7b)['milliseconds'](0x0);return _0x2d1c35['diff'](_0x84f5c1,_0x2d5c('0x46'));}function emit(_0x247812,_0x640a2f,_0x26c93e){io['to'](_0x247812)[_0x2d5c('0x47')](_0x640a2f,_0x26c93e);}function emitVoiceQueueSummary(_0x43d2d4){if(_0x43d2d4[_0x2d5c('0x48')]==='outbound'){var _0x2e8b9d={'id':_0x43d2d4['id'],'name':_0x43d2d4[_0x2d5c('0x3a')],'strategy':_0x43d2d4[_0x2d5c('0x49')],'answered':_0x43d2d4[_0x2d5c('0x4a')],'available':_0x43d2d4[_0x2d5c('0x4b')],'loggedIn':_0x43d2d4['loggedIn'],'pTalking':_0x43d2d4[_0x2d5c('0x4c')],'sumBillable':_0x43d2d4[_0x2d5c('0x4d')],'sumDuration':_0x43d2d4[_0x2d5c('0x4e')],'sumHoldTime':_0x43d2d4[_0x2d5c('0x4f')]||0x0,'talking':_0x43d2d4['talking'],'total':_0x43d2d4[_0x2d5c('0x50')],'type':_0x43d2d4['type'],'unmanaged':_0x43d2d4[_0x2d5c('0x51')],'abandoned':_0x43d2d4[_0x2d5c('0x52')],'waiting':_0x43d2d4[_0x2d5c('0x53')],'loggedInDb':_0x43d2d4[_0x2d5c('0x54')],'dialActive':_0x43d2d4[_0x2d5c('0x55')],'dialMethod':_0x43d2d4[_0x2d5c('0x56')],'dialOriginateCallerIdName':_0x43d2d4[_0x2d5c('0x57')],'dialOriginateCallerIdNumber':_0x43d2d4[_0x2d5c('0x58')],'dialOriginateTimeout':_0x43d2d4[_0x2d5c('0x59')],'dialPrefix':_0x43d2d4[_0x2d5c('0x5a')],'outboundAnswerAgiCallsDay':_0x43d2d4[_0x2d5c('0x5b')],'outboundAnswerCallsDay':_0x43d2d4[_0x2d5c('0x5c')],'outboundBlacklistCallsDay':_0x43d2d4[_0x2d5c('0x5d')],'outboundBusyCallsDay':_0x43d2d4[_0x2d5c('0x5e')],'outboundCongestionCallsDay':_0x43d2d4['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x43d2d4['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x43d2d4[_0x2d5c('0x5f')],'outboundDropCallsDayTimeout':_0x43d2d4['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x43d2d4[_0x2d5c('0x60')],'outboundNoSuchCallsDay':_0x43d2d4[_0x2d5c('0x61')],'outboundOriginateFailureCallsDay':_0x43d2d4[_0x2d5c('0x62')],'outboundReCallsDay':_0x43d2d4[_0x2d5c('0x63')],'outboundRejectCallsDay':_0x43d2d4[_0x2d5c('0x64')],'outboundUnknownCallsDay':_0x43d2d4[_0x2d5c('0x65')],'predictiveIntervalAnsweredCalls':_0x43d2d4[_0x2d5c('0x66')],'predictiveIntervalAvgHoldtime':_0x43d2d4['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x43d2d4[_0x2d5c('0x67')],'predictiveIntervalDroppedCallsCallersExit':_0x43d2d4['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x43d2d4[_0x2d5c('0x68')],'predictiveIntervalErlangCalls':_0x43d2d4['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x43d2d4[_0x2d5c('0x69')],'predictiveIntervalHitRate':_0x43d2d4[_0x2d5c('0x6a')],'predictiveIntervalMultiplicativeFactor':_0x43d2d4['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x43d2d4[_0x2d5c('0x6b')],'predictiveIntervalAvailable':_0x43d2d4[_0x2d5c('0x6c')],'predictiveIntervalTotalCalls':_0x43d2d4[_0x2d5c('0x6d')],'message':_0x43d2d4['message'],'originated':_0x43d2d4[_0x2d5c('0x6e')],'erlangCalls':_0x43d2d4[_0x2d5c('0x6f')],'erlangCallToSecond':_0x43d2d4[_0x2d5c('0x70')],'erlangAbandonmentRate':_0x43d2d4[_0x2d5c('0x71')],'erlangBusyFactor':_0x43d2d4[_0x2d5c('0x72')],'startPredictive':_0x43d2d4['startPredictive'],'startProgressive':_0x43d2d4['startProgressive']};if(_0x43d2d4['Trunk']){_0x2e8b9d[_0x2d5c('0x73')]={'id':_0x43d2d4[_0x2d5c('0x73')]['id'],'name':_0x43d2d4[_0x2d5c('0x73')][_0x2d5c('0x3a')],'active':_0x43d2d4[_0x2d5c('0x73')][_0x2d5c('0x74')],'callerid':_0x43d2d4[_0x2d5c('0x73')][_0x2d5c('0x75')]};}if(_0x43d2d4[_0x2d5c('0x3d')]){_0x2e8b9d[_0x2d5c('0x3d')]={'id':_0x43d2d4[_0x2d5c('0x3d')]['id'],'name':_0x43d2d4[_0x2d5c('0x3d')][_0x2d5c('0x3a')]};}var _0xfbc77e=md5(JSON[_0x2d5c('0x44')](_0x2e8b9d));if(_0x43d2d4[_0x2d5c('0x2')]!==_0xfbc77e){_0x43d2d4[_0x2d5c('0x2')]=_0xfbc77e;emit(util['format'](_0x2d5c('0x76'),_0x2e8b9d['name']),_0x2d5c('0x77'),_0x2e8b9d);}}}function emitCampaignSummary(_0x4cc143){if(_0x4cc143['type']===_0x2d5c('0x78')){emit(util[_0x2d5c('0x79')]('campaign:ivr:%s',_0x4cc143[_0x2d5c('0x3a')]),_0x2d5c('0x7a'),_0x4cc143);}}function checkGetDataPredictive(_0x5ec12a){if(isNotNull(_0x5ec12a)){if(!_[_0x2d5c('0x7b')](_0x5ec12a)){loggerPredictive[_0x2d5c('0x7c')](_0x2d5c('0x7d'));loggerPredictive[_0x2d5c('0x7c')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5ec12a[_0x2d5c('0x6d')]);loggerPredictive['info'](_0x2d5c('0x7e'),_0x5ec12a['predictiveIntervalAnsweredCalls']);loggerPredictive[_0x2d5c('0x7c')](_0x2d5c('0x7f'),_0x5ec12a[_0x2d5c('0x68')]);loggerPredictive[_0x2d5c('0x7c')](_0x2d5c('0x80'),_0x5ec12a['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x2d5c('0x7c')](_0x2d5c('0x81'),_0x5ec12a[_0x2d5c('0x82')]);loggerPredictive[_0x2d5c('0x7c')](_0x2d5c('0x83'),_0x5ec12a[_0x2d5c('0x67')]);loggerPredictive[_0x2d5c('0x7c')](_0x2d5c('0x84'));if(_0x5ec12a[_0x2d5c('0x6d')]>0x0){if(!_['isUndefined'](_0x5ec12a[_0x2d5c('0x67')])&&_0x5ec12a[_0x2d5c('0x67')]>0x0){return!![];}else{loggerPredictive['info'](_0x2d5c('0x85'));}if(!_[_0x2d5c('0x38')](_0x5ec12a['predictiveIntervalAvgHoldtime'])&&_0x5ec12a[_0x2d5c('0x82')]>0x0){return!![];}else{loggerPredictive[_0x2d5c('0x7c')](_0x2d5c('0x86'));}}else{loggerPredictive['info'](_0x2d5c('0x87'));}}else{loggerPredictive[_0x2d5c('0x7c')](_0x2d5c('0x88'));}}else{loggerPredictive[_0x2d5c('0x7c')](_0x2d5c('0x88'));}return![];}function mergeDataErlangB(_0x530768){return function(_0x329cd9){loggerPredictive[_0x2d5c('0x7c')](_0x2d5c('0x89'));loggerPredictive[_0x2d5c('0x7c')](_0x2d5c('0x8a'),_0x329cd9['erlangCalls']);loggerPredictive[_0x2d5c('0x7c')](_0x2d5c('0x8b'),_0x329cd9['erlangCallToSecond']);loggerPredictive[_0x2d5c('0x7c')](_0x2d5c('0x8c'),_0x329cd9['erlangAbandonmentRate']);loggerPredictive['info'](_0x2d5c('0x8d'),_0x329cd9['erlangBusyFactor']);loggerPredictive['info'](_0x2d5c('0x8c'),_0x329cd9['erlangAbandonmentRate']);loggerPredictive[_0x2d5c('0x7c')](_0x2d5c('0x84'));_[_0x2d5c('0x8e')](_0x530768,_0x329cd9);};}function getDiff(_0x51875f){var _0x1c48be=moment()[_0x2d5c('0x45')](0x0);var _0x57847f=moment(_0x51875f)['milliseconds'](0x0);return _0x1c48be[_0x2d5c('0x8f')](_0x57847f,_0x2d5c('0x46'));}function ifInterval(_0x17bf74,_0x2686a3){if(_[_0x2d5c('0x38')](_0x2686a3)){return![];}if(getDiff(_0x2686a3)<_0x17bf74*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x297c1d){if(isNotNull(_0x297c1d)){if(!_[_0x2d5c('0x38')](_0x297c1d[_0x2d5c('0x28')])){_0x297c1d['startProgressive']=undefined;loggerPredictive[_0x2d5c('0x7c')](_0x297c1d[_0x2d5c('0x3a')],_0x2d5c('0x90'));}if(!_[_0x2d5c('0x38')](_0x297c1d[_0x2d5c('0x27')])){_0x297c1d['startPredictive']=undefined;loggerPredictive[_0x2d5c('0x7c')](_0x297c1d[_0x2d5c('0x3a')],_0x2d5c('0x91'));}if(!_['isUndefined'](_0x297c1d[_0x2d5c('0x92')])){clearInterval(_0x297c1d['handlePredictive']);_0x297c1d[_0x2d5c('0x92')]=undefined;loggerPredictive[_0x2d5c('0x7c')](_0x297c1d['name'],_0x2d5c('0x93'));}}}function erlangb(_0x449472,_0x39157f){if(_0x39157f===0x0){return 0x0;}var _0x13ea4a=0x1;for(var _0x429f5d=0x1;_0x429f5d<=_0x39157f;_0x429f5d+=0x1){_0x13ea4a=0x1+_0x13ea4a*_0x429f5d/_0x449472;}return 0x1/_0x13ea4a;}function isVoiceQueueOutbound(_0x26fdd6){return _0x26fdd6==='outbound';}function isNotPreview(_0x5b68be){return _0x5b68be!==_0x2d5c('0x20');}function isCampaignIvr(_0x5c27d8){return _0x5c27d8===_0x2d5c('0x78');}function getCallerId(_0x453efe,_0x320e0f,_0x191014){if(!_[_0x2d5c('0x38')](_0x191014)&&_0x2d5c('0x94')===typeof _0x191014&&!_[_0x2d5c('0x7b')](_0x191014)){if(!_[_0x2d5c('0x38')](_0x320e0f)&&'string'===typeof _0x320e0f&&!_[_0x2d5c('0x7b')](_0x320e0f)){return util[_0x2d5c('0x79')]('\x22%s\x22\x20<%s>',_0x320e0f,_0x191014);}return util[_0x2d5c('0x79')](_0x2d5c('0x95'),_0x191014,_0x191014);}if(!_['isUndefined'](_0x453efe)&&_0x2d5c('0x94')===typeof _0x453efe&&!_[_0x2d5c('0x7b')](_0x453efe)){return _0x453efe;}return _0x2d5c('0x96');}function loggerCatchQueueSummary(_0x513ac1,_0x1aa447){return function(_0x4851cb){freeVariablesPredictive(_0x1aa447);emitVoiceQueueSummary(_0x1aa447);emitCampaignSummary(_0x1aa447);loggerSyncQueueSummary[_0x2d5c('0x97')](_0x513ac1,util[_0x2d5c('0x98')](_0x4851cb,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x29ff96,_0x1d9015){return function(_0xd014d8){loggerPredictive[_0x2d5c('0x97')](_0x1d9015[_0x2d5c('0x3a')],_0x29ff96);loggerPredictive['error'](_0xd014d8[_0x2d5c('0x99')]);freeVariablesPredictive(_0x1d9015);};}function loggerCatch(_0x2dfc7b){return function(_0x5bf8f1){logger[_0x2d5c('0x97')](_0x2dfc7b,util[_0x2d5c('0x98')](_0x5bf8f1,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x1bb7c8){return _0x1bb7c8&&!_[_0x2d5c('0x38')](_0x1bb7c8)&&_0x1bb7c8[_0x2d5c('0x9a')]>0x0;}function decremetOriginate(_0x49bdf6){if(!_['isUndefined'](_0x49bdf6)&&_0x49bdf6!==null){if(_0x49bdf6[_0x2d5c('0x9b')](_0x2d5c('0x6e'))){if(_0x49bdf6[_0x2d5c('0x6e')]>0x0){_0x49bdf6[_0x2d5c('0x6e')]-=0x1;}else{logger['error']('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x2d5c('0x97')](_0x2d5c('0x9c'));}}function checkContactLowerLimitOriginate(_0x316e94,_0x2cc2e3,_0x299864){if(_0x2cc2e3>_0x299864){for(var _0x28db0f=0x0;_0x28db0f<_0x2cc2e3-_0x299864;_0x28db0f+=0x1){decremetOriginate(_0x316e94);}}}function loggerGetContactDialer(_0x223e22,_0xf75af7,_0x27c1d7){return function(_0x1dafa6){checkContactLowerLimitOriginate(_0xf75af7,_0x27c1d7,0x0);logger['error'](_0x223e22,util[_0x2d5c('0x98')](_0x1dafa6,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x34c7d7){return function(_0x58ac86){if(isNotNull(_0x58ac86)&&isNotNull(_0x58ac86[0x0])){if(_0x58ac86[0x0][_0x2d5c('0x9d')]>0x0){_0x34c7d7['message']='RESCHEDULED_CONTACTS';logger[_0x2d5c('0x7c')]('[getContactDialer2][ReScheduled]'+_0x34c7d7[_0x2d5c('0x3a')],_0x58ac86[0x0][_0x2d5c('0x9d')],'contacts');}else{_0x34c7d7[_0x2d5c('0x41')]=_0x2d5c('0x9e');logger[_0x2d5c('0x7c')](_0x2d5c('0x9f')+_0x34c7d7[_0x2d5c('0x3a')]);}}};}function notSendMessagesQueue(_0x56f463){if(_0x56f463[_0x2d5c('0xa0')]){freeVariablesPredictive(_0x56f463);if(_0x56f463[_0x2d5c('0x6e')]===0x0&&_0x56f463[_0x2d5c('0xa1')]===0x0&&_0x56f463[_0x2d5c('0x53')]===0x0&&(_0x56f463[_0x2d5c('0x4c')]||0x0)===0x0){_0x56f463[_0x2d5c('0xa0')]=![];_0x56f463[_0x2d5c('0x4b')]=0x0;_0x56f463[_0x2d5c('0x41')]='NOT_ACTIVE';loggerSyncQueueSummary[_0x2d5c('0x97')](_0x2d5c('0xa2'),_0x56f463[_0x2d5c('0x3a')],'is\x20not\x20active');}else{_0x56f463[_0x2d5c('0x41')]=_0x2d5c('0xa3');loggerSyncQueueSummary[_0x2d5c('0x97')](_0x2d5c('0xa2'),_0x56f463[_0x2d5c('0x3a')],'is\x20disactive');}emitVoiceQueueSummary(_0x56f463);}}function notSendMessagesCampaign(_0x5d0b76){if(_0x5d0b76[_0x2d5c('0xa0')]){if(_0x5d0b76[_0x2d5c('0x6e')]===0x0){_0x5d0b76[_0x2d5c('0xa0')]=![];_0x5d0b76['message']=_0x2d5c('0x3b');loggerSyncQueueSummary[_0x2d5c('0x97')](_0x2d5c('0xa4'),_0x5d0b76['name'],_0x2d5c('0xa5'));}else{_0x5d0b76[_0x2d5c('0x41')]=_0x2d5c('0xa3');loggerSyncQueueSummary[_0x2d5c('0x97')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x5d0b76[_0x2d5c('0x3a')],_0x2d5c('0xa6'));}emitCampaignSummary(_0x5d0b76);}}function createObjHistory(_0x1a76e7,_0x1e9451,_0x4d96b7,_0x315cae,_0x4a75ac){_0x1a76e7[_0x2d5c('0x41')]=_0x4d96b7;var _0x490d72=new Action(_0x1a76e7,_0x1e9451);var _0x213524=new History(_0x490d72);_0x213524[_0x2d5c('0xa7')]=_0x315cae;_0x213524['statedesc']=_0x4a75ac;_0x213524['endtime']=_0x490d72[_0x2d5c('0xa8')];return _0x213524;}Dialer[_0x2d5c('0x1c')][_0x2d5c('0xa9')]=function(){var _0x12c9e4=this;setInterval(function(){_0x12c9e4[_0x2d5c('0xaa')](_0x12c9e4[_0x2d5c('0x26')],_0x2d5c('0xab'));_0x12c9e4[_0x2d5c('0xaa')](_0x12c9e4[_0x2d5c('0x25')],_0x2d5c('0xac'));},0x32c8);};Dialer[_0x2d5c('0x1c')]['clearZombieChannels']=function(_0x40c245,_0x446a58){var _0x4454d7=this;for(var _0xac17d7 in _0x40c245){if(_0x40c245[_0x2d5c('0x9b')](_0xac17d7)){this['sequence']['enqueue'](function(){if(!_[_0x2d5c('0xad')](_0x40c245[_0xac17d7])){return ami[_0x2d5c('0xae')]({'action':_0x2d5c('0xaf'),'channel':_0x40c245[_0xac17d7][_0x2d5c('0xb0')]})['catch'](function(_0x69b277){if(_0x69b277[_0x2d5c('0x41')]===_0x2d5c('0xb1')){setTimeout(function(){if(_0x40c245[_0xac17d7]&&_0x40c245[_0xac17d7][_0x2d5c('0x48')]!==_0x2d5c('0x78')){_0x4454d7[_0x2d5c('0xb2')](_0x4454d7['voiceQueues'][_0x40c245[_0xac17d7][_0x2d5c('0xb3')]]);logger['error'](_0x2d5c('0xb4'),_0x446a58,_0xac17d7,_0x40c245[_0xac17d7][_0x2d5c('0xb3')]);delete _0x40c245[_0xac17d7];}if(_0x40c245[_0xac17d7]&&_0x40c245[_0xac17d7][_0x2d5c('0x48')]==='ivr'){_0x4454d7[_0x2d5c('0xb2')](_0x4454d7['campaigns'][_0x40c245[_0xac17d7]['queue']]);logger[_0x2d5c('0x97')](_0x2d5c('0xb5'),_0x446a58,_0xac17d7,_0x40c245[_0xac17d7]['queue']);delete _0x40c245[_0xac17d7];}},0x2328);}});}});}}};Dialer['prototype'][_0x2d5c('0xb6')]=function(_0x4a6cf9){return BPromise[_0x2d5c('0xb7')]()[_0x2d5c('0xb8')](cmHopper[_0x2d5c('0xb6')](_0x4a6cf9))['catch'](loggerCatch(_0x2d5c('0xb9')));};Dialer['prototype'][_0x2d5c('0xba')]=function(_0x4b8b40){return BPromise['resolve']()[_0x2d5c('0xb8')](cmHopperBlack[_0x2d5c('0xba')](_0x4b8b40))[_0x2d5c('0xbb')](loggerCatch(_0x2d5c('0xbc')));};Dialer[_0x2d5c('0x1c')][_0x2d5c('0xbd')]=function(_0x46c39f){return BPromise[_0x2d5c('0xb7')]()[_0x2d5c('0xb8')](cmHopperBlack[_0x2d5c('0xbd')](_0x46c39f))[_0x2d5c('0xbb')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer['prototype']['averageHandleTime']=function(_0x77d06a){return BPromise['resolve']()[_0x2d5c('0xb8')](cmHopperHistory[_0x2d5c('0xbe')](_0x77d06a))[_0x2d5c('0xbb')](loggerCatch(_0x2d5c('0xbf')));};Dialer[_0x2d5c('0x1c')]['rescheduleContact']=function(_0x35b595){return BPromise[_0x2d5c('0xb7')]()[_0x2d5c('0xb8')](cmHopper['rescheduleContact'](_0x35b595))[_0x2d5c('0xbb')](loggerCatch(_0x2d5c('0xc0')));};Dialer['prototype'][_0x2d5c('0xc1')]=function(_0x4c8a3d,_0x22f8fa,_0x61dfd6,_0x4744e6){return BPromise[_0x2d5c('0xb7')]()[_0x2d5c('0xb8')](cmHopper[_0x2d5c('0xc1')](_0x4c8a3d,_0x22f8fa,_0x61dfd6,_0x4744e6))[_0x2d5c('0xbb')](loggerCatch('[getContactDialer]\x20'));};Dialer['prototype'][_0x2d5c('0xc2')]=function(_0x32b548,_0x28ff24,_0x2f8bce){return BPromise[_0x2d5c('0xb7')]()[_0x2d5c('0xb8')](cmHopper[_0x2d5c('0xc2')](_0x32b548,_0x28ff24,_0x2f8bce))[_0x2d5c('0xbb')](loggerCatch(_0x2d5c('0xc3')));};Dialer[_0x2d5c('0x1c')]['getVoiceQueueRtPauses']=function(_0x448a01){return BPromise[_0x2d5c('0xb7')]()[_0x2d5c('0xb8')](voiceQueueRt['getVoiceQueueRtPauses'](_0x448a01))['catch'](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0x2d5c('0x1c')][_0x2d5c('0xc4')]=function(_0x573c55){return BPromise[_0x2d5c('0xb7')]()[_0x2d5c('0xb8')](cmHopper[_0x2d5c('0xc4')](_0x573c55))[_0x2d5c('0xbb')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0x2d5c('0x1c')]['createHistory']=function(_0x201790){return BPromise['resolve']()[_0x2d5c('0xb8')](cmHopperHistory[_0x2d5c('0xc5')](_0x201790))['catch'](loggerCatch(_0x2d5c('0xc6')));};Dialer['prototype'][_0x2d5c('0xb2')]=function(_0x359bcd){if(!_[_0x2d5c('0x38')](_0x359bcd)&&_0x359bcd!==null){if(_0x359bcd[_0x2d5c('0x9b')]('originated')){if(_0x359bcd[_0x2d5c('0x6e')]>0x0){_0x359bcd[_0x2d5c('0x6e')]-=0x1;}else{logger['error'](_0x2d5c('0xc7'));}}}else{logger[_0x2d5c('0x97')](_0x2d5c('0xc8'));}};Dialer[_0x2d5c('0x1c')][_0x2d5c('0xc9')]=function(_0x1f819d,_0x123127){var _0x56c8a5=this;return function(_0x10d7b0){_0x56c8a5[_0x2d5c('0xb2')](_0x123127);logger[_0x2d5c('0x97')](_0x1f819d,util[_0x2d5c('0x98')](_0x10d7b0,{'showHidden':![],'depth':null}));};};Dialer[_0x2d5c('0x1c')][_0x2d5c('0xca')]=function(_0x3261f7,_0x3fb914,_0x2fd47e){var _0x43ca68={'state':0x19,'statedesc':'notFound'};this[_0x2d5c('0xb2')](_0x3fb914);this[_0x2d5c('0xcb')](_[_0x2d5c('0x8e')](_0x43ca68,_[_0x2d5c('0xcc')](_0x2fd47e,[_0x2d5c('0xcd'),_0x2d5c('0xce'),_0x2d5c('0xcf'),_0x2d5c('0xd0'),_0x2d5c('0xd1')])),_0x2d5c('0xd2'),_0x2d5c('0xd3'));logger[_0x2d5c('0x97')](_0x3261f7);};Dialer[_0x2d5c('0x1c')][_0x2d5c('0xd4')]=function(_0xd5223b){return _0xd5223b===_0x2d5c('0xd5');};Dialer['prototype'][_0x2d5c('0xd6')]=function(_0x33cf7b){return!_[_0x2d5c('0x38')](_0x33cf7b)&&_0x33cf7b&&!_[_0x2d5c('0x38')](_0x33cf7b[_0x2d5c('0x3a')])&&!_[_0x2d5c('0x38')](_0x33cf7b[_0x2d5c('0x74')])&&_0x33cf7b[_0x2d5c('0x74')]&&(this[_0x2d5c('0x24')][util['format'](_0x2d5c('0xd7'),_0x33cf7b['name'])]['status']===_0x2d5c('0xd8')||this[_0x2d5c('0x24')][util[_0x2d5c('0x79')]('SIP/%s',_0x33cf7b['name'])]['status']===_0x2d5c('0xd9'));};Dialer[_0x2d5c('0x1c')][_0x2d5c('0xcb')]=function(_0x59faab,_0x59485a,_0x2662bb){this[_0x2d5c('0xc5')](_0x59faab)[_0x2d5c('0xbb')](loggerCatch(_0x59485a));this[_0x2d5c('0xc4')](_0x59faab)[_0x2d5c('0xbb')](loggerCatch(_0x2662bb));};Dialer[_0x2d5c('0x1c')][_0x2d5c('0xda')]=function(_0x3083ba){var _0x45977e=this[_0x2d5c('0x26')][_0x3083ba[_0x2d5c('0xdb')]];var _0x12f51f;if(!_[_0x2d5c('0xad')](_0x3083ba)&&!_['isNil'](_0x3083ba[_0x2d5c('0xdc')])&&!_[_0x2d5c('0xad')](_0x3083ba['variable']['amdstatus'])&&_0x3083ba[_0x2d5c('0xdd')]===_0x2d5c('0xde')&&_0x45977e){if(_0x45977e[_0x2d5c('0x48')]!==_0x2d5c('0x78')&&this[_0x2d5c('0x21')][_0x45977e[_0x2d5c('0xb3')]][_0x2d5c('0xdf')]&&_0x3083ba['value']===_0x2d5c('0xe0')){delete this[_0x2d5c('0x26')][_0x3083ba[_0x2d5c('0xdb')]];this[_0x2d5c('0xb2')](this['voiceQueues'][_0x45977e[_0x2d5c('0xb3')]]);this[_0x2d5c('0x21')][_0x45977e['queue']][_0x2d5c('0x5c')]+=0x1;this[_0x2d5c('0x21')][_0x45977e['queue']][_0x2d5c('0x5b')]+=0x1;_0x12f51f=new Hangup(_0x45977e,_0x3083ba);_0x12f51f[_0x2d5c('0xa7')]=0x12;_0x12f51f[_0x2d5c('0xe1')]=_0x2d5c('0xe2');_0x12f51f[_0x2d5c('0xe3')]=_0x2d5c('0xe4');this['saveInDb'](_0x12f51f,'[syncHangupInAMD][createHistory]',_0x2d5c('0xe5'));}if(_0x45977e[_0x2d5c('0x48')]!==_0x2d5c('0x78')&&this['voiceQueues'][_0x45977e[_0x2d5c('0xb3')]][_0x2d5c('0xdf')]&&_0x3083ba[_0x2d5c('0xe6')]===_0x2d5c('0xe7')){delete this[_0x2d5c('0x26')][_0x3083ba[_0x2d5c('0xdb')]];this['updateOriginated'](this[_0x2d5c('0x21')][_0x45977e[_0x2d5c('0xb3')]]);this[_0x2d5c('0x21')][_0x45977e[_0x2d5c('0xb3')]][_0x2d5c('0x5c')]+=0x1;this[_0x2d5c('0x21')][_0x45977e[_0x2d5c('0xb3')]][_0x2d5c('0x5b')]+=0x1;_0x12f51f=new Hangup(_0x45977e,_0x3083ba);_0x12f51f[_0x2d5c('0xa7')]=0x13;_0x12f51f['statedesc']=_0x2d5c('0xe8');_0x12f51f['membername']=_0x2d5c('0xe4');_0x12f51f[_0x2d5c('0xe9')]=!![];this['saveInDb'](_0x12f51f,_0x2d5c('0xea'),_0x2d5c('0xeb'));}if(_0x45977e['type']==='ivr'&&this['campaigns'][_0x45977e['queue']]['dialAMDActive']&&_0x3083ba[_0x2d5c('0xe6')]===_0x2d5c('0xe0')){delete this[_0x2d5c('0x26')][_0x3083ba['uniqueid']];this[_0x2d5c('0xb2')](this[_0x2d5c('0x22')][_0x45977e[_0x2d5c('0xb3')]]);_0x12f51f=new Hangup(_0x45977e,_0x3083ba);_0x12f51f[_0x2d5c('0xa7')]=0x12;_0x12f51f[_0x2d5c('0xe1')]=_0x2d5c('0xe2');_0x12f51f[_0x2d5c('0xe3')]=_0x2d5c('0xe4');this['saveInDb'](_0x12f51f,_0x2d5c('0xec'),_0x2d5c('0xed'));}if(_0x45977e['type']===_0x2d5c('0x78')&&this[_0x2d5c('0x22')][_0x45977e['queue']][_0x2d5c('0xdf')]&&_0x3083ba[_0x2d5c('0xe6')]===_0x2d5c('0xe7')){delete this[_0x2d5c('0x26')][_0x3083ba[_0x2d5c('0xdb')]];this[_0x2d5c('0xb2')](this[_0x2d5c('0x22')][_0x45977e[_0x2d5c('0xb3')]]);_0x12f51f=new Hangup(_0x45977e,_0x3083ba);_0x12f51f['state']=0x13;_0x12f51f[_0x2d5c('0xe1')]=_0x2d5c('0xe8');_0x12f51f[_0x2d5c('0xe3')]=_0x2d5c('0xe4');_0x12f51f[_0x2d5c('0xe9')]=!![];this[_0x2d5c('0xcb')](_0x12f51f,_0x2d5c('0xee'),_0x2d5c('0xef'));}}};Dialer['prototype']['syncHangup']=function(_0x8be6ef){var _0x4abcb2=this[_0x2d5c('0x26')][_0x8be6ef[_0x2d5c('0xdb')]];var _0x2c2f11=this;var _0x2a7a7d;if(_0x4abcb2&&_0x4abcb2[_0x2d5c('0x48')]==='ivr'){delete this[_0x2d5c('0x26')][_0x8be6ef[_0x2d5c('0xdb')]];this['updateOriginated'](this[_0x2d5c('0x22')][_0x4abcb2[_0x2d5c('0xb3')]]);this['campaigns'][_0x4abcb2[_0x2d5c('0xb3')]][_0x2d5c('0xf0')]+=0x1;_0x2a7a7d=new Hangup(_0x4abcb2,_0x8be6ef);this[_0x2d5c('0xc5')](_0x2a7a7d)['catch'](loggerCatch(_0x2d5c('0xf1')));this[_0x2d5c('0xc4')](_0x2a7a7d)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0x4abcb2&&_0x4abcb2['type']!==_0x2d5c('0x78')&&isNotNull(this[_0x2d5c('0x21')][_0x4abcb2[_0x2d5c('0xb3')]][_0x2d5c('0xf2')])){delete this[_0x2d5c('0x26')][_0x8be6ef[_0x2d5c('0xdb')]];this[_0x2d5c('0xb2')](this[_0x2d5c('0x21')][_0x4abcb2[_0x2d5c('0xb3')]]);this[_0x2d5c('0x21')][_0x4abcb2['queue']][_0x2d5c('0x5c')]+=0x1;this['voiceQueues'][_0x4abcb2[_0x2d5c('0xb3')]][_0x2d5c('0x5b')]+=0x1;_0x2a7a7d=new Hangup(_0x4abcb2,_0x8be6ef);_0x2a7a7d[_0x2d5c('0xa7')]=0x10;_0x2a7a7d[_0x2d5c('0xe1')]=_0x2d5c('0xf3');_0x2a7a7d[_0x2d5c('0xe3')]=_0x2d5c('0xf4');this[_0x2d5c('0xc5')](_0x2a7a7d)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x2d5c('0xc4')](_0x2a7a7d)[_0x2d5c('0xbb')](loggerCatch(_0x2d5c('0xf5')));}if(_0x4abcb2&&_0x4abcb2[_0x2d5c('0x48')]!==_0x2d5c('0x78')&&!isNotNull(this[_0x2d5c('0x21')][_0x4abcb2['queue']][_0x2d5c('0xf2')])){delete this['uniqueId'][_0x8be6ef['uniqueid']];this[_0x2d5c('0xb2')](this[_0x2d5c('0x21')][_0x4abcb2[_0x2d5c('0xb3')]]);this[_0x2d5c('0x21')][_0x4abcb2[_0x2d5c('0xb3')]][_0x2d5c('0x65')]+=0x1;_0x2a7a7d=new Hangup(_0x4abcb2,_0x8be6ef);_0x2a7a7d[_0x2d5c('0xa7')]=0xc;_0x2a7a7d[_0x2d5c('0xe1')]=_0x8be6ef['cause-txt'];_0x2a7a7d[_0x2d5c('0xe3')]='Unknow';this[_0x2d5c('0xc5')](_0x2a7a7d)[_0x2d5c('0xbb')](loggerCatch(_0x2d5c('0xf1')));this[_0x2d5c('0xc4')](_0x2a7a7d)[_0x2d5c('0xbb')](loggerCatch(_0x2d5c('0xf5')));}};Dialer['prototype']['syncAgentComplete']=function(_0x289984){var _0x427f81=this[_0x2d5c('0x26')][_0x289984[_0x2d5c('0xdb')]];var _0x3e46b1=this;if(this[_0x2d5c('0x21')][_0x289984['queue']]){if(_0x427f81&&_0x427f81['type']!==_0x2d5c('0x78')){delete this[_0x2d5c('0x26')][_0x289984[_0x2d5c('0xdb')]];this[_0x2d5c('0x21')][_0x289984['queue']][_0x2d5c('0x5c')]+=0x1;var _0x118c5c=new AgentComplete(_0x427f81,_0x289984);if(_0x289984['reason']===_0x2d5c('0xf6')){_0x118c5c[_0x2d5c('0xf7')]=this[_0x2d5c('0x21')][_0x289984[_0x2d5c('0xb3')]][_0x2d5c('0xf8')]&&this[_0x2d5c('0x21')][_0x289984[_0x2d5c('0xb3')]][_0x2d5c('0xf9')]?moment()[_0x2d5c('0x79')](_0x2d5c('0xfa')):undefined;}this[_0x2d5c('0xc5')](_0x118c5c)[_0x2d5c('0xbb')](loggerCatch(_0x2d5c('0xfb')));this[_0x2d5c('0xc4')](_0x118c5c)[_0x2d5c('0xbb')](loggerCatch(_0x2d5c('0xfc')));}}};Dialer[_0x2d5c('0x1c')][_0x2d5c('0xfd')]=function(_0x545d86){if(this[_0x2d5c('0x21')][_0x545d86[_0x2d5c('0xb3')]]){if(this[_0x2d5c('0x26')][_0x545d86[_0x2d5c('0xdb')]]&&this[_0x2d5c('0x26')][_0x545d86['uniqueid']][_0x2d5c('0x48')]!=='ivr'){this[_0x2d5c('0xb2')](this['voiceQueues'][_0x545d86[_0x2d5c('0xb3')]]);this['uniqueId'][_0x545d86[_0x2d5c('0xdb')]][_0x2d5c('0xfe')]=moment()[_0x2d5c('0x79')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0x2d5c('0x1c')][_0x2d5c('0xff')]=function(_0x51c4b1){this[_0x2d5c('0xc5')](_0x51c4b1)[_0x2d5c('0xbb')](loggerCatch(_0x2d5c('0xfb')));this[_0x2d5c('0xc4')](_0x51c4b1)['catch'](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer[_0x2d5c('0x1c')][_0x2d5c('0x2c')]=function(_0x2680da){var _0x2828f7=this[_0x2d5c('0x26')][_0x2680da[_0x2d5c('0xdb')]];var _0x4e3a66=this;if(this[_0x2d5c('0x21')][_0x2680da[_0x2d5c('0xb3')]]){if(_0x2828f7&&_0x2828f7[_0x2d5c('0x48')]!=='ivr'){delete this[_0x2d5c('0x26')][_0x2680da['uniqueid']];this[_0x2d5c('0xb2')](this['voiceQueues'][_0x2680da[_0x2d5c('0xb3')]]);_0x2828f7[_0x2d5c('0x100')]=moment()[_0x2d5c('0x79')](_0x2d5c('0xfa'));var _0x263f4b=new QueueCallerAbandon(_0x2828f7,_0x2680da);if(getSeconds(_0x2828f7[_0x2d5c('0x100')],_0x2828f7[_0x2d5c('0x101')])>=_0x2828f7[_0x2d5c('0x102')]){this[_0x2d5c('0x21')][_0x2680da[_0x2d5c('0xb3')]][_0x2d5c('0x68')]+=0x1;this['voiceQueues'][_0x2680da['queue']][_0x2d5c('0x103')]+=0x1;this[_0x2d5c('0x21')][_0x2680da[_0x2d5c('0xb3')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x263f4b['state']=0xa;_0x263f4b[_0x2d5c('0xe1')]=_0x2d5c('0x104');_0x263f4b[_0x2d5c('0x105')]=_0x2d5c('0x106');_0x263f4b[_0x2d5c('0xf7')]=this[_0x2d5c('0x21')][_0x2680da[_0x2d5c('0xb3')]]['dialQueueProject2']?moment()[_0x2d5c('0x79')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;this[_0x2d5c('0xff')](_0x263f4b);}else{this[_0x2d5c('0x21')][_0x2680da[_0x2d5c('0xb3')]][_0x2d5c('0x107')]+=0x1;this[_0x2d5c('0x21')][_0x2680da[_0x2d5c('0xb3')]][_0x2d5c('0x5f')]+=0x1;_0x263f4b[_0x2d5c('0xa7')]=0xb;_0x263f4b['statedesc']=_0x2d5c('0x108');_0x263f4b[_0x2d5c('0x105')]='CALLEREXIT';this[_0x2d5c('0xff')](_0x263f4b);}}}};Dialer['prototype'][_0x2d5c('0x34')]=function(_0x46b3d8){if(this[_0x2d5c('0x25')][_0x46b3d8[_0x2d5c('0xdb')]]){this[_0x2d5c('0x25')][_0x46b3d8[_0x2d5c('0xdb')]][_0x2d5c('0xb0')]=_0x46b3d8[_0x2d5c('0xb0')];}if(this[_0x2d5c('0x26')][_0x46b3d8[_0x2d5c('0xdb')]]){this[_0x2d5c('0x26')][_0x46b3d8[_0x2d5c('0xdb')]][_0x2d5c('0xb0')]=_0x46b3d8['channel'];}};Dialer['prototype']['syncQueueMember']=function(_0x260728){if(strategy[this[_0x2d5c('0x21')][this['actions'][_0x260728[_0x2d5c('0x109')]][_0x2d5c('0xb3')]][_0x2d5c('0x49')]]===_0x2d5c('0x10a')){if(this['actions'][_0x260728['actionid']]&&_[_0x2d5c('0xad')](this['actions'][_0x260728[_0x2d5c('0x109')]][_0x2d5c('0x10b')])&&_0x260728[_0x2d5c('0xaf')]==='1'&&_0x260728[_0x2d5c('0x10c')]==='0'){if(this[_0x2d5c('0x23')][_0x260728[_0x2d5c('0x10d')]]){if(!this['agents'][_0x260728[_0x2d5c('0x10d')]]['locked']){this[_0x2d5c('0x23')][_0x260728['stateinterface']][_0x2d5c('0x10b')]=!![];this[_0x2d5c('0x25')][_0x260728['actionid']][_0x2d5c('0x10b')]=!![];this[_0x2d5c('0x25')][_0x260728[_0x2d5c('0x109')]]['stateinterface']=_0x260728[_0x2d5c('0x10d')];}}}}else if((strategy[this[_0x2d5c('0x21')][this['actions'][_0x260728[_0x2d5c('0x109')]][_0x2d5c('0xb3')]][_0x2d5c('0x49')]]||_0x2d5c('0x10e'))==='rrmemory'){if(this['actions'][_0x260728[_0x2d5c('0x109')]]){if(this[_0x2d5c('0x23')][_0x260728['stateinterface']]){this[_0x2d5c('0x25')][_0x260728[_0x2d5c('0x109')]][_0x2d5c('0x10d')]=_0x260728['stateinterface'];if(_[_0x2d5c('0xad')](this[_0x2d5c('0x29')][this['actions'][_0x260728[_0x2d5c('0x109')]][_0x2d5c('0xb3')]])){this['queueBooked'][this[_0x2d5c('0x25')][_0x260728[_0x2d5c('0x109')]][_0x2d5c('0xb3')]]=[];}this[_0x2d5c('0x29')][this[_0x2d5c('0x25')][_0x260728[_0x2d5c('0x109')]][_0x2d5c('0xb3')]]['push'](_[_0x2d5c('0x8e')](_[_0x2d5c('0xcc')](this['actions'][_0x260728[_0x2d5c('0x109')]],[_0x2d5c('0x10f'),_0x2d5c('0x10d')]),{'status':_0x260728[_0x2d5c('0xaf')],'paused':_0x260728['paused']}));}}}};function unlockQueueStatus(_0x49b1dc,_0x5b6689){setTimeout(function(){if(_['isUndefined'](_0x49b1dc['queueStatusComplete'])){loggerBooked[_0x2d5c('0x97')](_0x2d5c('0x110'),_0x5b6689);}_0x49b1dc[_0x2d5c('0x111')]=!![];loggerBooked[_0x2d5c('0x7c')](_0x2d5c('0x112'),_0x5b6689,JSON['stringify'](_[_0x2d5c('0xcc')](_0x49b1dc,['name',_0x2d5c('0x111')])));},0x1f3);}Dialer['prototype'][_0x2d5c('0x36')]=function(_0x507dcb){var _0x166750=this;var _0x4be176=_0x166750[_0x2d5c('0x21')][_0x166750[_0x2d5c('0x25')][_0x507dcb[_0x2d5c('0x109')]][_0x2d5c('0xb3')]];if(strategy[this[_0x2d5c('0x21')][this[_0x2d5c('0x25')][_0x507dcb[_0x2d5c('0x109')]][_0x2d5c('0xb3')]][_0x2d5c('0x49')]]==='roundrobin'){if(this[_0x2d5c('0x25')][_0x507dcb[_0x2d5c('0x109')]]&&this[_0x2d5c('0x25')][_0x507dcb['actionid']]['stateinterface']){this['preview'][_0x2d5c('0x113')](this[_0x2d5c('0x25')][_0x507dcb[_0x2d5c('0x109')]][_0x2d5c('0x10f')],this[_0x2d5c('0x25')][_0x507dcb[_0x2d5c('0x109')]][_0x2d5c('0x10d')])[_0x2d5c('0xbb')](function(_0x36dd76){logger['error'](_0x2d5c('0x114'),util[_0x2d5c('0x98')](_0x36dd76,{'showHidden':![],'depth':null}));})[_0x2d5c('0x1e')](function(){_0x166750['updateOriginated'](_0x166750[_0x2d5c('0x21')][_0x166750[_0x2d5c('0x25')][_0x507dcb[_0x2d5c('0x109')]]['queue']]);_0x166750[_0x2d5c('0x23')][_0x166750[_0x2d5c('0x25')][_0x507dcb[_0x2d5c('0x109')]][_0x2d5c('0x10d')]]['locked']=![];delete _0x166750[_0x2d5c('0x25')][_0x507dcb['actionid']];unlockQueueStatus(_0x4be176);});}else{this['updateOriginated'](this['voiceQueues'][this[_0x2d5c('0x25')][_0x507dcb[_0x2d5c('0x109')]][_0x2d5c('0xb3')]]);this[_0x2d5c('0x115')]({'active':![],'ContactId':this[_0x2d5c('0x25')][_0x507dcb[_0x2d5c('0x109')]][_0x2d5c('0xcd')],'ListId':this[_0x2d5c('0x25')][_0x507dcb['actionid']][_0x2d5c('0xce')],'VoiceQueueId':this[_0x2d5c('0x25')][_0x507dcb[_0x2d5c('0x109')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x2d5c('0x25')][_0x507dcb['actionid']][_0x2d5c('0xd1')]||undefined})['catch'](loggerCatch(_0x2d5c('0x116')));delete this[_0x2d5c('0x25')][_0x507dcb['actionid']];unlockQueueStatus(_0x4be176);}}else if((strategy[this[_0x2d5c('0x21')][this[_0x2d5c('0x25')][_0x507dcb[_0x2d5c('0x109')]][_0x2d5c('0xb3')]][_0x2d5c('0x49')]]||'rrmemory')===_0x2d5c('0x10e')){var _0x347b54;if(this[_0x2d5c('0x25')][_0x507dcb[_0x2d5c('0x109')]]&&!_['isEmpty'](this[_0x2d5c('0x29')][this[_0x2d5c('0x25')][_0x507dcb[_0x2d5c('0x109')]][_0x2d5c('0xb3')]])){if(this[_0x2d5c('0x117')][_0x166750[_0x2d5c('0x25')][_0x507dcb[_0x2d5c('0x109')]]['queue']]){this['queueBookedRR'][_0x166750['actions'][_0x507dcb[_0x2d5c('0x109')]]['queue']]=this['queueBookedRR'][this[_0x2d5c('0x25')][_0x507dcb[_0x2d5c('0x109')]][_0x2d5c('0xb3')]]?this['queueBookedRR'][this[_0x2d5c('0x25')][_0x507dcb[_0x2d5c('0x109')]][_0x2d5c('0xb3')]]:this['queueBooked'][this['actions'][_0x507dcb[_0x2d5c('0x109')]][_0x2d5c('0xb3')]]?this['queueBooked'][this[_0x2d5c('0x25')][_0x507dcb[_0x2d5c('0x109')]]['queue']][_0x2d5c('0x118')]||0x0:0x0;}this['queueBooked'][this[_0x2d5c('0x25')][_0x507dcb[_0x2d5c('0x109')]]['queue']]['_rr']=this[_0x2d5c('0x117')][this[_0x2d5c('0x25')][_0x507dcb[_0x2d5c('0x109')]][_0x2d5c('0xb3')]];for(var _0x10fa02=0x0;_0x10fa02<this[_0x2d5c('0x29')][this[_0x2d5c('0x25')][_0x507dcb[_0x2d5c('0x109')]]['queue']][_0x2d5c('0x9a')];_0x10fa02+=0x1){_0x347b54=rr(this['queueBooked'][this['actions'][_0x507dcb[_0x2d5c('0x109')]][_0x2d5c('0xb3')]]);this[_0x2d5c('0x117')][_0x166750[_0x2d5c('0x25')][_0x507dcb['actionid']][_0x2d5c('0xb3')]]=this[_0x2d5c('0x29')][this[_0x2d5c('0x25')][_0x507dcb['actionid']][_0x2d5c('0xb3')]]['_rr'];if(_0x347b54[_0x2d5c('0xaf')]==='1'&&_0x347b54['paused']==='0'){break;}}if(!_[_0x2d5c('0xad')](_0x347b54)){this[_0x2d5c('0x23')][_0x347b54['stateinterface']][_0x2d5c('0x119')]=_[_0x2d5c('0x38')](this['agents'][_0x347b54[_0x2d5c('0x10d')]][_0x2d5c('0x119')])?!![]:this['agents'][_0x347b54['stateinterface']][_0x2d5c('0x119')];}loggerBooked[_0x2d5c('0x7c')]('[booked][RR]',_0x507dcb['actionid'],_0x2d5c('0x11a'),JSON['stringify'](_[_0x2d5c('0xcc')](this[_0x2d5c('0x23')][_0x347b54[_0x2d5c('0x10d')]],[_0x2d5c('0x3a'),_0x2d5c('0x119')])),'contactAgent-idHopper:\x20',JSON['stringify'](_0x347b54['idHopper']));if(!_[_0x2d5c('0xad')](_0x347b54)&&_0x347b54['status']==='1'&&_0x347b54[_0x2d5c('0x10c')]==='0'&&this[_0x2d5c('0x23')][_0x347b54[_0x2d5c('0x10d')]]['unlockRR']){this[_0x2d5c('0x23')][_0x347b54[_0x2d5c('0x10d')]][_0x2d5c('0x119')]=![];this[_0x2d5c('0x29')][_0x166750[_0x2d5c('0x25')][_0x507dcb[_0x2d5c('0x109')]][_0x2d5c('0xb3')]]=[];this['preview'][_0x2d5c('0x113')](_0x347b54[_0x2d5c('0x10f')],_0x347b54['stateinterface'])[_0x2d5c('0xbb')](function(_0x346689){logger[_0x2d5c('0x97')](_0x2d5c('0x114'),util[_0x2d5c('0x98')](_0x346689,{'showHidden':![],'depth':null}));})[_0x2d5c('0x1e')](function(){_0x166750[_0x2d5c('0xb2')](_0x166750[_0x2d5c('0x21')][_0x166750[_0x2d5c('0x25')][_0x507dcb[_0x2d5c('0x109')]][_0x2d5c('0xb3')]]);setTimeout(function(){_0x166750[_0x2d5c('0x23')][_0x347b54[_0x2d5c('0x10d')]]['unlockRR']=!![];loggerBooked[_0x2d5c('0x7c')](_0x2d5c('0x11b'),_0x507dcb[_0x2d5c('0x109')],'Agent:\x20',JSON[_0x2d5c('0x44')](_[_0x2d5c('0xcc')](_0x166750[_0x2d5c('0x23')][_0x347b54[_0x2d5c('0x10d')]],['name',_0x2d5c('0x119')])),'contactAgent-idHopper:\x20',JSON['stringify'](_0x347b54[_0x2d5c('0x10f')]));},0xc7);delete _0x166750[_0x2d5c('0x25')][_0x507dcb['actionid']];unlockQueueStatus(_0x4be176,_0x507dcb[_0x2d5c('0x109')]);});}else{loggerBooked['info'](_0x2d5c('0x11c'));this[_0x2d5c('0xb2')](this[_0x2d5c('0x21')][this[_0x2d5c('0x25')][_0x507dcb[_0x2d5c('0x109')]][_0x2d5c('0xb3')]]);this[_0x2d5c('0x115')]({'active':![],'ContactId':this['actions'][_0x507dcb[_0x2d5c('0x109')]][_0x2d5c('0xcd')],'ListId':this[_0x2d5c('0x25')][_0x507dcb[_0x2d5c('0x109')]][_0x2d5c('0xce')],'VoiceQueueId':this['actions'][_0x507dcb['actionid']][_0x2d5c('0xd0')]||undefined,'CampaignId':this[_0x2d5c('0x25')][_0x507dcb[_0x2d5c('0x109')]][_0x2d5c('0xd1')]||undefined})['catch'](loggerCatch(_0x2d5c('0x116')));delete this[_0x2d5c('0x25')][_0x507dcb[_0x2d5c('0x109')]];unlockQueueStatus(_0x4be176);}}else{loggerBooked[_0x2d5c('0x7c')]('[booked][unlock2]');this[_0x2d5c('0xb2')](this[_0x2d5c('0x21')][this[_0x2d5c('0x25')][_0x507dcb['actionid']][_0x2d5c('0xb3')]]);this[_0x2d5c('0x115')]({'active':![],'ContactId':this[_0x2d5c('0x25')][_0x507dcb[_0x2d5c('0x109')]][_0x2d5c('0xcd')],'ListId':this[_0x2d5c('0x25')][_0x507dcb['actionid']]['ListId'],'VoiceQueueId':this[_0x2d5c('0x25')][_0x507dcb['actionid']]['VoiceQueueId']||undefined,'CampaignId':this[_0x2d5c('0x25')][_0x507dcb[_0x2d5c('0x109')]][_0x2d5c('0xd1')]||undefined})[_0x2d5c('0xbb')](loggerCatch(_0x2d5c('0x11d')));delete this['actions'][_0x507dcb[_0x2d5c('0x109')]];unlockQueueStatus(_0x4be176);}}else{loggerBooked[_0x2d5c('0x7c')]('[booked][unlock3]');this[_0x2d5c('0xb2')](this[_0x2d5c('0x21')][this[_0x2d5c('0x25')][_0x507dcb[_0x2d5c('0x109')]][_0x2d5c('0xb3')]]);this[_0x2d5c('0x115')]({'active':![],'ContactId':this[_0x2d5c('0x25')][_0x507dcb['actionid']]['ContactId'],'ListId':this[_0x2d5c('0x25')][_0x507dcb[_0x2d5c('0x109')]][_0x2d5c('0xce')],'VoiceQueueId':this[_0x2d5c('0x25')][_0x507dcb['actionid']][_0x2d5c('0xd0')]||undefined,'CampaignId':this[_0x2d5c('0x25')][_0x507dcb['actionid']][_0x2d5c('0xd1')]||undefined})['catch'](loggerCatch(_0x2d5c('0x11e')));delete this[_0x2d5c('0x25')][_0x507dcb['actionid']];unlockQueueStatus(_0x4be176);}};Dialer[_0x2d5c('0x1c')]['loopCampaigns']=function(){var _0x1dbc08=this;setInterval(function(){_0x1dbc08[_0x2d5c('0x11f')]();},0x3e8);};Dialer['prototype']['checkIsTrunkReachable']=function(_0x286c7a){var _0x50203a=this;return function(){if(!_0x50203a[_0x2d5c('0xd6')](_0x286c7a[_0x2d5c('0x73')])){if(!_0x50203a[_0x2d5c('0xd6')](_0x286c7a[_0x2d5c('0x120')])){_0x286c7a[_0x2d5c('0x41')]=_0x2d5c('0x121');throw _0x286c7a[_0x2d5c('0x3a')]+'\x20trunk\x20is\x20not\x20reachable';}}};};Dialer['prototype'][_0x2d5c('0x122')]=function(_0x4166fc,_0x34667a,_0x373883,_0xe58a83){var _0x14df9b=this;return function(){var _0x581d44=!![];return _0x14df9b['ifTime'](_0x4166fc,_0x34667a,_0x373883,_0xe58a83,_0x581d44);};};Dialer[_0x2d5c('0x1c')]['checkIfTimeIntervals']=function(_0x783677,_0x13d1c6,_0x23fd9e,_0x3f61d5){var _0x517443=this;return function(){var _0x49ad74=![];return _0x517443[_0x2d5c('0x123')](_0x783677[_0x2d5c('0x40')],_0x13d1c6,_0x23fd9e,_0x3f61d5,_0x49ad74);};};Dialer[_0x2d5c('0x1c')][_0x2d5c('0x123')]=function(_0x29cdbf,_0x2e056f,_0x13d23b,_0x227bbd,_0x27e734){var _0xbaac80=[];return new BPromise(function(_0x30df0f,_0x4b3fe4){if(!isNotNull(_0x29cdbf)){_0x227bbd[_0x2d5c('0x41')]=_0x2d5c('0x3e');return _0x4b3fe4(msgResponse(_0x2d5c('0x123'),_0x2d5c('0x124'),_0x13d23b+_0x2d5c('0x125')));}if(_[_0x2d5c('0x7b')](_0x29cdbf)){_0x227bbd['message']=_0x2d5c('0x126');return _0x4b3fe4(msgResponse(_0x2d5c('0x123'),_0x2d5c('0x124'),_0x13d23b+'\x20Intervals\x20is\x20empty\x20'));}if(_0x2e056f&&_[_0x2d5c('0x38')](config[_0x2d5c('0x127')][_0x2e056f])){_0x227bbd[_0x2d5c('0x41')]=_0x2d5c('0x128');return _0x4b3fe4(msgResponse('ifTime',_0x2d5c('0x124'),_0x13d23b+_0x2d5c('0x129')+_0x2e056f));}if(_[_0x2d5c('0x12a')](_0x29cdbf)){for(var _0x49ffb6=0x0;_0x49ffb6<_0x29cdbf['length'];_0x49ffb6+=0x1){_0xbaac80[_0x2d5c('0x12b')](ami[_0x2d5c('0xae')]({'action':_0x2d5c('0x12c'),'command':util[_0x2d5c('0x79')](_0x2d5c('0x12d'),_0x29cdbf[_0x49ffb6][_0x2d5c('0x12e')],!_[_0x2d5c('0x38')](config['timezones'][_0x2e056f])?_0x2e056f:'')})[_0x2d5c('0xb8')](function(_0x5bfb03){return _0x5bfb03[_0x2d5c('0x12f')][_0x2d5c('0x130')]('true')>=0x0?!![]:![];})[_0x2d5c('0xbb')](myreject(_0x4b3fe4)));}}else{_0xbaac80['push'](ami[_0x2d5c('0xae')]({'action':_0x2d5c('0x12c'),'command':util[_0x2d5c('0x79')](_0x2d5c('0x12d'),_0x29cdbf,!_['isUndefined'](config[_0x2d5c('0x127')][_0x2e056f])?_0x2e056f:'')})[_0x2d5c('0xb8')](function(_0x3ec651){return _0x3ec651[_0x2d5c('0x12f')][_0x2d5c('0x130')](_0x2d5c('0x131'))>=0x0?!![]:![];})['catch'](myreject(_0x4b3fe4)));}BPromise[_0x2d5c('0x132')](_0xbaac80)[_0x2d5c('0xb8')](function(_0x4e1893){var _0x57601e=_[_0x2d5c('0x133')](_0x4e1893);if(_0x57601e){return _0x30df0f(_0x57601e);}else{_0x227bbd['message']=_0x27e734?_0x2d5c('0x134'):'INTERVAL_IS_OVERTIME';return _0x4b3fe4(msgResponse(_0x2d5c('0x135'),_0x2d5c('0x124'),_0x2d5c('0x136')+_0x27e734+'\x20'+_0x13d23b+_0x2d5c('0x137')+util[_0x2d5c('0x98')](_0x29cdbf,{'showHidden':![],'depth':null})+_0x2d5c('0x138')+_0x2e056f));}})[_0x2d5c('0xbb')](function(_0x512bf9){return _0x4b3fe4(msgResponse(_0x2d5c('0x123'),'Failure',JSON[_0x2d5c('0x44')](_0x512bf9)));});});};Dialer['prototype'][_0x2d5c('0x139')]=function(_0x5b26e0){var _0x432c3e=this;return function(){switch(_0x5b26e0['dialMethod']){case _0x2d5c('0x13a'):freeVariablesPredictive(_0x5b26e0);_0x432c3e[_0x2d5c('0x13b')](_0x5b26e0,0x1);break;case _0x2d5c('0x13c'):freeVariablesPredictive(_0x5b26e0);_0x432c3e[_0x2d5c('0x13b')](_0x5b26e0,_0x5b26e0[_0x2d5c('0x13d')]);break;case'predictive':_0x432c3e[_0x2d5c('0x7')](_0x5b26e0);break;case _0x2d5c('0x6'):freeVariablesPredictive(_0x5b26e0);_0x432c3e['handlePower'](_0x5b26e0,0x1);break;default:freeVariablesPredictive(_0x5b26e0);logger[_0x2d5c('0x97')](_0x2d5c('0x13e'),_0x5b26e0['name'],_0x2d5c('0x13f'));}};};Dialer[_0x2d5c('0x1c')][_0x2d5c('0x140')]=function(_0x148070){var _0x104897=this;return function(){_0x104897[_0x2d5c('0x141')](_0x148070);};};Dialer[_0x2d5c('0x1c')][_0x2d5c('0x9')]=function(_0x14ef50){var _0x262aa8=this;if(isNotPreview(_0x14ef50[_0x2d5c('0x56')])){if(isVoiceQueueOutbound(_0x14ef50[_0x2d5c('0x48')])&&isActive(_0x14ef50[_0x2d5c('0x55')])){_0x14ef50['sendMessageOneNotActive']=!![];BPromise[_0x2d5c('0xb7')]()['then'](checkIsLoggedIn(_0x14ef50,_0x14ef50[_0x2d5c('0x142')]))[_0x2d5c('0xb8')](checkIsActive(_0x14ef50,_0x14ef50[_0x2d5c('0x55')]))[_0x2d5c('0xb8')](checkInterval(_0x14ef50))[_0x2d5c('0xb8')](_0x262aa8[_0x2d5c('0x143')](_0x14ef50))['then'](_0x262aa8[_0x2d5c('0x122')](_0x14ef50[_0x2d5c('0x144')],_0x14ef50[_0x2d5c('0x145')],_0x14ef50[_0x2d5c('0x3a')],_0x14ef50))[_0x2d5c('0xb8')](_0x262aa8[_0x2d5c('0x146')](_0x14ef50[_0x2d5c('0x3d')],_0x14ef50[_0x2d5c('0x145')],_0x14ef50[_0x2d5c('0x3a')],_0x14ef50))[_0x2d5c('0xb8')](_0x262aa8['checkDialMethod'](_0x14ef50))[_0x2d5c('0xbb')](loggerCatchQueueSummary(_0x2d5c('0x147'),_0x14ef50));}else{notSendMessagesQueue(_0x14ef50);}}else{freeVariablesPredictive(_0x14ef50);}};Dialer[_0x2d5c('0x1c')][_0x2d5c('0x11f')]=function(){var _0x3190ad=this;var _0x51202c;for(var _0x285c5f in this['campaigns']){if(this[_0x2d5c('0x22')][_0x2d5c('0x9b')](_0x285c5f)){_0x51202c=this['campaigns'][_0x285c5f];if(isCampaignIvr(_0x51202c[_0x2d5c('0x48')])&&isActive(_0x51202c[_0x2d5c('0x74')])){_0x51202c[_0x2d5c('0xa0')]=!![];BPromise[_0x2d5c('0xb7')]()[_0x2d5c('0xb8')](checkIsActive(_0x51202c,_0x51202c[_0x2d5c('0x74')]))[_0x2d5c('0xb8')](checkInterval(_0x51202c))[_0x2d5c('0xb8')](_0x3190ad['checkIsTrunkReachable'](_0x51202c))[_0x2d5c('0xb8')](_0x3190ad[_0x2d5c('0x122')](_0x51202c['dialGlobalInterval'],_0x51202c[_0x2d5c('0x145')],_0x51202c[_0x2d5c('0x3a')],_0x51202c))[_0x2d5c('0xb8')](_0x3190ad['checkIfTimeIntervals'](_0x51202c[_0x2d5c('0x3d')],_0x51202c[_0x2d5c('0x145')],_0x51202c[_0x2d5c('0x3a')],_0x51202c))[_0x2d5c('0xb8')](_0x3190ad[_0x2d5c('0x140')](_0x51202c))['catch'](loggerCatchQueueSummary(_0x2d5c('0x148'),_0x51202c));}else{notSendMessagesCampaign(_0x51202c);}}}};function getCallerIdRandom(_0x336a91,_0x150c94){var _0x4e4a12,_0x517f33,_0x556ecd;if(_0x150c94<=0x0){_0x150c94=0x1;}_0x4e4a12=new RegExp(_0x2d5c('0x149')+_0x150c94+'}$');_0x517f33=Math[_0x2d5c('0x14a')](0xa,_0x150c94-0x1);_0x556ecd=Math[_0x2d5c('0x14a')](0xa,_0x150c94)-0x1;return util[_0x2d5c('0x79')]('%s',_['replace'](_0x336a91,_0x4e4a12,_['random'](_0x517f33,_0x556ecd)));}function extractCalleridName(_0x1099c7){var _0xce604=_0x1099c7[_0x2d5c('0x14b')](/"(.*?)"/);return _0xce604?_0xce604[0x1]:_0x1099c7;}function extractCalleridNumber(_0x547cc8){var _0x23ad51=_0x547cc8['match'](/<(.*?)>/);return _0x23ad51?_0x23ad51[0x1]:_0x547cc8;}Dialer[_0x2d5c('0x1c')][_0x2d5c('0x14c')]=function(_0x14faf9,_0x2d0f1e){var _0x161da1=this;var _0x190b63=uuid['v4']();this[_0x2d5c('0x25')][_0x190b63]=new Action(_0x14faf9,_0x2d0f1e,_0x190b63);return new BPromise(function(_0x524405,_0x36f4c5){if(_[_0x2d5c('0x38')](_0x14faf9)&&_0x2d5c('0x14d')!==typeof _0x14faf9){return _0x36f4c5(msgResponse(_0x2d5c('0x14e'),_0x2d5c('0x124'),_0x2d5c('0x14f')));}if(_['isUndefined'](_0x2d0f1e[_0x2d5c('0x150')]['phone'])||_0x2d0f1e[_0x2d5c('0x150')][_0x2d5c('0x151')]===null){return _0x36f4c5(msgResponse(_0x2d5c('0x14e'),_0x2d5c('0x124'),_0x2d5c('0x152')));}var _0x4bedf9={'XMD-CALLERID':_0x161da1[_0x2d5c('0x25')][_0x190b63]['getCaller'](),'XMD-AGI':_0x14faf9[_0x2d5c('0xf2')]?util[_0x2d5c('0x79')](_0x2d5c('0x153'),ipAgi,_0x14faf9[_0x2d5c('0xf2')]):_0x2d5c('0x154'),'XMD-AGIAFTER':_0x14faf9[_0x2d5c('0xf8')]?util['format'](_0x2d5c('0x153'),ipAgi,_0x14faf9[_0x2d5c('0xf8')]):_0x2d5c('0x154'),'XMD-QUEUE':_0x14faf9[_0x2d5c('0x48')]===_0x2d5c('0x155')?util[_0x2d5c('0x79')](_0x2d5c('0x156'),_0x14faf9[_0x2d5c('0x3a')],_0x14faf9[_0x2d5c('0x157')]||'',_0x14faf9[_0x2d5c('0xf9')]?'c':'',_0x14faf9[_0x2d5c('0x102')]||0x3):_0x2d5c('0x154'),'XMD-CONTACTID':_0x2d0f1e['ContactId'],'XMD-CDRTYPE':_0x2d5c('0x5'),'CALLERID(all)':_0x161da1[_0x2d5c('0x25')][_0x190b63]['getCaller'](),'XMD-AMD':_0x14faf9[_0x2d5c('0xdf')]?_0x2d5c('0x158'):_0x2d5c('0x154'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x14faf9[_0x2d5c('0xdf')]){_0x4bedf9['XMD-AMDINITIALSILENCE']=_0x14faf9[_0x2d5c('0x159')]||0x9c4;_0x4bedf9[_0x2d5c('0x15a')]=_0x14faf9[_0x2d5c('0x15b')]||0x5dc;_0x4bedf9[_0x2d5c('0x15c')]=_0x14faf9[_0x2d5c('0x15d')]||0x320;_0x4bedf9[_0x2d5c('0x15e')]=_0x14faf9['dialAMDTotalAnalysisTime']||0x1388;_0x4bedf9[_0x2d5c('0x15f')]=_0x14faf9[_0x2d5c('0x160')]||0x64;_0x4bedf9[_0x2d5c('0x161')]=_0x14faf9['dialAMDBetweenWordsSilence']||0x32;_0x4bedf9['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x14faf9[_0x2d5c('0x162')]||0x3;_0x4bedf9['XMD-AMDSILENCETHRESHOLD']=_0x14faf9[_0x2d5c('0x163')]||0x100;_0x4bedf9[_0x2d5c('0x164')]=_0x14faf9[_0x2d5c('0x165')]||0x1388;}if(_0x14faf9[_0x2d5c('0x48')]===_0x2d5c('0x155')){_0x4bedf9[_0x2d5c('0x166')]=_0x2d0f1e[_0x2d5c('0xd0')];}else{_0x4bedf9[_0x2d5c('0x167')]=_0x2d0f1e['CampaignId'];}for(var _0x5b3844 in _0x2d0f1e[_0x2d5c('0x150')]){if(_0x2d0f1e[_0x2d5c('0x150')][_0x2d5c('0x9b')](_0x5b3844)){if(isNotNull(_0x2d0f1e[_0x2d5c('0x150')][_0x5b3844])&&_0x5b3844!=='id'&&_0x5b3844!==_0x2d5c('0x168')&&_0x5b3844!==_0x2d5c('0x169')&&_0x5b3844!==_0x2d5c('0x16a')){_0x4bedf9[util[_0x2d5c('0x79')](_0x2d5c('0x16b'),_0x2d5c('0x16c'),_[_0x2d5c('0x16d')](_0x5b3844))]=_0x2d0f1e[_0x2d5c('0x150')][_0x5b3844];}}}var _0x5ac52a=_0x161da1['isTrunkReachable'](_0x14faf9[_0x2d5c('0x73')])?getCallerId(_0x14faf9[_0x2d5c('0x73')][_0x2d5c('0x75')],_0x14faf9[_0x2d5c('0x57')],_0x14faf9[_0x2d5c('0x16e')]>0x0?getCallerIdRandom(_0x14faf9[_0x2d5c('0x58')],_0x14faf9[_0x2d5c('0x16e')]):_0x14faf9[_0x2d5c('0x58')]):getCallerId(_['isNil'](_0x14faf9[_0x2d5c('0x120')])?_0x14faf9['Trunk'][_0x2d5c('0x75')]:_0x14faf9[_0x2d5c('0x120')]['callerid'],_0x14faf9[_0x2d5c('0x57')],_0x14faf9[_0x2d5c('0x16e')]>0x0?getCallerIdRandom(_0x14faf9[_0x2d5c('0x58')],_0x14faf9[_0x2d5c('0x16e')]):_0x14faf9[_0x2d5c('0x58')]);if(_0x5ac52a){_0x4bedf9[_0x2d5c('0x16f')]=_0x161da1[_0x2d5c('0x25')][_0x190b63][_0x2d5c('0x170')]=extractCalleridName(_0x5ac52a);_0x4bedf9[_0x2d5c('0x171')]=_0x161da1[_0x2d5c('0x25')][_0x190b63][_0x2d5c('0x172')]=extractCalleridNumber(_0x5ac52a);}return ami[_0x2d5c('0xae')]({'actionid':_0x190b63,'action':'originate','channel':_0x161da1[_0x2d5c('0xd6')](_0x14faf9[_0x2d5c('0x73')])?util['format'](_0x2d5c('0x173'),_0x14faf9['Trunk']['name'],isNotNull(_0x14faf9[_0x2d5c('0x5a')])?_0x14faf9[_0x2d5c('0x5a')]['trim']()||'':'',_0x14faf9[_0x2d5c('0x174')]>0x0?_0x2d0f1e[_0x2d5c('0x150')][_0x2d5c('0x151')]['substring'](_0x14faf9[_0x2d5c('0x174')]):_0x2d0f1e[_0x2d5c('0x150')][_0x2d5c('0x151')]):util[_0x2d5c('0x79')]('SIP/%s/%s%s',_[_0x2d5c('0xad')](_0x14faf9[_0x2d5c('0x120')])?_0x14faf9[_0x2d5c('0x73')][_0x2d5c('0x3a')]:_0x14faf9['TrunkBackup'][_0x2d5c('0x3a')],isNotNull(_0x14faf9['dialPrefix'])?_0x14faf9['dialPrefix']['trim']()||'':'',_0x14faf9['dialCutDigit']>0x0?_0x2d0f1e[_0x2d5c('0x150')][_0x2d5c('0x151')]['substring'](_0x14faf9[_0x2d5c('0x174')]):_0x2d0f1e[_0x2d5c('0x150')][_0x2d5c('0x151')]),'callerid':_0x5ac52a,'Exten':'xcally-motion-dialer','Context':'from-sip','Priority':'1','variable':_0x4bedf9,'timeout':(_0x14faf9[_0x2d5c('0x59')]||0x1e)*0x3e8,'async':!![],'channelid':_0x190b63})[_0x2d5c('0xb8')](function(_0x46d4bd){return _0x524405(_0x46d4bd);})[_0x2d5c('0xbb')](function(_0x436af6){_0x14faf9[_0x2d5c('0x62')]+=0x1;var _0x20a96a=new History(_0x161da1['actions'][_0x190b63]);logger[_0x2d5c('0x97')](util[_0x2d5c('0x79')](_0x2d5c('0x175'),JSON[_0x2d5c('0x44')](_0x436af6)));_0x20a96a[_0x2d5c('0xa7')]=0xe;_0x20a96a[_0x2d5c('0xe1')]=_0x2d5c('0x176');_0x20a96a[_0x2d5c('0xa8')]=moment()[_0x2d5c('0x79')](_0x2d5c('0xfa'));_0x20a96a[_0x2d5c('0x177')]=_0x20a96a[_0x2d5c('0xa8')];_0x161da1[_0x2d5c('0xc5')](_0x20a96a)[_0x2d5c('0xbb')](loggerCatch(_0x2d5c('0x178')));_0x161da1[_0x2d5c('0xc4')](_0x20a96a)[_0x2d5c('0xbb')](loggerCatch(_0x2d5c('0x178')))['finally'](function(){delete _0x161da1[_0x2d5c('0x25')][_0x190b63];return _0x36f4c5(msgResponse('originate',_0x2d5c('0x43'),'originate\x20action\x20Error'));});});});};Dialer[_0x2d5c('0x1c')][_0x2d5c('0x2f')]=function(_0x42ca9d){var _0x583047=this[_0x2d5c('0x25')][_0x42ca9d['actionid']];var _0x31f5aa=this;if(_0x583047){delete this['actions'][_0x42ca9d['actionid']];_0x583047[_0x2d5c('0x101')]=moment()['format'](_0x2d5c('0xfa'));var _0x3cedf4=_0x583047[_0x2d5c('0x48')]==='ivr'?this[_0x2d5c('0x22')][_0x583047[_0x2d5c('0xb3')]]:this[_0x2d5c('0x21')][_0x583047[_0x2d5c('0x179')]()];if(!this[_0x2d5c('0xd4')](_0x42ca9d[_0x2d5c('0x17a')])){this['updateOriginated'](_0x3cedf4);return this[_0x2d5c('0x17b')](_0x583047,_0x3cedf4,_0x42ca9d)[_0x2d5c('0xb8')](function(_0x3652db){})['catch'](loggerCatch(_0x2d5c('0x17c')));}else{this[_0x2d5c('0x26')][_0x42ca9d['uniqueid']]=_0x583047;}}};Dialer['prototype'][_0x2d5c('0x17d')]=function(_0x584fb8,_0x1f7338,_0x5bc5da){var _0x3aed41=new History(_0x1f7338);if(_0x3aed41['countbusyretry']+_0x3aed41[_0x2d5c('0x17e')]+_0x3aed41[_0x2d5c('0x17f')]>=_0x5bc5da[_0x2d5c('0x180')]-0x1){return!![];}switch(_0x584fb8){case 0x3:if(_0x3aed41[_0x2d5c('0x17f')]>=_0x5bc5da[_0x2d5c('0x181')]-0x1){return!![];}else{this[_0x2d5c('0x115')]({'active':![],'countnoanswerretry':_0x3aed41['countnoanswerretry']+=0x1,'scheduledat':moment()['add'](_0x5bc5da[_0x2d5c('0x182')],_0x2d5c('0x183'))[_0x2d5c('0x79')](_0x2d5c('0xfa')),'ContactId':_0x3aed41[_0x2d5c('0xcd')],'ListId':_0x3aed41[_0x2d5c('0xce')],'VoiceQueueId':_0x3aed41[_0x2d5c('0xd0')]||undefined,'CampaignId':_0x3aed41[_0x2d5c('0xd1')]||undefined})['catch'](loggerCatch(_0x2d5c('0x184')));}break;case 0x5:if(_0x3aed41[_0x2d5c('0x185')]>=_0x5bc5da[_0x2d5c('0x186')]-0x1){return!![];}else{this[_0x2d5c('0x115')]({'active':![],'countbusyretry':_0x3aed41[_0x2d5c('0x185')]+=0x1,'scheduledat':moment()[_0x2d5c('0x187')](_0x5bc5da[_0x2d5c('0x188')],'minutes')[_0x2d5c('0x79')](_0x2d5c('0xfa')),'ContactId':_0x3aed41[_0x2d5c('0xcd')],'ListId':_0x3aed41[_0x2d5c('0xce')],'VoiceQueueId':_0x3aed41['VoiceQueueId']||undefined,'CampaignId':_0x3aed41['CampaignId']||undefined})[_0x2d5c('0xbb')](loggerCatch(_0x2d5c('0x189')));}break;case 0x8:if(_0x3aed41[_0x2d5c('0x17e')]>=_0x5bc5da[_0x2d5c('0x18a')]-0x1){return!![];}else{this[_0x2d5c('0x115')]({'active':![],'countcongestionretry':_0x3aed41[_0x2d5c('0x17e')]+=0x1,'scheduledat':moment()['add'](_0x5bc5da[_0x2d5c('0x18b')],_0x2d5c('0x183'))[_0x2d5c('0x79')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3aed41[_0x2d5c('0xcd')],'ListId':_0x3aed41[_0x2d5c('0xce')],'VoiceQueueId':_0x3aed41[_0x2d5c('0xd0')]||undefined,'CampaignId':_0x3aed41[_0x2d5c('0xd1')]||undefined})[_0x2d5c('0xbb')](loggerCatch(_0x2d5c('0x18c')));}break;default:return!![];}};Dialer['prototype']['callProgressDetecting']=function(_0x40da8e,_0x51ddf0,_0x5e9c76){var _0x42fc0a=this;var _0x2e7333=new History(_0x40da8e);return new BPromise(function(_0x1f53a6,_0x1d01b3){if(_[_0x2d5c('0x38')](_0x51ddf0)&&'object'!==typeof _0x51ddf0){return _0x1d01b3(msgResponse(_0x2d5c('0x18d'),'Failure',_0x2d5c('0x18e')));}if(_[_0x2d5c('0x38')](_0x5e9c76)&&_0x2d5c('0x14d')!==typeof _0x5e9c76){return _0x1d01b3(msgResponse(_0x2d5c('0x18d'),_0x2d5c('0x124'),'evt\x20is\x20undefine'));}switch(_0x5e9c76[_0x2d5c('0x18f')]){case'0':_0x51ddf0[_0x2d5c('0x61')]+=0x1;_0x2e7333['state']=0x0;_0x2e7333[_0x2d5c('0xe1')]=_0x2d5c('0x190');_0x42fc0a['createHistory'](_0x2e7333)[_0x2d5c('0xbb')](loggerCatch(_0x2d5c('0x191')));if(_0x42fc0a[_0x2d5c('0x17d')](0x0,_0x40da8e,_0x51ddf0)){if(_0x2e7333[_0x2d5c('0x185')]+_0x2e7333['countcongestionretry']+_0x2e7333[_0x2d5c('0x17f')]>=_0x51ddf0['dialGlobalMaxRetry']){_0x42fc0a[_0x2d5c('0x192')](_0x2e7333,_0x1f53a6,_0x1d01b3,_0x2d5c('0x193'));}else{_0x42fc0a[_0x2d5c('0x194')](_0x2e7333,_0x1f53a6,_0x1d01b3,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x51ddf0[_0x2d5c('0x60')]+=0x1;_0x2e7333[_0x2d5c('0xa7')]=0x3;_0x2e7333[_0x2d5c('0xe1')]=_0x2d5c('0x195');_0x2e7333[_0x2d5c('0x17f')]+=0x1;_0x2e7333['countglobal']+=0x1;_0x42fc0a[_0x2d5c('0xc5')](_0x2e7333)[_0x2d5c('0xbb')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x42fc0a[_0x2d5c('0x17d')](0x3,_0x40da8e,_0x51ddf0)){if(_0x2e7333['countnoanswerretry']>=_0x51ddf0[_0x2d5c('0x181')]){_0x42fc0a[_0x2d5c('0x194')](_0x2e7333,_0x1f53a6,_0x1d01b3,_0x2d5c('0x196'));}else{_0x42fc0a[_0x2d5c('0x192')](_0x2e7333,_0x1f53a6,_0x1d01b3,_0x2d5c('0x196'));}}break;case'5':_0x51ddf0[_0x2d5c('0x5e')]+=0x1;_0x2e7333['state']=0x5;_0x2e7333[_0x2d5c('0xe1')]=_0x2d5c('0x197');_0x2e7333[_0x2d5c('0x185')]+=0x1;_0x2e7333[_0x2d5c('0x198')]+=0x1;_0x42fc0a['createHistory'](_0x2e7333)['catch'](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x42fc0a[_0x2d5c('0x17d')](0x5,_0x40da8e,_0x51ddf0)){if(_0x2e7333[_0x2d5c('0x185')]>=_0x51ddf0[_0x2d5c('0x186')]){_0x42fc0a['createStateFinal'](_0x2e7333,_0x1f53a6,_0x1d01b3,_0x2d5c('0x199'));}else{_0x42fc0a[_0x2d5c('0x192')](_0x2e7333,_0x1f53a6,_0x1d01b3,_0x2d5c('0x199'));}}break;case'8':_0x51ddf0[_0x2d5c('0x19a')]+=0x1;_0x2e7333[_0x2d5c('0xa7')]=0x8;_0x2e7333[_0x2d5c('0xe1')]=_0x2d5c('0x19b');_0x2e7333[_0x2d5c('0x17e')]+=0x1;_0x2e7333[_0x2d5c('0x198')]+=0x1;_0x42fc0a[_0x2d5c('0xc5')](_0x2e7333)[_0x2d5c('0xbb')](loggerCatch(_0x2d5c('0x19c')));if(_0x42fc0a['checkRetriveMax'](0x8,_0x40da8e,_0x51ddf0)){if(_0x2e7333[_0x2d5c('0x17e')]>=_0x51ddf0[_0x2d5c('0x18a')]){_0x42fc0a[_0x2d5c('0x194')](_0x2e7333,_0x1f53a6,_0x1d01b3,_0x2d5c('0x19d'));}else{_0x42fc0a[_0x2d5c('0x192')](_0x2e7333,_0x1f53a6,_0x1d01b3,_0x2d5c('0x19d'));}}break;default:_0x51ddf0['outboundUnknownCallsDay']+=0x1;_0x2e7333[_0x2d5c('0xa7')]=0xc;_0x2e7333[_0x2d5c('0xe1')]=_0x5e9c76[_0x2d5c('0x18f')];_0x42fc0a['createHistory'](_0x2e7333)[_0x2d5c('0xbb')](loggerCatch(_0x2d5c('0x19e')));if(_0x42fc0a[_0x2d5c('0x17d')](_0x5e9c76['reason'],_0x40da8e,_0x51ddf0)){if(_0x2e7333['countbusyretry']+_0x2e7333['countcongestionretry']+_0x2e7333[_0x2d5c('0x17f')]>=_0x51ddf0['dialGlobalMaxRetry']){_0x42fc0a[_0x2d5c('0x192')](_0x2e7333,_0x1f53a6,_0x1d01b3,_0x5e9c76[_0x2d5c('0x18f')]);}else{_0x42fc0a[_0x2d5c('0x194')](_0x2e7333,_0x1f53a6,_0x1d01b3,_0x5e9c76[_0x2d5c('0x18f')]);}}}});};Dialer['prototype'][_0x2d5c('0x192')]=function(_0x29e155,_0x8de35,_0x96b7e7,_0x40cec1){var _0x3b37ad=new Final(_0x29e155);_0x3b37ad[_0x2d5c('0xa7')]=0xf;_0x3b37ad[_0x2d5c('0xe1')]='Global';this[_0x2d5c('0x194')](_0x3b37ad,_0x8de35,_0x96b7e7,_0x40cec1);};Dialer[_0x2d5c('0x1c')]['createStateFinal']=function(_0x385234,_0xef0ccb,_0x2e2ef5,_0x573934){this[_0x2d5c('0xc4')](_0x385234)[_0x2d5c('0xb8')](function(_0x1bbd59){return _0xef0ccb(msgResponse('[callProgressDetecting]','Success',_0x573934));})[_0x2d5c('0xbb')](function(_0x5d3a17){return _0x2e2ef5(msgResponse('[moveContactManagedDialer][0]',_0x2d5c('0x124'),'contact\x20not\x20moved'));});};Dialer[_0x2d5c('0x1c')][_0x2d5c('0x7')]=function(_0xb1640f){var _0x43c8c6=this;var _0x168e26=_0xb1640f['dialPredictiveOptimizationPercentage']/0x64;var _0x9429e5=_0xb1640f['outboundDropCallsDayTimeout']/(_0xb1640f[_0x2d5c('0x103')]+_0xb1640f[_0x2d5c('0x5c')]);var _0x37c640=Math['round'](_0xb1640f['predictiveIntervalAvailable']*(_0xb1640f['predictiveIntervalMaxThreshold']/0x64));var _0x32de13=Math[_0x2d5c('0x19f')](_0xb1640f[_0x2d5c('0x6c')]*(_0xb1640f[_0x2d5c('0x1a0')]/0x64));var _0x153ef1=_0xb1640f[_0x2d5c('0x4b')]+_0xb1640f['talking'];var _0xc3cea4=Math['floor'](_0xb1640f[_0x2d5c('0x6f')]*_0xb1640f[_0x2d5c('0x71')]*_0xb1640f['predictiveIntervalHitRate']*_0xb1640f[_0x2d5c('0x1a1')]);if(_['isUndefined'](_0xb1640f[_0x2d5c('0x28')])){if(!_[_0x2d5c('0x38')](_0xb1640f[_0x2d5c('0x27')])){_0xb1640f[_0x2d5c('0x27')]=undefined;loggerPredictive[_0x2d5c('0x97')](_0x2d5c('0x1a2'),_0x2d5c('0x1a3'));}if(!_[_0x2d5c('0x38')](_0xb1640f['handlePredictive'])){loggerPredictive['error'](_0x2d5c('0x1a2'),_0x2d5c('0x1a4'));clearInterval(_0xb1640f[_0x2d5c('0x92')]);_0xb1640f[_0x2d5c('0x92')]=undefined;}_0xb1640f[_0x2d5c('0x28')]=moment()[_0x2d5c('0x79')](_0x2d5c('0xfa'));loggerPredictive[_0x2d5c('0x7c')](_0xb1640f[_0x2d5c('0x3a')],_0x2d5c('0x1a5'),_0xb1640f[_0x2d5c('0x28')]);this[_0x2d5c('0x13b')](_0xb1640f,0x1);}else if(ifInterval(_0xb1640f['dialPredictiveInterval'],_0xb1640f[_0x2d5c('0x28')])){this[_0x2d5c('0x13b')](_0xb1640f,0x1);loggerPredictiveCalls[_0x2d5c('0x7c')](_0x2d5c('0x1a6'),_0xb1640f[_0x2d5c('0x28')],_0xb1640f['name']);_0xb1640f[_0x2d5c('0x6f')]=0x0;_0xb1640f['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x168e26<_0x9429e5&&_0xb1640f['dialPredictiveOptimization']==='dropRate'){freeVariablesPredictive(_0xb1640f);loggerPredictive['info']('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0x2d5c('0x1a7'),_0x9429e5,'startProgressive',_0xb1640f[_0x2d5c('0x3a')]);}else if(_0xc3cea4<_0xb1640f['predictiveIntervalErlangCallsDroppedCalls']&&_0xb1640f[_0x2d5c('0x1a8')]===_0x2d5c('0x1a9')){freeVariablesPredictive(_0xb1640f);loggerPredictive[_0x2d5c('0x7c')](_0x2d5c('0x1aa'),_0x2d5c('0x1ab'),_0xc3cea4,_0x2d5c('0x1ac'),_0xb1640f[_0x2d5c('0x69')],_0x2d5c('0x28'),_0xb1640f[_0x2d5c('0x3a')]);}else if(!ifInterval(_0xb1640f['dialPredictiveInterval'],_0xb1640f[_0x2d5c('0x28')])&&_[_0x2d5c('0x38')](_0xb1640f[_0x2d5c('0x27')])&&!_[_0x2d5c('0x38')](_0xb1640f[_0x2d5c('0x28')])){_0xb1640f[_0x2d5c('0x27')]=moment()[_0x2d5c('0x79')](_0x2d5c('0xfa'));loggerPredictive['info'](_0xb1640f['name'],'started\x20in\x20predictive\x20at',_0xb1640f[_0x2d5c('0x27')]);this[_0x2d5c('0x1ad')](_0xb1640f[_0x2d5c('0x1ae')])[_0x2d5c('0xb8')](this[_0x2d5c('0x1af')](_0xb1640f))[_0x2d5c('0xb8')](mergeDataErlangB(_0xb1640f))[_0x2d5c('0xb8')](this[_0x2d5c('0x1b0')](_0xb1640f))[_0x2d5c('0xbb')](loggerCatchPredictive(_0x2d5c('0x1b1'),_0xb1640f));}else if(!ifInterval(_0xb1640f['dialPredictiveInterval'],_0xb1640f[_0x2d5c('0x27')])){_0xb1640f[_0x2d5c('0x69')]=0x0;_0xb1640f['startPredictive']=moment()[_0x2d5c('0x79')](_0x2d5c('0xfa'));loggerPredictive[_0x2d5c('0x7c')](_0xb1640f[_0x2d5c('0x3a')],'recalculate\x20predictive\x20at',_0xb1640f['startPredictive']);clearInterval(_0xb1640f[_0x2d5c('0x92')]);_0xb1640f[_0x2d5c('0x92')]=undefined;this[_0x2d5c('0x1ad')](_0xb1640f[_0x2d5c('0x1ae')])[_0x2d5c('0xb8')](this['getDataPredictive'](_0xb1640f))[_0x2d5c('0xb8')](mergeDataErlangB(_0xb1640f))['then'](this['startMethodPredictive'](_0xb1640f))[_0x2d5c('0xbb')](loggerCatchPredictive(_0x2d5c('0x1b2'),_0xb1640f));}else if(_0xb1640f[_0x2d5c('0x6c')]&&_0x153ef1<_0xb1640f[_0x2d5c('0x6c')]-_0x32de13){freeVariablesPredictive(_0xb1640f);loggerPredictive[_0x2d5c('0x7c')](_0xb1640f[_0x2d5c('0x3a')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x153ef1,')\x20are\x20less\x20than\x20threshold\x20(',_0xb1640f[_0x2d5c('0x6c')],'-',_0x32de13,'=',_0xb1640f[_0x2d5c('0x6c')]-_0x32de13,')');}else if(_0xb1640f[_0x2d5c('0x6c')]&&_0x153ef1>_0xb1640f[_0x2d5c('0x6c')]+_0x37c640){freeVariablesPredictive(_0xb1640f);loggerPredictive[_0x2d5c('0x7c')](_0xb1640f[_0x2d5c('0x3a')],_0x2d5c('0x1b3'),_0x153ef1,')\x20are\x20more\x20than\x20threshold\x20(',_0xb1640f[_0x2d5c('0x6c')],'+',_0x37c640,'=',_0xb1640f[_0x2d5c('0x6c')]+_0x37c640,')');}};Dialer[_0x2d5c('0x1c')]['getDataPredictive']=function(_0x3e4eb5){var _0x3ab34c=this;return function(_0x95c40a){return new BPromise(function(_0x38aa68,_0x485fd3){_[_0x2d5c('0x8e')](_0x3e4eb5,_0x95c40a[0x0]);if(checkGetDataPredictive(_0x95c40a[0x0])){var _0x377466=_0x3e4eb5[_0x2d5c('0x6c')]=_0x3e4eb5[_0x2d5c('0xa1')]+_0x3e4eb5[_0x2d5c('0x4b')];var _0x1c4e0e=_0x3e4eb5[_0x2d5c('0x1ae')]*0x3c;var _0x5b574c=_0x95c40a[0x0][_0x2d5c('0x67')]+_0x95c40a[0x0][_0x2d5c('0x82')];var _0x52b799=(_0x95c40a[0x0][_0x2d5c('0x66')]+_0x95c40a[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x95c40a[0x0][_0x2d5c('0x107')])/_0x95c40a[0x0][_0x2d5c('0x6d')];_0x3e4eb5['predictiveIntervalHitRate']=_0x52b799>0x0?_0x52b799:0x1;switch(_0x3e4eb5[_0x2d5c('0x1a8')]){case _0x2d5c('0x1a9'):var _0x2674d6=_0x3e4eb5[_0x2d5c('0x1b4')]/0x64;return _0x3ab34c['abandonmentRate'](_0x377466,_0x1c4e0e,_0x5b574c,_0x52b799,_0x2674d6)[_0x2d5c('0xb8')](function(_0x28066d){return _0x38aa68(_0x28066d);});case _0x2d5c('0x1b5'):var _0x46c707=_0x3e4eb5['dialPredictiveOptimizationPercentage']/0x64;return _0x3ab34c['busyFactor'](_0x377466,_0x1c4e0e,_0x5b574c,_0x52b799,_0x46c707)[_0x2d5c('0xb8')](function(_0xdcac89){return _0x38aa68(_0xdcac89);});default:return _0x485fd3(msgResponse(_0x2d5c('0x1b6'),_0x2d5c('0x124'),_0x2d5c('0x1b7')));}}else{return _0x485fd3(msgResponse('[getDataPredictive]',_0x2d5c('0x124'),_0x2d5c('0x1b8')));}});};};Dialer[_0x2d5c('0x1c')][_0x2d5c('0x1b9')]=function(_0x4ccc09){var _0x37d847=this;return function(_0xedcac9){return new BPromise(function(_0x2d7ec8,_0x56307c){_[_0x2d5c('0x8e')](_0x4ccc09,_0xedcac9[0x0]);if(checkGetDataPredictive(_0xedcac9[0x0])){loggerPredictive['info'](JSON['stringify'](_0xedcac9[0x0]));if(_0x4ccc09['dialPredictiveOptimization']===_0x2d5c('0x1a9')){return _0x37d847[_0x2d5c('0x1ba')](_0x4ccc09['id'])[_0x2d5c('0xb8')](function(_0x1b14f6){var _0x33faf3=_0x4ccc09[_0x2d5c('0x142')]-_0x1b14f6[0x0]['outboundQueuePauses'];var _0x30662f=_0x4ccc09['dialPredictiveInterval']*0x3c;var _0x1683bf=_0xedcac9[0x0][_0x2d5c('0x67')]+_0xedcac9[0x0][_0x2d5c('0x82')];var _0x5ba8b3=(_0xedcac9[0x0][_0x2d5c('0x66')]+_0xedcac9[0x0][_0x2d5c('0x68')]+_0xedcac9[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0xedcac9[0x0][_0x2d5c('0x6d')];var _0x1ca383=_0x4ccc09[_0x2d5c('0x1b4')]/0x64;_0x4ccc09['predictiveIntervalPauses']=_0x1b14f6[0x0][_0x2d5c('0x1bb')]||0x0;_0x4ccc09[_0x2d5c('0x6a')]=_0x5ba8b3>0x0?_0x5ba8b3:0x1;return _0x37d847[_0x2d5c('0x1bc')](_0x33faf3,_0x30662f,_0x1683bf,_0x5ba8b3,_0x1ca383);})[_0x2d5c('0xb8')](function(_0x5ef0d4){return _0x2d7ec8(_0x5ef0d4);})[_0x2d5c('0xbb')](function(_0x3de556){return _0x56307c(msgResponse('[CatchErlangB]',_0x2d5c('0x124'),JSON[_0x2d5c('0x44')](_0x3de556)));});}if(_0x4ccc09[_0x2d5c('0x1a8')]===_0x2d5c('0x1b5')){return _0x37d847['getVoiceQueueRtPauses'](_0x4ccc09['id'])[_0x2d5c('0xb8')](function(_0x76d021){var _0x469af7=_0x4ccc09['loggedIn']-_0x76d021[0x0][_0x2d5c('0x1bb')];var _0x298f98=_0x4ccc09['dialPredictiveInterval']*0x3c;var _0x39bfb8=_0xedcac9[0x0][_0x2d5c('0x67')]+_0xedcac9[0x0][_0x2d5c('0x82')];var _0x2d604a=(_0xedcac9[0x0][_0x2d5c('0x66')]+_0xedcac9[0x0][_0x2d5c('0x68')]+_0xedcac9[0x0][_0x2d5c('0x107')])/_0xedcac9[0x0]['predictiveIntervalTotalCalls'];var _0x53a81c=_0x4ccc09[_0x2d5c('0x1b4')]/0x64;_0x4ccc09[_0x2d5c('0x6b')]=_0x76d021[0x0][_0x2d5c('0x1bb')]||0x0;_0x4ccc09[_0x2d5c('0x6a')]=_0x2d604a>0x0?_0x2d604a:0x1;return _0x37d847[_0x2d5c('0x1bd')](_0x469af7,_0x298f98,_0x39bfb8,_0x2d604a,_0x53a81c);})['then'](function(_0x9ab2e1){return _0x2d7ec8(_0x9ab2e1);})['catch'](function(_0x2f3504){return _0x56307c(msgResponse(_0x2d5c('0x1be'),_0x2d5c('0x124'),JSON[_0x2d5c('0x44')](_0x2f3504)));});}}else{return _0x56307c(msgResponse(_0x2d5c('0x1b6'),_0x2d5c('0x124'),'check\x20failure'));}});};};Dialer['prototype'][_0x2d5c('0x1b0')]=function(_0x3d9377){var _0x341a1c=this;return function(){var _0x53400c=0x0;var _0x4fcf3f=Math[_0x2d5c('0x1bf')](_0x3d9377[_0x2d5c('0x70')]*0x3e8);if(_0x4fcf3f>0x0){_0x4fcf3f=_0x4fcf3f<0x64?0x64:_0x4fcf3f;loggerPredictive[_0x2d5c('0x7c')](_0x3d9377[_0x2d5c('0x3a')],'one\x20call\x20every:',_0x4fcf3f,_0x2d5c('0x45'));_0x3d9377['handlePredictive']=setInterval(function(){_0x341a1c['handlePredictive'](_0x3d9377);loggerPredictiveCalls[_0x2d5c('0x7c')](_0x2d5c('0x1c0'),_0x53400c+=0x1);},_0x4fcf3f);}else{loggerPredictive[_0x2d5c('0x7c')](_0x3d9377['name'],_0x2d5c('0x1c1'));}};};Dialer[_0x2d5c('0x1c')][_0x2d5c('0x1c2')]=function(_0x1bc3d,_0x446157){var _0x27447d=this;return function(_0x36adcf){if(_[_0x2d5c('0x7b')](_0x36adcf)){if(_[_0x2d5c('0xad')](_0x446157[_0x2d5c('0xcf')])||!_0x446157[_0x2d5c('0x1c3')]){if(_0x1bc3d[_0x2d5c('0x56')]==='booked'){_0x1bc3d[_0x2d5c('0x111')]=_[_0x2d5c('0x38')](_0x1bc3d['queueStatusComplete'])?!![]:_0x1bc3d['queueStatusComplete'];var _0x3067bb=uuid['v4']();_0x27447d['actions'][_0x3067bb]=new Action(_0x1bc3d,_0x446157,_0x3067bb);loggerBooked['info'](_0x2d5c('0x1c4'),_0x3067bb,_0x2d5c('0x1c5'),JSON[_0x2d5c('0x44')](_0x1bc3d['queueStatusComplete']),_0x2d5c('0x1c6'),_0x1bc3d[_0x2d5c('0x3a')]);if(_0x1bc3d[_0x2d5c('0x111')]){_0x1bc3d['queueStatusComplete']=![];_0x27447d[_0x2d5c('0x29')][_0x27447d[_0x2d5c('0x25')][_0x3067bb][_0x2d5c('0xb3')]]=[];ami['Action']({'actionid':_0x3067bb,'action':'queuestatus','queue':_0x1bc3d[_0x2d5c('0x3a')]})[_0x2d5c('0xbb')](function(_0x179dcc){_0x27447d[_0x2d5c('0xb2')](_0x1bc3d);_0x27447d[_0x2d5c('0x115')]({'active':![],'ContactId':_0x27447d[_0x2d5c('0x25')][_0x3067bb][_0x2d5c('0xcd')],'ListId':_0x27447d[_0x2d5c('0x25')][_0x3067bb]['ListId'],'VoiceQueueId':_0x27447d['actions'][_0x3067bb][_0x2d5c('0xd0')]||undefined,'CampaignId':_0x27447d[_0x2d5c('0x25')][_0x3067bb][_0x2d5c('0xd1')]||undefined})['catch'](loggerCatch(_0x2d5c('0x1c7')));delete _0x27447d[_0x2d5c('0x25')][_0x3067bb];});}else{loggerBooked[_0x2d5c('0x7c')](_0x2d5c('0x1c8'),JSON['stringify'](_0x1bc3d[_0x2d5c('0x111')]),_0x2d5c('0x1c6'),_0x1bc3d['name']);_0x27447d['updateOriginated'](_0x1bc3d);_0x27447d[_0x2d5c('0x115')]({'active':![],'ContactId':_0x27447d[_0x2d5c('0x25')][_0x3067bb][_0x2d5c('0xcd')],'ListId':_0x27447d[_0x2d5c('0x25')][_0x3067bb]['ListId'],'VoiceQueueId':_0x27447d[_0x2d5c('0x25')][_0x3067bb][_0x2d5c('0xd0')]||undefined,'CampaignId':_0x27447d[_0x2d5c('0x25')][_0x3067bb][_0x2d5c('0xd1')]||undefined})['catch'](loggerCatch(_0x2d5c('0x1c7')));delete _0x27447d[_0x2d5c('0x25')][_0x3067bb];}}else{return _0x27447d[_0x2d5c('0x14c')](_0x1bc3d,_0x446157);}}else{if(getDiff(_0x446157[_0x2d5c('0x1c9')])<_0x1bc3d[_0x2d5c('0x1ca')]*0x3c){_0x27447d['preview']['run'](_0x446157['id'])[_0x2d5c('0x1e')](function(){_0x27447d[_0x2d5c('0xb2')](_0x1bc3d);});}else{_0x1bc3d[_0x2d5c('0x63')]+=0x1;_0x27447d[_0x2d5c('0xb2')](_0x1bc3d);if(_0x1bc3d[_0x2d5c('0x1cb')]){_0x27447d['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x446157[_0x2d5c('0xcd')],'ListId':_0x446157['ListId'],'VoiceQueueId':_0x446157[_0x2d5c('0xd0')]||undefined,'CampaignId':_0x446157[_0x2d5c('0xd1')]||undefined})[_0x2d5c('0xbb')](loggerCatch(_0x2d5c('0x1cc')));_0x27447d[_0x2d5c('0xc5')](createObjHistory(_0x1bc3d,_0x446157,_0x2d5c('0x1cd'),0x17,'RecallInQueue'))[_0x2d5c('0xbb')](loggerCatch(_0x2d5c('0x1ce')));}else{_0x27447d[_0x2d5c('0xcb')](createObjHistory(_0x1bc3d,_0x446157,_0x2d5c('0x1cf'),0x16,_0x2d5c('0x1d0')),_0x2d5c('0x1d1'),_0x2d5c('0x1d2'));}}}}else{_0x1bc3d[_0x2d5c('0x5d')]+=0x1;_0x27447d[_0x2d5c('0xcb')](createObjHistory(_0x1bc3d,_0x446157,_0x2d5c('0x1d3'),0xd,_0x2d5c('0x1d4')),_0x2d5c('0x1d5'),'[Originate][MoveBlacklist]');throw _0x2d5c('0x1d6');}};};Dialer[_0x2d5c('0x1c')]['handleIvr']=function(_0x110996){var _0x553374=this;var _0x45df04=[];var _0x517fd3=_0x110996[_0x2d5c('0x1d7')]-_0x110996['originated']-_0x110996[_0x2d5c('0x1d8')];emitCampaignSummary(_0x110996);if(_0x517fd3>0x0){if(_0x517fd3>this[_0x2d5c('0x1d9')]){_0x517fd3=this['maxNumberOriginate'];}_0x110996[_0x2d5c('0x1d8')]+=_0x517fd3;this[_0x2d5c('0xc2')](_0x110996['id'],_0x517fd3,_0x110996[_0x2d5c('0x1da')])['then'](function(_0x1321e8){_0x110996[_0x2d5c('0x1d8')]-=_0x517fd3;_0x110996['temp']=_0x110996['temp']>0x0?_0x110996[_0x2d5c('0x1d8')]:0x0;if(!checkContactEmpty(_0x1321e8)){_0x110996['message']=_0x2d5c('0x9e');logger[_0x2d5c('0x7c')]('[getContactCampaign2][Empty]'+_0x110996['name']);}else{_0x110996[_0x2d5c('0x6e')]+=_0x1321e8[_0x2d5c('0x9a')];_0x110996[_0x2d5c('0x41')]=_0x2d5c('0x1db');for(var _0x1a15e4=0x0;_0x1a15e4<_0x1321e8[_0x2d5c('0x9a')];_0x1a15e4+=0x1){_0x110996[_0x2d5c('0x1dc')]+=0x1;if(_[_0x2d5c('0xad')](_0x1321e8[_0x1a15e4])||_['isNil'](_0x1321e8[_0x1a15e4][_0x2d5c('0x150')])||_[_0x2d5c('0xad')](_0x1321e8[_0x1a15e4][_0x2d5c('0x150')][_0x2d5c('0x151')])){_0x553374[_0x2d5c('0xca')](_0x2d5c('0x1dd'),_0x110996,_0x1321e8[_0x1a15e4]);}else{_0x553374[_0x2d5c('0xbd')](_['pick'](_0x1321e8[_0x1a15e4],[_0x2d5c('0xd1'),_0x2d5c('0x1de')]))[_0x2d5c('0xb8')](_0x553374[_0x2d5c('0x1c2')](_0x110996,_0x1321e8[_0x1a15e4]))['catch'](_0x553374[_0x2d5c('0xc9')]('[actionOriginateIvr]\x20',_0x110996));}}}})[_0x2d5c('0xbb')](loggerGetContactDialer(_0x2d5c('0x1df'),_0x110996,_0x517fd3));}};Dialer[_0x2d5c('0x1c')]['handlePower']=function(_0x471671,_0x41d2e9){var _0x41e732=this;var _0x39c091=[];var _0x163072=_0x41d2e9>=0x1?_0x41d2e9:0x1;var _0x1d78ce=[];if(_0x471671[_0x2d5c('0x56')]==='booked'){_0x163072=0x1;}var _0x3d28f2=Math['floor'](_0x471671[_0x2d5c('0x4b')]*_0x163072)-_0x471671[_0x2d5c('0x6e')]-_0x471671[_0x2d5c('0x1d8')];emitVoiceQueueSummary(_0x471671);if(_0x471671[_0x2d5c('0x1e0')]>0x0){var _0x290f22=_0x471671[_0x2d5c('0x1e0')]-_0x471671[_0x2d5c('0x6e')]-_0x471671['talking']-_0x471671[_0x2d5c('0x1d8')]-_0x471671[_0x2d5c('0x4c')];if(_0x3d28f2>_0x290f22){_0x3d28f2=_0x290f22;}}if(_0x3d28f2>0x0){if(_0x471671[_0x2d5c('0x56')]===_0x2d5c('0x6')){_0x3d28f2=0x1;}if(_0x3d28f2>this[_0x2d5c('0x1d9')]){_0x3d28f2=this[_0x2d5c('0x1d9')];}_0x471671[_0x2d5c('0x1d8')]+=_0x3d28f2;for(var _0x540fed in this['agents']){if(this[_0x2d5c('0x23')][_0x2d5c('0x9b')](_0x540fed)){if(this[_0x2d5c('0x23')][_0x540fed][_0x2d5c('0xa7')]===_0x2d5c('0x1e1')&&this[_0x2d5c('0x23')][_0x540fed][_0x2d5c('0xaf')]===_0x2d5c('0xd8')){_0x39c091[_0x2d5c('0x12b')](this[_0x2d5c('0x23')][_0x540fed]['id']);}}}this[_0x2d5c('0xc1')](_0x471671['id'],_0x39c091,_0x3d28f2,_0x471671[_0x2d5c('0x1da')])[_0x2d5c('0xb8')](function(_0x66cdd5){_0x471671[_0x2d5c('0x1d8')]-=_0x3d28f2;_0x471671[_0x2d5c('0x1d8')]=_0x471671[_0x2d5c('0x1d8')]>0x0?_0x471671[_0x2d5c('0x1d8')]:0x0;if(!checkContactEmpty(_0x66cdd5)){_0x41e732['countReScheduled'](_0x471671)['then'](sendMessageReschedule(_0x471671))['catch'](loggerCatch(_0x2d5c('0xb9')));}else{_0x471671['originated']+=_0x66cdd5[_0x2d5c('0x9a')];_0x471671[_0x2d5c('0x41')]=_0x471671[_0x2d5c('0x56')]==='booked'?_0x2d5c('0x158'):_0x2d5c('0x1db');for(var _0x3d1313=0x0;_0x3d1313<_0x66cdd5['length'];_0x3d1313+=0x1){if(_['isNil'](_0x66cdd5[_0x3d1313])||_[_0x2d5c('0xad')](_0x66cdd5[_0x3d1313][_0x2d5c('0x150')])||_['isNil'](_0x66cdd5[_0x3d1313]['Contact'][_0x2d5c('0x151')])){_0x41e732[_0x2d5c('0xca')](_0x2d5c('0x1dd'),_0x471671,_0x66cdd5[_0x3d1313]);}else{_0x41e732[_0x2d5c('0xba')](_[_0x2d5c('0xcc')](_0x66cdd5[_0x3d1313],['VoiceQueueId',_0x2d5c('0x1de')]))[_0x2d5c('0xb8')](_0x41e732['checkContactBlack'](_0x471671,_0x66cdd5[_0x3d1313]))[_0x2d5c('0xbb')](_0x41e732[_0x2d5c('0xc9')](_0x2d5c('0x1dd'),_0x471671));}}}})[_0x2d5c('0xbb')](loggerGetContactDialer(_0x2d5c('0x1e2'),_0x471671,_0x3d28f2));}};Dialer[_0x2d5c('0x1c')][_0x2d5c('0x92')]=function(_0x41c0f5){var _0x43589a=this;if(_0x41c0f5[_0x2d5c('0x1e0')]>0x0){var _0x136faa=_0x41c0f5[_0x2d5c('0x1e0')]-_0x41c0f5[_0x2d5c('0x6e')]-_0x41c0f5[_0x2d5c('0xa1')];if(_0x136faa>0x0){this['tryOriginatePredictive'](_0x41c0f5);}else{loggerPredictiveCalls[_0x2d5c('0x7c')](_0x2d5c('0x1e3'));}}else{this[_0x2d5c('0x1e4')](_0x41c0f5);}};Dialer[_0x2d5c('0x1c')][_0x2d5c('0x1e4')]=function(_0x587c6a){var _0x1943f5=this;var _0x3e32ef=[];_0x587c6a[_0x2d5c('0x6e')]+=0x1;for(var _0x3b6a89 in this[_0x2d5c('0x23')]){if(this['agents'][_0x2d5c('0x9b')](_0x3b6a89)){if(this['agents'][_0x3b6a89]['state']==='not_inuse'&&this[_0x2d5c('0x23')][_0x3b6a89][_0x2d5c('0xaf')]===_0x2d5c('0xd8')){_0x3e32ef[_0x2d5c('0x12b')](this[_0x2d5c('0x23')][_0x3b6a89]['id']);}}}this[_0x2d5c('0xc1')](_0x587c6a['id'],_0x3e32ef,0x1,_0x587c6a[_0x2d5c('0x1da')])[_0x2d5c('0xb8')](function(_0x294dd9){if(!checkContactEmpty(_0x294dd9)){checkContactLowerLimitOriginate(_0x587c6a,0x1,0x0);_0x1943f5[_0x2d5c('0xb6')](_0x587c6a)[_0x2d5c('0xb8')](sendMessageReschedule(_0x587c6a))[_0x2d5c('0xbb')](loggerCatch(_0x2d5c('0xb9')));}else{_0x587c6a[_0x2d5c('0x41')]='RUNNING';if(_[_0x2d5c('0xad')](_0x294dd9[0x0])||_[_0x2d5c('0xad')](_0x294dd9[0x0][_0x2d5c('0x150')])||_['isNil'](_0x294dd9[0x0][_0x2d5c('0x150')][_0x2d5c('0x151')])){_0x1943f5[_0x2d5c('0xca')]('[actionOriginate]\x20',_0x587c6a,_0x294dd9[0x0]);}else{_0x1943f5[_0x2d5c('0xba')](_['pick'](_0x294dd9[0x0],[_0x2d5c('0xd0'),_0x2d5c('0x1de')]))[_0x2d5c('0xb8')](_0x1943f5[_0x2d5c('0x1c2')](_0x587c6a,_0x294dd9[0x0]))[_0x2d5c('0xbb')](_0x1943f5['loggerHandler'](_0x2d5c('0x1e5'),_0x587c6a));}}})[_0x2d5c('0xbb')](loggerGetContactDialer('[getContactDialerPredictive]',_0x587c6a,0x1));emitVoiceQueueSummary(_0x587c6a);};Dialer[_0x2d5c('0x1c')][_0x2d5c('0x1bc')]=function(_0x37f8ea,_0x325c52,_0x2f34db,_0x5c89fe,_0x3210de,_0x39bc9b){loggerPredictive['info'](_0x2d5c('0x1e6'));loggerPredictive[_0x2d5c('0x7c')]('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',_0x37f8ea);loggerPredictive[_0x2d5c('0x7c')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x325c52);loggerPredictive[_0x2d5c('0x7c')](_0x2d5c('0x1e7'),_0x2f34db);loggerPredictive[_0x2d5c('0x7c')](_0x2d5c('0x1e8'),_0x5c89fe);loggerPredictive[_0x2d5c('0x7c')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3210de);loggerPredictive[_0x2d5c('0x7c')](_0x2d5c('0x84'));return new BPromise(function(_0x215409,_0x5b00c4){if(_0x37f8ea<=0x0||isNaN(_0x37f8ea)){return _0x5b00c4(msgResponse(_0x2d5c('0x1e9'),'Error',_0x2d5c('0x1ea')+_0x37f8ea));}if(_0x2f34db<=0x0||isNaN(_0x2f34db)){return _0x5b00c4(msgResponse(_0x2d5c('0x1e9'),_0x2d5c('0x43'),'Ts\x20=\x20'+_0x2f34db));}if(_0x5c89fe<=0x0||isNaN(_0x5c89fe)){return _0x5b00c4(msgResponse(_0x2d5c('0x1e9'),'Error',_0x2d5c('0x1eb')+_0x5c89fe));}if(_0x325c52<=0x0||isNaN(_0x325c52)){return _0x5b00c4(msgResponse(_0x2d5c('0x1e9'),_0x2d5c('0x43'),'interval\x20=\x20'+_0x325c52));}if(_0x3210de<=0x0||isNaN(_0x3210de)){return _0x5b00c4(msgResponse(_0x2d5c('0x1e9'),_0x2d5c('0x43'),_0x2d5c('0x1ec')+_0x3210de));}_0x39bc9b=_0x39bc9b||0x0;var _0x143b07=0x1/_0x2f34db;var _0x4c3a8b=0x0;var _0x1d2087=0x0;var _0x58bc1c=0x0;var _0x439177=0x0;for(var _0x225dc4=0x0;_0x58bc1c<_0x3210de;_0x225dc4+=0x1){_0x1d2087=_0x225dc4/_0x325c52;_0x4c3a8b=(_0x5c89fe*_0x1d2087+_0x39bc9b)/_0x143b07;_0x58bc1c=erlangb(_0x4c3a8b,_0x37f8ea);_0x439177=_0x4c3a8b/_0x37f8ea*(0x1-erlangb(_0x4c3a8b,_0x37f8ea));}return _0x215409({'erlangCalls':_0x225dc4,'erlangCallToSecond':_0x325c52/_0x225dc4,'erlangAbandonmentRate':_0x58bc1c,'erlangBusyFactor':_0x439177});});};Dialer[_0x2d5c('0x1c')][_0x2d5c('0x1bd')]=function(_0x5c0819,_0x2b6ac0,_0xc78a8,_0x4b4eeb,_0x496c64,_0x23d808){loggerPredictive[_0x2d5c('0x7c')](_0x2d5c('0x1ed'));loggerPredictive[_0x2d5c('0x7c')](_0x2d5c('0x1ee'),_0x5c0819);loggerPredictive[_0x2d5c('0x7c')](_0x2d5c('0x1ef'),_0x2b6ac0);loggerPredictive[_0x2d5c('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',_0xc78a8);loggerPredictive[_0x2d5c('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',_0x4b4eeb);loggerPredictive[_0x2d5c('0x7c')](_0x2d5c('0x1f0'),_0x496c64);loggerPredictive[_0x2d5c('0x7c')]('---------------------------');return new BPromise(function(_0x1b9666,_0x58331b){if(_0x5c0819<=0x0||isNaN(_0x5c0819)){return _0x58331b(msgResponse(_0x2d5c('0x1f1'),'Error',_0x2d5c('0x1ea')+_0x5c0819));}if(_0xc78a8<=0x0||isNaN(_0xc78a8)){return _0x58331b(msgResponse(_0x2d5c('0x1f1'),_0x2d5c('0x43'),_0x2d5c('0x1f2')+_0xc78a8));}if(_0x4b4eeb<=0x0||isNaN(_0x4b4eeb)){return _0x58331b(msgResponse('[busyFactor]',_0x2d5c('0x43'),'p\x20=\x20'+_0x4b4eeb));}if(_0x2b6ac0<=0x0||isNaN(_0x2b6ac0)){return _0x58331b(msgResponse(_0x2d5c('0x1f1'),_0x2d5c('0x43'),_0x2d5c('0x1f3')+_0x2b6ac0));}if(_0x496c64<=0x0||isNaN(_0x496c64)){return _0x58331b(msgResponse(_0x2d5c('0x1f1'),_0x2d5c('0x43'),_0x2d5c('0x1f4')+_0x496c64));}_0x23d808=_0x23d808||0x0;var _0x133410=0x1/_0xc78a8;var _0x4fbbad=0x0;var _0x9c2f37=0x0;var _0x1a2262=0x0;var _0x1ed194=0x0;for(var _0x5212d8=0x0;_0x1ed194<_0x496c64;_0x5212d8+=0x1){_0x9c2f37=_0x5212d8/_0x2b6ac0;_0x4fbbad=(_0x4b4eeb*_0x9c2f37+_0x23d808)/_0x133410;_0x1a2262=erlangb(_0x4fbbad,_0x5c0819);_0x1ed194=_0x4fbbad/_0x5c0819*(0x1-erlangb(_0x4fbbad,_0x5c0819));}return _0x1b9666({'erlangCalls':_0x5212d8,'erlangCallToSecond':_0x2b6ac0/_0x5212d8,'erlangAbandonmentRate':_0x1a2262,'erlangBusyFactor':_0x1ed194});});};module[_0x2d5c('0x1f5')]=Dialer;