Built motion from commit (unavailable).|2.3.3
[motion2.git] / server / services / xdr / recordings.controller.js
index 7e6280b..08d1298 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x19ea=['varset','isNil','variable','mixmonitor_filename','endsWith','value','replace','.wav49','.WAV','assign','agentconnect','membername','queue','connectedlinenum','type','dialer','uniqueid','lastdata','destination','calleridnum','destinationcontext','connectedlinename','calleridname','lodash','debug','getUserByInternal','accountcode','then','name','UserId','request','CreateVoiceRecording','channel'];(function(_0x306ca4,_0x238ec2){var _0xe3f589=function(_0x2df96d){while(--_0x2df96d){_0x306ca4['push'](_0x306ca4['shift']());}};_0xe3f589(++_0x238ec2);}(_0x19ea,0xfe));var _0xa19e=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0x19ea[_0x424a9a];return _0xa7831c;};'use strict';var _=require(_0xa19e('0x0'));var utils=require('./utils');var recordings={};function writeDB(_0x49bcb5){utils[_0xa19e('0x1')](_0x49bcb5);if(_0x49bcb5['accountcode']){utils[_0xa19e('0x2')](_0x49bcb5[_0xa19e('0x3')])[_0xa19e('0x4')](function(_0x4d323a){if(_0x4d323a){_0x49bcb5['membername']=_0x4d323a[_0xa19e('0x5')];_0x49bcb5[_0xa19e('0x6')]=_0x4d323a['id'];}utils[_0xa19e('0x7')](_0xa19e('0x8'),_0x49bcb5);});}else{utils[_0xa19e('0x7')](_0xa19e('0x8'),_0x49bcb5);}if(recordings[_0x49bcb5[_0xa19e('0x9')]]){delete recordings[_0x49bcb5[_0xa19e('0x9')]];}}exports[_0xa19e('0xa')]=function(_0x33253e){if(!_[_0xa19e('0xb')](_0x33253e['variable'])&&!_[_0xa19e('0xb')](_0x33253e[_0xa19e('0xc')][_0xa19e('0xd')])){if(!_[_0xa19e('0xb')](recordings[_0x33253e['channel']])){writeDB(recordings[_0x33253e[_0xa19e('0x9')]]);}if(_[_0xa19e('0xe')](_0x33253e[_0xa19e('0xf')],'.wav49')){_0x33253e[_0xa19e('0xf')]=_0x33253e[_0xa19e('0xf')][_0xa19e('0x10')](_0xa19e('0x11'),_0xa19e('0x12'));}recordings[_0x33253e['channel']]=_[_0xa19e('0x13')](_0x33253e,{});}};exports[_0xa19e('0x14')]=function(_0xa7e0c4){if(!_[_0xa19e('0xb')](recordings[_0xa7e0c4[_0xa19e('0x9')]])){recordings[_0xa7e0c4[_0xa19e('0x9')]]=_[_0xa19e('0x13')](recordings[_0xa7e0c4[_0xa19e('0x9')]],{'membername':_0xa7e0c4[_0xa19e('0x15')],'queue':_0xa7e0c4[_0xa19e('0x16')],'accountcode':_0xa7e0c4[_0xa19e('0x17')]});}};exports['cdr']=function(_0x28fd37){if(!_[_0xa19e('0xb')](recordings[_0x28fd37[_0xa19e('0x9')]])){recordings[_0x28fd37[_0xa19e('0x9')]]=_[_0xa19e('0x13')](recordings[_0x28fd37[_0xa19e('0x9')]],{'type':_0x28fd37[_0xa19e('0x18')]});writeDB(recordings[_0x28fd37['channel']]);}else if(!_[_0xa19e('0xb')](recordings[_0x28fd37['destinationchannel']])){recordings[_0x28fd37[_0xa19e('0x9')]]=recordings[_0x28fd37['destinationchannel']];delete recordings[_0x28fd37['destinationchannel']];if(_0x28fd37[_0xa19e('0x18')]==_0xa19e('0x19')){recordings[_0x28fd37['channel']]=_[_0xa19e('0x13')](recordings[_0x28fd37[_0xa19e('0x9')]],{'type':_0x28fd37[_0xa19e('0x18')],'uniqueid':_0x28fd37[_0xa19e('0x1a')],'context':_0x28fd37['destinationcontext'],'queue':_0x28fd37[_0xa19e('0x1b')],'connectedlinenum':_0x28fd37[_0xa19e('0x3')],'connectedlinename':'','calleridnum':_0x28fd37[_0xa19e('0x1c')],'exten':recordings[_0x28fd37[_0xa19e('0x9')]][_0xa19e('0x1d')]});}else{recordings[_0x28fd37[_0xa19e('0x9')]]=_[_0xa19e('0x13')](recordings[_0x28fd37[_0xa19e('0x9')]],{'type':_0x28fd37[_0xa19e('0x18')],'channel':_0x28fd37['channel'],'exten':_0x28fd37[_0xa19e('0x1c')],'context':_0x28fd37[_0xa19e('0x1e')],'uniqueid':_0x28fd37['uniqueid'],'calleridnum':recordings[_0x28fd37[_0xa19e('0x9')]][_0xa19e('0x17')],'calleridname':recordings[_0x28fd37['channel']][_0xa19e('0x1f')],'connectedlinenum':recordings[_0x28fd37[_0xa19e('0x9')]]['calleridnum'],'connectedlinename':recordings[_0x28fd37[_0xa19e('0x9')]][_0xa19e('0x20')]});}writeDB(recordings[_0x28fd37[_0xa19e('0x9')]]);}};
\ No newline at end of file
+var _0x1d5b=['varset','variable','isNil','value','.wav49','replace','.WAV','agentconnect','assign','queue','connectedlinenum','type','destinationchannel','dialer','uniqueid','destinationcontext','lastdata','calleridnum','calleridname','lodash','./utils','accountcode','then','membername','request','CreateVoiceRecording','channel'];(function(_0x15884f,_0x26355d){var _0x31073c=function(_0x3417d5){while(--_0x3417d5){_0x15884f['push'](_0x15884f['shift']());}};_0x31073c(++_0x26355d);}(_0x1d5b,0x13c));var _0xb1d5=function(_0x142cb5,_0x1a7750){_0x142cb5=_0x142cb5-0x0;var _0x321de3=_0x1d5b[_0x142cb5];return _0x321de3;};'use strict';var _=require(_0xb1d5('0x0'));var utils=require(_0xb1d5('0x1'));var recordings={};function writeDB(_0x1a1089){utils['debug'](_0x1a1089);if(_0x1a1089[_0xb1d5('0x2')]){utils['getUserByInternal'](_0x1a1089[_0xb1d5('0x2')])[_0xb1d5('0x3')](function(_0xa12a1e){if(_0xa12a1e){_0x1a1089[_0xb1d5('0x4')]=_0xa12a1e['name'];_0x1a1089['UserId']=_0xa12a1e['id'];}utils[_0xb1d5('0x5')](_0xb1d5('0x6'),_0x1a1089);});}else{utils[_0xb1d5('0x5')](_0xb1d5('0x6'),_0x1a1089);}if(recordings[_0x1a1089[_0xb1d5('0x7')]]){delete recordings[_0x1a1089[_0xb1d5('0x7')]];}}exports[_0xb1d5('0x8')]=function(_0xc3f315){if(!_['isNil'](_0xc3f315[_0xb1d5('0x9')])&&!_[_0xb1d5('0xa')](_0xc3f315['variable']['mixmonitor_filename'])){if(!_[_0xb1d5('0xa')](recordings[_0xc3f315[_0xb1d5('0x7')]])){writeDB(recordings[_0xc3f315[_0xb1d5('0x7')]]);}if(_['endsWith'](_0xc3f315[_0xb1d5('0xb')],_0xb1d5('0xc'))){_0xc3f315[_0xb1d5('0xb')]=_0xc3f315['value'][_0xb1d5('0xd')](_0xb1d5('0xc'),_0xb1d5('0xe'));}recordings[_0xc3f315[_0xb1d5('0x7')]]=_['assign'](_0xc3f315,{});}};exports[_0xb1d5('0xf')]=function(_0x31a2b6){if(!_[_0xb1d5('0xa')](recordings[_0x31a2b6['channel']])){recordings[_0x31a2b6[_0xb1d5('0x7')]]=_[_0xb1d5('0x10')](recordings[_0x31a2b6[_0xb1d5('0x7')]],{'membername':_0x31a2b6[_0xb1d5('0x4')],'queue':_0x31a2b6[_0xb1d5('0x11')],'accountcode':_0x31a2b6[_0xb1d5('0x12')]});}};exports['cdr']=function(_0x199deb){if(!_['isNil'](recordings[_0x199deb[_0xb1d5('0x7')]])){recordings[_0x199deb[_0xb1d5('0x7')]]=_['assign'](recordings[_0x199deb[_0xb1d5('0x7')]],{'type':_0x199deb[_0xb1d5('0x13')]});writeDB(recordings[_0x199deb[_0xb1d5('0x7')]]);}else if(!_['isNil'](recordings[_0x199deb[_0xb1d5('0x14')]])){recordings[_0x199deb[_0xb1d5('0x7')]]=recordings[_0x199deb['destinationchannel']];delete recordings[_0x199deb[_0xb1d5('0x14')]];if(_0x199deb[_0xb1d5('0x13')]==_0xb1d5('0x15')){recordings[_0x199deb[_0xb1d5('0x7')]]=_[_0xb1d5('0x10')](recordings[_0x199deb['channel']],{'type':_0x199deb[_0xb1d5('0x13')],'uniqueid':_0x199deb[_0xb1d5('0x16')],'context':_0x199deb[_0xb1d5('0x17')],'queue':_0x199deb[_0xb1d5('0x18')],'connectedlinenum':_0x199deb[_0xb1d5('0x2')],'connectedlinename':'','calleridnum':_0x199deb['destination'],'exten':recordings[_0x199deb[_0xb1d5('0x7')]]['calleridnum']});}else{recordings[_0x199deb[_0xb1d5('0x7')]]=_['assign'](recordings[_0x199deb[_0xb1d5('0x7')]],{'type':_0x199deb[_0xb1d5('0x13')],'channel':_0x199deb[_0xb1d5('0x7')],'exten':_0x199deb['destination'],'context':_0x199deb['destinationcontext'],'uniqueid':_0x199deb[_0xb1d5('0x16')],'calleridnum':recordings[_0x199deb[_0xb1d5('0x7')]][_0xb1d5('0x12')],'calleridname':recordings[_0x199deb[_0xb1d5('0x7')]]['connectedlinename'],'connectedlinenum':recordings[_0x199deb[_0xb1d5('0x7')]][_0xb1d5('0x19')],'connectedlinename':recordings[_0x199deb[_0xb1d5('0x7')]][_0xb1d5('0x1a')]});}writeDB(recordings[_0x199deb[_0xb1d5('0x7')]]);}};
\ No newline at end of file