Built motion from commit 52c8a02d.|2.6.29
[motion2.git] / server / services / xdr / recordings.controller.js
index 53f6bed..53d4091 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfcb3=['[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','.WAV','find','monitors','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','outbound','clone','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','util','./utils','info','format','[%s][recordings][writeDB]','uniqueid','accountcode','getUserByInternal','then','name','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','newstate','[%s][recordings][newstate]','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','isNil','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','variable','mixmonitor_filename'];(function(_0x30bdff,_0x308063){var _0x1e7ca9=function(_0x1a6e16){while(--_0x1a6e16){_0x30bdff['push'](_0x30bdff['shift']());}};_0x1e7ca9(++_0x308063);}(_0xfcb3,0x167));var _0x3fcb=function(_0x2d2f02,_0x1580f4){_0x2d2f02=_0x2d2f02-0x0;var _0x14b591=_0xfcb3[_0x2d2f02];return _0x14b591;};'use strict';var _=require(_0x3fcb('0x0'));var util=require(_0x3fcb('0x1'));var utils=require(_0x3fcb('0x2'));var recordings={};function writeDB(_0x224638){utils[_0x3fcb('0x3')](util[_0x3fcb('0x4')](_0x3fcb('0x5'),_0x224638[_0x3fcb('0x6')]));if(_0x224638[_0x3fcb('0x7')]){utils[_0x3fcb('0x8')](_0x224638[_0x3fcb('0x7')])[_0x3fcb('0x9')](function(_0x5d9d82){if(_0x5d9d82){_0x224638['membername']=_0x5d9d82[_0x3fcb('0xa')];_0x224638['UserId']=_0x5d9d82['id'];}utils[_0x3fcb('0xb')](_0x3fcb('0xc'),_0x224638);});}else{utils[_0x3fcb('0xb')](_0x3fcb('0xc'),_0x224638);}}exports[_0x3fcb('0xd')]=function(_0x22b2ed){try{utils[_0x3fcb('0xe')](util['format'](_0x3fcb('0xf'),_0x22b2ed['uniqueid']),_0x22b2ed);if(_0x22b2ed['uniqueid']==_0x22b2ed[_0x3fcb('0x10')]){utils[_0x3fcb('0x3')](util['format'](_0x3fcb('0x11'),_0x22b2ed[_0x3fcb('0x6')],_0x22b2ed[_0x3fcb('0x12')],_0x22b2ed[_0x3fcb('0x13')]));recordings[_0x22b2ed[_0x3fcb('0x6')]]={'uniqueid':_0x22b2ed[_0x3fcb('0x6')],'accountcode':_0x22b2ed[_0x3fcb('0x7')],'exten':_0x22b2ed[_0x3fcb('0x13')],'context':_0x22b2ed[_0x3fcb('0x12')],'channel':_0x22b2ed[_0x3fcb('0x14')],'monitors':[]};}}catch(_0x4515cf){utils[_0x3fcb('0x15')](util['format'](_0x3fcb('0xf'),_0x22b2ed[_0x3fcb('0x6')]),_0x4515cf);}};exports[_0x3fcb('0x16')]=function(_0x2eb336){try{utils[_0x3fcb('0xe')](util[_0x3fcb('0x4')](_0x3fcb('0x17'),_0x2eb336[_0x3fcb('0x6')]),_0x2eb336);if(!_['isNil'](recordings[_0x2eb336['uniqueid']])&&_0x2eb336[_0x3fcb('0x18')]==0x6){utils[_0x3fcb('0x3')](util[_0x3fcb('0x4')](_0x3fcb('0x19'),_0x2eb336[_0x3fcb('0x6')],_0x2eb336[_0x3fcb('0x12')],_0x2eb336[_0x3fcb('0x14')]));}else if(!_[_0x3fcb('0x1a')](recordings[_0x2eb336[_0x3fcb('0x10')]])&&_0x2eb336[_0x3fcb('0x18')]==0x6&&_0x2eb336[_0x3fcb('0x12')]!=_0x3fcb('0x1b')){utils[_0x3fcb('0x3')](util[_0x3fcb('0x4')](_0x3fcb('0x1c'),_0x2eb336['uniqueid'],_0x2eb336[_0x3fcb('0x10')],_0x2eb336[_0x3fcb('0x12')],_0x2eb336['channel']));recordings[_0x2eb336[_0x3fcb('0x10')]][_0x3fcb('0x7')]=_0x2eb336[_0x3fcb('0x7')];}}catch(_0x5b076a){utils[_0x3fcb('0x15')](util['format']('[%s][recordings][newstate]',_0x2eb336['uniqueid']),_0x5b076a);}};exports['varset']=function(_0x5cbe4c){try{if(!_[_0x3fcb('0x1a')](_0x5cbe4c[_0x3fcb('0x1d')])&&!_[_0x3fcb('0x1a')](_0x5cbe4c[_0x3fcb('0x1d')][_0x3fcb('0x1e')])){utils['debug'](util[_0x3fcb('0x4')](_0x3fcb('0x1f'),_0x5cbe4c[_0x3fcb('0x6')]),_0x5cbe4c);utils[_0x3fcb('0x3')](util[_0x3fcb('0x4')](_0x3fcb('0x20'),_0x5cbe4c[_0x3fcb('0x6')],_0x5cbe4c[_0x3fcb('0x1d')],_0x5cbe4c[_0x3fcb('0x21')]));if(_[_0x3fcb('0x22')](_0x5cbe4c[_0x3fcb('0x21')],_0x3fcb('0x23'))){_0x5cbe4c[_0x3fcb('0x21')]=_0x5cbe4c['value'][_0x3fcb('0x24')]('.wav49',_0x3fcb('0x25'));}if(recordings[_0x5cbe4c[_0x3fcb('0x10')]]){var _0xa290a1=_[_0x3fcb('0x26')](recordings[_0x5cbe4c[_0x3fcb('0x10')]][_0x3fcb('0x27')],{'value':_0x5cbe4c['value']});if(_['isNil'](_0xa290a1)){recordings[_0x5cbe4c[_0x3fcb('0x10')]][_0x3fcb('0x27')]['push']({'value':_0x5cbe4c[_0x3fcb('0x21')]});}}}}catch(_0x56b1e3){utils[_0x3fcb('0x15')](util['format'](_0x3fcb('0x1f'),_0x5cbe4c[_0x3fcb('0x6')]),_0x56b1e3);}};exports[_0x3fcb('0x28')]=function(_0x265080){try{if(!_[_0x3fcb('0x1a')](recordings[_0x265080[_0x3fcb('0x6')]])){utils[_0x3fcb('0xe')](util[_0x3fcb('0x4')](_0x3fcb('0x29'),_0x265080[_0x3fcb('0x6')]),_0x265080);utils[_0x3fcb('0x3')](util[_0x3fcb('0x4')](_0x3fcb('0x2a'),_0x265080['uniqueid'],_0x265080[_0x3fcb('0x2b')],_0x265080[_0x3fcb('0x2c')],_0x265080[_0x3fcb('0x2d')]));recordings[_0x265080[_0x3fcb('0x6')]][_0x3fcb('0x2b')]=_0x265080[_0x3fcb('0x2b')];recordings[_0x265080[_0x3fcb('0x6')]][_0x3fcb('0x2c')]=_0x265080[_0x3fcb('0x2c')];recordings[_0x265080['uniqueid']][_0x3fcb('0x2e')]=_0x265080[_0x3fcb('0x2e')];recordings[_0x265080[_0x3fcb('0x6')]][_0x3fcb('0x2f')]=_0x265080[_0x3fcb('0x2f')];if(recordings[_0x265080[_0x3fcb('0x6')]][_0x3fcb('0x30')]==_0x3fcb('0x31')&&recordings[_0x265080[_0x3fcb('0x6')]][_0x3fcb('0x7')]){recordings[_0x265080[_0x3fcb('0x6')]][_0x3fcb('0x2e')]=recordings[_0x265080['uniqueid']][_0x3fcb('0x7')];recordings[_0x265080[_0x3fcb('0x6')]][_0x3fcb('0x2f')]='';}recordings[_0x265080[_0x3fcb('0x6')]][_0x3fcb('0x27')]['forEach'](function(_0x4e2e47){var _0x20d4a8=_[_0x3fcb('0x32')](recordings[_0x265080['uniqueid']]);_0x20d4a8[_0x3fcb('0x21')]=_0x4e2e47[_0x3fcb('0x21')];writeDB(_0x20d4a8);});delete recordings[_0x265080[_0x3fcb('0x6')]];}}catch(_0x4a5080){utils['error'](util[_0x3fcb('0x4')](_0x3fcb('0x29'),_0x265080['uniqueid']),_0x4a5080);}};exports['newexten']=function(_0x104b25){try{if(!_['isNil'](recordings[_0x104b25[_0x3fcb('0x6')]])){utils[_0x3fcb('0xe')](util[_0x3fcb('0x4')](_0x3fcb('0x33'),_0x104b25[_0x3fcb('0x6')]),_0x104b25);utils[_0x3fcb('0x3')](util[_0x3fcb('0x4')](_0x3fcb('0x34'),_0x104b25[_0x3fcb('0x6')],_0x104b25[_0x3fcb('0x35')],_0x104b25[_0x3fcb('0x36')]));if(_0x104b25[_0x3fcb('0x35')][_0x3fcb('0x37')]()==_0x3fcb('0x38')&&_[_0x3fcb('0x39')](_0x104b25[_0x3fcb('0x36')][_0x3fcb('0x37')](),'cdr')){var _0x1ac054=_0x104b25[_0x3fcb('0x36')][_0x3fcb('0x3a')]('=');var _0x97432f=_0x1ac054[0x0][_0x3fcb('0x3b')](_0x1ac054[0x0][_0x3fcb('0x3c')]('(')+0x1,_0x1ac054[0x0][_0x3fcb('0x3c')](')'));var _0x58b48e=_0x1ac054[0x1];recordings[_0x104b25[_0x3fcb('0x6')]][_0x97432f]=_0x58b48e;}}}catch(_0x1cce31){utils['error'](util[_0x3fcb('0x4')]('[%s][recordings][newexten]',_0x104b25[_0x3fcb('0x6')]),_0x1cce31);}};exports[_0x3fcb('0x3d')]=function(_0xc21084){try{if(!_['isNil'](recordings[_0xc21084['uniqueid']])){utils[_0x3fcb('0xe')](util[_0x3fcb('0x4')](_0x3fcb('0x3e'),_0xc21084[_0x3fcb('0x6')]),_0xc21084);utils[_0x3fcb('0x3')](util[_0x3fcb('0x4')](_0x3fcb('0x3f'),_0xc21084[_0x3fcb('0x6')],_0xc21084[_0x3fcb('0x40')]));recordings[_0xc21084[_0x3fcb('0x6')]][_0x3fcb('0x40')]=_0xc21084[_0x3fcb('0x40')];}}catch(_0x5ed586){utils[_0x3fcb('0x15')](util[_0x3fcb('0x4')](_0x3fcb('0x3e'),_0xc21084['uniqueid']),_0x5ed586);}};
\ No newline at end of file
+var _0xaeb8=['find','monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','outbound','forEach','clone','newexten','[%s][recordings][newexten]','application','appdata','toLowerCase','set','cdr','split','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','./utils','info','format','[%s][recordings][writeDB]','uniqueid','accountcode','getUserByInternal','then','name','request','CreateVoiceRecording','newchannel','[%s][recordings][newchannel]','linkedid','context','exten','channel','newstate','debug','[%s][recordings][newstate]','isNil','channelstate','error','varset','variable','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','.WAV'];(function(_0x233e33,_0x5266e9){var _0x529ed9=function(_0x55da2a){while(--_0x55da2a){_0x233e33['push'](_0x233e33['shift']());}};_0x529ed9(++_0x5266e9);}(_0xaeb8,0x107));var _0x8aeb=function(_0x296144,_0x26bbbf){_0x296144=_0x296144-0x0;var _0x5329b1=_0xaeb8[_0x296144];return _0x5329b1;};'use strict';var _=require(_0x8aeb('0x0'));var util=require('util');var utils=require(_0x8aeb('0x1'));var recordings={};function writeDB(_0x27c448){utils[_0x8aeb('0x2')](util[_0x8aeb('0x3')](_0x8aeb('0x4'),_0x27c448[_0x8aeb('0x5')]));if(_0x27c448[_0x8aeb('0x6')]){utils[_0x8aeb('0x7')](_0x27c448[_0x8aeb('0x6')])[_0x8aeb('0x8')](function(_0x574041){if(_0x574041){_0x27c448['membername']=_0x574041[_0x8aeb('0x9')];_0x27c448['UserId']=_0x574041['id'];}utils['request']('CreateVoiceRecording',_0x27c448);});}else{utils[_0x8aeb('0xa')](_0x8aeb('0xb'),_0x27c448);}}exports[_0x8aeb('0xc')]=function(_0x5c6e0c){try{utils['debug'](util[_0x8aeb('0x3')](_0x8aeb('0xd'),_0x5c6e0c['uniqueid']),_0x5c6e0c);if(_0x5c6e0c[_0x8aeb('0x5')]==_0x5c6e0c[_0x8aeb('0xe')]){utils[_0x8aeb('0x2')](util['format']('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x5c6e0c[_0x8aeb('0x5')],_0x5c6e0c[_0x8aeb('0xf')],_0x5c6e0c[_0x8aeb('0x10')]));recordings[_0x5c6e0c[_0x8aeb('0x5')]]={'uniqueid':_0x5c6e0c[_0x8aeb('0x5')],'accountcode':_0x5c6e0c[_0x8aeb('0x6')],'exten':_0x5c6e0c['exten'],'context':_0x5c6e0c[_0x8aeb('0xf')],'channel':_0x5c6e0c[_0x8aeb('0x11')],'monitors':[]};}}catch(_0x57b4b9){utils['error'](util[_0x8aeb('0x3')](_0x8aeb('0xd'),_0x5c6e0c['uniqueid']),_0x57b4b9);}};exports[_0x8aeb('0x12')]=function(_0x27e961){try{utils[_0x8aeb('0x13')](util[_0x8aeb('0x3')](_0x8aeb('0x14'),_0x27e961[_0x8aeb('0x5')]),_0x27e961);if(!_[_0x8aeb('0x15')](recordings[_0x27e961[_0x8aeb('0x5')]])&&_0x27e961[_0x8aeb('0x16')]==0x6){utils[_0x8aeb('0x2')](util['format']('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x27e961[_0x8aeb('0x5')],_0x27e961[_0x8aeb('0xf')],_0x27e961[_0x8aeb('0x11')]));}else if(!_[_0x8aeb('0x15')](recordings[_0x27e961['linkedid']])&&_0x27e961[_0x8aeb('0x16')]==0x6&&_0x27e961[_0x8aeb('0xf')]!='transfer'){utils['info'](util[_0x8aeb('0x3')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x27e961[_0x8aeb('0x5')],_0x27e961[_0x8aeb('0xe')],_0x27e961['context'],_0x27e961[_0x8aeb('0x11')]));recordings[_0x27e961[_0x8aeb('0xe')]]['accountcode']=_0x27e961[_0x8aeb('0x6')];}}catch(_0x422cae){utils[_0x8aeb('0x17')](util[_0x8aeb('0x3')]('[%s][recordings][newstate]',_0x27e961['uniqueid']),_0x422cae);}};exports[_0x8aeb('0x18')]=function(_0x307605){try{if(!_[_0x8aeb('0x15')](_0x307605[_0x8aeb('0x19')])&&!_[_0x8aeb('0x15')](_0x307605['variable']['mixmonitor_filename'])){utils[_0x8aeb('0x13')](util[_0x8aeb('0x3')](_0x8aeb('0x1a'),_0x307605[_0x8aeb('0x5')]),_0x307605);utils[_0x8aeb('0x2')](util[_0x8aeb('0x3')](_0x8aeb('0x1b'),_0x307605['uniqueid'],_0x307605[_0x8aeb('0x19')],_0x307605[_0x8aeb('0x1c')]));if(_[_0x8aeb('0x1d')](_0x307605[_0x8aeb('0x1c')],'.wav49')){_0x307605[_0x8aeb('0x1c')]=_0x307605[_0x8aeb('0x1c')]['replace'](_0x8aeb('0x1e'),_0x8aeb('0x1f'));}if(recordings[_0x307605[_0x8aeb('0xe')]]){var _0x3805a2=_[_0x8aeb('0x20')](recordings[_0x307605['linkedid']][_0x8aeb('0x21')],{'value':_0x307605[_0x8aeb('0x1c')]});if(_[_0x8aeb('0x15')](_0x3805a2)){recordings[_0x307605[_0x8aeb('0xe')]][_0x8aeb('0x21')][_0x8aeb('0x22')]({'value':_0x307605[_0x8aeb('0x1c')]});}}}}catch(_0xf216cb){utils[_0x8aeb('0x17')](util['format']('[%s][recordings][varset]',_0x307605[_0x8aeb('0x5')]),_0xf216cb);}};exports[_0x8aeb('0x23')]=function(_0x1bdab9){try{if(!_['isNil'](recordings[_0x1bdab9[_0x8aeb('0x5')]])){utils[_0x8aeb('0x13')](util['format'](_0x8aeb('0x24'),_0x1bdab9[_0x8aeb('0x5')]),_0x1bdab9);utils[_0x8aeb('0x2')](util['format'](_0x8aeb('0x25'),_0x1bdab9['uniqueid'],_0x1bdab9[_0x8aeb('0x26')],_0x1bdab9[_0x8aeb('0x27')],_0x1bdab9[_0x8aeb('0x28')]));recordings[_0x1bdab9[_0x8aeb('0x5')]][_0x8aeb('0x26')]=_0x1bdab9[_0x8aeb('0x26')];recordings[_0x1bdab9[_0x8aeb('0x5')]]['calleridname']=_0x1bdab9[_0x8aeb('0x27')];recordings[_0x1bdab9['uniqueid']][_0x8aeb('0x29')]=_0x1bdab9[_0x8aeb('0x29')];recordings[_0x1bdab9['uniqueid']][_0x8aeb('0x2a')]=_0x1bdab9[_0x8aeb('0x2a')];if(recordings[_0x1bdab9[_0x8aeb('0x5')]][_0x8aeb('0x2b')]==_0x8aeb('0x2c')&&recordings[_0x1bdab9[_0x8aeb('0x5')]][_0x8aeb('0x6')]){recordings[_0x1bdab9[_0x8aeb('0x5')]][_0x8aeb('0x29')]=recordings[_0x1bdab9['uniqueid']][_0x8aeb('0x6')];recordings[_0x1bdab9[_0x8aeb('0x5')]][_0x8aeb('0x2a')]='';}recordings[_0x1bdab9[_0x8aeb('0x5')]][_0x8aeb('0x21')][_0x8aeb('0x2d')](function(_0xee31bb){var _0x2c4227=_[_0x8aeb('0x2e')](recordings[_0x1bdab9[_0x8aeb('0x5')]]);_0x2c4227['value']=_0xee31bb[_0x8aeb('0x1c')];writeDB(_0x2c4227);});delete recordings[_0x1bdab9['uniqueid']];}}catch(_0x5320f7){utils['error'](util[_0x8aeb('0x3')](_0x8aeb('0x24'),_0x1bdab9['uniqueid']),_0x5320f7);}};exports[_0x8aeb('0x2f')]=function(_0x26c0dc){try{if(!_[_0x8aeb('0x15')](recordings[_0x26c0dc['uniqueid']])){utils['debug'](util[_0x8aeb('0x3')](_0x8aeb('0x30'),_0x26c0dc['uniqueid']),_0x26c0dc);utils[_0x8aeb('0x2')](util[_0x8aeb('0x3')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x26c0dc[_0x8aeb('0x5')],_0x26c0dc[_0x8aeb('0x31')],_0x26c0dc[_0x8aeb('0x32')]));if(_0x26c0dc[_0x8aeb('0x31')][_0x8aeb('0x33')]()==_0x8aeb('0x34')&&_['startsWith'](_0x26c0dc[_0x8aeb('0x32')][_0x8aeb('0x33')](),_0x8aeb('0x35'))){var _0x434462=_0x26c0dc[_0x8aeb('0x32')][_0x8aeb('0x36')]('=');var _0x609922=_0x434462[0x0]['substring'](_0x434462[0x0][_0x8aeb('0x37')]('(')+0x1,_0x434462[0x0][_0x8aeb('0x37')](')'));var _0x29c882=_0x434462[0x1];recordings[_0x26c0dc['uniqueid']][_0x609922]=_0x29c882;}}}catch(_0x501c16){utils[_0x8aeb('0x17')](util['format']('[%s][recordings][newexten]',_0x26c0dc['uniqueid']),_0x501c16);}};exports[_0x8aeb('0x38')]=function(_0x51b5cf){try{if(!_[_0x8aeb('0x15')](recordings[_0x51b5cf[_0x8aeb('0x5')]])){utils[_0x8aeb('0x13')](util[_0x8aeb('0x3')]('[%s][recordings][queuecallerjoin]',_0x51b5cf['uniqueid']),_0x51b5cf);utils['info'](util[_0x8aeb('0x3')](_0x8aeb('0x39'),_0x51b5cf[_0x8aeb('0x5')],_0x51b5cf['queue']));recordings[_0x51b5cf[_0x8aeb('0x5')]]['queue']=_0x51b5cf[_0x8aeb('0x3a')];}}catch(_0x39e15d){utils['error'](util[_0x8aeb('0x3')]('[%s][recordings][queuecallerjoin]',_0x51b5cf[_0x8aeb('0x5')]),_0x39e15d);}};
\ No newline at end of file