Built motion from commit 0c5f406c.|2.6.29
[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 _0x3f70=['includes','lastapplication','lastdata','startsWith','cdr(','match','isNil','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','calleridname','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','holdtime','destinationchannel','UserId','membername','diff','connectedlinename','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','.wav49','replace','.WAV','monitorFilename','monitors','rec','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','OutgoingSpoolFailed','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','type','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','parse','sipcalllinkedid','[%s][voiceCallReport][varset]','syncHangup','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','omit','user:agentcomplete','length','transferType','resolve','then','transferToInternal','getSettings','stopRecordingOnTransfer','StopMixMonitor','catch','Action','finally','webbar:stopmonitors','event','BlindTransfer','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][hangup]','syncAttendedTransfer','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','secondtransfereruniqueid','transfertargetuniqueid','transferconnectedlinenum','origtransfereruniqueid','ATTENDED','some','origtransfererlinkedid','syncBlindTransfer','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','extension','BLIND','transfereruniqueid','transfererchannel','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','syncMusicOnHoldStop','[%s][voiceCallReport][musiconholdstop]\x20event:','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','mohtime','lodash','util','ioredis','../../../config/environment','ami','../ami','../model/channel','../rpc/setting','set','queue','agi','dial','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','defaults','localhost','socket.io-emitter','channels','agents','blindTransfers','coreshowchannel','syncNewExten','bind','newexten','newchannel','syncNewChannel','newstate','syncNewState','varset','syncVarSet','attendedtransfer','blindtransfer','syncMusicOnHoldStart','musiconholdstop','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','error','inspect','prototype','isNotNull','syncNewCallerId','info','uniqueid','calleridnum','debug','[%s][voiceCallReport][newcallerid]\x20event:','linkedid','isUndefined','merge','pick','context','from-sip','channel','split','xcally-motion-preview','destconnectedlinenum','emit','format','user:%s','name','user:agentconnect','accountcode','connectedlinenum','[%s][voiceCallReport][newcallerid]','[%s][voiceCallReport][newchannel]\x20event:','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','undefined','exten','application','toLowerCase','applicationdata','appdata','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','starttime','duration','seconds','keys'];(function(_0x449d90,_0x49c741){var _0x1206d9=function(_0x36dd9b){while(--_0x36dd9b){_0x449d90['push'](_0x449d90['shift']());}};_0x1206d9(++_0x49c741);}(_0x3f70,0x138));var _0x03f7=function(_0x51a6f6,_0x57f2b5){_0x51a6f6=_0x51a6f6-0x0;var _0x476652=_0x3f70[_0x51a6f6];return _0x476652;};'use strict';var _=require(_0x03f7('0x0'));var moment=require('moment');var util=require(_0x03f7('0x1'));var path=require('path');var Redis=require(_0x03f7('0x2'));var config=require(_0x03f7('0x3'));var logger=require('../../../config/logger')(_0x03f7('0x4'));var ami=require(_0x03f7('0x5'));var Channel=require(_0x03f7('0x6'));var RpcSetting=require(_0x03f7('0x7'));var applications=[_0x03f7('0x8'),_0x03f7('0x9'),_0x03f7('0xa'),_0x03f7('0xb'),_0x03f7('0xc'),_0x03f7('0xd')];var dispositions=[_0x03f7('0xe'),_0x03f7('0xf'),_0x03f7('0xf'),_0x03f7('0xe'),_0x03f7('0xe'),_0x03f7('0xe'),_0x03f7('0x10'),_0x03f7('0x11'),'FAILED',_0x03f7('0xf'),_0x03f7('0xf')];config[_0x03f7('0x12')]=_[_0x03f7('0x13')](config['redis'],{'host':_0x03f7('0x14'),'port':0x18eb});var io=require(_0x03f7('0x15'))(new Redis(config[_0x03f7('0x12')]));function VoiceCallReport(_0x31ff13){this[_0x03f7('0x16')]=_0x31ff13[_0x03f7('0x16')];this[_0x03f7('0x17')]=_0x31ff13[_0x03f7('0x17')];this[_0x03f7('0x18')]={};ami['on'](_0x03f7('0x19'),this[_0x03f7('0x1a')][_0x03f7('0x1b')](this));ami['on'](_0x03f7('0x1c'),this[_0x03f7('0x1a')][_0x03f7('0x1b')](this));ami['on'](_0x03f7('0x1d'),this[_0x03f7('0x1e')][_0x03f7('0x1b')](this));ami['on'](_0x03f7('0x1f'),this[_0x03f7('0x20')][_0x03f7('0x1b')](this));ami['on'](_0x03f7('0x21'),this[_0x03f7('0x22')][_0x03f7('0x1b')](this));ami['on']('hangup',this['syncHangup'][_0x03f7('0x1b')](this));ami['on']('newcallerid',this['syncNewCallerId'][_0x03f7('0x1b')](this));ami['on'](_0x03f7('0x23'),this['syncAttendedTransfer'][_0x03f7('0x1b')](this));ami['on'](_0x03f7('0x24'),this['syncBlindTransfer'][_0x03f7('0x1b')](this));ami['on']('musiconholdstart',this[_0x03f7('0x25')][_0x03f7('0x1b')](this));ami['on'](_0x03f7('0x26'),this['syncMusicOnHoldStop']['bind'](this));try{logger['info'](_0x03f7('0x27'));ami[_0x03f7('0x28')]();}catch(_0x37de29){logger[_0x03f7('0x29')]('[voiceCallReport][coreshowchannels]',util[_0x03f7('0x2a')](_0x37de29,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x03f7('0x2b')][_0x03f7('0x2c')]=function(_0x49b917){return _0x49b917!==null&&!_['isUndefined'](_0x49b917);};VoiceCallReport[_0x03f7('0x2b')]['emit']=function(_0x2e6c5d,_0x3cc643,_0x1c47f5){io['to'](_0x2e6c5d)['emit'](_0x3cc643,_0x1c47f5);};VoiceCallReport['prototype'][_0x03f7('0x2d')]=function(_0x79fafe){try{if(this['isNotNull'](_0x79fafe)){logger[_0x03f7('0x2e')]('[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s',_0x79fafe[_0x03f7('0x2f')],_0x79fafe['calleridname'],_0x79fafe[_0x03f7('0x30')]);logger[_0x03f7('0x31')](_0x03f7('0x32'),_0x79fafe[_0x03f7('0x2f')],util[_0x03f7('0x2a')](_0x79fafe,{'showHidden':![],'depth':null}));if(_0x79fafe[_0x03f7('0x2f')]===_0x79fafe[_0x03f7('0x33')]){if(!_[_0x03f7('0x34')](this[_0x03f7('0x16')][_0x79fafe[_0x03f7('0x2f')]])){_[_0x03f7('0x35')](this[_0x03f7('0x16')][_0x79fafe[_0x03f7('0x2f')]],_[_0x03f7('0x36')](_0x79fafe,_['keys'](this[_0x03f7('0x16')][_0x79fafe[_0x03f7('0x2f')]])));}}if(_0x79fafe[_0x03f7('0x37')]===_0x03f7('0x38')){var _0x206528=this[_0x03f7('0x17')][_0x79fafe[_0x03f7('0x39')][_0x03f7('0x3a')]('-')[0x0]];if(_0x206528){if(_0x79fafe['exten']==_0x03f7('0x3b')){_0x206528[_0x03f7('0x3c')]=_0x79fafe['connectedlinenum'];this[_0x03f7('0x3d')](util[_0x03f7('0x3e')](_0x03f7('0x3f'),_0x206528[_0x03f7('0x40')]),_0x03f7('0x41'),{'id':_0x206528['id'],'destaccountcode':_0x206528[_0x03f7('0x42')],'destconnectedlinenum':_0x79fafe[_0x03f7('0x43')]});}}}}}catch(_0x3371c7){logger['error'](_0x03f7('0x44'),_0x79fafe[_0x03f7('0x2f')],util['inspect'](_0x3371c7,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x03f7('0x2b')][_0x03f7('0x1e')]=function(_0x33f3bc){try{if(this[_0x03f7('0x2c')](_0x33f3bc)){logger[_0x03f7('0x31')](_0x03f7('0x45'),_0x33f3bc[_0x03f7('0x2f')],util[_0x03f7('0x2a')](_0x33f3bc,{'showHidden':![],'depth':null}));if(this[_0x03f7('0x16')][_0x33f3bc['uniqueid']]){return;}if(_0x33f3bc['channel']==='OutgoingSpoolFailed'){return;}if(_0x33f3bc[_0x03f7('0x2f')]!==_0x33f3bc['linkedid']&&!this[_0x03f7('0x18')][_0x33f3bc[_0x03f7('0x33')]]){return;}logger[_0x03f7('0x2e')](_0x03f7('0x46'),_0x33f3bc[_0x03f7('0x2f')],_0x33f3bc[_0x03f7('0x37')],_0x33f3bc['exten']);this[_0x03f7('0x16')][_0x33f3bc[_0x03f7('0x2f')]]=new Channel();this[_0x03f7('0x16')][_0x33f3bc['uniqueid']]['starttime']=moment()['format'](_0x03f7('0x47'));this['channels'][_0x33f3bc[_0x03f7('0x2f')]][_0x03f7('0x48')]=dispositions[_[_0x03f7('0x49')](_0x33f3bc[_0x03f7('0x4a')])];_[_0x03f7('0x35')](this['channels'][_0x33f3bc[_0x03f7('0x2f')]],_[_0x03f7('0x36')](_0x33f3bc,_['keys'](this[_0x03f7('0x16')][_0x33f3bc[_0x03f7('0x2f')]])));if(_0x33f3bc['context']===_0x03f7('0x38')){var _0x52a0fc=this[_0x03f7('0x17')][_0x33f3bc[_0x03f7('0x39')][_0x03f7('0x3a')]('-')[0x0]];if(_0x52a0fc&&typeof _0x52a0fc['destconnectedlinenum']===_0x03f7('0x4b')){_0x52a0fc['destconnectedlinenum']=_0x33f3bc[_0x03f7('0x4c')];logger[_0x03f7('0x31')]('[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:',_0x33f3bc[_0x03f7('0x2f')],util['inspect']({'id':_0x52a0fc['id'],'destaccountcode':_0x52a0fc['accountcode'],'destconnectedlinenum':_0x33f3bc[_0x03f7('0x4c')]},{'showHidden':![],'depth':null}));this['emit'](util[_0x03f7('0x3e')]('user:%s',_0x52a0fc[_0x03f7('0x40')]),'user:agentconnect',{'id':_0x52a0fc['id'],'destaccountcode':_0x52a0fc[_0x03f7('0x42')],'destconnectedlinenum':_0x33f3bc[_0x03f7('0x4c')]});}}}}catch(_0x4e56d1){logger[_0x03f7('0x29')]('[%s][voiceCallReport][newchannel]',_0x33f3bc[_0x03f7('0x2f')],util[_0x03f7('0x2a')](_0x4e56d1,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x03f7('0x2b')][_0x03f7('0x1a')]=function(_0x431eb7){try{if(this[_0x03f7('0x2c')](_0x431eb7)){logger[_0x03f7('0x31')]('[%s][voiceCallReport][newexten]\x20event:',_0x431eb7[_0x03f7('0x2f')],util[_0x03f7('0x2a')](_0x431eb7,{'showHidden':![],'depth':null}));if(_0x431eb7[_0x03f7('0x39')]==='OutgoingSpoolFailed'||_0x431eb7[_0x03f7('0x4c')]==='h')return;if(_0x431eb7[_0x03f7('0x2f')]===_0x431eb7[_0x03f7('0x33')]||this['blindTransfers'][_0x431eb7[_0x03f7('0x33')]]){_0x431eb7['application']=_0x431eb7['application']?_0x431eb7[_0x03f7('0x4d')][_0x03f7('0x4e')]():undefined;_0x431eb7[_0x03f7('0x4f')]=_0x431eb7[_0x03f7('0x50')]||_0x431eb7[_0x03f7('0x4f')];if(_0x431eb7[_0x03f7('0x50')]&&_0x431eb7[_0x03f7('0x4d')]!==_0x03f7('0x9')){_0x431eb7['applicationdata']=_0x431eb7[_0x03f7('0x4f')][_0x03f7('0x4e')]();}logger[_0x03f7('0x2e')](_0x03f7('0x51'),_0x431eb7[_0x03f7('0x2f')],_0x431eb7[_0x03f7('0x4d')],_0x431eb7[_0x03f7('0x4f')]);if(_[_0x03f7('0x34')](this[_0x03f7('0x16')][_0x431eb7['uniqueid']])){this[_0x03f7('0x16')][_0x431eb7[_0x03f7('0x2f')]]=new Channel();this['channels'][_0x431eb7[_0x03f7('0x2f')]][_0x03f7('0x52')]=_0x431eb7['duration']?moment()['subtract'](moment[_0x03f7('0x53')](_0x431eb7[_0x03f7('0x53')])['seconds'](),_0x03f7('0x54'))[_0x03f7('0x3e')](_0x03f7('0x47')):moment()['format'](_0x03f7('0x47'));this['channels'][_0x431eb7[_0x03f7('0x2f')]]['disposition']=_0x03f7('0xe');}_[_0x03f7('0x35')](this[_0x03f7('0x16')][_0x431eb7[_0x03f7('0x2f')]],_[_0x03f7('0x36')](_0x431eb7,_[_0x03f7('0x55')](this[_0x03f7('0x16')][_0x431eb7[_0x03f7('0x2f')]])));if(_[_0x03f7('0x56')](applications,_0x431eb7[_0x03f7('0x4d')])){this['channels'][_0x431eb7[_0x03f7('0x2f')]][_0x03f7('0x57')]=_0x431eb7[_0x03f7('0x4d')];this['channels'][_0x431eb7[_0x03f7('0x2f')]][_0x03f7('0x58')]=_0x431eb7[_0x03f7('0x4f')];if(_0x431eb7[_0x03f7('0x4d')]==='set'&&_[_0x03f7('0x59')](_0x431eb7[_0x03f7('0x4f')][_0x03f7('0x4e')](),_0x03f7('0x5a'))){var _0x465bb8=_0x431eb7[_0x03f7('0x4f')][_0x03f7('0x3a')]('=');var _0x1cc31a=_0x465bb8[0x0][_0x03f7('0x4e')]()[_0x03f7('0x5b')](/cdr\((.*)\)/);if(_0x1cc31a){if(_0x1cc31a[0x1]==='type'&&!_[_0x03f7('0x5c')](this['channels'][_0x431eb7['uniqueid']][_0x1cc31a[0x1]]))return;this['channels'][_0x431eb7[_0x03f7('0x2f')]][_0x1cc31a[0x1]]=_0x465bb8[0x1];}}else if(_0x431eb7[_0x03f7('0x4d')]===_0x03f7('0x9')){this[_0x03f7('0x16')][_0x431eb7['uniqueid']]['queue']=_0x431eb7['applicationdata'][_0x03f7('0x3a')](',')[0x0];}}}}}catch(_0x1ca20d){logger[_0x03f7('0x29')]('[%s][voiceCallReport][newexten]',_0x431eb7['uniqueid'],util['inspect'](_0x1ca20d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x03f7('0x2b')]['syncNewState']=function(_0x4edf4a){try{if(this['isNotNull'](_0x4edf4a)){logger[_0x03f7('0x2e')](_0x03f7('0x5d'),_0x4edf4a[_0x03f7('0x2f')],_0x4edf4a[_0x03f7('0x33')],_0x4edf4a[_0x03f7('0x5e')],_0x4edf4a[_0x03f7('0x30')]);logger['debug'](_0x03f7('0x5f'),_0x4edf4a[_0x03f7('0x2f')],util['inspect'](_0x4edf4a,{'showHidden':![],'depth':null}));if(_0x4edf4a[_0x03f7('0x4a')]!=='6')return;var _0x4a4c36=this['agents'][_0x4edf4a[_0x03f7('0x39')][_0x03f7('0x3a')]('-')[0x0]];if(_0x4edf4a['uniqueid']!==_0x4edf4a[_0x03f7('0x33')]){var _0x2ab8fa=moment();if(this['channels'][_0x4edf4a[_0x03f7('0x33')]]){if(!this[_0x03f7('0x16')][_0x4edf4a[_0x03f7('0x33')]][_0x03f7('0x60')]){this['channels'][_0x4edf4a[_0x03f7('0x33')]][_0x03f7('0x60')]=!![];this[_0x03f7('0x16')][_0x4edf4a[_0x03f7('0x33')]][_0x03f7('0x61')]=_0x2ab8fa[_0x03f7('0x3e')](_0x03f7('0x47'));if(this[_0x03f7('0x16')][_0x4edf4a[_0x03f7('0x33')]][_0x03f7('0x52')]){this[_0x03f7('0x16')][_0x4edf4a['linkedid']][_0x03f7('0x62')]=_0x2ab8fa['diff'](this['channels'][_0x4edf4a['linkedid']]['starttime'],_0x03f7('0x54'));}}this['channels'][_0x4edf4a[_0x03f7('0x33')]]['linkedid']=_0x4edf4a[_0x03f7('0x2f')];if(_0x4edf4a[_0x03f7('0x30')]!==_0x03f7('0x3b')){this[_0x03f7('0x16')][_0x4edf4a['linkedid']]['connectedlinenum']=_0x4edf4a[_0x03f7('0x30')];}this['channels'][_0x4edf4a[_0x03f7('0x33')]]['connectedlinename']=_0x4edf4a['calleridname'];this[_0x03f7('0x16')][_0x4edf4a[_0x03f7('0x33')]][_0x03f7('0x63')]=_0x4edf4a[_0x03f7('0x39')];this['channels'][_0x4edf4a['linkedid']][_0x03f7('0x48')]=dispositions[_[_0x03f7('0x49')](_0x4edf4a[_0x03f7('0x4a')])];if(_0x4a4c36){this[_0x03f7('0x16')][_0x4edf4a[_0x03f7('0x33')]][_0x03f7('0x64')]=_0x4a4c36['id'];this[_0x03f7('0x16')][_0x4edf4a[_0x03f7('0x33')]][_0x03f7('0x65')]=_0x4a4c36[_0x03f7('0x40')];}}if(this[_0x03f7('0x16')][_0x4edf4a[_0x03f7('0x2f')]]){if(!this[_0x03f7('0x16')][_0x4edf4a[_0x03f7('0x2f')]][_0x03f7('0x60')]){this[_0x03f7('0x16')][_0x4edf4a['uniqueid']][_0x03f7('0x60')]=!![];this['channels'][_0x4edf4a[_0x03f7('0x2f')]][_0x03f7('0x61')]=_0x2ab8fa[_0x03f7('0x3e')]('YYYY-MM-DD\x20HH:mm:ss');if(this[_0x03f7('0x16')][_0x4edf4a[_0x03f7('0x2f')]][_0x03f7('0x52')]){this[_0x03f7('0x16')][_0x4edf4a[_0x03f7('0x2f')]][_0x03f7('0x62')]=_0x2ab8fa[_0x03f7('0x66')](this[_0x03f7('0x16')][_0x4edf4a[_0x03f7('0x2f')]][_0x03f7('0x52')],'seconds');}}if(_0x4edf4a[_0x03f7('0x30')]!==_0x03f7('0x3b')){this[_0x03f7('0x16')][_0x4edf4a['uniqueid']][_0x03f7('0x43')]=_0x4edf4a[_0x03f7('0x30')];}this['channels'][_0x4edf4a[_0x03f7('0x2f')]][_0x03f7('0x67')]=_0x4edf4a['calleridname'];this[_0x03f7('0x16')][_0x4edf4a['uniqueid']][_0x03f7('0x63')]=_0x4edf4a[_0x03f7('0x39')];this[_0x03f7('0x16')][_0x4edf4a[_0x03f7('0x2f')]][_0x03f7('0x48')]=dispositions[_[_0x03f7('0x49')](_0x4edf4a['channelstate'])];}}else{if(this['channels'][_0x4edf4a[_0x03f7('0x2f')]]){if(_0x4a4c36){this['channels'][_0x4edf4a['uniqueid']][_0x03f7('0x64')]=_0x4a4c36['id'];this[_0x03f7('0x16')][_0x4edf4a[_0x03f7('0x2f')]][_0x03f7('0x65')]=_0x4a4c36[_0x03f7('0x40')];}}}if(_0x4edf4a['context']===_0x03f7('0x38')){if(_0x4a4c36){_0x4a4c36[_0x03f7('0x3c')]=_0x4edf4a[_0x03f7('0x4c')];var _0x3afac2;if(this['channels'][_0x4edf4a['uniqueid']]){_0x3afac2=this[_0x03f7('0x16')][_0x4edf4a[_0x03f7('0x2f')]][_0x03f7('0x9')];}else if(this[_0x03f7('0x16')][_0x4edf4a[_0x03f7('0x33')]]){_0x3afac2=this['channels'][_0x4edf4a[_0x03f7('0x33')]][_0x03f7('0x9')];}_0x4a4c36[_0x03f7('0x9')]=_0x3afac2;var _0x5ddd5b={'id':_0x4a4c36['id'],'name':_0x4a4c36[_0x03f7('0x40')],'agentconnected':!![],'destaccountcode':_0x4a4c36[_0x03f7('0x42')],'destconnectedlinenum':_0x4edf4a[_0x03f7('0x4c')],'queue':_0x3afac2||undefined,'uniqueid':_0x4edf4a[_0x03f7('0x33')]};logger['debug'](_0x03f7('0x68'),_0x4edf4a[_0x03f7('0x2f')],util[_0x03f7('0x2a')](_0x5ddd5b,{'showHidden':![],'depth':null}));this[_0x03f7('0x3d')](util[_0x03f7('0x3e')]('user:%s',_0x4a4c36[_0x03f7('0x40')]),'user:agentconnect',_0x5ddd5b);}}}}catch(_0x32c00b){logger[_0x03f7('0x29')](_0x03f7('0x69'),_0x4edf4a[_0x03f7('0x2f')],util[_0x03f7('0x2a')](_0x32c00b,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x03f7('0x6a')]=function(_0x3b739c,_0x3e5cf7){try{if(this[_0x03f7('0x16')][_0x3b739c]){logger[_0x03f7('0x2e')](_0x03f7('0x6b'),_0x3b739c,_0x3e5cf7);this[_0x03f7('0x16')][_0x3b739c][_0x03f7('0x6c')]=!![];if(_[_0x03f7('0x6d')](_0x3e5cf7,_0x03f7('0x6e'))){_0x3e5cf7=_0x3e5cf7[_0x03f7('0x6f')]('.wav49',_0x03f7('0x70'));}this[_0x03f7('0x16')][_0x3b739c][_0x03f7('0x71')]=_0x3e5cf7;var _0x556961=_['find'](this['channels'][_0x3b739c][_0x03f7('0x72')],{'filename':_0x3e5cf7});if(_[_0x03f7('0x5c')](_0x556961)){this[_0x03f7('0x16')][_0x3b739c][_0x03f7('0x72')]['push']({'filename':_0x3e5cf7,'createdAt':moment()[_0x03f7('0x3e')](_0x03f7('0x47')),'mixmonitorid':'','status':_0x03f7('0x73')});}}}catch(_0x3c5a7c){logger[_0x03f7('0x29')](_0x03f7('0x74'),_0x3b739c,util[_0x03f7('0x2a')](_0x3c5a7c,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncVarSet']=function(_0x27b250){try{if(this[_0x03f7('0x2c')](_0x27b250)){logger[_0x03f7('0x31')](_0x03f7('0x75'),_0x27b250[_0x03f7('0x2f')],util[_0x03f7('0x2a')](_0x27b250,{'showHidden':![],'depth':null}));if(this[_0x03f7('0x16')][_0x27b250[_0x03f7('0x2f')]]&&_0x27b250[_0x03f7('0x39')]!=_0x03f7('0x76')){if(this[_0x03f7('0x2c')](_0x27b250[_0x03f7('0x77')])){if(this[_0x03f7('0x2c')](_0x27b250[_0x03f7('0x77')][_0x03f7('0x78')])){logger[_0x03f7('0x2e')](_0x03f7('0x79'),_0x27b250[_0x03f7('0x2f')],_0x27b250['value']);this['syncMixMonitorFilename'](_0x27b250['uniqueid'],_0x27b250[_0x03f7('0x7a')]);}else if(this[_0x03f7('0x2c')](_0x27b250[_0x03f7('0x77')][_0x03f7('0x7b')])){logger[_0x03f7('0x2e')](_0x03f7('0x7c'),_0x27b250[_0x03f7('0x2f')],_0x27b250[_0x03f7('0x7a')]);this[_0x03f7('0x16')][_0x27b250[_0x03f7('0x2f')]][_0x03f7('0x30')]=_0x27b250[_0x03f7('0x7a')];}else if(this[_0x03f7('0x2c')](_0x27b250[_0x03f7('0x77')][_0x03f7('0x7d')])){logger[_0x03f7('0x2e')](_0x03f7('0x7e'),_0x27b250[_0x03f7('0x2f')],_0x27b250[_0x03f7('0x7a')]);this[_0x03f7('0x16')][_0x27b250[_0x03f7('0x2f')]][_0x03f7('0x7f')]=_0x27b250[_0x03f7('0x7a')];}else if(this[_0x03f7('0x2c')](_0x27b250['variable']['xmd-cdrtype'])){logger[_0x03f7('0x2e')](_0x03f7('0x80'),_0x27b250[_0x03f7('0x2f')],_0x27b250[_0x03f7('0x7a')]);this[_0x03f7('0x16')][_0x27b250[_0x03f7('0x2f')]][_0x03f7('0x81')]=_0x27b250['value'];}else if(this['isNotNull'](_0x27b250[_0x03f7('0x77')]['xmd-queue'])){logger[_0x03f7('0x2e')](_0x03f7('0x82'),_0x27b250[_0x03f7('0x2f')],_0x27b250[_0x03f7('0x7a')]['split'](',')[0x0]);this['channels'][_0x27b250[_0x03f7('0x2f')]][_0x03f7('0x9')]=_0x27b250[_0x03f7('0x7a')][_0x03f7('0x3a')](',')[0x0];}else if(this[_0x03f7('0x2c')](_0x27b250[_0x03f7('0x77')]['xmd-originatecalleridnum'])){logger[_0x03f7('0x2e')](_0x03f7('0x83'),_0x27b250[_0x03f7('0x2f')],_0x27b250['value']);this['channels'][_0x27b250[_0x03f7('0x2f')]][_0x03f7('0x84')]=_0x27b250['value'];}else if(this[_0x03f7('0x2c')](_0x27b250[_0x03f7('0x77')][_0x03f7('0x85')])){logger[_0x03f7('0x2e')](_0x03f7('0x86'),_0x27b250['uniqueid'],_0x27b250[_0x03f7('0x7a')]);this[_0x03f7('0x16')][_0x27b250['uniqueid']][_0x03f7('0x87')]=_0x27b250[_0x03f7('0x7a')];}else if(this[_0x03f7('0x2c')](_0x27b250[_0x03f7('0x77')][_0x03f7('0x88')])){logger[_0x03f7('0x2e')](_0x03f7('0x89'),_0x27b250[_0x03f7('0x2f')],_0x27b250[_0x03f7('0x7a')]);this[_0x03f7('0x16')][_0x27b250['uniqueid']]['calleridpreview']=_0x27b250['value'];}else if(this[_0x03f7('0x2c')](_0x27b250['variable'][_0x03f7('0x8a')])){logger[_0x03f7('0x2e')](_0x03f7('0x8b'),_0x27b250['uniqueid'],_0x27b250[_0x03f7('0x7a')]);this[_0x03f7('0x16')][_0x27b250[_0x03f7('0x2f')]][_0x03f7('0x9')]=_0x27b250[_0x03f7('0x7a')];}else if(this[_0x03f7('0x2c')](_0x27b250[_0x03f7('0x77')][_0x03f7('0x8c')])){logger[_0x03f7('0x2e')](_0x03f7('0x8d'),_0x27b250[_0x03f7('0x2f')],_0x27b250[_0x03f7('0x7a')]);this['channels'][_0x27b250['uniqueid']]['sipcalluniqueid']=_0x27b250[_0x03f7('0x7a')];}}}else if(this[_0x03f7('0x2c')](_0x27b250['variable']['mixmonitor_filename'])){if(_0x27b250[_0x03f7('0x7a')]){var _0x51661f=path[_0x03f7('0x8e')](_0x27b250[_0x03f7('0x7a')])[_0x03f7('0x40')];logger[_0x03f7('0x2e')](_0x03f7('0x79'),_0x51661f,_0x27b250[_0x03f7('0x7a')]);this[_0x03f7('0x6a')](_0x51661f,_0x27b250['value']);}}else if(this['channels'][_0x27b250[_0x03f7('0x33')]]){if(this[_0x03f7('0x2c')](_0x27b250[_0x03f7('0x77')])){if(this['isNotNull'](_0x27b250[_0x03f7('0x77')]['sipcallid'])){logger['info'](_0x03f7('0x8d'),_0x27b250['linkedid'],_0x27b250[_0x03f7('0x7a')]);this[_0x03f7('0x16')][_0x27b250[_0x03f7('0x33')]][_0x03f7('0x8f')]=_0x27b250[_0x03f7('0x7a')];}}}}}catch(_0x1cac2c){logger[_0x03f7('0x29')](_0x03f7('0x90'),_0x27b250[_0x03f7('0x2f')],util[_0x03f7('0x2a')](_0x1cac2c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x03f7('0x2b')][_0x03f7('0x91')]=function(_0x2e09da){try{if(this['isNotNull'](_0x2e09da)){logger['debug'](_0x03f7('0x92'),_0x2e09da[_0x03f7('0x2f')],util['inspect'](_0x2e09da,{'showHidden':![],'depth':null}));if(this['blindTransfers'][_0x2e09da[_0x03f7('0x33')]]){if(this[_0x03f7('0x16')][this[_0x03f7('0x18')][_0x2e09da[_0x03f7('0x33')]]['linkedid']]){this[_0x03f7('0x16')][this[_0x03f7('0x18')][_0x2e09da[_0x03f7('0x33')]]['linkedid']][_0x03f7('0x2f')]=_0x2e09da['uniqueid'];this['channels'][this['blindTransfers'][_0x2e09da['linkedid']][_0x03f7('0x33')]][_0x03f7('0x60')]=this[_0x03f7('0x16')][_0x2e09da[_0x03f7('0x2f')]]['answered'];this[_0x03f7('0x16')][this[_0x03f7('0x18')][_0x2e09da[_0x03f7('0x33')]]['linkedid']][_0x03f7('0x61')]=this[_0x03f7('0x16')][_0x2e09da[_0x03f7('0x2f')]][_0x03f7('0x61')];this['channels'][this[_0x03f7('0x18')][_0x2e09da[_0x03f7('0x33')]]['linkedid']]['destinationchannel']=this[_0x03f7('0x16')][this['blindTransfers'][_0x2e09da[_0x03f7('0x33')]]['linkedid']][_0x03f7('0x39')];this[_0x03f7('0x16')][this['blindTransfers'][_0x2e09da[_0x03f7('0x33')]][_0x03f7('0x33')]][_0x03f7('0x48')]=this[_0x03f7('0x16')][_0x2e09da[_0x03f7('0x2f')]][_0x03f7('0x48')];this[_0x03f7('0x16')][_0x2e09da['uniqueid']]=this[_0x03f7('0x16')][this[_0x03f7('0x18')][_0x2e09da['linkedid']][_0x03f7('0x33')]];delete this[_0x03f7('0x16')][this[_0x03f7('0x18')][_0x2e09da[_0x03f7('0x33')]][_0x03f7('0x33')]];}else if(this['channels'][this[_0x03f7('0x18')][_0x2e09da['linkedid']][_0x03f7('0x2f')]]){this['channels'][this[_0x03f7('0x18')][_0x2e09da[_0x03f7('0x33')]][_0x03f7('0x2f')]][_0x03f7('0x2f')]=[this[_0x03f7('0x16')][this[_0x03f7('0x18')][_0x2e09da[_0x03f7('0x33')]][_0x03f7('0x2f')]][_0x03f7('0x33')],this[_0x03f7('0x16')][this[_0x03f7('0x18')][_0x2e09da[_0x03f7('0x33')]][_0x03f7('0x2f')]][_0x03f7('0x33')]=this['channels'][this[_0x03f7('0x18')][_0x2e09da[_0x03f7('0x33')]][_0x03f7('0x2f')]]['uniqueid']][0x0];this['channels'][this[_0x03f7('0x18')][_0x2e09da['linkedid']]['uniqueid']][_0x03f7('0x60')]=this[_0x03f7('0x16')][_0x2e09da[_0x03f7('0x2f')]][_0x03f7('0x60')];this[_0x03f7('0x16')][this[_0x03f7('0x18')][_0x2e09da[_0x03f7('0x33')]][_0x03f7('0x2f')]]['answertime']=this[_0x03f7('0x16')][_0x2e09da[_0x03f7('0x2f')]][_0x03f7('0x61')];this[_0x03f7('0x16')][this['blindTransfers'][_0x2e09da[_0x03f7('0x33')]]['uniqueid']][_0x03f7('0x63')]=this['channels'][this['blindTransfers'][_0x2e09da['linkedid']]['uniqueid']][_0x03f7('0x39')];this[_0x03f7('0x16')][this[_0x03f7('0x18')][_0x2e09da['linkedid']][_0x03f7('0x2f')]][_0x03f7('0x48')]=this[_0x03f7('0x16')][_0x2e09da[_0x03f7('0x2f')]][_0x03f7('0x48')];this[_0x03f7('0x16')][_0x2e09da['uniqueid']]=this[_0x03f7('0x16')][this[_0x03f7('0x18')][_0x2e09da[_0x03f7('0x33')]][_0x03f7('0x2f')]];delete this[_0x03f7('0x16')][this[_0x03f7('0x18')][_0x2e09da[_0x03f7('0x33')]]['uniqueid']];}}if(this[_0x03f7('0x16')][_0x2e09da[_0x03f7('0x2f')]]){logger['info'](_0x03f7('0x93'),_0x2e09da[_0x03f7('0x2f')],_0x2e09da[_0x03f7('0x94')]);var _0x372a24=moment();this[_0x03f7('0x16')][_0x2e09da['uniqueid']][_0x03f7('0x95')]=_0x372a24[_0x03f7('0x3e')](_0x03f7('0x47'));this[_0x03f7('0x16')][_0x2e09da[_0x03f7('0x2f')]]['duration']=_0x372a24[_0x03f7('0x66')](this[_0x03f7('0x16')][_0x2e09da[_0x03f7('0x2f')]][_0x03f7('0x52')],_0x03f7('0x54'));if(this[_0x03f7('0x16')][_0x2e09da[_0x03f7('0x2f')]][_0x03f7('0x60')]){this[_0x03f7('0x16')][_0x2e09da['uniqueid']]['billableseconds']=_0x372a24['diff'](this['channels'][_0x2e09da[_0x03f7('0x2f')]]['answertime'],_0x03f7('0x54'));this[_0x03f7('0x16')][_0x2e09da[_0x03f7('0x2f')]][_0x03f7('0x62')]=this[_0x03f7('0x16')][_0x2e09da[_0x03f7('0x2f')]][_0x03f7('0x53')]-this[_0x03f7('0x16')][_0x2e09da[_0x03f7('0x2f')]]['billableseconds'];}if(_0x2e09da[_0x03f7('0x37')]==='from-sip'){if(this[_0x03f7('0x17')][_0x2e09da[_0x03f7('0x39')][_0x03f7('0x3a')]('-')[0x0]]){this[_0x03f7('0x17')][_0x2e09da[_0x03f7('0x39')][_0x03f7('0x3a')]('-')[0x0]]=_[_0x03f7('0x96')](this[_0x03f7('0x17')][_0x2e09da[_0x03f7('0x39')]['split']('-')[0x0]],['destconnectedlinenum']);logger['debug']('[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:',_0x2e09da[_0x03f7('0x2f')],util[_0x03f7('0x2a')]({'id':this[_0x03f7('0x17')][_0x2e09da['channel'][_0x03f7('0x3a')]('-')[0x0]]['id'],'destaccountcode':this[_0x03f7('0x17')][_0x2e09da['channel'][_0x03f7('0x3a')]('-')[0x0]]['accountcode']},{'showHidden':![],'depth':null}));this[_0x03f7('0x3d')](util[_0x03f7('0x3e')](_0x03f7('0x3f'),this['agents'][_0x2e09da[_0x03f7('0x39')]['split']('-')[0x0]][_0x03f7('0x40')]),_0x03f7('0x97'),{'id':this[_0x03f7('0x17')][_0x2e09da[_0x03f7('0x39')][_0x03f7('0x3a')]('-')[0x0]]['id'],'destaccountcode':this[_0x03f7('0x17')][_0x2e09da['channel'][_0x03f7('0x3a')]('-')[0x0]][_0x03f7('0x42')]});for(var _0x2f889e=0x0;_0x2f889e<Object[_0x03f7('0x55')](this[_0x03f7('0x17')])[_0x03f7('0x98')];_0x2f889e++){var _0x23a02a=Object[_0x03f7('0x55')](this[_0x03f7('0x17')])[_0x2f889e];var _0x591ce6=this[_0x03f7('0x17')][_0x23a02a];if(_0x591ce6['accountcode']===Number(this[_0x03f7('0x16')][_0x2e09da['uniqueid']]['connectedlinenum'])){this[_0x03f7('0x3d')](util[_0x03f7('0x3e')](_0x03f7('0x3f'),_0x591ce6[_0x03f7('0x40')]),_0x03f7('0x97'),{'id':_0x591ce6['id'],'destaccountcode':_0x591ce6[_0x03f7('0x42')],'transfer':this['channels'][_0x2e09da[_0x03f7('0x2f')]][_0x03f7('0x99')]});break;}}}}var _0x21eadc=this;Promise[_0x03f7('0x9a')]()[_0x03f7('0x9b')](function(){var _0x24fb88=_0x21eadc[_0x03f7('0x16')][_0x2e09da[_0x03f7('0x2f')]];if(typeof _0x24fb88[_0x03f7('0x99')]===_0x03f7('0x4b')){return;}if(_0x24fb88[_0x03f7('0x9c')]===!![]){return;}if(_['isEmpty'](_0x24fb88['monitors'])){return;}return RpcSetting[_0x03f7('0x9d')]()[_0x03f7('0x9b')](function(_0x2e0863){if(!_0x2e0863[_0x03f7('0x9e')])return;return Promise['resolve']()[_0x03f7('0x9b')](function(){return ami['Action']({'action':_0x03f7('0x9f'),'channel':_0x24fb88[_0x03f7('0x39')]})[_0x03f7('0xa0')](function(){});})[_0x03f7('0x9b')](function(){return ami[_0x03f7('0xa1')]({'action':_0x03f7('0x9f'),'channel':_0x24fb88[_0x03f7('0x63')]})['catch'](function(){})[_0x03f7('0xa2')](function(){var _0x51f2ed=_0x21eadc[_0x03f7('0x17')][_0x24fb88['destinationchannel'][_0x03f7('0x3a')]('-')[0x0]];if(!_0x51f2ed)return;io[_0x03f7('0x3d')](_0x03f7('0xa3'),{'agentId':_0x51f2ed['id'],'uniqueid':_0x24fb88[_0x03f7('0x2f')]});});});});})['then'](function(){if(_0x2e09da[_0x03f7('0xa4')]===_0x03f7('0xa5')){_0x21eadc[_0x03f7('0x18')][_0x2e09da[_0x03f7('0x2f')]]=_0x2e09da;}else{if(_0x21eadc[_0x03f7('0x16')][_0x2e09da['uniqueid']]&&_0x21eadc[_0x03f7('0x16')][_0x2e09da[_0x03f7('0x2f')]][_0x03f7('0x81')]===_0x03f7('0xa6')&&_0x21eadc[_0x03f7('0x18')][_0x2e09da[_0x03f7('0x2f')]]){_0x21eadc['channels'][_0x2e09da['uniqueid']][_0x03f7('0x2f')]=[_0x21eadc[_0x03f7('0x16')][_0x2e09da[_0x03f7('0x2f')]][_0x03f7('0x33')],_0x21eadc[_0x03f7('0x16')][_0x2e09da['uniqueid']]['linkedid']=_0x21eadc['channels'][_0x2e09da[_0x03f7('0x2f')]][_0x03f7('0x2f')]][0x0];delete _0x21eadc['blindTransfers'][_0x2e09da['uniqueid']];}}logger[_0x03f7('0x31')](_0x03f7('0xa7'),_0x2e09da[_0x03f7('0x2f')],util[_0x03f7('0x2a')](_0x21eadc['channels'][_0x2e09da[_0x03f7('0x2f')]],{'showHidden':![],'depth':null}));ami[_0x03f7('0x3d')](_0x03f7('0xa8'),_0x21eadc[_0x03f7('0x16')][_0x2e09da[_0x03f7('0x2f')]]);delete _0x21eadc[_0x03f7('0x16')][_0x2e09da[_0x03f7('0x2f')]];});}}}catch(_0x1f1e2f){logger[_0x03f7('0x29')](_0x03f7('0xa9'),_0x2e09da['uniqueid'],util['inspect'](_0x1f1e2f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x03f7('0x2b')][_0x03f7('0xaa')]=function(_0x118234){try{if(this[_0x03f7('0x2c')](_0x118234)){logger['info'](_0x03f7('0xab'),_0x118234['uniqueid'],_0x118234[_0x03f7('0xac')],_0x118234[_0x03f7('0xad')]);logger['debug'](_0x03f7('0xae'),_0x118234['uniqueid'],util[_0x03f7('0x2a')](_0x118234,{'showHidden':![],'depth':null}));var _0x3fbe51;if(this['channels'][_0x118234[_0x03f7('0xaf')]]){this['channels'][_0x118234[_0x03f7('0xaf')]][_0x03f7('0xb0')]=_0x118234[_0x03f7('0xac')];this['channels'][_0x118234['transfereeuniqueid']]['transferconnectedlinenum']=_0x118234[_0x03f7('0xad')];if(this[_0x03f7('0x16')][_0x118234[_0x03f7('0xb1')]]){_0x3fbe51=this['channels'][_0x118234['secondtransfereruniqueid']];this['channels'][_0x118234[_0x03f7('0xb1')]]=this['channels'][_0x118234['transfereeuniqueid']];this[_0x03f7('0x16')][_0x118234[_0x03f7('0xaf')]]=_0x3fbe51;}this[_0x03f7('0x16')][_0x118234['secondtransfereruniqueid']][_0x03f7('0x99')]='ATTENDED';}else if(this[_0x03f7('0x16')][_0x118234['transfertargetuniqueid']]){this[_0x03f7('0x16')][_0x118234[_0x03f7('0xb2')]][_0x03f7('0xb0')]=_0x118234[_0x03f7('0xac')];this['channels'][_0x118234['transfertargetuniqueid']][_0x03f7('0xb3')]=_0x118234[_0x03f7('0xad')];if(this[_0x03f7('0x16')][_0x118234[_0x03f7('0xb4')]]){_0x3fbe51=this[_0x03f7('0x16')][_0x118234['origtransfereruniqueid']];this['channels'][_0x118234[_0x03f7('0xb4')]]=this[_0x03f7('0x16')][_0x118234[_0x03f7('0xb2')]];this[_0x03f7('0x16')][_0x118234[_0x03f7('0xb2')]]=_0x3fbe51;}this[_0x03f7('0x16')][_0x118234['transfertargetuniqueid']][_0x03f7('0x99')]=_0x03f7('0xb5');}if((this[_0x03f7('0x16')][_0x118234['origtransfereruniqueid']]||this[_0x03f7('0x16')][_0x118234['origtransfererlinkedid']])&&this['channels'][_0x118234[_0x03f7('0xb1')]]){var _0x2b5661=_[_0x03f7('0xb6')]([this[_0x03f7('0x16')][_0x118234[_0x03f7('0xb4')]],this[_0x03f7('0x16')][_0x118234[_0x03f7('0xb7')]],this[_0x03f7('0x16')][_0x118234[_0x03f7('0xb1')]]],function(_0xf98411){return _0xf98411&&_0xf98411[_0x03f7('0x81')]===_0x03f7('0xa6')&&_0xf98411['routeid'];});if(_0x2b5661){if(this[_0x03f7('0x16')][_0x118234[_0x03f7('0xb4')]])this[_0x03f7('0x16')][_0x118234[_0x03f7('0xb4')]][_0x03f7('0x99')]=_0x03f7('0xb5');if(this[_0x03f7('0x16')][_0x118234[_0x03f7('0xb7')]])this[_0x03f7('0x16')][_0x118234[_0x03f7('0xb7')]]['transferType']=_0x03f7('0xb5');this['channels'][_0x118234[_0x03f7('0xb1')]][_0x03f7('0x99')]=_0x03f7('0xb5');}else{if(this[_0x03f7('0x16')][_0x118234[_0x03f7('0xaf')]]){this[_0x03f7('0x16')][_0x118234[_0x03f7('0xb1')]][_0x03f7('0x9c')]=!![];}if(this[_0x03f7('0x16')][_0x118234[_0x03f7('0xb2')]]){this[_0x03f7('0x16')][_0x118234[_0x03f7('0xb2')]][_0x03f7('0x9c')]=!![];}}}}}catch(_0x46202c){logger['error']('[%s][voiceCallReport][attendedtransfer]',_0x118234[_0x03f7('0x2f')],util[_0x03f7('0x2a')](_0x46202c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x03f7('0x2b')][_0x03f7('0xb8')]=function(_0x4dfd08){try{if(this[_0x03f7('0x2c')](_0x4dfd08)){logger['info'](_0x03f7('0xb9'),_0x4dfd08[_0x03f7('0x2f')],_0x4dfd08['transfereecalleridnum'],_0x4dfd08['extension']);logger[_0x03f7('0x31')]('[%s][voiceCallReport][blindtransfer]\x20event:',_0x4dfd08['uniqueid'],util['inspect'](_0x4dfd08,{'showHidden':![],'depth':null}));if(this[_0x03f7('0x16')][_0x4dfd08[_0x03f7('0xaf')]]){this[_0x03f7('0x16')][_0x4dfd08[_0x03f7('0xaf')]]['transfercalleridnum']=_0x4dfd08['transfereecalleridnum'];this[_0x03f7('0x16')][_0x4dfd08['transfereeuniqueid']]['transferconnectedlinenum']=_0x4dfd08[_0x03f7('0xba')];this['channels'][_0x4dfd08[_0x03f7('0xaf')]][_0x03f7('0x99')]=_0x03f7('0xbb');this['syncHangup']({'event':_0x03f7('0xa5'),'uniqueid':_0x4dfd08[_0x03f7('0xaf')],'linkedid':_0x4dfd08[_0x03f7('0xbc')],'context':_0x4dfd08[_0x03f7('0x37')],'channel':_0x4dfd08['transfererchannel']});}else{this[_0x03f7('0x16')][_0x4dfd08[_0x03f7('0xbc')]][_0x03f7('0x99')]=_0x03f7('0xbb');this[_0x03f7('0x91')]({'event':'BlindTransfer','uniqueid':_0x4dfd08[_0x03f7('0xbc')],'linkedid':_0x4dfd08[_0x03f7('0xaf')],'context':_0x4dfd08[_0x03f7('0x37')],'channel':_0x4dfd08[_0x03f7('0xbd')]});}}}catch(_0x30d791){logger['error'](_0x03f7('0xbe'),_0x4dfd08[_0x03f7('0x2f')],util[_0x03f7('0x2a')](_0x30d791,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x03f7('0x2b')][_0x03f7('0x25')]=function(_0x57da59){try{if(this['isNotNull'](_0x57da59)){logger[_0x03f7('0x31')](_0x03f7('0xbf'),_0x57da59[_0x03f7('0x2f')],util['inspect'](_0x57da59,{'showHidden':![],'depth':null}));if(this[_0x03f7('0x16')][_0x57da59[_0x03f7('0x2f')]]){if(!_['isNil'](this[_0x03f7('0x16')][_0x57da59[_0x03f7('0x2f')]][_0x03f7('0x61')])){this[_0x03f7('0x16')][_0x57da59[_0x03f7('0x2f')]][_0x03f7('0xc0')]=moment()[_0x03f7('0x3e')](_0x03f7('0x47'));logger[_0x03f7('0x2e')](_0x03f7('0xc1'),_0x57da59[_0x03f7('0x2f')],this[_0x03f7('0x16')][_0x57da59[_0x03f7('0x2f')]]['mohstarttime']);}}}}catch(_0xc4cf32){logger['error']('[%s][voiceCallReport][musiconholdstart]',_0x57da59['uniqueid'],util[_0x03f7('0x2a')](_0xc4cf32,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x03f7('0x2b')][_0x03f7('0xc2')]=function(_0x4194f3){try{if(this[_0x03f7('0x2c')](_0x4194f3)){logger[_0x03f7('0x31')](_0x03f7('0xc3'),_0x4194f3[_0x03f7('0x2f')],util[_0x03f7('0x2a')](_0x4194f3,{'showHidden':![],'depth':null}));if(this[_0x03f7('0x16')][_0x4194f3[_0x03f7('0x2f')]]){if(!_[_0x03f7('0x5c')](this[_0x03f7('0x16')][_0x4194f3[_0x03f7('0x2f')]][_0x03f7('0xc0')])){this[_0x03f7('0x16')][_0x4194f3[_0x03f7('0x2f')]]['mohtime']+=moment()[_0x03f7('0xc4')](0x0)[_0x03f7('0x66')](this[_0x03f7('0x16')][_0x4194f3[_0x03f7('0x2f')]][_0x03f7('0xc0')],_0x03f7('0x54'));logger[_0x03f7('0x2e')](_0x03f7('0xc5'),_0x4194f3[_0x03f7('0x2f')],this[_0x03f7('0x16')][_0x4194f3[_0x03f7('0x2f')]][_0x03f7('0xc6')]);delete this[_0x03f7('0x16')][_0x4194f3['uniqueid']]['mohstarttime'];}}}}catch(_0x24f940){logger[_0x03f7('0x29')]('[%s][voiceCallReport][musiconholdstop]',_0x4194f3[_0x03f7('0x2f')],util[_0x03f7('0x2a')](_0x24f940,{'showHidden':![],'depth':null}));}};module['exports']=VoiceCallReport;