Built motion from commit d1eab355.|2.6.28
[motion2.git] / server / api / voiceQueue / voiceQueue.rpc.js
index 4112d7a..e9fea15 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6007=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','defaults','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowVoiceQueue','find','stringify','lodash','util','bluebird'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x6007,0xa1));var _0x7600=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0x6007[_0x45bf86];return _0x1f02b7;};'use strict';var _=require(_0x7600('0x0'));var util=require(_0x7600('0x1'));var moment=require('moment');var BPromise=require(_0x7600('0x2'));var rs=require(_0x7600('0x3'));var fs=require('fs');var Redis=require(_0x7600('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7600('0x5'));var logger=require(_0x7600('0x6'))(_0x7600('0x7'));var config=require(_0x7600('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7600('0x9')]['http']({'port':0x232a});config['redis']=_[_0x7600('0xa')](config[_0x7600('0xb')],{'host':_0x7600('0xc'),'port':0x18eb});var socket=require(_0x7600('0xd'))(new Redis(config[_0x7600('0xb')]));require(_0x7600('0xe'))[_0x7600('0xf')](socket);function respondWithRpcPromise(_0x30e407,_0x269021,_0x16ad27){return new BPromise(function(_0x2fe754,_0x30dc46){return client[_0x7600('0x10')](_0x30e407,_0x16ad27)[_0x7600('0x11')](function(_0x393b0f){logger[_0x7600('0x12')](_0x7600('0x13'),_0x269021,_0x7600('0x14'));logger[_0x7600('0x15')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x269021,'request\x20sent',JSON['stringify'](_0x393b0f));if(_0x393b0f[_0x7600('0x16')]){if(_0x393b0f['error'][_0x7600('0x17')]===0x1f4){logger[_0x7600('0x16')](_0x7600('0x13'),_0x269021,_0x393b0f[_0x7600('0x16')][_0x7600('0x18')]);return _0x30dc46(_0x393b0f['error'][_0x7600('0x18')]);}logger[_0x7600('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x269021,_0x393b0f[_0x7600('0x16')][_0x7600('0x18')]);return _0x2fe754(_0x393b0f[_0x7600('0x16')]['message']);}else{logger['info']('VoiceQueue,\x20%s,\x20%s',_0x269021,_0x7600('0x14'));_0x2fe754(_0x393b0f[_0x7600('0x19')][_0x7600('0x18')]);}})[_0x7600('0x1a')](function(_0x149a99){logger[_0x7600('0x16')](_0x7600('0x13'),_0x269021,_0x149a99);_0x30dc46(_0x149a99);});});}exports[_0x7600('0x1b')]=function(_0x5533d3){var _0x147895=this;return new Promise(function(_0x83121b,_0x55a828){return db[_0x7600('0x1c')][_0x7600('0x1d')]({'raw':_0x5533d3[_0x7600('0x1e')]?_0x5533d3[_0x7600('0x1e')][_0x7600('0x1f')]===undefined?!![]:![]:!![],'where':_0x5533d3[_0x7600('0x1e')]?_0x5533d3[_0x7600('0x1e')][_0x7600('0x20')]||null:null,'attributes':_0x5533d3[_0x7600('0x1e')]?_0x5533d3[_0x7600('0x1e')][_0x7600('0x21')]||null:null,'limit':_0x5533d3[_0x7600('0x1e')]?_0x5533d3[_0x7600('0x1e')][_0x7600('0x22')]||null:null,'include':_0x5533d3[_0x7600('0x1e')]?_0x5533d3['options'][_0x7600('0x23')]?_[_0x7600('0x24')](_0x5533d3['options'][_0x7600('0x23')],function(_0x563cbf){return{'model':db[_0x563cbf[_0x7600('0x25')]],'as':_0x563cbf['as'],'attributes':_0x563cbf[_0x7600('0x21')],'include':_0x563cbf[_0x7600('0x23')]?_[_0x7600('0x24')](_0x563cbf[_0x7600('0x23')],function(_0x344755){return{'model':db[_0x344755[_0x7600('0x25')]],'as':_0x344755['as'],'attributes':_0x344755[_0x7600('0x21')],'include':_0x344755['include']?_['map'](_0x344755[_0x7600('0x23')],function(_0xdbc7fa){return{'model':db[_0xdbc7fa['model']],'as':_0xdbc7fa['as'],'attributes':_0xdbc7fa['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x583231){logger[_0x7600('0x12')](_0x7600('0x1b'),_0x5533d3);logger[_0x7600('0x15')]('GetVoiceQueue',_0x5533d3,JSON['stringify'](_0x583231));_0x83121b(_0x583231);})[_0x7600('0x1a')](function(_0x1369ad){logger[_0x7600('0x16')](_0x7600('0x1b'),_0x1369ad[_0x7600('0x18')],_0x5533d3);_0x55a828(_0x147895[_0x7600('0x16')](0x1f4,_0x1369ad['message']));});});};exports[_0x7600('0x26')]=function(_0x1f4ba7){var _0x523957=this;return new Promise(function(_0x2f5261,_0x10ad9f){return db[_0x7600('0x1c')][_0x7600('0x27')]({'raw':_0x1f4ba7['options']?_0x1f4ba7[_0x7600('0x1e')][_0x7600('0x1f')]===undefined?!![]:![]:!![],'where':_0x1f4ba7[_0x7600('0x1e')]?_0x1f4ba7[_0x7600('0x1e')]['where']||null:null,'attributes':_0x1f4ba7[_0x7600('0x1e')]?_0x1f4ba7[_0x7600('0x1e')][_0x7600('0x21')]||null:null,'include':_0x1f4ba7[_0x7600('0x1e')]?_0x1f4ba7[_0x7600('0x1e')]['include']?_[_0x7600('0x24')](_0x1f4ba7[_0x7600('0x1e')]['include'],function(_0x2dc082){return{'model':db[_0x2dc082[_0x7600('0x25')]],'as':_0x2dc082['as'],'attributes':_0x2dc082['attributes'],'include':_0x2dc082[_0x7600('0x23')]?_[_0x7600('0x24')](_0x2dc082[_0x7600('0x23')],function(_0x1de9d0){return{'model':db[_0x1de9d0[_0x7600('0x25')]],'as':_0x1de9d0['as'],'attributes':_0x1de9d0[_0x7600('0x21')],'include':_0x1de9d0[_0x7600('0x23')]?_[_0x7600('0x24')](_0x1de9d0[_0x7600('0x23')],function(_0x56c625){return{'model':db[_0x56c625[_0x7600('0x25')]],'as':_0x56c625['as'],'attributes':_0x56c625[_0x7600('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7600('0x11')](function(_0x26a60c){logger[_0x7600('0x12')](_0x7600('0x26'),_0x1f4ba7);logger[_0x7600('0x15')](_0x7600('0x26'),_0x1f4ba7,JSON[_0x7600('0x28')](_0x26a60c));_0x2f5261(_0x26a60c);})[_0x7600('0x1a')](function(_0x54bb3b){logger[_0x7600('0x16')](_0x7600('0x26'),_0x54bb3b[_0x7600('0x18')],_0x1f4ba7);_0x10ad9f(_0x523957[_0x7600('0x16')](0x1f4,_0x54bb3b[_0x7600('0x18')]));});});};
\ No newline at end of file
+var _0x41f3=['raw','where','attributes','limit','map','include','model','then','ShowVoiceQueue','find','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','./voiceQueue.socket','register','info','VoiceQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','GetVoiceQueue','VoiceQueue','findAll','options'];(function(_0x4d61ca,_0x2153c9){var _0xa1e14a=function(_0x4b2ca0){while(--_0x4b2ca0){_0x4d61ca['push'](_0x4d61ca['shift']());}};_0xa1e14a(++_0x2153c9);}(_0x41f3,0x11b));var _0x341f=function(_0x4f4c51,_0x3b2bc9){_0x4f4c51=_0x4f4c51-0x0;var _0x145dc3=_0x41f3[_0x4f4c51];return _0x145dc3;};'use strict';var _=require('lodash');var util=require(_0x341f('0x0'));var moment=require(_0x341f('0x1'));var BPromise=require('bluebird');var rs=require(_0x341f('0x2'));var fs=require('fs');var Redis=require(_0x341f('0x3'));var db=require(_0x341f('0x4'))['db'];var utils=require(_0x341f('0x5'));var logger=require(_0x341f('0x6'))(_0x341f('0x7'));var config=require('../../config/environment');var jayson=require(_0x341f('0x8'));var client=jayson[_0x341f('0x9')][_0x341f('0xa')]({'port':0x232a});config['redis']=_[_0x341f('0xb')](config[_0x341f('0xc')],{'host':_0x341f('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x341f('0xc')]));require(_0x341f('0xe'))[_0x341f('0xf')](socket);function respondWithRpcPromise(_0x58d306,_0x473e87,_0x51a8b8){return new BPromise(function(_0x3b6115,_0x39e28b){return client['request'](_0x58d306,_0x51a8b8)['then'](function(_0x2fd1ae){logger[_0x341f('0x10')](_0x341f('0x11'),_0x473e87,'request\x20sent');logger[_0x341f('0x12')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x473e87,_0x341f('0x13'),JSON[_0x341f('0x14')](_0x2fd1ae));if(_0x2fd1ae[_0x341f('0x15')]){if(_0x2fd1ae[_0x341f('0x15')][_0x341f('0x16')]===0x1f4){logger[_0x341f('0x15')]('VoiceQueue,\x20%s,\x20%s',_0x473e87,_0x2fd1ae[_0x341f('0x15')]['message']);return _0x39e28b(_0x2fd1ae['error'][_0x341f('0x17')]);}logger['error']('VoiceQueue,\x20%s,\x20%s',_0x473e87,_0x2fd1ae[_0x341f('0x15')][_0x341f('0x17')]);return _0x3b6115(_0x2fd1ae['error']['message']);}else{logger[_0x341f('0x10')](_0x341f('0x11'),_0x473e87,_0x341f('0x13'));_0x3b6115(_0x2fd1ae['result']['message']);}})[_0x341f('0x18')](function(_0x2e9b13){logger[_0x341f('0x15')](_0x341f('0x11'),_0x473e87,_0x2e9b13);_0x39e28b(_0x2e9b13);});});}exports[_0x341f('0x19')]=function(_0x2074d1){var _0x7f0e46=this;return new Promise(function(_0x145492,_0x4ddc0b){return db[_0x341f('0x1a')][_0x341f('0x1b')]({'raw':_0x2074d1[_0x341f('0x1c')]?_0x2074d1[_0x341f('0x1c')][_0x341f('0x1d')]===undefined?!![]:![]:!![],'where':_0x2074d1[_0x341f('0x1c')]?_0x2074d1[_0x341f('0x1c')][_0x341f('0x1e')]||null:null,'attributes':_0x2074d1[_0x341f('0x1c')]?_0x2074d1[_0x341f('0x1c')][_0x341f('0x1f')]||null:null,'limit':_0x2074d1[_0x341f('0x1c')]?_0x2074d1[_0x341f('0x1c')][_0x341f('0x20')]||null:null,'include':_0x2074d1['options']?_0x2074d1[_0x341f('0x1c')]['include']?_[_0x341f('0x21')](_0x2074d1[_0x341f('0x1c')][_0x341f('0x22')],function(_0x429858){return{'model':db[_0x429858['model']],'as':_0x429858['as'],'attributes':_0x429858[_0x341f('0x1f')],'include':_0x429858['include']?_[_0x341f('0x21')](_0x429858[_0x341f('0x22')],function(_0x27b86f){return{'model':db[_0x27b86f[_0x341f('0x23')]],'as':_0x27b86f['as'],'attributes':_0x27b86f[_0x341f('0x1f')],'include':_0x27b86f[_0x341f('0x22')]?_[_0x341f('0x21')](_0x27b86f[_0x341f('0x22')],function(_0xecabf5){return{'model':db[_0xecabf5[_0x341f('0x23')]],'as':_0xecabf5['as'],'attributes':_0xecabf5[_0x341f('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x341f('0x24')](function(_0x5a882e){logger[_0x341f('0x10')](_0x341f('0x19'),_0x2074d1);logger['debug']('GetVoiceQueue',_0x2074d1,JSON[_0x341f('0x14')](_0x5a882e));_0x145492(_0x5a882e);})[_0x341f('0x18')](function(_0x4cbcad){logger[_0x341f('0x15')](_0x341f('0x19'),_0x4cbcad[_0x341f('0x17')],_0x2074d1);_0x4ddc0b(_0x7f0e46[_0x341f('0x15')](0x1f4,_0x4cbcad[_0x341f('0x17')]));});});};exports[_0x341f('0x25')]=function(_0x4dba19){var _0x55e0ea=this;return new Promise(function(_0x559de2,_0x5c4340){return db[_0x341f('0x1a')][_0x341f('0x26')]({'raw':_0x4dba19[_0x341f('0x1c')]?_0x4dba19[_0x341f('0x1c')][_0x341f('0x1d')]===undefined?!![]:![]:!![],'where':_0x4dba19[_0x341f('0x1c')]?_0x4dba19[_0x341f('0x1c')][_0x341f('0x1e')]||null:null,'attributes':_0x4dba19['options']?_0x4dba19['options'][_0x341f('0x1f')]||null:null,'include':_0x4dba19[_0x341f('0x1c')]?_0x4dba19[_0x341f('0x1c')][_0x341f('0x22')]?_[_0x341f('0x21')](_0x4dba19[_0x341f('0x1c')][_0x341f('0x22')],function(_0x1a0976){return{'model':db[_0x1a0976[_0x341f('0x23')]],'as':_0x1a0976['as'],'attributes':_0x1a0976[_0x341f('0x1f')],'include':_0x1a0976[_0x341f('0x22')]?_['map'](_0x1a0976[_0x341f('0x22')],function(_0x3072dc){return{'model':db[_0x3072dc[_0x341f('0x23')]],'as':_0x3072dc['as'],'attributes':_0x3072dc[_0x341f('0x1f')],'include':_0x3072dc[_0x341f('0x22')]?_[_0x341f('0x21')](_0x3072dc['include'],function(_0x59be82){return{'model':db[_0x59be82['model']],'as':_0x59be82['as'],'attributes':_0x59be82[_0x341f('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4c2291){logger[_0x341f('0x10')]('ShowVoiceQueue',_0x4dba19);logger[_0x341f('0x12')](_0x341f('0x25'),_0x4dba19,JSON[_0x341f('0x14')](_0x4c2291));_0x559de2(_0x4c2291);})[_0x341f('0x18')](function(_0x203182){logger[_0x341f('0x15')](_0x341f('0x25'),_0x203182[_0x341f('0x17')],_0x4dba19);_0x5c4340(_0x55e0ea[_0x341f('0x15')](0x1f4,_0x203182[_0x341f('0x17')]));});});};
\ No newline at end of file