Built motion from commit 10af8726.|2.6.34
[motion2.git] / server / services / ami / preview / index.js
index 02704ef..a233bdc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc35e=['custom:agentConnectPreview','channelAgent','custom:agentcomplete','complete','outboundAnswerCallsDay','answered','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','sumBillable','[syncHangup][talking][decrement]','\x20Queue','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','busy','verifyAdditionalPhones','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','unlockAgent','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','NoAnswer','buildNoAnswerEventPayload','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','incrementPreviewCounters','CONGESTION','outboundCongestionCallsDay','countcongestionretry','Congestion','dialCongestionRetryFrequency','congestion','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','outboundRejectCallsDay','countagentrejectretry','agentreject','AgentReject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','amd','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalking][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','decrementOriginate','[callProgressDetectingCustomer]','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[swapAdditionalPhone]\x20','[incrementPreviewCounters]\x20','checkInBlack','Contact','phone','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','createHistory','[Blacklist][error]','active','SIP/%s','reachable','unmonitored','run','execRun','getContactPreview','recallme','isValid','checkIsBlackList','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','validateContact','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','ACTIVE','[Preview][validateContact][Empty\x20Campaign]','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','Trunk\x20not\x20working\x20correctly','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','dialPrefix','substring','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','dialOriginateCallerIdName','originatecalleridname','extractCalleridName','extractCalleridNumber','addVariables','setXMDContactVariables','assign','toLowerVariables','starttime','variablesAction','Action','[originated][increment]','[originateFailure][logOriginateFailure]','actionid','clone','isFailure','response','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','dialQueueProject','channelstate','transfer','unlockContact','callProgressDetectingAgent','[syncHangup][talking][transfer]','[syncHangup][talking][cause]','destlinkedid','destuniqueid','addVariable','variables','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','util','lodash','uuid','moment','ioredis','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','../rpc/cmHopperAdditionalPhone','./util/util','../dialer/utils','redis','defaults','localhost','socket.io-emitter','enqueue','tail','finally','sequence','campaignsPreview','trunks','actions','agents','syncOriginateResponse','bind','syncHangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','emit','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','format','voice:queue:%s','name','sendMessageOneNotActive','originated','pTalking','available','paused','message','CAMPAIGN_STATUS','INACTIVE','logger','\x20is\x20not\x20active','DEACTIVATED','[CampaignPreview]\x20Campaign\x20Queue:\x20','prototype','loopCampaigns','syncCampaigns','clockClearZombieChannels','hasOwnProperty','dialMethod','booked','clearZombieChannels','type','outbound','dialActive','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','UserId','VoiceQueueId','status','channel','catch','No\x20such\x20channel','decrementTalking','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','size','getContactRecallMe','agentReadyId','then','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','logger2','[RecallMe]','disableContact','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','loggedIn','isActive','Trunk','isTrunkReachable','TrunkBackup','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','buildObj','[callProgressDetectingCustomer][logNoSuch]','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','activeContact','linkedid','actioncountonusuch','idContact','swapAdditionalPhones','ANSWER','[syncHangup][talking][increment]','uniqueid','connect','acw'];(function(_0x31216b,_0x4ccdaf){var _0x24a7b3=function(_0x5977db){while(--_0x5977db){_0x31216b['push'](_0x31216b['shift']());}};_0x24a7b3(++_0x4ccdaf);}(_0xc35e,0x1e9));var _0xec35=function(_0x130375,_0x4cee28){_0x130375=_0x130375-0x0;var _0x457d9e=_0xc35e[_0x130375];return _0x457d9e;};'use strict';var util=require(_0xec35('0x0'));var _=require(_0xec35('0x1'));var uuid=require(_0xec35('0x2'));var moment=require(_0xec35('0x3'));var Redis=require(_0xec35('0x4'));var config=require(_0xec35('0x5'));var logger=require('../../../config/logger')(_0xec35('0x6'));var loggerAction=require(_0xec35('0x7'))(_0xec35('0x8'));var ami=require(_0xec35('0x9'));var rpcDb=require('./rpcDb');var cmHopperAdditionalPhone=require(_0xec35('0xa'));var Action=require('./action');var ut=require(_0xec35('0xb'));var utils=require(_0xec35('0xc'));config[_0xec35('0xd')]=_[_0xec35('0xe')](config[_0xec35('0xd')],{'host':_0xec35('0xf'),'port':0x18eb});var io=require(_0xec35('0x10'))(new Redis(config[_0xec35('0xd')]));var Sequence=function(){};Sequence['prototype'][_0xec35('0x11')]=function(_0x4acd5d){this[_0xec35('0x12')]=this[_0xec35('0x12')]?this[_0xec35('0x12')][_0xec35('0x13')](_0x4acd5d):_0x4acd5d();};function Preview(_0x4f2510){this[_0xec35('0x14')]=new Sequence();this[_0xec35('0x15')]=_0x4f2510['voiceQueues'];this[_0xec35('0x16')]=_0x4f2510['trunks'];this[_0xec35('0x17')]={};this['agents']=_0x4f2510[_0xec35('0x18')];this['clockClearZombieChannels']=0x0;ami['on']('originateresponse',this[_0xec35('0x19')][_0xec35('0x1a')](this));ami['on']('hangup',this[_0xec35('0x1b')][_0xec35('0x1a')](this));ami['on'](_0xec35('0x1c'),this[_0xec35('0x1d')][_0xec35('0x1a')](this));ami['on'](_0xec35('0x1e'),this[_0xec35('0x1f')][_0xec35('0x1a')](this));ami['on'](_0xec35('0x20'),this[_0xec35('0x21')][_0xec35('0x1a')](this));ami['on'](_0xec35('0x22'),this[_0xec35('0x23')]['bind'](this));ami['on'](_0xec35('0x24'),this[_0xec35('0x25')][_0xec35('0x1a')](this));ami['on'](_0xec35('0x26'),this[_0xec35('0x27')]['bind'](this));this['loopCampaigns'](this[_0xec35('0x15')]);}function emit(_0x51f949,_0x434dce,_0x19512a){io['to'](_0x51f949)[_0xec35('0x28')](_0x434dce,_0x19512a);}function emitVoiceQueueChannelRemove(_0x33b180){logger[_0xec35('0x29')](_0xec35('0x2a'),JSON[_0xec35('0x2b')](_0x33b180));emit(util[_0xec35('0x2c')](_0xec35('0x2d'),_0x33b180[_0xec35('0x2e')]),'voice_queue_channel:remove',_0x33b180);io[_0xec35('0x28')]('voice_queue_presence:remove',_0x33b180);}function notSendMessagesQueue(_0x148553){if(_0x148553[_0xec35('0x2f')]){if(_0x148553[_0xec35('0x30')]===0x0&&_0x148553[_0xec35('0x31')]===0x0){_0x148553[_0xec35('0x2f')]=![];_0x148553[_0xec35('0x32')]=0x0;_0x148553[_0xec35('0x33')]=0x0;_0x148553[_0xec35('0x34')]=utils[_0xec35('0x35')][_0xec35('0x36')];ut[_0xec35('0x37')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x148553[_0xec35('0x2e')]+_0xec35('0x38'));}else{_0x148553['message']=utils[_0xec35('0x35')][_0xec35('0x39')];ut[_0xec35('0x37')](_0xec35('0x3a'),_0x148553[_0xec35('0x2e')]+'\x20is\x20deactivated');}}}Preview[_0xec35('0x3b')][_0xec35('0x3c')]=function(){var _0x2528d7=this;setInterval(function(){_0x2528d7[_0xec35('0x3d')]();},0x7cf);};Preview[_0xec35('0x3b')][_0xec35('0x3d')]=function(){var _0xb23958=this[_0xec35('0x15')];this[_0xec35('0x3e')]+=0x1;for(var _0x130d2d in _0xb23958){if(_0xb23958[_0xec35('0x3f')](_0x130d2d)&&(_0xb23958[_0x130d2d][_0xec35('0x40')]===_0xec35('0x6')||_0xb23958[_0x130d2d][_0xec35('0x40')]===_0xec35('0x41'))&&_0xb23958[_0x130d2d]['type']==='outbound'){if(this['clockClearZombieChannels']>0x7){this[_0xec35('0x3e')]=0x0;this[_0xec35('0x42')]();}}if(_0xb23958['hasOwnProperty'](_0x130d2d)&&_0xb23958[_0x130d2d][_0xec35('0x40')]==='preview'&&_0xb23958[_0x130d2d][_0xec35('0x43')]===_0xec35('0x44')){if(_0xb23958[_0x130d2d][_0xec35('0x45')]){this[_0xec35('0x46')](_0xb23958[_0x130d2d]);if(_0xb23958[_0x130d2d][_0xec35('0x47')])this[_0xec35('0x48')](_0xb23958[_0x130d2d]);}else{notSendMessagesQueue(_0xb23958[_0x130d2d]);}}}};Preview[_0xec35('0x3b')][_0xec35('0x49')]=function(_0xb46ca5){var _0x93529=this;this['sequence'][_0xec35('0x11')](function(){if(!_[_0xec35('0x4a')](_0x93529[_0xec35('0x17')][_0xb46ca5])){loggerAction[_0xec35('0x29')](_0xec35('0x4b'),_0xb46ca5,_0xec35('0x4c'),_0x93529[_0xec35('0x17')][_0xb46ca5][_0xec35('0x4d')],_0xec35('0x4e'),JSON[_0xec35('0x2b')](_0x93529['campaignsPreview'][_0x93529[_0xec35('0x17')][_0xb46ca5][_0xec35('0x4d')]][_0xec35('0x30')]),_0xec35('0x4f'),JSON[_0xec35('0x2b')](_0x93529[_0xec35('0x15')][_0x93529[_0xec35('0x17')][_0xb46ca5][_0xec35('0x4d')]]['pTalking']),JSON[_0xec35('0x2b')](_0x93529[_0xec35('0x17')][_0xb46ca5][_0xec35('0x50')]),JSON[_0xec35('0x2b')](_[_0xec35('0x51')](_0x93529[_0xec35('0x17')][_0xb46ca5],['contactId',_0xec35('0x52'),_0xec35('0x53'),'ListId'])));return ami['Action']({'action':_0xec35('0x54'),'channel':_0x93529[_0xec35('0x17')][_0xb46ca5][_0xec35('0x55')]})[_0xec35('0x56')](function(_0x28238e){if(_0x28238e['message']===_0xec35('0x57')){setTimeout(function(){if(_0x93529[_0xec35('0x17')][_0xb46ca5]){utils['decrementOriginate'](_0x93529['campaignsPreview'][_0x93529['actions'][_0xb46ca5][_0xec35('0x4d')]],'[clearZombieChannel]');if(_0x93529[_0xec35('0x17')][_0xb46ca5][_0xec35('0x50')]===!![]){ut[_0xec35('0x58')](_0x93529[_0xec35('0x15')][_0x93529[_0xec35('0x17')][_0xb46ca5][_0xec35('0x4d')]],_0xec35('0x59'));ut[_0xec35('0x5a')](_0xec35('0x5b')+_0xb46ca5,_0x93529[_0xec35('0x17')][_0xb46ca5]['queue']);}ut[_0xec35('0x5a')](_0xec35('0x5c')+_0xb46ca5,_0x93529[_0xec35('0x17')][_0xb46ca5]['queue']);delete _0x93529[_0xec35('0x17')][_0xb46ca5];}},0x2328);}});}});};Preview[_0xec35('0x3b')][_0xec35('0x42')]=function(){var _0x4dac1b=this;loggerAction['info']('[action]',_[_0xec35('0x5d')](this[_0xec35('0x17')]));for(var _0x2f1d3e in this[_0xec35('0x17')]){if(_0x4dac1b[_0xec35('0x17')][_0xec35('0x3f')](_0x2f1d3e)){_0x4dac1b['clearZombieChannel'](_0x2f1d3e);}}};Preview[_0xec35('0x3b')][_0xec35('0x48')]=function(_0x935ada){var _0x292a25=this;rpcDb[_0xec35('0x5e')](_0x935ada['id'],ut[_0xec35('0x5f')](this[_0xec35('0x18')]))[_0xec35('0x60')](function(_0x32c41c){if(!_[_0xec35('0x4a')](_0x32c41c)){for(var _0x59ddf1=0x0;_0x59ddf1<_0x32c41c[_0xec35('0x61')];_0x59ddf1+=0x1){if(ut[_0xec35('0x62')](_0x32c41c[_0x59ddf1][_0xec35('0x63')])<_0x935ada[_0xec35('0x64')]*0x3c){if(_0x32c41c[_0x59ddf1]['Agent']&&!_0x32c41c[_0x59ddf1][_0xec35('0x65')]['voicePause']){_0x292a25['run'](_0x32c41c[_0x59ddf1]['id'])[_0xec35('0x60')](ut[_0xec35('0x66')](_0xec35('0x67')))['catch'](ut['logger2']('[RecallMe]'));}else{rpcDb[_0xec35('0x68')](_0x32c41c[_0x59ddf1]['id']);}}else{var _0x512dae=new Action(_0x32c41c[_0x59ddf1],_0x935ada);_0x512dae['starttime']=moment()['format'](_0xec35('0x69'));_0x935ada[_0xec35('0x6a')]+=0x1;ut[_0xec35('0x6b')](_0x512dae,0x17,_0xec35('0x6c'));if(_0x935ada[_0xec35('0x6d')]){rpcDb[_0xec35('0x6e')](ut[_0xec35('0x6f')](_0x32c41c[_0x59ddf1]));rpcDb[_0xec35('0x70')](_0x512dae,_0xec35('0x71'));}else{ut['logCustomer'](_0x512dae,0x16,_0xec35('0x72'));rpcDb[_0xec35('0x70')](_0x512dae,_0xec35('0x73'));rpcDb[_0xec35('0x74')](_0x512dae,_0xec35('0x73'));}}}}})[_0xec35('0x56')](ut[_0xec35('0x66')](_0xec35('0x75')));};Preview['prototype'][_0xec35('0x46')]=function(_0x38f550){_0x38f550[_0xec35('0x2f')]=!![];if(ut['IsNotLoggedIn'](_0x38f550[_0xec35('0x76')])){_0x38f550[_0xec35('0x34')]=utils['CAMPAIGN_STATUS']['NO_AGENTS_LOGGED'];}else if(!ut[_0xec35('0x77')](_0x38f550[_0xec35('0x45')])){_0x38f550['message']=utils[_0xec35('0x35')][_0xec35('0x36')];}else if(!this['isTrunkReachable'](_0x38f550[_0xec35('0x78')])){if(!this[_0xec35('0x79')](_0x38f550[_0xec35('0x7a')])){_0x38f550[_0xec35('0x34')]=utils[_0xec35('0x35')]['UNREACHABLE_TRUNK'];}else{_0x38f550[_0xec35('0x34')]=utils[_0xec35('0x35')]['ACTIVE'];}}else{_0x38f550[_0xec35('0x34')]=utils[_0xec35('0x35')]['ACTIVE'];}};Preview[_0xec35('0x3b')][_0xec35('0x7b')]=function(_0x5f2026,_0x240369,_0x15876b){var _0x17a81f=this;var _0x3a739a=this[_0xec35('0x17')][_0x240369];var _0x5decba=this[_0xec35('0x15')][_0x3a739a[_0xec35('0x4d')]];var _0x252fc8;var _0x1b7c31=![];var _0xfd3f41=0x2;var _0x6605ea=0x3;if(_0x5decba){switch(_0x15876b){case'1':_0x5decba['outboundNoSuchCallsDay']+=0x1;_0x3a739a[_0xec35('0x7c')]+=0x1;_0x3a739a[_0xec35('0x7d')]=ut[_0xec35('0x7e')](_0x3a739a);ut[_0xec35('0x6b')](_0x3a739a,0x0,_0xec35('0x7f'));ami[_0xec35('0x28')]('custom:agentnosuchnumber',ut[_0xec35('0x80')](_0x3a739a,'nosuchnumber'));rpcDb[_0xec35('0x70')](_0x3a739a,_0xec35('0x81'));_0x17a81f['verifyAdditionalPhones'](_0x3a739a,'0',_0x5decba)[_0xec35('0x60')](function(_0x53658b){_0x1b7c31=_0x53658b[_0xec35('0x82')]==0x1;_0xfd3f41=_0x5decba[_0xec35('0x83')];_0x6605ea=_0x5decba[_0xec35('0x84')];if(!_0x1b7c31){if(ut['totalGlobal'](_0x3a739a)>=_0x5decba[_0xec35('0x85')]){_0x252fc8=ut[_0xec35('0x86')](_0x3a739a,0xf,_0xec35('0x87'));rpcDb[_0xec35('0x74')](_0x252fc8,_0xec35('0x88'));}else{if(_0x3a739a['countnosuchnumberretry']>=_0x5decba['dialNoSuchNumberMaxRetry']){rpcDb['createCustomerFinal'](_0x3a739a,_0xec35('0x88'));}else{rpcDb[_0xec35('0x89')](ut[_0xec35('0x8a')](_0x3a739a,_0xec35('0x7c'),_0x5decba[_0xec35('0x83')]),_0x3a739a['unlockAgent'],_0x3a739a[_0xec35('0x8b')]);}}delete this[_0xec35('0x17')][_0x5f2026[_0xec35('0x8c')]];}else{_0x3a739a[_0xec35('0x7c')]++;logger['info'](_0xec35('0x8d'),_0x3a739a[_0xec35('0x7c')]);logger[_0xec35('0x29')]('id',_0x3a739a[_0xec35('0x8e')]);_0x17a81f['incrementPreviewCounters']({'id':_0x3a739a['idContact'],'field':{'countnosuchnumberretry':_0x3a739a['countnosuchnumberretry']}})[_0xec35('0x60')](function(){_0x17a81f[_0xec35('0x8f')](_0x3a739a,_0xfd3f41,_0x6605ea)['then'](function(){});});}});break;case _0xec35('0x90'):var _0x42e4ea=moment()['format'](_0xec35('0x69'));_0x3a739a['responsetime']=_0x42e4ea;_0x3a739a['answertime']=_0x42e4ea;_0x3a739a[_0xec35('0x50')]=!![];_0x5decba[_0xec35('0x31')]+=0x1;logger['info'](_0xec35('0x91'),_0x3a739a[_0xec35('0x92')],'\x20Queue',_0x5decba[_0xec35('0x2e')],_0xec35('0x4f'),_0x5decba[_0xec35('0x31')]);ami[_0xec35('0x28')]('custom:agentconnect',ut['buildObj'](_0x3a739a,_0xec35('0x93'),this[_0xec35('0x15')][_0x3a739a[_0xec35('0x4d')]]));if(_0x5decba[_0xec35('0x94')]||_0x5decba['mandatoryDisposition']){ami[_0xec35('0x28')](_0xec35('0x95'),{'queue':_0x3a739a['queue'],'interface':_0x3a739a[_0xec35('0x96')],'uniqueid':_0x3a739a[_0xec35('0x92')]});}break;case'16':ami[_0xec35('0x28')](_0xec35('0x97'),ut[_0xec35('0x80')](_0x3a739a,_0xec35('0x98'),this[_0xec35('0x15')][_0x3a739a[_0xec35('0x4d')]]));emitVoiceQueueChannelRemove(ut[_0xec35('0x80')](_0x3a739a,_0xec35('0x98')));_0x5decba[_0xec35('0x99')]+=0x1;_0x5decba['total']+=0x1;_0x5decba[_0xec35('0x9a')]+=0x1;ut[_0xec35('0x58')](_0x5decba,_0xec35('0x9b'));_0x3a739a[_0xec35('0x7d')]=ut[_0xec35('0x7e')](_0x3a739a);ut[_0xec35('0x6b')](_0x3a739a,0x4,_0xec35('0x9c'));rpcDb[_0xec35('0x70')](_0x3a739a,_0xec35('0x9d'));rpcDb[_0xec35('0x74')](_0x3a739a,_0xec35('0x9e'));rpcDb[_0xec35('0x9f')](_0x3a739a);_0x5decba['sumDuration']+=_0x3a739a[_0xec35('0xa0')];_0x5decba[_0xec35('0xa1')]+=_0x3a739a[_0xec35('0xa0')];logger[_0xec35('0x29')](_0xec35('0xa2'),_0x3a739a[_0xec35('0x92')],_0xec35('0xa3'),_0x5decba[_0xec35('0x2e')],'pTalking:\x20',_0x5decba[_0xec35('0x31')]);delete this[_0xec35('0x17')][_0x5f2026[_0xec35('0x8c')]];break;case'BUSY':_0x5decba[_0xec35('0xa4')]+=0x1;_0x3a739a[_0xec35('0xa5')]+=0x1;_0x3a739a[_0xec35('0x7d')]=ut[_0xec35('0x7e')](_0x3a739a);ut[_0xec35('0x6b')](_0x3a739a,0x5,_0xec35('0xa6'));_0xfd3f41=_0x5decba[_0xec35('0xa7')];_0x6605ea=_0x5decba['callAdditionalPhoneAfterMin'];ami[_0xec35('0x28')]('custom:agentbusy',ut[_0xec35('0x80')](_0x3a739a,_0xec35('0xa8')));rpcDb['createCustomerHistory'](_0x3a739a,'[callProgressDetectingCustomer][logBusy]');_0x17a81f[_0xec35('0xa9')](_0x3a739a,'5',_0x5decba)[_0xec35('0x60')](function(_0x33e883){_0x1b7c31=_0x33e883[_0xec35('0x82')]==0x1;if(!_0x1b7c31){if(ut[_0xec35('0x7e')](_0x3a739a)>=_0x5decba[_0xec35('0x85')]){_0x252fc8=ut[_0xec35('0x86')](_0x3a739a,0xf,_0xec35('0x87'));rpcDb[_0xec35('0x74')](_0x252fc8,_0xec35('0xaa'));}else{if(_0x3a739a[_0xec35('0xa5')]>=_0x5decba[_0xec35('0xab')]){rpcDb[_0xec35('0x74')](_0x3a739a,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0xec35('0x89')](ut[_0xec35('0x8a')](_0x3a739a,_0xec35('0xa5'),_0x5decba[_0xec35('0xa7')]),_0x3a739a[_0xec35('0xac')],_0x3a739a[_0xec35('0x8b')]);}}}else{_0x3a739a[_0xec35('0xa5')]++;_0x17a81f['incrementPreviewCounters']({'id':_0x3a739a[_0xec35('0x8e')],'field':{'countbusyretry':_0x3a739a[_0xec35('0xa5')]}})['then'](function(){_0x17a81f[_0xec35('0x8f')](_0x3a739a,_0xfd3f41,_0x6605ea)[_0xec35('0x60')](function(){});});}});break;case _0xec35('0xad'):_0x5decba[_0xec35('0xae')]+=0x1;_0x3a739a[_0xec35('0xaf')]+=0x1;_0x3a739a[_0xec35('0x7d')]=ut['totalGlobal'](_0x3a739a);ut['logCustomer'](_0x3a739a,0x3,_0xec35('0xb0'));_0xfd3f41=_0x5decba['dialNoAnswerRetryFrequency'];_0x6605ea=_0x5decba[_0xec35('0x84')];var _0xae9f24=ut[_0xec35('0xb1')](_0x3a739a,_0x5decba);ami['emit']('custom:agentnoanswer',_0xae9f24);rpcDb[_0xec35('0x70')](_0x3a739a,_0xec35('0xb2'));_0x17a81f[_0xec35('0xa9')](_0x3a739a,'3',_0x5decba)[_0xec35('0x60')](function(_0x3a4c8d){_0x1b7c31=_0x3a4c8d[_0xec35('0x82')]==0x1;if(!_0x1b7c31){if(ut[_0xec35('0x7e')](_0x3a739a)>=_0x5decba[_0xec35('0x85')]){_0x252fc8=ut[_0xec35('0x86')](_0x3a739a,0xf,'Global');rpcDb['createCustomerFinal'](_0x252fc8,_0xec35('0xb3'));}else{if(_0x3a739a[_0xec35('0xaf')]>=_0x5decba[_0xec35('0xb4')]){rpcDb['createCustomerFinal'](_0x3a739a,_0xec35('0xb2'));}else{rpcDb['rescheduleContact'](ut[_0xec35('0x8a')](_0x3a739a,_0xec35('0xaf'),_0x5decba['dialNoAnswerRetryFrequency']),_0x3a739a[_0xec35('0xac')],_0x3a739a['activeContact']);}}}else{_0x3a739a[_0xec35('0xaf')]++;_0x17a81f[_0xec35('0xb5')]({'id':_0x3a739a[_0xec35('0x8e')],'field':{'countnoanswerretry':_0x3a739a['countnoanswerretry']}})[_0xec35('0x60')](function(){_0x17a81f['swapAdditionalPhones'](_0x3a739a,_0xfd3f41,_0x6605ea)['then'](function(){});});}});break;case _0xec35('0xb6'):_0x5decba[_0xec35('0xb7')]+=0x1;_0x3a739a[_0xec35('0xb8')]+=0x1;_0x3a739a['countglobal']=ut[_0xec35('0x7e')](_0x3a739a);ut['logCustomer'](_0x3a739a,0x8,_0xec35('0xb9'));_0xfd3f41=_0x5decba[_0xec35('0xba')];_0x6605ea=_0x5decba['callAdditionalPhoneAfterMin'];ami[_0xec35('0x28')]('custom:agentcongestion',ut[_0xec35('0x80')](_0x3a739a,_0xec35('0xbb')));rpcDb[_0xec35('0x70')](_0x3a739a,'[callProgressDetectingCustomer][logCongestion]');_0x17a81f['verifyAdditionalPhones'](_0x3a739a,'8',_0x5decba)['then'](function(_0x393551){_0x1b7c31=_0x393551[_0xec35('0x82')]==0x1;if(!_0x1b7c31){if(ut[_0xec35('0x7e')](_0x3a739a)>=_0x5decba[_0xec35('0x85')]){_0x252fc8=ut['cloneAction'](_0x3a739a,0xf,'Global');rpcDb['createCustomerFinal'](_0x252fc8,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x3a739a['countcongestionretry']>=_0x5decba[_0xec35('0xbc')]){rpcDb[_0xec35('0x74')](_0x3a739a,_0xec35('0xbd'));}else{rpcDb[_0xec35('0x89')](ut[_0xec35('0x8a')](_0x3a739a,_0xec35('0xb8'),_0x5decba[_0xec35('0xa7')]),_0x3a739a['unlockAgent'],_0x3a739a[_0xec35('0x8b')]);}}}else{_0x3a739a[_0xec35('0xb8')]++;_0x17a81f[_0xec35('0xb5')]({'id':_0x3a739a[_0xec35('0x8e')],'field':{'countcongestionretry':_0x3a739a[_0xec35('0xb8')]}})['then'](function(){_0x17a81f[_0xec35('0x8f')](_0x3a739a,_0xfd3f41,_0x6605ea)[_0xec35('0x60')](function(){});});}});break;case'CANCEL':_0x5decba[_0xec35('0xbe')]+=0x1;_0x3a739a[_0xec35('0xbf')]+=0x1;_0x3a739a[_0xec35('0x7d')]=ut[_0xec35('0x7e')](_0x3a739a);ut[_0xec35('0x6b')](_0x3a739a,0x14,'AgentReject');_0xfd3f41=_0x5decba['dialAgentRejectRetryFrequency'];_0x6605ea=_0x5decba['callAdditionalPhoneAfterMin'];ami[_0xec35('0x28')]('custom:agentreject',ut[_0xec35('0x80')](_0x3a739a,_0xec35('0xc0')));rpcDb[_0xec35('0x70')](_0x3a739a,'[syncHangupRequest][logAgentReject]');_0x17a81f[_0xec35('0xa9')](_0x3a739a,'20',_0x5decba)['then'](function(_0x181966){_0x1b7c31=_0x181966[_0xec35('0x82')]==0x1;if(!_0x1b7c31){if(ut[_0xec35('0x7e')](_0x3a739a)>=_0x5decba[_0xec35('0x85')]){_0x252fc8=ut[_0xec35('0x86')](_0x3a739a,0x14,_0xec35('0xc1'));rpcDb['createCustomerFinal'](_0x252fc8,_0xec35('0xc2'));}else{if(_0x3a739a[_0xec35('0xbf')]>=_0x5decba[_0xec35('0xc3')]){rpcDb[_0xec35('0x74')](_0x3a739a,_0xec35('0xc2'));}else{rpcDb[_0xec35('0x89')](ut[_0xec35('0x8a')](_0x3a739a,'countagentrejectretry',_0x5decba[_0xec35('0xc4')]),_0x3a739a[_0xec35('0xac')],_0x3a739a['activeContact']);}}}else{_0x3a739a[_0xec35('0xaf')]++;_0x17a81f[_0xec35('0xb5')]({'id':_0x3a739a[_0xec35('0x8e')],'field':{'countnoanswerretry':_0x3a739a[_0xec35('0xaf')]}})[_0xec35('0x60')](function(){_0x17a81f['swapAdditionalPhones'](_0x3a739a,_0xfd3f41,_0x6605ea)[_0xec35('0x60')](function(){});});}});break;case _0xec35('0xc5'):_0x5decba['outboundAbandonedCallsDay']+=0x1;_0x3a739a[_0xec35('0xc6')]+=0x1;_0x3a739a[_0xec35('0x7d')]=ut[_0xec35('0x7e')](_0x3a739a);ut['logCustomer'](_0x3a739a,0xb,_0xec35('0xc7'));rpcDb[_0xec35('0x70')](_0x3a739a,_0xec35('0xc8'));_0x17a81f[_0xec35('0xa9')](_0x3a739a,'11',_0x5decba)[_0xec35('0x60')](function(_0xb3c8d){_0x1b7c31=_0xb3c8d[_0xec35('0x82')]==0x1;if(!_0x1b7c31){if(ut[_0xec35('0x7e')](_0x3a739a)>=_0x5decba['dialGlobalMaxRetry']){_0x252fc8=ut[_0xec35('0x86')](_0x3a739a,0xf,_0xec35('0x87'));rpcDb[_0xec35('0x74')](_0x252fc8,_0xec35('0xc8'));}else{if(_0x3a739a['countabandonedetry']>=_0x5decba[_0xec35('0xc9')]){rpcDb['createCustomerFinal'](_0x3a739a,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x3a739a,'countabandonedretry',_0x5decba[_0xec35('0xca')]),_0x3a739a[_0xec35('0xac')],_0x3a739a[_0xec35('0x8b')]);}}}else{_0x3a739a['countnoanswerretry']++;_0x17a81f[_0xec35('0xb5')]({'id':_0x3a739a['idContact'],'field':{'countnoanswerretry':_0x3a739a[_0xec35('0xaf')]}})[_0xec35('0x60')](function(){_0x17a81f[_0xec35('0x8f')](_0x3a739a,_0xfd3f41,_0x6605ea)[_0xec35('0x60')](function(){});});}});break;case'18':_0x5decba['outboundUnknownCallsDay']+=0x1;_0x3a739a[_0xec35('0xcb')]+=0x1;_0x3a739a[_0xec35('0x7d')]=ut[_0xec35('0x7e')](_0x3a739a);ut['logCustomer'](_0x3a739a,0x12,_0x5f2026[_0xec35('0xcc')]||_0x5f2026[_0xec35('0xcd')]);ami[_0xec35('0x28')](_0xec35('0xce'),ut['buildObj'](_0x3a739a,'amd'));rpcDb[_0xec35('0x70')](_0x3a739a,'[callProgressDetectingCustomer][hangupInAMD]');_0x17a81f[_0xec35('0xa9')](_0x3a739a,'18',_0x5decba)[_0xec35('0x60')](function(_0x4e7cda){_0x1b7c31=_0x4e7cda['additional']==0x1;if(!_0x1b7c31){if(ut[_0xec35('0x7e')](_0x3a739a)>=_0x5decba[_0xec35('0x85')]){_0x252fc8=ut['cloneAction'](_0x3a739a,0x12,_0xec35('0x87'));rpcDb[_0xec35('0x74')](_0x252fc8,_0xec35('0xcf'));}else{rpcDb[_0xec35('0x74')](_0x3a739a,_0xec35('0xcf'));}}else{_0x3a739a[_0xec35('0xaf')]++;_0x17a81f[_0xec35('0xb5')]({'id':_0x3a739a[_0xec35('0x8e')],'field':{'countnoanswerretry':_0x3a739a['countnoanswerretry']}})[_0xec35('0x60')](function(){_0x17a81f['swapAdditionalPhones'](_0x3a739a,_0xfd3f41,_0x6605ea)['then'](function(){});});}});delete this['actions'][_0x5f2026[_0xec35('0x8c')]];break;case'19':_0x5decba[_0xec35('0xd0')]+=0x1;_0x3a739a[_0xec35('0x7d')]=ut[_0xec35('0x7e')](_0x3a739a);ut[_0xec35('0x6b')](_0x3a739a,0x13,_0x5f2026[_0xec35('0xcc')]||_0x5f2026[_0xec35('0xcd')]);ami[_0xec35('0x28')](_0xec35('0xce'),ut[_0xec35('0x80')](_0x3a739a,_0xec35('0xd1')));rpcDb['createCustomerHistory'](_0x3a739a,_0xec35('0xd2'));_0x17a81f[_0xec35('0xa9')](_0x3a739a,'18',_0x5decba)[_0xec35('0x60')](function(_0x277b62){_0x1b7c31=_0x277b62[_0xec35('0x82')]==0x1;if(!_0x1b7c31){if(ut[_0xec35('0x7e')](_0x3a739a)>=_0x5decba[_0xec35('0x85')]){_0x252fc8=ut['cloneAction'](_0x3a739a,0xf,_0xec35('0x87'));rpcDb[_0xec35('0x74')](_0x252fc8,_0xec35('0xd2'));}else{rpcDb[_0xec35('0x74')](_0x3a739a,'[callProgressDetectingCustomer][machine]');}}else{_0x3a739a[_0xec35('0xaf')]++;_0x17a81f[_0xec35('0xb5')]({'id':_0x3a739a['idContact'],'field':{'countnoanswerretry':_0x3a739a[_0xec35('0xaf')]}})['then'](function(){_0x17a81f[_0xec35('0x8f')](_0x3a739a,_0xfd3f41,_0x6605ea)[_0xec35('0x60')](function(){});});}});delete this[_0xec35('0x17')][_0x5f2026['linkedid']];break;default:if(_0x3a739a[_0xec35('0x50')]){ut[_0xec35('0x58')](_0x5decba,_0xec35('0xd3'));ut['loggerError'](_0xec35('0xd4')+_0x5decba[_0xec35('0x2e')],_0x5f2026);}_0x5decba[_0xec35('0xd0')]+=0x1;_0x3a739a[_0xec35('0x7d')]=ut[_0xec35('0x7e')](_0x3a739a);ut[_0xec35('0x6b')](_0x3a739a,0xc,_0x5f2026['cause-txt']||_0x5f2026['dialstatus']);_0xfd3f41=_0x5decba[_0xec35('0xc4')];_0x6605ea=_0x5decba[_0xec35('0x84')];rpcDb[_0xec35('0x70')](_0x3a739a,'[callProgressDetectingCustomer][logUnknown]');_0x17a81f[_0xec35('0xa9')](_0x3a739a,'20',_0x5decba)['then'](function(_0x52dc36){_0x1b7c31=_0x52dc36['additional']==0x1;if(!_0x1b7c31){if(ut[_0xec35('0x7e')](_0x3a739a)>=_0x5decba['dialGlobalMaxRetry']){_0x252fc8=ut[_0xec35('0x86')](_0x3a739a,0xf,_0xec35('0x87'));rpcDb[_0xec35('0x74')](_0x252fc8,_0xec35('0xd5'));}else{rpcDb[_0xec35('0x74')](_0x3a739a,_0xec35('0xd5'));}delete this[_0xec35('0x17')][_0x5f2026['linkedid']];}else{_0x17a81f[_0xec35('0x8f')](_0x3a739a,_0xfd3f41,_0x6605ea)[_0xec35('0x60')](function(){});}});}if(!(_0x3a739a[_0xec35('0x50')]&&_0x15876b==='16')){utils[_0xec35('0xd6')](_0x5decba,_0xec35('0xd7'));logger[_0xec35('0x29')]('[originated][decrement][callProgressDetectingCustomer]',_0x3a739a[_0xec35('0x92')],_0xec35('0xa3'),_0x5decba[_0xec35('0x2e')],_0xec35('0x4e'),_0x5decba[_0xec35('0x30')]);}if(_0x15876b!==_0xec35('0x90')){delete this[_0xec35('0x17')][_0x5f2026[_0xec35('0x8c')]];delete this[_0xec35('0x17')][_0x5f2026['destlinkedid']];}_0x5decba['queueSummaryCountersUpdated']=!![];}};Preview[_0xec35('0x3b')]['callProgressDetectingAgent']=function(_0x27ac84,_0x11c684,_0x3d1dff){if(_[_0xec35('0xd8')](_0x11c684)&&_0xec35('0xd9')!==typeof _0x11c684){return;}if(_[_0xec35('0xd8')](_0x3d1dff)&&_0xec35('0xd9')!==typeof _0x3d1dff){return;}switch(_0x3d1dff[_0xec35('0xda')]){case'0':ut[_0xec35('0xdb')](_0x27ac84,0x0,_0xec35('0x7f'));rpcDb[_0xec35('0xdc')](_0x27ac84,_0xec35('0xdd'));break;case'3':ut[_0xec35('0xdb')](_0x27ac84,0x3,'NoAnswer');rpcDb[_0xec35('0xdc')](_0x27ac84,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut[_0xec35('0xdb')](_0x27ac84,0x5,_0xec35('0xa6'));rpcDb['createAgentHistory'](_0x27ac84,'[callProgressDetectingAgent][logBusy]');break;case'8':ut[_0xec35('0xdb')](_0x27ac84,0x8,_0xec35('0xb9'));rpcDb[_0xec35('0xdc')](_0x27ac84,_0xec35('0xde'));break;case'22':ut['logAgent'](_0x27ac84,0x16,'AnswerAGI');rpcDb['createAgentHistory'](_0x27ac84,_0xec35('0xdf'));break;default:ut[_0xec35('0xdb')](_0x27ac84,0xc,_0x3d1dff[_0xec35('0xda')]);rpcDb[_0xec35('0xdc')](_0x27ac84,_0xec35('0xde'));}utils[_0xec35('0xd6')](_0x11c684,_0xec35('0xe0'));logger[_0xec35('0x29')](_0xec35('0xe1'),_0x27ac84['uniqueid'],'\x20Queue',_0x11c684[_0xec35('0x2e')],'originated:\x20',_0x11c684['originated']);delete this[_0xec35('0x17')][_0x27ac84[_0xec35('0x92')]];};Preview['prototype'][_0xec35('0xa9')]=function(_0x100c17,_0x29645a,_0x2e51d9){return cmHopperAdditionalPhone[_0xec35('0xa9')](_0x100c17,_0x29645a,_0x2e51d9)[_0xec35('0x56')](logger['info']('[verifyAdditionalPhone]\x20'));};Preview[_0xec35('0x3b')][_0xec35('0x8f')]=function(_0x260e96,_0x1d7013,_0x3b1356){return cmHopperAdditionalPhone[_0xec35('0x8f')](_0x260e96,_0x1d7013,_0x3b1356)[_0xec35('0x56')](logger[_0xec35('0x29')](_0xec35('0xe2')));};Preview[_0xec35('0x3b')][_0xec35('0xb5')]=function(_0x421517){return Promise['resolve']()[_0xec35('0x60')](cmHopperAdditionalPhone[_0xec35('0xb5')](_0x421517))[_0xec35('0x56')](logger[_0xec35('0x29')](_0xec35('0xe3')));};Preview[_0xec35('0x3b')][_0xec35('0xe4')]=function(_0x518bd3,_0x3c9996,_0x397646,_0x539d80,_0x6e3697){var _0xad725f=this;return new Promise(function(_0x58f0b4,_0x28bf7d){if(_[_0xec35('0x4a')](_0x3c9996)||_['isNil'](_0x3c9996[_0xec35('0xe5')])||_[_0xec35('0x4a')](_0x3c9996[_0xec35('0xe6')])||_[_0xec35('0x4a')](_0x3c9996[_0xec35('0x53')])){_0x28bf7d(ut[_0xec35('0x34')]('Contact\x20is\x20undefined',_0x539d80,_0x6e3697));return;}var _0x1d4b98=uuid['v4']();var _0x5a4d73=_0xad725f[_0xec35('0x15')][_0x3c9996[_0xec35('0x4c')][_0xec35('0x2e')]];var _0x2d10ab=_0x397646?_0xad725f[_0xec35('0x18')][_0x397646]['id']:undefined;_0xad725f['actions'][_0x1d4b98]=new Action(_0x3c9996,_0x5a4d73,_0x1d4b98,_0x397646,_0x2d10ab);var _0x1e3940=_0xad725f[_0xec35('0x17')][_0x1d4b98];_0x1e3940[_0xec35('0xac')]=_0x539d80;_0x1e3940[_0xec35('0x8b')]=_0x6e3697;_0x1e3940[_0xec35('0xe7')]=_0x397646;if(_[_0xec35('0xe8')](_0x518bd3)){_0xad725f[_0xec35('0xe9')](_0x1e3940,_0x5a4d73,_0x3c9996,_0x397646)['then'](function(_0x45eac4){logger[_0xec35('0x29')](_0xec35('0xea'),_0xec35('0xeb')+_0x1e3940[_0xec35('0x4d')]+_0xec35('0xec')+_0x1e3940[_0xec35('0x8e')],JSON[_0xec35('0x2b')](_0x45eac4));ami[_0xec35('0x28')](_0xec35('0xed'),ut[_0xec35('0x80')](_0x1e3940,_0xec35('0xee'),_0xad725f[_0xec35('0x15')][_0x1e3940['queue']]));_0x58f0b4(ut['message'](_0xec35('0xef')));})['catch'](function(_0x415e0b){ut[_0xec35('0x37')](_0xec35('0xf0'),_0x415e0b);_0x28bf7d(ut[_0xec35('0x34')](_0xec35('0xf1'),_0x539d80,_0x6e3697));});}else{_0x5a4d73[_0xec35('0xf2')]+=0x1;ut['logBlacklist'](_0x1e3940);rpcDb[_0xec35('0xf3')](_0x1e3940,_0xec35('0xf4'));delete _0xad725f[_0xec35('0x17')][_0x1d4b98];_0x28bf7d(ut[_0xec35('0x34')]('Contact\x20in\x20black\x20List',_0x539d80,_0x6e3697));}});};Preview['prototype'][_0xec35('0x79')]=function(_0x4496a4){return!_[_0xec35('0x4a')](_0x4496a4)&&!_[_0xec35('0x4a')](_0x4496a4['name'])&&!_[_0xec35('0x4a')](_0x4496a4[_0xec35('0xf5')])&&_0x4496a4[_0xec35('0xf5')]&&!_[_0xec35('0x4a')](this[_0xec35('0x16')][util['format'](_0xec35('0xf6'),_0x4496a4['name'])])&&!_[_0xec35('0x4a')](this[_0xec35('0x16')][util[_0xec35('0x2c')](_0xec35('0xf6'),_0x4496a4[_0xec35('0x2e')])]['status'])&&(this[_0xec35('0x16')][util[_0xec35('0x2c')](_0xec35('0xf6'),_0x4496a4[_0xec35('0x2e')])][_0xec35('0x54')]===_0xec35('0xf7')||this['trunks'][util['format'](_0xec35('0xf6'),_0x4496a4['name'])][_0xec35('0x54')]===_0xec35('0xf8'));};Preview[_0xec35('0x3b')][_0xec35('0xf9')]=function(_0x54585d,_0x39fe47){return this[_0xec35('0xfa')](_0x54585d,_0x39fe47)['then'](function(_0x41616e){return _[_0xec35('0x51')](_0x41616e,[_0xec35('0x34')]);})[_0xec35('0x56')](function(_0x3524ec){if(_0x3524ec['unlock']){rpcDb['unlockContact'](_0x54585d);}if(_0x3524ec[_0xec35('0xf5')]){rpcDb['disableContact'](_0x54585d);}throw _['pick'](_0x3524ec,[_0xec35('0x34')]);});};Preview['prototype'][_0xec35('0xfa')]=function(_0x2cbffa,_0x39a1c7){var _0x1c11b7=this;var _0x3978e8,_0x377d9c;return rpcDb[_0xec35('0xfb')](_0x2cbffa)[_0xec35('0x60')](function(_0x1ae16d){if(!_[_0xec35('0x4a')](_0x1ae16d[0x0])){_0x377d9c=_0x1ae16d[0x0][_0xec35('0xfc')]?![]:!![];_0x3978e8=_0x1ae16d[0x0][_0xec35('0xfc')]?!![]:![];_0x3978e8=_0x39a1c7?!![]:_0x3978e8;}var _0x46a597=_0x1c11b7['validateContact'](_0x1ae16d);if(_0x46a597[_0xec35('0xfd')]){rpcDb[_0xec35('0xfe')](_[_0xec35('0x51')](_0x1ae16d[0x0],[_0xec35('0x53'),_0xec35('0xe6')]))[_0xec35('0x60')](function(_0x1022be){_0x1c11b7['checkInBlack'](_0x1022be,_0x1ae16d[0x0],_0x39a1c7,_0x377d9c,_0x3978e8)[_0xec35('0x60')](function(_0x30838a){return _0x30838a;})[_0xec35('0x56')](function(_0x20ef14){throw _0x20ef14;});})[_0xec35('0x56')](function(_0x2a7ead){ut['logger'](_0xec35('0xff'),_0x2a7ead);throw ut[_0xec35('0x34')](_0xec35('0x100'),_0x377d9c,_0x3978e8);});}else{throw ut['message'](_0x46a597[_0xec35('0x34')],_0x377d9c,_0x3978e8);}})[_0xec35('0x56')](function(_0x41da60){ut[_0xec35('0x37')](_0xec35('0x101'),_0x41da60);throw ut[_0xec35('0x34')](_0xec35('0x100'),![],!![]);});};Preview[_0xec35('0x3b')][_0xec35('0x102')]=function(_0x414aaf){if(_[_0xec35('0x4a')](_0x414aaf)||_[_0xec35('0xe8')](_0x414aaf)||!_['isNil'](_0x414aaf[0x0][_0xec35('0x65')])&&_[_0xec35('0x4a')](_0x414aaf[0x0][_0xec35('0x65')]['name'])){ut[_0xec35('0x37')](_0xec35('0x103'),_0x414aaf);return{'isValid':![],'message':_0xec35('0x104')};}var _0x5a278f=this['campaignsPreview'][_0x414aaf[0x0]['Queue'][_0xec35('0x2e')]];_0x5a278f[_0xec35('0x34')]=utils[_0xec35('0x35')][_0xec35('0x105')];if(_['isNil'](_0x5a278f)){ut['logger'](_0xec35('0x106'),_0x5a278f);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0xec35('0x79')](_0x5a278f[_0xec35('0x78')])){ut[_0xec35('0x37')](_0xec35('0x107'),_0xec35('0x108')+_0x5a278f[_0xec35('0x2e')]+'\x20Trunk\x20is\x20not\x20active');if(!this['isTrunkReachable'](_0x5a278f[_0xec35('0x7a')])){ut['logger'](_0xec35('0x107'),_0x5a278f[_0xec35('0x2e')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0xec35('0x109')};}}if(!ut[_0xec35('0x77')](_0x5a278f[_0xec35('0x45')])){ut[_0xec35('0x37')]('[Preview][validateContact][Campaign\x20Active]',_0x5a278f[_0xec35('0x2e')]+_0xec35('0x10a'));return{'isValid':![],'message':_0xec35('0x108')+_0x5a278f['name']+_0xec35('0x10a')};}return{'isValid':!![],'message':_0xec35('0x10b')};};Preview[_0xec35('0x3b')][_0xec35('0xe9')]=function(_0x2a8c5c,_0x1eb89a,_0x336a4,_0x289d33){var _0x2a4af6=this;return new Promise(function(_0x3e52e7,_0x4cdf8e){var _0xcb5f33=_0x2a8c5c[_0xec35('0x92')];var _0x205ff4=_0x2a4af6[_0xec35('0x79')](_0x1eb89a['Trunk'])?util['format'](_0xec35('0x10c'),_0x1eb89a[_0xec35('0x78')][_0xec35('0x2e')],_[_0xec35('0x4a')](_0x1eb89a['dialPrefix'])?'':_0x1eb89a['dialPrefix'][_0xec35('0x10d')]()||'',_0x1eb89a['dialCutDigit']>0x0?_0x336a4[_0xec35('0xe6')]['substring'](_0x1eb89a[_0xec35('0x10e')]):_0x336a4[_0xec35('0xe6')]):util['format'](_0xec35('0x10c'),_[_0xec35('0x4a')](_0x1eb89a['TrunkBackup'])?_0x1eb89a[_0xec35('0x78')][_0xec35('0x2e')]:_0x1eb89a[_0xec35('0x7a')][_0xec35('0x2e')],_[_0xec35('0x4a')](_0x1eb89a[_0xec35('0x10f')])?'':_0x1eb89a['dialPrefix']['trim']()||'',_0x1eb89a[_0xec35('0x10e')]>0x0?_0x336a4['phone'][_0xec35('0x110')](_0x1eb89a[_0xec35('0x10e')]):_0x336a4[_0xec35('0xe6')]);var _0x38632c=_0x2a4af6[_0xec35('0x79')](_0x1eb89a[_0xec35('0x78')])?ut[_0xec35('0x111')](_0x1eb89a[_0xec35('0x78')][_0xec35('0x112')],_0x1eb89a['dialOriginateCallerIdName'],_0x1eb89a[_0xec35('0x113')]>0x0?ut[_0xec35('0x114')](_0x1eb89a[_0xec35('0x115')],_0x1eb89a[_0xec35('0x113')]):_0x1eb89a[_0xec35('0x115')]):ut[_0xec35('0x111')](_[_0xec35('0x4a')](_0x1eb89a[_0xec35('0x7a')])?_0x1eb89a[_0xec35('0x78')][_0xec35('0x112')]:_0x1eb89a['TrunkBackup'][_0xec35('0x112')],_0x1eb89a[_0xec35('0x116')],_0x1eb89a['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x1eb89a[_0xec35('0x115')],_0x1eb89a[_0xec35('0x113')]):_0x1eb89a[_0xec35('0x115')]);if(_0x38632c){_0x2a8c5c[_0xec35('0x117')]=ut[_0xec35('0x118')](_0x38632c);_0x2a8c5c['originatecalleridnum']=ut[_0xec35('0x119')](_0x38632c);}var _0x48de6c=ut[_0xec35('0x11a')](_0x1eb89a,_0x336a4,_0x205ff4,_0x38632c,_0xcb5f33,_0x2a8c5c);var _0x397a3b=utils[_0xec35('0x11b')](_0x336a4[_0xec35('0xe5')]);Object[_0xec35('0x11c')](_0x48de6c,_0x397a3b);_['merge'](_0x2a8c5c,ut[_0xec35('0x11d')](_0x48de6c));_0x2a8c5c[_0xec35('0x11e')]=moment()[_0xec35('0x2c')](_0xec35('0x69'));_0x1eb89a['variables']=_0x48de6c;var _0x11ce32=ut[_0xec35('0x11f')](_0x2a8c5c,_0x1eb89a,_0x48de6c,_0x2a8c5c[_0xec35('0x8b')],_0x289d33);return ami[_0xec35('0x120')](_0x11ce32)[_0xec35('0x60')](function(_0x52a8ad){_0x1eb89a[_0xec35('0x30')]+=0x1;logger[_0xec35('0x29')](_0xec35('0x121'),_0xcb5f33,_0xec35('0xa3'),_0x1eb89a['name'],_0xec35('0x4e'),_0x1eb89a['originated']);_0x3e52e7(_0x52a8ad);})[_0xec35('0x56')](function(_0x4722c8){ut['logAgent'](_0x2a8c5c,0xe,'OriginateError');rpcDb['createAgentHistory'](_0x2a8c5c,_0xec35('0x122'));_0x4cdf8e(_0x4722c8);});});};Preview['prototype'][_0xec35('0x21')]=function(_0x48e77a){if(this['actions'][_0x48e77a[_0xec35('0x8c')]]){this[_0xec35('0x17')][_0x48e77a[_0xec35('0x8c')]][_0xec35('0x55')]=_0x48e77a[_0xec35('0x55')];}};Preview[_0xec35('0x3b')][_0xec35('0x19')]=function(_0x894377){var _0x19db6d=this;var _0x44e809=this['actions'][_0x894377[_0xec35('0x123')]];if(_0x44e809){if(_0x44e809[_0xec35('0xe7')]&&this[_0xec35('0x18')][_0x44e809[_0xec35('0xe7')]]){ut['logLookAgent'](_0x44e809,this[_0xec35('0x18')][_0x44e809[_0xec35('0xe7')]][_0xec35('0x2e')],this[_0xec35('0x18')][_0x44e809[_0xec35('0xe7')]]['id']);}var _0x41570e=_[_0xec35('0x124')](_0x44e809);_0x41570e['responsetime']=moment()[_0xec35('0x2c')](_0xec35('0x69'));var _0x4a6cfb=_0x19db6d[_0xec35('0x15')][_0x44e809['queue']];if(ut[_0xec35('0x125')](_0x894377[_0xec35('0x126')])){if(_0x44e809['unlockAgent']){rpcDb['unlockContact'](_0x44e809[_0xec35('0x8e')]);}if(_0x44e809['activeContact']){rpcDb[_0xec35('0x68')](_0x44e809[_0xec35('0x8e')]);}ami['emit'](_0xec35('0x127'),ut[_0xec35('0x80')](_0x44e809,_0xec35('0x128'),this[_0xec35('0x15')][_0x44e809[_0xec35('0x4d')]]));this['callProgressDetectingAgent'](_0x41570e,_0x4a6cfb,_0x894377);}else{_0x44e809[_0xec35('0x11e')]=moment()[_0xec35('0x2c')](_0xec35('0x69'));ut['logAgent'](_0x41570e,0x4,'Answer');rpcDb[_0xec35('0xdc')](_0x41570e,_0xec35('0x129'));}}};Preview[_0xec35('0x3b')][_0xec35('0x1b')]=function(_0x90e5c7){var _0x1fa86a=this['actions'][_0x90e5c7[_0xec35('0x8c')]];var _0x576538;if(_0x1fa86a){_0x576538=this[_0xec35('0x15')][_0x1fa86a[_0xec35('0x4d')]];logger[_0xec35('0x29')](_0xec35('0x12a'),_0x90e5c7['linkedid'],_0xec35('0xa3'),_0x576538[_0xec35('0x2e')],_0xec35('0x4f'),_0x576538[_0xec35('0x31')]);}if(this['actions'][_0x90e5c7['linkedid']]&&_0x90e5c7[_0xec35('0x8c')]!==_0x90e5c7[_0xec35('0x92')]){if(_0x90e5c7['cause']==='16'&&this[_0xec35('0x17')][_0x90e5c7['linkedid']][_0xec35('0x50')]){this[_0xec35('0x7b')](_0x90e5c7,_0x90e5c7['linkedid'],_0x90e5c7['cause']);}else if(this[_0xec35('0x17')][_0x90e5c7[_0xec35('0x8c')]][_0xec35('0x50')]){logger[_0xec35('0x29')]('[syncHangup][talking][cause]',_0x90e5c7[_0xec35('0x8c')],_0x90e5c7[_0xec35('0x12b')],'\x20Queue',_0x576538['name'],_0xec35('0x4f'),_0x576538[_0xec35('0x31')]);this[_0xec35('0x7b')](_0x90e5c7,_0x90e5c7[_0xec35('0x8c')],_0x90e5c7[_0xec35('0x12b')]);}}else if(_0x1fa86a&&_[_0xec35('0x4a')](_0x1fa86a['statedesc'])&&_0x576538[_0xec35('0x12c')]&&_0x90e5c7['linkedid']===_0x90e5c7[_0xec35('0x92')]&&_[_0xec35('0x4a')](_0x90e5c7[_0xec35('0xda')])&&_0x90e5c7[_0xec35('0x12b')]==='16'&&_0x90e5c7[_0xec35('0x12d')]==='6'&&_[_0xec35('0xd8')](_0x1fa86a[_0xec35('0x12e')])){if(_0x1fa86a['unlockAgent']){rpcDb[_0xec35('0x12f')](_0x1fa86a[_0xec35('0x8e')]);}if(_0x1fa86a['activeContact']){rpcDb['disableContact'](_0x1fa86a[_0xec35('0x8e')]);}_0x90e5c7[_0xec35('0xda')]='22';this[_0xec35('0x130')](_0x1fa86a,_0x576538,_0x90e5c7);}else if(_0x1fa86a&&_0x1fa86a[_0xec35('0x12e')]){if(_0x90e5c7[_0xec35('0x12b')]==='16'&&this[_0xec35('0x17')][_0x90e5c7[_0xec35('0x8c')]][_0xec35('0x50')]){logger[_0xec35('0x29')](_0xec35('0x131'),_0x90e5c7[_0xec35('0x8c')],_0x90e5c7[_0xec35('0x12b')],_0xec35('0xa3'),_0x576538[_0xec35('0x2e')],_0xec35('0x4f'),_0x576538[_0xec35('0x31')]);this[_0xec35('0x7b')](_0x90e5c7,_0x90e5c7[_0xec35('0x8c')],_0x90e5c7[_0xec35('0x12b')]);}else if(this[_0xec35('0x17')][_0x90e5c7[_0xec35('0x8c')]][_0xec35('0x50')]){logger[_0xec35('0x29')](_0xec35('0x132'),_0x90e5c7[_0xec35('0x8c')],_0x90e5c7[_0xec35('0x12b')],_0xec35('0xa3'),_0x576538[_0xec35('0x2e')],_0xec35('0x4f'),_0x576538[_0xec35('0x31')]);this[_0xec35('0x7b')](_0x90e5c7,_0x90e5c7[_0xec35('0x8c')],_0x90e5c7[_0xec35('0x12b')]);}}};Preview['prototype']['syncDialEnd']=function(_0x43a5d1){if(this[_0xec35('0x17')][_0x43a5d1[_0xec35('0x133')]]&&_0x43a5d1['destlinkedid']!==_0x43a5d1[_0xec35('0x134')]){this[_0xec35('0x7b')](_0x43a5d1,_0x43a5d1[_0xec35('0x133')],_0x43a5d1[_0xec35('0xcd')]);}};Preview[_0xec35('0x3b')][_0xec35('0x1d')]=function(_0x42dc68){if(this[_0xec35('0x17')][_0x42dc68[_0xec35('0x8c')]]&&_0x42dc68[_0xec35('0x8c')]!==_0x42dc68[_0xec35('0x92')]&&!this['actions'][_0x42dc68[_0xec35('0x8c')]]['dialAnswer']){if(_0x42dc68['cause']==='1'){this[_0xec35('0x7b')](_0x42dc68,_0x42dc68[_0xec35('0x8c')],_0x42dc68[_0xec35('0x12b')]);}}};Preview[_0xec35('0x3b')][_0xec35('0x135')]=function(_0x23f6aa,_0x3c9a70,_0x46e897){if(this[_0xec35('0x17')][_0x23f6aa]){if(_[_0xec35('0x4a')](this[_0xec35('0x17')][_0x23f6aa][_0xec35('0x136')])){this[_0xec35('0x17')][_0x23f6aa]['variables']={};}this['actions'][_0x23f6aa][_0xec35('0x136')][_0x3c9a70]=_0x46e897;}};Preview[_0xec35('0x3b')][_0xec35('0x23')]=function(_0x113621){try{if(!_[_0xec35('0x4a')](_0x113621)){if(ut['filterKey'](_[_0xec35('0x137')](_0x113621[_0xec35('0x138')])[0x0])){this[_0xec35('0x135')](_0x113621['uniqueid'],_[_0xec35('0x137')](_0x113621[_0xec35('0x138')])[0x0],_0x113621[_0xec35('0x139')]);}}}catch(_0x2fb55b){logger[_0xec35('0x13a')](_0xec35('0x13b'),util[_0xec35('0x13c')](_0x2fb55b,{'showHidden':![],'depth':null}));}};Preview['prototype'][_0xec35('0x25')]=function(_0x3652fb){if(_0x3652fb){if(this[_0xec35('0x17')][_0x3652fb['transfertargetlinkedid']]){this[_0xec35('0x17')][_0x3652fb[_0xec35('0x13d')]][_0xec35('0x12e')]=!![];}}};Preview[_0xec35('0x3b')][_0xec35('0x27')]=function(_0x1d89e5){if(_0x1d89e5){if(this[_0xec35('0x17')][_0x1d89e5[_0xec35('0x13e')]]){this[_0xec35('0x17')][_0x1d89e5[_0xec35('0x13e')]][_0xec35('0x12e')]=!![];}}};module['exports']=Preview;
\ No newline at end of file
+var _0x9267=['Answer','[callProgressDetectingCustomer][logAnswer]','talktime','sumBillable','[syncHangup][talking][decrement]','BUSY','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','[callProgressDetectingCustomer][logBusy]','verifyAdditionalPhones','additional','cloneAction','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','outboundNoAnswerCallsDay','countnoanswerretry','NoAnswer','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','rescheduleContact','CONGESTION','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','outboundRejectCallsDay','custom:agentreject','agentreject','AgentReject','countagentrejectretry','dialAgentRejectMaxRetry','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectRetryFrequency','ABANDONED','outboundAbandonedCallsDay','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','outboundUnknownCallsDay','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[Dialer][decrementTalking][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','\x20Queue','originated:\x20','ANSWER','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','createAgentHistory','logAgent','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','resolve','checkInBlack','Contact','phone','Queue','lookAgent','isEmpty','execCall','\x20IdHopper:\x20','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','Contact\x20in\x20black\x20List','active','SIP/%s','reachable','execRun','unlock','unlockContact','getContactPreview','recallme','validateContact','isValid','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','isActive','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','dialOriginateCallerIdName','getCallerIdRandom','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','callerid','extractCalleridName','originatecalleridnum','extractCalleridNumber','setXMDContactVariables','assign','merge','toLowerVariables','variables','OriginateError','[originateFailure][logOriginateFailure]','syncNewExten','logLookAgent','isFailure','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','transfer','[syncHangup][talking][transfer]','destuniqueid','filterKey','keys','variable','[syncVarSet][Preview]','inspect','transfererlinkedid','exports','util','uuid','moment','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./rpcDb','../rpc/cmHopperAdditionalPhone','./action','./util/util','../dialer/utils','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','bind','syncHangup','hanguprequest','syncHangupRequest','syncDialEnd','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice:queue:%s','name','voice_queue_channel:remove','originated','pTalking','available','paused','message','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','DEACTIVATED','\x20is\x20deactivated','syncCampaigns','dialMethod','booked','type','clearZombieChannels','outbound','setMessage','recallMe','clearZombieChannel','sequence','isNil','[clearZombieChannels][talking]','stringify','queue','pTalking:\x20','dialAnswer','pick','UserId','VoiceQueueId','ListId','status','channel','catch','No\x20such\x20channel','decrementOriginate','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','hasOwnProperty','agentReadyId','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','then','logger2','[RecallMe]','disableContact','starttime','format','outboundReCallsDay','logCustomer','rescheduleContactInQueue','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','NO_AGENTS_LOGGED','dialActive','Trunk','isTrunkReachable','TrunkBackup','UNREACHABLE_TRUNK','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','[callProgressDetectingCustomer][logNoSuchGlobal]','scheduledAt','unlockAgent','activeContact','linkedid','actioncountonusuch','idContact','incrementPreviewCounters','swapAdditionalPhones','YYYY-MM-DD\x20HH:mm:ss','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','custom:agentconnect','connect','mandatoryDisposition','custom:agentConnectPreview','channelAgent','custom:agentcomplete','complete','outboundAnswerCallsDay','answered','decrementTalking','[16]'];(function(_0x47411f,_0x5e0737){var _0x1fb64e=function(_0x47abd2){while(--_0x47abd2){_0x47411f['push'](_0x47411f['shift']());}};_0x1fb64e(++_0x5e0737);}(_0x9267,0x1dd));var _0x7926=function(_0x4416a4,_0x562fd6){_0x4416a4=_0x4416a4-0x0;var _0xadbdae=_0x9267[_0x4416a4];return _0xadbdae;};'use strict';var util=require(_0x7926('0x0'));var _=require('lodash');var uuid=require(_0x7926('0x1'));var moment=require(_0x7926('0x2'));var Redis=require(_0x7926('0x3'));var config=require(_0x7926('0x4'));var logger=require(_0x7926('0x5'))(_0x7926('0x6'));var loggerAction=require('../../../config/logger')(_0x7926('0x7'));var ami=require(_0x7926('0x8'));var rpcDb=require(_0x7926('0x9'));var cmHopperAdditionalPhone=require(_0x7926('0xa'));var Action=require(_0x7926('0xb'));var ut=require(_0x7926('0xc'));var utils=require(_0x7926('0xd'));config[_0x7926('0xe')]=_[_0x7926('0xf')](config[_0x7926('0xe')],{'host':_0x7926('0x10'),'port':0x18eb});var io=require(_0x7926('0x11'))(new Redis(config[_0x7926('0xe')]));var Sequence=function(){};Sequence[_0x7926('0x12')][_0x7926('0x13')]=function(_0x20db3){this[_0x7926('0x14')]=this['tail']?this[_0x7926('0x14')][_0x7926('0x15')](_0x20db3):_0x20db3();};function Preview(_0x3c0dcc){this['sequence']=new Sequence();this[_0x7926('0x16')]=_0x3c0dcc[_0x7926('0x17')];this[_0x7926('0x18')]=_0x3c0dcc[_0x7926('0x18')];this[_0x7926('0x19')]={};this[_0x7926('0x1a')]=_0x3c0dcc[_0x7926('0x1a')];this[_0x7926('0x1b')]=0x0;ami['on'](_0x7926('0x1c'),this['syncOriginateResponse'][_0x7926('0x1d')](this));ami['on']('hangup',this[_0x7926('0x1e')][_0x7926('0x1d')](this));ami['on'](_0x7926('0x1f'),this[_0x7926('0x20')][_0x7926('0x1d')](this));ami['on']('dialend',this[_0x7926('0x21')][_0x7926('0x1d')](this));ami['on']('newexten',this['syncNewExten']['bind'](this));ami['on']('varset',this[_0x7926('0x22')][_0x7926('0x1d')](this));ami['on'](_0x7926('0x23'),this[_0x7926('0x24')][_0x7926('0x1d')](this));ami['on'](_0x7926('0x25'),this[_0x7926('0x26')]['bind'](this));this[_0x7926('0x27')](this[_0x7926('0x16')]);}function emit(_0x266438,_0xe91c02,_0x21d4c4){io['to'](_0x266438)[_0x7926('0x28')](_0xe91c02,_0x21d4c4);}function emitVoiceQueueChannelRemove(_0x1d8d54){logger[_0x7926('0x29')](_0x7926('0x2a'),JSON['stringify'](_0x1d8d54));emit(util['format'](_0x7926('0x2b'),_0x1d8d54[_0x7926('0x2c')]),_0x7926('0x2d'),_0x1d8d54);io[_0x7926('0x28')]('voice_queue_presence:remove',_0x1d8d54);}function notSendMessagesQueue(_0x25c33c){if(_0x25c33c['sendMessageOneNotActive']){if(_0x25c33c[_0x7926('0x2e')]===0x0&&_0x25c33c[_0x7926('0x2f')]===0x0){_0x25c33c['sendMessageOneNotActive']=![];_0x25c33c[_0x7926('0x30')]=0x0;_0x25c33c[_0x7926('0x31')]=0x0;_0x25c33c[_0x7926('0x32')]=utils[_0x7926('0x33')][_0x7926('0x34')];ut[_0x7926('0x35')](_0x7926('0x36'),_0x25c33c[_0x7926('0x2c')]+_0x7926('0x37'));}else{_0x25c33c[_0x7926('0x32')]=utils[_0x7926('0x33')][_0x7926('0x38')];ut[_0x7926('0x35')](_0x7926('0x36'),_0x25c33c[_0x7926('0x2c')]+_0x7926('0x39'));}}}Preview[_0x7926('0x12')]['loopCampaigns']=function(){var _0x464a3a=this;setInterval(function(){_0x464a3a['syncCampaigns']();},0x7cf);};Preview[_0x7926('0x12')][_0x7926('0x3a')]=function(){var _0x1087e4=this[_0x7926('0x16')];this[_0x7926('0x1b')]+=0x1;for(var _0x278d60 in _0x1087e4){if(_0x1087e4['hasOwnProperty'](_0x278d60)&&(_0x1087e4[_0x278d60][_0x7926('0x3b')]===_0x7926('0x6')||_0x1087e4[_0x278d60][_0x7926('0x3b')]===_0x7926('0x3c'))&&_0x1087e4[_0x278d60][_0x7926('0x3d')]==='outbound'){if(this[_0x7926('0x1b')]>0x7){this[_0x7926('0x1b')]=0x0;this[_0x7926('0x3e')]();}}if(_0x1087e4['hasOwnProperty'](_0x278d60)&&_0x1087e4[_0x278d60]['dialMethod']===_0x7926('0x6')&&_0x1087e4[_0x278d60][_0x7926('0x3d')]===_0x7926('0x3f')){if(_0x1087e4[_0x278d60]['dialActive']){this[_0x7926('0x40')](_0x1087e4[_0x278d60]);if(_0x1087e4[_0x278d60]['dialPreviewAutoRecallMe'])this[_0x7926('0x41')](_0x1087e4[_0x278d60]);}else{notSendMessagesQueue(_0x1087e4[_0x278d60]);}}}};Preview[_0x7926('0x12')][_0x7926('0x42')]=function(_0x21671a){var _0x370599=this;this[_0x7926('0x43')]['enqueue'](function(){if(!_[_0x7926('0x44')](_0x370599[_0x7926('0x19')][_0x21671a])){loggerAction[_0x7926('0x29')](_0x7926('0x45'),_0x21671a,'Queue',_0x370599[_0x7926('0x19')][_0x21671a]['queue'],'originated:\x20',JSON[_0x7926('0x46')](_0x370599['campaignsPreview'][_0x370599[_0x7926('0x19')][_0x21671a][_0x7926('0x47')]][_0x7926('0x2e')]),_0x7926('0x48'),JSON[_0x7926('0x46')](_0x370599[_0x7926('0x16')][_0x370599[_0x7926('0x19')][_0x21671a][_0x7926('0x47')]][_0x7926('0x2f')]),JSON[_0x7926('0x46')](_0x370599[_0x7926('0x19')][_0x21671a][_0x7926('0x49')]),JSON['stringify'](_[_0x7926('0x4a')](_0x370599[_0x7926('0x19')][_0x21671a],['contactId',_0x7926('0x4b'),_0x7926('0x4c'),_0x7926('0x4d')])));return ami['Action']({'action':_0x7926('0x4e'),'channel':_0x370599[_0x7926('0x19')][_0x21671a][_0x7926('0x4f')]})[_0x7926('0x50')](function(_0x2c0cbf){if(_0x2c0cbf[_0x7926('0x32')]===_0x7926('0x51')){setTimeout(function(){if(_0x370599['actions'][_0x21671a]){utils[_0x7926('0x52')](_0x370599[_0x7926('0x16')][_0x370599['actions'][_0x21671a][_0x7926('0x47')]],_0x7926('0x53'));if(_0x370599[_0x7926('0x19')][_0x21671a][_0x7926('0x49')]===!![]){ut['decrementTalking'](_0x370599[_0x7926('0x16')][_0x370599[_0x7926('0x19')][_0x21671a][_0x7926('0x47')]],'[clearZombieChannel]');ut[_0x7926('0x54')](_0x7926('0x55')+_0x21671a,_0x370599[_0x7926('0x19')][_0x21671a][_0x7926('0x47')]);}ut[_0x7926('0x54')](_0x7926('0x56')+_0x21671a,_0x370599['actions'][_0x21671a][_0x7926('0x47')]);delete _0x370599[_0x7926('0x19')][_0x21671a];}},0x2328);}});}});};Preview[_0x7926('0x12')][_0x7926('0x3e')]=function(){var _0x1139a2=this;loggerAction[_0x7926('0x29')](_0x7926('0x57'),_['size'](this['actions']));for(var _0x44c9ef in this['actions']){if(_0x1139a2[_0x7926('0x19')][_0x7926('0x58')](_0x44c9ef)){_0x1139a2[_0x7926('0x42')](_0x44c9ef);}}};Preview[_0x7926('0x12')][_0x7926('0x41')]=function(_0x2a56c8){var _0x57f550=this;rpcDb['getContactRecallMe'](_0x2a56c8['id'],ut[_0x7926('0x59')](this[_0x7926('0x1a')]))['then'](function(_0x582290){if(!_[_0x7926('0x44')](_0x582290)){for(var _0x3dbb1c=0x0;_0x3dbb1c<_0x582290[_0x7926('0x5a')];_0x3dbb1c+=0x1){if(ut[_0x7926('0x5b')](_0x582290[_0x3dbb1c][_0x7926('0x5c')])<_0x2a56c8[_0x7926('0x5d')]*0x3c){if(_0x582290[_0x3dbb1c][_0x7926('0x5e')]&&!_0x582290[_0x3dbb1c][_0x7926('0x5e')][_0x7926('0x5f')]){_0x57f550[_0x7926('0x60')](_0x582290[_0x3dbb1c]['id'])[_0x7926('0x61')](ut[_0x7926('0x62')](_0x7926('0x63')))[_0x7926('0x50')](ut[_0x7926('0x62')]('[RecallMe]'));}else{rpcDb[_0x7926('0x64')](_0x582290[_0x3dbb1c]['id']);}}else{var _0x2e1a1d=new Action(_0x582290[_0x3dbb1c],_0x2a56c8);_0x2e1a1d[_0x7926('0x65')]=moment()[_0x7926('0x66')]('YYYY-MM-DD\x20HH:mm:ss');_0x2a56c8[_0x7926('0x67')]+=0x1;ut[_0x7926('0x68')](_0x2e1a1d,0x17,'RecallInQueue');if(_0x2a56c8['dialRecallInQueue']){rpcDb[_0x7926('0x69')](ut['createBody'](_0x582290[_0x3dbb1c]));rpcDb[_0x7926('0x6a')](_0x2e1a1d,_0x7926('0x6b'));}else{ut[_0x7926('0x68')](_0x2e1a1d,0x16,'RecallFailedTimeout');rpcDb[_0x7926('0x6a')](_0x2e1a1d,_0x7926('0x6c'));rpcDb[_0x7926('0x6d')](_0x2e1a1d,'[HistoryRecallClose]');}}}}})[_0x7926('0x50')](ut[_0x7926('0x62')](_0x7926('0x6e')));};Preview[_0x7926('0x12')][_0x7926('0x40')]=function(_0x4780ae){_0x4780ae['sendMessageOneNotActive']=!![];if(ut[_0x7926('0x6f')](_0x4780ae['loggedIn'])){_0x4780ae['message']=utils[_0x7926('0x33')][_0x7926('0x70')];}else if(!ut['isActive'](_0x4780ae[_0x7926('0x71')])){_0x4780ae['message']=utils[_0x7926('0x33')][_0x7926('0x34')];}else if(!this['isTrunkReachable'](_0x4780ae[_0x7926('0x72')])){if(!this[_0x7926('0x73')](_0x4780ae[_0x7926('0x74')])){_0x4780ae[_0x7926('0x32')]=utils[_0x7926('0x33')][_0x7926('0x75')];}else{_0x4780ae[_0x7926('0x32')]=utils[_0x7926('0x33')]['ACTIVE'];}}else{_0x4780ae[_0x7926('0x32')]=utils[_0x7926('0x33')][_0x7926('0x76')];}};Preview[_0x7926('0x12')][_0x7926('0x77')]=function(_0x3832e3,_0x42fc29,_0x2e1d2b){var _0x4a166f=this;var _0x4dd95b=this['actions'][_0x42fc29];var _0x30c59e=this[_0x7926('0x16')][_0x4dd95b['queue']];var _0x147aad;var _0x460a20=![];var _0x3a86a7=0x2;var _0x4900de=0x3;if(_0x30c59e){switch(_0x2e1d2b){case'1':_0x30c59e[_0x7926('0x78')]+=0x1;_0x4dd95b[_0x7926('0x79')]+=0x1;_0x4dd95b[_0x7926('0x7a')]=ut[_0x7926('0x7b')](_0x4dd95b);ut['logCustomer'](_0x4dd95b,0x0,_0x7926('0x7c'));ami[_0x7926('0x28')](_0x7926('0x7d'),ut[_0x7926('0x7e')](_0x4dd95b,_0x7926('0x7f')));rpcDb['createCustomerHistory'](_0x4dd95b,'[callProgressDetectingCustomer][logNoSuch]');_0x4a166f['verifyAdditionalPhones'](_0x4dd95b,'0',_0x30c59e)[_0x7926('0x61')](function(_0x301b7d){_0x460a20=_0x301b7d['additional']==0x1;_0x3a86a7=_0x30c59e[_0x7926('0x80')];_0x4900de=_0x30c59e[_0x7926('0x81')];if(!_0x460a20){if(ut[_0x7926('0x7b')](_0x4dd95b)>=_0x30c59e[_0x7926('0x82')]){_0x147aad=ut['cloneAction'](_0x4dd95b,0xf,'Global');rpcDb[_0x7926('0x6d')](_0x147aad,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x4dd95b[_0x7926('0x79')]>=_0x30c59e[_0x7926('0x83')]){rpcDb[_0x7926('0x6d')](_0x4dd95b,_0x7926('0x84'));}else{rpcDb['rescheduleContact'](ut[_0x7926('0x85')](_0x4dd95b,'countnosuchnumberretry',_0x30c59e[_0x7926('0x80')]),_0x4dd95b[_0x7926('0x86')],_0x4dd95b[_0x7926('0x87')]);}}delete this[_0x7926('0x19')][_0x3832e3[_0x7926('0x88')]];}else{_0x4dd95b['countnosuchnumberretry']++;logger[_0x7926('0x29')](_0x7926('0x89'),_0x4dd95b[_0x7926('0x79')]);logger[_0x7926('0x29')]('id',_0x4dd95b[_0x7926('0x8a')]);_0x4a166f[_0x7926('0x8b')]({'id':_0x4dd95b['idContact'],'field':{'countnosuchnumberretry':_0x4dd95b['countnosuchnumberretry']}})[_0x7926('0x61')](function(){_0x4a166f[_0x7926('0x8c')](_0x4dd95b,_0x3a86a7,_0x4900de)[_0x7926('0x61')](function(){});});}});break;case'ANSWER':var _0x1c82cf=moment()['format'](_0x7926('0x8d'));_0x4dd95b[_0x7926('0x8e')]=_0x1c82cf;_0x4dd95b[_0x7926('0x8f')]=_0x1c82cf;_0x4dd95b[_0x7926('0x49')]=!![];_0x30c59e['pTalking']+=0x1;logger[_0x7926('0x29')](_0x7926('0x90'),_0x4dd95b[_0x7926('0x91')],'\x20Queue',_0x30c59e[_0x7926('0x2c')],_0x7926('0x48'),_0x30c59e[_0x7926('0x2f')]);ami[_0x7926('0x28')](_0x7926('0x92'),ut[_0x7926('0x7e')](_0x4dd95b,_0x7926('0x93'),this[_0x7926('0x16')][_0x4dd95b['queue']]));if(_0x30c59e['acw']||_0x30c59e[_0x7926('0x94')]){ami[_0x7926('0x28')](_0x7926('0x95'),{'queue':_0x4dd95b[_0x7926('0x47')],'interface':_0x4dd95b[_0x7926('0x96')],'uniqueid':_0x4dd95b[_0x7926('0x91')]});}break;case'16':ami[_0x7926('0x28')](_0x7926('0x97'),ut[_0x7926('0x7e')](_0x4dd95b,'complete',this[_0x7926('0x16')][_0x4dd95b['queue']]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x4dd95b,_0x7926('0x98')));_0x30c59e[_0x7926('0x99')]+=0x1;_0x30c59e['total']+=0x1;_0x30c59e[_0x7926('0x9a')]+=0x1;ut[_0x7926('0x9b')](_0x30c59e,_0x7926('0x9c'));_0x4dd95b['countglobal']=ut[_0x7926('0x7b')](_0x4dd95b);ut['logCustomer'](_0x4dd95b,0x4,_0x7926('0x9d'));rpcDb[_0x7926('0x6a')](_0x4dd95b,_0x7926('0x9e'));rpcDb[_0x7926('0x6d')](_0x4dd95b,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb['crateCustomerReportQueue'](_0x4dd95b);_0x30c59e['sumDuration']+=_0x4dd95b[_0x7926('0x9f')];_0x30c59e[_0x7926('0xa0')]+=_0x4dd95b[_0x7926('0x9f')];logger['info'](_0x7926('0xa1'),_0x4dd95b['uniqueid'],'\x20Queue',_0x30c59e[_0x7926('0x2c')],_0x7926('0x48'),_0x30c59e[_0x7926('0x2f')]);delete this[_0x7926('0x19')][_0x3832e3[_0x7926('0x88')]];break;case _0x7926('0xa2'):_0x30c59e[_0x7926('0xa3')]+=0x1;_0x4dd95b[_0x7926('0xa4')]+=0x1;_0x4dd95b['countglobal']=ut['totalGlobal'](_0x4dd95b);ut[_0x7926('0x68')](_0x4dd95b,0x5,_0x7926('0xa5'));_0x3a86a7=_0x30c59e[_0x7926('0xa6')];_0x4900de=_0x30c59e[_0x7926('0x81')];ami[_0x7926('0x28')]('custom:agentbusy',ut[_0x7926('0x7e')](_0x4dd95b,'busy'));rpcDb[_0x7926('0x6a')](_0x4dd95b,_0x7926('0xa7'));_0x4a166f[_0x7926('0xa8')](_0x4dd95b,'5',_0x30c59e)[_0x7926('0x61')](function(_0x457672){_0x460a20=_0x457672[_0x7926('0xa9')]==0x1;if(!_0x460a20){if(ut[_0x7926('0x7b')](_0x4dd95b)>=_0x30c59e['dialGlobalMaxRetry']){_0x147aad=ut[_0x7926('0xaa')](_0x4dd95b,0xf,_0x7926('0xab'));rpcDb[_0x7926('0x6d')](_0x147aad,_0x7926('0xac'));}else{if(_0x4dd95b[_0x7926('0xa4')]>=_0x30c59e[_0x7926('0xad')]){rpcDb['createCustomerFinal'](_0x4dd95b,_0x7926('0xa7'));}else{rpcDb['rescheduleContact'](ut[_0x7926('0x85')](_0x4dd95b,_0x7926('0xa4'),_0x30c59e[_0x7926('0xa6')]),_0x4dd95b[_0x7926('0x86')],_0x4dd95b[_0x7926('0x87')]);}}}else{_0x4dd95b['countbusyretry']++;_0x4a166f['incrementPreviewCounters']({'id':_0x4dd95b[_0x7926('0x8a')],'field':{'countbusyretry':_0x4dd95b[_0x7926('0xa4')]}})[_0x7926('0x61')](function(){_0x4a166f['swapAdditionalPhones'](_0x4dd95b,_0x3a86a7,_0x4900de)[_0x7926('0x61')](function(){});});}});break;case'NOANSWER':_0x30c59e[_0x7926('0xae')]+=0x1;_0x4dd95b[_0x7926('0xaf')]+=0x1;_0x4dd95b[_0x7926('0x7a')]=ut['totalGlobal'](_0x4dd95b);ut['logCustomer'](_0x4dd95b,0x3,_0x7926('0xb0'));_0x3a86a7=_0x30c59e[_0x7926('0xb1')];_0x4900de=_0x30c59e[_0x7926('0x81')];var _0x1440bd=ut[_0x7926('0xb2')](_0x4dd95b,_0x30c59e);ami[_0x7926('0x28')](_0x7926('0xb3'),_0x1440bd);rpcDb['createCustomerHistory'](_0x4dd95b,'[callProgressDetectingCustomer][logNoAnswer]');_0x4a166f[_0x7926('0xa8')](_0x4dd95b,'3',_0x30c59e)[_0x7926('0x61')](function(_0x4dbe95){_0x460a20=_0x4dbe95[_0x7926('0xa9')]==0x1;if(!_0x460a20){if(ut[_0x7926('0x7b')](_0x4dd95b)>=_0x30c59e[_0x7926('0x82')]){_0x147aad=ut['cloneAction'](_0x4dd95b,0xf,_0x7926('0xab'));rpcDb[_0x7926('0x6d')](_0x147aad,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x4dd95b[_0x7926('0xaf')]>=_0x30c59e[_0x7926('0xb4')]){rpcDb['createCustomerFinal'](_0x4dd95b,_0x7926('0xb5'));}else{rpcDb[_0x7926('0xb6')](ut[_0x7926('0x85')](_0x4dd95b,_0x7926('0xaf'),_0x30c59e[_0x7926('0xb1')]),_0x4dd95b['unlockAgent'],_0x4dd95b['activeContact']);}}}else{_0x4dd95b['countnoanswerretry']++;_0x4a166f[_0x7926('0x8b')]({'id':_0x4dd95b[_0x7926('0x8a')],'field':{'countnoanswerretry':_0x4dd95b[_0x7926('0xaf')]}})[_0x7926('0x61')](function(){_0x4a166f[_0x7926('0x8c')](_0x4dd95b,_0x3a86a7,_0x4900de)[_0x7926('0x61')](function(){});});}});break;case _0x7926('0xb7'):_0x30c59e[_0x7926('0xb8')]+=0x1;_0x4dd95b[_0x7926('0xb9')]+=0x1;_0x4dd95b[_0x7926('0x7a')]=ut[_0x7926('0x7b')](_0x4dd95b);ut[_0x7926('0x68')](_0x4dd95b,0x8,_0x7926('0xba'));_0x3a86a7=_0x30c59e['dialCongestionRetryFrequency'];_0x4900de=_0x30c59e['callAdditionalPhoneAfterMin'];ami['emit'](_0x7926('0xbb'),ut[_0x7926('0x7e')](_0x4dd95b,_0x7926('0xbc')));rpcDb[_0x7926('0x6a')](_0x4dd95b,_0x7926('0xbd'));_0x4a166f[_0x7926('0xa8')](_0x4dd95b,'8',_0x30c59e)[_0x7926('0x61')](function(_0x3fca6d){_0x460a20=_0x3fca6d[_0x7926('0xa9')]==0x1;if(!_0x460a20){if(ut[_0x7926('0x7b')](_0x4dd95b)>=_0x30c59e[_0x7926('0x82')]){_0x147aad=ut[_0x7926('0xaa')](_0x4dd95b,0xf,_0x7926('0xab'));rpcDb['createCustomerFinal'](_0x147aad,_0x7926('0xbe'));}else{if(_0x4dd95b[_0x7926('0xb9')]>=_0x30c59e[_0x7926('0xbf')]){rpcDb[_0x7926('0x6d')](_0x4dd95b,_0x7926('0xbd'));}else{rpcDb[_0x7926('0xb6')](ut[_0x7926('0x85')](_0x4dd95b,_0x7926('0xb9'),_0x30c59e[_0x7926('0xa6')]),_0x4dd95b[_0x7926('0x86')],_0x4dd95b['activeContact']);}}}else{_0x4dd95b[_0x7926('0xb9')]++;_0x4a166f['incrementPreviewCounters']({'id':_0x4dd95b['idContact'],'field':{'countcongestionretry':_0x4dd95b[_0x7926('0xb9')]}})[_0x7926('0x61')](function(){_0x4a166f[_0x7926('0x8c')](_0x4dd95b,_0x3a86a7,_0x4900de)[_0x7926('0x61')](function(){});});}});break;case _0x7926('0xc0'):_0x30c59e[_0x7926('0xc1')]+=0x1;_0x4dd95b['countagentrejectretry']+=0x1;_0x4dd95b['countglobal']=ut[_0x7926('0x7b')](_0x4dd95b);ut[_0x7926('0x68')](_0x4dd95b,0x14,'AgentReject');_0x3a86a7=_0x30c59e['dialAgentRejectRetryFrequency'];_0x4900de=_0x30c59e[_0x7926('0x81')];ami[_0x7926('0x28')](_0x7926('0xc2'),ut['buildObj'](_0x4dd95b,_0x7926('0xc3')));rpcDb[_0x7926('0x6a')](_0x4dd95b,'[syncHangupRequest][logAgentReject]');_0x4a166f[_0x7926('0xa8')](_0x4dd95b,'20',_0x30c59e)['then'](function(_0x50bdfb){_0x460a20=_0x50bdfb[_0x7926('0xa9')]==0x1;if(!_0x460a20){if(ut[_0x7926('0x7b')](_0x4dd95b)>=_0x30c59e[_0x7926('0x82')]){_0x147aad=ut['cloneAction'](_0x4dd95b,0x14,_0x7926('0xc4'));rpcDb[_0x7926('0x6d')](_0x147aad,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x4dd95b[_0x7926('0xc5')]>=_0x30c59e[_0x7926('0xc6')]){rpcDb[_0x7926('0x6d')](_0x4dd95b,_0x7926('0xc7'));}else{rpcDb[_0x7926('0xb6')](ut['scheduledAt'](_0x4dd95b,_0x7926('0xc5'),_0x30c59e[_0x7926('0xc8')]),_0x4dd95b[_0x7926('0x86')],_0x4dd95b['activeContact']);}}}else{_0x4dd95b[_0x7926('0xaf')]++;_0x4a166f[_0x7926('0x8b')]({'id':_0x4dd95b['idContact'],'field':{'countnoanswerretry':_0x4dd95b[_0x7926('0xaf')]}})[_0x7926('0x61')](function(){_0x4a166f[_0x7926('0x8c')](_0x4dd95b,_0x3a86a7,_0x4900de)[_0x7926('0x61')](function(){});});}});break;case _0x7926('0xc9'):_0x30c59e[_0x7926('0xca')]+=0x1;_0x4dd95b[_0x7926('0xcb')]+=0x1;_0x4dd95b[_0x7926('0x7a')]=ut[_0x7926('0x7b')](_0x4dd95b);ut['logCustomer'](_0x4dd95b,0xb,'Abandoned');rpcDb[_0x7926('0x6a')](_0x4dd95b,_0x7926('0xcc'));_0x4a166f[_0x7926('0xa8')](_0x4dd95b,'11',_0x30c59e)[_0x7926('0x61')](function(_0x176bd9){_0x460a20=_0x176bd9[_0x7926('0xa9')]==0x1;if(!_0x460a20){if(ut['totalGlobal'](_0x4dd95b)>=_0x30c59e[_0x7926('0x82')]){_0x147aad=ut[_0x7926('0xaa')](_0x4dd95b,0xf,'Global');rpcDb[_0x7926('0x6d')](_0x147aad,_0x7926('0xcc'));}else{if(_0x4dd95b[_0x7926('0xcd')]>=_0x30c59e[_0x7926('0xce')]){rpcDb[_0x7926('0x6d')](_0x4dd95b,_0x7926('0xcc'));}else{rpcDb[_0x7926('0xb6')](ut[_0x7926('0x85')](_0x4dd95b,_0x7926('0xcb'),_0x30c59e[_0x7926('0xcf')]),_0x4dd95b[_0x7926('0x86')],_0x4dd95b[_0x7926('0x87')]);}}}else{_0x4dd95b[_0x7926('0xaf')]++;_0x4a166f[_0x7926('0x8b')]({'id':_0x4dd95b['idContact'],'field':{'countnoanswerretry':_0x4dd95b['countnoanswerretry']}})[_0x7926('0x61')](function(){_0x4a166f[_0x7926('0x8c')](_0x4dd95b,_0x3a86a7,_0x4900de)[_0x7926('0x61')](function(){});});}});break;case'18':_0x30c59e[_0x7926('0xd0')]+=0x1;_0x4dd95b[_0x7926('0xd1')]+=0x1;_0x4dd95b[_0x7926('0x7a')]=ut[_0x7926('0x7b')](_0x4dd95b);ut[_0x7926('0x68')](_0x4dd95b,0x12,_0x3832e3[_0x7926('0xd2')]||_0x3832e3[_0x7926('0xd3')]);ami[_0x7926('0x28')](_0x7926('0xd4'),ut[_0x7926('0x7e')](_0x4dd95b,_0x7926('0xd5')));rpcDb['createCustomerHistory'](_0x4dd95b,_0x7926('0xd6'));_0x4a166f[_0x7926('0xa8')](_0x4dd95b,'18',_0x30c59e)[_0x7926('0x61')](function(_0x2a15eb){_0x460a20=_0x2a15eb[_0x7926('0xa9')]==0x1;if(!_0x460a20){if(ut[_0x7926('0x7b')](_0x4dd95b)>=_0x30c59e[_0x7926('0x82')]){_0x147aad=ut[_0x7926('0xaa')](_0x4dd95b,0x12,'Global');rpcDb['createCustomerFinal'](_0x147aad,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb[_0x7926('0x6d')](_0x4dd95b,_0x7926('0xd6'));}}else{_0x4dd95b['countnoanswerretry']++;_0x4a166f[_0x7926('0x8b')]({'id':_0x4dd95b['idContact'],'field':{'countnoanswerretry':_0x4dd95b[_0x7926('0xaf')]}})[_0x7926('0x61')](function(){_0x4a166f[_0x7926('0x8c')](_0x4dd95b,_0x3a86a7,_0x4900de)[_0x7926('0x61')](function(){});});}});delete this[_0x7926('0x19')][_0x3832e3[_0x7926('0x88')]];break;case'19':_0x30c59e['outboundUnknownCallsDay']+=0x1;_0x4dd95b[_0x7926('0x7a')]=ut['totalGlobal'](_0x4dd95b);ut[_0x7926('0x68')](_0x4dd95b,0x13,_0x3832e3[_0x7926('0xd2')]||_0x3832e3['dialstatus']);ami[_0x7926('0x28')](_0x7926('0xd4'),ut[_0x7926('0x7e')](_0x4dd95b,_0x7926('0xd5')));rpcDb[_0x7926('0x6a')](_0x4dd95b,_0x7926('0xd7'));_0x4a166f[_0x7926('0xa8')](_0x4dd95b,'18',_0x30c59e)['then'](function(_0x414202){_0x460a20=_0x414202[_0x7926('0xa9')]==0x1;if(!_0x460a20){if(ut['totalGlobal'](_0x4dd95b)>=_0x30c59e[_0x7926('0x82')]){_0x147aad=ut[_0x7926('0xaa')](_0x4dd95b,0xf,_0x7926('0xab'));rpcDb[_0x7926('0x6d')](_0x147aad,_0x7926('0xd7'));}else{rpcDb[_0x7926('0x6d')](_0x4dd95b,_0x7926('0xd7'));}}else{_0x4dd95b['countnoanswerretry']++;_0x4a166f['incrementPreviewCounters']({'id':_0x4dd95b[_0x7926('0x8a')],'field':{'countnoanswerretry':_0x4dd95b[_0x7926('0xaf')]}})[_0x7926('0x61')](function(){_0x4a166f[_0x7926('0x8c')](_0x4dd95b,_0x3a86a7,_0x4900de)[_0x7926('0x61')](function(){});});}});delete this[_0x7926('0x19')][_0x3832e3[_0x7926('0x88')]];break;default:if(_0x4dd95b[_0x7926('0x49')]){ut[_0x7926('0x9b')](_0x30c59e,'[default]');ut[_0x7926('0x54')](_0x7926('0xd8')+_0x30c59e[_0x7926('0x2c')],_0x3832e3);}_0x30c59e['outboundUnknownCallsDay']+=0x1;_0x4dd95b[_0x7926('0x7a')]=ut[_0x7926('0x7b')](_0x4dd95b);ut['logCustomer'](_0x4dd95b,0xc,_0x3832e3['cause-txt']||_0x3832e3[_0x7926('0xd3')]);_0x3a86a7=_0x30c59e[_0x7926('0xc8')];_0x4900de=_0x30c59e['callAdditionalPhoneAfterMin'];rpcDb[_0x7926('0x6a')](_0x4dd95b,'[callProgressDetectingCustomer][logUnknown]');_0x4a166f[_0x7926('0xa8')](_0x4dd95b,'20',_0x30c59e)[_0x7926('0x61')](function(_0x13a0db){_0x460a20=_0x13a0db[_0x7926('0xa9')]==0x1;if(!_0x460a20){if(ut[_0x7926('0x7b')](_0x4dd95b)>=_0x30c59e[_0x7926('0x82')]){_0x147aad=ut[_0x7926('0xaa')](_0x4dd95b,0xf,'Global');rpcDb[_0x7926('0x6d')](_0x147aad,_0x7926('0xd9'));}else{rpcDb[_0x7926('0x6d')](_0x4dd95b,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0x7926('0x19')][_0x3832e3[_0x7926('0x88')]];}else{_0x4a166f[_0x7926('0x8c')](_0x4dd95b,_0x3a86a7,_0x4900de)[_0x7926('0x61')](function(){});}});}if(!(_0x4dd95b['dialAnswer']&&_0x2e1d2b==='16')){utils[_0x7926('0x52')](_0x30c59e,_0x7926('0xda'));logger['info'](_0x7926('0xdb'),_0x4dd95b['uniqueid'],_0x7926('0xdc'),_0x30c59e['name'],_0x7926('0xdd'),_0x30c59e[_0x7926('0x2e')]);}if(_0x2e1d2b!==_0x7926('0xde')){delete this[_0x7926('0x19')][_0x3832e3[_0x7926('0x88')]];delete this['actions'][_0x3832e3[_0x7926('0xdf')]];}_0x30c59e['queueSummaryCountersUpdated']=!![];}};Preview[_0x7926('0x12')][_0x7926('0xe0')]=function(_0x3e9f43,_0x3dd1b8,_0x499e5a){if(_[_0x7926('0xe1')](_0x3dd1b8)&&_0x7926('0xe2')!==typeof _0x3dd1b8){return;}if(_[_0x7926('0xe1')](_0x499e5a)&&_0x7926('0xe2')!==typeof _0x499e5a){return;}switch(_0x499e5a[_0x7926('0xe3')]){case'0':ut['logAgent'](_0x3e9f43,0x0,_0x7926('0x7c'));rpcDb[_0x7926('0xe4')](_0x3e9f43,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0x7926('0xe5')](_0x3e9f43,0x3,_0x7926('0xb0'));rpcDb[_0x7926('0xe4')](_0x3e9f43,_0x7926('0xe6'));break;case'5':ut[_0x7926('0xe5')](_0x3e9f43,0x5,_0x7926('0xa5'));rpcDb['createAgentHistory'](_0x3e9f43,_0x7926('0xe7'));break;case'8':ut[_0x7926('0xe5')](_0x3e9f43,0x8,'Congestion');rpcDb['createAgentHistory'](_0x3e9f43,_0x7926('0xe8'));break;case'22':ut[_0x7926('0xe5')](_0x3e9f43,0x16,'AnswerAGI');rpcDb[_0x7926('0xe4')](_0x3e9f43,_0x7926('0xe9'));break;default:ut[_0x7926('0xe5')](_0x3e9f43,0xc,_0x499e5a[_0x7926('0xe3')]);rpcDb[_0x7926('0xe4')](_0x3e9f43,_0x7926('0xe8'));}utils[_0x7926('0x52')](_0x3dd1b8,_0x7926('0xea'));logger[_0x7926('0x29')](_0x7926('0xeb'),_0x3e9f43['uniqueid'],_0x7926('0xdc'),_0x3dd1b8[_0x7926('0x2c')],_0x7926('0xdd'),_0x3dd1b8[_0x7926('0x2e')]);delete this['actions'][_0x3e9f43['uniqueid']];};Preview[_0x7926('0x12')][_0x7926('0xa8')]=function(_0x5e07a0,_0x235901,_0x53365f){return cmHopperAdditionalPhone[_0x7926('0xa8')](_0x5e07a0,_0x235901,_0x53365f)[_0x7926('0x50')](logger[_0x7926('0x29')](_0x7926('0xec')));};Preview[_0x7926('0x12')][_0x7926('0x8c')]=function(_0x4fe077,_0x31806c,_0x5e5d54){return cmHopperAdditionalPhone['swapAdditionalPhones'](_0x4fe077,_0x31806c,_0x5e5d54)[_0x7926('0x50')](logger['info']('[swapAdditionalPhone]\x20'));};Preview[_0x7926('0x12')][_0x7926('0x8b')]=function(_0x139a30){return Promise[_0x7926('0xed')]()['then'](cmHopperAdditionalPhone['incrementPreviewCounters'](_0x139a30))[_0x7926('0x50')](logger[_0x7926('0x29')]('[incrementPreviewCounters]\x20'));};Preview[_0x7926('0x12')][_0x7926('0xee')]=function(_0x50e63a,_0x153c08,_0x4c9603,_0x4a57ae,_0x34cf9d){var _0x77920e=this;return new Promise(function(_0x1cd32c,_0x4c7812){if(_[_0x7926('0x44')](_0x153c08)||_[_0x7926('0x44')](_0x153c08[_0x7926('0xef')])||_[_0x7926('0x44')](_0x153c08[_0x7926('0xf0')])||_[_0x7926('0x44')](_0x153c08[_0x7926('0x4c')])){_0x4c7812(ut[_0x7926('0x32')]('Contact\x20is\x20undefined',_0x4a57ae,_0x34cf9d));return;}var _0xc8bda6=uuid['v4']();var _0x38c84f=_0x77920e[_0x7926('0x16')][_0x153c08[_0x7926('0xf1')][_0x7926('0x2c')]];var _0x48a535=_0x4c9603?_0x77920e[_0x7926('0x1a')][_0x4c9603]['id']:undefined;_0x77920e['actions'][_0xc8bda6]=new Action(_0x153c08,_0x38c84f,_0xc8bda6,_0x4c9603,_0x48a535);var _0x39ffe9=_0x77920e['actions'][_0xc8bda6];_0x39ffe9[_0x7926('0x86')]=_0x4a57ae;_0x39ffe9[_0x7926('0x87')]=_0x34cf9d;_0x39ffe9[_0x7926('0xf2')]=_0x4c9603;if(_[_0x7926('0xf3')](_0x50e63a)){_0x77920e[_0x7926('0xf4')](_0x39ffe9,_0x38c84f,_0x153c08,_0x4c9603)[_0x7926('0x61')](function(_0x236779){logger[_0x7926('0x29')]('[Preview][execCall][success]','Queue:\x20'+_0x39ffe9[_0x7926('0x47')]+_0x7926('0xf5')+_0x39ffe9[_0x7926('0x8a')],JSON[_0x7926('0x46')](_0x236779));ami[_0x7926('0x28')](_0x7926('0xf6'),ut['buildObj'](_0x39ffe9,_0x7926('0xf7'),_0x77920e[_0x7926('0x16')][_0x39ffe9[_0x7926('0x47')]]));_0x1cd32c(ut['message'](_0x7926('0xf8')));})[_0x7926('0x50')](function(_0x4f43ab){ut[_0x7926('0x35')](_0x7926('0xf9'),_0x4f43ab);_0x4c7812(ut[_0x7926('0x32')](_0x7926('0xfa'),_0x4a57ae,_0x34cf9d));});}else{_0x38c84f['outboundBlacklistCallsDay']+=0x1;ut[_0x7926('0xfb')](_0x39ffe9);rpcDb['createHistory'](_0x39ffe9,'[Blacklist][error]');delete _0x77920e['actions'][_0xc8bda6];_0x4c7812(ut[_0x7926('0x32')](_0x7926('0xfc'),_0x4a57ae,_0x34cf9d));}});};Preview[_0x7926('0x12')][_0x7926('0x73')]=function(_0x1155a5){return!_['isNil'](_0x1155a5)&&!_['isNil'](_0x1155a5[_0x7926('0x2c')])&&!_['isNil'](_0x1155a5[_0x7926('0xfd')])&&_0x1155a5[_0x7926('0xfd')]&&!_[_0x7926('0x44')](this[_0x7926('0x18')][util[_0x7926('0x66')](_0x7926('0xfe'),_0x1155a5['name'])])&&!_['isNil'](this['trunks'][util['format']('SIP/%s',_0x1155a5[_0x7926('0x2c')])]['status'])&&(this[_0x7926('0x18')][util['format'](_0x7926('0xfe'),_0x1155a5['name'])]['status']===_0x7926('0xff')||this['trunks'][util[_0x7926('0x66')](_0x7926('0xfe'),_0x1155a5['name'])]['status']==='unmonitored');};Preview['prototype']['run']=function(_0x3d752b,_0x504d19){return this[_0x7926('0x100')](_0x3d752b,_0x504d19)[_0x7926('0x61')](function(_0x3aa4ef){return _[_0x7926('0x4a')](_0x3aa4ef,[_0x7926('0x32')]);})[_0x7926('0x50')](function(_0x1e1b95){if(_0x1e1b95[_0x7926('0x101')]){rpcDb[_0x7926('0x102')](_0x3d752b);}if(_0x1e1b95[_0x7926('0xfd')]){rpcDb['disableContact'](_0x3d752b);}throw _[_0x7926('0x4a')](_0x1e1b95,['message']);});};Preview[_0x7926('0x12')][_0x7926('0x100')]=function(_0x5b9111,_0x5309f0){var _0x6170f9=this;var _0x5856e4,_0x498352;return rpcDb[_0x7926('0x103')](_0x5b9111)[_0x7926('0x61')](function(_0x5edcf0){if(!_['isNil'](_0x5edcf0[0x0])){_0x498352=_0x5edcf0[0x0][_0x7926('0x104')]?![]:!![];_0x5856e4=_0x5edcf0[0x0][_0x7926('0x104')]?!![]:![];_0x5856e4=_0x5309f0?!![]:_0x5856e4;}var _0x460b6e=_0x6170f9[_0x7926('0x105')](_0x5edcf0);if(_0x460b6e[_0x7926('0x106')]){rpcDb['checkIsBlackList'](_[_0x7926('0x4a')](_0x5edcf0[0x0],[_0x7926('0x4c'),_0x7926('0xf0')]))[_0x7926('0x61')](function(_0xbe17a0){_0x6170f9[_0x7926('0xee')](_0xbe17a0,_0x5edcf0[0x0],_0x5309f0,_0x498352,_0x5856e4)[_0x7926('0x61')](function(_0x94ee22){return _0x94ee22;})[_0x7926('0x50')](function(_0x240fa9){throw _0x240fa9;});})[_0x7926('0x50')](function(_0x3fa6fc){ut[_0x7926('0x35')](_0x7926('0x107'),_0x3fa6fc);throw ut[_0x7926('0x32')](_0x7926('0x108'),_0x498352,_0x5856e4);});}else{throw ut[_0x7926('0x32')](_0x460b6e[_0x7926('0x32')],_0x498352,_0x5856e4);}})[_0x7926('0x50')](function(_0x3bdba2){ut['logger'](_0x7926('0x109'),_0x3bdba2);throw ut[_0x7926('0x32')](_0x7926('0x108'),![],!![]);});};Preview['prototype']['validateContact']=function(_0x34a498){if(_[_0x7926('0x44')](_0x34a498)||_[_0x7926('0xf3')](_0x34a498)||!_[_0x7926('0x44')](_0x34a498[0x0]['Agent'])&&_[_0x7926('0x44')](_0x34a498[0x0][_0x7926('0x5e')][_0x7926('0x2c')])){ut[_0x7926('0x35')](_0x7926('0x10a'),_0x34a498);return{'isValid':![],'message':_0x7926('0x10b')};}var _0x4cfaf4=this['campaignsPreview'][_0x34a498[0x0][_0x7926('0xf1')][_0x7926('0x2c')]];_0x4cfaf4[_0x7926('0x32')]=utils['CAMPAIGN_STATUS']['ACTIVE'];if(_[_0x7926('0x44')](_0x4cfaf4)){ut['logger'](_0x7926('0x10c'),_0x4cfaf4);return{'isValid':![],'message':_0x7926('0x10d')};}if(!this[_0x7926('0x73')](_0x4cfaf4[_0x7926('0x72')])){ut[_0x7926('0x35')](_0x7926('0x10e'),_0x7926('0x10f')+_0x4cfaf4[_0x7926('0x2c')]+_0x7926('0x110'));if(!this['isTrunkReachable'](_0x4cfaf4[_0x7926('0x74')])){ut['logger'](_0x7926('0x10e'),_0x4cfaf4[_0x7926('0x2c')]+_0x7926('0x111'));return{'isValid':![],'message':_0x7926('0x112')};}}if(!ut[_0x7926('0x113')](_0x4cfaf4['dialActive'])){ut[_0x7926('0x35')]('[Preview][validateContact][Campaign\x20Active]',_0x4cfaf4['name']+'\x20Not\x20Active');return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x4cfaf4['name']+_0x7926('0x114')};}return{'isValid':!![],'message':_0x7926('0x115')};};Preview[_0x7926('0x12')][_0x7926('0xf4')]=function(_0x13e71c,_0x4cf65a,_0x27592a,_0x4521d1){var _0x34b315=this;return new Promise(function(_0x58609b,_0x1e34f2){var _0x47fe4a=_0x13e71c[_0x7926('0x91')];var _0x3bdc08=_0x34b315[_0x7926('0x73')](_0x4cf65a['Trunk'])?util[_0x7926('0x66')](_0x7926('0x116'),_0x4cf65a[_0x7926('0x72')]['name'],_['isNil'](_0x4cf65a[_0x7926('0x117')])?'':_0x4cf65a[_0x7926('0x117')][_0x7926('0x118')]()||'',_0x4cf65a[_0x7926('0x119')]>0x0?_0x27592a[_0x7926('0xf0')][_0x7926('0x11a')](_0x4cf65a[_0x7926('0x119')]):_0x27592a[_0x7926('0xf0')]):util[_0x7926('0x66')](_0x7926('0x116'),_[_0x7926('0x44')](_0x4cf65a[_0x7926('0x74')])?_0x4cf65a['Trunk']['name']:_0x4cf65a['TrunkBackup'][_0x7926('0x2c')],_[_0x7926('0x44')](_0x4cf65a[_0x7926('0x117')])?'':_0x4cf65a[_0x7926('0x117')][_0x7926('0x118')]()||'',_0x4cf65a[_0x7926('0x119')]>0x0?_0x27592a[_0x7926('0xf0')][_0x7926('0x11a')](_0x4cf65a[_0x7926('0x119')]):_0x27592a[_0x7926('0xf0')]);var _0x38daa2=_0x34b315[_0x7926('0x73')](_0x4cf65a[_0x7926('0x72')])?ut['getCallerId'](_0x4cf65a[_0x7926('0x72')]['callerid'],_0x4cf65a[_0x7926('0x11b')],_0x4cf65a['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x7926('0x11c')](_0x4cf65a[_0x7926('0x11d')],_0x4cf65a[_0x7926('0x11e')]):_0x4cf65a[_0x7926('0x11d')]):ut['getCallerId'](_[_0x7926('0x44')](_0x4cf65a[_0x7926('0x74')])?_0x4cf65a[_0x7926('0x72')][_0x7926('0x11f')]:_0x4cf65a[_0x7926('0x74')][_0x7926('0x11f')],_0x4cf65a[_0x7926('0x11b')],_0x4cf65a['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x7926('0x11c')](_0x4cf65a[_0x7926('0x11d')],_0x4cf65a['dialRandomLastDigitCallerIdNumber']):_0x4cf65a['dialOriginateCallerIdNumber']);if(_0x38daa2){_0x13e71c['originatecalleridname']=ut[_0x7926('0x120')](_0x38daa2);_0x13e71c[_0x7926('0x121')]=ut[_0x7926('0x122')](_0x38daa2);}var _0x3875c1=ut['addVariables'](_0x4cf65a,_0x27592a,_0x3bdc08,_0x38daa2,_0x47fe4a,_0x13e71c);var _0x5e3ad8=utils[_0x7926('0x123')](_0x27592a['Contact']);Object[_0x7926('0x124')](_0x3875c1,_0x5e3ad8);_[_0x7926('0x125')](_0x13e71c,ut[_0x7926('0x126')](_0x3875c1));_0x13e71c[_0x7926('0x65')]=moment()[_0x7926('0x66')](_0x7926('0x8d'));_0x4cf65a[_0x7926('0x127')]=_0x3875c1;var _0x2419f1=ut['variablesAction'](_0x13e71c,_0x4cf65a,_0x3875c1,_0x13e71c[_0x7926('0x87')],_0x4521d1);return ami['Action'](_0x2419f1)[_0x7926('0x61')](function(_0x3b5366){_0x4cf65a['originated']+=0x1;logger['info']('[originated][increment]',_0x47fe4a,_0x7926('0xdc'),_0x4cf65a[_0x7926('0x2c')],_0x7926('0xdd'),_0x4cf65a['originated']);_0x58609b(_0x3b5366);})[_0x7926('0x50')](function(_0xfb38ac){ut[_0x7926('0xe5')](_0x13e71c,0xe,_0x7926('0x128'));rpcDb[_0x7926('0xe4')](_0x13e71c,_0x7926('0x129'));_0x1e34f2(_0xfb38ac);});});};Preview['prototype'][_0x7926('0x12a')]=function(_0x5cbaec){if(this[_0x7926('0x19')][_0x5cbaec[_0x7926('0x88')]]){this[_0x7926('0x19')][_0x5cbaec['linkedid']][_0x7926('0x4f')]=_0x5cbaec['channel'];}};Preview[_0x7926('0x12')]['syncOriginateResponse']=function(_0x5d0359){var _0x5529df=this;var _0x500c24=this[_0x7926('0x19')][_0x5d0359['actionid']];if(_0x500c24){if(_0x500c24['lookAgent']&&this['agents'][_0x500c24[_0x7926('0xf2')]]){ut[_0x7926('0x12b')](_0x500c24,this['agents'][_0x500c24[_0x7926('0xf2')]][_0x7926('0x2c')],this[_0x7926('0x1a')][_0x500c24[_0x7926('0xf2')]]['id']);}var _0x1240ba=_['clone'](_0x500c24);_0x1240ba[_0x7926('0x8e')]=moment()[_0x7926('0x66')]('YYYY-MM-DD\x20HH:mm:ss');var _0x16b6ae=_0x5529df[_0x7926('0x16')][_0x500c24[_0x7926('0x47')]];if(ut[_0x7926('0x12c')](_0x5d0359['response'])){if(_0x500c24['unlockAgent']){rpcDb[_0x7926('0x102')](_0x500c24[_0x7926('0x8a')]);}if(_0x500c24[_0x7926('0x87')]){rpcDb[_0x7926('0x64')](_0x500c24[_0x7926('0x8a')]);}ami[_0x7926('0x28')]('custom:agentringnoanswer',ut[_0x7926('0x7e')](_0x500c24,_0x7926('0x12d'),this[_0x7926('0x16')][_0x500c24[_0x7926('0x47')]]));this['callProgressDetectingAgent'](_0x1240ba,_0x16b6ae,_0x5d0359);}else{_0x500c24['starttime']=moment()['format'](_0x7926('0x8d'));ut[_0x7926('0xe5')](_0x1240ba,0x4,_0x7926('0x9d'));rpcDb[_0x7926('0xe4')](_0x1240ba,_0x7926('0x12e'));}}};Preview['prototype'][_0x7926('0x1e')]=function(_0x13d65c){var _0x1aedf6=this[_0x7926('0x19')][_0x13d65c['linkedid']];var _0x3858d3;if(_0x1aedf6){_0x3858d3=this[_0x7926('0x16')][_0x1aedf6['queue']];logger[_0x7926('0x29')](_0x7926('0x12f'),_0x13d65c[_0x7926('0x88')],_0x7926('0xdc'),_0x3858d3['name'],_0x7926('0x48'),_0x3858d3[_0x7926('0x2f')]);}if(this['actions'][_0x13d65c[_0x7926('0x88')]]&&_0x13d65c[_0x7926('0x88')]!==_0x13d65c[_0x7926('0x91')]){if(_0x13d65c['cause']==='16'&&this[_0x7926('0x19')][_0x13d65c[_0x7926('0x88')]][_0x7926('0x49')]){this[_0x7926('0x77')](_0x13d65c,_0x13d65c[_0x7926('0x88')],_0x13d65c[_0x7926('0x130')]);}else if(this[_0x7926('0x19')][_0x13d65c[_0x7926('0x88')]][_0x7926('0x49')]){logger[_0x7926('0x29')](_0x7926('0x131'),_0x13d65c[_0x7926('0x88')],_0x13d65c[_0x7926('0x130')],_0x7926('0xdc'),_0x3858d3[_0x7926('0x2c')],_0x7926('0x48'),_0x3858d3['pTalking']);this[_0x7926('0x77')](_0x13d65c,_0x13d65c[_0x7926('0x88')],_0x13d65c['cause']);}}else if(_0x1aedf6&&_[_0x7926('0x44')](_0x1aedf6[_0x7926('0x132')])&&_0x3858d3['dialQueueProject']&&_0x13d65c[_0x7926('0x88')]===_0x13d65c['uniqueid']&&_[_0x7926('0x44')](_0x13d65c[_0x7926('0xe3')])&&_0x13d65c['cause']==='16'&&_0x13d65c['channelstate']==='6'&&_[_0x7926('0xe1')](_0x1aedf6[_0x7926('0x133')])){if(_0x1aedf6[_0x7926('0x86')]){rpcDb['unlockContact'](_0x1aedf6[_0x7926('0x8a')]);}if(_0x1aedf6['activeContact']){rpcDb[_0x7926('0x64')](_0x1aedf6[_0x7926('0x8a')]);}_0x13d65c[_0x7926('0xe3')]='22';this[_0x7926('0xe0')](_0x1aedf6,_0x3858d3,_0x13d65c);}else if(_0x1aedf6&&_0x1aedf6[_0x7926('0x133')]){if(_0x13d65c['cause']==='16'&&this['actions'][_0x13d65c[_0x7926('0x88')]][_0x7926('0x49')]){logger[_0x7926('0x29')](_0x7926('0x134'),_0x13d65c['linkedid'],_0x13d65c[_0x7926('0x130')],_0x7926('0xdc'),_0x3858d3[_0x7926('0x2c')],_0x7926('0x48'),_0x3858d3['pTalking']);this['callProgressDetectingCustomer'](_0x13d65c,_0x13d65c['linkedid'],_0x13d65c[_0x7926('0x130')]);}else if(this['actions'][_0x13d65c[_0x7926('0x88')]][_0x7926('0x49')]){logger[_0x7926('0x29')](_0x7926('0x131'),_0x13d65c['linkedid'],_0x13d65c[_0x7926('0x130')],_0x7926('0xdc'),_0x3858d3[_0x7926('0x2c')],_0x7926('0x48'),_0x3858d3[_0x7926('0x2f')]);this[_0x7926('0x77')](_0x13d65c,_0x13d65c[_0x7926('0x88')],_0x13d65c[_0x7926('0x130')]);}}};Preview[_0x7926('0x12')]['syncDialEnd']=function(_0x5369ef){if(this['actions'][_0x5369ef['destlinkedid']]&&_0x5369ef[_0x7926('0xdf')]!==_0x5369ef[_0x7926('0x135')]){this[_0x7926('0x77')](_0x5369ef,_0x5369ef['destlinkedid'],_0x5369ef[_0x7926('0xd3')]);}};Preview[_0x7926('0x12')][_0x7926('0x20')]=function(_0x21073d){if(this[_0x7926('0x19')][_0x21073d[_0x7926('0x88')]]&&_0x21073d[_0x7926('0x88')]!==_0x21073d[_0x7926('0x91')]&&!this[_0x7926('0x19')][_0x21073d['linkedid']][_0x7926('0x49')]){if(_0x21073d[_0x7926('0x130')]==='1'){this[_0x7926('0x77')](_0x21073d,_0x21073d[_0x7926('0x88')],_0x21073d[_0x7926('0x130')]);}}};Preview[_0x7926('0x12')]['addVariable']=function(_0x4896e4,_0x13a911,_0x3d5449){if(this[_0x7926('0x19')][_0x4896e4]){if(_[_0x7926('0x44')](this[_0x7926('0x19')][_0x4896e4]['variables'])){this['actions'][_0x4896e4][_0x7926('0x127')]={};}this[_0x7926('0x19')][_0x4896e4][_0x7926('0x127')][_0x13a911]=_0x3d5449;}};Preview[_0x7926('0x12')][_0x7926('0x22')]=function(_0x1970bc){try{if(!_[_0x7926('0x44')](_0x1970bc)){if(ut[_0x7926('0x136')](_[_0x7926('0x137')](_0x1970bc[_0x7926('0x138')])[0x0])){this['addVariable'](_0x1970bc[_0x7926('0x91')],_[_0x7926('0x137')](_0x1970bc[_0x7926('0x138')])[0x0],_0x1970bc['value']);}}}catch(_0x5e0d7a){logger['error'](_0x7926('0x139'),util[_0x7926('0x13a')](_0x5e0d7a,{'showHidden':![],'depth':null}));}};Preview[_0x7926('0x12')]['syncAttendedTransfer']=function(_0x400a32){if(_0x400a32){if(this['actions'][_0x400a32['transfertargetlinkedid']]){this[_0x7926('0x19')][_0x400a32['transfertargetlinkedid']]['transfer']=!![];}}};Preview[_0x7926('0x12')][_0x7926('0x26')]=function(_0x20ef9d){if(_0x20ef9d){if(this[_0x7926('0x19')][_0x20ef9d[_0x7926('0x13b')]]){this[_0x7926('0x19')][_0x20ef9d['transfererlinkedid']][_0x7926('0x133')]=!![];}}};module[_0x7926('0x13c')]=Preview;
\ No newline at end of file