X-Git-Url: http://repos.xcallymotion.com/?a=blobdiff_plain;f=server%2Fservices%2Fami%2Freport%2FvoiceCallReport.js;h=e934cd19469305c41e01f4b9218d9d1c73f60b6d;hb=0efc675adde92ca51a2377339d9e99ab851456b5;hp=98123d984d3bbf8aa61399d147231755728f3dcc;hpb=fe8c827137dd3c5e6b46ed251e0129d077b10dab;p=motion2.git diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 98123d9..e934cd1 100644 --- a/server/services/ami/report/voiceCallReport.js +++ b/server/services/ami/report/voiceCallReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe449=['outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','[%s][voiceCallReport][hangup]','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transferconnectedlinenum','secondtransfereruniqueid','ATTENDED','transfertargetuniqueid','transfercalleridnum','origtransfereruniqueid','origtransfererlinkedid','routeid','syncBlindTransfer','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','extension','[%s][voiceCallReport][blindtransfer]\x20event:','transfereecalleridnum','BLIND','transfereruniqueid','transfererchannel','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','[%s][voiceCallReport][musiconholdstop]','exports','lodash','moment','util','path','../../../config/environment','../../../config/logger','ami','../ami','../model/channel','queue','agi','dial','voicemail','NO\x20ANSWER','FAILED','BUSY','redis','defaults','localhost','socket.io-emitter','channels','agents','coreshowchannel','syncNewExten','bind','newexten','newchannel','syncNewChannel','newstate','syncNewState','varset','syncVarSet','hangup','newcallerid','syncAttendedTransfer','blindtransfer','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','error','[voiceCallReport][coreshowchannels]','prototype','emit','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','calleridnum','debug','[%s][voiceCallReport][newcallerid]\x20event:','uniqueid','inspect','linkedid','isUndefined','pick','context','from-sip','channel','split','exten','xcally-motion-preview','connectedlinenum','format','user:agentconnect','[%s][voiceCallReport][newcallerid]','OutgoingSpoolFailed','blindTransfers','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','merge','keys','destconnectedlinenum','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','accountcode','user:%s','name','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','toLowerCase','applicationdata','appdata','startsWith','application','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','starttime','duration','subtract','seconds','lastdata','set','cdr(','match','type','[%s][voiceCallReport][newexten]','isNotNull','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','calleridname','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','connectedlinename','destinationchannel','UserId','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','.wav49','replace','.WAV','monitorFilename','find','monitors','isNil','push','[%s][voiceCallReport][mixMonitorFilename]','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','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','calleridpreview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','parse','sipcalllinkedid','[%s][voiceCallReport][varset]','syncHangup','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','endtime','diff','holdtime','billableseconds','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','transferType','resolve','isEmpty','getSettings','stopRecordingOnTransfer','then','Action','StopMixMonitor','catch','webbar:stopmonitors','BlindTransfer'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xe449,0xe4));var _0x9e44=function(_0x5407e6,_0x18fcc6){_0x5407e6=_0x5407e6-0x0;var _0x215815=_0xe449[_0x5407e6];return _0x215815;};'use strict';var _=require(_0x9e44('0x0'));var moment=require(_0x9e44('0x1'));var util=require(_0x9e44('0x2'));var path=require(_0x9e44('0x3'));var Redis=require('ioredis');var config=require(_0x9e44('0x4'));var logger=require(_0x9e44('0x5'))(_0x9e44('0x6'));var ami=require(_0x9e44('0x7'));var Channel=require(_0x9e44('0x8'));var RpcSetting=require('../rpc/setting');var applications=['set',_0x9e44('0x9'),_0x9e44('0xa'),_0x9e44('0xb'),'playback',_0x9e44('0xc')];var dispositions=[_0x9e44('0xd'),_0x9e44('0xe'),'FAILED',_0x9e44('0xd'),'NO\x20ANSWER',_0x9e44('0xd'),'ANSWERED',_0x9e44('0xf'),'FAILED',_0x9e44('0xe'),_0x9e44('0xe')];config[_0x9e44('0x10')]=_[_0x9e44('0x11')](config[_0x9e44('0x10')],{'host':_0x9e44('0x12'),'port':0x18eb});var io=require(_0x9e44('0x13'))(new Redis(config[_0x9e44('0x10')]));function VoiceCallReport(_0x230341){this[_0x9e44('0x14')]=_0x230341[_0x9e44('0x14')];this[_0x9e44('0x15')]=_0x230341[_0x9e44('0x15')];this['blindTransfers']={};ami['on'](_0x9e44('0x16'),this[_0x9e44('0x17')][_0x9e44('0x18')](this));ami['on'](_0x9e44('0x19'),this[_0x9e44('0x17')]['bind'](this));ami['on'](_0x9e44('0x1a'),this[_0x9e44('0x1b')][_0x9e44('0x18')](this));ami['on'](_0x9e44('0x1c'),this[_0x9e44('0x1d')]['bind'](this));ami['on'](_0x9e44('0x1e'),this[_0x9e44('0x1f')][_0x9e44('0x18')](this));ami['on'](_0x9e44('0x20'),this['syncHangup'][_0x9e44('0x18')](this));ami['on'](_0x9e44('0x21'),this['syncNewCallerId'][_0x9e44('0x18')](this));ami['on']('attendedtransfer',this[_0x9e44('0x22')][_0x9e44('0x18')](this));ami['on'](_0x9e44('0x23'),this['syncBlindTransfer']['bind'](this));ami['on'](_0x9e44('0x24'),this[_0x9e44('0x25')]['bind'](this));ami['on']('musiconholdstop',this[_0x9e44('0x26')][_0x9e44('0x18')](this));try{logger[_0x9e44('0x27')](_0x9e44('0x28'));ami['actionCoreShowChannels']();}catch(_0x11f225){logger[_0x9e44('0x29')](_0x9e44('0x2a'),util['inspect'](_0x11f225,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x9e44('0x2b')]['isNotNull']=function(_0x2fa563){return _0x2fa563!==null&&!_['isUndefined'](_0x2fa563);};VoiceCallReport['prototype'][_0x9e44('0x2c')]=function(_0x72a7db,_0x2486b1,_0x447027){io['to'](_0x72a7db)['emit'](_0x2486b1,_0x447027);};VoiceCallReport[_0x9e44('0x2b')]['syncNewCallerId']=function(_0x40efe4){try{if(this['isNotNull'](_0x40efe4)){logger['info'](_0x9e44('0x2d'),_0x40efe4['uniqueid'],_0x40efe4['calleridname'],_0x40efe4[_0x9e44('0x2e')]);logger[_0x9e44('0x2f')](_0x9e44('0x30'),_0x40efe4[_0x9e44('0x31')],util[_0x9e44('0x32')](_0x40efe4,{'showHidden':![],'depth':null}));if(_0x40efe4['uniqueid']===_0x40efe4[_0x9e44('0x33')]){if(!_[_0x9e44('0x34')](this[_0x9e44('0x14')][_0x40efe4[_0x9e44('0x31')]])){_['merge'](this[_0x9e44('0x14')][_0x40efe4['uniqueid']],_[_0x9e44('0x35')](_0x40efe4,_['keys'](this[_0x9e44('0x14')][_0x40efe4[_0x9e44('0x31')]])));}}if(_0x40efe4[_0x9e44('0x36')]===_0x9e44('0x37')){if(this['agents'][_0x40efe4[_0x9e44('0x38')][_0x9e44('0x39')]('-')[0x0]]){if(_0x40efe4[_0x9e44('0x3a')]==_0x9e44('0x3b')){this[_0x9e44('0x15')][_0x40efe4['channel'][_0x9e44('0x39')]('-')[0x0]]['destconnectedlinenum']=_0x40efe4[_0x9e44('0x3c')];this[_0x9e44('0x2c')](util[_0x9e44('0x3d')]('user:%s',this[_0x9e44('0x15')][_0x40efe4[_0x9e44('0x38')][_0x9e44('0x39')]('-')[0x0]]['name']),_0x9e44('0x3e'),{'destaccountcode':this[_0x9e44('0x15')][_0x40efe4['channel'][_0x9e44('0x39')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x40efe4[_0x9e44('0x3c')]});}}}}}catch(_0xc2ca48){logger[_0x9e44('0x29')](_0x9e44('0x3f'),_0x40efe4['uniqueid'],util['inspect'](_0xc2ca48,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9e44('0x2b')][_0x9e44('0x1b')]=function(_0x335edb){try{if(this['isNotNull'](_0x335edb)){logger[_0x9e44('0x2f')]('[%s][voiceCallReport][newchannel]\x20event:',_0x335edb[_0x9e44('0x31')],util[_0x9e44('0x32')](_0x335edb,{'showHidden':![],'depth':null}));if(this[_0x9e44('0x14')][_0x335edb[_0x9e44('0x31')]])return;if(_0x335edb['channel']===_0x9e44('0x40'))return;if(_0x335edb['uniqueid']!==_0x335edb['linkedid']&&!this[_0x9e44('0x41')][_0x335edb['linkedid']])return;logger[_0x9e44('0x27')](_0x9e44('0x42'),_0x335edb[_0x9e44('0x31')],_0x335edb[_0x9e44('0x36')],_0x335edb[_0x9e44('0x3a')]);this[_0x9e44('0x14')][_0x335edb['uniqueid']]=new Channel();this['channels'][_0x335edb['uniqueid']]['starttime']=moment()[_0x9e44('0x3d')](_0x9e44('0x43'));this[_0x9e44('0x14')][_0x335edb[_0x9e44('0x31')]][_0x9e44('0x44')]=dispositions[_[_0x9e44('0x45')](_0x335edb[_0x9e44('0x46')])];_[_0x9e44('0x47')](this[_0x9e44('0x14')][_0x335edb[_0x9e44('0x31')]],_[_0x9e44('0x35')](_0x335edb,_[_0x9e44('0x48')](this[_0x9e44('0x14')][_0x335edb['uniqueid']])));if(_0x335edb['context']===_0x9e44('0x37')){if(this[_0x9e44('0x15')][_0x335edb[_0x9e44('0x38')][_0x9e44('0x39')]('-')[0x0]]){if(_[_0x9e44('0x34')](this[_0x9e44('0x15')][_0x335edb['channel']['split']('-')[0x0]][_0x9e44('0x49')])){this[_0x9e44('0x15')][_0x335edb[_0x9e44('0x38')][_0x9e44('0x39')]('-')[0x0]][_0x9e44('0x49')]=_0x335edb[_0x9e44('0x3a')];logger['debug'](_0x9e44('0x4a'),_0x335edb[_0x9e44('0x31')],util[_0x9e44('0x32')]({'id':this[_0x9e44('0x15')][_0x335edb[_0x9e44('0x38')][_0x9e44('0x39')]('-')[0x0]]['id'],'destaccountcode':this[_0x9e44('0x15')][_0x335edb[_0x9e44('0x38')][_0x9e44('0x39')]('-')[0x0]][_0x9e44('0x4b')],'destconnectedlinenum':_0x335edb[_0x9e44('0x3a')]},{'showHidden':![],'depth':null}));this[_0x9e44('0x2c')](util[_0x9e44('0x3d')](_0x9e44('0x4c'),this['agents'][_0x335edb['channel'][_0x9e44('0x39')]('-')[0x0]][_0x9e44('0x4d')]),_0x9e44('0x3e'),{'id':this['agents'][_0x335edb['channel'][_0x9e44('0x39')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x335edb['channel'][_0x9e44('0x39')]('-')[0x0]][_0x9e44('0x4b')],'destconnectedlinenum':_0x335edb[_0x9e44('0x3a')]});}}}}}catch(_0x400253){logger[_0x9e44('0x29')](_0x9e44('0x4e'),_0x335edb[_0x9e44('0x31')],util[_0x9e44('0x32')](_0x400253,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9e44('0x2b')][_0x9e44('0x17')]=function(_0x8d9d27){try{if(this['isNotNull'](_0x8d9d27)){logger[_0x9e44('0x2f')](_0x9e44('0x4f'),_0x8d9d27[_0x9e44('0x31')],util[_0x9e44('0x32')](_0x8d9d27,{'showHidden':![],'depth':null}));if(_0x8d9d27[_0x9e44('0x38')]===_0x9e44('0x40')||_0x8d9d27[_0x9e44('0x3a')]==='h')return;if(_0x8d9d27[_0x9e44('0x31')]===_0x8d9d27['linkedid']||this[_0x9e44('0x41')][_0x8d9d27['linkedid']]){_0x8d9d27['application']=_0x8d9d27['application'][_0x9e44('0x50')]();_0x8d9d27[_0x9e44('0x51')]=_0x8d9d27[_0x9e44('0x52')]||_0x8d9d27[_0x9e44('0x51')];if(_0x8d9d27[_0x9e44('0x52')]&&!_0x8d9d27[_0x9e44('0x52')][_0x9e44('0x53')]('CDR(routeAlias)')&&_0x8d9d27[_0x9e44('0x54')]!=='queue'){_0x8d9d27[_0x9e44('0x51')]=_0x8d9d27[_0x9e44('0x51')][_0x9e44('0x50')]();}logger[_0x9e44('0x27')](_0x9e44('0x55'),_0x8d9d27[_0x9e44('0x31')],_0x8d9d27['application'],_0x8d9d27[_0x9e44('0x51')]);if(_[_0x9e44('0x34')](this['channels'][_0x8d9d27['uniqueid']])){this[_0x9e44('0x14')][_0x8d9d27[_0x9e44('0x31')]]=new Channel();this['channels'][_0x8d9d27[_0x9e44('0x31')]][_0x9e44('0x56')]=_0x8d9d27[_0x9e44('0x57')]?moment()[_0x9e44('0x58')](moment[_0x9e44('0x57')](_0x8d9d27[_0x9e44('0x57')])['seconds'](),_0x9e44('0x59'))['format'](_0x9e44('0x43')):moment()[_0x9e44('0x3d')](_0x9e44('0x43'));this[_0x9e44('0x14')][_0x8d9d27[_0x9e44('0x31')]]['disposition']=_0x9e44('0xd');}_['merge'](this[_0x9e44('0x14')][_0x8d9d27[_0x9e44('0x31')]],_[_0x9e44('0x35')](_0x8d9d27,_[_0x9e44('0x48')](this[_0x9e44('0x14')][_0x8d9d27[_0x9e44('0x31')]])));if(_['includes'](applications,_0x8d9d27[_0x9e44('0x54')])){this[_0x9e44('0x14')][_0x8d9d27[_0x9e44('0x31')]]['lastapplication']=_0x8d9d27[_0x9e44('0x54')];this['channels'][_0x8d9d27[_0x9e44('0x31')]][_0x9e44('0x5a')]=_0x8d9d27['applicationdata'];if(_0x8d9d27[_0x9e44('0x54')]===_0x9e44('0x5b')&&_[_0x9e44('0x53')](_0x8d9d27['applicationdata']['toLowerCase'](),_0x9e44('0x5c'))){var _0x13e6eb=_0x8d9d27[_0x9e44('0x51')]['split']('=');var _0x4a0df6=_0x13e6eb[0x0][_0x9e44('0x50')]()[_0x9e44('0x5d')](/cdr\((.*)\)/);if(_0x4a0df6){if(_0x4a0df6[0x1]===_0x9e44('0x5e')&&!_['isNil'](this[_0x9e44('0x14')][_0x8d9d27[_0x9e44('0x31')]][_0x4a0df6[0x1]]))return;this['channels'][_0x8d9d27[_0x9e44('0x31')]][_0x4a0df6[0x1]]=_0x13e6eb[0x1];}}else if(_0x8d9d27[_0x9e44('0x54')]===_0x9e44('0x9')){this[_0x9e44('0x14')][_0x8d9d27[_0x9e44('0x31')]][_0x9e44('0x9')]=_0x8d9d27['applicationdata']['split'](',')[0x0];}}}}}catch(_0x42021e){logger[_0x9e44('0x29')](_0x9e44('0x5f'),_0x8d9d27[_0x9e44('0x31')],util[_0x9e44('0x32')](_0x42021e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9e44('0x2b')][_0x9e44('0x1d')]=function(_0x5755f7){try{if(this[_0x9e44('0x60')](_0x5755f7)){logger['info'](_0x9e44('0x61'),_0x5755f7[_0x9e44('0x31')],_0x5755f7[_0x9e44('0x33')],_0x5755f7[_0x9e44('0x62')],_0x5755f7[_0x9e44('0x2e')]);logger[_0x9e44('0x2f')](_0x9e44('0x63'),_0x5755f7[_0x9e44('0x31')],util[_0x9e44('0x32')](_0x5755f7,{'showHidden':![],'depth':null}));if(_0x5755f7[_0x9e44('0x46')]!=='6')return;if(_0x5755f7[_0x9e44('0x31')]!==_0x5755f7[_0x9e44('0x33')]){var _0x55a272=moment();if(this[_0x9e44('0x14')][_0x5755f7[_0x9e44('0x33')]]){if(!this[_0x9e44('0x14')][_0x5755f7[_0x9e44('0x33')]]['answered']){this[_0x9e44('0x14')][_0x5755f7[_0x9e44('0x33')]][_0x9e44('0x64')]=!![];this[_0x9e44('0x14')][_0x5755f7[_0x9e44('0x33')]][_0x9e44('0x65')]=_0x55a272[_0x9e44('0x3d')](_0x9e44('0x43'));if(this[_0x9e44('0x14')][_0x5755f7[_0x9e44('0x33')]][_0x9e44('0x56')]){this[_0x9e44('0x14')][_0x5755f7['linkedid']]['holdtime']=_0x55a272['diff'](this['channels'][_0x5755f7[_0x9e44('0x33')]]['starttime'],'seconds');}}this['channels'][_0x5755f7[_0x9e44('0x33')]][_0x9e44('0x33')]=_0x5755f7[_0x9e44('0x31')];if(_0x5755f7['calleridnum']!==_0x9e44('0x3b')){this[_0x9e44('0x14')][_0x5755f7[_0x9e44('0x33')]][_0x9e44('0x3c')]=_0x5755f7['calleridnum'];}this[_0x9e44('0x14')][_0x5755f7[_0x9e44('0x33')]][_0x9e44('0x66')]=_0x5755f7['calleridname'];this[_0x9e44('0x14')][_0x5755f7[_0x9e44('0x33')]][_0x9e44('0x67')]=_0x5755f7[_0x9e44('0x38')];this['channels'][_0x5755f7[_0x9e44('0x33')]][_0x9e44('0x44')]=dispositions[_[_0x9e44('0x45')](_0x5755f7[_0x9e44('0x46')])];if(this['agents'][_0x5755f7[_0x9e44('0x38')]['split']('-')[0x0]]){this[_0x9e44('0x14')][_0x5755f7[_0x9e44('0x33')]][_0x9e44('0x68')]=this['agents'][_0x5755f7[_0x9e44('0x38')]['split']('-')[0x0]]['id'];this[_0x9e44('0x14')][_0x5755f7[_0x9e44('0x33')]]['membername']=this[_0x9e44('0x15')][_0x5755f7[_0x9e44('0x38')][_0x9e44('0x39')]('-')[0x0]]['name'];}}if(this[_0x9e44('0x14')][_0x5755f7[_0x9e44('0x31')]]){if(!this[_0x9e44('0x14')][_0x5755f7['uniqueid']][_0x9e44('0x64')]){this[_0x9e44('0x14')][_0x5755f7[_0x9e44('0x31')]][_0x9e44('0x64')]=!![];this[_0x9e44('0x14')][_0x5755f7[_0x9e44('0x31')]][_0x9e44('0x65')]=_0x55a272[_0x9e44('0x3d')](_0x9e44('0x43'));if(this[_0x9e44('0x14')][_0x5755f7[_0x9e44('0x31')]]['starttime']){this['channels'][_0x5755f7[_0x9e44('0x31')]]['holdtime']=_0x55a272['diff'](this[_0x9e44('0x14')][_0x5755f7[_0x9e44('0x31')]][_0x9e44('0x56')],_0x9e44('0x59'));}}if(_0x5755f7['calleridnum']!==_0x9e44('0x3b')){this[_0x9e44('0x14')][_0x5755f7['uniqueid']][_0x9e44('0x3c')]=_0x5755f7[_0x9e44('0x2e')];}this[_0x9e44('0x14')][_0x5755f7[_0x9e44('0x31')]]['connectedlinename']=_0x5755f7['calleridname'];this[_0x9e44('0x14')][_0x5755f7[_0x9e44('0x31')]][_0x9e44('0x67')]=_0x5755f7[_0x9e44('0x38')];this['channels'][_0x5755f7[_0x9e44('0x31')]][_0x9e44('0x44')]=dispositions[_[_0x9e44('0x45')](_0x5755f7[_0x9e44('0x46')])];}}else{if(this[_0x9e44('0x14')][_0x5755f7[_0x9e44('0x31')]]){if(this[_0x9e44('0x15')][_0x5755f7['channel'][_0x9e44('0x39')]('-')[0x0]]){this[_0x9e44('0x14')][_0x5755f7['uniqueid']][_0x9e44('0x68')]=this[_0x9e44('0x15')][_0x5755f7[_0x9e44('0x38')][_0x9e44('0x39')]('-')[0x0]]['id'];this[_0x9e44('0x14')][_0x5755f7[_0x9e44('0x31')]]['membername']=this['agents'][_0x5755f7[_0x9e44('0x38')][_0x9e44('0x39')]('-')[0x0]][_0x9e44('0x4d')];}}}if(_0x5755f7[_0x9e44('0x36')]==='from-sip'){if(this[_0x9e44('0x15')][_0x5755f7[_0x9e44('0x38')][_0x9e44('0x39')]('-')[0x0]]){this[_0x9e44('0x15')][_0x5755f7[_0x9e44('0x38')][_0x9e44('0x39')]('-')[0x0]][_0x9e44('0x49')]=_0x5755f7['exten'];var _0x3c7a73,_0x1420aa;if(this[_0x9e44('0x14')][_0x5755f7[_0x9e44('0x31')]]){_0x3c7a73=this[_0x9e44('0x14')][_0x5755f7[_0x9e44('0x31')]]['routealias'];_0x1420aa=this[_0x9e44('0x14')][_0x5755f7[_0x9e44('0x31')]][_0x9e44('0x9')];}else if(this[_0x9e44('0x14')][_0x5755f7[_0x9e44('0x33')]]){_0x3c7a73=this[_0x9e44('0x14')][_0x5755f7[_0x9e44('0x33')]][_0x9e44('0x69')];_0x1420aa=this[_0x9e44('0x14')][_0x5755f7[_0x9e44('0x33')]][_0x9e44('0x9')];}this[_0x9e44('0x15')][_0x5755f7[_0x9e44('0x38')][_0x9e44('0x39')]('-')[0x0]][_0x9e44('0x9')]=_0x1420aa;this[_0x9e44('0x15')][_0x5755f7[_0x9e44('0x38')][_0x9e44('0x39')]('-')[0x0]][_0x9e44('0x69')]=_0x3c7a73;logger[_0x9e44('0x2f')](_0x9e44('0x6a'),_0x5755f7[_0x9e44('0x31')],util[_0x9e44('0x32')]({'id':this[_0x9e44('0x15')][_0x5755f7[_0x9e44('0x38')][_0x9e44('0x39')]('-')[0x0]]['id'],'destaccountcode':this[_0x9e44('0x15')][_0x5755f7['channel']['split']('-')[0x0]][_0x9e44('0x4b')],'destconnectedlinenum':_0x5755f7[_0x9e44('0x3a')],'routealias':_0x3c7a73,'queue':_0x1420aa||undefined},{'showHidden':![],'depth':null}));this['emit'](util[_0x9e44('0x3d')]('user:%s',this[_0x9e44('0x15')][_0x5755f7[_0x9e44('0x38')][_0x9e44('0x39')]('-')[0x0]][_0x9e44('0x4d')]),_0x9e44('0x3e'),{'id':this[_0x9e44('0x15')][_0x5755f7[_0x9e44('0x38')][_0x9e44('0x39')]('-')[0x0]]['id'],'agentconnected':!![],'destaccountcode':this[_0x9e44('0x15')][_0x5755f7[_0x9e44('0x38')][_0x9e44('0x39')]('-')[0x0]][_0x9e44('0x4b')],'destconnectedlinenum':_0x5755f7[_0x9e44('0x3a')],'routealias':_0x3c7a73,'queue':_0x1420aa||undefined});}}}}catch(_0x2d4568){logger[_0x9e44('0x29')]('[%s][voiceCallReport][newstate]',_0x5755f7[_0x9e44('0x31')],util['inspect'](_0x2d4568,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x9e44('0x6b')]=function(_0x4a9d30,_0x5206d3){try{if(this['channels'][_0x4a9d30]){logger['info'](_0x9e44('0x6c'),_0x4a9d30,_0x5206d3);this['channels'][_0x4a9d30]['monitor']=!![];if(_['endsWith'](_0x5206d3,_0x9e44('0x6d'))){_0x5206d3=_0x5206d3[_0x9e44('0x6e')](_0x9e44('0x6d'),_0x9e44('0x6f'));}this[_0x9e44('0x14')][_0x4a9d30][_0x9e44('0x70')]=_0x5206d3;var _0x201fdf=_[_0x9e44('0x71')](this[_0x9e44('0x14')][_0x4a9d30][_0x9e44('0x72')],{'filename':_0x5206d3});if(_[_0x9e44('0x73')](_0x201fdf)){this[_0x9e44('0x14')][_0x4a9d30][_0x9e44('0x72')][_0x9e44('0x74')]({'filename':_0x5206d3,'createdAt':moment()[_0x9e44('0x3d')](_0x9e44('0x43')),'mixmonitorid':'','status':'rec'});}}}catch(_0x3f6ad1){logger[_0x9e44('0x29')](_0x9e44('0x75'),_0x4a9d30,util[_0x9e44('0x32')](_0x3f6ad1,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9e44('0x2b')][_0x9e44('0x1f')]=function(_0x33e386){try{if(this[_0x9e44('0x60')](_0x33e386)){logger[_0x9e44('0x2f')]('[%s][voiceCallReport][varset]\x20event:',_0x33e386['uniqueid'],util[_0x9e44('0x32')](_0x33e386,{'showHidden':![],'depth':null}));if(this['channels'][_0x33e386[_0x9e44('0x31')]]&&_0x33e386[_0x9e44('0x38')]!=_0x9e44('0x40')){if(this['isNotNull'](_0x33e386[_0x9e44('0x76')])){if(this[_0x9e44('0x60')](_0x33e386[_0x9e44('0x76')][_0x9e44('0x77')])){logger['info'](_0x9e44('0x78'),_0x33e386[_0x9e44('0x31')],_0x33e386[_0x9e44('0x79')]);this[_0x9e44('0x6b')](_0x33e386[_0x9e44('0x31')],_0x33e386['value']);}else if(this['isNotNull'](_0x33e386[_0x9e44('0x76')][_0x9e44('0x7a')])){logger['info'](_0x9e44('0x7b'),_0x33e386['uniqueid'],_0x33e386[_0x9e44('0x79')]);this[_0x9e44('0x14')][_0x33e386[_0x9e44('0x31')]][_0x9e44('0x2e')]=_0x33e386['value'];}else if(this[_0x9e44('0x60')](_0x33e386[_0x9e44('0x76')][_0x9e44('0x7c')])){logger[_0x9e44('0x27')](_0x9e44('0x7d'),_0x33e386['uniqueid'],_0x33e386[_0x9e44('0x79')]);this[_0x9e44('0x14')][_0x33e386['uniqueid']][_0x9e44('0x7e')]=_0x33e386[_0x9e44('0x79')];}else if(this['isNotNull'](_0x33e386[_0x9e44('0x76')]['xmd-cdrtype'])){logger[_0x9e44('0x27')](_0x9e44('0x7f'),_0x33e386[_0x9e44('0x31')],_0x33e386['value']);this[_0x9e44('0x14')][_0x33e386[_0x9e44('0x31')]][_0x9e44('0x5e')]=_0x33e386['value'];}else if(this[_0x9e44('0x60')](_0x33e386[_0x9e44('0x76')][_0x9e44('0x80')])){logger[_0x9e44('0x27')](_0x9e44('0x81'),_0x33e386[_0x9e44('0x31')],_0x33e386[_0x9e44('0x79')][_0x9e44('0x39')](',')[0x0]);this[_0x9e44('0x14')][_0x33e386[_0x9e44('0x31')]][_0x9e44('0x9')]=_0x33e386[_0x9e44('0x79')][_0x9e44('0x39')](',')[0x0];}else if(this[_0x9e44('0x60')](_0x33e386[_0x9e44('0x76')][_0x9e44('0x82')])){logger[_0x9e44('0x27')](_0x9e44('0x83'),_0x33e386['uniqueid'],_0x33e386[_0x9e44('0x79')]);this[_0x9e44('0x14')][_0x33e386[_0x9e44('0x31')]][_0x9e44('0x84')]=_0x33e386[_0x9e44('0x79')];}else if(this['isNotNull'](_0x33e386[_0x9e44('0x76')]['xmd-destination'])){logger[_0x9e44('0x27')](_0x9e44('0x85'),_0x33e386[_0x9e44('0x31')],_0x33e386[_0x9e44('0x79')]);this[_0x9e44('0x14')][_0x33e386[_0x9e44('0x31')]][_0x9e44('0x86')]=_0x33e386[_0x9e44('0x79')];}else if(this[_0x9e44('0x60')](_0x33e386[_0x9e44('0x76')][_0x9e44('0x87')])){logger[_0x9e44('0x27')]('[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s',_0x33e386['uniqueid'],_0x33e386[_0x9e44('0x79')]);this['channels'][_0x33e386[_0x9e44('0x31')]][_0x9e44('0x88')]=_0x33e386[_0x9e44('0x79')];}else if(this[_0x9e44('0x60')](_0x33e386['variable'][_0x9e44('0x89')])){logger[_0x9e44('0x27')](_0x9e44('0x8a'),_0x33e386[_0x9e44('0x31')],_0x33e386['value']);this[_0x9e44('0x14')][_0x33e386['uniqueid']][_0x9e44('0x9')]=_0x33e386['value'];}else if(this[_0x9e44('0x60')](_0x33e386['variable'][_0x9e44('0x8b')])){logger[_0x9e44('0x27')](_0x9e44('0x8c'),_0x33e386[_0x9e44('0x31')],_0x33e386['value']);this[_0x9e44('0x14')][_0x33e386[_0x9e44('0x31')]][_0x9e44('0x8d')]=_0x33e386[_0x9e44('0x79')];}}}else if(this[_0x9e44('0x60')](_0x33e386[_0x9e44('0x76')][_0x9e44('0x77')])){if(_0x33e386[_0x9e44('0x79')]){var _0x18aadc=path[_0x9e44('0x8e')](_0x33e386[_0x9e44('0x79')])[_0x9e44('0x4d')];logger[_0x9e44('0x27')]('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x18aadc,_0x33e386['value']);this[_0x9e44('0x6b')](_0x18aadc,_0x33e386['value']);}}else if(this['channels'][_0x33e386['linkedid']]){if(this[_0x9e44('0x60')](_0x33e386[_0x9e44('0x76')])){if(this[_0x9e44('0x60')](_0x33e386['variable']['sipcallid'])){logger[_0x9e44('0x27')](_0x9e44('0x8c'),_0x33e386[_0x9e44('0x33')],_0x33e386[_0x9e44('0x79')]);this[_0x9e44('0x14')][_0x33e386['linkedid']][_0x9e44('0x8f')]=_0x33e386[_0x9e44('0x79')];}}}}}catch(_0x3ee393){logger['error'](_0x9e44('0x90'),_0x33e386[_0x9e44('0x31')],util[_0x9e44('0x32')](_0x3ee393,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x9e44('0x91')]=function(_0x954e00){try{if(this[_0x9e44('0x60')](_0x954e00)){logger[_0x9e44('0x2f')](_0x9e44('0x92'),_0x954e00[_0x9e44('0x31')],util[_0x9e44('0x32')](_0x954e00,{'showHidden':![],'depth':null}));if(this[_0x9e44('0x41')][_0x954e00['linkedid']]){if(this[_0x9e44('0x14')][this['blindTransfers'][_0x954e00[_0x9e44('0x33')]][_0x9e44('0x33')]]){this['channels'][this[_0x9e44('0x41')][_0x954e00['linkedid']][_0x9e44('0x33')]][_0x9e44('0x31')]=_0x954e00['uniqueid'];this[_0x9e44('0x14')][this['blindTransfers'][_0x954e00['linkedid']][_0x9e44('0x33')]][_0x9e44('0x64')]=this[_0x9e44('0x14')][_0x954e00[_0x9e44('0x31')]][_0x9e44('0x64')];this[_0x9e44('0x14')][this[_0x9e44('0x41')][_0x954e00[_0x9e44('0x33')]][_0x9e44('0x33')]][_0x9e44('0x65')]=this[_0x9e44('0x14')][_0x954e00['uniqueid']][_0x9e44('0x65')];this['channels'][this[_0x9e44('0x41')][_0x954e00[_0x9e44('0x33')]]['linkedid']][_0x9e44('0x67')]=this[_0x9e44('0x14')][this['blindTransfers'][_0x954e00[_0x9e44('0x33')]][_0x9e44('0x33')]][_0x9e44('0x38')];this[_0x9e44('0x14')][this['blindTransfers'][_0x954e00[_0x9e44('0x33')]][_0x9e44('0x33')]][_0x9e44('0x44')]=this[_0x9e44('0x14')][_0x954e00[_0x9e44('0x31')]][_0x9e44('0x44')];this[_0x9e44('0x14')][_0x954e00[_0x9e44('0x31')]]=this[_0x9e44('0x14')][this[_0x9e44('0x41')][_0x954e00[_0x9e44('0x33')]]['linkedid']];delete this[_0x9e44('0x14')][this[_0x9e44('0x41')][_0x954e00[_0x9e44('0x33')]][_0x9e44('0x33')]];}else if(this['channels'][this[_0x9e44('0x41')][_0x954e00[_0x9e44('0x33')]][_0x9e44('0x31')]]){this['channels'][this['blindTransfers'][_0x954e00['linkedid']][_0x9e44('0x31')]][_0x9e44('0x31')]=[this[_0x9e44('0x14')][this[_0x9e44('0x41')][_0x954e00[_0x9e44('0x33')]][_0x9e44('0x31')]][_0x9e44('0x33')],this[_0x9e44('0x14')][this[_0x9e44('0x41')][_0x954e00[_0x9e44('0x33')]]['uniqueid']][_0x9e44('0x33')]=this['channels'][this['blindTransfers'][_0x954e00['linkedid']]['uniqueid']][_0x9e44('0x31')]][0x0];this[_0x9e44('0x14')][this[_0x9e44('0x41')][_0x954e00[_0x9e44('0x33')]][_0x9e44('0x31')]]['answered']=this[_0x9e44('0x14')][_0x954e00[_0x9e44('0x31')]][_0x9e44('0x64')];this[_0x9e44('0x14')][this[_0x9e44('0x41')][_0x954e00[_0x9e44('0x33')]][_0x9e44('0x31')]][_0x9e44('0x65')]=this[_0x9e44('0x14')][_0x954e00[_0x9e44('0x31')]]['answertime'];this[_0x9e44('0x14')][this['blindTransfers'][_0x954e00[_0x9e44('0x33')]][_0x9e44('0x31')]][_0x9e44('0x67')]=this[_0x9e44('0x14')][this[_0x9e44('0x41')][_0x954e00['linkedid']][_0x9e44('0x31')]]['channel'];this[_0x9e44('0x14')][this[_0x9e44('0x41')][_0x954e00['linkedid']][_0x9e44('0x31')]][_0x9e44('0x44')]=this[_0x9e44('0x14')][_0x954e00[_0x9e44('0x31')]][_0x9e44('0x44')];this[_0x9e44('0x14')][_0x954e00[_0x9e44('0x31')]]=this['channels'][this[_0x9e44('0x41')][_0x954e00['linkedid']][_0x9e44('0x31')]];delete this[_0x9e44('0x14')][this[_0x9e44('0x41')][_0x954e00[_0x9e44('0x33')]][_0x9e44('0x31')]];}}if(this[_0x9e44('0x14')][_0x954e00[_0x9e44('0x31')]]){logger['info'](_0x9e44('0x93'),_0x954e00['uniqueid'],_0x954e00['cause-txt']);var _0x7d1e4c=moment();this[_0x9e44('0x14')][_0x954e00[_0x9e44('0x31')]][_0x9e44('0x94')]=_0x7d1e4c['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x9e44('0x14')][_0x954e00[_0x9e44('0x31')]][_0x9e44('0x57')]=_0x7d1e4c[_0x9e44('0x95')](this['channels'][_0x954e00['uniqueid']][_0x9e44('0x56')],'seconds');if(this[_0x9e44('0x14')][_0x954e00[_0x9e44('0x31')]][_0x9e44('0x64')]){this[_0x9e44('0x14')][_0x954e00[_0x9e44('0x31')]]['billableseconds']=_0x7d1e4c[_0x9e44('0x95')](this[_0x9e44('0x14')][_0x954e00['uniqueid']]['answertime'],'seconds');this['channels'][_0x954e00[_0x9e44('0x31')]][_0x9e44('0x96')]=this[_0x9e44('0x14')][_0x954e00[_0x9e44('0x31')]]['duration']-this['channels'][_0x954e00[_0x9e44('0x31')]][_0x9e44('0x97')];}if(_0x954e00[_0x9e44('0x36')]===_0x9e44('0x37')){if(this['agents'][_0x954e00[_0x9e44('0x38')][_0x9e44('0x39')]('-')[0x0]]){this[_0x9e44('0x15')][_0x954e00[_0x9e44('0x38')][_0x9e44('0x39')]('-')[0x0]]=_[_0x9e44('0x98')](this['agents'][_0x954e00['channel'][_0x9e44('0x39')]('-')[0x0]],[_0x9e44('0x49')]);logger[_0x9e44('0x2f')](_0x9e44('0x99'),_0x954e00[_0x9e44('0x31')],util['inspect']({'id':this[_0x9e44('0x15')][_0x954e00[_0x9e44('0x38')][_0x9e44('0x39')]('-')[0x0]]['id'],'destaccountcode':this[_0x9e44('0x15')][_0x954e00[_0x9e44('0x38')]['split']('-')[0x0]][_0x9e44('0x4b')]},{'showHidden':![],'depth':null}));this[_0x9e44('0x2c')](util[_0x9e44('0x3d')](_0x9e44('0x4c'),this['agents'][_0x954e00[_0x9e44('0x38')][_0x9e44('0x39')]('-')[0x0]][_0x9e44('0x4d')]),_0x9e44('0x9a'),{'id':this['agents'][_0x954e00[_0x9e44('0x38')][_0x9e44('0x39')]('-')[0x0]]['id'],'destaccountcode':this[_0x9e44('0x15')][_0x954e00[_0x9e44('0x38')][_0x9e44('0x39')]('-')[0x0]][_0x9e44('0x4b')]});for(var _0x3270f6=0x0;_0x3270f6