Built motion from commit ecdc8e66766c75b1b08288b0ea13eb12d42606b4. Version 3.0.0...
[motion-next.git] / server / services / xdr / recordings.controller.js
index 2c56a90..edba286 100644 (file)
@@ -1 +1 @@
-const a1226_0x41e9=['startsWith','forEach','replace','stack','exten','then','monitors','name','outbound','substring','channelstate','toLowerCase','endsWith','isNil','debug','membername','mixmonitor_filename','push','calleridname','error','linkedid','queuecallerjoin','queue','.wav49','set','connectedlinename','calleridnum','CreateVoiceRecording','newexten','accountcode','type','getUserByInternal','clone','lastIndexOf','connectedlinenum','split','uniqueid','context','varset','.WAV','appdata','value','cdr','newstate','hangup','application','UserId','newchannel','request'];(function(_0x56d566,_0x41e906){const _0x3963b4=function(_0x2b3c53){while(--_0x2b3c53){_0x56d566['push'](_0x56d566['shift']());}};_0x3963b4(++_0x41e906);}(a1226_0x41e9,0xd0));const a1226_0x3963=function(_0x56d566,_0x41e906){_0x56d566=_0x56d566-0x0;let _0x3963b4=a1226_0x41e9[_0x56d566];return _0x3963b4;};const _0x2fe71e=a1226_0x3963;'use strict';const _=require('lodash'),utils=require('./utils'),recordings={};function writeDB(_0x2b3c53){const _0x27ab87=a1226_0x3963;utils[_0x27ab87('0x2')](_0x2b3c53),_0x2b3c53['accountcode']?utils[_0x27ab87('0x13')](_0x2b3c53[_0x27ab87('0x11')])[_0x27ab87('0x2a')](function(_0x11a55a){const _0x5d7312=_0x27ab87;_0x11a55a&&(_0x2b3c53[_0x5d7312('0x3')]=_0x11a55a[_0x5d7312('0x2c')],_0x2b3c53[_0x5d7312('0x22')]=_0x11a55a['id']),utils[_0x5d7312('0x24')]('CreateVoiceRecording',_0x2b3c53);}):utils['request'](_0x27ab87('0xf'),_0x2b3c53);}exports[_0x2fe71e('0x23')]=function(_0x34b1c7){const _0x892f93=_0x2fe71e;try{_0x34b1c7['uniqueid']==_0x34b1c7['linkedid']&&(recordings[_0x34b1c7[_0x892f93('0x18')]]={'uniqueid':_0x34b1c7[_0x892f93('0x18')],'accountcode':_0x34b1c7[_0x892f93('0x11')],'exten':_0x34b1c7[_0x892f93('0x29')],'context':_0x34b1c7[_0x892f93('0x19')],'channel':_0x34b1c7['channel'],'monitors':[]});}catch(_0x173520){utils[_0x892f93('0x7')](_0x173520[_0x892f93('0x28')]);}},exports[_0x2fe71e('0x1f')]=function(_0x25c6d4){const _0x57cae8=_0x2fe71e;try{if(!_[_0x57cae8('0x1')](recordings[_0x25c6d4[_0x57cae8('0x18')]])&&_0x25c6d4['channelstate']==0x6){}else!_[_0x57cae8('0x1')](recordings[_0x25c6d4[_0x57cae8('0x8')]])&&_0x25c6d4[_0x57cae8('0x2f')]==0x6&&_0x25c6d4['context']!='transfer'&&(recordings[_0x25c6d4[_0x57cae8('0x8')]]['accountcode']=_0x25c6d4[_0x57cae8('0x11')]);}catch(_0x36f2ea){utils[_0x57cae8('0x7')](_0x36f2ea[_0x57cae8('0x28')]);}},exports[_0x2fe71e('0x1a')]=function(_0x32f2a5){const _0x32e95c=_0x2fe71e;try{if(!_[_0x32e95c('0x1')](_0x32f2a5['variable'])&&!_[_0x32e95c('0x1')](_0x32f2a5['variable'][_0x32e95c('0x4')])){_[_0x32e95c('0x0')](_0x32f2a5[_0x32e95c('0x1d')],_0x32e95c('0xb'))&&(_0x32f2a5[_0x32e95c('0x1d')]=_0x32f2a5[_0x32e95c('0x1d')][_0x32e95c('0x27')](_0x32e95c('0xb'),_0x32e95c('0x1b')));if(recordings[_0x32f2a5[_0x32e95c('0x8')]]){const _0x1f4d64=_['find'](recordings[_0x32f2a5[_0x32e95c('0x8')]]['monitors'],{'value':_0x32f2a5[_0x32e95c('0x1d')]});_[_0x32e95c('0x1')](_0x1f4d64)&&recordings[_0x32f2a5[_0x32e95c('0x8')]][_0x32e95c('0x2b')][_0x32e95c('0x5')]({'value':_0x32f2a5[_0x32e95c('0x1d')]});}}}catch(_0x120edf){utils['error'](_0x120edf[_0x32e95c('0x28')]);}},exports[_0x2fe71e('0x20')]=function(_0x27e9db){const _0x452ed8=_0x2fe71e;try{!_[_0x452ed8('0x1')](recordings[_0x27e9db[_0x452ed8('0x18')]])&&(recordings[_0x27e9db[_0x452ed8('0x18')]]['calleridnum']=_0x27e9db[_0x452ed8('0xe')],recordings[_0x27e9db['uniqueid']][_0x452ed8('0x6')]=_0x27e9db['calleridname'],recordings[_0x27e9db['uniqueid']][_0x452ed8('0x16')]=_0x27e9db[_0x452ed8('0x16')],recordings[_0x27e9db[_0x452ed8('0x18')]]['connectedlinename']=_0x27e9db[_0x452ed8('0xd')],recordings[_0x27e9db[_0x452ed8('0x18')]][_0x452ed8('0x12')]==_0x452ed8('0x2d')&&recordings[_0x27e9db[_0x452ed8('0x18')]][_0x452ed8('0x11')]&&(recordings[_0x27e9db[_0x452ed8('0x18')]][_0x452ed8('0x16')]=recordings[_0x27e9db['uniqueid']][_0x452ed8('0x11')],recordings[_0x27e9db[_0x452ed8('0x18')]]['connectedlinename']=''),recordings[_0x27e9db[_0x452ed8('0x18')]]['monitors'][_0x452ed8('0x26')](_0x61f325=>{const _0x48a70a=_0x452ed8,_0x5409fd=_[_0x48a70a('0x14')](recordings[_0x27e9db[_0x48a70a('0x18')]]);_0x5409fd[_0x48a70a('0x1d')]=_0x61f325[_0x48a70a('0x1d')],writeDB(_0x5409fd);}),delete recordings[_0x27e9db[_0x452ed8('0x18')]]);}catch(_0x15c06f){utils[_0x452ed8('0x7')](_0x15c06f['stack']);}},exports[_0x2fe71e('0x10')]=function(_0x1e1bf4){const _0x4c32cf=_0x2fe71e;try{if(!_[_0x4c32cf('0x1')](recordings[_0x1e1bf4[_0x4c32cf('0x18')]])){if(_0x1e1bf4[_0x4c32cf('0x21')][_0x4c32cf('0x30')]()==_0x4c32cf('0xc')&&_[_0x4c32cf('0x25')](_0x1e1bf4[_0x4c32cf('0x1c')][_0x4c32cf('0x30')](),_0x4c32cf('0x1e'))){const _0x1ea662=_0x1e1bf4['appdata'][_0x4c32cf('0x17')]('='),_0x3fa384=_0x1ea662[0x0][_0x4c32cf('0x2e')](_0x1ea662[0x0][_0x4c32cf('0x15')]('(')+0x1,_0x1ea662[0x0]['lastIndexOf'](')')),_0x694e71=_0x1ea662[0x1];recordings[_0x1e1bf4['uniqueid']][_0x3fa384]=_0x694e71;}}}catch(_0x4ddaec){utils['error'](_0x4ddaec['stack']);}},exports[_0x2fe71e('0x9')]=function(_0x57d80b){const _0x2b88a8=_0x2fe71e;try{!_[_0x2b88a8('0x1')](recordings[_0x57d80b[_0x2b88a8('0x18')]])&&(recordings[_0x57d80b[_0x2b88a8('0x18')]][_0x2b88a8('0xa')]=_0x57d80b[_0x2b88a8('0xa')]);}catch(_0x436110){utils[_0x2b88a8('0x7')](_0x436110[_0x2b88a8('0x28')]);}};
\ No newline at end of file
+const a1226_0x300e=['application','getUserByInternal','membername','channel','forEach','debug','monitors','push','substring','appdata','isNil','linkedid','queue','name','type','outbound','uniqueid','channelstate','context','connectedlinenum','endsWith','.wav49','calleridname','stack','cdr','request','accountcode','./utils','error','toLowerCase','newexten','split','newchannel','mixmonitor_filename','UserId','lodash','calleridnum','exten','CreateVoiceRecording','queuecallerjoin','transfer','variable','varset','value','startsWith','connectedlinename','newstate','lastIndexOf'];(function(_0x2b6a28,_0x300e18){const _0x105e46=function(_0x6fd200){while(--_0x6fd200){_0x2b6a28['push'](_0x2b6a28['shift']());}};_0x105e46(++_0x300e18);}(a1226_0x300e,0x178));const a1226_0x105e=function(_0x2b6a28,_0x300e18){_0x2b6a28=_0x2b6a28-0x0;let _0x105e46=a1226_0x300e[_0x2b6a28];return _0x105e46;};const _0x145ec8=a1226_0x105e;'use strict';const _=require(_0x145ec8('0x2b')),utils=require(_0x145ec8('0x23')),recordings={};function writeDB(_0x6fd200){const _0x118d49=_0x145ec8;utils[_0x118d49('0xd')](_0x6fd200),_0x6fd200[_0x118d49('0x22')]?utils[_0x118d49('0x9')](_0x6fd200[_0x118d49('0x22')])['then'](function(_0x5848f5){const _0x19dc01=_0x118d49;_0x5848f5&&(_0x6fd200[_0x19dc01('0xa')]=_0x5848f5[_0x19dc01('0x15')],_0x6fd200[_0x19dc01('0x2a')]=_0x5848f5['id']),utils[_0x19dc01('0x21')](_0x19dc01('0x2e'),_0x6fd200);}):utils[_0x118d49('0x21')](_0x118d49('0x2e'),_0x6fd200);}exports[_0x145ec8('0x28')]=function(_0x329932){const _0x37ab67=_0x145ec8;try{_0x329932[_0x37ab67('0x18')]==_0x329932['linkedid']&&(recordings[_0x329932['uniqueid']]={'uniqueid':_0x329932[_0x37ab67('0x18')],'accountcode':_0x329932[_0x37ab67('0x22')],'exten':_0x329932[_0x37ab67('0x2d')],'context':_0x329932[_0x37ab67('0x1a')],'channel':_0x329932[_0x37ab67('0xb')],'monitors':[]});}catch(_0x1035e4){utils['error'](_0x1035e4[_0x37ab67('0x1f')]);}},exports[_0x145ec8('0x6')]=function(_0xd1f12){const _0x1aa891=_0x145ec8;try{if(!_[_0x1aa891('0x12')](recordings[_0xd1f12[_0x1aa891('0x18')]])&&_0xd1f12[_0x1aa891('0x19')]==0x6){}else!_['isNil'](recordings[_0xd1f12[_0x1aa891('0x13')]])&&_0xd1f12[_0x1aa891('0x19')]==0x6&&_0xd1f12[_0x1aa891('0x1a')]!=_0x1aa891('0x0')&&(recordings[_0xd1f12[_0x1aa891('0x13')]][_0x1aa891('0x22')]=_0xd1f12[_0x1aa891('0x22')]);}catch(_0x3a076e){utils['error'](_0x3a076e[_0x1aa891('0x1f')]);}},exports[_0x145ec8('0x2')]=function(_0x79430f){const _0xb64c3e=_0x145ec8;try{if(!_[_0xb64c3e('0x12')](_0x79430f['variable'])&&!_['isNil'](_0x79430f[_0xb64c3e('0x1')][_0xb64c3e('0x29')])){_[_0xb64c3e('0x1c')](_0x79430f[_0xb64c3e('0x3')],_0xb64c3e('0x1d'))&&(_0x79430f[_0xb64c3e('0x3')]=_0x79430f[_0xb64c3e('0x3')]['replace']('.wav49','.WAV'));if(recordings[_0x79430f[_0xb64c3e('0x13')]]){const _0x326089=_['find'](recordings[_0x79430f[_0xb64c3e('0x13')]]['monitors'],{'value':_0x79430f[_0xb64c3e('0x3')]});_[_0xb64c3e('0x12')](_0x326089)&&recordings[_0x79430f[_0xb64c3e('0x13')]][_0xb64c3e('0xe')][_0xb64c3e('0xf')]({'value':_0x79430f[_0xb64c3e('0x3')]});}}}catch(_0x501d22){utils['error'](_0x501d22['stack']);}},exports['hangup']=function(_0x124aa7){const _0x4d4ffa=_0x145ec8;try{!_['isNil'](recordings[_0x124aa7['uniqueid']])&&(recordings[_0x124aa7[_0x4d4ffa('0x18')]][_0x4d4ffa('0x2c')]=_0x124aa7[_0x4d4ffa('0x2c')],recordings[_0x124aa7[_0x4d4ffa('0x18')]]['calleridname']=_0x124aa7[_0x4d4ffa('0x1e')],recordings[_0x124aa7['uniqueid']]['connectedlinenum']=_0x124aa7[_0x4d4ffa('0x1b')],recordings[_0x124aa7[_0x4d4ffa('0x18')]][_0x4d4ffa('0x5')]=_0x124aa7[_0x4d4ffa('0x5')],recordings[_0x124aa7['uniqueid']][_0x4d4ffa('0x16')]==_0x4d4ffa('0x17')&&recordings[_0x124aa7[_0x4d4ffa('0x18')]][_0x4d4ffa('0x22')]&&(recordings[_0x124aa7[_0x4d4ffa('0x18')]][_0x4d4ffa('0x1b')]=recordings[_0x124aa7[_0x4d4ffa('0x18')]][_0x4d4ffa('0x22')],recordings[_0x124aa7[_0x4d4ffa('0x18')]][_0x4d4ffa('0x5')]=''),recordings[_0x124aa7[_0x4d4ffa('0x18')]][_0x4d4ffa('0xe')][_0x4d4ffa('0xc')](_0x5f5907=>{const _0x13b855=_0x4d4ffa,_0xdc0a27=_['clone'](recordings[_0x124aa7[_0x13b855('0x18')]]);_0xdc0a27[_0x13b855('0x3')]=_0x5f5907[_0x13b855('0x3')],writeDB(_0xdc0a27);}),delete recordings[_0x124aa7[_0x4d4ffa('0x18')]]);}catch(_0x4637a3){utils['error'](_0x4637a3[_0x4d4ffa('0x1f')]);}},exports[_0x145ec8('0x26')]=function(_0x4c935f){const _0x2ba084=_0x145ec8;try{if(!_[_0x2ba084('0x12')](recordings[_0x4c935f['uniqueid']])){if(_0x4c935f[_0x2ba084('0x8')]['toLowerCase']()=='set'&&_[_0x2ba084('0x4')](_0x4c935f[_0x2ba084('0x11')][_0x2ba084('0x25')](),_0x2ba084('0x20'))){const _0x51f581=_0x4c935f[_0x2ba084('0x11')][_0x2ba084('0x27')]('='),_0x3fdc8c=_0x51f581[0x0][_0x2ba084('0x10')](_0x51f581[0x0][_0x2ba084('0x7')]('(')+0x1,_0x51f581[0x0]['lastIndexOf'](')')),_0x4c9bd0=_0x51f581[0x1];recordings[_0x4c935f['uniqueid']][_0x3fdc8c]=_0x4c9bd0;}}}catch(_0x47b134){utils[_0x2ba084('0x24')](_0x47b134[_0x2ba084('0x1f')]);}},exports[_0x145ec8('0x2f')]=function(_0x34c175){const _0x3516a3=_0x145ec8;try{!_[_0x3516a3('0x12')](recordings[_0x34c175['uniqueid']])&&(recordings[_0x34c175['uniqueid']][_0x3516a3('0x14')]=_0x34c175[_0x3516a3('0x14')]);}catch(_0x531f95){utils[_0x3516a3('0x24')](_0x531f95[_0x3516a3('0x1f')]);}};
\ No newline at end of file