Built motion from commit 10af8726.|2.6.34
[motion2.git] / server / services / ami / report / index.js
index 8578e1e..85b9dbf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x44fd=['xcally-motion-dialer','forEach','voiceDialReport','Local','substring','indexOf','mobile','lastIndexOf','exports','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceDialReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','xdr','disabled','voiceQueueReport','bind','custom:voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','blindtransfer','attendedtransfer','attendedTransfer','findAgent','isNil','find','accountcode','format','SIP/%s','length','connectedlinenum','assigned','lastAssignedTo','interface','name','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','getAgentByInternal','keys','getCallType','channel','split','calleridnum','outbound','internal','voiceCallReport','destination','exten','type','dialer','lastapplication','lastdata','queue','context','from-voip-provider','callerid','xcally-motion-preview','calleridpreview','destinationchannel','originatecalleridnum','disposition','ANSWERED','\x22%s\x22\x20<%s>','transfers','linkedid','transfereelinkedid','blindTransfer','UserId','membername','monitor','monitors','filename','createdAt','calleridname','connectedlinename'];(function(_0x338f73,_0x1945c8){var _0x163fdf=function(_0x4cd033){while(--_0x4cd033){_0x338f73['push'](_0x338f73['shift']());}};_0x163fdf(++_0x1945c8);}(_0x44fd,0x123));var _0xd44f=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x44fd[_0x4243a3];return _0x1b2a33;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0xd44f('0x0'));var config=require(_0xd44f('0x1'));var ami=require(_0xd44f('0x2'));var RpcVoiceAgentReport=require(_0xd44f('0x3'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0xd44f('0x4'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0xd44f('0x5'));var RpcVoiceRecording=require(_0xd44f('0x6'));var RpcVoiceTransferReport=require(_0xd44f('0x7'));var VoiceQueueReport=require(_0xd44f('0x8'));var VoiceCallReport=require(_0xd44f('0x9'));var VoiceAgentReport=require(_0xd44f('0xa'));var VoiceDialReport=require(_0xd44f('0xb'));var UserReport=require(_0xd44f('0xc'));function Report(_0x4e5e68){this[_0xd44f('0xd')]=_0x4e5e68;this[_0xd44f('0xe')]=_0x4e5e68[_0xd44f('0xe')];this['telephones']=_0x4e5e68[_0xd44f('0xf')];}Report[_0xd44f('0x10')]['sync']=function(_0x3a2e7b){var _0x1f6d10=new VoiceQueueReport(this[_0xd44f('0xd')]);var _0x315699=new VoiceAgentReport(this[_0xd44f('0xd')]);var _0x4c2c9f=new VoiceDialReport(this[_0xd44f('0xd')]);var _0x410ceb=new VoiceCallReport(this[_0xd44f('0xd')]);var _0x580196=new UserReport(this[_0xd44f('0xd')]);if(config[_0xd44f('0x11')]&&config[_0xd44f('0x11')][_0xd44f('0x12')]){ami['on']('custom:voiceQueueReport',this[_0xd44f('0x13')][_0xd44f('0x14')](this));ami['on'](_0xd44f('0x15'),this['voiceCallReport']['bind'](this));ami['on'](_0xd44f('0x16'),this[_0xd44f('0x17')][_0xd44f('0x14')](this));ami['on'](_0xd44f('0x18'),this['voiceDialReport'][_0xd44f('0x14')](this));ami['on'](_0xd44f('0x19'),this['blindTransfer']['bind'](this));ami['on'](_0xd44f('0x1a'),this[_0xd44f('0x1b')][_0xd44f('0x14')](this));}};Report[_0xd44f('0x10')][_0xd44f('0x1c')]=function(_0x1ef863){var _0x122c2d;_0x122c2d=_['find'](this['agents'],function(_0x412da9){return _0x412da9['accountcode']==_0x1ef863||_0x412da9['name']==_0x1ef863;});if(_[_0xd44f('0x1d')](_0x122c2d)){var _0x174e55=_[_0xd44f('0x1e')](this[_0xd44f('0xf')],function(_0x28f530){return _0x28f530[_0xd44f('0x1f')]==_0x1ef863||_0x28f530['name']==_0x1ef863;});if(_0x174e55){_0x122c2d=_[_0xd44f('0x1e')](this[_0xd44f('0xe')],function(_0x2f322a){return _0x2f322a['interface']==util[_0xd44f('0x20')](_0xd44f('0x21'),_0x174e55['name']);});}}return _0x122c2d;};Report[_0xd44f('0x10')]['voiceQueueReport']=function(_0x1c7651){for(var _0x204710=0x0;_0x204710<_0x1c7651[_0xd44f('0x22')];_0x204710+=0x1){var _0x43c29c=this['findAgent'](_0x1c7651[_0x204710][_0xd44f('0x23')]);if(_0x43c29c){_0x1c7651[_0x204710]['accountcode']=_0x43c29c[_0xd44f('0x1f')];_0x1c7651[_0x204710][_0xd44f('0x24')]=!![];_0x1c7651[_0x204710][_0xd44f('0x25')]=_0x43c29c['name'];_0x1c7651[_0x204710][_0xd44f('0x26')]=_[_0xd44f('0x1d')](_0x43c29c[_0xd44f('0x26')])?util['format'](_0xd44f('0x21'),_0x43c29c[_0xd44f('0x27')]):_0x43c29c[_0xd44f('0x26')];if(_0x1c7651[_0x204710][_0xd44f('0x28')]){_0x1c7651[_0x204710][_0xd44f('0x29')]=moment()[_0xd44f('0x20')](_0xd44f('0x2a'));}if(_0x1c7651[_0x204710][_0xd44f('0x2b')]){_0x1c7651[_0x204710][_0xd44f('0x2c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0xd44f('0x13')](_0x1c7651[_0x204710]);}RpcVoiceQueueReport[_0xd44f('0x2d')](_0x1c7651[_0x204710]);}};function extractCalleridNumber(_0x1d6ea2){var _0x551ee8=_0x1d6ea2[_0xd44f('0x2e')](/<(.*?)>/);return _0x551ee8?_0x551ee8[0x1]:_0x1d6ea2;}Report['prototype'][_0xd44f('0x2f')]=function(_0x1047fc){for(var _0x40cb3a=0x0;_0x40cb3a<Object[_0xd44f('0x30')](this[_0xd44f('0xe')])[_0xd44f('0x22')];_0x40cb3a++){var _0x41f75c=Object[_0xd44f('0x30')](this[_0xd44f('0xe')])[_0x40cb3a];var _0x35d514=this[_0xd44f('0xe')][_0x41f75c];if(_0x35d514[_0xd44f('0x1f')]===Number(_0x1047fc))return _0x35d514;}return null;};Report[_0xd44f('0x10')][_0xd44f('0x31')]=function(_0x45d38c){var _0x4c8475=_0x45d38c[_0xd44f('0x32')][_0xd44f('0x33')]('-')[0x0];var _0xfd11a=this['agents'][_0x4c8475];if(!_0xfd11a)_0xfd11a=this[_0xd44f('0x2f')](_0x45d38c[_0xd44f('0x34')]);return!_0xfd11a?_0xd44f('0x35'):_0xd44f('0x36');};Report[_0xd44f('0x10')][_0xd44f('0x37')]=function(_0x4ae09b){_0x4ae09b['destination']=_0x4ae09b[_0xd44f('0x38')]||_0x4ae09b[_0xd44f('0x39')];if(_0x4ae09b[_0xd44f('0x3a')]==_0xd44f('0x3b')){_0x4ae09b[_0xd44f('0x3c')]='queue';_0x4ae09b[_0xd44f('0x3d')]=_0x4ae09b[_0xd44f('0x3e')];if(_0x4ae09b[_0xd44f('0x3f')]==_0xd44f('0x40')){_0x4ae09b[_0xd44f('0x1f')]='';_0x4ae09b[_0xd44f('0x38')]=extractCalleridNumber(_0x4ae09b[_0xd44f('0x41')]);}else if(_0x4ae09b[_0xd44f('0x3f')]=='from-sip'){if(_0x4ae09b['destination']==_0xd44f('0x42')){_0x4ae09b[_0xd44f('0x38')]=extractCalleridNumber(_0x4ae09b[_0xd44f('0x43')]);_0x4ae09b[_0xd44f('0x34')]=_0x4ae09b['originatecalleridnum'];_0x4ae09b['destinationchannel']=[_0x4ae09b[_0xd44f('0x32')],_0x4ae09b[_0xd44f('0x32')]=_0x4ae09b[_0xd44f('0x44')]][0x0];_0x4ae09b[_0xd44f('0x41')]=_0x4ae09b[_0xd44f('0x43')];}else{_0x4ae09b[_0xd44f('0x38')]=_0x4ae09b[_0xd44f('0x34')];_0x4ae09b[_0xd44f('0x34')]=_0x4ae09b[_0xd44f('0x45')];if(_0x4ae09b[_0xd44f('0x46')]==_0xd44f('0x47')){_0x4ae09b[_0xd44f('0x1f')]=_0x4ae09b[_0xd44f('0x23')];}else{_0x4ae09b['accountcode']='';}}}}else{_0x4ae09b[_0xd44f('0x41')]=util[_0xd44f('0x20')](_0xd44f('0x48'),_0x4ae09b['calleridname'],_0x4ae09b[_0xd44f('0x34')]);}if(RpcVoiceTransferReport[_0xd44f('0x49')][_0x4ae09b['linkedid']]){var _0x1df55e=RpcVoiceTransferReport['transfers'][_0x4ae09b[_0xd44f('0x4a')]];_0x1df55e[_0xd44f('0x4b')]=_0x4ae09b['uniqueid'];RpcVoiceTransferReport[_0xd44f('0x4c')](_0x1df55e);delete RpcVoiceTransferReport[_0xd44f('0x49')][_0x4ae09b[_0xd44f('0x4a')]];}if(_['isNil'](_0x4ae09b[_0xd44f('0x3a')])){_0x4ae09b[_0xd44f('0x3a')]=this['getCallType'](_0x4ae09b);}if(_[_0xd44f('0x1d')](_0x4ae09b[_0xd44f('0x4d')])){var _0x4fd919=_0x4ae09b[_0xd44f('0x32')]['split']('-')[0x0];var _0x54ccc3=this[_0xd44f('0xe')][_0x4fd919];if(!_0x54ccc3)_0x54ccc3=this['getAgentByInternal'](_0x4ae09b[_0xd44f('0x1f')]);if(_0x54ccc3){_0x4ae09b[_0xd44f('0x4d')]=_0x54ccc3['id'];_0x4ae09b[_0xd44f('0x4e')]=_0x54ccc3[_0xd44f('0x27')];}}RpcVoiceCallReport[_0xd44f('0x2d')](_0x4ae09b);if(_0x4ae09b[_0xd44f('0x4f')]){for(var _0x4f7bb0=0x0;_0x4f7bb0<_0x4ae09b[_0xd44f('0x50')][_0xd44f('0x22')];_0x4f7bb0+=0x1){_0x4ae09b['monitorFilename']=_0x4ae09b['monitors'][_0x4f7bb0][_0xd44f('0x51')];_0x4ae09b['createdAt']=_0x4ae09b['monitors'][_0x4f7bb0][_0xd44f('0x52')];if(_0x4ae09b[_0xd44f('0x39')]==_0xd44f('0x42')){_0x4ae09b['calleridnum']=_0x4ae09b[_0xd44f('0x23')];_0x4ae09b[_0xd44f('0x53')]=_0x4ae09b[_0xd44f('0x54')];_0x4ae09b[_0xd44f('0x23')]=_0x4ae09b[_0xd44f('0x1f')];_0x4ae09b[_0xd44f('0x54')]=_0x4ae09b['membername'];_0x4ae09b[_0xd44f('0x39')]=_0x4ae09b['originatecalleridnum'];}else if(_0x4ae09b['exten']==_0xd44f('0x55')){_0x4ae09b[_0xd44f('0x34')]=_0x4ae09b[_0xd44f('0x38')];_0x4ae09b[_0xd44f('0x39')]=_0x4ae09b[_0xd44f('0x45')];}RpcVoiceRecording[_0xd44f('0x2d')](_0x4ae09b);}}};Report['prototype']['voiceAgentReport']=function(_0x1d125d){if(_['isArray'](_0x1d125d)){_0x1d125d[_0xd44f('0x56')](function(_0x17577f){RpcVoiceAgentReport[_0xd44f('0x2d')](_0x17577f);});}else{RpcVoiceAgentReport[_0xd44f('0x2d')](_0x1d125d);}};Report[_0xd44f('0x10')][_0xd44f('0x57')]=function(_0x3b8753){RpcVoiceDialReport[_0xd44f('0x2d')](_0x3b8753);var _0x4efda3;var _0x31d52d;var _0x434f08=_0x3b8753[_0xd44f('0x32')];if(_['startsWith'](_0x434f08,_0xd44f('0x58'))){_0x31d52d=_0x434f08[_0xd44f('0x59')](_0x434f08[_0xd44f('0x5a')]('/')+0x1,_0x434f08[_0xd44f('0x5a')]('@'));_0x4efda3=_[_0xd44f('0x1e')](this[_0xd44f('0xe')],function(_0x4f2784){return _0x4f2784[_0xd44f('0x5b')]==_0x31d52d||_0x4f2784['phone']==_0x31d52d||_0x4f2784[_0xd44f('0x1f')]==_0x31d52d;});}else{_0x31d52d=_0x434f08[_0xd44f('0x59')](_0x434f08['indexOf']('/')+0x1,_0x434f08[_0xd44f('0x5c')]('-'));_0x4efda3=this[_0xd44f('0x1c')](_0x31d52d);}if(_0x4efda3){_0x3b8753[_0xd44f('0x26')]=_[_0xd44f('0x1d')](_0x4efda3['interface'])?util[_0xd44f('0x20')]('SIP/%s',_0x4efda3['name']):_0x4efda3[_0xd44f('0x26')];_0x3b8753[_0xd44f('0x4e')]=_0x4efda3['name'];_0x3b8753['accountcode']=_0x4efda3['accountcode'];RpcMemberReport[_0xd44f('0x57')](_0x3b8753);}};Report['prototype'][_0xd44f('0x4c')]=function(_0x2c7d58){RpcVoiceTransferReport[_0xd44f('0x49')][_0x2c7d58['transfererlinkedid']]=_0x2c7d58;};Report[_0xd44f('0x10')][_0xd44f('0x1b')]=function(_0xa8b1ac){RpcVoiceTransferReport['attendedTransfer'](_0xa8b1ac);};module[_0xd44f('0x5d')]=Report;
\ No newline at end of file
+var _0x00a8=['voiceDialReport','blindtransfer','attendedtransfer','attendedTransfer','prototype','findAgent','find','accountcode','name','isNil','format','SIP/%s','length','connectedlinenum','assigned','lastAssignedTo','interface','queuecallercomplete','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','getAgentByInternal','keys','channel','calleridnum','internal','voiceCallReport','destination','type','lastapplication','lastdata','queue','context','from-voip-provider','callerid','from-sip','calleridpreview','originatecalleridnum','destinationchannel','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','blindTransfer','getCallType','UserId','split','membername','monitor','monitors','monitorFilename','createdAt','exten','xcally-motion-preview','connectedlinename','isArray','forEach','startsWith','Local','indexOf','mobile','substring','lastIndexOf','transfererlinkedid','lodash','moment','util','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','agents','telephones','sync','realtime','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport'];(function(_0x32b3c5,_0x2747fd){var _0x23cf7d=function(_0x480854){while(--_0x480854){_0x32b3c5['push'](_0x32b3c5['shift']());}};_0x23cf7d(++_0x2747fd);}(_0x00a8,0x164));var _0x800a=function(_0x27df4d,_0x3ef5fd){_0x27df4d=_0x27df4d-0x0;var _0x25b543=_0x00a8[_0x27df4d];return _0x25b543;};'use strict';var _=require(_0x800a('0x0'));var moment=require(_0x800a('0x1'));var util=require(_0x800a('0x2'));var config=require('../../../config/environment');var ami=require(_0x800a('0x3'));var RpcVoiceAgentReport=require(_0x800a('0x4'));var RpcVoiceCallReport=require(_0x800a('0x5'));var RpcVoiceDialReport=require(_0x800a('0x6'));var RpcMemberReport=require(_0x800a('0x7'));var RpcVoiceQueueReport=require(_0x800a('0x8'));var RpcVoiceRecording=require(_0x800a('0x9'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0x800a('0xa'));var VoiceCallReport=require(_0x800a('0xb'));var VoiceAgentReport=require(_0x800a('0xc'));var VoiceDialReport=require(_0x800a('0xd'));var UserReport=require(_0x800a('0xe'));function Report(_0x7abb7){this['realtime']=_0x7abb7;this[_0x800a('0xf')]=_0x7abb7['agents'];this[_0x800a('0x10')]=_0x7abb7['telephones'];}Report['prototype'][_0x800a('0x11')]=function(_0x54ce72){var _0x3aeeaf=new VoiceQueueReport(this[_0x800a('0x12')]);var _0x4697e5=new VoiceAgentReport(this[_0x800a('0x12')]);var _0x20f9d8=new VoiceDialReport(this['realtime']);var _0x3f649a=new VoiceCallReport(this['realtime']);var _0x5b6e06=new UserReport(this['realtime']);if(config[_0x800a('0x13')]&&config[_0x800a('0x13')][_0x800a('0x14')]){ami['on'](_0x800a('0x15'),this[_0x800a('0x16')][_0x800a('0x17')](this));ami['on'](_0x800a('0x18'),this['voiceCallReport'][_0x800a('0x17')](this));ami['on'](_0x800a('0x19'),this[_0x800a('0x1a')][_0x800a('0x17')](this));ami['on'](_0x800a('0x1b'),this[_0x800a('0x1c')][_0x800a('0x17')](this));ami['on'](_0x800a('0x1d'),this['blindTransfer'][_0x800a('0x17')](this));ami['on'](_0x800a('0x1e'),this[_0x800a('0x1f')]['bind'](this));}};Report[_0x800a('0x20')][_0x800a('0x21')]=function(_0xfcf49f){var _0x56279e;_0x56279e=_[_0x800a('0x22')](this[_0x800a('0xf')],function(_0x3d6ca1){return _0x3d6ca1[_0x800a('0x23')]==_0xfcf49f||_0x3d6ca1[_0x800a('0x24')]==_0xfcf49f;});if(_[_0x800a('0x25')](_0x56279e)){var _0x413d49=_[_0x800a('0x22')](this[_0x800a('0x10')],function(_0x3c0da2){return _0x3c0da2[_0x800a('0x23')]==_0xfcf49f||_0x3c0da2['name']==_0xfcf49f;});if(_0x413d49){_0x56279e=_[_0x800a('0x22')](this[_0x800a('0xf')],function(_0xa88884){return _0xa88884['interface']==util[_0x800a('0x26')](_0x800a('0x27'),_0x413d49[_0x800a('0x24')]);});}}return _0x56279e;};Report['prototype']['voiceQueueReport']=function(_0x57c463){for(var _0x15a579=0x0;_0x15a579<_0x57c463[_0x800a('0x28')];_0x15a579+=0x1){var _0x505942=this[_0x800a('0x21')](_0x57c463[_0x15a579][_0x800a('0x29')]);if(_0x505942){_0x57c463[_0x15a579]['accountcode']=_0x505942[_0x800a('0x23')];_0x57c463[_0x15a579][_0x800a('0x2a')]=!![];_0x57c463[_0x15a579][_0x800a('0x2b')]=_0x505942[_0x800a('0x24')];_0x57c463[_0x15a579]['interface']=_[_0x800a('0x25')](_0x505942[_0x800a('0x2c')])?util[_0x800a('0x26')](_0x800a('0x27'),_0x505942[_0x800a('0x24')]):_0x505942[_0x800a('0x2c')];if(_0x57c463[_0x15a579][_0x800a('0x2d')]){_0x57c463[_0x15a579]['queuecallercompleteAt']=moment()[_0x800a('0x26')](_0x800a('0x2e'));}if(_0x57c463[_0x15a579][_0x800a('0x2f')]){_0x57c463[_0x15a579][_0x800a('0x30')]=moment()[_0x800a('0x26')](_0x800a('0x2e'));}RpcMemberReport['voiceQueueReport'](_0x57c463[_0x15a579]);}RpcVoiceQueueReport[_0x800a('0x31')](_0x57c463[_0x15a579]);}};function extractCalleridNumber(_0x58f24a){var _0x56466e=_0x58f24a[_0x800a('0x32')](/<(.*?)>/);return _0x56466e?_0x56466e[0x1]:_0x58f24a;}Report['prototype'][_0x800a('0x33')]=function(_0x8490b){for(var _0xf29831=0x0;_0xf29831<Object[_0x800a('0x34')](this[_0x800a('0xf')])[_0x800a('0x28')];_0xf29831++){var _0x337cea=Object[_0x800a('0x34')](this['agents'])[_0xf29831];var _0x533118=this[_0x800a('0xf')][_0x337cea];if(_0x533118[_0x800a('0x23')]===Number(_0x8490b))return _0x533118;}return null;};Report[_0x800a('0x20')]['getCallType']=function(_0xf0b34e){var _0x24e64f=_0xf0b34e[_0x800a('0x35')]['split']('-')[0x0];var _0x108445=this['agents'][_0x24e64f];if(!_0x108445)_0x108445=this['getAgentByInternal'](_0xf0b34e[_0x800a('0x36')]);return!_0x108445?'outbound':_0x800a('0x37');};Report[_0x800a('0x20')][_0x800a('0x38')]=function(_0x37dd42){_0x37dd42[_0x800a('0x39')]=_0x37dd42[_0x800a('0x39')]||_0x37dd42['exten'];if(_0x37dd42[_0x800a('0x3a')]=='dialer'){_0x37dd42[_0x800a('0x3b')]='queue';_0x37dd42[_0x800a('0x3c')]=_0x37dd42[_0x800a('0x3d')];if(_0x37dd42[_0x800a('0x3e')]==_0x800a('0x3f')){_0x37dd42[_0x800a('0x23')]='';_0x37dd42[_0x800a('0x39')]=extractCalleridNumber(_0x37dd42[_0x800a('0x40')]);}else if(_0x37dd42[_0x800a('0x3e')]==_0x800a('0x41')){if(_0x37dd42[_0x800a('0x39')]=='xcally-motion-preview'){_0x37dd42[_0x800a('0x39')]=extractCalleridNumber(_0x37dd42[_0x800a('0x42')]);_0x37dd42['calleridnum']=_0x37dd42[_0x800a('0x43')];_0x37dd42[_0x800a('0x44')]=[_0x37dd42[_0x800a('0x35')],_0x37dd42[_0x800a('0x35')]=_0x37dd42[_0x800a('0x44')]][0x0];_0x37dd42[_0x800a('0x40')]=_0x37dd42[_0x800a('0x42')];}else{_0x37dd42[_0x800a('0x39')]=_0x37dd42[_0x800a('0x36')];_0x37dd42[_0x800a('0x36')]=_0x37dd42[_0x800a('0x43')];if(_0x37dd42[_0x800a('0x45')]==_0x800a('0x46')){_0x37dd42[_0x800a('0x23')]=_0x37dd42[_0x800a('0x29')];}else{_0x37dd42[_0x800a('0x23')]='';}}}}else{_0x37dd42[_0x800a('0x40')]=util[_0x800a('0x26')](_0x800a('0x47'),_0x37dd42[_0x800a('0x48')],_0x37dd42[_0x800a('0x36')]);}if(RpcVoiceTransferReport[_0x800a('0x49')][_0x37dd42['linkedid']]){var _0x48d68c=RpcVoiceTransferReport[_0x800a('0x49')][_0x37dd42[_0x800a('0x4a')]];_0x48d68c['transfereelinkedid']=_0x37dd42['uniqueid'];RpcVoiceTransferReport[_0x800a('0x4b')](_0x48d68c);delete RpcVoiceTransferReport['transfers'][_0x37dd42[_0x800a('0x4a')]];}if(_['isNil'](_0x37dd42['type'])){_0x37dd42['type']=this[_0x800a('0x4c')](_0x37dd42);}if(_[_0x800a('0x25')](_0x37dd42[_0x800a('0x4d')])){var _0x58e424=_0x37dd42['channel'][_0x800a('0x4e')]('-')[0x0];var _0x1a8035=this[_0x800a('0xf')][_0x58e424];if(!_0x1a8035)_0x1a8035=this[_0x800a('0x33')](_0x37dd42[_0x800a('0x23')]);if(_0x1a8035){_0x37dd42[_0x800a('0x4d')]=_0x1a8035['id'];_0x37dd42[_0x800a('0x4f')]=_0x1a8035[_0x800a('0x24')];}}RpcVoiceCallReport[_0x800a('0x31')](_0x37dd42);if(_0x37dd42[_0x800a('0x50')]){for(var _0x312ae2=0x0;_0x312ae2<_0x37dd42[_0x800a('0x51')]['length'];_0x312ae2+=0x1){_0x37dd42[_0x800a('0x52')]=_0x37dd42[_0x800a('0x51')][_0x312ae2]['filename'];_0x37dd42[_0x800a('0x53')]=_0x37dd42[_0x800a('0x51')][_0x312ae2][_0x800a('0x53')];if(_0x37dd42[_0x800a('0x54')]==_0x800a('0x55')){_0x37dd42[_0x800a('0x36')]=_0x37dd42[_0x800a('0x29')];_0x37dd42[_0x800a('0x48')]=_0x37dd42[_0x800a('0x56')];_0x37dd42[_0x800a('0x29')]=_0x37dd42[_0x800a('0x23')];_0x37dd42['connectedlinename']=_0x37dd42['membername'];_0x37dd42[_0x800a('0x54')]=_0x37dd42[_0x800a('0x43')];}else if(_0x37dd42[_0x800a('0x54')]=='xcally-motion-dialer'){_0x37dd42['calleridnum']=_0x37dd42[_0x800a('0x39')];_0x37dd42[_0x800a('0x54')]=_0x37dd42[_0x800a('0x43')];}RpcVoiceRecording['create'](_0x37dd42);}}};Report[_0x800a('0x20')][_0x800a('0x1a')]=function(_0x1e8427){if(_[_0x800a('0x57')](_0x1e8427)){_0x1e8427[_0x800a('0x58')](function(_0x1520f7){RpcVoiceAgentReport['create'](_0x1520f7);});}else{RpcVoiceAgentReport[_0x800a('0x31')](_0x1e8427);}};Report['prototype'][_0x800a('0x1c')]=function(_0xd54aac){RpcVoiceDialReport[_0x800a('0x31')](_0xd54aac);var _0x2da168;var _0xabe867;var _0x4aaf97=_0xd54aac[_0x800a('0x35')];if(_[_0x800a('0x59')](_0x4aaf97,_0x800a('0x5a'))){_0xabe867=_0x4aaf97['substring'](_0x4aaf97['indexOf']('/')+0x1,_0x4aaf97[_0x800a('0x5b')]('@'));_0x2da168=_[_0x800a('0x22')](this[_0x800a('0xf')],function(_0x2aec2f){return _0x2aec2f[_0x800a('0x5c')]==_0xabe867||_0x2aec2f['phone']==_0xabe867||_0x2aec2f['accountcode']==_0xabe867;});}else{_0xabe867=_0x4aaf97[_0x800a('0x5d')](_0x4aaf97[_0x800a('0x5b')]('/')+0x1,_0x4aaf97[_0x800a('0x5e')]('-'));_0x2da168=this[_0x800a('0x21')](_0xabe867);}if(_0x2da168){_0xd54aac[_0x800a('0x2c')]=_[_0x800a('0x25')](_0x2da168[_0x800a('0x2c')])?util[_0x800a('0x26')](_0x800a('0x27'),_0x2da168['name']):_0x2da168[_0x800a('0x2c')];_0xd54aac['membername']=_0x2da168[_0x800a('0x24')];_0xd54aac[_0x800a('0x23')]=_0x2da168[_0x800a('0x23')];RpcMemberReport[_0x800a('0x1c')](_0xd54aac);}};Report[_0x800a('0x20')]['blindTransfer']=function(_0x5e309f){RpcVoiceTransferReport['transfers'][_0x5e309f[_0x800a('0x5f')]]=_0x5e309f;};Report[_0x800a('0x20')][_0x800a('0x1f')]=function(_0x276c39){RpcVoiceTransferReport[_0x800a('0x1f')](_0x276c39);};module['exports']=Report;
\ No newline at end of file