Built motion from commit (unavailable).|2.5.12
[motion2.git] / server / services / ami / report / voiceCallReport.js
index 5014654..665222c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x23db=['appdata','applicationdata','subtract','seconds','includes','lastdata','startsWith','cdr(','queue','[%s][voiceCallReport][newexten]','syncNewState','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','calleridname','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','holdtime','diff','connectedlinenum','connectedlinename','destinationchannel','UserId','membername','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','.wav49','.WAV','monitorFilename','find','monitors','isNil','push','rec','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','value','syncMixMonitorFilename','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','type','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','originatecalleridnum','xmd-destination','destination','xmd-callerid-preview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','parse','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','sipcallid','sipcalllinkedid','[%s][voiceCallReport][varset]','syncHangup','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','duration','billableseconds','from-sip','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','BlindTransfer','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','[%s][voiceCallReport][hangup]','syncAttendedTransfer','transfertargetcalleridnum','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','origtransferercalleridnum','origtransfereruniqueid','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','transfererchannel','[%s][voiceCallReport][blindtransfer]','syncMusicOnHoldStart','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','[%s][voiceCallReport][musiconholdstop]','exports','bluebird','lodash','moment','util','path','../../../config/environment','../../../config/logger','../ami','../model/channel','unknown','not_inuse','inuse','invalid','unavailable','ringing','ringinuse','set','agi','dial','playback','voicemail','FAILED','NO\x20ANSWER','BUSY','redis','defaults','socket.io-emitter','channels','agents','blindTransfers','coreshowchannel','syncNewExten','bind','newexten','newchannel','syncNewChannel','newstate','syncVarSet','syncNewCallerId','attendedtransfer','blindtransfer','syncBlindTransfer','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','inspect','prototype','isNotNull','isUndefined','emit','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridnum','debug','linkedid','merge','pick','keys','[%s][voiceCallReport][newchannel]\x20event:','channel','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','context','exten','starttime','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','split','destconnectedlinenum','format','user:%s','name','user:agentconnect','accountcode','error','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase'];(function(_0x3df9fc,_0x4bf706){var _0x4d269f=function(_0x31465e){while(--_0x31465e){_0x3df9fc['push'](_0x3df9fc['shift']());}};_0x4d269f(++_0x4bf706);}(_0x23db,0x1cb));var _0xb23d=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x23db[_0x1a36a5];return _0x746243;};'use strict';var BPromise=require(_0xb23d('0x0'));var _=require(_0xb23d('0x1'));var moment=require(_0xb23d('0x2'));var util=require(_0xb23d('0x3'));var path=require(_0xb23d('0x4'));var Redis=require('ioredis');var config=require(_0xb23d('0x5'));var logger=require(_0xb23d('0x6'))('ami');var ami=require(_0xb23d('0x7'));var Channel=require(_0xb23d('0x8'));var statusDesc=[_0xb23d('0x9'),_0xb23d('0xa'),_0xb23d('0xb'),'busy',_0xb23d('0xc'),_0xb23d('0xd'),_0xb23d('0xe'),_0xb23d('0xf'),'onhold'];var applications=[_0xb23d('0x10'),'queue',_0xb23d('0x11'),_0xb23d('0x12'),_0xb23d('0x13'),_0xb23d('0x14')];var dispositions=['NO\x20ANSWER',_0xb23d('0x15'),_0xb23d('0x15'),_0xb23d('0x16'),_0xb23d('0x16'),_0xb23d('0x16'),'ANSWERED',_0xb23d('0x17'),_0xb23d('0x15'),_0xb23d('0x15'),_0xb23d('0x15')];var actions={};config[_0xb23d('0x18')]=_[_0xb23d('0x19')](config[_0xb23d('0x18')],{'host':'localhost','port':0x18eb});var io=require(_0xb23d('0x1a'))(new Redis(config['redis']));function VoiceCallReport(_0x5f3953){this['channels']=_0x5f3953[_0xb23d('0x1b')];this[_0xb23d('0x1c')]=_0x5f3953['agents'];this[_0xb23d('0x1d')]={};ami['on'](_0xb23d('0x1e'),this[_0xb23d('0x1f')][_0xb23d('0x20')](this));ami['on'](_0xb23d('0x21'),this[_0xb23d('0x1f')][_0xb23d('0x20')](this));ami['on'](_0xb23d('0x22'),this[_0xb23d('0x23')][_0xb23d('0x20')](this));ami['on'](_0xb23d('0x24'),this['syncNewState'][_0xb23d('0x20')](this));ami['on']('varset',this[_0xb23d('0x25')]['bind'](this));ami['on']('hangup',this['syncHangup'][_0xb23d('0x20')](this));ami['on']('newcallerid',this[_0xb23d('0x26')][_0xb23d('0x20')](this));ami['on'](_0xb23d('0x27'),this['syncAttendedTransfer'][_0xb23d('0x20')](this));ami['on'](_0xb23d('0x28'),this[_0xb23d('0x29')][_0xb23d('0x20')](this));ami['on'](_0xb23d('0x2a'),this['syncMusicOnHoldStart'][_0xb23d('0x20')](this));ami['on'](_0xb23d('0x2b'),this[_0xb23d('0x2c')][_0xb23d('0x20')](this));try{logger[_0xb23d('0x2d')](_0xb23d('0x2e'));ami[_0xb23d('0x2f')]();}catch(_0x4aea94){logger['error']('[voiceCallReport][coreshowchannels]',util[_0xb23d('0x30')](_0x4aea94,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0xb23d('0x31')][_0xb23d('0x32')]=function(_0x58b2de){return _0x58b2de!==null&&!_[_0xb23d('0x33')](_0x58b2de);};VoiceCallReport['prototype'][_0xb23d('0x34')]=function(_0x373333,_0x20fbc6,_0x3b8939){io['to'](_0x373333)[_0xb23d('0x34')](_0x20fbc6,_0x3b8939);};VoiceCallReport[_0xb23d('0x31')]['syncNewCallerId']=function(_0x143022){try{if(this[_0xb23d('0x32')](_0x143022)){logger['info'](_0xb23d('0x35'),_0x143022[_0xb23d('0x36')],_0x143022['calleridname'],_0x143022[_0xb23d('0x37')]);logger[_0xb23d('0x38')]('[%s][voiceCallReport][newcallerid]\x20event:',_0x143022['uniqueid'],util[_0xb23d('0x30')](_0x143022,{'showHidden':![],'depth':null}));if(_0x143022[_0xb23d('0x36')]===_0x143022[_0xb23d('0x39')]){if(!_['isUndefined'](this['channels'][_0x143022['uniqueid']])){_[_0xb23d('0x3a')](this['channels'][_0x143022[_0xb23d('0x36')]],_[_0xb23d('0x3b')](_0x143022,_[_0xb23d('0x3c')](this['channels'][_0x143022['uniqueid']])));}}}}catch(_0x5b5593){logger['error']('[%s][voiceCallReport][newcallerid]',_0x143022[_0xb23d('0x36')],util[_0xb23d('0x30')](_0x5b5593,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb23d('0x31')][_0xb23d('0x23')]=function(_0x46b050){try{if(this[_0xb23d('0x32')](_0x46b050)){logger[_0xb23d('0x38')](_0xb23d('0x3d'),_0x46b050[_0xb23d('0x36')],util['inspect'](_0x46b050,{'showHidden':![],'depth':null}));if(_0x46b050['uniqueid']===_0x46b050[_0xb23d('0x39')]&&_0x46b050[_0xb23d('0x3e')]!=_0xb23d('0x3f')){if(_['isUndefined'](this[_0xb23d('0x1b')][_0x46b050[_0xb23d('0x36')]])){logger[_0xb23d('0x2d')](_0xb23d('0x40'),_0x46b050[_0xb23d('0x36')],_0x46b050[_0xb23d('0x41')],_0x46b050[_0xb23d('0x42')]);this[_0xb23d('0x1b')][_0x46b050[_0xb23d('0x36')]]=new Channel();this[_0xb23d('0x1b')][_0x46b050[_0xb23d('0x36')]][_0xb23d('0x43')]=moment()['format'](_0xb23d('0x44'));this[_0xb23d('0x1b')][_0x46b050[_0xb23d('0x36')]][_0xb23d('0x45')]=dispositions[_[_0xb23d('0x46')](_0x46b050[_0xb23d('0x47')])];_[_0xb23d('0x3a')](this[_0xb23d('0x1b')][_0x46b050[_0xb23d('0x36')]],_[_0xb23d('0x3b')](_0x46b050,_['keys'](this[_0xb23d('0x1b')][_0x46b050[_0xb23d('0x36')]])));if(_0x46b050[_0xb23d('0x41')]==='from-sip'){if(this[_0xb23d('0x1c')][_0x46b050[_0xb23d('0x3e')][_0xb23d('0x48')]('-')[0x0]]){this[_0xb23d('0x1c')][_0x46b050['channel']['split']('-')[0x0]][_0xb23d('0x49')]=_0x46b050['exten'];logger[_0xb23d('0x38')]('[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:',_0x46b050[_0xb23d('0x36')],util['inspect']({'destaccountcode':this[_0xb23d('0x1c')][_0x46b050[_0xb23d('0x3e')][_0xb23d('0x48')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x46b050[_0xb23d('0x42')]},{'showHidden':![],'depth':null}));this[_0xb23d('0x34')](util[_0xb23d('0x4a')](_0xb23d('0x4b'),this[_0xb23d('0x1c')][_0x46b050[_0xb23d('0x3e')][_0xb23d('0x48')]('-')[0x0]][_0xb23d('0x4c')]),_0xb23d('0x4d'),{'destaccountcode':this['agents'][_0x46b050['channel'][_0xb23d('0x48')]('-')[0x0]][_0xb23d('0x4e')],'destconnectedlinenum':_0x46b050[_0xb23d('0x42')]});}}}}}}catch(_0x1dfef5){logger[_0xb23d('0x4f')](_0xb23d('0x50'),_0x46b050[_0xb23d('0x36')],util[_0xb23d('0x30')](_0x1dfef5,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb23d('0x31')][_0xb23d('0x1f')]=function(_0x452cb9){try{if(this[_0xb23d('0x32')](_0x452cb9)){logger['debug'](_0xb23d('0x51'),_0x452cb9['uniqueid'],util[_0xb23d('0x30')](_0x452cb9,{'showHidden':![],'depth':null}));if(_0x452cb9[_0xb23d('0x36')]===_0x452cb9[_0xb23d('0x39')]&&_0x452cb9['exten']!='h'&&_0x452cb9[_0xb23d('0x3e')]!=_0xb23d('0x3f')){_0x452cb9[_0xb23d('0x52')]=_0x452cb9['application'][_0xb23d('0x53')]();_0x452cb9['applicationdata']=(_0x452cb9[_0xb23d('0x54')]||_0x452cb9['applicationdata'])[_0xb23d('0x53')]();logger[_0xb23d('0x2d')]('[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s',_0x452cb9[_0xb23d('0x36')],_0x452cb9[_0xb23d('0x52')],_0x452cb9[_0xb23d('0x55')]);if(_[_0xb23d('0x33')](this[_0xb23d('0x1b')][_0x452cb9['uniqueid']])){this[_0xb23d('0x1b')][_0x452cb9[_0xb23d('0x36')]]=new Channel();this[_0xb23d('0x1b')][_0x452cb9[_0xb23d('0x36')]][_0xb23d('0x43')]=_0x452cb9['duration']?moment()[_0xb23d('0x56')](moment['duration'](_0x452cb9['duration'])[_0xb23d('0x57')](),_0xb23d('0x57'))[_0xb23d('0x4a')]('YYYY-MM-DD\x20HH:mm:ss'):moment()[_0xb23d('0x4a')](_0xb23d('0x44'));this[_0xb23d('0x1b')][_0x452cb9[_0xb23d('0x36')]][_0xb23d('0x45')]='NO\x20ANSWER';}_['merge'](this[_0xb23d('0x1b')][_0x452cb9[_0xb23d('0x36')]],_[_0xb23d('0x3b')](_0x452cb9,_[_0xb23d('0x3c')](this[_0xb23d('0x1b')][_0x452cb9[_0xb23d('0x36')]])));if(_[_0xb23d('0x58')](applications,_0x452cb9[_0xb23d('0x52')])){this['channels'][_0x452cb9['uniqueid']]['lastapplication']=_0x452cb9[_0xb23d('0x52')];this['channels'][_0x452cb9[_0xb23d('0x36')]][_0xb23d('0x59')]=_0x452cb9['applicationdata'];if(_0x452cb9[_0xb23d('0x52')]===_0xb23d('0x10')&&_[_0xb23d('0x5a')](_0x452cb9[_0xb23d('0x55')],_0xb23d('0x5b'))){var _0x57c70a=_0x452cb9[_0xb23d('0x55')][_0xb23d('0x48')]('=');var _0x5249f8=_0x57c70a[0x0]['match'](/cdr\((.*)\)/);if(_0x5249f8){this[_0xb23d('0x1b')][_0x452cb9[_0xb23d('0x36')]][_0x5249f8[0x1]]=_0x57c70a[0x1];}}else if(_0x452cb9['application']===_0xb23d('0x5c')){this[_0xb23d('0x1b')][_0x452cb9[_0xb23d('0x36')]][_0xb23d('0x5c')]=_0x452cb9[_0xb23d('0x55')]['split'](',')[0x0];}}}}}catch(_0x505984){logger[_0xb23d('0x4f')](_0xb23d('0x5d'),_0x452cb9['uniqueid'],util[_0xb23d('0x30')](_0x505984,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb23d('0x31')][_0xb23d('0x5e')]=function(_0x397ff8){try{if(this[_0xb23d('0x32')](_0x397ff8)){logger[_0xb23d('0x2d')](_0xb23d('0x5f'),_0x397ff8[_0xb23d('0x36')],_0x397ff8['linkedid'],_0x397ff8[_0xb23d('0x60')],_0x397ff8[_0xb23d('0x37')]);logger[_0xb23d('0x38')](_0xb23d('0x61'),_0x397ff8[_0xb23d('0x36')],util['inspect'](_0x397ff8,{'showHidden':![],'depth':null}));if(_0x397ff8['uniqueid']!==_0x397ff8[_0xb23d('0x39')]){if(this[_0xb23d('0x1b')][_0x397ff8[_0xb23d('0x39')]]){if(_0x397ff8[_0xb23d('0x47')]==='6'){if(!this[_0xb23d('0x1b')][_0x397ff8[_0xb23d('0x39')]][_0xb23d('0x62')]){var _0x5bd159=moment();this[_0xb23d('0x1b')][_0x397ff8['linkedid']][_0xb23d('0x62')]=!![];this[_0xb23d('0x1b')][_0x397ff8[_0xb23d('0x39')]][_0xb23d('0x63')]=_0x5bd159[_0xb23d('0x4a')](_0xb23d('0x44'));if(this[_0xb23d('0x1b')][_0x397ff8[_0xb23d('0x39')]][_0xb23d('0x43')]){this[_0xb23d('0x1b')][_0x397ff8[_0xb23d('0x39')]][_0xb23d('0x64')]=_0x5bd159[_0xb23d('0x65')](this['channels'][_0x397ff8[_0xb23d('0x39')]]['starttime'],_0xb23d('0x57'));}}this[_0xb23d('0x1b')][_0x397ff8[_0xb23d('0x39')]][_0xb23d('0x39')]=_0x397ff8[_0xb23d('0x36')];if(_0x397ff8[_0xb23d('0x37')]!=='xcally-motion-preview'){this[_0xb23d('0x1b')][_0x397ff8[_0xb23d('0x39')]][_0xb23d('0x66')]=_0x397ff8['calleridnum'];}this[_0xb23d('0x1b')][_0x397ff8[_0xb23d('0x39')]][_0xb23d('0x67')]=_0x397ff8['calleridname'];this[_0xb23d('0x1b')][_0x397ff8[_0xb23d('0x39')]][_0xb23d('0x68')]=_0x397ff8[_0xb23d('0x3e')];this[_0xb23d('0x1b')][_0x397ff8[_0xb23d('0x39')]][_0xb23d('0x45')]=dispositions[_[_0xb23d('0x46')](_0x397ff8[_0xb23d('0x47')])];if(this[_0xb23d('0x1c')][_0x397ff8[_0xb23d('0x3e')][_0xb23d('0x48')]('-')[0x0]]){this['channels'][_0x397ff8['linkedid']][_0xb23d('0x69')]=this[_0xb23d('0x1c')][_0x397ff8[_0xb23d('0x3e')][_0xb23d('0x48')]('-')[0x0]]['id'];this[_0xb23d('0x1b')][_0x397ff8[_0xb23d('0x39')]]['membername']=this[_0xb23d('0x1c')][_0x397ff8[_0xb23d('0x3e')][_0xb23d('0x48')]('-')[0x0]][_0xb23d('0x4c')];}}}}else{if(this[_0xb23d('0x1b')][_0x397ff8[_0xb23d('0x36')]]){if(_0x397ff8['channelstate']==='6'){if(this['agents'][_0x397ff8[_0xb23d('0x3e')][_0xb23d('0x48')]('-')[0x0]]){this['channels'][_0x397ff8['uniqueid']][_0xb23d('0x69')]=this[_0xb23d('0x1c')][_0x397ff8[_0xb23d('0x3e')][_0xb23d('0x48')]('-')[0x0]]['id'];this[_0xb23d('0x1b')][_0x397ff8['uniqueid']][_0xb23d('0x6a')]=this[_0xb23d('0x1c')][_0x397ff8[_0xb23d('0x3e')]['split']('-')[0x0]]['name'];}}}}}}catch(_0x46a083){logger['error']('[%s][voiceCallReport][newstate]',_0x397ff8[_0xb23d('0x36')],util[_0xb23d('0x30')](_0x46a083,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb23d('0x31')]['syncMixMonitorFilename']=function(_0x14f718,_0x385174){try{if(this['channels'][_0x14f718]){logger[_0xb23d('0x2d')](_0xb23d('0x6b'),_0x14f718,_0x385174);this[_0xb23d('0x1b')][_0x14f718][_0xb23d('0x6c')]=!![];if(_[_0xb23d('0x6d')](_0x385174,_0xb23d('0x6e'))){_0x385174=_0x385174['replace']('.wav49',_0xb23d('0x6f'));}this[_0xb23d('0x1b')][_0x14f718][_0xb23d('0x70')]=_0x385174;var _0xf8fb1f=_[_0xb23d('0x71')](this[_0xb23d('0x1b')][_0x14f718][_0xb23d('0x72')],{'filename':_0x385174});if(_[_0xb23d('0x73')](_0xf8fb1f)){this['channels'][_0x14f718]['monitors'][_0xb23d('0x74')]({'filename':_0x385174,'createdAt':moment()[_0xb23d('0x4a')](_0xb23d('0x44')),'mixmonitorid':'','status':_0xb23d('0x75')});}}}catch(_0x48cf1d){logger[_0xb23d('0x4f')]('[%s][voiceCallReport][mixMonitorFilename]',_0x14f718,util[_0xb23d('0x30')](_0x48cf1d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb23d('0x31')][_0xb23d('0x25')]=function(_0xebc5cc){try{if(this['isNotNull'](_0xebc5cc)){logger[_0xb23d('0x38')](_0xb23d('0x76'),_0xebc5cc[_0xb23d('0x36')],util[_0xb23d('0x30')](_0xebc5cc,{'showHidden':![],'depth':null}));if(this[_0xb23d('0x1b')][_0xebc5cc[_0xb23d('0x36')]]&&_0xebc5cc[_0xb23d('0x3e')]!=_0xb23d('0x3f')){if(this[_0xb23d('0x32')](_0xebc5cc[_0xb23d('0x77')])){if(this[_0xb23d('0x32')](_0xebc5cc[_0xb23d('0x77')][_0xb23d('0x78')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0xebc5cc[_0xb23d('0x36')],_0xebc5cc[_0xb23d('0x79')]);this[_0xb23d('0x7a')](_0xebc5cc['uniqueid'],_0xebc5cc[_0xb23d('0x79')]);}else if(this[_0xb23d('0x32')](_0xebc5cc[_0xb23d('0x77')][_0xb23d('0x7b')])){logger[_0xb23d('0x2d')](_0xb23d('0x7c'),_0xebc5cc[_0xb23d('0x36')],_0xebc5cc[_0xb23d('0x79')]);this[_0xb23d('0x1b')][_0xebc5cc[_0xb23d('0x36')]][_0xb23d('0x37')]=_0xebc5cc['value'];}else if(this[_0xb23d('0x32')](_0xebc5cc[_0xb23d('0x77')]['xmd-callerid'])){logger[_0xb23d('0x2d')]('[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s',_0xebc5cc[_0xb23d('0x36')],_0xebc5cc['value']);this[_0xb23d('0x1b')][_0xebc5cc[_0xb23d('0x36')]]['callerid']=_0xebc5cc[_0xb23d('0x79')];}else if(this['isNotNull'](_0xebc5cc[_0xb23d('0x77')][_0xb23d('0x7d')])){logger[_0xb23d('0x2d')](_0xb23d('0x7e'),_0xebc5cc[_0xb23d('0x36')],_0xebc5cc['value']);this[_0xb23d('0x1b')][_0xebc5cc[_0xb23d('0x36')]][_0xb23d('0x7f')]=_0xebc5cc[_0xb23d('0x79')];}else if(this['isNotNull'](_0xebc5cc[_0xb23d('0x77')][_0xb23d('0x80')])){logger[_0xb23d('0x2d')](_0xb23d('0x81'),_0xebc5cc[_0xb23d('0x36')],_0xebc5cc[_0xb23d('0x79')][_0xb23d('0x48')](',')[0x0]);this[_0xb23d('0x1b')][_0xebc5cc[_0xb23d('0x36')]][_0xb23d('0x5c')]=_0xebc5cc['value'][_0xb23d('0x48')](',')[0x0];}else if(this[_0xb23d('0x32')](_0xebc5cc[_0xb23d('0x77')][_0xb23d('0x82')])){logger[_0xb23d('0x2d')]('[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0xebc5cc['uniqueid'],_0xebc5cc['value']);this['channels'][_0xebc5cc[_0xb23d('0x36')]][_0xb23d('0x83')]=_0xebc5cc[_0xb23d('0x79')];}else if(this[_0xb23d('0x32')](_0xebc5cc[_0xb23d('0x77')][_0xb23d('0x84')])){logger[_0xb23d('0x2d')]('[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s',_0xebc5cc[_0xb23d('0x36')],_0xebc5cc['value']);this['channels'][_0xebc5cc[_0xb23d('0x36')]][_0xb23d('0x85')]=_0xebc5cc[_0xb23d('0x79')];}else if(this[_0xb23d('0x32')](_0xebc5cc[_0xb23d('0x77')][_0xb23d('0x86')])){logger[_0xb23d('0x2d')]('[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s',_0xebc5cc[_0xb23d('0x36')],_0xebc5cc[_0xb23d('0x79')]);this[_0xb23d('0x1b')][_0xebc5cc[_0xb23d('0x36')]]['calleridpreview']=_0xebc5cc['value'];}else if(this['isNotNull'](_0xebc5cc['variable'][_0xb23d('0x87')])){logger[_0xb23d('0x2d')](_0xb23d('0x88'),_0xebc5cc[_0xb23d('0x36')],_0xebc5cc[_0xb23d('0x79')]);this[_0xb23d('0x1b')][_0xebc5cc[_0xb23d('0x36')]]['queue']=_0xebc5cc[_0xb23d('0x79')];}else if(this[_0xb23d('0x32')](_0xebc5cc[_0xb23d('0x77')]['sipcallid'])){logger[_0xb23d('0x2d')](_0xb23d('0x89'),_0xebc5cc[_0xb23d('0x36')],_0xebc5cc[_0xb23d('0x79')]);this[_0xb23d('0x1b')][_0xebc5cc[_0xb23d('0x36')]][_0xb23d('0x8a')]=_0xebc5cc[_0xb23d('0x79')];}}}else if(this[_0xb23d('0x32')](_0xebc5cc[_0xb23d('0x77')]['mixmonitor_filename'])){if(_0xebc5cc[_0xb23d('0x79')]){var _0x3f0399=path[_0xb23d('0x8b')](_0xebc5cc[_0xb23d('0x79')])['name'];logger[_0xb23d('0x2d')](_0xb23d('0x8c'),_0x3f0399,_0xebc5cc['value']);this['syncMixMonitorFilename'](_0x3f0399,_0xebc5cc[_0xb23d('0x79')]);}}else if(this[_0xb23d('0x1b')][_0xebc5cc[_0xb23d('0x39')]]){if(this[_0xb23d('0x32')](_0xebc5cc['variable'])){if(this[_0xb23d('0x32')](_0xebc5cc['variable'][_0xb23d('0x8d')])){logger[_0xb23d('0x2d')](_0xb23d('0x89'),_0xebc5cc[_0xb23d('0x39')],_0xebc5cc['value']);this[_0xb23d('0x1b')][_0xebc5cc[_0xb23d('0x39')]][_0xb23d('0x8e')]=_0xebc5cc[_0xb23d('0x79')];}}}}}catch(_0x2d07df){logger['error'](_0xb23d('0x8f'),_0xebc5cc[_0xb23d('0x36')],util['inspect'](_0x2d07df,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xb23d('0x90')]=function(_0x3da5f2){try{if(this[_0xb23d('0x32')](_0x3da5f2)){logger[_0xb23d('0x38')]('[%s][voiceCallReport][hangup]\x20event:',_0x3da5f2[_0xb23d('0x36')],util[_0xb23d('0x30')](_0x3da5f2,{'showHidden':![],'depth':null}));if(this[_0xb23d('0x1b')][_0x3da5f2['uniqueid']]){logger[_0xb23d('0x2d')](_0xb23d('0x91'),_0x3da5f2['uniqueid'],_0x3da5f2[_0xb23d('0x92')]);var _0x3de6f2=moment();this[_0xb23d('0x1b')][_0x3da5f2['uniqueid']][_0xb23d('0x93')]=_0x3de6f2[_0xb23d('0x4a')](_0xb23d('0x44'));this['channels'][_0x3da5f2['uniqueid']][_0xb23d('0x94')]=_0x3de6f2['diff'](this[_0xb23d('0x1b')][_0x3da5f2[_0xb23d('0x36')]][_0xb23d('0x43')],_0xb23d('0x57'));if(this[_0xb23d('0x1b')][_0x3da5f2[_0xb23d('0x36')]]['answered']){this[_0xb23d('0x1b')][_0x3da5f2['uniqueid']]['billableseconds']=_0x3de6f2[_0xb23d('0x65')](this[_0xb23d('0x1b')][_0x3da5f2[_0xb23d('0x36')]]['answertime'],_0xb23d('0x57'));this[_0xb23d('0x1b')][_0x3da5f2[_0xb23d('0x36')]][_0xb23d('0x64')]=this[_0xb23d('0x1b')][_0x3da5f2[_0xb23d('0x36')]][_0xb23d('0x94')]-this[_0xb23d('0x1b')][_0x3da5f2[_0xb23d('0x36')]][_0xb23d('0x95')];}if(_0x3da5f2['context']===_0xb23d('0x96')){if(this['agents'][_0x3da5f2[_0xb23d('0x3e')][_0xb23d('0x48')]('-')[0x0]]){this[_0xb23d('0x1c')][_0x3da5f2[_0xb23d('0x3e')][_0xb23d('0x48')]('-')[0x0]]=_[_0xb23d('0x97')](this['agents'][_0x3da5f2[_0xb23d('0x3e')][_0xb23d('0x48')]('-')[0x0]],[_0xb23d('0x49')]);logger[_0xb23d('0x38')](_0xb23d('0x98'),_0x3da5f2['uniqueid'],util[_0xb23d('0x30')]({'destaccountcode':this[_0xb23d('0x1c')][_0x3da5f2[_0xb23d('0x3e')][_0xb23d('0x48')]('-')[0x0]][_0xb23d('0x4e')]},{'showHidden':![],'depth':null}));this[_0xb23d('0x34')](util['format']('user:%s',this[_0xb23d('0x1c')][_0x3da5f2[_0xb23d('0x3e')]['split']('-')[0x0]][_0xb23d('0x4c')]),_0xb23d('0x99'),{'destaccountcode':this[_0xb23d('0x1c')][_0x3da5f2[_0xb23d('0x3e')][_0xb23d('0x48')]('-')[0x0]]['accountcode']});}}if(_0x3da5f2['event']===_0xb23d('0x9a')){this[_0xb23d('0x1d')][_0x3da5f2[_0xb23d('0x36')]]=this[_0xb23d('0x1b')][_0x3da5f2['uniqueid']];}else{if(this[_0xb23d('0x1b')][_0x3da5f2['uniqueid']][_0xb23d('0x7f')]===_0xb23d('0x9b')&&this[_0xb23d('0x1d')][_0x3da5f2['uniqueid']]){this[_0xb23d('0x1b')][_0x3da5f2[_0xb23d('0x36')]][_0xb23d('0x36')]=[this[_0xb23d('0x1b')][_0x3da5f2[_0xb23d('0x36')]]['linkedid'],this[_0xb23d('0x1b')][_0x3da5f2[_0xb23d('0x36')]][_0xb23d('0x39')]=this[_0xb23d('0x1b')][_0x3da5f2['uniqueid']][_0xb23d('0x36')]][0x0];delete this[_0xb23d('0x1d')][_0x3da5f2['uniqueid']];}}logger[_0xb23d('0x38')](_0xb23d('0x9c'),_0x3da5f2[_0xb23d('0x36')],util['inspect'](this[_0xb23d('0x1b')][_0x3da5f2[_0xb23d('0x36')]],{'showHidden':![],'depth':null}));ami[_0xb23d('0x34')]('custom:voiceCallReport',this[_0xb23d('0x1b')][_0x3da5f2[_0xb23d('0x36')]]);delete this[_0xb23d('0x1b')][_0x3da5f2[_0xb23d('0x36')]];}}}catch(_0x34057b){logger[_0xb23d('0x4f')](_0xb23d('0x9d'),_0x3da5f2[_0xb23d('0x36')],util[_0xb23d('0x30')](_0x34057b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb23d('0x31')][_0xb23d('0x9e')]=function(_0x3f0993){try{if(this[_0xb23d('0x32')](_0x3f0993)){logger['info']('[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s',_0x3f0993[_0xb23d('0x36')],_0x3f0993['origtransferercalleridnum'],_0x3f0993[_0xb23d('0x9f')]);logger['debug']('[%s][voiceCallReport][attendedtransfer]\x20event:',_0x3f0993[_0xb23d('0x36')],util[_0xb23d('0x30')](_0x3f0993,{'showHidden':![],'depth':null}));if(this[_0xb23d('0x1b')][_0x3f0993[_0xb23d('0xa0')]]){this[_0xb23d('0x1b')][_0x3f0993[_0xb23d('0xa0')]][_0xb23d('0xa1')]=_0x3f0993['origtransferercalleridnum'];this[_0xb23d('0x1b')][_0x3f0993['transfereeuniqueid']][_0xb23d('0xa2')]=_0x3f0993[_0xb23d('0x9f')];if(this['channels'][_0x3f0993[_0xb23d('0xa3')]]){var _0x4546cd=this[_0xb23d('0x1b')][_0x3f0993['secondtransfereruniqueid']];this[_0xb23d('0x1b')][_0x3f0993[_0xb23d('0xa3')]]=this['channels'][_0x3f0993[_0xb23d('0xa0')]];this[_0xb23d('0x1b')][_0x3f0993[_0xb23d('0xa0')]]=_0x4546cd;}}else if(this[_0xb23d('0x1b')][_0x3f0993[_0xb23d('0xa4')]]){this[_0xb23d('0x1b')][_0x3f0993[_0xb23d('0xa4')]]['transfercalleridnum']=_0x3f0993[_0xb23d('0xa5')];this[_0xb23d('0x1b')][_0x3f0993[_0xb23d('0xa4')]][_0xb23d('0xa2')]=_0x3f0993['transfertargetcalleridnum'];if(this['channels'][_0x3f0993[_0xb23d('0xa6')]]){var _0x4546cd=this['channels'][_0x3f0993[_0xb23d('0xa6')]];this[_0xb23d('0x1b')][_0x3f0993[_0xb23d('0xa6')]]=this[_0xb23d('0x1b')][_0x3f0993[_0xb23d('0xa4')]];this[_0xb23d('0x1b')][_0x3f0993[_0xb23d('0xa4')]]=_0x4546cd;}}}}catch(_0x3767a4){logger[_0xb23d('0x4f')]('[%s][voiceCallReport][attendedtransfer]',_0x3f0993['uniqueid'],util['inspect'](_0x3767a4,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb23d('0x31')][_0xb23d('0x29')]=function(_0x480c50){try{if(this[_0xb23d('0x32')](_0x480c50)){logger['info'](_0xb23d('0xa7'),_0x480c50[_0xb23d('0x36')],_0x480c50[_0xb23d('0xa8')],_0x480c50[_0xb23d('0xa9')]);logger['debug']('[%s][voiceCallReport][blindtransfer]\x20event:',_0x480c50['uniqueid'],util[_0xb23d('0x30')](_0x480c50,{'showHidden':![],'depth':null}));if(this[_0xb23d('0x1b')][_0x480c50[_0xb23d('0xa0')]]){this[_0xb23d('0x1b')][_0x480c50[_0xb23d('0xa0')]][_0xb23d('0xa1')]=_0x480c50[_0xb23d('0xa8')];this[_0xb23d('0x1b')][_0x480c50[_0xb23d('0xa0')]]['transferconnectedlinenum']=_0x480c50[_0xb23d('0xa9')];this[_0xb23d('0x90')]({'event':_0xb23d('0x9a'),'uniqueid':_0x480c50['transfereeuniqueid'],'context':_0x480c50['context'],'channel':_0x480c50[_0xb23d('0xaa')]});}}}catch(_0x2fed16){logger[_0xb23d('0x4f')](_0xb23d('0xab'),_0x480c50[_0xb23d('0x36')],util['inspect'](_0x2fed16,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb23d('0x31')][_0xb23d('0xac')]=function(_0x3c97c9){try{if(this[_0xb23d('0x32')](_0x3c97c9)){logger[_0xb23d('0x38')]('[%s][voiceCallReport][musiconholdstart]\x20event:',_0x3c97c9[_0xb23d('0x36')],util['inspect'](_0x3c97c9,{'showHidden':![],'depth':null}));if(this[_0xb23d('0x1b')][_0x3c97c9['uniqueid']]){if(!_[_0xb23d('0x73')](this[_0xb23d('0x1b')][_0x3c97c9[_0xb23d('0x36')]][_0xb23d('0x63')])){this[_0xb23d('0x1b')][_0x3c97c9['uniqueid']][_0xb23d('0xad')]=moment()['format'](_0xb23d('0x44'));logger[_0xb23d('0x2d')](_0xb23d('0xae'),_0x3c97c9[_0xb23d('0x36')],this[_0xb23d('0x1b')][_0x3c97c9[_0xb23d('0x36')]][_0xb23d('0xad')]);}}}}catch(_0x218831){logger['error'](_0xb23d('0xaf'),_0x3c97c9['uniqueid'],util[_0xb23d('0x30')](_0x218831,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb23d('0x31')][_0xb23d('0x2c')]=function(_0x30b9cb){try{if(this[_0xb23d('0x32')](_0x30b9cb)){logger['debug'](_0xb23d('0xb0'),_0x30b9cb[_0xb23d('0x36')],util[_0xb23d('0x30')](_0x30b9cb,{'showHidden':![],'depth':null}));if(this[_0xb23d('0x1b')][_0x30b9cb[_0xb23d('0x36')]]){if(!_[_0xb23d('0x73')](this['channels'][_0x30b9cb['uniqueid']][_0xb23d('0xad')])){this[_0xb23d('0x1b')][_0x30b9cb[_0xb23d('0x36')]][_0xb23d('0xb1')]+=moment()['milliseconds'](0x0)[_0xb23d('0x65')](this[_0xb23d('0x1b')][_0x30b9cb[_0xb23d('0x36')]][_0xb23d('0xad')],'seconds');logger['info'](_0xb23d('0xb2'),_0x30b9cb[_0xb23d('0x36')],this[_0xb23d('0x1b')][_0x30b9cb[_0xb23d('0x36')]]['mohtime']);delete this[_0xb23d('0x1b')][_0x30b9cb['uniqueid']][_0xb23d('0xad')];}}}}catch(_0xe257c1){logger[_0xb23d('0x4f')](_0xb23d('0xb3'),_0x30b9cb['uniqueid'],util[_0xb23d('0x30')](_0xe257c1,{'showHidden':![],'depth':null}));}};module[_0xb23d('0xb4')]=VoiceCallReport;
\ No newline at end of file
+var _0x1453=['transfertargetcalleridnum','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[%s][voiceCallReport][attendedtransfer]','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','transfererchannel','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','[%s][voiceCallReport][musiconholdstop]','exports','bluebird','lodash','util','path','../../../config/logger','ami','../ami','../model/channel','unknown','inuse','invalid','ringing','ringinuse','onhold','set','agi','dial','playback','FAILED','NO\x20ANSWER','ANSWERED','redis','localhost','socket.io-emitter','channels','blindTransfers','coreshowchannel','syncNewExten','newexten','syncNewChannel','syncNewState','bind','syncVarSet','hangup','syncHangup','newcallerid','syncNewCallerId','syncAttendedTransfer','blindtransfer','syncBlindTransfer','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','[voiceCallReport][coreshowchannels]\x20started','error','[voiceCallReport][coreshowchannels]','prototype','isNotNull','isUndefined','emit','info','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridnum','[%s][voiceCallReport][newcallerid]\x20event:','pick','debug','[%s][voiceCallReport][newchannel]\x20event:','inspect','channel','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','context','exten','format','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','merge','from-sip','agents','split','destconnectedlinenum','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','accountcode','name','[%s][voiceCallReport][newexten]\x20event:','linkedid','application','toLowerCase','applicationdata','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','seconds','keys','lastapplication','startsWith','cdr(','match','queue','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','calleridname','[%s][voiceCallReport][newstate]\x20event:','channelstate','answered','answertime','starttime','xcally-motion-preview','connectedlinenum','connectedlinename','destinationchannel','membername','UserId','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','monitor','endsWith','.wav49','replace','monitorFilename','find','monitors','isNil','push','rec','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','xmd-queue','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','sipcallid','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','cause-txt','endtime','diff','billableseconds','holdtime','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:%s','user:agentcomplete','event','BlindTransfer','type','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][hangup]','origtransferercalleridnum'];(function(_0x310d96,_0x3bd3f3){var _0x2149de=function(_0x20b32d){while(--_0x20b32d){_0x310d96['push'](_0x310d96['shift']());}};_0x2149de(++_0x3bd3f3);}(_0x1453,0xd3));var _0x3145=function(_0x860966,_0x4c00b){_0x860966=_0x860966-0x0;var _0x33770f=_0x1453[_0x860966];return _0x33770f;};'use strict';var BPromise=require(_0x3145('0x0'));var _=require(_0x3145('0x1'));var moment=require('moment');var util=require(_0x3145('0x2'));var path=require(_0x3145('0x3'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x3145('0x4'))(_0x3145('0x5'));var ami=require(_0x3145('0x6'));var Channel=require(_0x3145('0x7'));var statusDesc=[_0x3145('0x8'),'not_inuse',_0x3145('0x9'),'busy',_0x3145('0xa'),'unavailable',_0x3145('0xb'),_0x3145('0xc'),_0x3145('0xd')];var applications=[_0x3145('0xe'),'queue',_0x3145('0xf'),_0x3145('0x10'),_0x3145('0x11'),'voicemail'];var dispositions=['NO\x20ANSWER',_0x3145('0x12'),_0x3145('0x12'),'NO\x20ANSWER',_0x3145('0x13'),_0x3145('0x13'),_0x3145('0x14'),'BUSY',_0x3145('0x12'),_0x3145('0x12'),_0x3145('0x12')];var actions={};config[_0x3145('0x15')]=_['defaults'](config[_0x3145('0x15')],{'host':_0x3145('0x16'),'port':0x18eb});var io=require(_0x3145('0x17'))(new Redis(config[_0x3145('0x15')]));function VoiceCallReport(_0x42fbc7){this[_0x3145('0x18')]=_0x42fbc7[_0x3145('0x18')];this['agents']=_0x42fbc7['agents'];this[_0x3145('0x19')]={};ami['on'](_0x3145('0x1a'),this[_0x3145('0x1b')]['bind'](this));ami['on'](_0x3145('0x1c'),this[_0x3145('0x1b')]['bind'](this));ami['on']('newchannel',this[_0x3145('0x1d')]['bind'](this));ami['on']('newstate',this[_0x3145('0x1e')][_0x3145('0x1f')](this));ami['on']('varset',this[_0x3145('0x20')][_0x3145('0x1f')](this));ami['on'](_0x3145('0x21'),this[_0x3145('0x22')][_0x3145('0x1f')](this));ami['on'](_0x3145('0x23'),this[_0x3145('0x24')][_0x3145('0x1f')](this));ami['on']('attendedtransfer',this[_0x3145('0x25')][_0x3145('0x1f')](this));ami['on'](_0x3145('0x26'),this[_0x3145('0x27')][_0x3145('0x1f')](this));ami['on']('musiconholdstart',this[_0x3145('0x28')]['bind'](this));ami['on'](_0x3145('0x29'),this[_0x3145('0x2a')][_0x3145('0x1f')](this));try{logger['info'](_0x3145('0x2b'));ami['actionCoreShowChannels']();}catch(_0x2fbb9b){logger[_0x3145('0x2c')](_0x3145('0x2d'),util['inspect'](_0x2fbb9b,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x3145('0x2e')][_0x3145('0x2f')]=function(_0x4d9bea){return _0x4d9bea!==null&&!_[_0x3145('0x30')](_0x4d9bea);};VoiceCallReport[_0x3145('0x2e')][_0x3145('0x31')]=function(_0x1bb393,_0x3ddd32,_0x57ee1f){io['to'](_0x1bb393)[_0x3145('0x31')](_0x3ddd32,_0x57ee1f);};VoiceCallReport[_0x3145('0x2e')][_0x3145('0x24')]=function(_0x413012){try{if(this['isNotNull'](_0x413012)){logger[_0x3145('0x32')](_0x3145('0x33'),_0x413012[_0x3145('0x34')],_0x413012['calleridname'],_0x413012[_0x3145('0x35')]);logger['debug'](_0x3145('0x36'),_0x413012[_0x3145('0x34')],util['inspect'](_0x413012,{'showHidden':![],'depth':null}));if(_0x413012['uniqueid']===_0x413012['linkedid']){if(!_['isUndefined'](this['channels'][_0x413012[_0x3145('0x34')]])){_['merge'](this[_0x3145('0x18')][_0x413012['uniqueid']],_[_0x3145('0x37')](_0x413012,_['keys'](this['channels'][_0x413012['uniqueid']])));}}}}catch(_0x450913){logger[_0x3145('0x2c')]('[%s][voiceCallReport][newcallerid]',_0x413012['uniqueid'],util['inspect'](_0x450913,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x3145('0x1d')]=function(_0x37afe3){try{if(this['isNotNull'](_0x37afe3)){logger[_0x3145('0x38')](_0x3145('0x39'),_0x37afe3[_0x3145('0x34')],util[_0x3145('0x3a')](_0x37afe3,{'showHidden':![],'depth':null}));if(_0x37afe3[_0x3145('0x34')]===_0x37afe3['linkedid']&&_0x37afe3[_0x3145('0x3b')]!=_0x3145('0x3c')){if(_[_0x3145('0x30')](this[_0x3145('0x18')][_0x37afe3[_0x3145('0x34')]])){logger[_0x3145('0x32')](_0x3145('0x3d'),_0x37afe3[_0x3145('0x34')],_0x37afe3[_0x3145('0x3e')],_0x37afe3[_0x3145('0x3f')]);this[_0x3145('0x18')][_0x37afe3[_0x3145('0x34')]]=new Channel();this[_0x3145('0x18')][_0x37afe3['uniqueid']]['starttime']=moment()[_0x3145('0x40')](_0x3145('0x41'));this['channels'][_0x37afe3['uniqueid']][_0x3145('0x42')]=dispositions[_[_0x3145('0x43')](_0x37afe3['channelstate'])];_[_0x3145('0x44')](this['channels'][_0x37afe3[_0x3145('0x34')]],_[_0x3145('0x37')](_0x37afe3,_['keys'](this[_0x3145('0x18')][_0x37afe3[_0x3145('0x34')]])));if(_0x37afe3[_0x3145('0x3e')]===_0x3145('0x45')){if(this[_0x3145('0x46')][_0x37afe3['channel'][_0x3145('0x47')]('-')[0x0]]){this['agents'][_0x37afe3[_0x3145('0x3b')][_0x3145('0x47')]('-')[0x0]][_0x3145('0x48')]=_0x37afe3[_0x3145('0x3f')];logger[_0x3145('0x38')](_0x3145('0x49'),_0x37afe3[_0x3145('0x34')],util[_0x3145('0x3a')]({'destaccountcode':this['agents'][_0x37afe3['channel'][_0x3145('0x47')]('-')[0x0]][_0x3145('0x4a')],'destconnectedlinenum':_0x37afe3['exten']},{'showHidden':![],'depth':null}));this[_0x3145('0x31')](util['format']('user:%s',this[_0x3145('0x46')][_0x37afe3[_0x3145('0x3b')][_0x3145('0x47')]('-')[0x0]][_0x3145('0x4b')]),'user:agentconnect',{'destaccountcode':this[_0x3145('0x46')][_0x37afe3[_0x3145('0x3b')][_0x3145('0x47')]('-')[0x0]][_0x3145('0x4a')],'destconnectedlinenum':_0x37afe3[_0x3145('0x3f')]});}}}}}}catch(_0x55cb82){logger[_0x3145('0x2c')]('[%s][voiceCallReport][newchannel]',_0x37afe3[_0x3145('0x34')],util[_0x3145('0x3a')](_0x55cb82,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3145('0x2e')][_0x3145('0x1b')]=function(_0x4e95f1){try{if(this['isNotNull'](_0x4e95f1)){logger['debug'](_0x3145('0x4c'),_0x4e95f1[_0x3145('0x34')],util[_0x3145('0x3a')](_0x4e95f1,{'showHidden':![],'depth':null}));if(_0x4e95f1[_0x3145('0x34')]===_0x4e95f1[_0x3145('0x4d')]&&_0x4e95f1['exten']!='h'&&_0x4e95f1[_0x3145('0x3b')]!='OutgoingSpoolFailed'){_0x4e95f1[_0x3145('0x4e')]=_0x4e95f1[_0x3145('0x4e')][_0x3145('0x4f')]();_0x4e95f1[_0x3145('0x50')]=(_0x4e95f1['appdata']||_0x4e95f1[_0x3145('0x50')])[_0x3145('0x4f')]();logger[_0x3145('0x32')](_0x3145('0x51'),_0x4e95f1['uniqueid'],_0x4e95f1[_0x3145('0x4e')],_0x4e95f1[_0x3145('0x50')]);if(_[_0x3145('0x30')](this[_0x3145('0x18')][_0x4e95f1['uniqueid']])){this[_0x3145('0x18')][_0x4e95f1['uniqueid']]=new Channel();this['channels'][_0x4e95f1[_0x3145('0x34')]]['starttime']=_0x4e95f1[_0x3145('0x52')]?moment()['subtract'](moment[_0x3145('0x52')](_0x4e95f1[_0x3145('0x52')])[_0x3145('0x53')](),_0x3145('0x53'))[_0x3145('0x40')](_0x3145('0x41')):moment()[_0x3145('0x40')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x4e95f1[_0x3145('0x34')]]['disposition']=_0x3145('0x13');}_[_0x3145('0x44')](this[_0x3145('0x18')][_0x4e95f1['uniqueid']],_[_0x3145('0x37')](_0x4e95f1,_[_0x3145('0x54')](this[_0x3145('0x18')][_0x4e95f1[_0x3145('0x34')]])));if(_['includes'](applications,_0x4e95f1[_0x3145('0x4e')])){this[_0x3145('0x18')][_0x4e95f1[_0x3145('0x34')]][_0x3145('0x55')]=_0x4e95f1[_0x3145('0x4e')];this[_0x3145('0x18')][_0x4e95f1[_0x3145('0x34')]]['lastdata']=_0x4e95f1[_0x3145('0x50')];if(_0x4e95f1[_0x3145('0x4e')]===_0x3145('0xe')&&_[_0x3145('0x56')](_0x4e95f1[_0x3145('0x50')],_0x3145('0x57'))){var _0x20f2b1=_0x4e95f1[_0x3145('0x50')][_0x3145('0x47')]('=');var _0x2a753b=_0x20f2b1[0x0][_0x3145('0x58')](/cdr\((.*)\)/);if(_0x2a753b){this[_0x3145('0x18')][_0x4e95f1[_0x3145('0x34')]][_0x2a753b[0x1]]=_0x20f2b1[0x1];}}else if(_0x4e95f1['application']==='queue'){this[_0x3145('0x18')][_0x4e95f1[_0x3145('0x34')]][_0x3145('0x59')]=_0x4e95f1[_0x3145('0x50')]['split'](',')[0x0];}}}}}catch(_0x538a60){logger['error'](_0x3145('0x5a'),_0x4e95f1[_0x3145('0x34')],util[_0x3145('0x3a')](_0x538a60,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3145('0x2e')]['syncNewState']=function(_0x583dd7){try{if(this[_0x3145('0x2f')](_0x583dd7)){logger[_0x3145('0x32')](_0x3145('0x5b'),_0x583dd7[_0x3145('0x34')],_0x583dd7['linkedid'],_0x583dd7[_0x3145('0x5c')],_0x583dd7[_0x3145('0x35')]);logger['debug'](_0x3145('0x5d'),_0x583dd7[_0x3145('0x34')],util[_0x3145('0x3a')](_0x583dd7,{'showHidden':![],'depth':null}));if(_0x583dd7[_0x3145('0x34')]!==_0x583dd7['linkedid']){if(this[_0x3145('0x18')][_0x583dd7[_0x3145('0x4d')]]){if(_0x583dd7[_0x3145('0x5e')]==='6'){if(!this[_0x3145('0x18')][_0x583dd7[_0x3145('0x4d')]][_0x3145('0x5f')]){var _0x5c444e=moment();this[_0x3145('0x18')][_0x583dd7[_0x3145('0x4d')]]['answered']=!![];this['channels'][_0x583dd7['linkedid']][_0x3145('0x60')]=_0x5c444e[_0x3145('0x40')](_0x3145('0x41'));if(this[_0x3145('0x18')][_0x583dd7[_0x3145('0x4d')]][_0x3145('0x61')]){this[_0x3145('0x18')][_0x583dd7[_0x3145('0x4d')]]['holdtime']=_0x5c444e['diff'](this[_0x3145('0x18')][_0x583dd7['linkedid']][_0x3145('0x61')],_0x3145('0x53'));}}this[_0x3145('0x18')][_0x583dd7['linkedid']]['linkedid']=_0x583dd7[_0x3145('0x34')];if(_0x583dd7[_0x3145('0x35')]!==_0x3145('0x62')){this[_0x3145('0x18')][_0x583dd7[_0x3145('0x4d')]][_0x3145('0x63')]=_0x583dd7['calleridnum'];}this[_0x3145('0x18')][_0x583dd7['linkedid']][_0x3145('0x64')]=_0x583dd7[_0x3145('0x5c')];this[_0x3145('0x18')][_0x583dd7['linkedid']][_0x3145('0x65')]=_0x583dd7[_0x3145('0x3b')];this[_0x3145('0x18')][_0x583dd7[_0x3145('0x4d')]][_0x3145('0x42')]=dispositions[_[_0x3145('0x43')](_0x583dd7['channelstate'])];if(this[_0x3145('0x46')][_0x583dd7['channel'][_0x3145('0x47')]('-')[0x0]]){this[_0x3145('0x18')][_0x583dd7['linkedid']]['UserId']=this[_0x3145('0x46')][_0x583dd7[_0x3145('0x3b')][_0x3145('0x47')]('-')[0x0]]['id'];this[_0x3145('0x18')][_0x583dd7[_0x3145('0x4d')]][_0x3145('0x66')]=this[_0x3145('0x46')][_0x583dd7['channel'][_0x3145('0x47')]('-')[0x0]][_0x3145('0x4b')];}}}}else{if(this[_0x3145('0x18')][_0x583dd7[_0x3145('0x34')]]){if(_0x583dd7['channelstate']==='6'){if(this['agents'][_0x583dd7[_0x3145('0x3b')][_0x3145('0x47')]('-')[0x0]]){this[_0x3145('0x18')][_0x583dd7['uniqueid']][_0x3145('0x67')]=this[_0x3145('0x46')][_0x583dd7[_0x3145('0x3b')][_0x3145('0x47')]('-')[0x0]]['id'];this[_0x3145('0x18')][_0x583dd7['uniqueid']][_0x3145('0x66')]=this[_0x3145('0x46')][_0x583dd7[_0x3145('0x3b')][_0x3145('0x47')]('-')[0x0]][_0x3145('0x4b')];}}}}}}catch(_0x265714){logger[_0x3145('0x2c')](_0x3145('0x68'),_0x583dd7[_0x3145('0x34')],util[_0x3145('0x3a')](_0x265714,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x3145('0x69')]=function(_0x2c9e7d,_0x2e4136){try{if(this[_0x3145('0x18')][_0x2c9e7d]){logger[_0x3145('0x32')]('[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s',_0x2c9e7d,_0x2e4136);this[_0x3145('0x18')][_0x2c9e7d][_0x3145('0x6a')]=!![];if(_[_0x3145('0x6b')](_0x2e4136,_0x3145('0x6c'))){_0x2e4136=_0x2e4136[_0x3145('0x6d')](_0x3145('0x6c'),'.WAV');}this['channels'][_0x2c9e7d][_0x3145('0x6e')]=_0x2e4136;var _0x54ddc1=_[_0x3145('0x6f')](this[_0x3145('0x18')][_0x2c9e7d][_0x3145('0x70')],{'filename':_0x2e4136});if(_[_0x3145('0x71')](_0x54ddc1)){this[_0x3145('0x18')][_0x2c9e7d][_0x3145('0x70')][_0x3145('0x72')]({'filename':_0x2e4136,'createdAt':moment()['format'](_0x3145('0x41')),'mixmonitorid':'','status':_0x3145('0x73')});}}}catch(_0x3bdd37){logger[_0x3145('0x2c')](_0x3145('0x74'),_0x2c9e7d,util[_0x3145('0x3a')](_0x3bdd37,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3145('0x2e')]['syncVarSet']=function(_0x29d0cf){try{if(this[_0x3145('0x2f')](_0x29d0cf)){logger[_0x3145('0x38')](_0x3145('0x75'),_0x29d0cf['uniqueid'],util[_0x3145('0x3a')](_0x29d0cf,{'showHidden':![],'depth':null}));if(this[_0x3145('0x18')][_0x29d0cf[_0x3145('0x34')]]&&_0x29d0cf[_0x3145('0x3b')]!=_0x3145('0x3c')){if(this[_0x3145('0x2f')](_0x29d0cf['variable'])){if(this[_0x3145('0x2f')](_0x29d0cf[_0x3145('0x76')][_0x3145('0x77')])){logger[_0x3145('0x32')](_0x3145('0x78'),_0x29d0cf['uniqueid'],_0x29d0cf[_0x3145('0x79')]);this[_0x3145('0x69')](_0x29d0cf['uniqueid'],_0x29d0cf[_0x3145('0x79')]);}else if(this[_0x3145('0x2f')](_0x29d0cf['variable'][_0x3145('0x7a')])){logger[_0x3145('0x32')](_0x3145('0x7b'),_0x29d0cf[_0x3145('0x34')],_0x29d0cf[_0x3145('0x79')]);this['channels'][_0x29d0cf[_0x3145('0x34')]][_0x3145('0x35')]=_0x29d0cf[_0x3145('0x79')];}else if(this[_0x3145('0x2f')](_0x29d0cf[_0x3145('0x76')][_0x3145('0x7c')])){logger[_0x3145('0x32')](_0x3145('0x7d'),_0x29d0cf['uniqueid'],_0x29d0cf['value']);this[_0x3145('0x18')][_0x29d0cf['uniqueid']][_0x3145('0x7e')]=_0x29d0cf['value'];}else if(this[_0x3145('0x2f')](_0x29d0cf[_0x3145('0x76')][_0x3145('0x7f')])){logger[_0x3145('0x32')](_0x3145('0x80'),_0x29d0cf[_0x3145('0x34')],_0x29d0cf[_0x3145('0x79')]);this[_0x3145('0x18')][_0x29d0cf['uniqueid']]['type']=_0x29d0cf[_0x3145('0x79')];}else if(this[_0x3145('0x2f')](_0x29d0cf['variable'][_0x3145('0x81')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s',_0x29d0cf['uniqueid'],_0x29d0cf[_0x3145('0x79')]['split'](',')[0x0]);this[_0x3145('0x18')][_0x29d0cf[_0x3145('0x34')]][_0x3145('0x59')]=_0x29d0cf[_0x3145('0x79')][_0x3145('0x47')](',')[0x0];}else if(this[_0x3145('0x2f')](_0x29d0cf[_0x3145('0x76')][_0x3145('0x82')])){logger[_0x3145('0x32')](_0x3145('0x83'),_0x29d0cf[_0x3145('0x34')],_0x29d0cf[_0x3145('0x79')]);this['channels'][_0x29d0cf[_0x3145('0x34')]][_0x3145('0x84')]=_0x29d0cf[_0x3145('0x79')];}else if(this['isNotNull'](_0x29d0cf[_0x3145('0x76')][_0x3145('0x85')])){logger['info'](_0x3145('0x86'),_0x29d0cf[_0x3145('0x34')],_0x29d0cf['value']);this[_0x3145('0x18')][_0x29d0cf['uniqueid']]['destination']=_0x29d0cf['value'];}else if(this[_0x3145('0x2f')](_0x29d0cf[_0x3145('0x76')][_0x3145('0x87')])){logger[_0x3145('0x32')](_0x3145('0x88'),_0x29d0cf[_0x3145('0x34')],_0x29d0cf[_0x3145('0x79')]);this[_0x3145('0x18')][_0x29d0cf['uniqueid']][_0x3145('0x89')]=_0x29d0cf[_0x3145('0x79')];}else if(this['isNotNull'](_0x29d0cf['variable'][_0x3145('0x8a')])){logger[_0x3145('0x32')](_0x3145('0x8b'),_0x29d0cf[_0x3145('0x34')],_0x29d0cf['value']);this['channels'][_0x29d0cf[_0x3145('0x34')]]['queue']=_0x29d0cf['value'];}else if(this[_0x3145('0x2f')](_0x29d0cf[_0x3145('0x76')]['sipcallid'])){logger[_0x3145('0x32')](_0x3145('0x8c'),_0x29d0cf['uniqueid'],_0x29d0cf[_0x3145('0x79')]);this[_0x3145('0x18')][_0x29d0cf[_0x3145('0x34')]][_0x3145('0x8d')]=_0x29d0cf[_0x3145('0x79')];}}}else if(this[_0x3145('0x2f')](_0x29d0cf[_0x3145('0x76')]['mixmonitor_filename'])){if(_0x29d0cf['value']){var _0x4295ba=path['parse'](_0x29d0cf[_0x3145('0x79')])[_0x3145('0x4b')];logger['info'](_0x3145('0x78'),_0x4295ba,_0x29d0cf[_0x3145('0x79')]);this[_0x3145('0x69')](_0x4295ba,_0x29d0cf['value']);}}else if(this[_0x3145('0x18')][_0x29d0cf[_0x3145('0x4d')]]){if(this[_0x3145('0x2f')](_0x29d0cf[_0x3145('0x76')])){if(this[_0x3145('0x2f')](_0x29d0cf[_0x3145('0x76')][_0x3145('0x8e')])){logger[_0x3145('0x32')](_0x3145('0x8c'),_0x29d0cf['linkedid'],_0x29d0cf['value']);this['channels'][_0x29d0cf[_0x3145('0x4d')]][_0x3145('0x8f')]=_0x29d0cf[_0x3145('0x79')];}}}}}catch(_0x3d3972){logger[_0x3145('0x2c')](_0x3145('0x90'),_0x29d0cf[_0x3145('0x34')],util[_0x3145('0x3a')](_0x3d3972,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3145('0x2e')][_0x3145('0x22')]=function(_0x20d126){try{if(this[_0x3145('0x2f')](_0x20d126)){logger[_0x3145('0x38')](_0x3145('0x91'),_0x20d126[_0x3145('0x34')],util[_0x3145('0x3a')](_0x20d126,{'showHidden':![],'depth':null}));if(this[_0x3145('0x18')][_0x20d126['uniqueid']]){logger[_0x3145('0x32')]('[%s][voiceCallReport][hangup]\x20reason:%s',_0x20d126[_0x3145('0x34')],_0x20d126[_0x3145('0x92')]);var _0x392cb3=moment();this[_0x3145('0x18')][_0x20d126['uniqueid']][_0x3145('0x93')]=_0x392cb3[_0x3145('0x40')](_0x3145('0x41'));this[_0x3145('0x18')][_0x20d126[_0x3145('0x34')]][_0x3145('0x52')]=_0x392cb3[_0x3145('0x94')](this[_0x3145('0x18')][_0x20d126['uniqueid']]['starttime'],_0x3145('0x53'));if(this[_0x3145('0x18')][_0x20d126[_0x3145('0x34')]][_0x3145('0x5f')]){this[_0x3145('0x18')][_0x20d126[_0x3145('0x34')]][_0x3145('0x95')]=_0x392cb3[_0x3145('0x94')](this[_0x3145('0x18')][_0x20d126[_0x3145('0x34')]][_0x3145('0x60')],_0x3145('0x53'));this[_0x3145('0x18')][_0x20d126[_0x3145('0x34')]][_0x3145('0x96')]=this['channels'][_0x20d126[_0x3145('0x34')]]['duration']-this[_0x3145('0x18')][_0x20d126[_0x3145('0x34')]][_0x3145('0x95')];}if(_0x20d126[_0x3145('0x3e')]===_0x3145('0x45')){if(this[_0x3145('0x46')][_0x20d126[_0x3145('0x3b')][_0x3145('0x47')]('-')[0x0]]){this[_0x3145('0x46')][_0x20d126['channel'][_0x3145('0x47')]('-')[0x0]]=_[_0x3145('0x97')](this[_0x3145('0x46')][_0x20d126[_0x3145('0x3b')]['split']('-')[0x0]],[_0x3145('0x48')]);logger[_0x3145('0x38')](_0x3145('0x98'),_0x20d126['uniqueid'],util['inspect']({'destaccountcode':this[_0x3145('0x46')][_0x20d126[_0x3145('0x3b')][_0x3145('0x47')]('-')[0x0]][_0x3145('0x4a')]},{'showHidden':![],'depth':null}));this[_0x3145('0x31')](util[_0x3145('0x40')](_0x3145('0x99'),this[_0x3145('0x46')][_0x20d126['channel'][_0x3145('0x47')]('-')[0x0]][_0x3145('0x4b')]),_0x3145('0x9a'),{'destaccountcode':this[_0x3145('0x46')][_0x20d126['channel']['split']('-')[0x0]]['accountcode']});}}if(_0x20d126[_0x3145('0x9b')]===_0x3145('0x9c')){this[_0x3145('0x19')][_0x20d126['uniqueid']]=this['channels'][_0x20d126[_0x3145('0x34')]];}else{if(this[_0x3145('0x18')][_0x20d126[_0x3145('0x34')]][_0x3145('0x9d')]===_0x3145('0x9e')&&this['blindTransfers'][_0x20d126[_0x3145('0x34')]]){this[_0x3145('0x18')][_0x20d126[_0x3145('0x34')]][_0x3145('0x34')]=[this[_0x3145('0x18')][_0x20d126['uniqueid']][_0x3145('0x4d')],this[_0x3145('0x18')][_0x20d126['uniqueid']]['linkedid']=this[_0x3145('0x18')][_0x20d126[_0x3145('0x34')]][_0x3145('0x34')]][0x0];delete this[_0x3145('0x19')][_0x20d126[_0x3145('0x34')]];}}logger['debug'](_0x3145('0x9f'),_0x20d126[_0x3145('0x34')],util[_0x3145('0x3a')](this['channels'][_0x20d126[_0x3145('0x34')]],{'showHidden':![],'depth':null}));ami['emit'](_0x3145('0xa0'),this[_0x3145('0x18')][_0x20d126['uniqueid']]);delete this[_0x3145('0x18')][_0x20d126[_0x3145('0x34')]];}}}catch(_0x28d8ad){logger[_0x3145('0x2c')](_0x3145('0xa1'),_0x20d126[_0x3145('0x34')],util[_0x3145('0x3a')](_0x28d8ad,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3145('0x2e')][_0x3145('0x25')]=function(_0x1fc6b9){try{if(this[_0x3145('0x2f')](_0x1fc6b9)){logger[_0x3145('0x32')]('[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s',_0x1fc6b9[_0x3145('0x34')],_0x1fc6b9[_0x3145('0xa2')],_0x1fc6b9[_0x3145('0xa3')]);logger[_0x3145('0x38')]('[%s][voiceCallReport][attendedtransfer]\x20event:',_0x1fc6b9[_0x3145('0x34')],util[_0x3145('0x3a')](_0x1fc6b9,{'showHidden':![],'depth':null}));if(this['channels'][_0x1fc6b9['transfereeuniqueid']]){this[_0x3145('0x18')][_0x1fc6b9[_0x3145('0xa4')]][_0x3145('0xa5')]=_0x1fc6b9[_0x3145('0xa2')];this['channels'][_0x1fc6b9['transfereeuniqueid']][_0x3145('0xa6')]=_0x1fc6b9[_0x3145('0xa3')];if(this[_0x3145('0x18')][_0x1fc6b9[_0x3145('0xa7')]]){var _0x58b4fd=this[_0x3145('0x18')][_0x1fc6b9[_0x3145('0xa7')]];this[_0x3145('0x18')][_0x1fc6b9['secondtransfereruniqueid']]=this[_0x3145('0x18')][_0x1fc6b9['transfereeuniqueid']];this[_0x3145('0x18')][_0x1fc6b9['transfereeuniqueid']]=_0x58b4fd;}}else if(this[_0x3145('0x18')][_0x1fc6b9[_0x3145('0xa8')]]){this[_0x3145('0x18')][_0x1fc6b9[_0x3145('0xa8')]][_0x3145('0xa5')]=_0x1fc6b9['origtransferercalleridnum'];this[_0x3145('0x18')][_0x1fc6b9['transfertargetuniqueid']]['transferconnectedlinenum']=_0x1fc6b9[_0x3145('0xa3')];if(this[_0x3145('0x18')][_0x1fc6b9['origtransfereruniqueid']]){var _0x58b4fd=this[_0x3145('0x18')][_0x1fc6b9[_0x3145('0xa9')]];this['channels'][_0x1fc6b9['origtransfereruniqueid']]=this[_0x3145('0x18')][_0x1fc6b9['transfertargetuniqueid']];this[_0x3145('0x18')][_0x1fc6b9['transfertargetuniqueid']]=_0x58b4fd;}}}}catch(_0x377f34){logger['error'](_0x3145('0xaa'),_0x1fc6b9['uniqueid'],util[_0x3145('0x3a')](_0x377f34,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3145('0x2e')][_0x3145('0x27')]=function(_0x2cbf29){try{if(this[_0x3145('0x2f')](_0x2cbf29)){logger['info'](_0x3145('0xab'),_0x2cbf29[_0x3145('0x34')],_0x2cbf29[_0x3145('0xac')],_0x2cbf29[_0x3145('0xad')]);logger[_0x3145('0x38')](_0x3145('0xae'),_0x2cbf29[_0x3145('0x34')],util[_0x3145('0x3a')](_0x2cbf29,{'showHidden':![],'depth':null}));if(this[_0x3145('0x18')][_0x2cbf29[_0x3145('0xa4')]]){this['channels'][_0x2cbf29['transfereeuniqueid']][_0x3145('0xa5')]=_0x2cbf29[_0x3145('0xac')];this['channels'][_0x2cbf29[_0x3145('0xa4')]]['transferconnectedlinenum']=_0x2cbf29[_0x3145('0xad')];this[_0x3145('0x22')]({'event':'BlindTransfer','uniqueid':_0x2cbf29[_0x3145('0xa4')],'context':_0x2cbf29[_0x3145('0x3e')],'channel':_0x2cbf29[_0x3145('0xaf')]});}}}catch(_0x1eeb26){logger[_0x3145('0x2c')](_0x3145('0xb0'),_0x2cbf29[_0x3145('0x34')],util['inspect'](_0x1eeb26,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3145('0x2e')]['syncMusicOnHoldStart']=function(_0x568292){try{if(this[_0x3145('0x2f')](_0x568292)){logger[_0x3145('0x38')](_0x3145('0xb1'),_0x568292[_0x3145('0x34')],util[_0x3145('0x3a')](_0x568292,{'showHidden':![],'depth':null}));if(this[_0x3145('0x18')][_0x568292[_0x3145('0x34')]]){if(!_['isNil'](this[_0x3145('0x18')][_0x568292[_0x3145('0x34')]]['answertime'])){this[_0x3145('0x18')][_0x568292[_0x3145('0x34')]][_0x3145('0xb2')]=moment()[_0x3145('0x40')](_0x3145('0x41'));logger['info'](_0x3145('0xb3'),_0x568292[_0x3145('0x34')],this['channels'][_0x568292['uniqueid']][_0x3145('0xb2')]);}}}}catch(_0x372146){logger[_0x3145('0x2c')](_0x3145('0xb4'),_0x568292['uniqueid'],util['inspect'](_0x372146,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncMusicOnHoldStop']=function(_0x3040eb){try{if(this[_0x3145('0x2f')](_0x3040eb)){logger[_0x3145('0x38')](_0x3145('0xb5'),_0x3040eb[_0x3145('0x34')],util[_0x3145('0x3a')](_0x3040eb,{'showHidden':![],'depth':null}));if(this[_0x3145('0x18')][_0x3040eb[_0x3145('0x34')]]){if(!_['isNil'](this[_0x3145('0x18')][_0x3040eb['uniqueid']]['mohstarttime'])){this[_0x3145('0x18')][_0x3040eb['uniqueid']][_0x3145('0xb6')]+=moment()[_0x3145('0xb7')](0x0)[_0x3145('0x94')](this[_0x3145('0x18')][_0x3040eb[_0x3145('0x34')]][_0x3145('0xb2')],_0x3145('0x53'));logger[_0x3145('0x32')](_0x3145('0xb8'),_0x3040eb[_0x3145('0x34')],this[_0x3145('0x18')][_0x3040eb['uniqueid']][_0x3145('0xb6')]);delete this[_0x3145('0x18')][_0x3040eb[_0x3145('0x34')]][_0x3145('0xb2')];}}}}catch(_0x31e2a2){logger[_0x3145('0x2c')](_0x3145('0xb9'),_0x3040eb[_0x3145('0x34')],util['inspect'](_0x31e2a2,{'showHidden':![],'depth':null}));}};module[_0x3145('0xba')]=VoiceCallReport;
\ No newline at end of file