Built motion from commit da617fac.|2.6.6
[motion2.git] / server / services / ami / report / voiceCallReport.js
index babae42..cbf40f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5089=['sipcallid','parse','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','billableseconds','user:agentcomplete','length','transferType','resolve','undefined','isEmpty','getSettings','then','stopRecordingOnTransfer','Action','StopMixMonitor','catch','webbar:stopmonitors','event','BlindTransfer','custom:voiceCallReport','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','secondtransfereruniqueid','ATTENDED','transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid','routeid','[%s][voiceCallReport][attendedtransfer]','syncBlindTransfer','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','BLIND','transfereruniqueid','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','exports','lodash','moment','path','ioredis','../../../config/environment','../../../config/logger','ami','../model/channel','set','queue','agi','playback','voicemail','FAILED','NO\x20ANSWER','ANSWERED','BUSY','redis','socket.io-emitter','channels','agents','coreshowchannel','syncNewExten','newexten','bind','newchannel','syncNewChannel','newstate','syncNewState','varset','hangup','syncHangup','newcallerid','syncNewCallerId','syncAttendedTransfer','blindtransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','actionCoreShowChannels','error','[voiceCallReport][coreshowchannels]','inspect','prototype','isUndefined','emit','isNotNull','info','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','calleridnum','debug','[%s][voiceCallReport][newcallerid]\x20event:','linkedid','merge','pick','keys','context','from-sip','exten','xcally-motion-preview','destconnectedlinenum','connectedlinenum','format','user:%s','channel','split','name','user:agentconnect','[%s][voiceCallReport][newcallerid]','blindTransfers','YYYY-MM-DD\x20HH:mm:ss','channelstate','accountcode','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','applicationdata','appdata','startsWith','CDR(routeAlias)','starttime','duration','subtract','seconds','lastdata','cdr(','type','isNil','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','holdtime','connectedlinename','destinationchannel','disposition','toNumber','UserId','diff','membername','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','.wav49','replace','find','monitors','push','rec','[%s][voiceCallReport][mixMonitorFilename]','syncVarSet','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','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','originatecalleridnum','xmd-destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s'];(function(_0x39843f,_0x1bff74){var _0x3a01f4=function(_0x2981d5){while(--_0x2981d5){_0x39843f['push'](_0x39843f['shift']());}};_0x3a01f4(++_0x1bff74);}(_0x5089,0x1bb));var _0x9508=function(_0x4c8833,_0x14e755){_0x4c8833=_0x4c8833-0x0;var _0x30df54=_0x5089[_0x4c8833];return _0x30df54;};'use strict';var _=require(_0x9508('0x0'));var moment=require(_0x9508('0x1'));var util=require('util');var path=require(_0x9508('0x2'));var Redis=require(_0x9508('0x3'));var config=require(_0x9508('0x4'));var logger=require(_0x9508('0x5'))(_0x9508('0x6'));var ami=require('../ami');var Channel=require(_0x9508('0x7'));var RpcSetting=require('../rpc/setting');var applications=[_0x9508('0x8'),_0x9508('0x9'),_0x9508('0xa'),'dial',_0x9508('0xb'),_0x9508('0xc')];var dispositions=['NO\x20ANSWER',_0x9508('0xd'),_0x9508('0xd'),'NO\x20ANSWER',_0x9508('0xe'),'NO\x20ANSWER',_0x9508('0xf'),_0x9508('0x10'),_0x9508('0xd'),_0x9508('0xd'),_0x9508('0xd')];config[_0x9508('0x11')]=_['defaults'](config[_0x9508('0x11')],{'host':'localhost','port':0x18eb});var io=require(_0x9508('0x12'))(new Redis(config[_0x9508('0x11')]));function VoiceCallReport(_0x554c90){this[_0x9508('0x13')]=_0x554c90[_0x9508('0x13')];this[_0x9508('0x14')]=_0x554c90[_0x9508('0x14')];this['blindTransfers']={};ami['on'](_0x9508('0x15'),this[_0x9508('0x16')]['bind'](this));ami['on'](_0x9508('0x17'),this['syncNewExten'][_0x9508('0x18')](this));ami['on'](_0x9508('0x19'),this[_0x9508('0x1a')][_0x9508('0x18')](this));ami['on'](_0x9508('0x1b'),this[_0x9508('0x1c')][_0x9508('0x18')](this));ami['on'](_0x9508('0x1d'),this['syncVarSet'][_0x9508('0x18')](this));ami['on'](_0x9508('0x1e'),this[_0x9508('0x1f')][_0x9508('0x18')](this));ami['on'](_0x9508('0x20'),this[_0x9508('0x21')]['bind'](this));ami['on']('attendedtransfer',this[_0x9508('0x22')]['bind'](this));ami['on'](_0x9508('0x23'),this['syncBlindTransfer'][_0x9508('0x18')](this));ami['on'](_0x9508('0x24'),this[_0x9508('0x25')][_0x9508('0x18')](this));ami['on'](_0x9508('0x26'),this[_0x9508('0x27')][_0x9508('0x18')](this));try{logger['info']('[voiceCallReport][coreshowchannels]\x20started');ami[_0x9508('0x28')]();}catch(_0x1b70e6){logger[_0x9508('0x29')](_0x9508('0x2a'),util[_0x9508('0x2b')](_0x1b70e6,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x9508('0x2c')]['isNotNull']=function(_0x5e9a80){return _0x5e9a80!==null&&!_[_0x9508('0x2d')](_0x5e9a80);};VoiceCallReport['prototype']['emit']=function(_0x1d4500,_0x576614,_0x5db4e1){io['to'](_0x1d4500)[_0x9508('0x2e')](_0x576614,_0x5db4e1);};VoiceCallReport[_0x9508('0x2c')]['syncNewCallerId']=function(_0x49246b){try{if(this[_0x9508('0x2f')](_0x49246b)){logger[_0x9508('0x30')](_0x9508('0x31'),_0x49246b[_0x9508('0x32')],_0x49246b[_0x9508('0x33')],_0x49246b[_0x9508('0x34')]);logger[_0x9508('0x35')](_0x9508('0x36'),_0x49246b[_0x9508('0x32')],util[_0x9508('0x2b')](_0x49246b,{'showHidden':![],'depth':null}));if(_0x49246b['uniqueid']===_0x49246b[_0x9508('0x37')]){if(!_[_0x9508('0x2d')](this[_0x9508('0x13')][_0x49246b['uniqueid']])){_[_0x9508('0x38')](this[_0x9508('0x13')][_0x49246b['uniqueid']],_[_0x9508('0x39')](_0x49246b,_[_0x9508('0x3a')](this['channels'][_0x49246b[_0x9508('0x32')]])));}}if(_0x49246b[_0x9508('0x3b')]===_0x9508('0x3c')){if(this[_0x9508('0x14')][_0x49246b['channel']['split']('-')[0x0]]){if(_0x49246b[_0x9508('0x3d')]==_0x9508('0x3e')){this[_0x9508('0x14')][_0x49246b['channel']['split']('-')[0x0]][_0x9508('0x3f')]=_0x49246b[_0x9508('0x40')];this[_0x9508('0x2e')](util[_0x9508('0x41')](_0x9508('0x42'),this[_0x9508('0x14')][_0x49246b[_0x9508('0x43')][_0x9508('0x44')]('-')[0x0]][_0x9508('0x45')]),_0x9508('0x46'),{'destaccountcode':this['agents'][_0x49246b[_0x9508('0x43')][_0x9508('0x44')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x49246b[_0x9508('0x40')]});}}}}}catch(_0x42c23c){logger[_0x9508('0x29')](_0x9508('0x47'),_0x49246b[_0x9508('0x32')],util[_0x9508('0x2b')](_0x42c23c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9508('0x2c')][_0x9508('0x1a')]=function(_0xfb6676){try{if(this[_0x9508('0x2f')](_0xfb6676)){logger[_0x9508('0x35')]('[%s][voiceCallReport][newchannel]\x20event:',_0xfb6676[_0x9508('0x32')],util['inspect'](_0xfb6676,{'showHidden':![],'depth':null}));if(this[_0x9508('0x13')][_0xfb6676[_0x9508('0x32')]])return;if(_0xfb6676[_0x9508('0x43')]==='OutgoingSpoolFailed')return;if(_0xfb6676['uniqueid']!==_0xfb6676[_0x9508('0x37')]&&!this[_0x9508('0x48')][_0xfb6676[_0x9508('0x37')]])return;logger[_0x9508('0x30')]('[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s',_0xfb6676[_0x9508('0x32')],_0xfb6676['context'],_0xfb6676[_0x9508('0x3d')]);this[_0x9508('0x13')][_0xfb6676['uniqueid']]=new Channel();this[_0x9508('0x13')][_0xfb6676[_0x9508('0x32')]]['starttime']=moment()[_0x9508('0x41')](_0x9508('0x49'));this[_0x9508('0x13')][_0xfb6676[_0x9508('0x32')]]['disposition']=dispositions[_['toNumber'](_0xfb6676[_0x9508('0x4a')])];_['merge'](this[_0x9508('0x13')][_0xfb6676[_0x9508('0x32')]],_[_0x9508('0x39')](_0xfb6676,_[_0x9508('0x3a')](this['channels'][_0xfb6676['uniqueid']])));if(_0xfb6676['context']===_0x9508('0x3c')){if(this['agents'][_0xfb6676[_0x9508('0x43')]['split']('-')[0x0]]){if(_[_0x9508('0x2d')](this[_0x9508('0x14')][_0xfb6676[_0x9508('0x43')][_0x9508('0x44')]('-')[0x0]]['destconnectedlinenum'])){this[_0x9508('0x14')][_0xfb6676[_0x9508('0x43')][_0x9508('0x44')]('-')[0x0]]['destconnectedlinenum']=_0xfb6676[_0x9508('0x3d')];logger[_0x9508('0x35')]('[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:',_0xfb6676[_0x9508('0x32')],util['inspect']({'id':this[_0x9508('0x14')][_0xfb6676['channel']['split']('-')[0x0]]['id'],'destaccountcode':this[_0x9508('0x14')][_0xfb6676[_0x9508('0x43')][_0x9508('0x44')]('-')[0x0]][_0x9508('0x4b')],'destconnectedlinenum':_0xfb6676[_0x9508('0x3d')]},{'showHidden':![],'depth':null}));this[_0x9508('0x2e')](util['format'](_0x9508('0x42'),this[_0x9508('0x14')][_0xfb6676[_0x9508('0x43')]['split']('-')[0x0]][_0x9508('0x45')]),_0x9508('0x46'),{'id':this[_0x9508('0x14')][_0xfb6676[_0x9508('0x43')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0x9508('0x14')][_0xfb6676['channel'][_0x9508('0x44')]('-')[0x0]][_0x9508('0x4b')],'destconnectedlinenum':_0xfb6676['exten']});}}}}}catch(_0x436eaa){logger[_0x9508('0x29')]('[%s][voiceCallReport][newchannel]',_0xfb6676[_0x9508('0x32')],util[_0x9508('0x2b')](_0x436eaa,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x9508('0x16')]=function(_0x51e199){try{if(this[_0x9508('0x2f')](_0x51e199)){logger['debug'](_0x9508('0x4c'),_0x51e199['uniqueid'],util['inspect'](_0x51e199,{'showHidden':![],'depth':null}));if(_0x51e199['channel']==='OutgoingSpoolFailed'||_0x51e199[_0x9508('0x3d')]==='h')return;if(_0x51e199[_0x9508('0x32')]===_0x51e199[_0x9508('0x37')]||this[_0x9508('0x48')][_0x51e199[_0x9508('0x37')]]){_0x51e199[_0x9508('0x4d')]=_0x51e199[_0x9508('0x4d')][_0x9508('0x4e')]();_0x51e199[_0x9508('0x4f')]=_0x51e199['appdata']||_0x51e199[_0x9508('0x4f')];if(_0x51e199[_0x9508('0x50')]&&!_0x51e199[_0x9508('0x50')][_0x9508('0x51')](_0x9508('0x52'))&&_0x51e199['application']!=='queue'){_0x51e199[_0x9508('0x4f')]=_0x51e199['applicationdata'][_0x9508('0x4e')]();}logger[_0x9508('0x30')]('[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s',_0x51e199[_0x9508('0x32')],_0x51e199['application'],_0x51e199['applicationdata']);if(_[_0x9508('0x2d')](this[_0x9508('0x13')][_0x51e199['uniqueid']])){this[_0x9508('0x13')][_0x51e199[_0x9508('0x32')]]=new Channel();this[_0x9508('0x13')][_0x51e199[_0x9508('0x32')]][_0x9508('0x53')]=_0x51e199[_0x9508('0x54')]?moment()[_0x9508('0x55')](moment[_0x9508('0x54')](_0x51e199[_0x9508('0x54')])[_0x9508('0x56')](),_0x9508('0x56'))[_0x9508('0x41')](_0x9508('0x49')):moment()[_0x9508('0x41')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x9508('0x13')][_0x51e199[_0x9508('0x32')]]['disposition']=_0x9508('0xe');}_['merge'](this['channels'][_0x51e199[_0x9508('0x32')]],_[_0x9508('0x39')](_0x51e199,_['keys'](this[_0x9508('0x13')][_0x51e199[_0x9508('0x32')]])));if(_['includes'](applications,_0x51e199[_0x9508('0x4d')])){this[_0x9508('0x13')][_0x51e199[_0x9508('0x32')]]['lastapplication']=_0x51e199[_0x9508('0x4d')];this[_0x9508('0x13')][_0x51e199[_0x9508('0x32')]][_0x9508('0x57')]=_0x51e199[_0x9508('0x4f')];if(_0x51e199[_0x9508('0x4d')]==='set'&&_[_0x9508('0x51')](_0x51e199[_0x9508('0x4f')][_0x9508('0x4e')](),_0x9508('0x58'))){var _0x5bab99=_0x51e199[_0x9508('0x4f')]['split']('=');var _0x314a07=_0x5bab99[0x0][_0x9508('0x4e')]()['match'](/cdr\((.*)\)/);if(_0x314a07){if(_0x314a07[0x1]===_0x9508('0x59')&&!_[_0x9508('0x5a')](this['channels'][_0x51e199[_0x9508('0x32')]][_0x314a07[0x1]]))return;this[_0x9508('0x13')][_0x51e199[_0x9508('0x32')]][_0x314a07[0x1]]=_0x5bab99[0x1];}}else if(_0x51e199[_0x9508('0x4d')]==='queue'){this[_0x9508('0x13')][_0x51e199[_0x9508('0x32')]][_0x9508('0x9')]=_0x51e199[_0x9508('0x4f')][_0x9508('0x44')](',')[0x0];}}}}}catch(_0x9a59f7){logger[_0x9508('0x29')](_0x9508('0x5b'),_0x51e199['uniqueid'],util[_0x9508('0x2b')](_0x9a59f7,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9508('0x2c')][_0x9508('0x1c')]=function(_0x4fd9af){try{if(this[_0x9508('0x2f')](_0x4fd9af)){logger['info'](_0x9508('0x5c'),_0x4fd9af['uniqueid'],_0x4fd9af['linkedid'],_0x4fd9af['calleridname'],_0x4fd9af[_0x9508('0x34')]);logger[_0x9508('0x35')](_0x9508('0x5d'),_0x4fd9af['uniqueid'],util[_0x9508('0x2b')](_0x4fd9af,{'showHidden':![],'depth':null}));if(_0x4fd9af[_0x9508('0x4a')]!=='6')return;if(_0x4fd9af[_0x9508('0x32')]!==_0x4fd9af[_0x9508('0x37')]){var _0x3d066b=moment();if(this['channels'][_0x4fd9af['linkedid']]){if(!this[_0x9508('0x13')][_0x4fd9af[_0x9508('0x37')]][_0x9508('0x5e')]){this[_0x9508('0x13')][_0x4fd9af[_0x9508('0x37')]][_0x9508('0x5e')]=!![];this[_0x9508('0x13')][_0x4fd9af[_0x9508('0x37')]][_0x9508('0x5f')]=_0x3d066b[_0x9508('0x41')](_0x9508('0x49'));if(this[_0x9508('0x13')][_0x4fd9af['linkedid']]['starttime']){this[_0x9508('0x13')][_0x4fd9af['linkedid']][_0x9508('0x60')]=_0x3d066b['diff'](this['channels'][_0x4fd9af[_0x9508('0x37')]]['starttime'],'seconds');}}this[_0x9508('0x13')][_0x4fd9af[_0x9508('0x37')]][_0x9508('0x37')]=_0x4fd9af[_0x9508('0x32')];if(_0x4fd9af[_0x9508('0x34')]!==_0x9508('0x3e')){this[_0x9508('0x13')][_0x4fd9af[_0x9508('0x37')]][_0x9508('0x40')]=_0x4fd9af[_0x9508('0x34')];}this[_0x9508('0x13')][_0x4fd9af[_0x9508('0x37')]][_0x9508('0x61')]=_0x4fd9af[_0x9508('0x33')];this[_0x9508('0x13')][_0x4fd9af['linkedid']][_0x9508('0x62')]=_0x4fd9af['channel'];this[_0x9508('0x13')][_0x4fd9af[_0x9508('0x37')]][_0x9508('0x63')]=dispositions[_[_0x9508('0x64')](_0x4fd9af[_0x9508('0x4a')])];if(this[_0x9508('0x14')][_0x4fd9af[_0x9508('0x43')][_0x9508('0x44')]('-')[0x0]]){this[_0x9508('0x13')][_0x4fd9af[_0x9508('0x37')]][_0x9508('0x65')]=this[_0x9508('0x14')][_0x4fd9af['channel'][_0x9508('0x44')]('-')[0x0]]['id'];this[_0x9508('0x13')][_0x4fd9af[_0x9508('0x37')]]['membername']=this['agents'][_0x4fd9af[_0x9508('0x43')][_0x9508('0x44')]('-')[0x0]][_0x9508('0x45')];}}if(this[_0x9508('0x13')][_0x4fd9af[_0x9508('0x32')]]){if(!this[_0x9508('0x13')][_0x4fd9af[_0x9508('0x32')]]['answered']){this[_0x9508('0x13')][_0x4fd9af['uniqueid']]['answered']=!![];this[_0x9508('0x13')][_0x4fd9af['uniqueid']][_0x9508('0x5f')]=_0x3d066b[_0x9508('0x41')]('YYYY-MM-DD\x20HH:mm:ss');if(this[_0x9508('0x13')][_0x4fd9af['uniqueid']][_0x9508('0x53')]){this['channels'][_0x4fd9af[_0x9508('0x32')]][_0x9508('0x60')]=_0x3d066b[_0x9508('0x66')](this[_0x9508('0x13')][_0x4fd9af[_0x9508('0x32')]][_0x9508('0x53')],_0x9508('0x56'));}}if(_0x4fd9af[_0x9508('0x34')]!==_0x9508('0x3e')){this[_0x9508('0x13')][_0x4fd9af['uniqueid']][_0x9508('0x40')]=_0x4fd9af[_0x9508('0x34')];}this[_0x9508('0x13')][_0x4fd9af[_0x9508('0x32')]][_0x9508('0x61')]=_0x4fd9af[_0x9508('0x33')];this['channels'][_0x4fd9af['uniqueid']][_0x9508('0x62')]=_0x4fd9af[_0x9508('0x43')];this[_0x9508('0x13')][_0x4fd9af['uniqueid']]['disposition']=dispositions[_[_0x9508('0x64')](_0x4fd9af['channelstate'])];}}else{if(this[_0x9508('0x13')][_0x4fd9af[_0x9508('0x32')]]){if(this[_0x9508('0x14')][_0x4fd9af['channel'][_0x9508('0x44')]('-')[0x0]]){this[_0x9508('0x13')][_0x4fd9af[_0x9508('0x32')]][_0x9508('0x65')]=this[_0x9508('0x14')][_0x4fd9af[_0x9508('0x43')]['split']('-')[0x0]]['id'];this['channels'][_0x4fd9af[_0x9508('0x32')]][_0x9508('0x67')]=this['agents'][_0x4fd9af[_0x9508('0x43')][_0x9508('0x44')]('-')[0x0]][_0x9508('0x45')];}}}if(_0x4fd9af['context']==='from-sip'){if(this[_0x9508('0x14')][_0x4fd9af['channel'][_0x9508('0x44')]('-')[0x0]]){this[_0x9508('0x14')][_0x4fd9af[_0x9508('0x43')][_0x9508('0x44')]('-')[0x0]]['destconnectedlinenum']=_0x4fd9af[_0x9508('0x3d')];var _0x178b03,_0x598644;if(this[_0x9508('0x13')][_0x4fd9af[_0x9508('0x32')]]){_0x178b03=this[_0x9508('0x13')][_0x4fd9af['uniqueid']][_0x9508('0x68')];_0x598644=this['channels'][_0x4fd9af[_0x9508('0x32')]][_0x9508('0x9')];}else if(this[_0x9508('0x13')][_0x4fd9af[_0x9508('0x37')]]){_0x178b03=this[_0x9508('0x13')][_0x4fd9af[_0x9508('0x37')]][_0x9508('0x68')];_0x598644=this[_0x9508('0x13')][_0x4fd9af[_0x9508('0x37')]][_0x9508('0x9')];}logger[_0x9508('0x35')](_0x9508('0x69'),_0x4fd9af[_0x9508('0x32')],util[_0x9508('0x2b')]({'id':this[_0x9508('0x14')][_0x4fd9af[_0x9508('0x43')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0x9508('0x14')][_0x4fd9af['channel']['split']('-')[0x0]][_0x9508('0x4b')],'destconnectedlinenum':_0x4fd9af[_0x9508('0x3d')],'routealias':_0x178b03,'queue':_0x598644||undefined},{'showHidden':![],'depth':null}));this[_0x9508('0x2e')](util['format'](_0x9508('0x42'),this[_0x9508('0x14')][_0x4fd9af[_0x9508('0x43')][_0x9508('0x44')]('-')[0x0]][_0x9508('0x45')]),_0x9508('0x46'),{'id':this[_0x9508('0x14')][_0x4fd9af['channel'][_0x9508('0x44')]('-')[0x0]]['id'],'agentconnected':!![],'destaccountcode':this['agents'][_0x4fd9af[_0x9508('0x43')][_0x9508('0x44')]('-')[0x0]][_0x9508('0x4b')],'destconnectedlinenum':_0x4fd9af[_0x9508('0x3d')],'routealias':_0x178b03,'queue':_0x598644||undefined});}}}}catch(_0x2ae582){logger[_0x9508('0x29')](_0x9508('0x6a'),_0x4fd9af[_0x9508('0x32')],util[_0x9508('0x2b')](_0x2ae582,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x9508('0x6b')]=function(_0x53b103,_0x55900d){try{if(this[_0x9508('0x13')][_0x53b103]){logger[_0x9508('0x30')](_0x9508('0x6c'),_0x53b103,_0x55900d);this[_0x9508('0x13')][_0x53b103]['monitor']=!![];if(_['endsWith'](_0x55900d,_0x9508('0x6d'))){_0x55900d=_0x55900d[_0x9508('0x6e')](_0x9508('0x6d'),'.WAV');}this[_0x9508('0x13')][_0x53b103]['monitorFilename']=_0x55900d;var _0x4a2830=_[_0x9508('0x6f')](this['channels'][_0x53b103][_0x9508('0x70')],{'filename':_0x55900d});if(_[_0x9508('0x5a')](_0x4a2830)){this[_0x9508('0x13')][_0x53b103][_0x9508('0x70')][_0x9508('0x71')]({'filename':_0x55900d,'createdAt':moment()[_0x9508('0x41')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':_0x9508('0x72')});}}}catch(_0x2f47a3){logger['error'](_0x9508('0x73'),_0x53b103,util['inspect'](_0x2f47a3,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x9508('0x74')]=function(_0x142d81){try{if(this[_0x9508('0x2f')](_0x142d81)){logger[_0x9508('0x35')]('[%s][voiceCallReport][varset]\x20event:',_0x142d81[_0x9508('0x32')],util[_0x9508('0x2b')](_0x142d81,{'showHidden':![],'depth':null}));if(this[_0x9508('0x13')][_0x142d81[_0x9508('0x32')]]&&_0x142d81['channel']!='OutgoingSpoolFailed'){if(this['isNotNull'](_0x142d81[_0x9508('0x75')])){if(this[_0x9508('0x2f')](_0x142d81[_0x9508('0x75')][_0x9508('0x76')])){logger[_0x9508('0x30')](_0x9508('0x77'),_0x142d81[_0x9508('0x32')],_0x142d81[_0x9508('0x78')]);this[_0x9508('0x6b')](_0x142d81[_0x9508('0x32')],_0x142d81[_0x9508('0x78')]);}else if(this[_0x9508('0x2f')](_0x142d81[_0x9508('0x75')][_0x9508('0x79')])){logger['info'](_0x9508('0x7a'),_0x142d81['uniqueid'],_0x142d81[_0x9508('0x78')]);this['channels'][_0x142d81[_0x9508('0x32')]][_0x9508('0x34')]=_0x142d81[_0x9508('0x78')];}else if(this[_0x9508('0x2f')](_0x142d81[_0x9508('0x75')][_0x9508('0x7b')])){logger[_0x9508('0x30')](_0x9508('0x7c'),_0x142d81[_0x9508('0x32')],_0x142d81[_0x9508('0x78')]);this[_0x9508('0x13')][_0x142d81['uniqueid']][_0x9508('0x7d')]=_0x142d81[_0x9508('0x78')];}else if(this['isNotNull'](_0x142d81[_0x9508('0x75')]['xmd-cdrtype'])){logger[_0x9508('0x30')](_0x9508('0x7e'),_0x142d81[_0x9508('0x32')],_0x142d81[_0x9508('0x78')]);this[_0x9508('0x13')][_0x142d81[_0x9508('0x32')]]['type']=_0x142d81[_0x9508('0x78')];}else if(this['isNotNull'](_0x142d81[_0x9508('0x75')]['xmd-queue'])){logger[_0x9508('0x30')](_0x9508('0x7f'),_0x142d81[_0x9508('0x32')],_0x142d81[_0x9508('0x78')][_0x9508('0x44')](',')[0x0]);this[_0x9508('0x13')][_0x142d81[_0x9508('0x32')]][_0x9508('0x9')]=_0x142d81[_0x9508('0x78')][_0x9508('0x44')](',')[0x0];}else if(this[_0x9508('0x2f')](_0x142d81[_0x9508('0x75')][_0x9508('0x80')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x142d81[_0x9508('0x32')],_0x142d81['value']);this['channels'][_0x142d81['uniqueid']][_0x9508('0x81')]=_0x142d81[_0x9508('0x78')];}else if(this['isNotNull'](_0x142d81['variable'][_0x9508('0x82')])){logger[_0x9508('0x30')]('[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s',_0x142d81[_0x9508('0x32')],_0x142d81['value']);this[_0x9508('0x13')][_0x142d81[_0x9508('0x32')]]['destination']=_0x142d81[_0x9508('0x78')];}else if(this['isNotNull'](_0x142d81[_0x9508('0x75')][_0x9508('0x83')])){logger[_0x9508('0x30')](_0x9508('0x84'),_0x142d81['uniqueid'],_0x142d81[_0x9508('0x78')]);this['channels'][_0x142d81[_0x9508('0x32')]][_0x9508('0x85')]=_0x142d81[_0x9508('0x78')];}else if(this[_0x9508('0x2f')](_0x142d81[_0x9508('0x75')][_0x9508('0x86')])){logger[_0x9508('0x30')](_0x9508('0x87'),_0x142d81[_0x9508('0x32')],_0x142d81[_0x9508('0x78')]);this['channels'][_0x142d81['uniqueid']][_0x9508('0x9')]=_0x142d81[_0x9508('0x78')];}else if(this[_0x9508('0x2f')](_0x142d81['variable'][_0x9508('0x88')])){logger[_0x9508('0x30')]('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x142d81[_0x9508('0x32')],_0x142d81[_0x9508('0x78')]);this[_0x9508('0x13')][_0x142d81[_0x9508('0x32')]]['sipcalluniqueid']=_0x142d81[_0x9508('0x78')];}}}else if(this['isNotNull'](_0x142d81['variable']['mixmonitor_filename'])){if(_0x142d81[_0x9508('0x78')]){var _0x27fd2b=path[_0x9508('0x89')](_0x142d81[_0x9508('0x78')])[_0x9508('0x45')];logger[_0x9508('0x30')]('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x27fd2b,_0x142d81[_0x9508('0x78')]);this[_0x9508('0x6b')](_0x27fd2b,_0x142d81[_0x9508('0x78')]);}}else if(this[_0x9508('0x13')][_0x142d81[_0x9508('0x37')]]){if(this[_0x9508('0x2f')](_0x142d81['variable'])){if(this[_0x9508('0x2f')](_0x142d81['variable'][_0x9508('0x88')])){logger[_0x9508('0x30')](_0x9508('0x8a'),_0x142d81['linkedid'],_0x142d81[_0x9508('0x78')]);this['channels'][_0x142d81['linkedid']][_0x9508('0x8b')]=_0x142d81[_0x9508('0x78')];}}}}}catch(_0x537cfb){logger[_0x9508('0x29')](_0x9508('0x8c'),_0x142d81[_0x9508('0x32')],util[_0x9508('0x2b')](_0x537cfb,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9508('0x2c')][_0x9508('0x1f')]=function(_0x45fe21){try{if(this[_0x9508('0x2f')](_0x45fe21)){logger[_0x9508('0x35')](_0x9508('0x8d'),_0x45fe21[_0x9508('0x32')],util[_0x9508('0x2b')](_0x45fe21,{'showHidden':![],'depth':null}));if(this[_0x9508('0x48')][_0x45fe21[_0x9508('0x37')]]){if(this['channels'][this[_0x9508('0x48')][_0x45fe21[_0x9508('0x37')]][_0x9508('0x37')]]){this[_0x9508('0x13')][this['blindTransfers'][_0x45fe21[_0x9508('0x37')]][_0x9508('0x37')]][_0x9508('0x32')]=_0x45fe21[_0x9508('0x32')];this[_0x9508('0x13')][this[_0x9508('0x48')][_0x45fe21['linkedid']][_0x9508('0x37')]][_0x9508('0x5e')]=this[_0x9508('0x13')][_0x45fe21[_0x9508('0x32')]][_0x9508('0x5e')];this['channels'][this['blindTransfers'][_0x45fe21[_0x9508('0x37')]][_0x9508('0x37')]][_0x9508('0x5f')]=this[_0x9508('0x13')][_0x45fe21[_0x9508('0x32')]][_0x9508('0x5f')];this[_0x9508('0x13')][this['blindTransfers'][_0x45fe21[_0x9508('0x37')]]['linkedid']][_0x9508('0x62')]=this['channels'][this[_0x9508('0x48')][_0x45fe21[_0x9508('0x37')]][_0x9508('0x37')]][_0x9508('0x43')];this[_0x9508('0x13')][this[_0x9508('0x48')][_0x45fe21[_0x9508('0x37')]]['linkedid']][_0x9508('0x63')]=this[_0x9508('0x13')][_0x45fe21['uniqueid']][_0x9508('0x63')];this[_0x9508('0x13')][_0x45fe21[_0x9508('0x32')]]=this['channels'][this['blindTransfers'][_0x45fe21[_0x9508('0x37')]][_0x9508('0x37')]];delete this[_0x9508('0x13')][this['blindTransfers'][_0x45fe21['linkedid']][_0x9508('0x37')]];}else if(this[_0x9508('0x13')][this[_0x9508('0x48')][_0x45fe21[_0x9508('0x37')]][_0x9508('0x32')]]){this[_0x9508('0x13')][this[_0x9508('0x48')][_0x45fe21[_0x9508('0x37')]][_0x9508('0x32')]][_0x9508('0x32')]=[this[_0x9508('0x13')][this[_0x9508('0x48')][_0x45fe21[_0x9508('0x37')]]['uniqueid']][_0x9508('0x37')],this[_0x9508('0x13')][this['blindTransfers'][_0x45fe21[_0x9508('0x37')]][_0x9508('0x32')]][_0x9508('0x37')]=this[_0x9508('0x13')][this['blindTransfers'][_0x45fe21[_0x9508('0x37')]][_0x9508('0x32')]]['uniqueid']][0x0];this[_0x9508('0x13')][this['blindTransfers'][_0x45fe21[_0x9508('0x37')]]['uniqueid']][_0x9508('0x5e')]=this[_0x9508('0x13')][_0x45fe21[_0x9508('0x32')]][_0x9508('0x5e')];this[_0x9508('0x13')][this[_0x9508('0x48')][_0x45fe21[_0x9508('0x37')]][_0x9508('0x32')]][_0x9508('0x5f')]=this[_0x9508('0x13')][_0x45fe21[_0x9508('0x32')]][_0x9508('0x5f')];this['channels'][this[_0x9508('0x48')][_0x45fe21[_0x9508('0x37')]][_0x9508('0x32')]]['destinationchannel']=this[_0x9508('0x13')][this[_0x9508('0x48')][_0x45fe21[_0x9508('0x37')]][_0x9508('0x32')]][_0x9508('0x43')];this['channels'][this[_0x9508('0x48')][_0x45fe21[_0x9508('0x37')]][_0x9508('0x32')]]['disposition']=this['channels'][_0x45fe21[_0x9508('0x32')]][_0x9508('0x63')];this['channels'][_0x45fe21[_0x9508('0x32')]]=this[_0x9508('0x13')][this[_0x9508('0x48')][_0x45fe21['linkedid']][_0x9508('0x32')]];delete this[_0x9508('0x13')][this[_0x9508('0x48')][_0x45fe21[_0x9508('0x37')]]['uniqueid']];}}if(this['channels'][_0x45fe21['uniqueid']]){logger['info'](_0x9508('0x8e'),_0x45fe21['uniqueid'],_0x45fe21[_0x9508('0x8f')]);var _0xf7f04c=moment();this[_0x9508('0x13')][_0x45fe21[_0x9508('0x32')]][_0x9508('0x90')]=_0xf7f04c[_0x9508('0x41')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x9508('0x13')][_0x45fe21['uniqueid']][_0x9508('0x54')]=_0xf7f04c[_0x9508('0x66')](this[_0x9508('0x13')][_0x45fe21['uniqueid']]['starttime'],_0x9508('0x56'));if(this[_0x9508('0x13')][_0x45fe21['uniqueid']]['answered']){this[_0x9508('0x13')][_0x45fe21[_0x9508('0x32')]][_0x9508('0x91')]=_0xf7f04c[_0x9508('0x66')](this[_0x9508('0x13')][_0x45fe21['uniqueid']][_0x9508('0x5f')],_0x9508('0x56'));this[_0x9508('0x13')][_0x45fe21[_0x9508('0x32')]]['holdtime']=this[_0x9508('0x13')][_0x45fe21['uniqueid']][_0x9508('0x54')]-this[_0x9508('0x13')][_0x45fe21['uniqueid']][_0x9508('0x91')];}if(_0x45fe21[_0x9508('0x3b')]===_0x9508('0x3c')){if(this[_0x9508('0x14')][_0x45fe21[_0x9508('0x43')][_0x9508('0x44')]('-')[0x0]]){this[_0x9508('0x14')][_0x45fe21[_0x9508('0x43')][_0x9508('0x44')]('-')[0x0]]=_['omit'](this['agents'][_0x45fe21[_0x9508('0x43')][_0x9508('0x44')]('-')[0x0]],['destconnectedlinenum']);logger['debug']('[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:',_0x45fe21[_0x9508('0x32')],util[_0x9508('0x2b')]({'id':this[_0x9508('0x14')][_0x45fe21[_0x9508('0x43')][_0x9508('0x44')]('-')[0x0]]['id'],'destaccountcode':this[_0x9508('0x14')][_0x45fe21['channel'][_0x9508('0x44')]('-')[0x0]][_0x9508('0x4b')]},{'showHidden':![],'depth':null}));this['emit'](util[_0x9508('0x41')]('user:%s',this[_0x9508('0x14')][_0x45fe21['channel'][_0x9508('0x44')]('-')[0x0]][_0x9508('0x45')]),_0x9508('0x92'),{'id':this[_0x9508('0x14')][_0x45fe21[_0x9508('0x43')][_0x9508('0x44')]('-')[0x0]]['id'],'destaccountcode':this[_0x9508('0x14')][_0x45fe21['channel'][_0x9508('0x44')]('-')[0x0]][_0x9508('0x4b')]});for(var _0x46e577=0x0;_0x46e577<Object[_0x9508('0x3a')](this[_0x9508('0x14')])[_0x9508('0x93')];_0x46e577++){var _0x3d4d7b=Object[_0x9508('0x3a')](this['agents'])[_0x46e577];var _0xfb0e8e=this['agents'][_0x3d4d7b];if(_0xfb0e8e['accountcode']===Number(_0x45fe21[_0x9508('0x40')])){this[_0x9508('0x2e')](util[_0x9508('0x41')](_0x9508('0x42'),_0xfb0e8e['name']),_0x9508('0x92'),{'id':_0xfb0e8e['id'],'destaccountcode':_0xfb0e8e[_0x9508('0x4b')],'transfer':this[_0x9508('0x13')][_0x45fe21[_0x9508('0x32')]][_0x9508('0x94')]});break;}}}}var _0x33ffce=this;Promise[_0x9508('0x95')]()['then'](function(){var _0x5b3702=_0x33ffce[_0x9508('0x13')][_0x45fe21['uniqueid']];if(typeof _0x5b3702[_0x9508('0x94')]===_0x9508('0x96'))return;if(_[_0x9508('0x97')](_0x5b3702[_0x9508('0x70')]))return;return RpcSetting[_0x9508('0x98')]()[_0x9508('0x99')](function(_0x57ebdb){if(!_0x57ebdb[_0x9508('0x9a')])return;return Promise[_0x9508('0x95')]()[_0x9508('0x99')](function(){return ami[_0x9508('0x9b')]({'action':_0x9508('0x9c'),'channel':_0x5b3702[_0x9508('0x43')]})[_0x9508('0x9d')](function(){});})['then'](function(){return ami[_0x9508('0x9b')]({'action':_0x9508('0x9c'),'channel':_0x5b3702['destinationchannel']})[_0x9508('0x9d')](function(){})['finally'](function(){var _0x464e99=_0x33ffce['agents'][_0x5b3702[_0x9508('0x62')][_0x9508('0x44')]('-')[0x0]];if(!_0x464e99)return;io[_0x9508('0x2e')](_0x9508('0x9e'),{'agentId':_0x464e99['id'],'uniqueid':_0x5b3702[_0x9508('0x32')]});});});});})[_0x9508('0x99')](function(){if(_0x45fe21[_0x9508('0x9f')]===_0x9508('0xa0')){_0x33ffce[_0x9508('0x48')][_0x45fe21[_0x9508('0x32')]]=_0x45fe21;}else{if(_0x33ffce[_0x9508('0x13')][_0x45fe21[_0x9508('0x32')]][_0x9508('0x59')]==='outbound'&&_0x33ffce['blindTransfers'][_0x45fe21['uniqueid']]){_0x33ffce[_0x9508('0x13')][_0x45fe21[_0x9508('0x32')]]['uniqueid']=[_0x33ffce[_0x9508('0x13')][_0x45fe21['uniqueid']]['linkedid'],_0x33ffce['channels'][_0x45fe21['uniqueid']]['linkedid']=_0x33ffce[_0x9508('0x13')][_0x45fe21['uniqueid']][_0x9508('0x32')]][0x0];delete _0x33ffce[_0x9508('0x48')][_0x45fe21[_0x9508('0x32')]];}}logger['debug']('[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:',_0x45fe21[_0x9508('0x32')],util['inspect'](_0x33ffce[_0x9508('0x13')][_0x45fe21['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x9508('0x2e')](_0x9508('0xa1'),_0x33ffce[_0x9508('0x13')][_0x45fe21[_0x9508('0x32')]]);delete _0x33ffce[_0x9508('0x13')][_0x45fe21[_0x9508('0x32')]];});}}}catch(_0x42cb2b){logger[_0x9508('0x29')]('[%s][voiceCallReport][hangup]',_0x45fe21['uniqueid'],util['inspect'](_0x42cb2b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9508('0x2c')]['syncAttendedTransfer']=function(_0x25c003){try{if(this[_0x9508('0x2f')](_0x25c003)){logger[_0x9508('0x30')](_0x9508('0xa2'),_0x25c003[_0x9508('0x32')],_0x25c003[_0x9508('0xa3')],_0x25c003[_0x9508('0xa4')]);logger[_0x9508('0x35')](_0x9508('0xa5'),_0x25c003[_0x9508('0x32')],util[_0x9508('0x2b')](_0x25c003,{'showHidden':![],'depth':null}));var _0xbe8dda;if(this[_0x9508('0x13')][_0x25c003[_0x9508('0xa6')]]){this[_0x9508('0x13')][_0x25c003[_0x9508('0xa6')]][_0x9508('0xa7')]=_0x25c003[_0x9508('0xa3')];this[_0x9508('0x13')][_0x25c003[_0x9508('0xa6')]]['transferconnectedlinenum']=_0x25c003[_0x9508('0xa4')];if(this['channels'][_0x25c003['secondtransfereruniqueid']]){_0xbe8dda=this[_0x9508('0x13')][_0x25c003[_0x9508('0xa8')]];this['channels'][_0x25c003[_0x9508('0xa8')]]=this[_0x9508('0x13')][_0x25c003[_0x9508('0xa6')]];this[_0x9508('0x13')][_0x25c003[_0x9508('0xa6')]]=_0xbe8dda;}this['channels'][_0x25c003[_0x9508('0xa8')]]['transferType']=_0x9508('0xa9');}else if(this['channels'][_0x25c003[_0x9508('0xaa')]]){this[_0x9508('0x13')][_0x25c003['transfertargetuniqueid']][_0x9508('0xa7')]=_0x25c003[_0x9508('0xa3')];this['channels'][_0x25c003[_0x9508('0xaa')]]['transferconnectedlinenum']=_0x25c003['transfertargetcalleridnum'];if(this['channels'][_0x25c003[_0x9508('0xab')]]){_0xbe8dda=this[_0x9508('0x13')][_0x25c003['origtransfereruniqueid']];this[_0x9508('0x13')][_0x25c003['origtransfereruniqueid']]=this[_0x9508('0x13')][_0x25c003[_0x9508('0xaa')]];this[_0x9508('0x13')][_0x25c003[_0x9508('0xaa')]]=_0xbe8dda;}this[_0x9508('0x13')][_0x25c003[_0x9508('0xaa')]][_0x9508('0x94')]='ATTENDED';}if((this[_0x9508('0x13')][_0x25c003[_0x9508('0xab')]]||this['channels'][_0x25c003[_0x9508('0xac')]])&&this['channels'][_0x25c003[_0x9508('0xa8')]]){var _0x4f97f2=_['some']([this[_0x9508('0x13')][_0x25c003['origtransfereruniqueid']],this[_0x9508('0x13')][_0x25c003[_0x9508('0xac')]],this[_0x9508('0x13')][_0x25c003['secondtransfereruniqueid']]],function(_0x513a47){return _0x513a47&&_0x513a47[_0x9508('0x59')]==='outbound'&&_0x513a47[_0x9508('0xad')];});if(_0x4f97f2){if(this[_0x9508('0x13')][_0x25c003[_0x9508('0xab')]])this[_0x9508('0x13')][_0x25c003['origtransfereruniqueid']][_0x9508('0x94')]='ATTENDED';if(this['channels'][_0x25c003['origtransfererlinkedid']])this[_0x9508('0x13')][_0x25c003[_0x9508('0xac')]]['transferType']=_0x9508('0xa9');this['channels'][_0x25c003[_0x9508('0xa8')]]['transferType']='ATTENDED';}}}}catch(_0xafc4b4){logger[_0x9508('0x29')](_0x9508('0xae'),_0x25c003[_0x9508('0x32')],util[_0x9508('0x2b')](_0xafc4b4,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9508('0x2c')][_0x9508('0xaf')]=function(_0x29d277){try{if(this['isNotNull'](_0x29d277)){logger['info'](_0x9508('0xb0'),_0x29d277[_0x9508('0x32')],_0x29d277[_0x9508('0xb1')],_0x29d277[_0x9508('0xb2')]);logger[_0x9508('0x35')](_0x9508('0xb3'),_0x29d277['uniqueid'],util[_0x9508('0x2b')](_0x29d277,{'showHidden':![],'depth':null}));if(this[_0x9508('0x13')][_0x29d277[_0x9508('0xa6')]]){this['channels'][_0x29d277[_0x9508('0xa6')]][_0x9508('0xa7')]=_0x29d277[_0x9508('0xb1')];this[_0x9508('0x13')][_0x29d277[_0x9508('0xa6')]]['transferconnectedlinenum']=_0x29d277[_0x9508('0xb2')];this['channels'][_0x29d277[_0x9508('0xa6')]][_0x9508('0x94')]=_0x9508('0xb4');this[_0x9508('0x1f')]({'event':_0x9508('0xa0'),'uniqueid':_0x29d277[_0x9508('0xa6')],'linkedid':_0x29d277[_0x9508('0xb5')],'context':_0x29d277[_0x9508('0x3b')],'channel':_0x29d277[_0x9508('0xb6')]});}else{this[_0x9508('0x13')][_0x29d277[_0x9508('0xb5')]][_0x9508('0x94')]=_0x9508('0xb4');this[_0x9508('0x1f')]({'event':_0x9508('0xa0'),'uniqueid':_0x29d277['transfereruniqueid'],'linkedid':_0x29d277[_0x9508('0xa6')],'context':_0x29d277['context'],'channel':_0x29d277['transfererchannel']});}}}catch(_0x4fd315){logger[_0x9508('0x29')](_0x9508('0xb7'),_0x29d277[_0x9508('0x32')],util[_0x9508('0x2b')](_0x4fd315,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x9508('0x25')]=function(_0x889d0c){try{if(this[_0x9508('0x2f')](_0x889d0c)){logger['debug'](_0x9508('0xb8'),_0x889d0c['uniqueid'],util[_0x9508('0x2b')](_0x889d0c,{'showHidden':![],'depth':null}));if(this[_0x9508('0x13')][_0x889d0c['uniqueid']]){if(!_[_0x9508('0x5a')](this[_0x9508('0x13')][_0x889d0c[_0x9508('0x32')]][_0x9508('0x5f')])){this[_0x9508('0x13')][_0x889d0c['uniqueid']][_0x9508('0xb9')]=moment()['format'](_0x9508('0x49'));logger['info'](_0x9508('0xba'),_0x889d0c[_0x9508('0x32')],this[_0x9508('0x13')][_0x889d0c[_0x9508('0x32')]]['mohstarttime']);}}}}catch(_0x281e45){logger[_0x9508('0x29')](_0x9508('0xbb'),_0x889d0c[_0x9508('0x32')],util[_0x9508('0x2b')](_0x281e45,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9508('0x2c')]['syncMusicOnHoldStop']=function(_0x3c3a92){try{if(this[_0x9508('0x2f')](_0x3c3a92)){logger[_0x9508('0x35')](_0x9508('0xbc'),_0x3c3a92[_0x9508('0x32')],util[_0x9508('0x2b')](_0x3c3a92,{'showHidden':![],'depth':null}));if(this[_0x9508('0x13')][_0x3c3a92[_0x9508('0x32')]]){if(!_[_0x9508('0x5a')](this[_0x9508('0x13')][_0x3c3a92[_0x9508('0x32')]][_0x9508('0xb9')])){this[_0x9508('0x13')][_0x3c3a92[_0x9508('0x32')]][_0x9508('0xbd')]+=moment()[_0x9508('0xbe')](0x0)[_0x9508('0x66')](this['channels'][_0x3c3a92['uniqueid']][_0x9508('0xb9')],_0x9508('0x56'));logger[_0x9508('0x30')](_0x9508('0xbf'),_0x3c3a92[_0x9508('0x32')],this[_0x9508('0x13')][_0x3c3a92[_0x9508('0x32')]][_0x9508('0xbd')]);delete this[_0x9508('0x13')][_0x3c3a92[_0x9508('0x32')]][_0x9508('0xb9')];}}}}catch(_0x105b5a){logger[_0x9508('0x29')]('[%s][voiceCallReport][musiconholdstop]',_0x3c3a92[_0x9508('0x32')],util[_0x9508('0x2b')](_0x105b5a,{'showHidden':![],'depth':null}));}};module[_0x9508('0xc0')]=VoiceCallReport;
\ No newline at end of file
+var _0x2927=['[%s][voiceCallReport][newcallerid]\x20event:','linkedid','isUndefined','merge','pick','keys','context','from-sip','channel','split','exten','connectedlinenum','format','user:agentconnect','accountcode','[%s][voiceCallReport][newcallerid]','inspect','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','starttime','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','destconnectedlinenum','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','user:%s','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','application','applicationdata','appdata','startsWith','CDR(routeAlias)','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','subtract','seconds','lastapplication','lastdata','cdr(','toLowerCase','match','type','[%s][voiceCallReport][newexten]','syncNewState','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','calleridname','answered','answertime','holdtime','diff','xcally-motion-preview','destinationchannel','membername','name','connectedlinename','UserId','routealias','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','.wav49','replace','.WAV','monitorFilename','find','monitors','isNil','push','rec','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','variable','[%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','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','xmd-destination','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','mixmonitor_filename','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','endtime','billableseconds','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','length','user:agentcomplete','resolve','then','transferType','undefined','isEmpty','stopRecordingOnTransfer','Action','StopMixMonitor','catch','webbar:stopmonitors','event','BlindTransfer','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','origtransferercalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfercalleridnum','transfertargetuniqueid','origtransfereruniqueid','ATTENDED','origtransfererlinkedid','some','outbound','routeid','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','syncHangup','transfereruniqueid','transfererchannel','BLIND','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstart]','syncMusicOnHoldStop','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','[%s][voiceCallReport][musiconholdstop]','lodash','util','path','ioredis','../../../config/logger','ami','../model/channel','../rpc/setting','set','queue','dial','playback','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','defaults','socket.io-emitter','channels','agents','blindTransfers','bind','newexten','syncNewExten','newchannel','syncNewChannel','varset','syncVarSet','hangup','newcallerid','syncNewCallerId','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','musiconholdstop','info','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','error','[voiceCallReport][coreshowchannels]','isNotNull','prototype','emit','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridnum','debug'];(function(_0x3e20e9,_0x3b8184){var _0x5c6e48=function(_0xb3500b){while(--_0xb3500b){_0x3e20e9['push'](_0x3e20e9['shift']());}};_0x5c6e48(++_0x3b8184);}(_0x2927,0x99));var _0x7292=function(_0x45ea18,_0x514491){_0x45ea18=_0x45ea18-0x0;var _0x6e5309=_0x2927[_0x45ea18];return _0x6e5309;};'use strict';var _=require(_0x7292('0x0'));var moment=require('moment');var util=require(_0x7292('0x1'));var path=require(_0x7292('0x2'));var Redis=require(_0x7292('0x3'));var config=require('../../../config/environment');var logger=require(_0x7292('0x4'))(_0x7292('0x5'));var ami=require('../ami');var Channel=require(_0x7292('0x6'));var RpcSetting=require(_0x7292('0x7'));var applications=[_0x7292('0x8'),_0x7292('0x9'),'agi',_0x7292('0xa'),_0x7292('0xb'),'voicemail'];var dispositions=[_0x7292('0xc'),_0x7292('0xd'),_0x7292('0xd'),_0x7292('0xc'),'NO\x20ANSWER',_0x7292('0xc'),_0x7292('0xe'),_0x7292('0xf'),_0x7292('0xd'),_0x7292('0xd'),_0x7292('0xd')];config[_0x7292('0x10')]=_[_0x7292('0x11')](config[_0x7292('0x10')],{'host':'localhost','port':0x18eb});var io=require(_0x7292('0x12'))(new Redis(config['redis']));function VoiceCallReport(_0xab263b){this[_0x7292('0x13')]=_0xab263b['channels'];this[_0x7292('0x14')]=_0xab263b[_0x7292('0x14')];this[_0x7292('0x15')]={};ami['on']('coreshowchannel',this['syncNewExten'][_0x7292('0x16')](this));ami['on'](_0x7292('0x17'),this[_0x7292('0x18')]['bind'](this));ami['on'](_0x7292('0x19'),this[_0x7292('0x1a')][_0x7292('0x16')](this));ami['on']('newstate',this['syncNewState'][_0x7292('0x16')](this));ami['on'](_0x7292('0x1b'),this[_0x7292('0x1c')][_0x7292('0x16')](this));ami['on'](_0x7292('0x1d'),this['syncHangup']['bind'](this));ami['on'](_0x7292('0x1e'),this[_0x7292('0x1f')][_0x7292('0x16')](this));ami['on']('attendedtransfer',this[_0x7292('0x20')]['bind'](this));ami['on'](_0x7292('0x21'),this[_0x7292('0x22')][_0x7292('0x16')](this));ami['on'](_0x7292('0x23'),this['syncMusicOnHoldStart'][_0x7292('0x16')](this));ami['on'](_0x7292('0x24'),this['syncMusicOnHoldStop'][_0x7292('0x16')](this));try{logger[_0x7292('0x25')](_0x7292('0x26'));ami[_0x7292('0x27')]();}catch(_0x17ebbb){logger[_0x7292('0x28')](_0x7292('0x29'),util['inspect'](_0x17ebbb,{'showHidden':![],'depth':null}));}}VoiceCallReport['prototype'][_0x7292('0x2a')]=function(_0x831b53){return _0x831b53!==null&&!_['isUndefined'](_0x831b53);};VoiceCallReport[_0x7292('0x2b')][_0x7292('0x2c')]=function(_0xf99f7f,_0x99c726,_0x177408){io['to'](_0xf99f7f)[_0x7292('0x2c')](_0x99c726,_0x177408);};VoiceCallReport[_0x7292('0x2b')][_0x7292('0x1f')]=function(_0x3c16a9){try{if(this[_0x7292('0x2a')](_0x3c16a9)){logger[_0x7292('0x25')](_0x7292('0x2d'),_0x3c16a9[_0x7292('0x2e')],_0x3c16a9['calleridname'],_0x3c16a9[_0x7292('0x2f')]);logger[_0x7292('0x30')](_0x7292('0x31'),_0x3c16a9[_0x7292('0x2e')],util['inspect'](_0x3c16a9,{'showHidden':![],'depth':null}));if(_0x3c16a9[_0x7292('0x2e')]===_0x3c16a9[_0x7292('0x32')]){if(!_[_0x7292('0x33')](this['channels'][_0x3c16a9[_0x7292('0x2e')]])){_[_0x7292('0x34')](this['channels'][_0x3c16a9[_0x7292('0x2e')]],_[_0x7292('0x35')](_0x3c16a9,_[_0x7292('0x36')](this[_0x7292('0x13')][_0x3c16a9[_0x7292('0x2e')]])));}}if(_0x3c16a9[_0x7292('0x37')]===_0x7292('0x38')){if(this[_0x7292('0x14')][_0x3c16a9[_0x7292('0x39')][_0x7292('0x3a')]('-')[0x0]]){if(_0x3c16a9[_0x7292('0x3b')]=='xcally-motion-preview'){this[_0x7292('0x14')][_0x3c16a9[_0x7292('0x39')][_0x7292('0x3a')]('-')[0x0]]['destconnectedlinenum']=_0x3c16a9[_0x7292('0x3c')];this[_0x7292('0x2c')](util[_0x7292('0x3d')]('user:%s',this[_0x7292('0x14')][_0x3c16a9[_0x7292('0x39')][_0x7292('0x3a')]('-')[0x0]]['name']),_0x7292('0x3e'),{'destaccountcode':this['agents'][_0x3c16a9[_0x7292('0x39')][_0x7292('0x3a')]('-')[0x0]][_0x7292('0x3f')],'destconnectedlinenum':_0x3c16a9[_0x7292('0x3c')]});}}}}}catch(_0x5c2b9a){logger[_0x7292('0x28')](_0x7292('0x40'),_0x3c16a9['uniqueid'],util[_0x7292('0x41')](_0x5c2b9a,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x7292('0x1a')]=function(_0x235a75){try{if(this[_0x7292('0x2a')](_0x235a75)){logger['debug'](_0x7292('0x42'),_0x235a75[_0x7292('0x2e')],util[_0x7292('0x41')](_0x235a75,{'showHidden':![],'depth':null}));if(this[_0x7292('0x13')][_0x235a75[_0x7292('0x2e')]])return;if(_0x235a75['channel']===_0x7292('0x43'))return;if(_0x235a75['uniqueid']!==_0x235a75[_0x7292('0x32')]&&!this[_0x7292('0x15')][_0x235a75[_0x7292('0x32')]])return;logger[_0x7292('0x25')](_0x7292('0x44'),_0x235a75[_0x7292('0x2e')],_0x235a75[_0x7292('0x37')],_0x235a75['exten']);this[_0x7292('0x13')][_0x235a75[_0x7292('0x2e')]]=new Channel();this[_0x7292('0x13')][_0x235a75[_0x7292('0x2e')]][_0x7292('0x45')]=moment()[_0x7292('0x3d')](_0x7292('0x46'));this[_0x7292('0x13')][_0x235a75[_0x7292('0x2e')]][_0x7292('0x47')]=dispositions[_[_0x7292('0x48')](_0x235a75[_0x7292('0x49')])];_['merge'](this[_0x7292('0x13')][_0x235a75[_0x7292('0x2e')]],_[_0x7292('0x35')](_0x235a75,_[_0x7292('0x36')](this[_0x7292('0x13')][_0x235a75[_0x7292('0x2e')]])));if(_0x235a75[_0x7292('0x37')]==='from-sip'){if(this['agents'][_0x235a75[_0x7292('0x39')][_0x7292('0x3a')]('-')[0x0]]){if(_[_0x7292('0x33')](this[_0x7292('0x14')][_0x235a75[_0x7292('0x39')]['split']('-')[0x0]][_0x7292('0x4a')])){this[_0x7292('0x14')][_0x235a75[_0x7292('0x39')][_0x7292('0x3a')]('-')[0x0]][_0x7292('0x4a')]=_0x235a75['exten'];logger[_0x7292('0x30')](_0x7292('0x4b'),_0x235a75[_0x7292('0x2e')],util['inspect']({'id':this[_0x7292('0x14')][_0x235a75['channel'][_0x7292('0x3a')]('-')[0x0]]['id'],'destaccountcode':this[_0x7292('0x14')][_0x235a75['channel']['split']('-')[0x0]][_0x7292('0x3f')],'destconnectedlinenum':_0x235a75[_0x7292('0x3b')]},{'showHidden':![],'depth':null}));this[_0x7292('0x2c')](util[_0x7292('0x3d')](_0x7292('0x4c'),this[_0x7292('0x14')][_0x235a75[_0x7292('0x39')][_0x7292('0x3a')]('-')[0x0]]['name']),_0x7292('0x3e'),{'id':this[_0x7292('0x14')][_0x235a75['channel'][_0x7292('0x3a')]('-')[0x0]]['id'],'destaccountcode':this[_0x7292('0x14')][_0x235a75[_0x7292('0x39')][_0x7292('0x3a')]('-')[0x0]][_0x7292('0x3f')],'destconnectedlinenum':_0x235a75[_0x7292('0x3b')]});}}}}}catch(_0x1f2c43){logger[_0x7292('0x28')](_0x7292('0x4d'),_0x235a75['uniqueid'],util['inspect'](_0x1f2c43,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x7292('0x2b')][_0x7292('0x18')]=function(_0x1ad365){try{if(this[_0x7292('0x2a')](_0x1ad365)){logger[_0x7292('0x30')](_0x7292('0x4e'),_0x1ad365[_0x7292('0x2e')],util[_0x7292('0x41')](_0x1ad365,{'showHidden':![],'depth':null}));if(_0x1ad365['channel']===_0x7292('0x43')||_0x1ad365[_0x7292('0x3b')]==='h')return;if(_0x1ad365[_0x7292('0x2e')]===_0x1ad365['linkedid']||this[_0x7292('0x15')][_0x1ad365[_0x7292('0x32')]]){_0x1ad365['application']=_0x1ad365[_0x7292('0x4f')]['toLowerCase']();_0x1ad365[_0x7292('0x50')]=_0x1ad365[_0x7292('0x51')]||_0x1ad365['applicationdata'];if(_0x1ad365[_0x7292('0x51')]&&!_0x1ad365[_0x7292('0x51')][_0x7292('0x52')](_0x7292('0x53'))&&_0x1ad365[_0x7292('0x4f')]!==_0x7292('0x9')){_0x1ad365[_0x7292('0x50')]=_0x1ad365[_0x7292('0x50')]['toLowerCase']();}logger[_0x7292('0x25')](_0x7292('0x54'),_0x1ad365['uniqueid'],_0x1ad365[_0x7292('0x4f')],_0x1ad365[_0x7292('0x50')]);if(_[_0x7292('0x33')](this[_0x7292('0x13')][_0x1ad365[_0x7292('0x2e')]])){this[_0x7292('0x13')][_0x1ad365[_0x7292('0x2e')]]=new Channel();this[_0x7292('0x13')][_0x1ad365[_0x7292('0x2e')]]['starttime']=_0x1ad365[_0x7292('0x55')]?moment()[_0x7292('0x56')](moment[_0x7292('0x55')](_0x1ad365['duration'])[_0x7292('0x57')](),_0x7292('0x57'))['format'](_0x7292('0x46')):moment()[_0x7292('0x3d')](_0x7292('0x46'));this[_0x7292('0x13')][_0x1ad365[_0x7292('0x2e')]]['disposition']='NO\x20ANSWER';}_[_0x7292('0x34')](this[_0x7292('0x13')][_0x1ad365['uniqueid']],_[_0x7292('0x35')](_0x1ad365,_['keys'](this[_0x7292('0x13')][_0x1ad365[_0x7292('0x2e')]])));if(_['includes'](applications,_0x1ad365[_0x7292('0x4f')])){this[_0x7292('0x13')][_0x1ad365['uniqueid']][_0x7292('0x58')]=_0x1ad365[_0x7292('0x4f')];this['channels'][_0x1ad365[_0x7292('0x2e')]][_0x7292('0x59')]=_0x1ad365[_0x7292('0x50')];if(_0x1ad365[_0x7292('0x4f')]==='set'&&_[_0x7292('0x52')](_0x1ad365['applicationdata']['toLowerCase'](),_0x7292('0x5a'))){var _0x1e7544=_0x1ad365[_0x7292('0x50')][_0x7292('0x3a')]('=');var _0x128165=_0x1e7544[0x0][_0x7292('0x5b')]()[_0x7292('0x5c')](/cdr\((.*)\)/);if(_0x128165){if(_0x128165[0x1]===_0x7292('0x5d')&&!_['isNil'](this[_0x7292('0x13')][_0x1ad365[_0x7292('0x2e')]][_0x128165[0x1]]))return;this['channels'][_0x1ad365['uniqueid']][_0x128165[0x1]]=_0x1e7544[0x1];}}else if(_0x1ad365[_0x7292('0x4f')]==='queue'){this['channels'][_0x1ad365[_0x7292('0x2e')]][_0x7292('0x9')]=_0x1ad365[_0x7292('0x50')]['split'](',')[0x0];}}}}}catch(_0x1194a1){logger[_0x7292('0x28')](_0x7292('0x5e'),_0x1ad365[_0x7292('0x2e')],util[_0x7292('0x41')](_0x1194a1,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x7292('0x5f')]=function(_0x4c0331){try{if(this[_0x7292('0x2a')](_0x4c0331)){logger[_0x7292('0x25')](_0x7292('0x60'),_0x4c0331[_0x7292('0x2e')],_0x4c0331[_0x7292('0x32')],_0x4c0331[_0x7292('0x61')],_0x4c0331['calleridnum']);logger['debug']('[%s][voiceCallReport][newstate]\x20event:',_0x4c0331['uniqueid'],util['inspect'](_0x4c0331,{'showHidden':![],'depth':null}));if(_0x4c0331[_0x7292('0x49')]!=='6')return;if(_0x4c0331[_0x7292('0x2e')]!==_0x4c0331[_0x7292('0x32')]){var _0x3a8e99=moment();if(this['channels'][_0x4c0331[_0x7292('0x32')]]){if(!this[_0x7292('0x13')][_0x4c0331[_0x7292('0x32')]][_0x7292('0x62')]){this[_0x7292('0x13')][_0x4c0331[_0x7292('0x32')]][_0x7292('0x62')]=!![];this[_0x7292('0x13')][_0x4c0331[_0x7292('0x32')]][_0x7292('0x63')]=_0x3a8e99[_0x7292('0x3d')](_0x7292('0x46'));if(this[_0x7292('0x13')][_0x4c0331[_0x7292('0x32')]][_0x7292('0x45')]){this['channels'][_0x4c0331[_0x7292('0x32')]][_0x7292('0x64')]=_0x3a8e99[_0x7292('0x65')](this[_0x7292('0x13')][_0x4c0331['linkedid']][_0x7292('0x45')],_0x7292('0x57'));}}this[_0x7292('0x13')][_0x4c0331[_0x7292('0x32')]][_0x7292('0x32')]=_0x4c0331['uniqueid'];if(_0x4c0331['calleridnum']!==_0x7292('0x66')){this[_0x7292('0x13')][_0x4c0331[_0x7292('0x32')]][_0x7292('0x3c')]=_0x4c0331[_0x7292('0x2f')];}this[_0x7292('0x13')][_0x4c0331['linkedid']]['connectedlinename']=_0x4c0331[_0x7292('0x61')];this[_0x7292('0x13')][_0x4c0331[_0x7292('0x32')]][_0x7292('0x67')]=_0x4c0331[_0x7292('0x39')];this[_0x7292('0x13')][_0x4c0331[_0x7292('0x32')]][_0x7292('0x47')]=dispositions[_[_0x7292('0x48')](_0x4c0331['channelstate'])];if(this[_0x7292('0x14')][_0x4c0331[_0x7292('0x39')][_0x7292('0x3a')]('-')[0x0]]){this[_0x7292('0x13')][_0x4c0331[_0x7292('0x32')]]['UserId']=this[_0x7292('0x14')][_0x4c0331[_0x7292('0x39')][_0x7292('0x3a')]('-')[0x0]]['id'];this[_0x7292('0x13')][_0x4c0331[_0x7292('0x32')]][_0x7292('0x68')]=this[_0x7292('0x14')][_0x4c0331['channel'][_0x7292('0x3a')]('-')[0x0]][_0x7292('0x69')];}}if(this['channels'][_0x4c0331[_0x7292('0x2e')]]){if(!this[_0x7292('0x13')][_0x4c0331[_0x7292('0x2e')]][_0x7292('0x62')]){this[_0x7292('0x13')][_0x4c0331['uniqueid']][_0x7292('0x62')]=!![];this[_0x7292('0x13')][_0x4c0331['uniqueid']][_0x7292('0x63')]=_0x3a8e99[_0x7292('0x3d')](_0x7292('0x46'));if(this[_0x7292('0x13')][_0x4c0331[_0x7292('0x2e')]][_0x7292('0x45')]){this['channels'][_0x4c0331['uniqueid']]['holdtime']=_0x3a8e99['diff'](this[_0x7292('0x13')][_0x4c0331[_0x7292('0x2e')]][_0x7292('0x45')],_0x7292('0x57'));}}if(_0x4c0331['calleridnum']!=='xcally-motion-preview'){this[_0x7292('0x13')][_0x4c0331[_0x7292('0x2e')]][_0x7292('0x3c')]=_0x4c0331[_0x7292('0x2f')];}this[_0x7292('0x13')][_0x4c0331[_0x7292('0x2e')]][_0x7292('0x6a')]=_0x4c0331['calleridname'];this['channels'][_0x4c0331[_0x7292('0x2e')]][_0x7292('0x67')]=_0x4c0331[_0x7292('0x39')];this[_0x7292('0x13')][_0x4c0331['uniqueid']]['disposition']=dispositions[_[_0x7292('0x48')](_0x4c0331[_0x7292('0x49')])];}}else{if(this[_0x7292('0x13')][_0x4c0331[_0x7292('0x2e')]]){if(this[_0x7292('0x14')][_0x4c0331[_0x7292('0x39')][_0x7292('0x3a')]('-')[0x0]]){this[_0x7292('0x13')][_0x4c0331[_0x7292('0x2e')]][_0x7292('0x6b')]=this[_0x7292('0x14')][_0x4c0331[_0x7292('0x39')][_0x7292('0x3a')]('-')[0x0]]['id'];this[_0x7292('0x13')][_0x4c0331[_0x7292('0x2e')]]['membername']=this[_0x7292('0x14')][_0x4c0331[_0x7292('0x39')][_0x7292('0x3a')]('-')[0x0]]['name'];}}}if(_0x4c0331[_0x7292('0x37')]===_0x7292('0x38')){if(this[_0x7292('0x14')][_0x4c0331[_0x7292('0x39')][_0x7292('0x3a')]('-')[0x0]]){this[_0x7292('0x14')][_0x4c0331[_0x7292('0x39')][_0x7292('0x3a')]('-')[0x0]][_0x7292('0x4a')]=_0x4c0331[_0x7292('0x3b')];var _0x2e5ca6,_0x5ccaca;if(this[_0x7292('0x13')][_0x4c0331[_0x7292('0x2e')]]){_0x2e5ca6=this[_0x7292('0x13')][_0x4c0331['uniqueid']][_0x7292('0x6c')];_0x5ccaca=this['channels'][_0x4c0331[_0x7292('0x2e')]][_0x7292('0x9')];}else if(this['channels'][_0x4c0331['linkedid']]){_0x2e5ca6=this[_0x7292('0x13')][_0x4c0331['linkedid']][_0x7292('0x6c')];_0x5ccaca=this[_0x7292('0x13')][_0x4c0331[_0x7292('0x32')]]['queue'];}this['agents'][_0x4c0331[_0x7292('0x39')][_0x7292('0x3a')]('-')[0x0]][_0x7292('0x9')]=_0x5ccaca;this['agents'][_0x4c0331[_0x7292('0x39')][_0x7292('0x3a')]('-')[0x0]]['routealias']=_0x2e5ca6;logger['debug']('[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:',_0x4c0331[_0x7292('0x2e')],util[_0x7292('0x41')]({'id':this[_0x7292('0x14')][_0x4c0331[_0x7292('0x39')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0x7292('0x14')][_0x4c0331[_0x7292('0x39')][_0x7292('0x3a')]('-')[0x0]][_0x7292('0x3f')],'destconnectedlinenum':_0x4c0331[_0x7292('0x3b')],'routealias':_0x2e5ca6,'queue':_0x5ccaca||undefined},{'showHidden':![],'depth':null}));this[_0x7292('0x2c')](util[_0x7292('0x3d')](_0x7292('0x4c'),this[_0x7292('0x14')][_0x4c0331['channel'][_0x7292('0x3a')]('-')[0x0]][_0x7292('0x69')]),'user:agentconnect',{'id':this[_0x7292('0x14')][_0x4c0331[_0x7292('0x39')][_0x7292('0x3a')]('-')[0x0]]['id'],'agentconnected':!![],'destaccountcode':this[_0x7292('0x14')][_0x4c0331[_0x7292('0x39')]['split']('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x4c0331[_0x7292('0x3b')],'routealias':_0x2e5ca6,'queue':_0x5ccaca||undefined});}}}}catch(_0x4a96e7){logger[_0x7292('0x28')](_0x7292('0x6d'),_0x4c0331[_0x7292('0x2e')],util[_0x7292('0x41')](_0x4a96e7,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x7292('0x2b')][_0x7292('0x6e')]=function(_0x27dc01,_0x58ea3e){try{if(this['channels'][_0x27dc01]){logger[_0x7292('0x25')](_0x7292('0x6f'),_0x27dc01,_0x58ea3e);this['channels'][_0x27dc01][_0x7292('0x70')]=!![];if(_[_0x7292('0x71')](_0x58ea3e,_0x7292('0x72'))){_0x58ea3e=_0x58ea3e[_0x7292('0x73')](_0x7292('0x72'),_0x7292('0x74'));}this[_0x7292('0x13')][_0x27dc01][_0x7292('0x75')]=_0x58ea3e;var _0x16a893=_[_0x7292('0x76')](this['channels'][_0x27dc01][_0x7292('0x77')],{'filename':_0x58ea3e});if(_[_0x7292('0x78')](_0x16a893)){this[_0x7292('0x13')][_0x27dc01][_0x7292('0x77')][_0x7292('0x79')]({'filename':_0x58ea3e,'createdAt':moment()['format'](_0x7292('0x46')),'mixmonitorid':'','status':_0x7292('0x7a')});}}}catch(_0x39247b){logger[_0x7292('0x28')](_0x7292('0x7b'),_0x27dc01,util[_0x7292('0x41')](_0x39247b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x7292('0x2b')][_0x7292('0x1c')]=function(_0xf027d0){try{if(this[_0x7292('0x2a')](_0xf027d0)){logger['debug'](_0x7292('0x7c'),_0xf027d0[_0x7292('0x2e')],util['inspect'](_0xf027d0,{'showHidden':![],'depth':null}));if(this[_0x7292('0x13')][_0xf027d0[_0x7292('0x2e')]]&&_0xf027d0[_0x7292('0x39')]!=_0x7292('0x43')){if(this[_0x7292('0x2a')](_0xf027d0['variable'])){if(this['isNotNull'](_0xf027d0[_0x7292('0x7d')]['mixmonitor_filename'])){logger['info'](_0x7292('0x7e'),_0xf027d0['uniqueid'],_0xf027d0['value']);this[_0x7292('0x6e')](_0xf027d0[_0x7292('0x2e')],_0xf027d0[_0x7292('0x7f')]);}else if(this[_0x7292('0x2a')](_0xf027d0[_0x7292('0x7d')][_0x7292('0x80')])){logger['info'](_0x7292('0x81'),_0xf027d0[_0x7292('0x2e')],_0xf027d0[_0x7292('0x7f')]);this[_0x7292('0x13')][_0xf027d0['uniqueid']]['calleridnum']=_0xf027d0[_0x7292('0x7f')];}else if(this[_0x7292('0x2a')](_0xf027d0['variable'][_0x7292('0x82')])){logger[_0x7292('0x25')](_0x7292('0x83'),_0xf027d0[_0x7292('0x2e')],_0xf027d0[_0x7292('0x7f')]);this[_0x7292('0x13')][_0xf027d0[_0x7292('0x2e')]][_0x7292('0x84')]=_0xf027d0['value'];}else if(this['isNotNull'](_0xf027d0[_0x7292('0x7d')][_0x7292('0x85')])){logger[_0x7292('0x25')](_0x7292('0x86'),_0xf027d0['uniqueid'],_0xf027d0[_0x7292('0x7f')]);this[_0x7292('0x13')][_0xf027d0[_0x7292('0x2e')]][_0x7292('0x5d')]=_0xf027d0[_0x7292('0x7f')];}else if(this['isNotNull'](_0xf027d0[_0x7292('0x7d')][_0x7292('0x87')])){logger[_0x7292('0x25')](_0x7292('0x88'),_0xf027d0[_0x7292('0x2e')],_0xf027d0[_0x7292('0x7f')]['split'](',')[0x0]);this[_0x7292('0x13')][_0xf027d0['uniqueid']][_0x7292('0x9')]=_0xf027d0[_0x7292('0x7f')][_0x7292('0x3a')](',')[0x0];}else if(this[_0x7292('0x2a')](_0xf027d0[_0x7292('0x7d')][_0x7292('0x89')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0xf027d0[_0x7292('0x2e')],_0xf027d0['value']);this[_0x7292('0x13')][_0xf027d0[_0x7292('0x2e')]]['originatecalleridnum']=_0xf027d0[_0x7292('0x7f')];}else if(this[_0x7292('0x2a')](_0xf027d0['variable'][_0x7292('0x8a')])){logger[_0x7292('0x25')]('[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s',_0xf027d0[_0x7292('0x2e')],_0xf027d0[_0x7292('0x7f')]);this['channels'][_0xf027d0[_0x7292('0x2e')]][_0x7292('0x8b')]=_0xf027d0[_0x7292('0x7f')];}else if(this[_0x7292('0x2a')](_0xf027d0[_0x7292('0x7d')][_0x7292('0x8c')])){logger[_0x7292('0x25')](_0x7292('0x8d'),_0xf027d0[_0x7292('0x2e')],_0xf027d0['value']);this[_0x7292('0x13')][_0xf027d0[_0x7292('0x2e')]][_0x7292('0x8e')]=_0xf027d0['value'];}else if(this[_0x7292('0x2a')](_0xf027d0[_0x7292('0x7d')]['xmcs-queue'])){logger[_0x7292('0x25')](_0x7292('0x8f'),_0xf027d0[_0x7292('0x2e')],_0xf027d0['value']);this['channels'][_0xf027d0['uniqueid']][_0x7292('0x9')]=_0xf027d0['value'];}else if(this[_0x7292('0x2a')](_0xf027d0['variable'][_0x7292('0x90')])){logger[_0x7292('0x25')](_0x7292('0x91'),_0xf027d0[_0x7292('0x2e')],_0xf027d0[_0x7292('0x7f')]);this['channels'][_0xf027d0[_0x7292('0x2e')]][_0x7292('0x92')]=_0xf027d0[_0x7292('0x7f')];}}}else if(this[_0x7292('0x2a')](_0xf027d0['variable'][_0x7292('0x93')])){if(_0xf027d0['value']){var _0x13a58a=path['parse'](_0xf027d0[_0x7292('0x7f')])[_0x7292('0x69')];logger[_0x7292('0x25')](_0x7292('0x7e'),_0x13a58a,_0xf027d0[_0x7292('0x7f')]);this['syncMixMonitorFilename'](_0x13a58a,_0xf027d0[_0x7292('0x7f')]);}}else if(this[_0x7292('0x13')][_0xf027d0[_0x7292('0x32')]]){if(this['isNotNull'](_0xf027d0[_0x7292('0x7d')])){if(this[_0x7292('0x2a')](_0xf027d0[_0x7292('0x7d')]['sipcallid'])){logger[_0x7292('0x25')](_0x7292('0x91'),_0xf027d0['linkedid'],_0xf027d0[_0x7292('0x7f')]);this[_0x7292('0x13')][_0xf027d0['linkedid']]['sipcalllinkedid']=_0xf027d0[_0x7292('0x7f')];}}}}}catch(_0x1d3199){logger[_0x7292('0x28')](_0x7292('0x94'),_0xf027d0[_0x7292('0x2e')],util[_0x7292('0x41')](_0x1d3199,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x7292('0x2b')]['syncHangup']=function(_0x2d40ab){try{if(this[_0x7292('0x2a')](_0x2d40ab)){logger['debug'](_0x7292('0x95'),_0x2d40ab['uniqueid'],util['inspect'](_0x2d40ab,{'showHidden':![],'depth':null}));if(this['blindTransfers'][_0x2d40ab['linkedid']]){if(this[_0x7292('0x13')][this[_0x7292('0x15')][_0x2d40ab[_0x7292('0x32')]][_0x7292('0x32')]]){this[_0x7292('0x13')][this[_0x7292('0x15')][_0x2d40ab[_0x7292('0x32')]][_0x7292('0x32')]]['uniqueid']=_0x2d40ab[_0x7292('0x2e')];this[_0x7292('0x13')][this[_0x7292('0x15')][_0x2d40ab['linkedid']]['linkedid']][_0x7292('0x62')]=this[_0x7292('0x13')][_0x2d40ab['uniqueid']][_0x7292('0x62')];this['channels'][this[_0x7292('0x15')][_0x2d40ab[_0x7292('0x32')]][_0x7292('0x32')]][_0x7292('0x63')]=this[_0x7292('0x13')][_0x2d40ab['uniqueid']]['answertime'];this[_0x7292('0x13')][this[_0x7292('0x15')][_0x2d40ab['linkedid']][_0x7292('0x32')]][_0x7292('0x67')]=this[_0x7292('0x13')][this[_0x7292('0x15')][_0x2d40ab[_0x7292('0x32')]]['linkedid']]['channel'];this[_0x7292('0x13')][this[_0x7292('0x15')][_0x2d40ab[_0x7292('0x32')]][_0x7292('0x32')]][_0x7292('0x47')]=this['channels'][_0x2d40ab[_0x7292('0x2e')]][_0x7292('0x47')];this['channels'][_0x2d40ab[_0x7292('0x2e')]]=this[_0x7292('0x13')][this[_0x7292('0x15')][_0x2d40ab['linkedid']]['linkedid']];delete this[_0x7292('0x13')][this[_0x7292('0x15')][_0x2d40ab[_0x7292('0x32')]]['linkedid']];}else if(this['channels'][this['blindTransfers'][_0x2d40ab[_0x7292('0x32')]][_0x7292('0x2e')]]){this['channels'][this[_0x7292('0x15')][_0x2d40ab[_0x7292('0x32')]][_0x7292('0x2e')]]['uniqueid']=[this[_0x7292('0x13')][this[_0x7292('0x15')][_0x2d40ab['linkedid']][_0x7292('0x2e')]][_0x7292('0x32')],this[_0x7292('0x13')][this[_0x7292('0x15')][_0x2d40ab['linkedid']]['uniqueid']]['linkedid']=this[_0x7292('0x13')][this[_0x7292('0x15')][_0x2d40ab[_0x7292('0x32')]][_0x7292('0x2e')]][_0x7292('0x2e')]][0x0];this[_0x7292('0x13')][this[_0x7292('0x15')][_0x2d40ab['linkedid']][_0x7292('0x2e')]][_0x7292('0x62')]=this[_0x7292('0x13')][_0x2d40ab[_0x7292('0x2e')]][_0x7292('0x62')];this[_0x7292('0x13')][this[_0x7292('0x15')][_0x2d40ab[_0x7292('0x32')]][_0x7292('0x2e')]]['answertime']=this[_0x7292('0x13')][_0x2d40ab[_0x7292('0x2e')]][_0x7292('0x63')];this[_0x7292('0x13')][this[_0x7292('0x15')][_0x2d40ab[_0x7292('0x32')]]['uniqueid']][_0x7292('0x67')]=this['channels'][this[_0x7292('0x15')][_0x2d40ab['linkedid']][_0x7292('0x2e')]][_0x7292('0x39')];this['channels'][this[_0x7292('0x15')][_0x2d40ab[_0x7292('0x32')]]['uniqueid']][_0x7292('0x47')]=this[_0x7292('0x13')][_0x2d40ab['uniqueid']][_0x7292('0x47')];this[_0x7292('0x13')][_0x2d40ab[_0x7292('0x2e')]]=this[_0x7292('0x13')][this[_0x7292('0x15')][_0x2d40ab[_0x7292('0x32')]]['uniqueid']];delete this[_0x7292('0x13')][this[_0x7292('0x15')][_0x2d40ab[_0x7292('0x32')]][_0x7292('0x2e')]];}}if(this[_0x7292('0x13')][_0x2d40ab[_0x7292('0x2e')]]){logger['info'](_0x7292('0x96'),_0x2d40ab[_0x7292('0x2e')],_0x2d40ab['cause-txt']);var _0x158639=moment();this[_0x7292('0x13')][_0x2d40ab[_0x7292('0x2e')]][_0x7292('0x97')]=_0x158639[_0x7292('0x3d')](_0x7292('0x46'));this[_0x7292('0x13')][_0x2d40ab[_0x7292('0x2e')]][_0x7292('0x55')]=_0x158639[_0x7292('0x65')](this[_0x7292('0x13')][_0x2d40ab[_0x7292('0x2e')]]['starttime'],'seconds');if(this['channels'][_0x2d40ab['uniqueid']][_0x7292('0x62')]){this['channels'][_0x2d40ab[_0x7292('0x2e')]][_0x7292('0x98')]=_0x158639[_0x7292('0x65')](this[_0x7292('0x13')][_0x2d40ab[_0x7292('0x2e')]]['answertime'],_0x7292('0x57'));this[_0x7292('0x13')][_0x2d40ab[_0x7292('0x2e')]]['holdtime']=this[_0x7292('0x13')][_0x2d40ab[_0x7292('0x2e')]][_0x7292('0x55')]-this['channels'][_0x2d40ab[_0x7292('0x2e')]][_0x7292('0x98')];}if(_0x2d40ab['context']===_0x7292('0x38')){if(this[_0x7292('0x14')][_0x2d40ab[_0x7292('0x39')][_0x7292('0x3a')]('-')[0x0]]){this[_0x7292('0x14')][_0x2d40ab[_0x7292('0x39')][_0x7292('0x3a')]('-')[0x0]]=_[_0x7292('0x99')](this['agents'][_0x2d40ab[_0x7292('0x39')][_0x7292('0x3a')]('-')[0x0]],['destconnectedlinenum']);logger[_0x7292('0x30')](_0x7292('0x9a'),_0x2d40ab['uniqueid'],util[_0x7292('0x41')]({'id':this[_0x7292('0x14')][_0x2d40ab[_0x7292('0x39')][_0x7292('0x3a')]('-')[0x0]]['id'],'destaccountcode':this[_0x7292('0x14')][_0x2d40ab['channel']['split']('-')[0x0]][_0x7292('0x3f')]},{'showHidden':![],'depth':null}));this[_0x7292('0x2c')](util['format']('user:%s',this[_0x7292('0x14')][_0x2d40ab[_0x7292('0x39')][_0x7292('0x3a')]('-')[0x0]][_0x7292('0x69')]),'user:agentcomplete',{'id':this[_0x7292('0x14')][_0x2d40ab['channel'][_0x7292('0x3a')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x2d40ab[_0x7292('0x39')][_0x7292('0x3a')]('-')[0x0]][_0x7292('0x3f')]});for(var _0x1212f8=0x0;_0x1212f8<Object[_0x7292('0x36')](this['agents'])[_0x7292('0x9b')];_0x1212f8++){var _0x31c618=Object[_0x7292('0x36')](this['agents'])[_0x1212f8];var _0x5ebc7e=this[_0x7292('0x14')][_0x31c618];if(_0x5ebc7e[_0x7292('0x3f')]===Number(_0x2d40ab[_0x7292('0x3c')])){this[_0x7292('0x2c')](util[_0x7292('0x3d')](_0x7292('0x4c'),_0x5ebc7e[_0x7292('0x69')]),_0x7292('0x9c'),{'id':_0x5ebc7e['id'],'destaccountcode':_0x5ebc7e[_0x7292('0x3f')],'transfer':this[_0x7292('0x13')][_0x2d40ab[_0x7292('0x2e')]]['transferType']});break;}}}}var _0x252326=this;Promise[_0x7292('0x9d')]()[_0x7292('0x9e')](function(){var _0x1d246f=_0x252326[_0x7292('0x13')][_0x2d40ab['uniqueid']];if(typeof _0x1d246f[_0x7292('0x9f')]===_0x7292('0xa0'))return;if(_[_0x7292('0xa1')](_0x1d246f[_0x7292('0x77')]))return;return RpcSetting['getSettings']()[_0x7292('0x9e')](function(_0x583e38){if(!_0x583e38[_0x7292('0xa2')])return;return Promise[_0x7292('0x9d')]()[_0x7292('0x9e')](function(){return ami[_0x7292('0xa3')]({'action':_0x7292('0xa4'),'channel':_0x1d246f[_0x7292('0x39')]})[_0x7292('0xa5')](function(){});})['then'](function(){return ami[_0x7292('0xa3')]({'action':'StopMixMonitor','channel':_0x1d246f['destinationchannel']})[_0x7292('0xa5')](function(){})['finally'](function(){var _0x3a0e83=_0x252326[_0x7292('0x14')][_0x1d246f['destinationchannel'][_0x7292('0x3a')]('-')[0x0]];if(!_0x3a0e83)return;io['emit'](_0x7292('0xa6'),{'agentId':_0x3a0e83['id'],'uniqueid':_0x1d246f['uniqueid']});});});});})[_0x7292('0x9e')](function(){if(_0x2d40ab[_0x7292('0xa7')]===_0x7292('0xa8')){_0x252326[_0x7292('0x15')][_0x2d40ab[_0x7292('0x2e')]]=_0x2d40ab;}else{if(_0x252326[_0x7292('0x13')][_0x2d40ab[_0x7292('0x2e')]][_0x7292('0x5d')]==='outbound'&&_0x252326[_0x7292('0x15')][_0x2d40ab[_0x7292('0x2e')]]){_0x252326[_0x7292('0x13')][_0x2d40ab['uniqueid']][_0x7292('0x2e')]=[_0x252326[_0x7292('0x13')][_0x2d40ab[_0x7292('0x2e')]]['linkedid'],_0x252326[_0x7292('0x13')][_0x2d40ab[_0x7292('0x2e')]][_0x7292('0x32')]=_0x252326[_0x7292('0x13')][_0x2d40ab[_0x7292('0x2e')]]['uniqueid']][0x0];delete _0x252326['blindTransfers'][_0x2d40ab[_0x7292('0x2e')]];}}logger[_0x7292('0x30')](_0x7292('0xa9'),_0x2d40ab[_0x7292('0x2e')],util['inspect'](_0x252326['channels'][_0x2d40ab['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x7292('0x2c')](_0x7292('0xaa'),_0x252326[_0x7292('0x13')][_0x2d40ab[_0x7292('0x2e')]]);delete _0x252326[_0x7292('0x13')][_0x2d40ab[_0x7292('0x2e')]];});}}}catch(_0x147390){logger['error']('[%s][voiceCallReport][hangup]',_0x2d40ab[_0x7292('0x2e')],util[_0x7292('0x41')](_0x147390,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x7292('0x2b')][_0x7292('0x20')]=function(_0x646268){try{if(this['isNotNull'](_0x646268)){logger['info']('[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s',_0x646268[_0x7292('0x2e')],_0x646268[_0x7292('0xab')],_0x646268['transfertargetcalleridnum']);logger[_0x7292('0x30')](_0x7292('0xac'),_0x646268[_0x7292('0x2e')],util[_0x7292('0x41')](_0x646268,{'showHidden':![],'depth':null}));var _0x2f3f9a;if(this[_0x7292('0x13')][_0x646268[_0x7292('0xad')]]){this[_0x7292('0x13')][_0x646268[_0x7292('0xad')]]['transfercalleridnum']=_0x646268['origtransferercalleridnum'];this[_0x7292('0x13')][_0x646268[_0x7292('0xad')]][_0x7292('0xae')]=_0x646268[_0x7292('0xaf')];if(this[_0x7292('0x13')][_0x646268[_0x7292('0xb0')]]){_0x2f3f9a=this[_0x7292('0x13')][_0x646268[_0x7292('0xb0')]];this[_0x7292('0x13')][_0x646268[_0x7292('0xb0')]]=this[_0x7292('0x13')][_0x646268[_0x7292('0xad')]];this[_0x7292('0x13')][_0x646268[_0x7292('0xad')]]=_0x2f3f9a;}this[_0x7292('0x13')][_0x646268[_0x7292('0xb0')]][_0x7292('0x9f')]='ATTENDED';}else if(this[_0x7292('0x13')][_0x646268['transfertargetuniqueid']]){this[_0x7292('0x13')][_0x646268['transfertargetuniqueid']][_0x7292('0xb1')]=_0x646268[_0x7292('0xab')];this[_0x7292('0x13')][_0x646268[_0x7292('0xb2')]][_0x7292('0xae')]=_0x646268[_0x7292('0xaf')];if(this[_0x7292('0x13')][_0x646268[_0x7292('0xb3')]]){_0x2f3f9a=this[_0x7292('0x13')][_0x646268[_0x7292('0xb3')]];this[_0x7292('0x13')][_0x646268['origtransfereruniqueid']]=this[_0x7292('0x13')][_0x646268[_0x7292('0xb2')]];this[_0x7292('0x13')][_0x646268['transfertargetuniqueid']]=_0x2f3f9a;}this[_0x7292('0x13')][_0x646268['transfertargetuniqueid']][_0x7292('0x9f')]=_0x7292('0xb4');}if((this['channels'][_0x646268['origtransfereruniqueid']]||this[_0x7292('0x13')][_0x646268[_0x7292('0xb5')]])&&this[_0x7292('0x13')][_0x646268[_0x7292('0xb0')]]){var _0x2296bb=_[_0x7292('0xb6')]([this[_0x7292('0x13')][_0x646268[_0x7292('0xb3')]],this[_0x7292('0x13')][_0x646268[_0x7292('0xb5')]],this[_0x7292('0x13')][_0x646268['secondtransfereruniqueid']]],function(_0x4da84e){return _0x4da84e&&_0x4da84e[_0x7292('0x5d')]===_0x7292('0xb7')&&_0x4da84e[_0x7292('0xb8')];});if(_0x2296bb){if(this[_0x7292('0x13')][_0x646268[_0x7292('0xb3')]])this[_0x7292('0x13')][_0x646268['origtransfereruniqueid']][_0x7292('0x9f')]='ATTENDED';if(this[_0x7292('0x13')][_0x646268[_0x7292('0xb5')]])this[_0x7292('0x13')][_0x646268['origtransfererlinkedid']][_0x7292('0x9f')]=_0x7292('0xb4');this[_0x7292('0x13')][_0x646268[_0x7292('0xb0')]][_0x7292('0x9f')]=_0x7292('0xb4');}}}}catch(_0x262fb0){logger[_0x7292('0x28')]('[%s][voiceCallReport][attendedtransfer]',_0x646268[_0x7292('0x2e')],util[_0x7292('0x41')](_0x262fb0,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x7292('0x2b')][_0x7292('0x22')]=function(_0x3accf0){try{if(this[_0x7292('0x2a')](_0x3accf0)){logger[_0x7292('0x25')](_0x7292('0xb9'),_0x3accf0['uniqueid'],_0x3accf0[_0x7292('0xba')],_0x3accf0[_0x7292('0xbb')]);logger[_0x7292('0x30')](_0x7292('0xbc'),_0x3accf0['uniqueid'],util['inspect'](_0x3accf0,{'showHidden':![],'depth':null}));if(this['channels'][_0x3accf0['transfereeuniqueid']]){this['channels'][_0x3accf0['transfereeuniqueid']]['transfercalleridnum']=_0x3accf0[_0x7292('0xba')];this['channels'][_0x3accf0[_0x7292('0xad')]][_0x7292('0xae')]=_0x3accf0[_0x7292('0xbb')];this[_0x7292('0x13')][_0x3accf0[_0x7292('0xad')]][_0x7292('0x9f')]='BLIND';this[_0x7292('0xbd')]({'event':_0x7292('0xa8'),'uniqueid':_0x3accf0[_0x7292('0xad')],'linkedid':_0x3accf0[_0x7292('0xbe')],'context':_0x3accf0[_0x7292('0x37')],'channel':_0x3accf0[_0x7292('0xbf')]});}else{this['channels'][_0x3accf0[_0x7292('0xbe')]]['transferType']=_0x7292('0xc0');this[_0x7292('0xbd')]({'event':_0x7292('0xa8'),'uniqueid':_0x3accf0[_0x7292('0xbe')],'linkedid':_0x3accf0[_0x7292('0xad')],'context':_0x3accf0[_0x7292('0x37')],'channel':_0x3accf0[_0x7292('0xbf')]});}}}catch(_0x391508){logger['error'](_0x7292('0xc1'),_0x3accf0[_0x7292('0x2e')],util[_0x7292('0x41')](_0x391508,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x7292('0x2b')]['syncMusicOnHoldStart']=function(_0x53d21a){try{if(this['isNotNull'](_0x53d21a)){logger[_0x7292('0x30')](_0x7292('0xc2'),_0x53d21a[_0x7292('0x2e')],util[_0x7292('0x41')](_0x53d21a,{'showHidden':![],'depth':null}));if(this[_0x7292('0x13')][_0x53d21a[_0x7292('0x2e')]]){if(!_['isNil'](this[_0x7292('0x13')][_0x53d21a[_0x7292('0x2e')]][_0x7292('0x63')])){this[_0x7292('0x13')][_0x53d21a['uniqueid']]['mohstarttime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');logger[_0x7292('0x25')]('[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s',_0x53d21a[_0x7292('0x2e')],this['channels'][_0x53d21a['uniqueid']][_0x7292('0xc3')]);}}}}catch(_0xb25606){logger[_0x7292('0x28')](_0x7292('0xc4'),_0x53d21a[_0x7292('0x2e')],util[_0x7292('0x41')](_0xb25606,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x7292('0xc5')]=function(_0x231f06){try{if(this['isNotNull'](_0x231f06)){logger[_0x7292('0x30')](_0x7292('0xc6'),_0x231f06[_0x7292('0x2e')],util[_0x7292('0x41')](_0x231f06,{'showHidden':![],'depth':null}));if(this[_0x7292('0x13')][_0x231f06[_0x7292('0x2e')]]){if(!_['isNil'](this['channels'][_0x231f06[_0x7292('0x2e')]][_0x7292('0xc3')])){this['channels'][_0x231f06[_0x7292('0x2e')]][_0x7292('0xc7')]+=moment()['milliseconds'](0x0)[_0x7292('0x65')](this[_0x7292('0x13')][_0x231f06[_0x7292('0x2e')]][_0x7292('0xc3')],'seconds');logger[_0x7292('0x25')](_0x7292('0xc8'),_0x231f06['uniqueid'],this[_0x7292('0x13')][_0x231f06[_0x7292('0x2e')]][_0x7292('0xc7')]);delete this[_0x7292('0x13')][_0x231f06[_0x7292('0x2e')]][_0x7292('0xc3')];}}}}catch(_0x4e283e){logger[_0x7292('0x28')](_0x7292('0xc9'),_0x231f06[_0x7292('0x2e')],util[_0x7292('0x41')](_0x4e283e,{'showHidden':![],'depth':null}));}};module['exports']=VoiceCallReport;
\ No newline at end of file