Built motion from commit (unavailable).|2.4.18
[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 _0xe105=['format','disposition','toNumber','channelstate','context','destconnectedlinenum','user:%s','split','name','accountcode','exten','[syncNewChannel][VoiceCallReport]','application','toLowerCase','applicationdata','appdata','starttime','duration','seconds','YYYY-MM-DD\x20HH:mm:ss','pick','lastdata','startsWith','cdr(','match','answered','answertime','holdtime','diff','xcally-motion-preview','connectedlinenum','calleridnum','connectedlinename','calleridname','destinationchannel','UserId','membername','[syncNewState][VoiceCallReport]','syncMixMonitorFilename','monitor','endsWith','replace','.WAV','monitorFilename','find','monitors','isNil','push','syncVarSet','variable','mixmonitor_filename','value','xmd-phone','xmd-callerid','callerid','xmd-cdrtype','type','xmd-queue','xmd-originatecalleridnum','originatecalleridnum','xmd-destination','destination','xmd-callerid-preview','calleridpreview','xmcs-queue','sipcallid','sipcalluniqueid','parse','error','[syncVarSet][VoiceCallReport]','endtime','billableseconds','omit','user:agentcomplete','custom:voiceCallReport','[syncHangup][VoiceCallReport]','transfereeuniqueid','origtransferercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','transfercalleridnum','transfertargetcalleridnum','origtransfereruniqueid','syncBlindTransfer','extension','BlindTransfer','transfererchannel','[syncBlindTransfer][VoiceCallReport]','mohstarttime','[syncMusicOnHoldStart][VoiceCallReport]','mohtime','bluebird','ioredis','../../../config/environment','../../../config/logger','ami','../model/channel','unknown','inuse','unavailable','ringing','set','queue','agi','playback','voicemail','FAILED','NO\x20ANSWER','ANSWERED','redis','defaults','localhost','channels','agents','coreshowchannel','syncNewExten','bind','newexten','newchannel','syncNewState','varset','hangup','syncHangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','resolve','catch','log','prototype','isNotNull','isUndefined','emit','uniqueid','linkedid','merge','keys','[syncNewCallerId][VoiceCallReport]','inspect','syncNewChannel','channel','OutgoingSpoolFailed'];(function(_0x3746a8,_0x46b6f7){var _0x2eb07f=function(_0x451d33){while(--_0x451d33){_0x3746a8['push'](_0x3746a8['shift']());}};_0x2eb07f(++_0x46b6f7);}(_0xe105,0xef));var _0x5e10=function(_0x5cc1b4,_0x8ae0ce){_0x5cc1b4=_0x5cc1b4-0x0;var _0x161174=_0xe105[_0x5cc1b4];return _0x161174;};'use strict';var BPromise=require(_0x5e10('0x0'));var _=require('lodash');var moment=require('moment');var util=require('util');var path=require('path');var Redis=require(_0x5e10('0x1'));var config=require(_0x5e10('0x2'));var logger=require(_0x5e10('0x3'))(_0x5e10('0x4'));var ami=require('../ami');var Channel=require(_0x5e10('0x5'));var statusDesc=[_0x5e10('0x6'),'not_inuse',_0x5e10('0x7'),'busy','invalid',_0x5e10('0x8'),_0x5e10('0x9'),'ringinuse','onhold'];var applications=[_0x5e10('0xa'),_0x5e10('0xb'),_0x5e10('0xc'),'dial',_0x5e10('0xd'),_0x5e10('0xe')];var dispositions=['NO\x20ANSWER',_0x5e10('0xf'),_0x5e10('0xf'),_0x5e10('0x10'),_0x5e10('0x10'),'NO\x20ANSWER',_0x5e10('0x11'),'BUSY',_0x5e10('0xf'),_0x5e10('0xf'),_0x5e10('0xf')];var actions={};config[_0x5e10('0x12')]=_[_0x5e10('0x13')](config[_0x5e10('0x12')],{'host':_0x5e10('0x14'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5e10('0x12')]));function VoiceCallReport(_0xdcd3c){this[_0x5e10('0x15')]=_0xdcd3c[_0x5e10('0x15')];this[_0x5e10('0x16')]=_0xdcd3c['agents'];ami['on'](_0x5e10('0x17'),this[_0x5e10('0x18')][_0x5e10('0x19')](this));ami['on'](_0x5e10('0x1a'),this[_0x5e10('0x18')][_0x5e10('0x19')](this));ami['on'](_0x5e10('0x1b'),this['syncNewChannel'][_0x5e10('0x19')](this));ami['on']('newstate',this[_0x5e10('0x1c')][_0x5e10('0x19')](this));ami['on'](_0x5e10('0x1d'),this['syncVarSet'][_0x5e10('0x19')](this));ami['on'](_0x5e10('0x1e'),this[_0x5e10('0x1f')][_0x5e10('0x19')](this));ami['on'](_0x5e10('0x20'),this[_0x5e10('0x21')][_0x5e10('0x19')](this));ami['on'](_0x5e10('0x22'),this[_0x5e10('0x23')][_0x5e10('0x19')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0x5e10('0x19')](this));ami['on']('musiconholdstart',this[_0x5e10('0x24')][_0x5e10('0x19')](this));ami['on'](_0x5e10('0x25'),this[_0x5e10('0x26')][_0x5e10('0x19')](this));return BPromise[_0x5e10('0x27')]()['then'](ami['actionCoreShowChannels']())[_0x5e10('0x28')](function(_0x5161a6){console[_0x5e10('0x29')](_0x5161a6);});}VoiceCallReport[_0x5e10('0x2a')][_0x5e10('0x2b')]=function(_0x1a69b8){return _0x1a69b8!==null&&!_[_0x5e10('0x2c')](_0x1a69b8);};VoiceCallReport['prototype']['emit']=function(_0x3f7f85,_0xb14be0,_0x4f0b2){io['to'](_0x3f7f85)[_0x5e10('0x2d')](_0xb14be0,_0x4f0b2);};VoiceCallReport[_0x5e10('0x2a')][_0x5e10('0x21')]=function(_0x4281c1){try{if(this[_0x5e10('0x2b')](_0x4281c1)){if(_0x4281c1[_0x5e10('0x2e')]===_0x4281c1[_0x5e10('0x2f')]){if(!_[_0x5e10('0x2c')](this[_0x5e10('0x15')][_0x4281c1[_0x5e10('0x2e')]])){_[_0x5e10('0x30')](this[_0x5e10('0x15')][_0x4281c1[_0x5e10('0x2e')]],_['pick'](_0x4281c1,_[_0x5e10('0x31')](this[_0x5e10('0x15')][_0x4281c1[_0x5e10('0x2e')]])));}}}}catch(_0x35536c){logger['error'](_0x5e10('0x32'),util[_0x5e10('0x33')](_0x35536c,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x5e10('0x34')]=function(_0x5d76e9){try{if(this['isNotNull'](_0x5d76e9)){if(_0x5d76e9['uniqueid']===_0x5d76e9[_0x5e10('0x2f')]&&_0x5d76e9[_0x5e10('0x35')]!=_0x5e10('0x36')){if(_[_0x5e10('0x2c')](this[_0x5e10('0x15')][_0x5d76e9[_0x5e10('0x2e')]])){this[_0x5e10('0x15')][_0x5d76e9['uniqueid']]=new Channel();this[_0x5e10('0x15')][_0x5d76e9[_0x5e10('0x2e')]]['starttime']=moment()[_0x5e10('0x37')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x5e10('0x15')][_0x5d76e9[_0x5e10('0x2e')]][_0x5e10('0x38')]=dispositions[_[_0x5e10('0x39')](_0x5d76e9[_0x5e10('0x3a')])];_[_0x5e10('0x30')](this['channels'][_0x5d76e9['uniqueid']],_['pick'](_0x5d76e9,_[_0x5e10('0x31')](this['channels'][_0x5d76e9[_0x5e10('0x2e')]])));if(_0x5d76e9[_0x5e10('0x3b')]==='from-sip'){if(this[_0x5e10('0x16')][_0x5d76e9[_0x5e10('0x35')]['split']('-')[0x0]]){this[_0x5e10('0x16')][_0x5d76e9[_0x5e10('0x35')]['split']('-')[0x0]][_0x5e10('0x3c')]=_0x5d76e9['exten'];this[_0x5e10('0x2d')](util[_0x5e10('0x37')](_0x5e10('0x3d'),this[_0x5e10('0x16')][_0x5d76e9[_0x5e10('0x35')][_0x5e10('0x3e')]('-')[0x0]][_0x5e10('0x3f')]),'user:agentconnect',{'destaccountcode':this[_0x5e10('0x16')][_0x5d76e9[_0x5e10('0x35')][_0x5e10('0x3e')]('-')[0x0]][_0x5e10('0x40')],'destconnectedlinenum':_0x5d76e9[_0x5e10('0x41')]});}}}}}}catch(_0x1f94ae){logger['error'](_0x5e10('0x42'),util[_0x5e10('0x33')](_0x1f94ae,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x5e10('0x18')]=function(_0x147e98){try{if(this[_0x5e10('0x2b')](_0x147e98)){if(_0x147e98[_0x5e10('0x2e')]===_0x147e98[_0x5e10('0x2f')]&&_0x147e98['exten']!='h'&&_0x147e98[_0x5e10('0x35')]!=_0x5e10('0x36')){_0x147e98[_0x5e10('0x43')]=_0x147e98['application'][_0x5e10('0x44')]();_0x147e98[_0x5e10('0x45')]=(_0x147e98[_0x5e10('0x46')]||_0x147e98[_0x5e10('0x45')])[_0x5e10('0x44')]();if(_[_0x5e10('0x2c')](this[_0x5e10('0x15')][_0x147e98['uniqueid']])){this[_0x5e10('0x15')][_0x147e98['uniqueid']]=new Channel();this['channels'][_0x147e98['uniqueid']][_0x5e10('0x47')]=_0x147e98[_0x5e10('0x48')]?moment()['subtract'](moment[_0x5e10('0x48')](_0x147e98[_0x5e10('0x48')])[_0x5e10('0x49')](),_0x5e10('0x49'))[_0x5e10('0x37')](_0x5e10('0x4a')):moment()[_0x5e10('0x37')](_0x5e10('0x4a'));this['channels'][_0x147e98['uniqueid']][_0x5e10('0x38')]=_0x5e10('0x10');}_[_0x5e10('0x30')](this['channels'][_0x147e98[_0x5e10('0x2e')]],_[_0x5e10('0x4b')](_0x147e98,_[_0x5e10('0x31')](this[_0x5e10('0x15')][_0x147e98[_0x5e10('0x2e')]])));if(_['includes'](applications,_0x147e98[_0x5e10('0x43')])){this[_0x5e10('0x15')][_0x147e98['uniqueid']]['lastapplication']=_0x147e98[_0x5e10('0x43')];this[_0x5e10('0x15')][_0x147e98[_0x5e10('0x2e')]][_0x5e10('0x4c')]=_0x147e98[_0x5e10('0x45')];if(_0x147e98[_0x5e10('0x43')]==='set'&&_[_0x5e10('0x4d')](_0x147e98['applicationdata'],_0x5e10('0x4e'))){var _0x5290d1=_0x147e98[_0x5e10('0x45')][_0x5e10('0x3e')]('=');var _0x3b47d4=_0x5290d1[0x0][_0x5e10('0x4f')](/cdr\((.*)\)/);if(_0x3b47d4){this['channels'][_0x147e98[_0x5e10('0x2e')]][_0x3b47d4[0x1]]=_0x5290d1[0x1];}}else if(_0x147e98[_0x5e10('0x43')]===_0x5e10('0xb')){this[_0x5e10('0x15')][_0x147e98[_0x5e10('0x2e')]][_0x5e10('0xb')]=_0x147e98[_0x5e10('0x45')][_0x5e10('0x3e')](',')[0x0];}}}}}catch(_0xd3f1e6){logger['error']('[syncNewExten][VoiceCallReport]',util[_0x5e10('0x33')](_0xd3f1e6,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x5e10('0x1c')]=function(_0x2c6288){try{if(this[_0x5e10('0x2b')](_0x2c6288)){if(_0x2c6288[_0x5e10('0x2e')]!==_0x2c6288[_0x5e10('0x2f')]){if(this[_0x5e10('0x15')][_0x2c6288[_0x5e10('0x2f')]]){if(_0x2c6288[_0x5e10('0x3a')]==='6'){if(!this[_0x5e10('0x15')][_0x2c6288[_0x5e10('0x2f')]]['answered']){var _0x4eb84f=moment();this[_0x5e10('0x15')][_0x2c6288[_0x5e10('0x2f')]][_0x5e10('0x50')]=!![];this['channels'][_0x2c6288['linkedid']][_0x5e10('0x51')]=_0x4eb84f[_0x5e10('0x37')](_0x5e10('0x4a'));if(this[_0x5e10('0x15')][_0x2c6288['linkedid']][_0x5e10('0x47')]){this[_0x5e10('0x15')][_0x2c6288[_0x5e10('0x2f')]][_0x5e10('0x52')]=_0x4eb84f[_0x5e10('0x53')](this[_0x5e10('0x15')][_0x2c6288[_0x5e10('0x2f')]][_0x5e10('0x47')],'seconds');}}this[_0x5e10('0x15')][_0x2c6288['linkedid']][_0x5e10('0x2f')]=_0x2c6288[_0x5e10('0x2e')];if(_0x2c6288['calleridnum']!==_0x5e10('0x54')){this[_0x5e10('0x15')][_0x2c6288[_0x5e10('0x2f')]][_0x5e10('0x55')]=_0x2c6288[_0x5e10('0x56')];}this[_0x5e10('0x15')][_0x2c6288['linkedid']][_0x5e10('0x57')]=_0x2c6288[_0x5e10('0x58')];this[_0x5e10('0x15')][_0x2c6288[_0x5e10('0x2f')]][_0x5e10('0x59')]=_0x2c6288[_0x5e10('0x35')];this[_0x5e10('0x15')][_0x2c6288[_0x5e10('0x2f')]][_0x5e10('0x38')]=dispositions[_['toNumber'](_0x2c6288[_0x5e10('0x3a')])];if(this[_0x5e10('0x16')][_0x2c6288[_0x5e10('0x35')][_0x5e10('0x3e')]('-')[0x0]]){this[_0x5e10('0x15')][_0x2c6288['linkedid']][_0x5e10('0x5a')]=this[_0x5e10('0x16')][_0x2c6288[_0x5e10('0x35')][_0x5e10('0x3e')]('-')[0x0]]['id'];this[_0x5e10('0x15')][_0x2c6288[_0x5e10('0x2f')]][_0x5e10('0x5b')]=this['agents'][_0x2c6288[_0x5e10('0x35')][_0x5e10('0x3e')]('-')[0x0]][_0x5e10('0x3f')];}}}}else{if(this['channels'][_0x2c6288[_0x5e10('0x2e')]]){if(_0x2c6288[_0x5e10('0x3a')]==='6'){if(this['agents'][_0x2c6288['channel'][_0x5e10('0x3e')]('-')[0x0]]){this[_0x5e10('0x15')][_0x2c6288[_0x5e10('0x2e')]][_0x5e10('0x5a')]=this[_0x5e10('0x16')][_0x2c6288[_0x5e10('0x35')][_0x5e10('0x3e')]('-')[0x0]]['id'];this['channels'][_0x2c6288[_0x5e10('0x2e')]][_0x5e10('0x5b')]=this[_0x5e10('0x16')][_0x2c6288['channel'][_0x5e10('0x3e')]('-')[0x0]]['name'];}}}}}}catch(_0x5257b3){logger['error'](_0x5e10('0x5c'),util[_0x5e10('0x33')](_0x5257b3,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x5e10('0x2a')][_0x5e10('0x5d')]=function(_0xa964be,_0x5a303a){if(this[_0x5e10('0x15')][_0xa964be]){this[_0x5e10('0x15')][_0xa964be][_0x5e10('0x5e')]=!![];if(_[_0x5e10('0x5f')](_0x5a303a,'.wav49')){_0x5a303a=_0x5a303a[_0x5e10('0x60')]('.wav49',_0x5e10('0x61'));}this[_0x5e10('0x15')][_0xa964be][_0x5e10('0x62')]=_0x5a303a;var _0x2c15e2=_[_0x5e10('0x63')](this['channels'][_0xa964be][_0x5e10('0x64')],{'filename':_0x5a303a});if(_[_0x5e10('0x65')](_0x2c15e2)){this[_0x5e10('0x15')][_0xa964be][_0x5e10('0x64')][_0x5e10('0x66')]({'filename':_0x5a303a,'createdAt':moment()[_0x5e10('0x37')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':'rec'});}}};VoiceCallReport[_0x5e10('0x2a')][_0x5e10('0x67')]=function(_0x1913b3){try{if(this['isNotNull'](_0x1913b3)){if(this['channels'][_0x1913b3[_0x5e10('0x2e')]]&&_0x1913b3[_0x5e10('0x35')]!='OutgoingSpoolFailed'){if(this[_0x5e10('0x2b')](_0x1913b3['variable'])){if(this[_0x5e10('0x2b')](_0x1913b3[_0x5e10('0x68')][_0x5e10('0x69')])){this[_0x5e10('0x5d')](_0x1913b3[_0x5e10('0x2e')],_0x1913b3[_0x5e10('0x6a')]);}else if(this[_0x5e10('0x2b')](_0x1913b3['variable'][_0x5e10('0x6b')])){this[_0x5e10('0x15')][_0x1913b3[_0x5e10('0x2e')]][_0x5e10('0x56')]=_0x1913b3['value'];}else if(this[_0x5e10('0x2b')](_0x1913b3['variable'][_0x5e10('0x6c')])){this[_0x5e10('0x15')][_0x1913b3[_0x5e10('0x2e')]][_0x5e10('0x6d')]=_0x1913b3[_0x5e10('0x6a')];}else if(this[_0x5e10('0x2b')](_0x1913b3[_0x5e10('0x68')][_0x5e10('0x6e')])){this[_0x5e10('0x15')][_0x1913b3[_0x5e10('0x2e')]][_0x5e10('0x6f')]=_0x1913b3[_0x5e10('0x6a')];}else if(this['isNotNull'](_0x1913b3[_0x5e10('0x68')][_0x5e10('0x70')])){this['channels'][_0x1913b3[_0x5e10('0x2e')]][_0x5e10('0xb')]=_0x1913b3[_0x5e10('0x6a')]['split'](',')[0x0];}else if(this[_0x5e10('0x2b')](_0x1913b3[_0x5e10('0x68')][_0x5e10('0x71')])){this[_0x5e10('0x15')][_0x1913b3[_0x5e10('0x2e')]][_0x5e10('0x72')]=_0x1913b3[_0x5e10('0x6a')];}else if(this[_0x5e10('0x2b')](_0x1913b3[_0x5e10('0x68')][_0x5e10('0x73')])){this['channels'][_0x1913b3['uniqueid']][_0x5e10('0x74')]=_0x1913b3['value'];}else if(this[_0x5e10('0x2b')](_0x1913b3['variable'][_0x5e10('0x75')])){this['channels'][_0x1913b3['uniqueid']][_0x5e10('0x76')]=_0x1913b3[_0x5e10('0x6a')];}else if(this[_0x5e10('0x2b')](_0x1913b3[_0x5e10('0x68')][_0x5e10('0x77')])){this[_0x5e10('0x15')][_0x1913b3[_0x5e10('0x2e')]][_0x5e10('0xb')]=_0x1913b3[_0x5e10('0x6a')];}else if(this[_0x5e10('0x2b')](_0x1913b3[_0x5e10('0x68')][_0x5e10('0x78')])){this[_0x5e10('0x15')][_0x1913b3[_0x5e10('0x2e')]][_0x5e10('0x79')]=_0x1913b3['value'];}}}else if(this[_0x5e10('0x2b')](_0x1913b3['variable'][_0x5e10('0x69')])){if(_0x1913b3[_0x5e10('0x6a')]){var _0x5e4a1a=path[_0x5e10('0x7a')](_0x1913b3[_0x5e10('0x6a')])[_0x5e10('0x3f')];this[_0x5e10('0x5d')](_0x5e4a1a,_0x1913b3[_0x5e10('0x6a')]);}}else if(this[_0x5e10('0x15')][_0x1913b3[_0x5e10('0x2f')]]){if(this['isNotNull'](_0x1913b3[_0x5e10('0x68')])){if(this[_0x5e10('0x2b')](_0x1913b3[_0x5e10('0x68')][_0x5e10('0x78')])){this[_0x5e10('0x15')][_0x1913b3['linkedid']]['sipcalllinkedid']=_0x1913b3[_0x5e10('0x6a')];}}}}}catch(_0x3a2d29){logger[_0x5e10('0x7b')](_0x5e10('0x7c'),util[_0x5e10('0x33')](_0x3a2d29,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x5e10('0x2a')]['syncHangup']=function(_0x5382c2){try{if(this[_0x5e10('0x2b')](_0x5382c2)){if(this[_0x5e10('0x15')][_0x5382c2['uniqueid']]){var _0x5d7f9e=moment();this[_0x5e10('0x15')][_0x5382c2[_0x5e10('0x2e')]][_0x5e10('0x7d')]=_0x5d7f9e[_0x5e10('0x37')](_0x5e10('0x4a'));this[_0x5e10('0x15')][_0x5382c2[_0x5e10('0x2e')]]['duration']=_0x5d7f9e[_0x5e10('0x53')](this['channels'][_0x5382c2['uniqueid']]['starttime'],_0x5e10('0x49'));if(this['channels'][_0x5382c2[_0x5e10('0x2e')]][_0x5e10('0x50')]){this[_0x5e10('0x15')][_0x5382c2[_0x5e10('0x2e')]][_0x5e10('0x7e')]=_0x5d7f9e[_0x5e10('0x53')](this[_0x5e10('0x15')][_0x5382c2['uniqueid']][_0x5e10('0x51')],_0x5e10('0x49'));this[_0x5e10('0x15')][_0x5382c2[_0x5e10('0x2e')]]['holdtime']=this[_0x5e10('0x15')][_0x5382c2['uniqueid']][_0x5e10('0x48')]-this[_0x5e10('0x15')][_0x5382c2[_0x5e10('0x2e')]][_0x5e10('0x7e')];}if(_0x5382c2[_0x5e10('0x3b')]==='from-sip'){if(this[_0x5e10('0x16')][_0x5382c2[_0x5e10('0x35')][_0x5e10('0x3e')]('-')[0x0]]){this[_0x5e10('0x16')][_0x5382c2[_0x5e10('0x35')][_0x5e10('0x3e')]('-')[0x0]]=_[_0x5e10('0x7f')](this[_0x5e10('0x16')][_0x5382c2['channel']['split']('-')[0x0]],['destconnectedlinenum']);this[_0x5e10('0x2d')](util[_0x5e10('0x37')](_0x5e10('0x3d'),this[_0x5e10('0x16')][_0x5382c2['channel']['split']('-')[0x0]][_0x5e10('0x3f')]),_0x5e10('0x80'),{'destaccountcode':this[_0x5e10('0x16')][_0x5382c2[_0x5e10('0x35')][_0x5e10('0x3e')]('-')[0x0]][_0x5e10('0x40')]});}}ami[_0x5e10('0x2d')](_0x5e10('0x81'),this[_0x5e10('0x15')][_0x5382c2[_0x5e10('0x2e')]]);delete this[_0x5e10('0x15')][_0x5382c2[_0x5e10('0x2e')]];}}}catch(_0x3b158b){logger[_0x5e10('0x7b')](_0x5e10('0x82'),util[_0x5e10('0x33')](_0x3b158b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x5e10('0x2a')][_0x5e10('0x23')]=function(_0xc9b8){try{if(this[_0x5e10('0x2b')](_0xc9b8)){if(this[_0x5e10('0x15')][_0xc9b8[_0x5e10('0x83')]]){this[_0x5e10('0x15')][_0xc9b8['transfereeuniqueid']]['transfercalleridnum']=_0xc9b8[_0x5e10('0x84')];this[_0x5e10('0x15')][_0xc9b8[_0x5e10('0x83')]][_0x5e10('0x85')]=_0xc9b8['transfertargetcalleridnum'];if(this['channels'][_0xc9b8[_0x5e10('0x86')]]){var _0x54c406=this[_0x5e10('0x15')][_0xc9b8['secondtransfereruniqueid']];this[_0x5e10('0x15')][_0xc9b8[_0x5e10('0x86')]]=this[_0x5e10('0x15')][_0xc9b8[_0x5e10('0x83')]];this[_0x5e10('0x15')][_0xc9b8[_0x5e10('0x83')]]=_0x54c406;}}else if(this[_0x5e10('0x15')][_0xc9b8[_0x5e10('0x87')]]){this[_0x5e10('0x15')][_0xc9b8[_0x5e10('0x87')]][_0x5e10('0x88')]=_0xc9b8[_0x5e10('0x84')];this[_0x5e10('0x15')][_0xc9b8[_0x5e10('0x87')]][_0x5e10('0x85')]=_0xc9b8[_0x5e10('0x89')];if(this['channels'][_0xc9b8[_0x5e10('0x8a')]]){var _0x54c406=this['channels'][_0xc9b8[_0x5e10('0x8a')]];this[_0x5e10('0x15')][_0xc9b8[_0x5e10('0x8a')]]=this[_0x5e10('0x15')][_0xc9b8['transfertargetuniqueid']];this[_0x5e10('0x15')][_0xc9b8[_0x5e10('0x87')]]=_0x54c406;}}}}catch(_0x1019b8){logger[_0x5e10('0x7b')]('[syncAttendedTransfer][VoiceCallReport]',util['inspect'](_0x1019b8,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x5e10('0x2a')][_0x5e10('0x8b')]=function(_0xe0be7){try{if(this[_0x5e10('0x2b')](_0xe0be7)){if(this[_0x5e10('0x15')][_0xe0be7[_0x5e10('0x83')]]){this[_0x5e10('0x15')][_0xe0be7[_0x5e10('0x83')]]['transfercalleridnum']=_0xe0be7['transfereecalleridnum'];this[_0x5e10('0x15')][_0xe0be7[_0x5e10('0x83')]][_0x5e10('0x85')]=_0xe0be7[_0x5e10('0x8c')];this[_0x5e10('0x1f')]({'event':_0x5e10('0x8d'),'uniqueid':_0xe0be7[_0x5e10('0x83')],'context':_0xe0be7[_0x5e10('0x3b')],'channel':_0xe0be7[_0x5e10('0x8e')]});}}}catch(_0x31c33e){logger[_0x5e10('0x7b')](_0x5e10('0x8f'),util[_0x5e10('0x33')](_0x31c33e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x5e10('0x2a')][_0x5e10('0x24')]=function(_0x499979){try{if(this[_0x5e10('0x2b')](_0x499979)){if(this['channels'][_0x499979[_0x5e10('0x2e')]]){if(!_['isNil'](this[_0x5e10('0x15')][_0x499979[_0x5e10('0x2e')]][_0x5e10('0x51')])){this[_0x5e10('0x15')][_0x499979[_0x5e10('0x2e')]][_0x5e10('0x90')]=moment()['format'](_0x5e10('0x4a'));}}}}catch(_0x484fd5){logger['error'](_0x5e10('0x91'),util[_0x5e10('0x33')](_0x484fd5,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x5e10('0x2a')][_0x5e10('0x26')]=function(_0x42cd7c){try{if(this['isNotNull'](_0x42cd7c)){if(this[_0x5e10('0x15')][_0x42cd7c[_0x5e10('0x2e')]]){if(!_['isNil'](this[_0x5e10('0x15')][_0x42cd7c['uniqueid']][_0x5e10('0x90')])){this[_0x5e10('0x15')][_0x42cd7c['uniqueid']][_0x5e10('0x92')]+=moment()['milliseconds'](0x0)[_0x5e10('0x53')](this[_0x5e10('0x15')][_0x42cd7c[_0x5e10('0x2e')]][_0x5e10('0x90')],_0x5e10('0x49'));delete this[_0x5e10('0x15')][_0x42cd7c[_0x5e10('0x2e')]][_0x5e10('0x90')];}}}}catch(_0x216e44){logger['error']('[syncMusicOnHoldStop][VoiceCallReport]',util['inspect'](_0x216e44,{'showHidden':![],'depth':null}));}};module['exports']=VoiceCallReport;