Built motion from commit (unavailable).|2.5.1
[motion2.git] / server / services / ami / report / voiceCallReport.js
index e692a62..f2e2ce3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x02ff=['[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','parse','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','answertime','billableseconds','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','event','BlindTransfer','outbound','blindTransfers','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][hangup]','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','transfererchannel','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','mohstarttime','[%s][voiceCallReport][musiconholdstart]','syncMusicOnHoldStop','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','exports','bluebird','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','../model/channel','unknown','invalid','ringing','ringinuse','onhold','set','queue','dial','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','defaults','redis','localhost','socket.io-emitter','channels','agents','coreshowchannel','syncNewExten','newexten','newchannel','syncNewChannel','newstate','syncNewState','bind','syncVarSet','syncHangup','newcallerid','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','info','actionCoreShowChannels','error','[voiceCallReport][coreshowchannels]','prototype','isNotNull','isUndefined','emit','syncNewCallerId','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','debug','inspect','linkedid','merge','pick','keys','[%s][voiceCallReport][newcallerid]','[%s][voiceCallReport][newchannel]\x20event:','channel','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','context','exten','starttime','format','channelstate','from-sip','destconnectedlinenum','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','split','accountcode','user:%s','name','user:agentconnect','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','appdata','applicationdata','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','subtract','seconds','YYYY-MM-DD\x20HH:mm:ss','includes','lastapplication','cdr(','match','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','calleridnum','[%s][voiceCallReport][newstate]\x20event:','answered','holdtime','diff','connectedlinename','destinationchannel','toNumber','UserId','membername','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','.wav49','replace','.WAV','find','monitors','isNil','rec','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','xmd-callerid','callerid','xmd-cdrtype','type','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum'];(function(_0x280d29,_0x4d12b8){var _0x14464a=function(_0x2eea47){while(--_0x2eea47){_0x280d29['push'](_0x280d29['shift']());}};_0x14464a(++_0x4d12b8);}(_0x02ff,0xef));var _0xf02f=function(_0x1752a7,_0x1f3f3e){_0x1752a7=_0x1752a7-0x0;var _0x5086a4=_0x02ff[_0x1752a7];return _0x5086a4;};'use strict';var BPromise=require(_0xf02f('0x0'));var _=require(_0xf02f('0x1'));var moment=require(_0xf02f('0x2'));var util=require(_0xf02f('0x3'));var path=require('path');var Redis=require(_0xf02f('0x4'));var config=require(_0xf02f('0x5'));var logger=require(_0xf02f('0x6'))('ami');var ami=require('../ami');var Channel=require(_0xf02f('0x7'));var statusDesc=[_0xf02f('0x8'),'not_inuse','inuse','busy',_0xf02f('0x9'),'unavailable',_0xf02f('0xa'),_0xf02f('0xb'),_0xf02f('0xc')];var applications=[_0xf02f('0xd'),_0xf02f('0xe'),'agi',_0xf02f('0xf'),_0xf02f('0x10'),_0xf02f('0x11')];var dispositions=[_0xf02f('0x12'),_0xf02f('0x13'),_0xf02f('0x13'),'NO\x20ANSWER',_0xf02f('0x12'),_0xf02f('0x12'),_0xf02f('0x14'),_0xf02f('0x15'),_0xf02f('0x13'),_0xf02f('0x13'),_0xf02f('0x13')];var actions={};config['redis']=_[_0xf02f('0x16')](config[_0xf02f('0x17')],{'host':_0xf02f('0x18'),'port':0x18eb});var io=require(_0xf02f('0x19'))(new Redis(config[_0xf02f('0x17')]));function VoiceCallReport(_0x7c4698){this[_0xf02f('0x1a')]=_0x7c4698[_0xf02f('0x1a')];this['agents']=_0x7c4698[_0xf02f('0x1b')];this['blindTransfers']={};ami['on'](_0xf02f('0x1c'),this[_0xf02f('0x1d')]['bind'](this));ami['on'](_0xf02f('0x1e'),this['syncNewExten']['bind'](this));ami['on'](_0xf02f('0x1f'),this[_0xf02f('0x20')]['bind'](this));ami['on'](_0xf02f('0x21'),this[_0xf02f('0x22')][_0xf02f('0x23')](this));ami['on']('varset',this[_0xf02f('0x24')]['bind'](this));ami['on']('hangup',this[_0xf02f('0x25')][_0xf02f('0x23')](this));ami['on'](_0xf02f('0x26'),this['syncNewCallerId'][_0xf02f('0x23')](this));ami['on'](_0xf02f('0x27'),this[_0xf02f('0x28')][_0xf02f('0x23')](this));ami['on'](_0xf02f('0x29'),this[_0xf02f('0x2a')][_0xf02f('0x23')](this));ami['on'](_0xf02f('0x2b'),this[_0xf02f('0x2c')][_0xf02f('0x23')](this));ami['on'](_0xf02f('0x2d'),this['syncMusicOnHoldStop'][_0xf02f('0x23')](this));try{logger[_0xf02f('0x2e')]('[voiceCallReport][coreshowchannels]\x20started');ami[_0xf02f('0x2f')]();}catch(_0xcf4265){logger[_0xf02f('0x30')](_0xf02f('0x31'),util['inspect'](_0xcf4265,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0xf02f('0x32')][_0xf02f('0x33')]=function(_0x4863f9){return _0x4863f9!==null&&!_[_0xf02f('0x34')](_0x4863f9);};VoiceCallReport[_0xf02f('0x32')]['emit']=function(_0x491e32,_0x199af3,_0xe69f66){io['to'](_0x491e32)[_0xf02f('0x35')](_0x199af3,_0xe69f66);};VoiceCallReport[_0xf02f('0x32')][_0xf02f('0x36')]=function(_0x4d369b){try{if(this['isNotNull'](_0x4d369b)){logger[_0xf02f('0x2e')](_0xf02f('0x37'),_0x4d369b[_0xf02f('0x38')],_0x4d369b[_0xf02f('0x39')],_0x4d369b['calleridnum']);logger[_0xf02f('0x3a')]('[%s][voiceCallReport][newcallerid]\x20event:',_0x4d369b[_0xf02f('0x38')],util[_0xf02f('0x3b')](_0x4d369b,{'showHidden':![],'depth':null}));if(_0x4d369b[_0xf02f('0x38')]===_0x4d369b[_0xf02f('0x3c')]){if(!_[_0xf02f('0x34')](this[_0xf02f('0x1a')][_0x4d369b[_0xf02f('0x38')]])){_[_0xf02f('0x3d')](this[_0xf02f('0x1a')][_0x4d369b[_0xf02f('0x38')]],_[_0xf02f('0x3e')](_0x4d369b,_[_0xf02f('0x3f')](this['channels'][_0x4d369b[_0xf02f('0x38')]])));}}}}catch(_0x57cf6e){logger[_0xf02f('0x30')](_0xf02f('0x40'),_0x4d369b['uniqueid'],util[_0xf02f('0x3b')](_0x57cf6e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf02f('0x32')][_0xf02f('0x20')]=function(_0x23b1d2){try{if(this[_0xf02f('0x33')](_0x23b1d2)){logger['debug'](_0xf02f('0x41'),_0x23b1d2[_0xf02f('0x38')],util[_0xf02f('0x3b')](_0x23b1d2,{'showHidden':![],'depth':null}));if(_0x23b1d2['uniqueid']===_0x23b1d2['linkedid']&&_0x23b1d2[_0xf02f('0x42')]!=_0xf02f('0x43')){if(_[_0xf02f('0x34')](this['channels'][_0x23b1d2[_0xf02f('0x38')]])){logger['info'](_0xf02f('0x44'),_0x23b1d2[_0xf02f('0x38')],_0x23b1d2[_0xf02f('0x45')],_0x23b1d2[_0xf02f('0x46')]);this['channels'][_0x23b1d2[_0xf02f('0x38')]]=new Channel();this[_0xf02f('0x1a')][_0x23b1d2[_0xf02f('0x38')]][_0xf02f('0x47')]=moment()[_0xf02f('0x48')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xf02f('0x1a')][_0x23b1d2['uniqueid']]['disposition']=dispositions[_['toNumber'](_0x23b1d2[_0xf02f('0x49')])];_[_0xf02f('0x3d')](this[_0xf02f('0x1a')][_0x23b1d2[_0xf02f('0x38')]],_[_0xf02f('0x3e')](_0x23b1d2,_[_0xf02f('0x3f')](this[_0xf02f('0x1a')][_0x23b1d2['uniqueid']])));if(_0x23b1d2[_0xf02f('0x45')]===_0xf02f('0x4a')){if(this[_0xf02f('0x1b')][_0x23b1d2[_0xf02f('0x42')]['split']('-')[0x0]]){this['agents'][_0x23b1d2[_0xf02f('0x42')]['split']('-')[0x0]][_0xf02f('0x4b')]=_0x23b1d2[_0xf02f('0x46')];logger['debug'](_0xf02f('0x4c'),_0x23b1d2['uniqueid'],util[_0xf02f('0x3b')]({'destaccountcode':this['agents'][_0x23b1d2[_0xf02f('0x42')][_0xf02f('0x4d')]('-')[0x0]][_0xf02f('0x4e')],'destconnectedlinenum':_0x23b1d2[_0xf02f('0x46')]},{'showHidden':![],'depth':null}));this[_0xf02f('0x35')](util[_0xf02f('0x48')](_0xf02f('0x4f'),this[_0xf02f('0x1b')][_0x23b1d2[_0xf02f('0x42')][_0xf02f('0x4d')]('-')[0x0]][_0xf02f('0x50')]),_0xf02f('0x51'),{'destaccountcode':this[_0xf02f('0x1b')][_0x23b1d2[_0xf02f('0x42')][_0xf02f('0x4d')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x23b1d2[_0xf02f('0x46')]});}}}}}}catch(_0xccd127){logger['error'](_0xf02f('0x52'),_0x23b1d2[_0xf02f('0x38')],util[_0xf02f('0x3b')](_0xccd127,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf02f('0x32')][_0xf02f('0x1d')]=function(_0x138dc3){try{if(this[_0xf02f('0x33')](_0x138dc3)){logger[_0xf02f('0x3a')](_0xf02f('0x53'),_0x138dc3[_0xf02f('0x38')],util['inspect'](_0x138dc3,{'showHidden':![],'depth':null}));if(_0x138dc3[_0xf02f('0x38')]===_0x138dc3['linkedid']&&_0x138dc3[_0xf02f('0x46')]!='h'&&_0x138dc3['channel']!=_0xf02f('0x43')){_0x138dc3[_0xf02f('0x54')]=_0x138dc3['application'][_0xf02f('0x55')]();_0x138dc3['applicationdata']=(_0x138dc3[_0xf02f('0x56')]||_0x138dc3[_0xf02f('0x57')])[_0xf02f('0x55')]();logger['info'](_0xf02f('0x58'),_0x138dc3[_0xf02f('0x38')],_0x138dc3[_0xf02f('0x54')],_0x138dc3[_0xf02f('0x57')]);if(_[_0xf02f('0x34')](this[_0xf02f('0x1a')][_0x138dc3[_0xf02f('0x38')]])){this['channels'][_0x138dc3[_0xf02f('0x38')]]=new Channel();this[_0xf02f('0x1a')][_0x138dc3['uniqueid']][_0xf02f('0x47')]=_0x138dc3[_0xf02f('0x59')]?moment()[_0xf02f('0x5a')](moment[_0xf02f('0x59')](_0x138dc3['duration'])['seconds'](),_0xf02f('0x5b'))[_0xf02f('0x48')](_0xf02f('0x5c')):moment()[_0xf02f('0x48')](_0xf02f('0x5c'));this[_0xf02f('0x1a')][_0x138dc3[_0xf02f('0x38')]]['disposition']=_0xf02f('0x12');}_['merge'](this[_0xf02f('0x1a')][_0x138dc3[_0xf02f('0x38')]],_[_0xf02f('0x3e')](_0x138dc3,_[_0xf02f('0x3f')](this[_0xf02f('0x1a')][_0x138dc3['uniqueid']])));if(_[_0xf02f('0x5d')](applications,_0x138dc3[_0xf02f('0x54')])){this[_0xf02f('0x1a')][_0x138dc3[_0xf02f('0x38')]][_0xf02f('0x5e')]=_0x138dc3[_0xf02f('0x54')];this[_0xf02f('0x1a')][_0x138dc3[_0xf02f('0x38')]]['lastdata']=_0x138dc3[_0xf02f('0x57')];if(_0x138dc3[_0xf02f('0x54')]===_0xf02f('0xd')&&_['startsWith'](_0x138dc3['applicationdata'],_0xf02f('0x5f'))){var _0x37e7a2=_0x138dc3[_0xf02f('0x57')][_0xf02f('0x4d')]('=');var _0x18d8c5=_0x37e7a2[0x0][_0xf02f('0x60')](/cdr\((.*)\)/);if(_0x18d8c5){this[_0xf02f('0x1a')][_0x138dc3[_0xf02f('0x38')]][_0x18d8c5[0x1]]=_0x37e7a2[0x1];}}else if(_0x138dc3[_0xf02f('0x54')]==='queue'){this['channels'][_0x138dc3[_0xf02f('0x38')]]['queue']=_0x138dc3[_0xf02f('0x57')][_0xf02f('0x4d')](',')[0x0];}}}}}catch(_0x5107be){logger[_0xf02f('0x30')]('[%s][voiceCallReport][newexten]',_0x138dc3[_0xf02f('0x38')],util[_0xf02f('0x3b')](_0x5107be,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf02f('0x32')][_0xf02f('0x22')]=function(_0x153e43){try{if(this[_0xf02f('0x33')](_0x153e43)){logger[_0xf02f('0x2e')](_0xf02f('0x61'),_0x153e43['uniqueid'],_0x153e43[_0xf02f('0x3c')],_0x153e43[_0xf02f('0x39')],_0x153e43[_0xf02f('0x62')]);logger[_0xf02f('0x3a')](_0xf02f('0x63'),_0x153e43[_0xf02f('0x38')],util[_0xf02f('0x3b')](_0x153e43,{'showHidden':![],'depth':null}));if(_0x153e43[_0xf02f('0x38')]!==_0x153e43[_0xf02f('0x3c')]){if(this[_0xf02f('0x1a')][_0x153e43[_0xf02f('0x3c')]]){if(_0x153e43[_0xf02f('0x49')]==='6'){if(!this[_0xf02f('0x1a')][_0x153e43[_0xf02f('0x3c')]][_0xf02f('0x64')]){var _0x5a9d1a=moment();this['channels'][_0x153e43[_0xf02f('0x3c')]]['answered']=!![];this[_0xf02f('0x1a')][_0x153e43[_0xf02f('0x3c')]]['answertime']=_0x5a9d1a[_0xf02f('0x48')](_0xf02f('0x5c'));if(this[_0xf02f('0x1a')][_0x153e43[_0xf02f('0x3c')]][_0xf02f('0x47')]){this[_0xf02f('0x1a')][_0x153e43[_0xf02f('0x3c')]][_0xf02f('0x65')]=_0x5a9d1a[_0xf02f('0x66')](this[_0xf02f('0x1a')][_0x153e43[_0xf02f('0x3c')]][_0xf02f('0x47')],'seconds');}}this['channels'][_0x153e43['linkedid']][_0xf02f('0x3c')]=_0x153e43[_0xf02f('0x38')];if(_0x153e43[_0xf02f('0x62')]!=='xcally-motion-preview'){this[_0xf02f('0x1a')][_0x153e43[_0xf02f('0x3c')]]['connectedlinenum']=_0x153e43['calleridnum'];}this[_0xf02f('0x1a')][_0x153e43['linkedid']][_0xf02f('0x67')]=_0x153e43[_0xf02f('0x39')];this[_0xf02f('0x1a')][_0x153e43[_0xf02f('0x3c')]][_0xf02f('0x68')]=_0x153e43[_0xf02f('0x42')];this[_0xf02f('0x1a')][_0x153e43[_0xf02f('0x3c')]]['disposition']=dispositions[_[_0xf02f('0x69')](_0x153e43[_0xf02f('0x49')])];if(this['agents'][_0x153e43[_0xf02f('0x42')][_0xf02f('0x4d')]('-')[0x0]]){this['channels'][_0x153e43[_0xf02f('0x3c')]][_0xf02f('0x6a')]=this[_0xf02f('0x1b')][_0x153e43[_0xf02f('0x42')][_0xf02f('0x4d')]('-')[0x0]]['id'];this[_0xf02f('0x1a')][_0x153e43[_0xf02f('0x3c')]][_0xf02f('0x6b')]=this[_0xf02f('0x1b')][_0x153e43[_0xf02f('0x42')]['split']('-')[0x0]][_0xf02f('0x50')];}}}}else{if(this[_0xf02f('0x1a')][_0x153e43[_0xf02f('0x38')]]){if(_0x153e43['channelstate']==='6'){if(this[_0xf02f('0x1b')][_0x153e43[_0xf02f('0x42')][_0xf02f('0x4d')]('-')[0x0]]){this[_0xf02f('0x1a')][_0x153e43[_0xf02f('0x38')]]['UserId']=this['agents'][_0x153e43[_0xf02f('0x42')][_0xf02f('0x4d')]('-')[0x0]]['id'];this[_0xf02f('0x1a')][_0x153e43[_0xf02f('0x38')]]['membername']=this[_0xf02f('0x1b')][_0x153e43[_0xf02f('0x42')][_0xf02f('0x4d')]('-')[0x0]][_0xf02f('0x50')];}}}}}}catch(_0x38e3ee){logger[_0xf02f('0x30')](_0xf02f('0x6c'),_0x153e43[_0xf02f('0x38')],util[_0xf02f('0x3b')](_0x38e3ee,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf02f('0x32')][_0xf02f('0x6d')]=function(_0x5b3461,_0x4415fd){try{if(this[_0xf02f('0x1a')][_0x5b3461]){logger[_0xf02f('0x2e')](_0xf02f('0x6e'),_0x5b3461,_0x4415fd);this[_0xf02f('0x1a')][_0x5b3461][_0xf02f('0x6f')]=!![];if(_[_0xf02f('0x70')](_0x4415fd,_0xf02f('0x71'))){_0x4415fd=_0x4415fd[_0xf02f('0x72')]('.wav49',_0xf02f('0x73'));}this[_0xf02f('0x1a')][_0x5b3461]['monitorFilename']=_0x4415fd;var _0x3e35d6=_[_0xf02f('0x74')](this[_0xf02f('0x1a')][_0x5b3461][_0xf02f('0x75')],{'filename':_0x4415fd});if(_[_0xf02f('0x76')](_0x3e35d6)){this['channels'][_0x5b3461][_0xf02f('0x75')]['push']({'filename':_0x4415fd,'createdAt':moment()[_0xf02f('0x48')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':_0xf02f('0x77')});}}}catch(_0x354b0b){logger['error'](_0xf02f('0x78'),_0x5b3461,util[_0xf02f('0x3b')](_0x354b0b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf02f('0x32')][_0xf02f('0x24')]=function(_0x47df8d){try{if(this[_0xf02f('0x33')](_0x47df8d)){logger['debug'](_0xf02f('0x79'),_0x47df8d[_0xf02f('0x38')],util['inspect'](_0x47df8d,{'showHidden':![],'depth':null}));if(this[_0xf02f('0x1a')][_0x47df8d[_0xf02f('0x38')]]&&_0x47df8d[_0xf02f('0x42')]!=_0xf02f('0x43')){if(this[_0xf02f('0x33')](_0x47df8d[_0xf02f('0x7a')])){if(this[_0xf02f('0x33')](_0x47df8d['variable'][_0xf02f('0x7b')])){logger['info'](_0xf02f('0x7c'),_0x47df8d['uniqueid'],_0x47df8d[_0xf02f('0x7d')]);this['syncMixMonitorFilename'](_0x47df8d[_0xf02f('0x38')],_0x47df8d[_0xf02f('0x7d')]);}else if(this[_0xf02f('0x33')](_0x47df8d[_0xf02f('0x7a')]['xmd-phone'])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s',_0x47df8d[_0xf02f('0x38')],_0x47df8d[_0xf02f('0x7d')]);this[_0xf02f('0x1a')][_0x47df8d['uniqueid']][_0xf02f('0x62')]=_0x47df8d[_0xf02f('0x7d')];}else if(this[_0xf02f('0x33')](_0x47df8d[_0xf02f('0x7a')][_0xf02f('0x7e')])){logger[_0xf02f('0x2e')]('[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s',_0x47df8d[_0xf02f('0x38')],_0x47df8d[_0xf02f('0x7d')]);this['channels'][_0x47df8d[_0xf02f('0x38')]][_0xf02f('0x7f')]=_0x47df8d[_0xf02f('0x7d')];}else if(this[_0xf02f('0x33')](_0x47df8d[_0xf02f('0x7a')][_0xf02f('0x80')])){logger[_0xf02f('0x2e')]('[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x47df8d[_0xf02f('0x38')],_0x47df8d[_0xf02f('0x7d')]);this['channels'][_0x47df8d[_0xf02f('0x38')]][_0xf02f('0x81')]=_0x47df8d[_0xf02f('0x7d')];}else if(this['isNotNull'](_0x47df8d[_0xf02f('0x7a')][_0xf02f('0x82')])){logger[_0xf02f('0x2e')](_0xf02f('0x83'),_0x47df8d[_0xf02f('0x38')],_0x47df8d[_0xf02f('0x7d')][_0xf02f('0x4d')](',')[0x0]);this[_0xf02f('0x1a')][_0x47df8d[_0xf02f('0x38')]][_0xf02f('0xe')]=_0x47df8d[_0xf02f('0x7d')][_0xf02f('0x4d')](',')[0x0];}else if(this[_0xf02f('0x33')](_0x47df8d[_0xf02f('0x7a')][_0xf02f('0x84')])){logger[_0xf02f('0x2e')](_0xf02f('0x85'),_0x47df8d['uniqueid'],_0x47df8d['value']);this[_0xf02f('0x1a')][_0x47df8d[_0xf02f('0x38')]][_0xf02f('0x86')]=_0x47df8d[_0xf02f('0x7d')];}else if(this[_0xf02f('0x33')](_0x47df8d[_0xf02f('0x7a')][_0xf02f('0x87')])){logger[_0xf02f('0x2e')](_0xf02f('0x88'),_0x47df8d['uniqueid'],_0x47df8d[_0xf02f('0x7d')]);this[_0xf02f('0x1a')][_0x47df8d[_0xf02f('0x38')]][_0xf02f('0x89')]=_0x47df8d[_0xf02f('0x7d')];}else if(this[_0xf02f('0x33')](_0x47df8d[_0xf02f('0x7a')][_0xf02f('0x8a')])){logger[_0xf02f('0x2e')](_0xf02f('0x8b'),_0x47df8d[_0xf02f('0x38')],_0x47df8d[_0xf02f('0x7d')]);this['channels'][_0x47df8d[_0xf02f('0x38')]][_0xf02f('0x8c')]=_0x47df8d[_0xf02f('0x7d')];}else if(this['isNotNull'](_0x47df8d[_0xf02f('0x7a')][_0xf02f('0x8d')])){logger[_0xf02f('0x2e')](_0xf02f('0x8e'),_0x47df8d[_0xf02f('0x38')],_0x47df8d[_0xf02f('0x7d')]);this[_0xf02f('0x1a')][_0x47df8d[_0xf02f('0x38')]][_0xf02f('0xe')]=_0x47df8d[_0xf02f('0x7d')];}else if(this[_0xf02f('0x33')](_0x47df8d[_0xf02f('0x7a')][_0xf02f('0x8f')])){logger['info'](_0xf02f('0x90'),_0x47df8d[_0xf02f('0x38')],_0x47df8d[_0xf02f('0x7d')]);this['channels'][_0x47df8d['uniqueid']][_0xf02f('0x91')]=_0x47df8d[_0xf02f('0x7d')];}}}else if(this['isNotNull'](_0x47df8d[_0xf02f('0x7a')][_0xf02f('0x7b')])){if(_0x47df8d[_0xf02f('0x7d')]){var _0x36d4df=path[_0xf02f('0x92')](_0x47df8d[_0xf02f('0x7d')])[_0xf02f('0x50')];logger[_0xf02f('0x2e')](_0xf02f('0x7c'),_0x36d4df,_0x47df8d['value']);this[_0xf02f('0x6d')](_0x36d4df,_0x47df8d[_0xf02f('0x7d')]);}}else if(this['channels'][_0x47df8d['linkedid']]){if(this['isNotNull'](_0x47df8d['variable'])){if(this[_0xf02f('0x33')](_0x47df8d[_0xf02f('0x7a')][_0xf02f('0x8f')])){logger[_0xf02f('0x2e')](_0xf02f('0x90'),_0x47df8d['linkedid'],_0x47df8d[_0xf02f('0x7d')]);this['channels'][_0x47df8d[_0xf02f('0x3c')]][_0xf02f('0x93')]=_0x47df8d[_0xf02f('0x7d')];}}}}}catch(_0x1ad814){logger[_0xf02f('0x30')](_0xf02f('0x94'),_0x47df8d[_0xf02f('0x38')],util[_0xf02f('0x3b')](_0x1ad814,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf02f('0x32')][_0xf02f('0x25')]=function(_0x504f1b){try{if(this['isNotNull'](_0x504f1b)){logger[_0xf02f('0x3a')](_0xf02f('0x95'),_0x504f1b[_0xf02f('0x38')],util['inspect'](_0x504f1b,{'showHidden':![],'depth':null}));if(this[_0xf02f('0x1a')][_0x504f1b[_0xf02f('0x38')]]){logger['info'](_0xf02f('0x96'),_0x504f1b['uniqueid'],_0x504f1b['cause-txt']);var _0x18a2e2=moment();this[_0xf02f('0x1a')][_0x504f1b[_0xf02f('0x38')]]['endtime']=_0x18a2e2[_0xf02f('0x48')](_0xf02f('0x5c'));this[_0xf02f('0x1a')][_0x504f1b['uniqueid']]['duration']=_0x18a2e2[_0xf02f('0x66')](this[_0xf02f('0x1a')][_0x504f1b[_0xf02f('0x38')]][_0xf02f('0x47')],_0xf02f('0x5b'));if(this['channels'][_0x504f1b[_0xf02f('0x38')]]['answered']){this[_0xf02f('0x1a')][_0x504f1b['uniqueid']]['billableseconds']=_0x18a2e2['diff'](this['channels'][_0x504f1b[_0xf02f('0x38')]][_0xf02f('0x97')],'seconds');this[_0xf02f('0x1a')][_0x504f1b['uniqueid']][_0xf02f('0x65')]=this[_0xf02f('0x1a')][_0x504f1b[_0xf02f('0x38')]][_0xf02f('0x59')]-this[_0xf02f('0x1a')][_0x504f1b['uniqueid']][_0xf02f('0x98')];}if(_0x504f1b[_0xf02f('0x45')]===_0xf02f('0x4a')){if(this['agents'][_0x504f1b['channel'][_0xf02f('0x4d')]('-')[0x0]]){this[_0xf02f('0x1b')][_0x504f1b[_0xf02f('0x42')][_0xf02f('0x4d')]('-')[0x0]]=_['omit'](this[_0xf02f('0x1b')][_0x504f1b[_0xf02f('0x42')]['split']('-')[0x0]],['destconnectedlinenum']);logger[_0xf02f('0x3a')](_0xf02f('0x99'),_0x504f1b[_0xf02f('0x38')],util[_0xf02f('0x3b')]({'destaccountcode':this[_0xf02f('0x1b')][_0x504f1b['channel'][_0xf02f('0x4d')]('-')[0x0]][_0xf02f('0x4e')]},{'showHidden':![],'depth':null}));this[_0xf02f('0x35')](util[_0xf02f('0x48')](_0xf02f('0x4f'),this['agents'][_0x504f1b['channel'][_0xf02f('0x4d')]('-')[0x0]][_0xf02f('0x50')]),_0xf02f('0x9a'),{'destaccountcode':this['agents'][_0x504f1b[_0xf02f('0x42')][_0xf02f('0x4d')]('-')[0x0]][_0xf02f('0x4e')]});}}if(_0x504f1b[_0xf02f('0x9b')]===_0xf02f('0x9c')){this['blindTransfers'][_0x504f1b[_0xf02f('0x38')]]=this[_0xf02f('0x1a')][_0x504f1b[_0xf02f('0x38')]];}else{if(this[_0xf02f('0x1a')][_0x504f1b[_0xf02f('0x38')]][_0xf02f('0x81')]===_0xf02f('0x9d')&&this[_0xf02f('0x9e')][_0x504f1b['uniqueid']]){this['channels'][_0x504f1b[_0xf02f('0x38')]][_0xf02f('0x38')]=[this[_0xf02f('0x1a')][_0x504f1b[_0xf02f('0x38')]]['linkedid'],this[_0xf02f('0x1a')][_0x504f1b[_0xf02f('0x38')]][_0xf02f('0x3c')]=this[_0xf02f('0x1a')][_0x504f1b['uniqueid']][_0xf02f('0x38')]][0x0];delete this[_0xf02f('0x9e')][_0x504f1b[_0xf02f('0x38')]];}}logger[_0xf02f('0x3a')](_0xf02f('0x9f'),_0x504f1b[_0xf02f('0x38')],util['inspect'](this[_0xf02f('0x1a')][_0x504f1b[_0xf02f('0x38')]],{'showHidden':![],'depth':null}));ami[_0xf02f('0x35')](_0xf02f('0xa0'),this[_0xf02f('0x1a')][_0x504f1b[_0xf02f('0x38')]]);delete this[_0xf02f('0x1a')][_0x504f1b[_0xf02f('0x38')]];}}}catch(_0x528189){logger[_0xf02f('0x30')](_0xf02f('0xa1'),_0x504f1b[_0xf02f('0x38')],util[_0xf02f('0x3b')](_0x528189,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf02f('0x32')]['syncAttendedTransfer']=function(_0x331566){try{if(this[_0xf02f('0x33')](_0x331566)){logger[_0xf02f('0x2e')](_0xf02f('0xa2'),_0x331566[_0xf02f('0x38')],_0x331566['origtransferercalleridnum'],_0x331566[_0xf02f('0xa3')]);logger['debug'](_0xf02f('0xa4'),_0x331566['uniqueid'],util[_0xf02f('0x3b')](_0x331566,{'showHidden':![],'depth':null}));if(this[_0xf02f('0x1a')][_0x331566[_0xf02f('0xa5')]]){this[_0xf02f('0x1a')][_0x331566[_0xf02f('0xa5')]][_0xf02f('0xa6')]=_0x331566[_0xf02f('0xa7')];this['channels'][_0x331566['transfereeuniqueid']][_0xf02f('0xa8')]=_0x331566[_0xf02f('0xa3')];if(this['channels'][_0x331566[_0xf02f('0xa9')]]){var _0x31f69a=this[_0xf02f('0x1a')][_0x331566[_0xf02f('0xa9')]];this[_0xf02f('0x1a')][_0x331566['secondtransfereruniqueid']]=this['channels'][_0x331566[_0xf02f('0xa5')]];this[_0xf02f('0x1a')][_0x331566['transfereeuniqueid']]=_0x31f69a;}}else if(this[_0xf02f('0x1a')][_0x331566[_0xf02f('0xaa')]]){this[_0xf02f('0x1a')][_0x331566[_0xf02f('0xaa')]][_0xf02f('0xa6')]=_0x331566[_0xf02f('0xa7')];this[_0xf02f('0x1a')][_0x331566['transfertargetuniqueid']]['transferconnectedlinenum']=_0x331566['transfertargetcalleridnum'];if(this[_0xf02f('0x1a')][_0x331566[_0xf02f('0xab')]]){var _0x31f69a=this[_0xf02f('0x1a')][_0x331566[_0xf02f('0xab')]];this[_0xf02f('0x1a')][_0x331566[_0xf02f('0xab')]]=this[_0xf02f('0x1a')][_0x331566[_0xf02f('0xaa')]];this[_0xf02f('0x1a')][_0x331566[_0xf02f('0xaa')]]=_0x31f69a;}}}}catch(_0x1fdb8f){logger[_0xf02f('0x30')]('[%s][voiceCallReport][attendedtransfer]',_0x331566[_0xf02f('0x38')],util['inspect'](_0x1fdb8f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf02f('0x32')][_0xf02f('0x2a')]=function(_0x32da11){try{if(this[_0xf02f('0x33')](_0x32da11)){logger[_0xf02f('0x2e')]('[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s',_0x32da11[_0xf02f('0x38')],_0x32da11[_0xf02f('0xac')],_0x32da11[_0xf02f('0xad')]);logger['debug'](_0xf02f('0xae'),_0x32da11[_0xf02f('0x38')],util['inspect'](_0x32da11,{'showHidden':![],'depth':null}));if(this[_0xf02f('0x1a')][_0x32da11['transfereeuniqueid']]){this[_0xf02f('0x1a')][_0x32da11['transfereeuniqueid']]['transfercalleridnum']=_0x32da11[_0xf02f('0xac')];this[_0xf02f('0x1a')][_0x32da11[_0xf02f('0xa5')]][_0xf02f('0xa8')]=_0x32da11['extension'];this[_0xf02f('0x25')]({'event':_0xf02f('0x9c'),'uniqueid':_0x32da11[_0xf02f('0xa5')],'context':_0x32da11[_0xf02f('0x45')],'channel':_0x32da11[_0xf02f('0xaf')]});}}}catch(_0x133405){logger[_0xf02f('0x30')](_0xf02f('0xb0'),_0x32da11[_0xf02f('0x38')],util[_0xf02f('0x3b')](_0x133405,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf02f('0x32')][_0xf02f('0x2c')]=function(_0x39a82f){try{if(this[_0xf02f('0x33')](_0x39a82f)){logger[_0xf02f('0x3a')](_0xf02f('0xb1'),_0x39a82f[_0xf02f('0x38')],util[_0xf02f('0x3b')](_0x39a82f,{'showHidden':![],'depth':null}));if(this['channels'][_0x39a82f[_0xf02f('0x38')]]){if(!_[_0xf02f('0x76')](this[_0xf02f('0x1a')][_0x39a82f[_0xf02f('0x38')]][_0xf02f('0x97')])){this[_0xf02f('0x1a')][_0x39a82f['uniqueid']]['mohstarttime']=moment()[_0xf02f('0x48')](_0xf02f('0x5c'));logger[_0xf02f('0x2e')](_0xf02f('0xb2'),_0x39a82f[_0xf02f('0x38')],this[_0xf02f('0x1a')][_0x39a82f[_0xf02f('0x38')]][_0xf02f('0xb3')]);}}}}catch(_0x314aa8){logger[_0xf02f('0x30')](_0xf02f('0xb4'),_0x39a82f['uniqueid'],util['inspect'](_0x314aa8,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf02f('0x32')][_0xf02f('0xb5')]=function(_0x56fdaf){try{if(this['isNotNull'](_0x56fdaf)){logger[_0xf02f('0x3a')](_0xf02f('0xb6'),_0x56fdaf[_0xf02f('0x38')],util[_0xf02f('0x3b')](_0x56fdaf,{'showHidden':![],'depth':null}));if(this[_0xf02f('0x1a')][_0x56fdaf['uniqueid']]){if(!_['isNil'](this['channels'][_0x56fdaf[_0xf02f('0x38')]][_0xf02f('0xb3')])){this[_0xf02f('0x1a')][_0x56fdaf[_0xf02f('0x38')]][_0xf02f('0xb7')]+=moment()[_0xf02f('0xb8')](0x0)[_0xf02f('0x66')](this[_0xf02f('0x1a')][_0x56fdaf['uniqueid']][_0xf02f('0xb3')],_0xf02f('0x5b'));logger[_0xf02f('0x2e')]('[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s',_0x56fdaf['uniqueid'],this[_0xf02f('0x1a')][_0x56fdaf[_0xf02f('0x38')]][_0xf02f('0xb7')]);delete this[_0xf02f('0x1a')][_0x56fdaf[_0xf02f('0x38')]][_0xf02f('0xb3')];}}}}catch(_0x4b96cf){logger['error']('[%s][voiceCallReport][musiconholdstop]',_0x56fdaf['uniqueid'],util[_0xf02f('0x3b')](_0x4b96cf,{'showHidden':![],'depth':null}));}};module[_0xf02f('0xb9')]=VoiceCallReport;
\ No newline at end of file
+var _0xc9c1=['calleridpreview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','parse','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','sipcalllinkedid','[%s][voiceCallReport][varset]','syncHangup','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','billableseconds','holdtime','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','event','BlindTransfer','blindTransfers','type','outbound','custom:voiceCallReport','[%s][voiceCallReport][hangup]','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','transfertargetcalleridnum','transfereeuniqueid','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','transfercalleridnum','origtransfereruniqueid','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','transfererchannel','[%s][voiceCallReport][blindtransfer]','syncMusicOnHoldStart','[%s][voiceCallReport][musiconholdstart]\x20event:','isNil','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','[%s][voiceCallReport][musiconholdstop]','exports','util','path','ioredis','../../../config/environment','../../../config/logger','ami','../model/channel','not_inuse','inuse','busy','ringinuse','onhold','set','queue','agi','dial','FAILED','NO\x20ANSWER','ANSWERED','BUSY','redis','defaults','localhost','socket.io-emitter','channels','agents','coreshowchannel','bind','newexten','syncNewExten','syncNewChannel','syncNewState','varset','syncVarSet','hangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','syncMusicOnHoldStop','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','[voiceCallReport][coreshowchannels]','inspect','prototype','isNotNull','isUndefined','emit','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','calleridname','calleridnum','debug','uniqueid','merge','pick','keys','error','[%s][voiceCallReport][newcallerid]','[%s][voiceCallReport][newchannel]\x20event:','channel','OutgoingSpoolFailed','info','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','context','exten','format','YYYY-MM-DD\x20HH:mm:ss','disposition','from-sip','split','destconnectedlinenum','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','accountcode','user:%s','name','user:agentconnect','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','duration','subtract','seconds','startsWith','applicationdata','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','linkedid','answered','answertime','starttime','diff','xcally-motion-preview','connectedlinename','toNumber','channelstate','UserId','membername','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','.wav49','.WAV','monitorFilename','find','monitors','push','rec','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','value','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s'];(function(_0x166313,_0x426cb7){var _0x5129e5=function(_0x16781e){while(--_0x16781e){_0x166313['push'](_0x166313['shift']());}};_0x5129e5(++_0x426cb7);}(_0xc9c1,0x1a9));var _0x1c9c=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xc9c1[_0x3635ce];return _0x97ecd0;};'use strict';var BPromise=require('bluebird');var _=require('lodash');var moment=require('moment');var util=require(_0x1c9c('0x0'));var path=require(_0x1c9c('0x1'));var Redis=require(_0x1c9c('0x2'));var config=require(_0x1c9c('0x3'));var logger=require(_0x1c9c('0x4'))(_0x1c9c('0x5'));var ami=require('../ami');var Channel=require(_0x1c9c('0x6'));var statusDesc=['unknown',_0x1c9c('0x7'),_0x1c9c('0x8'),_0x1c9c('0x9'),'invalid','unavailable','ringing',_0x1c9c('0xa'),_0x1c9c('0xb')];var applications=[_0x1c9c('0xc'),_0x1c9c('0xd'),_0x1c9c('0xe'),_0x1c9c('0xf'),'playback','voicemail'];var dispositions=['NO\x20ANSWER',_0x1c9c('0x10'),_0x1c9c('0x10'),_0x1c9c('0x11'),_0x1c9c('0x11'),_0x1c9c('0x11'),_0x1c9c('0x12'),_0x1c9c('0x13'),_0x1c9c('0x10'),_0x1c9c('0x10'),'FAILED'];var actions={};config[_0x1c9c('0x14')]=_[_0x1c9c('0x15')](config['redis'],{'host':_0x1c9c('0x16'),'port':0x18eb});var io=require(_0x1c9c('0x17'))(new Redis(config[_0x1c9c('0x14')]));function VoiceCallReport(_0x8e8aab){this[_0x1c9c('0x18')]=_0x8e8aab[_0x1c9c('0x18')];this[_0x1c9c('0x19')]=_0x8e8aab[_0x1c9c('0x19')];this['blindTransfers']={};ami['on'](_0x1c9c('0x1a'),this['syncNewExten'][_0x1c9c('0x1b')](this));ami['on'](_0x1c9c('0x1c'),this[_0x1c9c('0x1d')]['bind'](this));ami['on']('newchannel',this[_0x1c9c('0x1e')][_0x1c9c('0x1b')](this));ami['on']('newstate',this[_0x1c9c('0x1f')][_0x1c9c('0x1b')](this));ami['on'](_0x1c9c('0x20'),this[_0x1c9c('0x21')][_0x1c9c('0x1b')](this));ami['on'](_0x1c9c('0x22'),this['syncHangup'][_0x1c9c('0x1b')](this));ami['on'](_0x1c9c('0x23'),this[_0x1c9c('0x24')][_0x1c9c('0x1b')](this));ami['on'](_0x1c9c('0x25'),this[_0x1c9c('0x26')][_0x1c9c('0x1b')](this));ami['on'](_0x1c9c('0x27'),this[_0x1c9c('0x28')][_0x1c9c('0x1b')](this));ami['on']('musiconholdstart',this['syncMusicOnHoldStart'][_0x1c9c('0x1b')](this));ami['on']('musiconholdstop',this[_0x1c9c('0x29')]['bind'](this));try{logger['info'](_0x1c9c('0x2a'));ami[_0x1c9c('0x2b')]();}catch(_0x5f2fa9){logger['error'](_0x1c9c('0x2c'),util[_0x1c9c('0x2d')](_0x5f2fa9,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x1c9c('0x2e')][_0x1c9c('0x2f')]=function(_0x1a9be1){return _0x1a9be1!==null&&!_[_0x1c9c('0x30')](_0x1a9be1);};VoiceCallReport[_0x1c9c('0x2e')][_0x1c9c('0x31')]=function(_0x1be26c,_0x17377f,_0x358f47){io['to'](_0x1be26c)[_0x1c9c('0x31')](_0x17377f,_0x358f47);};VoiceCallReport[_0x1c9c('0x2e')][_0x1c9c('0x24')]=function(_0x863e1d){try{if(this[_0x1c9c('0x2f')](_0x863e1d)){logger['info'](_0x1c9c('0x32'),_0x863e1d['uniqueid'],_0x863e1d[_0x1c9c('0x33')],_0x863e1d[_0x1c9c('0x34')]);logger[_0x1c9c('0x35')]('[%s][voiceCallReport][newcallerid]\x20event:',_0x863e1d[_0x1c9c('0x36')],util['inspect'](_0x863e1d,{'showHidden':![],'depth':null}));if(_0x863e1d[_0x1c9c('0x36')]===_0x863e1d['linkedid']){if(!_[_0x1c9c('0x30')](this[_0x1c9c('0x18')][_0x863e1d[_0x1c9c('0x36')]])){_[_0x1c9c('0x37')](this[_0x1c9c('0x18')][_0x863e1d[_0x1c9c('0x36')]],_[_0x1c9c('0x38')](_0x863e1d,_[_0x1c9c('0x39')](this['channels'][_0x863e1d[_0x1c9c('0x36')]])));}}}}catch(_0x37aebe){logger[_0x1c9c('0x3a')](_0x1c9c('0x3b'),_0x863e1d[_0x1c9c('0x36')],util[_0x1c9c('0x2d')](_0x37aebe,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1c9c('0x2e')][_0x1c9c('0x1e')]=function(_0x689b64){try{if(this[_0x1c9c('0x2f')](_0x689b64)){logger[_0x1c9c('0x35')](_0x1c9c('0x3c'),_0x689b64['uniqueid'],util[_0x1c9c('0x2d')](_0x689b64,{'showHidden':![],'depth':null}));if(_0x689b64[_0x1c9c('0x36')]===_0x689b64['linkedid']&&_0x689b64[_0x1c9c('0x3d')]!=_0x1c9c('0x3e')){if(_[_0x1c9c('0x30')](this[_0x1c9c('0x18')][_0x689b64[_0x1c9c('0x36')]])){logger[_0x1c9c('0x3f')](_0x1c9c('0x40'),_0x689b64[_0x1c9c('0x36')],_0x689b64[_0x1c9c('0x41')],_0x689b64[_0x1c9c('0x42')]);this[_0x1c9c('0x18')][_0x689b64[_0x1c9c('0x36')]]=new Channel();this[_0x1c9c('0x18')][_0x689b64[_0x1c9c('0x36')]]['starttime']=moment()[_0x1c9c('0x43')](_0x1c9c('0x44'));this['channels'][_0x689b64['uniqueid']][_0x1c9c('0x45')]=dispositions[_['toNumber'](_0x689b64['channelstate'])];_['merge'](this[_0x1c9c('0x18')][_0x689b64[_0x1c9c('0x36')]],_['pick'](_0x689b64,_[_0x1c9c('0x39')](this[_0x1c9c('0x18')][_0x689b64[_0x1c9c('0x36')]])));if(_0x689b64[_0x1c9c('0x41')]===_0x1c9c('0x46')){if(this[_0x1c9c('0x19')][_0x689b64[_0x1c9c('0x3d')][_0x1c9c('0x47')]('-')[0x0]]){this['agents'][_0x689b64[_0x1c9c('0x3d')][_0x1c9c('0x47')]('-')[0x0]][_0x1c9c('0x48')]=_0x689b64[_0x1c9c('0x42')];logger['debug'](_0x1c9c('0x49'),_0x689b64['uniqueid'],util['inspect']({'destaccountcode':this[_0x1c9c('0x19')][_0x689b64[_0x1c9c('0x3d')]['split']('-')[0x0]][_0x1c9c('0x4a')],'destconnectedlinenum':_0x689b64[_0x1c9c('0x42')]},{'showHidden':![],'depth':null}));this[_0x1c9c('0x31')](util[_0x1c9c('0x43')](_0x1c9c('0x4b'),this[_0x1c9c('0x19')][_0x689b64['channel'][_0x1c9c('0x47')]('-')[0x0]][_0x1c9c('0x4c')]),_0x1c9c('0x4d'),{'destaccountcode':this['agents'][_0x689b64['channel'][_0x1c9c('0x47')]('-')[0x0]][_0x1c9c('0x4a')],'destconnectedlinenum':_0x689b64[_0x1c9c('0x42')]});}}}}}}catch(_0x329ebe){logger[_0x1c9c('0x3a')](_0x1c9c('0x4e'),_0x689b64['uniqueid'],util['inspect'](_0x329ebe,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x1c9c('0x1d')]=function(_0xf82840){try{if(this[_0x1c9c('0x2f')](_0xf82840)){logger['debug'](_0x1c9c('0x4f'),_0xf82840[_0x1c9c('0x36')],util[_0x1c9c('0x2d')](_0xf82840,{'showHidden':![],'depth':null}));if(_0xf82840[_0x1c9c('0x36')]===_0xf82840['linkedid']&&_0xf82840[_0x1c9c('0x42')]!='h'&&_0xf82840[_0x1c9c('0x3d')]!=_0x1c9c('0x3e')){_0xf82840[_0x1c9c('0x50')]=_0xf82840[_0x1c9c('0x50')][_0x1c9c('0x51')]();_0xf82840['applicationdata']=(_0xf82840['appdata']||_0xf82840['applicationdata'])[_0x1c9c('0x51')]();logger[_0x1c9c('0x3f')]('[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s',_0xf82840[_0x1c9c('0x36')],_0xf82840['application'],_0xf82840['applicationdata']);if(_[_0x1c9c('0x30')](this[_0x1c9c('0x18')][_0xf82840[_0x1c9c('0x36')]])){this['channels'][_0xf82840[_0x1c9c('0x36')]]=new Channel();this['channels'][_0xf82840[_0x1c9c('0x36')]]['starttime']=_0xf82840[_0x1c9c('0x52')]?moment()[_0x1c9c('0x53')](moment[_0x1c9c('0x52')](_0xf82840['duration'])[_0x1c9c('0x54')](),_0x1c9c('0x54'))['format'](_0x1c9c('0x44')):moment()[_0x1c9c('0x43')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x1c9c('0x18')][_0xf82840[_0x1c9c('0x36')]][_0x1c9c('0x45')]=_0x1c9c('0x11');}_[_0x1c9c('0x37')](this['channels'][_0xf82840[_0x1c9c('0x36')]],_[_0x1c9c('0x38')](_0xf82840,_['keys'](this[_0x1c9c('0x18')][_0xf82840[_0x1c9c('0x36')]])));if(_['includes'](applications,_0xf82840['application'])){this[_0x1c9c('0x18')][_0xf82840[_0x1c9c('0x36')]]['lastapplication']=_0xf82840['application'];this[_0x1c9c('0x18')][_0xf82840[_0x1c9c('0x36')]]['lastdata']=_0xf82840['applicationdata'];if(_0xf82840[_0x1c9c('0x50')]===_0x1c9c('0xc')&&_[_0x1c9c('0x55')](_0xf82840[_0x1c9c('0x56')],'cdr(')){var _0x38c3ed=_0xf82840[_0x1c9c('0x56')][_0x1c9c('0x47')]('=');var _0x51913f=_0x38c3ed[0x0]['match'](/cdr\((.*)\)/);if(_0x51913f){this[_0x1c9c('0x18')][_0xf82840[_0x1c9c('0x36')]][_0x51913f[0x1]]=_0x38c3ed[0x1];}}else if(_0xf82840[_0x1c9c('0x50')]==='queue'){this[_0x1c9c('0x18')][_0xf82840[_0x1c9c('0x36')]][_0x1c9c('0xd')]=_0xf82840[_0x1c9c('0x56')][_0x1c9c('0x47')](',')[0x0];}}}}}catch(_0x216fcc){logger['error'](_0x1c9c('0x57'),_0xf82840[_0x1c9c('0x36')],util['inspect'](_0x216fcc,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1c9c('0x2e')][_0x1c9c('0x1f')]=function(_0x3c4e1e){try{if(this[_0x1c9c('0x2f')](_0x3c4e1e)){logger[_0x1c9c('0x3f')](_0x1c9c('0x58'),_0x3c4e1e['uniqueid'],_0x3c4e1e[_0x1c9c('0x59')],_0x3c4e1e[_0x1c9c('0x33')],_0x3c4e1e[_0x1c9c('0x34')]);logger[_0x1c9c('0x35')]('[%s][voiceCallReport][newstate]\x20event:',_0x3c4e1e[_0x1c9c('0x36')],util[_0x1c9c('0x2d')](_0x3c4e1e,{'showHidden':![],'depth':null}));if(_0x3c4e1e[_0x1c9c('0x36')]!==_0x3c4e1e['linkedid']){if(this[_0x1c9c('0x18')][_0x3c4e1e[_0x1c9c('0x59')]]){if(_0x3c4e1e['channelstate']==='6'){if(!this[_0x1c9c('0x18')][_0x3c4e1e['linkedid']][_0x1c9c('0x5a')]){var _0x5a83a3=moment();this[_0x1c9c('0x18')][_0x3c4e1e[_0x1c9c('0x59')]]['answered']=!![];this[_0x1c9c('0x18')][_0x3c4e1e['linkedid']][_0x1c9c('0x5b')]=_0x5a83a3[_0x1c9c('0x43')](_0x1c9c('0x44'));if(this[_0x1c9c('0x18')][_0x3c4e1e[_0x1c9c('0x59')]][_0x1c9c('0x5c')]){this[_0x1c9c('0x18')][_0x3c4e1e['linkedid']]['holdtime']=_0x5a83a3[_0x1c9c('0x5d')](this[_0x1c9c('0x18')][_0x3c4e1e[_0x1c9c('0x59')]][_0x1c9c('0x5c')],_0x1c9c('0x54'));}}this[_0x1c9c('0x18')][_0x3c4e1e['linkedid']][_0x1c9c('0x59')]=_0x3c4e1e[_0x1c9c('0x36')];if(_0x3c4e1e['calleridnum']!==_0x1c9c('0x5e')){this[_0x1c9c('0x18')][_0x3c4e1e[_0x1c9c('0x59')]]['connectedlinenum']=_0x3c4e1e[_0x1c9c('0x34')];}this[_0x1c9c('0x18')][_0x3c4e1e[_0x1c9c('0x59')]][_0x1c9c('0x5f')]=_0x3c4e1e['calleridname'];this['channels'][_0x3c4e1e['linkedid']]['destinationchannel']=_0x3c4e1e[_0x1c9c('0x3d')];this['channels'][_0x3c4e1e['linkedid']][_0x1c9c('0x45')]=dispositions[_[_0x1c9c('0x60')](_0x3c4e1e[_0x1c9c('0x61')])];if(this[_0x1c9c('0x19')][_0x3c4e1e[_0x1c9c('0x3d')]['split']('-')[0x0]]){this[_0x1c9c('0x18')][_0x3c4e1e['linkedid']][_0x1c9c('0x62')]=this[_0x1c9c('0x19')][_0x3c4e1e[_0x1c9c('0x3d')]['split']('-')[0x0]]['id'];this[_0x1c9c('0x18')][_0x3c4e1e[_0x1c9c('0x59')]][_0x1c9c('0x63')]=this[_0x1c9c('0x19')][_0x3c4e1e[_0x1c9c('0x3d')][_0x1c9c('0x47')]('-')[0x0]][_0x1c9c('0x4c')];}}}}else{if(this[_0x1c9c('0x18')][_0x3c4e1e[_0x1c9c('0x36')]]){if(_0x3c4e1e[_0x1c9c('0x61')]==='6'){if(this[_0x1c9c('0x19')][_0x3c4e1e[_0x1c9c('0x3d')][_0x1c9c('0x47')]('-')[0x0]]){this[_0x1c9c('0x18')][_0x3c4e1e[_0x1c9c('0x36')]]['UserId']=this[_0x1c9c('0x19')][_0x3c4e1e[_0x1c9c('0x3d')]['split']('-')[0x0]]['id'];this[_0x1c9c('0x18')][_0x3c4e1e['uniqueid']][_0x1c9c('0x63')]=this['agents'][_0x3c4e1e[_0x1c9c('0x3d')][_0x1c9c('0x47')]('-')[0x0]][_0x1c9c('0x4c')];}}}}}}catch(_0x4f6a78){logger['error'](_0x1c9c('0x64'),_0x3c4e1e[_0x1c9c('0x36')],util[_0x1c9c('0x2d')](_0x4f6a78,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1c9c('0x2e')][_0x1c9c('0x65')]=function(_0x5e1a46,_0x184ed4){try{if(this[_0x1c9c('0x18')][_0x5e1a46]){logger[_0x1c9c('0x3f')](_0x1c9c('0x66'),_0x5e1a46,_0x184ed4);this[_0x1c9c('0x18')][_0x5e1a46][_0x1c9c('0x67')]=!![];if(_[_0x1c9c('0x68')](_0x184ed4,_0x1c9c('0x69'))){_0x184ed4=_0x184ed4['replace'](_0x1c9c('0x69'),_0x1c9c('0x6a'));}this[_0x1c9c('0x18')][_0x5e1a46][_0x1c9c('0x6b')]=_0x184ed4;var _0x25e8da=_[_0x1c9c('0x6c')](this[_0x1c9c('0x18')][_0x5e1a46][_0x1c9c('0x6d')],{'filename':_0x184ed4});if(_['isNil'](_0x25e8da)){this[_0x1c9c('0x18')][_0x5e1a46]['monitors'][_0x1c9c('0x6e')]({'filename':_0x184ed4,'createdAt':moment()[_0x1c9c('0x43')](_0x1c9c('0x44')),'mixmonitorid':'','status':_0x1c9c('0x6f')});}}}catch(_0x23ce30){logger['error'](_0x1c9c('0x70'),_0x5e1a46,util[_0x1c9c('0x2d')](_0x23ce30,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1c9c('0x2e')][_0x1c9c('0x21')]=function(_0x123612){try{if(this[_0x1c9c('0x2f')](_0x123612)){logger[_0x1c9c('0x35')](_0x1c9c('0x71'),_0x123612[_0x1c9c('0x36')],util[_0x1c9c('0x2d')](_0x123612,{'showHidden':![],'depth':null}));if(this[_0x1c9c('0x18')][_0x123612[_0x1c9c('0x36')]]&&_0x123612['channel']!='OutgoingSpoolFailed'){if(this[_0x1c9c('0x2f')](_0x123612[_0x1c9c('0x72')])){if(this[_0x1c9c('0x2f')](_0x123612[_0x1c9c('0x72')][_0x1c9c('0x73')])){logger[_0x1c9c('0x3f')]('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x123612[_0x1c9c('0x36')],_0x123612['value']);this['syncMixMonitorFilename'](_0x123612[_0x1c9c('0x36')],_0x123612[_0x1c9c('0x74')]);}else if(this[_0x1c9c('0x2f')](_0x123612[_0x1c9c('0x72')][_0x1c9c('0x75')])){logger['info'](_0x1c9c('0x76'),_0x123612[_0x1c9c('0x36')],_0x123612[_0x1c9c('0x74')]);this[_0x1c9c('0x18')][_0x123612[_0x1c9c('0x36')]][_0x1c9c('0x34')]=_0x123612[_0x1c9c('0x74')];}else if(this[_0x1c9c('0x2f')](_0x123612[_0x1c9c('0x72')]['xmd-callerid'])){logger[_0x1c9c('0x3f')](_0x1c9c('0x77'),_0x123612[_0x1c9c('0x36')],_0x123612[_0x1c9c('0x74')]);this[_0x1c9c('0x18')][_0x123612[_0x1c9c('0x36')]][_0x1c9c('0x78')]=_0x123612['value'];}else if(this[_0x1c9c('0x2f')](_0x123612['variable'][_0x1c9c('0x79')])){logger['info'](_0x1c9c('0x7a'),_0x123612[_0x1c9c('0x36')],_0x123612[_0x1c9c('0x74')]);this[_0x1c9c('0x18')][_0x123612['uniqueid']]['type']=_0x123612['value'];}else if(this[_0x1c9c('0x2f')](_0x123612['variable'][_0x1c9c('0x7b')])){logger[_0x1c9c('0x3f')](_0x1c9c('0x7c'),_0x123612[_0x1c9c('0x36')],_0x123612[_0x1c9c('0x74')]['split'](',')[0x0]);this[_0x1c9c('0x18')][_0x123612[_0x1c9c('0x36')]][_0x1c9c('0xd')]=_0x123612['value'][_0x1c9c('0x47')](',')[0x0];}else if(this[_0x1c9c('0x2f')](_0x123612[_0x1c9c('0x72')][_0x1c9c('0x7d')])){logger[_0x1c9c('0x3f')](_0x1c9c('0x7e'),_0x123612[_0x1c9c('0x36')],_0x123612[_0x1c9c('0x74')]);this[_0x1c9c('0x18')][_0x123612[_0x1c9c('0x36')]][_0x1c9c('0x7f')]=_0x123612[_0x1c9c('0x74')];}else if(this[_0x1c9c('0x2f')](_0x123612['variable'][_0x1c9c('0x80')])){logger[_0x1c9c('0x3f')](_0x1c9c('0x81'),_0x123612[_0x1c9c('0x36')],_0x123612[_0x1c9c('0x74')]);this['channels'][_0x123612[_0x1c9c('0x36')]][_0x1c9c('0x82')]=_0x123612['value'];}else if(this[_0x1c9c('0x2f')](_0x123612[_0x1c9c('0x72')][_0x1c9c('0x83')])){logger[_0x1c9c('0x3f')](_0x1c9c('0x84'),_0x123612[_0x1c9c('0x36')],_0x123612['value']);this[_0x1c9c('0x18')][_0x123612[_0x1c9c('0x36')]][_0x1c9c('0x85')]=_0x123612[_0x1c9c('0x74')];}else if(this['isNotNull'](_0x123612[_0x1c9c('0x72')][_0x1c9c('0x86')])){logger[_0x1c9c('0x3f')](_0x1c9c('0x87'),_0x123612[_0x1c9c('0x36')],_0x123612[_0x1c9c('0x74')]);this[_0x1c9c('0x18')][_0x123612[_0x1c9c('0x36')]]['queue']=_0x123612['value'];}else if(this[_0x1c9c('0x2f')](_0x123612[_0x1c9c('0x72')][_0x1c9c('0x88')])){logger[_0x1c9c('0x3f')](_0x1c9c('0x89'),_0x123612['uniqueid'],_0x123612['value']);this['channels'][_0x123612[_0x1c9c('0x36')]]['sipcalluniqueid']=_0x123612['value'];}}}else if(this[_0x1c9c('0x2f')](_0x123612[_0x1c9c('0x72')][_0x1c9c('0x73')])){if(_0x123612[_0x1c9c('0x74')]){var _0x1c06cc=path[_0x1c9c('0x8a')](_0x123612[_0x1c9c('0x74')])[_0x1c9c('0x4c')];logger[_0x1c9c('0x3f')](_0x1c9c('0x8b'),_0x1c06cc,_0x123612[_0x1c9c('0x74')]);this[_0x1c9c('0x65')](_0x1c06cc,_0x123612['value']);}}else if(this['channels'][_0x123612['linkedid']]){if(this[_0x1c9c('0x2f')](_0x123612[_0x1c9c('0x72')])){if(this['isNotNull'](_0x123612[_0x1c9c('0x72')][_0x1c9c('0x88')])){logger[_0x1c9c('0x3f')](_0x1c9c('0x89'),_0x123612['linkedid'],_0x123612['value']);this['channels'][_0x123612['linkedid']][_0x1c9c('0x8c')]=_0x123612['value'];}}}}}catch(_0x343696){logger[_0x1c9c('0x3a')](_0x1c9c('0x8d'),_0x123612['uniqueid'],util[_0x1c9c('0x2d')](_0x343696,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1c9c('0x2e')][_0x1c9c('0x8e')]=function(_0x35974a){try{if(this[_0x1c9c('0x2f')](_0x35974a)){logger[_0x1c9c('0x35')](_0x1c9c('0x8f'),_0x35974a[_0x1c9c('0x36')],util[_0x1c9c('0x2d')](_0x35974a,{'showHidden':![],'depth':null}));if(this[_0x1c9c('0x18')][_0x35974a[_0x1c9c('0x36')]]){logger['info'](_0x1c9c('0x90'),_0x35974a[_0x1c9c('0x36')],_0x35974a[_0x1c9c('0x91')]);var _0x458268=moment();this[_0x1c9c('0x18')][_0x35974a[_0x1c9c('0x36')]][_0x1c9c('0x92')]=_0x458268[_0x1c9c('0x43')](_0x1c9c('0x44'));this['channels'][_0x35974a[_0x1c9c('0x36')]][_0x1c9c('0x52')]=_0x458268[_0x1c9c('0x5d')](this[_0x1c9c('0x18')][_0x35974a[_0x1c9c('0x36')]][_0x1c9c('0x5c')],'seconds');if(this[_0x1c9c('0x18')][_0x35974a[_0x1c9c('0x36')]][_0x1c9c('0x5a')]){this[_0x1c9c('0x18')][_0x35974a['uniqueid']][_0x1c9c('0x93')]=_0x458268[_0x1c9c('0x5d')](this[_0x1c9c('0x18')][_0x35974a[_0x1c9c('0x36')]][_0x1c9c('0x5b')],_0x1c9c('0x54'));this['channels'][_0x35974a[_0x1c9c('0x36')]][_0x1c9c('0x94')]=this['channels'][_0x35974a[_0x1c9c('0x36')]]['duration']-this[_0x1c9c('0x18')][_0x35974a[_0x1c9c('0x36')]]['billableseconds'];}if(_0x35974a[_0x1c9c('0x41')]===_0x1c9c('0x46')){if(this[_0x1c9c('0x19')][_0x35974a[_0x1c9c('0x3d')][_0x1c9c('0x47')]('-')[0x0]]){this['agents'][_0x35974a[_0x1c9c('0x3d')][_0x1c9c('0x47')]('-')[0x0]]=_[_0x1c9c('0x95')](this[_0x1c9c('0x19')][_0x35974a[_0x1c9c('0x3d')]['split']('-')[0x0]],[_0x1c9c('0x48')]);logger[_0x1c9c('0x35')](_0x1c9c('0x96'),_0x35974a['uniqueid'],util[_0x1c9c('0x2d')]({'destaccountcode':this['agents'][_0x35974a[_0x1c9c('0x3d')]['split']('-')[0x0]]['accountcode']},{'showHidden':![],'depth':null}));this[_0x1c9c('0x31')](util['format'](_0x1c9c('0x4b'),this['agents'][_0x35974a['channel'][_0x1c9c('0x47')]('-')[0x0]][_0x1c9c('0x4c')]),_0x1c9c('0x97'),{'destaccountcode':this[_0x1c9c('0x19')][_0x35974a[_0x1c9c('0x3d')][_0x1c9c('0x47')]('-')[0x0]][_0x1c9c('0x4a')]});}}if(_0x35974a[_0x1c9c('0x98')]===_0x1c9c('0x99')){this[_0x1c9c('0x9a')][_0x35974a[_0x1c9c('0x36')]]=this[_0x1c9c('0x18')][_0x35974a['uniqueid']];}else{if(this[_0x1c9c('0x18')][_0x35974a['uniqueid']][_0x1c9c('0x9b')]===_0x1c9c('0x9c')&&this[_0x1c9c('0x9a')][_0x35974a[_0x1c9c('0x36')]]){this[_0x1c9c('0x18')][_0x35974a[_0x1c9c('0x36')]]['uniqueid']=[this[_0x1c9c('0x18')][_0x35974a['uniqueid']][_0x1c9c('0x59')],this['channels'][_0x35974a[_0x1c9c('0x36')]]['linkedid']=this[_0x1c9c('0x18')][_0x35974a[_0x1c9c('0x36')]][_0x1c9c('0x36')]][0x0];delete this[_0x1c9c('0x9a')][_0x35974a[_0x1c9c('0x36')]];}}logger[_0x1c9c('0x35')]('[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:',_0x35974a[_0x1c9c('0x36')],util['inspect'](this[_0x1c9c('0x18')][_0x35974a['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x1c9c('0x31')](_0x1c9c('0x9d'),this['channels'][_0x35974a[_0x1c9c('0x36')]]);delete this[_0x1c9c('0x18')][_0x35974a['uniqueid']];}}}catch(_0x184522){logger[_0x1c9c('0x3a')](_0x1c9c('0x9e'),_0x35974a[_0x1c9c('0x36')],util['inspect'](_0x184522,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1c9c('0x2e')]['syncAttendedTransfer']=function(_0x17d796){try{if(this[_0x1c9c('0x2f')](_0x17d796)){logger[_0x1c9c('0x3f')](_0x1c9c('0x9f'),_0x17d796[_0x1c9c('0x36')],_0x17d796[_0x1c9c('0xa0')],_0x17d796[_0x1c9c('0xa1')]);logger[_0x1c9c('0x35')]('[%s][voiceCallReport][attendedtransfer]\x20event:',_0x17d796[_0x1c9c('0x36')],util[_0x1c9c('0x2d')](_0x17d796,{'showHidden':![],'depth':null}));if(this[_0x1c9c('0x18')][_0x17d796[_0x1c9c('0xa2')]]){this['channels'][_0x17d796['transfereeuniqueid']]['transfercalleridnum']=_0x17d796[_0x1c9c('0xa0')];this[_0x1c9c('0x18')][_0x17d796['transfereeuniqueid']][_0x1c9c('0xa3')]=_0x17d796[_0x1c9c('0xa1')];if(this[_0x1c9c('0x18')][_0x17d796['secondtransfereruniqueid']]){var _0x4b35b7=this[_0x1c9c('0x18')][_0x17d796['secondtransfereruniqueid']];this['channels'][_0x17d796[_0x1c9c('0xa4')]]=this[_0x1c9c('0x18')][_0x17d796[_0x1c9c('0xa2')]];this[_0x1c9c('0x18')][_0x17d796['transfereeuniqueid']]=_0x4b35b7;}}else if(this['channels'][_0x17d796[_0x1c9c('0xa5')]]){this[_0x1c9c('0x18')][_0x17d796['transfertargetuniqueid']][_0x1c9c('0xa6')]=_0x17d796[_0x1c9c('0xa0')];this[_0x1c9c('0x18')][_0x17d796[_0x1c9c('0xa5')]][_0x1c9c('0xa3')]=_0x17d796[_0x1c9c('0xa1')];if(this[_0x1c9c('0x18')][_0x17d796['origtransfereruniqueid']]){var _0x4b35b7=this[_0x1c9c('0x18')][_0x17d796[_0x1c9c('0xa7')]];this[_0x1c9c('0x18')][_0x17d796[_0x1c9c('0xa7')]]=this[_0x1c9c('0x18')][_0x17d796[_0x1c9c('0xa5')]];this[_0x1c9c('0x18')][_0x17d796[_0x1c9c('0xa5')]]=_0x4b35b7;}}}}catch(_0xe1dbcf){logger['error']('[%s][voiceCallReport][attendedtransfer]',_0x17d796[_0x1c9c('0x36')],util[_0x1c9c('0x2d')](_0xe1dbcf,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1c9c('0x2e')][_0x1c9c('0x28')]=function(_0x5fd120){try{if(this['isNotNull'](_0x5fd120)){logger[_0x1c9c('0x3f')](_0x1c9c('0xa8'),_0x5fd120['uniqueid'],_0x5fd120[_0x1c9c('0xa9')],_0x5fd120[_0x1c9c('0xaa')]);logger[_0x1c9c('0x35')](_0x1c9c('0xab'),_0x5fd120[_0x1c9c('0x36')],util['inspect'](_0x5fd120,{'showHidden':![],'depth':null}));if(this[_0x1c9c('0x18')][_0x5fd120[_0x1c9c('0xa2')]]){this[_0x1c9c('0x18')][_0x5fd120[_0x1c9c('0xa2')]][_0x1c9c('0xa6')]=_0x5fd120[_0x1c9c('0xa9')];this[_0x1c9c('0x18')][_0x5fd120['transfereeuniqueid']][_0x1c9c('0xa3')]=_0x5fd120[_0x1c9c('0xaa')];this['syncHangup']({'event':'BlindTransfer','uniqueid':_0x5fd120[_0x1c9c('0xa2')],'context':_0x5fd120['context'],'channel':_0x5fd120[_0x1c9c('0xac')]});}}}catch(_0x55d9fb){logger[_0x1c9c('0x3a')](_0x1c9c('0xad'),_0x5fd120['uniqueid'],util['inspect'](_0x55d9fb,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1c9c('0x2e')][_0x1c9c('0xae')]=function(_0x10ccdf){try{if(this[_0x1c9c('0x2f')](_0x10ccdf)){logger[_0x1c9c('0x35')](_0x1c9c('0xaf'),_0x10ccdf[_0x1c9c('0x36')],util['inspect'](_0x10ccdf,{'showHidden':![],'depth':null}));if(this[_0x1c9c('0x18')][_0x10ccdf[_0x1c9c('0x36')]]){if(!_[_0x1c9c('0xb0')](this[_0x1c9c('0x18')][_0x10ccdf['uniqueid']][_0x1c9c('0x5b')])){this[_0x1c9c('0x18')][_0x10ccdf[_0x1c9c('0x36')]][_0x1c9c('0xb1')]=moment()[_0x1c9c('0x43')](_0x1c9c('0x44'));logger[_0x1c9c('0x3f')](_0x1c9c('0xb2'),_0x10ccdf[_0x1c9c('0x36')],this[_0x1c9c('0x18')][_0x10ccdf['uniqueid']][_0x1c9c('0xb1')]);}}}}catch(_0x9ff79a){logger['error'](_0x1c9c('0xb3'),_0x10ccdf[_0x1c9c('0x36')],util['inspect'](_0x9ff79a,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1c9c('0x2e')][_0x1c9c('0x29')]=function(_0x159b02){try{if(this[_0x1c9c('0x2f')](_0x159b02)){logger[_0x1c9c('0x35')](_0x1c9c('0xb4'),_0x159b02[_0x1c9c('0x36')],util[_0x1c9c('0x2d')](_0x159b02,{'showHidden':![],'depth':null}));if(this[_0x1c9c('0x18')][_0x159b02['uniqueid']]){if(!_[_0x1c9c('0xb0')](this['channels'][_0x159b02[_0x1c9c('0x36')]][_0x1c9c('0xb1')])){this[_0x1c9c('0x18')][_0x159b02['uniqueid']][_0x1c9c('0xb5')]+=moment()[_0x1c9c('0xb6')](0x0)[_0x1c9c('0x5d')](this[_0x1c9c('0x18')][_0x159b02[_0x1c9c('0x36')]][_0x1c9c('0xb1')],_0x1c9c('0x54'));logger[_0x1c9c('0x3f')](_0x1c9c('0xb7'),_0x159b02['uniqueid'],this[_0x1c9c('0x18')][_0x159b02[_0x1c9c('0x36')]][_0x1c9c('0xb5')]);delete this[_0x1c9c('0x18')][_0x159b02[_0x1c9c('0x36')]][_0x1c9c('0xb1')];}}}}catch(_0x1d5379){logger[_0x1c9c('0x3a')](_0x1c9c('0xb8'),_0x159b02['uniqueid'],util['inspect'](_0x1d5379,{'showHidden':![],'depth':null}));}};module[_0x1c9c('0xb9')]=VoiceCallReport;
\ No newline at end of file