Built motion from commit 709aa6fb5ed03aa61bc373fcdbf622215d37d30b. Version 3.0.0...
[motion-next.git] / server / api / voiceChanSpy / voiceChanSpy.model.js
index ec0eafd..8101773 100644 (file)
@@ -1 +1 @@
-const a715_0x52e1=['from-sip','lodash','system','User','${UNIQUEID}.%s,ab','VoiceChanSpy','define','recordingFormat','options','VoiceExtension','prefix','push','context','bulkCreate','auth','join','catch','merge','internal','then','format','voice_chanspy','password','util','%s%s','./voiceChanSpy.attributes','record','destroy','concat','findAll','models','length','CDR(type)=%s','name','chanspy','agent'];(function(_0x479010,_0x52e11d){const _0x27bf43=function(_0x39a93c){while(--_0x39a93c){_0x479010['push'](_0x479010['shift']());}};_0x27bf43(++_0x52e11d);}(a715_0x52e1,0x1e9));const a715_0x27bf=function(_0x479010,_0x52e11d){_0x479010=_0x479010-0x0;let _0x27bf43=a715_0x52e1[_0x479010];return _0x27bf43;};const _0x24997a=a715_0x27bf;'use strict';const _=require(_0x24997a('0x10')),util=require(_0x24997a('0x2')),attributes=require(_0x24997a('0x4')),createChanSpyApplications=function(_0x39a93c,_0x58bda5,_0x57be8b){const _0x29c90c=_0x24997a;let _0x11b1d9=0x1;const _0x3e91cc=[],_0xa7fd01={'context':_0x58bda5[_0x29c90c('0x1b')]||_0x29c90c('0xf'),'exten':util[_0x29c90c('0x23')](_0x29c90c('0x3'),_0x39a93c[_0x29c90c('0x19')],_0x57be8b),'type':_0x29c90c('0x11'),'isApp':![],'ChanSpyId':_0x39a93c['id'],'UserId':_0x58bda5['id']};return _0x3e91cc[_0x29c90c('0x1a')](_[_0x29c90c('0x20')]({'app':'Set','appdata':util[_0x29c90c('0x23')](_0x29c90c('0xb'),_0x29c90c('0xd')),'priority':_0x11b1d9++},_0xa7fd01)),_0x39a93c['record']&&_0x3e91cc['push'](_[_0x29c90c('0x20')]({'app':'MixMonitor','appdata':util['format'](_0x29c90c('0x13'),_0x39a93c[_0x29c90c('0x16')]),'priority':_0x11b1d9++},_0xa7fd01)),_0x39a93c[_0x29c90c('0x1d')]&&_0x3e91cc[_0x29c90c('0x1a')](_[_0x29c90c('0x20')]({'app':'Authenticate','appdata':_0x39a93c[_0x29c90c('0x1')],'priority':_0x11b1d9++},_0xa7fd01)),_0x3e91cc['push'](_[_0x29c90c('0x20')]({'app':'ChanSpy','appdata':util[_0x29c90c('0x23')]('SIP/%s,%s',_0x58bda5[_0x29c90c('0xc')],_0x39a93c[_0x29c90c('0x17')]?_0x39a93c[_0x29c90c('0x17')][_0x29c90c('0x1e')](''):''),'priority':_0x11b1d9++},_0xa7fd01)),_0x39a93c[_0x29c90c('0x5')]&&_0x3e91cc[_0x29c90c('0x1a')](_['merge']({'app':'StopMixMonitor','priority':_0x11b1d9++},_0xa7fd01)),_0x3e91cc;},addChanSpyApplications=function(_0x16a132,_0x12ecb8){const _0x45562a=_0x24997a;let _0x5d0bb0=[];for(let _0x5974e3=0x0;_0x5974e3<_0x12ecb8[_0x45562a('0xa')];_0x5974e3++){_0x5d0bb0=_0x5d0bb0[_0x45562a('0x7')](createChanSpyApplications(_0x16a132,_0x12ecb8[_0x5974e3],_0x12ecb8[_0x5974e3]['internal'])),_0x12ecb8[_0x5974e3][_0x45562a('0x21')]!=_0x12ecb8[_0x5974e3]['name']&&(_0x5d0bb0=_0x5d0bb0[_0x45562a('0x7')](createChanSpyApplications(_0x16a132,_0x12ecb8[_0x5974e3],_0x12ecb8[_0x5974e3]['name'])));}return _0x5d0bb0;},getChanSpy=function(_0x18a59e,_0x24f4f6){return new Promise(function(_0x33f89f,_0x4adf99){const _0x25eb8c=a715_0x27bf;return _0x18a59e[_0x25eb8c('0x12')][_0x25eb8c('0x8')]({'attributes':['id',_0x25eb8c('0xc'),_0x25eb8c('0x21')],'where':{'role':_0x25eb8c('0xe'),'chanspy':!![]},'raw':!![]})[_0x25eb8c('0x22')](function(_0x2e2117){if(_0x2e2117)return _0x33f89f(addChanSpyApplications(_0x24f4f6,_0x2e2117));return _0x33f89f([]);})[_0x25eb8c('0x1f')](function(_0x815080){_0x4adf99(_0x815080);});});};module['exports']=function(_0x4f0e2e){const _0x11b2f1=_0x24997a,_0x1176a0=_0x4f0e2e[_0x11b2f1('0x9')],_0xe8858f=_0x4f0e2e[_0x11b2f1('0x15')](_0x11b2f1('0x14'),attributes,{'tableName':_0x11b2f1('0x0'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x46ee2e){const _0x1771a1=_0x11b2f1;return getChanSpy(_0x1176a0,_0x46ee2e)['then'](function(_0x384bee){const _0x24fd3a=a715_0x27bf;return _0x384bee&&_0x384bee['length']?_0x1176a0[_0x24fd3a('0x18')]['bulkCreate'](_0x384bee):null;})[_0x1771a1('0x1f')](function(_0x4c2e1d){return _0x4c2e1d;});},'afterUpdate':function(_0x35aa8d){const _0x1a4261=_0x11b2f1;return _0x1176a0[_0x1a4261('0x18')][_0x1a4261('0x6')]({'where':{'ChanSpyId':_0x35aa8d['id']}})[_0x1a4261('0x22')](function(){return getChanSpy(_0x1176a0,_0x35aa8d);})['then'](function(_0x5b97bd){const _0x503740=_0x1a4261;return _0x5b97bd&&_0x5b97bd[_0x503740('0xa')]?_0x1176a0[_0x503740('0x18')][_0x503740('0x1c')](_0x5b97bd):null;})[_0x1a4261('0x1f')](function(_0x5600b8){return _0x5600b8;});},'afterDestroy':function(_0x5b9c69){const _0x101bbb=_0x11b2f1;return _0x1176a0[_0x101bbb('0x18')][_0x101bbb('0x6')]({'where':{'ChanSpyId':_0x5b9c69['id']}})['then'](function(){return null;})['catch'](function(_0x5f2c9f){return _0x5f2c9f;});}}});return _0xe8858f;};
\ No newline at end of file
+const a715_0x309f=['then','VoiceChanSpy','lodash','name','findAll','User','options','./voiceChanSpy.attributes','SIP/%s,%s','${UNIQUEID}.%s,ab','VoiceExtension','MixMonitor','prefix','ChanSpy','exports','record','util','catch','StopMixMonitor','concat','push','define','destroy','models','recordingFormat','chanspy','length','bulkCreate','auth','merge','join','password','format','context','internal','voice_chanspy','%s%s'];(function(_0x4b5fd7,_0x309fdf){const _0x181f06=function(_0x105716){while(--_0x105716){_0x4b5fd7['push'](_0x4b5fd7['shift']());}};_0x181f06(++_0x309fdf);}(a715_0x309f,0x163));const a715_0x181f=function(_0x4b5fd7,_0x309fdf){_0x4b5fd7=_0x4b5fd7-0x0;let _0x181f06=a715_0x309f[_0x4b5fd7];return _0x181f06;};const _0x265061=a715_0x181f;'use strict';const _=require(_0x265061('0x11')),util=require(_0x265061('0x1f')),attributes=require(_0x265061('0x16')),createChanSpyApplications=function(_0x105716,_0x4428b4,_0x4b22d8){const _0xbf7c12=_0x265061;let _0xaf0c87=0x1;const _0x1a1b72=[],_0x58c67b={'context':_0x4428b4[_0xbf7c12('0xb')]||'from-sip','exten':util[_0xbf7c12('0xa')](_0xbf7c12('0xe'),_0x105716[_0xbf7c12('0x1b')],_0x4b22d8),'type':'system','isApp':![],'ChanSpyId':_0x105716['id'],'UserId':_0x4428b4['id']};return _0x1a1b72[_0xbf7c12('0x23')](_[_0xbf7c12('0x7')]({'app':'Set','appdata':util[_0xbf7c12('0xa')]('CDR(type)=%s',_0xbf7c12('0x3')),'priority':_0xaf0c87++},_0x58c67b)),_0x105716[_0xbf7c12('0x1e')]&&_0x1a1b72['push'](_[_0xbf7c12('0x7')]({'app':_0xbf7c12('0x1a'),'appdata':util[_0xbf7c12('0xa')](_0xbf7c12('0x18'),_0x105716[_0xbf7c12('0x2')]),'priority':_0xaf0c87++},_0x58c67b)),_0x105716[_0xbf7c12('0x6')]&&_0x1a1b72[_0xbf7c12('0x23')](_[_0xbf7c12('0x7')]({'app':'Authenticate','appdata':_0x105716[_0xbf7c12('0x9')],'priority':_0xaf0c87++},_0x58c67b)),_0x1a1b72[_0xbf7c12('0x23')](_[_0xbf7c12('0x7')]({'app':_0xbf7c12('0x1c'),'appdata':util[_0xbf7c12('0xa')](_0xbf7c12('0x17'),_0x4428b4[_0xbf7c12('0x12')],_0x105716[_0xbf7c12('0x15')]?_0x105716[_0xbf7c12('0x15')][_0xbf7c12('0x8')](''):''),'priority':_0xaf0c87++},_0x58c67b)),_0x105716[_0xbf7c12('0x1e')]&&_0x1a1b72[_0xbf7c12('0x23')](_[_0xbf7c12('0x7')]({'app':_0xbf7c12('0x21'),'priority':_0xaf0c87++},_0x58c67b)),_0x1a1b72;},addChanSpyApplications=function(_0x2af23e,_0x2364e8){const _0x4b322f=_0x265061;let _0xe1b709=[];for(let _0x281172=0x0;_0x281172<_0x2364e8[_0x4b322f('0x4')];_0x281172++){_0xe1b709=_0xe1b709[_0x4b322f('0x22')](createChanSpyApplications(_0x2af23e,_0x2364e8[_0x281172],_0x2364e8[_0x281172][_0x4b322f('0xc')])),_0x2364e8[_0x281172][_0x4b322f('0xc')]!=_0x2364e8[_0x281172]['name']&&(_0xe1b709=_0xe1b709[_0x4b322f('0x22')](createChanSpyApplications(_0x2af23e,_0x2364e8[_0x281172],_0x2364e8[_0x281172][_0x4b322f('0x12')])));}return _0xe1b709;},getChanSpy=function(_0x1062fe,_0x794b8d){return new Promise(function(_0x5b150e,_0x12b0f3){const _0x4994eb=a715_0x181f;return _0x1062fe[_0x4994eb('0x14')][_0x4994eb('0x13')]({'attributes':['id',_0x4994eb('0x12'),_0x4994eb('0xc')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0x4994eb('0xf')](function(_0x100328){if(_0x100328)return _0x5b150e(addChanSpyApplications(_0x794b8d,_0x100328));return _0x5b150e([]);})['catch'](function(_0x38cc9c){_0x12b0f3(_0x38cc9c);});});};module[_0x265061('0x1d')]=function(_0x2942cd){const _0x3a9fe5=_0x265061,_0x780746=_0x2942cd[_0x3a9fe5('0x1')],_0x2e2665=_0x2942cd[_0x3a9fe5('0x24')](_0x3a9fe5('0x10'),attributes,{'tableName':_0x3a9fe5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xc1e0bc){const _0x222348=_0x3a9fe5;return getChanSpy(_0x780746,_0xc1e0bc)['then'](function(_0x582d11){const _0x2994cb=a715_0x181f;return _0x582d11&&_0x582d11['length']?_0x780746[_0x2994cb('0x19')][_0x2994cb('0x5')](_0x582d11):null;})[_0x222348('0x20')](function(_0x25cba1){return _0x25cba1;});},'afterUpdate':function(_0x173916){const _0x141e3f=_0x3a9fe5;return _0x780746[_0x141e3f('0x19')][_0x141e3f('0x0')]({'where':{'ChanSpyId':_0x173916['id']}})[_0x141e3f('0xf')](function(){return getChanSpy(_0x780746,_0x173916);})[_0x141e3f('0xf')](function(_0x51b7b8){const _0x5b41e7=_0x141e3f;return _0x51b7b8&&_0x51b7b8[_0x5b41e7('0x4')]?_0x780746[_0x5b41e7('0x19')][_0x5b41e7('0x5')](_0x51b7b8):null;})['catch'](function(_0x17fb4b){return _0x17fb4b;});},'afterDestroy':function(_0x27b60d){const _0x4657fa=_0x3a9fe5;return _0x780746[_0x4657fa('0x19')]['destroy']({'where':{'ChanSpyId':_0x27b60d['id']}})[_0x4657fa('0xf')](function(){return null;})[_0x4657fa('0x20')](function(_0x546f09){return _0x546f09;});}}});return _0x2e2665;};
\ No newline at end of file