Built motion from commit (unavailable).|2.5.4
[motion2.git] / server / services / ami / report / voiceCallReport.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x84e6=['lodash','moment','util','../../../config/environment','../ami','../model/channel','unknown','inuse','invalid','ringinuse','onhold','set','queue','agi','dial','playback','FAILED','NO\x20ANSWER','BUSY','redis','defaults','localhost','socket.io-emitter','channels','agents','coreshowchannel','syncNewExten','bind','newexten','syncNewChannel','syncNewState','varset','syncVarSet','hangup','newcallerid','syncNewCallerId','attendedtransfer','blindtransfer','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','resolve','then','actionCoreShowChannels','prototype','isNotNull','isUndefined','emit','uniqueid','linkedid','merge','pick','keys','error','inspect','channel','starttime','format','YYYY-MM-DD\x20HH:mm:ss','context','from-sip','split','exten','user:%s','user:agentconnect','accountcode','[syncNewChannel][VoiceCallReport]','OutgoingSpoolFailed','application','toLowerCase','applicationdata','duration','seconds','disposition','includes','lastdata','startsWith','cdr(','match','answered','answertime','diff','calleridnum','xcally-motion-preview','connectedlinename','calleridname','destinationchannel','channelstate','UserId','membername','name','monitor','.wav49','.WAV','monitorFilename','monitors','isNil','push','rec','variable','syncMixMonitorFilename','value','xmd-phone','xmd-callerid','callerid','xmd-queue','xmd-originatecalleridnum','originatecalleridnum','destination','xmd-callerid-preview','calleridpreview','xmcs-queue','sipcallid','mixmonitor_filename','parse','sipcalllinkedid','[syncVarSet][VoiceCallReport]','syncHangup','endtime','billableseconds','omit','destconnectedlinenum','custom:voiceCallReport','[syncHangup][VoiceCallReport]','syncAttendedTransfer','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','syncBlindTransfer','transfereecalleridnum','[syncBlindTransfer][VoiceCallReport]','mohstarttime','[syncMusicOnHoldStart][VoiceCallReport]','mohtime','milliseconds','[syncMusicOnHoldStop][VoiceCallReport]','exports','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x84e6,0x8f));var _0x684e=function(_0x5834e3,_0x420a49){_0x5834e3=_0x5834e3-0x0;var _0x54593d=_0x84e6[_0x5834e3];return _0x54593d;};'use strict';var BPromise=require(_0x684e('0x0'));var _=require(_0x684e('0x1'));var moment=require(_0x684e('0x2'));var util=require(_0x684e('0x3'));var path=require('path');var Redis=require('ioredis');var config=require(_0x684e('0x4'));var logger=require('../../../config/logger')('ami');var ami=require(_0x684e('0x5'));var Channel=require(_0x684e('0x6'));var statusDesc=[_0x684e('0x7'),'not_inuse',_0x684e('0x8'),'busy',_0x684e('0x9'),'unavailable','ringing',_0x684e('0xa'),_0x684e('0xb')];var applications=[_0x684e('0xc'),_0x684e('0xd'),_0x684e('0xe'),_0x684e('0xf'),_0x684e('0x10'),'voicemail'];var dispositions=['NO\x20ANSWER',_0x684e('0x11'),_0x684e('0x11'),'NO\x20ANSWER',_0x684e('0x12'),_0x684e('0x12'),'ANSWERED',_0x684e('0x13'),'FAILED',_0x684e('0x11'),_0x684e('0x11')];var actions={};config[_0x684e('0x14')]=_[_0x684e('0x15')](config[_0x684e('0x14')],{'host':_0x684e('0x16'),'port':0x18eb});var io=require(_0x684e('0x17'))(new Redis(config[_0x684e('0x14')]));function VoiceCallReport(_0x109281){this[_0x684e('0x18')]=_0x109281[_0x684e('0x18')];this[_0x684e('0x19')]=_0x109281[_0x684e('0x19')];ami['on'](_0x684e('0x1a'),this[_0x684e('0x1b')][_0x684e('0x1c')](this));ami['on'](_0x684e('0x1d'),this[_0x684e('0x1b')]['bind'](this));ami['on']('newchannel',this[_0x684e('0x1e')][_0x684e('0x1c')](this));ami['on']('newstate',this[_0x684e('0x1f')][_0x684e('0x1c')](this));ami['on'](_0x684e('0x20'),this[_0x684e('0x21')]['bind'](this));ami['on'](_0x684e('0x22'),this['syncHangup'][_0x684e('0x1c')](this));ami['on'](_0x684e('0x23'),this[_0x684e('0x24')][_0x684e('0x1c')](this));ami['on'](_0x684e('0x25'),this['syncAttendedTransfer'][_0x684e('0x1c')](this));ami['on'](_0x684e('0x26'),this['syncBlindTransfer']['bind'](this));ami['on']('musiconholdstart',this[_0x684e('0x27')][_0x684e('0x1c')](this));ami['on'](_0x684e('0x28'),this[_0x684e('0x29')]['bind'](this));return BPromise[_0x684e('0x2a')]()[_0x684e('0x2b')](ami[_0x684e('0x2c')]())['catch'](function(_0x245f69){console['log'](_0x245f69);});}VoiceCallReport[_0x684e('0x2d')][_0x684e('0x2e')]=function(_0x41002a){return _0x41002a!==null&&!_[_0x684e('0x2f')](_0x41002a);};VoiceCallReport[_0x684e('0x2d')][_0x684e('0x30')]=function(_0x50ee80,_0x2a3d8d,_0x4bf017){io['to'](_0x50ee80)[_0x684e('0x30')](_0x2a3d8d,_0x4bf017);};VoiceCallReport[_0x684e('0x2d')][_0x684e('0x24')]=function(_0x43fae8){try{if(this[_0x684e('0x2e')](_0x43fae8)){if(_0x43fae8[_0x684e('0x31')]===_0x43fae8[_0x684e('0x32')]){if(!_[_0x684e('0x2f')](this['channels'][_0x43fae8[_0x684e('0x31')]])){_[_0x684e('0x33')](this[_0x684e('0x18')][_0x43fae8[_0x684e('0x31')]],_[_0x684e('0x34')](_0x43fae8,_[_0x684e('0x35')](this['channels'][_0x43fae8['uniqueid']])));}}}}catch(_0x5cba48){logger[_0x684e('0x36')]('[syncNewCallerId][VoiceCallReport]',util[_0x684e('0x37')](_0x5cba48,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x684e('0x2d')][_0x684e('0x1e')]=function(_0x5e9711){try{if(this['isNotNull'](_0x5e9711)){if(_0x5e9711[_0x684e('0x31')]===_0x5e9711['linkedid']&&_0x5e9711[_0x684e('0x38')]!='OutgoingSpoolFailed'){if(_[_0x684e('0x2f')](this[_0x684e('0x18')][_0x5e9711[_0x684e('0x31')]])){this[_0x684e('0x18')][_0x5e9711['uniqueid']]=new Channel();this[_0x684e('0x18')][_0x5e9711[_0x684e('0x31')]][_0x684e('0x39')]=moment()[_0x684e('0x3a')](_0x684e('0x3b'));this['channels'][_0x5e9711[_0x684e('0x31')]]['disposition']=dispositions[_['toNumber'](_0x5e9711['channelstate'])];_[_0x684e('0x33')](this[_0x684e('0x18')][_0x5e9711[_0x684e('0x31')]],_[_0x684e('0x34')](_0x5e9711,_[_0x684e('0x35')](this[_0x684e('0x18')][_0x5e9711[_0x684e('0x31')]])));if(_0x5e9711[_0x684e('0x3c')]===_0x684e('0x3d')){if(this[_0x684e('0x19')][_0x5e9711[_0x684e('0x38')][_0x684e('0x3e')]('-')[0x0]]){this['agents'][_0x5e9711['channel'][_0x684e('0x3e')]('-')[0x0]]['destconnectedlinenum']=_0x5e9711[_0x684e('0x3f')];this[_0x684e('0x30')](util[_0x684e('0x3a')](_0x684e('0x40'),this[_0x684e('0x19')][_0x5e9711[_0x684e('0x38')]['split']('-')[0x0]]['name']),_0x684e('0x41'),{'destaccountcode':this[_0x684e('0x19')][_0x5e9711[_0x684e('0x38')][_0x684e('0x3e')]('-')[0x0]][_0x684e('0x42')],'destconnectedlinenum':_0x5e9711[_0x684e('0x3f')]});}}}}}}catch(_0x3f9b57){logger[_0x684e('0x36')](_0x684e('0x43'),util[_0x684e('0x37')](_0x3f9b57,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x684e('0x1b')]=function(_0x4dec8e){try{if(this[_0x684e('0x2e')](_0x4dec8e)){if(_0x4dec8e[_0x684e('0x31')]===_0x4dec8e[_0x684e('0x32')]&&_0x4dec8e[_0x684e('0x3f')]!='h'&&_0x4dec8e[_0x684e('0x38')]!=_0x684e('0x44')){_0x4dec8e[_0x684e('0x45')]=_0x4dec8e[_0x684e('0x45')][_0x684e('0x46')]();_0x4dec8e[_0x684e('0x47')]=(_0x4dec8e['appdata']||_0x4dec8e[_0x684e('0x47')])['toLowerCase']();if(_[_0x684e('0x2f')](this[_0x684e('0x18')][_0x4dec8e[_0x684e('0x31')]])){this['channels'][_0x4dec8e[_0x684e('0x31')]]=new Channel();this[_0x684e('0x18')][_0x4dec8e['uniqueid']][_0x684e('0x39')]=_0x4dec8e['duration']?moment()['subtract'](moment[_0x684e('0x48')](_0x4dec8e[_0x684e('0x48')])[_0x684e('0x49')](),'seconds')[_0x684e('0x3a')](_0x684e('0x3b')):moment()[_0x684e('0x3a')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x684e('0x18')][_0x4dec8e['uniqueid']][_0x684e('0x4a')]=_0x684e('0x12');}_[_0x684e('0x33')](this[_0x684e('0x18')][_0x4dec8e[_0x684e('0x31')]],_[_0x684e('0x34')](_0x4dec8e,_[_0x684e('0x35')](this['channels'][_0x4dec8e[_0x684e('0x31')]])));if(_[_0x684e('0x4b')](applications,_0x4dec8e[_0x684e('0x45')])){this[_0x684e('0x18')][_0x4dec8e[_0x684e('0x31')]]['lastapplication']=_0x4dec8e['application'];this[_0x684e('0x18')][_0x4dec8e[_0x684e('0x31')]][_0x684e('0x4c')]=_0x4dec8e['applicationdata'];if(_0x4dec8e[_0x684e('0x45')]===_0x684e('0xc')&&_[_0x684e('0x4d')](_0x4dec8e['applicationdata'],_0x684e('0x4e'))){var _0x5dac64=_0x4dec8e[_0x684e('0x47')]['split']('=');var _0x322b76=_0x5dac64[0x0][_0x684e('0x4f')](/cdr\((.*)\)/);if(_0x322b76){this['channels'][_0x4dec8e['uniqueid']][_0x322b76[0x1]]=_0x5dac64[0x1];}}else if(_0x4dec8e['application']===_0x684e('0xd')){this['channels'][_0x4dec8e[_0x684e('0x31')]]['queue']=_0x4dec8e[_0x684e('0x47')]['split'](',')[0x0];}}}}}catch(_0x47f834){logger['error']('[syncNewExten][VoiceCallReport]',util[_0x684e('0x37')](_0x47f834,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x684e('0x2d')]['syncNewState']=function(_0x39a2e2){try{if(this[_0x684e('0x2e')](_0x39a2e2)){if(_0x39a2e2[_0x684e('0x31')]!==_0x39a2e2[_0x684e('0x32')]){if(this[_0x684e('0x18')][_0x39a2e2[_0x684e('0x32')]]){if(_0x39a2e2['channelstate']==='6'){if(!this[_0x684e('0x18')][_0x39a2e2[_0x684e('0x32')]][_0x684e('0x50')]){var _0x46c2e3=moment();this['channels'][_0x39a2e2[_0x684e('0x32')]]['answered']=!![];this[_0x684e('0x18')][_0x39a2e2[_0x684e('0x32')]][_0x684e('0x51')]=_0x46c2e3['format'](_0x684e('0x3b'));if(this['channels'][_0x39a2e2[_0x684e('0x32')]][_0x684e('0x39')]){this['channels'][_0x39a2e2[_0x684e('0x32')]]['holdtime']=_0x46c2e3[_0x684e('0x52')](this['channels'][_0x39a2e2[_0x684e('0x32')]][_0x684e('0x39')],'seconds');}}this[_0x684e('0x18')][_0x39a2e2['linkedid']]['linkedid']=_0x39a2e2[_0x684e('0x31')];if(_0x39a2e2[_0x684e('0x53')]!==_0x684e('0x54')){this['channels'][_0x39a2e2['linkedid']]['connectedlinenum']=_0x39a2e2[_0x684e('0x53')];}this[_0x684e('0x18')][_0x39a2e2[_0x684e('0x32')]][_0x684e('0x55')]=_0x39a2e2[_0x684e('0x56')];this[_0x684e('0x18')][_0x39a2e2[_0x684e('0x32')]][_0x684e('0x57')]=_0x39a2e2[_0x684e('0x38')];this[_0x684e('0x18')][_0x39a2e2[_0x684e('0x32')]][_0x684e('0x4a')]=dispositions[_['toNumber'](_0x39a2e2[_0x684e('0x58')])];if(this['agents'][_0x39a2e2[_0x684e('0x38')]['split']('-')[0x0]]){this[_0x684e('0x18')][_0x39a2e2[_0x684e('0x32')]][_0x684e('0x59')]=this[_0x684e('0x19')][_0x39a2e2[_0x684e('0x38')][_0x684e('0x3e')]('-')[0x0]]['id'];this[_0x684e('0x18')][_0x39a2e2['linkedid']][_0x684e('0x5a')]=this[_0x684e('0x19')][_0x39a2e2[_0x684e('0x38')]['split']('-')[0x0]]['name'];}}}}else{if(this[_0x684e('0x18')][_0x39a2e2[_0x684e('0x31')]]){if(_0x39a2e2[_0x684e('0x58')]==='6'){if(this[_0x684e('0x19')][_0x39a2e2[_0x684e('0x38')][_0x684e('0x3e')]('-')[0x0]]){this[_0x684e('0x18')][_0x39a2e2['uniqueid']]['UserId']=this[_0x684e('0x19')][_0x39a2e2['channel'][_0x684e('0x3e')]('-')[0x0]]['id'];this[_0x684e('0x18')][_0x39a2e2[_0x684e('0x31')]][_0x684e('0x5a')]=this['agents'][_0x39a2e2[_0x684e('0x38')][_0x684e('0x3e')]('-')[0x0]][_0x684e('0x5b')];}}}}}}catch(_0x3bfa2b){logger[_0x684e('0x36')]('[syncNewState][VoiceCallReport]',util['inspect'](_0x3bfa2b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x684e('0x2d')]['syncMixMonitorFilename']=function(_0x1abeb4,_0x3463c4){if(this['channels'][_0x1abeb4]){this['channels'][_0x1abeb4][_0x684e('0x5c')]=!![];if(_['endsWith'](_0x3463c4,_0x684e('0x5d'))){_0x3463c4=_0x3463c4['replace'](_0x684e('0x5d'),_0x684e('0x5e'));}this[_0x684e('0x18')][_0x1abeb4][_0x684e('0x5f')]=_0x3463c4;var _0x2e2247=_['find'](this[_0x684e('0x18')][_0x1abeb4][_0x684e('0x60')],{'filename':_0x3463c4});if(_[_0x684e('0x61')](_0x2e2247)){this['channels'][_0x1abeb4]['monitors'][_0x684e('0x62')]({'filename':_0x3463c4,'createdAt':moment()['format'](_0x684e('0x3b')),'mixmonitorid':'','status':_0x684e('0x63')});}}};VoiceCallReport[_0x684e('0x2d')][_0x684e('0x21')]=function(_0x5b510c){try{if(this[_0x684e('0x2e')](_0x5b510c)){if(this[_0x684e('0x18')][_0x5b510c['uniqueid']]&&_0x5b510c[_0x684e('0x38')]!='OutgoingSpoolFailed'){if(this[_0x684e('0x2e')](_0x5b510c[_0x684e('0x64')])){if(this[_0x684e('0x2e')](_0x5b510c[_0x684e('0x64')]['mixmonitor_filename'])){this[_0x684e('0x65')](_0x5b510c[_0x684e('0x31')],_0x5b510c[_0x684e('0x66')]);}else if(this[_0x684e('0x2e')](_0x5b510c[_0x684e('0x64')][_0x684e('0x67')])){this['channels'][_0x5b510c['uniqueid']][_0x684e('0x53')]=_0x5b510c[_0x684e('0x66')];}else if(this['isNotNull'](_0x5b510c['variable'][_0x684e('0x68')])){this[_0x684e('0x18')][_0x5b510c[_0x684e('0x31')]][_0x684e('0x69')]=_0x5b510c[_0x684e('0x66')];}else if(this['isNotNull'](_0x5b510c[_0x684e('0x64')]['xmd-cdrtype'])){this[_0x684e('0x18')][_0x5b510c['uniqueid']]['type']=_0x5b510c['value'];}else if(this['isNotNull'](_0x5b510c[_0x684e('0x64')][_0x684e('0x6a')])){this[_0x684e('0x18')][_0x5b510c['uniqueid']][_0x684e('0xd')]=_0x5b510c[_0x684e('0x66')]['split'](',')[0x0];}else if(this[_0x684e('0x2e')](_0x5b510c[_0x684e('0x64')][_0x684e('0x6b')])){this['channels'][_0x5b510c[_0x684e('0x31')]][_0x684e('0x6c')]=_0x5b510c['value'];}else if(this[_0x684e('0x2e')](_0x5b510c[_0x684e('0x64')]['xmd-destination'])){this['channels'][_0x5b510c[_0x684e('0x31')]][_0x684e('0x6d')]=_0x5b510c[_0x684e('0x66')];}else if(this[_0x684e('0x2e')](_0x5b510c[_0x684e('0x64')][_0x684e('0x6e')])){this['channels'][_0x5b510c[_0x684e('0x31')]][_0x684e('0x6f')]=_0x5b510c[_0x684e('0x66')];}else if(this[_0x684e('0x2e')](_0x5b510c['variable'][_0x684e('0x70')])){this['channels'][_0x5b510c[_0x684e('0x31')]][_0x684e('0xd')]=_0x5b510c[_0x684e('0x66')];}else if(this[_0x684e('0x2e')](_0x5b510c[_0x684e('0x64')][_0x684e('0x71')])){this[_0x684e('0x18')][_0x5b510c[_0x684e('0x31')]]['sipcalluniqueid']=_0x5b510c[_0x684e('0x66')];}}}else if(this[_0x684e('0x2e')](_0x5b510c['variable'][_0x684e('0x72')])){if(_0x5b510c[_0x684e('0x66')]){var _0x1eae54=path[_0x684e('0x73')](_0x5b510c[_0x684e('0x66')])[_0x684e('0x5b')];this[_0x684e('0x65')](_0x1eae54,_0x5b510c[_0x684e('0x66')]);}}else if(this['channels'][_0x5b510c[_0x684e('0x32')]]){if(this[_0x684e('0x2e')](_0x5b510c[_0x684e('0x64')])){if(this[_0x684e('0x2e')](_0x5b510c['variable'][_0x684e('0x71')])){this[_0x684e('0x18')][_0x5b510c[_0x684e('0x32')]][_0x684e('0x74')]=_0x5b510c[_0x684e('0x66')];}}}}}catch(_0x2b3ea9){logger[_0x684e('0x36')](_0x684e('0x75'),util[_0x684e('0x37')](_0x2b3ea9,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x684e('0x76')]=function(_0x2a082b){try{if(this[_0x684e('0x2e')](_0x2a082b)){if(this[_0x684e('0x18')][_0x2a082b[_0x684e('0x31')]]){var _0xbdb1ef=moment();this[_0x684e('0x18')][_0x2a082b[_0x684e('0x31')]][_0x684e('0x77')]=_0xbdb1ef[_0x684e('0x3a')](_0x684e('0x3b'));this[_0x684e('0x18')][_0x2a082b[_0x684e('0x31')]][_0x684e('0x48')]=_0xbdb1ef[_0x684e('0x52')](this['channels'][_0x2a082b[_0x684e('0x31')]][_0x684e('0x39')],_0x684e('0x49'));if(this[_0x684e('0x18')][_0x2a082b['uniqueid']][_0x684e('0x50')]){this['channels'][_0x2a082b[_0x684e('0x31')]][_0x684e('0x78')]=_0xbdb1ef[_0x684e('0x52')](this[_0x684e('0x18')][_0x2a082b['uniqueid']][_0x684e('0x51')],'seconds');this[_0x684e('0x18')][_0x2a082b[_0x684e('0x31')]]['holdtime']=this[_0x684e('0x18')][_0x2a082b[_0x684e('0x31')]]['duration']-this['channels'][_0x2a082b[_0x684e('0x31')]]['billableseconds'];}if(_0x2a082b['context']===_0x684e('0x3d')){if(this['agents'][_0x2a082b[_0x684e('0x38')]['split']('-')[0x0]]){this[_0x684e('0x19')][_0x2a082b[_0x684e('0x38')][_0x684e('0x3e')]('-')[0x0]]=_[_0x684e('0x79')](this[_0x684e('0x19')][_0x2a082b[_0x684e('0x38')]['split']('-')[0x0]],[_0x684e('0x7a')]);this[_0x684e('0x30')](util[_0x684e('0x3a')]('user:%s',this[_0x684e('0x19')][_0x2a082b[_0x684e('0x38')]['split']('-')[0x0]][_0x684e('0x5b')]),'user:agentcomplete',{'destaccountcode':this[_0x684e('0x19')][_0x2a082b[_0x684e('0x38')][_0x684e('0x3e')]('-')[0x0]][_0x684e('0x42')]});}}ami[_0x684e('0x30')](_0x684e('0x7b'),this[_0x684e('0x18')][_0x2a082b['uniqueid']]);delete this['channels'][_0x2a082b[_0x684e('0x31')]];}}}catch(_0x4c51ae){logger['error'](_0x684e('0x7c'),util[_0x684e('0x37')](_0x4c51ae,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x684e('0x2d')][_0x684e('0x7d')]=function(_0x49f1bf){try{if(this['isNotNull'](_0x49f1bf)){if(this[_0x684e('0x18')][_0x49f1bf[_0x684e('0x7e')]]){this['channels'][_0x49f1bf['transfereeuniqueid']][_0x684e('0x7f')]=_0x49f1bf[_0x684e('0x80')];this['channels'][_0x49f1bf[_0x684e('0x7e')]][_0x684e('0x81')]=_0x49f1bf[_0x684e('0x82')];if(this[_0x684e('0x18')][_0x49f1bf[_0x684e('0x83')]]){var _0x4a977d=this['channels'][_0x49f1bf[_0x684e('0x83')]];this[_0x684e('0x18')][_0x49f1bf['secondtransfereruniqueid']]=this['channels'][_0x49f1bf[_0x684e('0x7e')]];this[_0x684e('0x18')][_0x49f1bf[_0x684e('0x7e')]]=_0x4a977d;}}else if(this['channels'][_0x49f1bf[_0x684e('0x84')]]){this[_0x684e('0x18')][_0x49f1bf[_0x684e('0x84')]][_0x684e('0x7f')]=_0x49f1bf[_0x684e('0x80')];this[_0x684e('0x18')][_0x49f1bf[_0x684e('0x84')]][_0x684e('0x81')]=_0x49f1bf['transfertargetcalleridnum'];if(this[_0x684e('0x18')][_0x49f1bf[_0x684e('0x85')]]){var _0x4a977d=this[_0x684e('0x18')][_0x49f1bf['origtransfereruniqueid']];this[_0x684e('0x18')][_0x49f1bf[_0x684e('0x85')]]=this[_0x684e('0x18')][_0x49f1bf[_0x684e('0x84')]];this[_0x684e('0x18')][_0x49f1bf[_0x684e('0x84')]]=_0x4a977d;}}}}catch(_0x56142d){logger[_0x684e('0x36')](_0x684e('0x86'),util['inspect'](_0x56142d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x684e('0x2d')][_0x684e('0x87')]=function(_0x3d95a1){try{if(this[_0x684e('0x2e')](_0x3d95a1)){if(this[_0x684e('0x18')][_0x3d95a1[_0x684e('0x7e')]]){this[_0x684e('0x18')][_0x3d95a1[_0x684e('0x7e')]][_0x684e('0x7f')]=_0x3d95a1[_0x684e('0x88')];this['channels'][_0x3d95a1['transfereeuniqueid']]['transferconnectedlinenum']=_0x3d95a1['extension'];this[_0x684e('0x76')]({'event':'BlindTransfer','uniqueid':_0x3d95a1[_0x684e('0x7e')],'context':_0x3d95a1[_0x684e('0x3c')],'channel':_0x3d95a1['transfererchannel']});}}}catch(_0x30301e){logger[_0x684e('0x36')](_0x684e('0x89'),util[_0x684e('0x37')](_0x30301e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x684e('0x2d')][_0x684e('0x27')]=function(_0x1e8b5e){try{if(this['isNotNull'](_0x1e8b5e)){if(this[_0x684e('0x18')][_0x1e8b5e[_0x684e('0x31')]]){if(!_['isNil'](this[_0x684e('0x18')][_0x1e8b5e['uniqueid']][_0x684e('0x51')])){this[_0x684e('0x18')][_0x1e8b5e[_0x684e('0x31')]][_0x684e('0x8a')]=moment()[_0x684e('0x3a')](_0x684e('0x3b'));}}}}catch(_0x1a7b29){logger[_0x684e('0x36')](_0x684e('0x8b'),util[_0x684e('0x37')](_0x1a7b29,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x684e('0x29')]=function(_0x2f1c7e){try{if(this[_0x684e('0x2e')](_0x2f1c7e)){if(this[_0x684e('0x18')][_0x2f1c7e['uniqueid']]){if(!_[_0x684e('0x61')](this['channels'][_0x2f1c7e[_0x684e('0x31')]][_0x684e('0x8a')])){this[_0x684e('0x18')][_0x2f1c7e[_0x684e('0x31')]][_0x684e('0x8c')]+=moment()[_0x684e('0x8d')](0x0)[_0x684e('0x52')](this[_0x684e('0x18')][_0x2f1c7e[_0x684e('0x31')]][_0x684e('0x8a')],_0x684e('0x49'));delete this[_0x684e('0x18')][_0x2f1c7e[_0x684e('0x31')]][_0x684e('0x8a')];}}}}catch(_0x4a3763){logger[_0x684e('0x36')](_0x684e('0x8e'),util[_0x684e('0x37')](_0x4a3763,{'showHidden':![],'depth':null}));}};module[_0x684e('0x8f')]=VoiceCallReport;