Built motion from commit (unavailable).|2.5.31
[motion2.git] / server / api / voiceQueue / voiceQueue.rpc.js
index 722c3db..0752469 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a02=['code','message','result','VoiceQueue','options','raw','attributes','include','model','map','GetVoiceQueue','debug','ShowVoiceQueue','find','where','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','./voiceQueue.socket','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3851be,_0x523903){var _0xdf3491=function(_0x9c1e27){while(--_0x9c1e27){_0x3851be['push'](_0x3851be['shift']());}};_0xdf3491(++_0x523903);}(_0x3a02,0x196));var _0x23a0=function(_0x2e8327,_0x1342f9){_0x2e8327=_0x2e8327-0x0;var _0x1100da=_0x3a02[_0x2e8327];return _0x1100da;};'use strict';var _=require(_0x23a0('0x0'));var util=require(_0x23a0('0x1'));var moment=require(_0x23a0('0x2'));var BPromise=require(_0x23a0('0x3'));var rs=require(_0x23a0('0x4'));var fs=require('fs');var Redis=require(_0x23a0('0x5'));var db=require(_0x23a0('0x6'))['db'];var utils=require(_0x23a0('0x7'));var logger=require(_0x23a0('0x8'))(_0x23a0('0x9'));var config=require('../../config/environment');var jayson=require(_0x23a0('0xa'));var client=jayson[_0x23a0('0xb')][_0x23a0('0xc')]({'port':0x232a});config[_0x23a0('0xd')]=_[_0x23a0('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x23a0('0xd')]));require(_0x23a0('0xf'))['register'](socket);function respondWithRpcPromise(_0x186e36,_0xe203a3,_0x1a3a49){return new BPromise(function(_0x3a8c69,_0x538b57){return client['request'](_0x186e36,_0x1a3a49)[_0x23a0('0x10')](function(_0x4966c6){logger[_0x23a0('0x11')](_0x23a0('0x12'),_0xe203a3,_0x23a0('0x13'));logger['debug'](_0x23a0('0x14'),_0xe203a3,_0x23a0('0x13'),JSON[_0x23a0('0x15')](_0x4966c6));if(_0x4966c6[_0x23a0('0x16')]){if(_0x4966c6[_0x23a0('0x16')][_0x23a0('0x17')]===0x1f4){logger[_0x23a0('0x16')](_0x23a0('0x12'),_0xe203a3,_0x4966c6[_0x23a0('0x16')][_0x23a0('0x18')]);return _0x538b57(_0x4966c6[_0x23a0('0x16')][_0x23a0('0x18')]);}logger['error'](_0x23a0('0x12'),_0xe203a3,_0x4966c6[_0x23a0('0x16')][_0x23a0('0x18')]);return _0x3a8c69(_0x4966c6[_0x23a0('0x16')][_0x23a0('0x18')]);}else{logger[_0x23a0('0x11')]('VoiceQueue,\x20%s,\x20%s',_0xe203a3,_0x23a0('0x13'));_0x3a8c69(_0x4966c6[_0x23a0('0x19')][_0x23a0('0x18')]);}})['catch'](function(_0x1fb43c){logger[_0x23a0('0x16')](_0x23a0('0x12'),_0xe203a3,_0x1fb43c);_0x538b57(_0x1fb43c);});});}exports['GetVoiceQueue']=function(_0x1f48b1){var _0x23cfda=this;return new Promise(function(_0x7cb97d,_0x36c4d4){return db[_0x23a0('0x1a')]['findAll']({'raw':_0x1f48b1[_0x23a0('0x1b')]?_0x1f48b1[_0x23a0('0x1b')][_0x23a0('0x1c')]===undefined?!![]:![]:!![],'where':_0x1f48b1[_0x23a0('0x1b')]?_0x1f48b1[_0x23a0('0x1b')]['where']||null:null,'attributes':_0x1f48b1['options']?_0x1f48b1[_0x23a0('0x1b')][_0x23a0('0x1d')]||null:null,'limit':_0x1f48b1['options']?_0x1f48b1[_0x23a0('0x1b')]['limit']||null:null,'include':_0x1f48b1['options']?_0x1f48b1[_0x23a0('0x1b')][_0x23a0('0x1e')]?_['map'](_0x1f48b1[_0x23a0('0x1b')][_0x23a0('0x1e')],function(_0x5b63b0){return{'model':db[_0x5b63b0[_0x23a0('0x1f')]],'as':_0x5b63b0['as'],'attributes':_0x5b63b0[_0x23a0('0x1d')],'include':_0x5b63b0[_0x23a0('0x1e')]?_['map'](_0x5b63b0['include'],function(_0x1e5518){return{'model':db[_0x1e5518[_0x23a0('0x1f')]],'as':_0x1e5518['as'],'attributes':_0x1e5518[_0x23a0('0x1d')],'include':_0x1e5518['include']?_[_0x23a0('0x20')](_0x1e5518[_0x23a0('0x1e')],function(_0x359b23){return{'model':db[_0x359b23[_0x23a0('0x1f')]],'as':_0x359b23['as'],'attributes':_0x359b23[_0x23a0('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x23a0('0x10')](function(_0x5ea973){logger[_0x23a0('0x11')](_0x23a0('0x21'),_0x1f48b1);logger[_0x23a0('0x22')](_0x23a0('0x21'),_0x1f48b1,JSON[_0x23a0('0x15')](_0x5ea973));_0x7cb97d(_0x5ea973);})['catch'](function(_0x5ee017){logger[_0x23a0('0x16')](_0x23a0('0x21'),_0x5ee017[_0x23a0('0x18')],_0x1f48b1);_0x36c4d4(_0x23cfda[_0x23a0('0x16')](0x1f4,_0x5ee017['message']));});});};exports[_0x23a0('0x23')]=function(_0x577c61){var _0x6adeeb=this;return new Promise(function(_0x77b6c9,_0x2f4eb1){return db['VoiceQueue'][_0x23a0('0x24')]({'raw':_0x577c61[_0x23a0('0x1b')]?_0x577c61[_0x23a0('0x1b')][_0x23a0('0x1c')]===undefined?!![]:![]:!![],'where':_0x577c61[_0x23a0('0x1b')]?_0x577c61[_0x23a0('0x1b')][_0x23a0('0x25')]||null:null,'attributes':_0x577c61[_0x23a0('0x1b')]?_0x577c61['options'][_0x23a0('0x1d')]||null:null,'include':_0x577c61['options']?_0x577c61[_0x23a0('0x1b')][_0x23a0('0x1e')]?_[_0x23a0('0x20')](_0x577c61[_0x23a0('0x1b')][_0x23a0('0x1e')],function(_0x5912ac){return{'model':db[_0x5912ac['model']],'as':_0x5912ac['as'],'attributes':_0x5912ac['attributes'],'include':_0x5912ac['include']?_[_0x23a0('0x20')](_0x5912ac['include'],function(_0xff91bf){return{'model':db[_0xff91bf[_0x23a0('0x1f')]],'as':_0xff91bf['as'],'attributes':_0xff91bf[_0x23a0('0x1d')],'include':_0xff91bf[_0x23a0('0x1e')]?_[_0x23a0('0x20')](_0xff91bf['include'],function(_0xe43fda){return{'model':db[_0xe43fda[_0x23a0('0x1f')]],'as':_0xe43fda['as'],'attributes':_0xe43fda[_0x23a0('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x23a0('0x10')](function(_0x686944){logger[_0x23a0('0x11')](_0x23a0('0x23'),_0x577c61);logger['debug'](_0x23a0('0x23'),_0x577c61,JSON[_0x23a0('0x15')](_0x686944));_0x77b6c9(_0x686944);})[_0x23a0('0x26')](function(_0x305b4a){logger[_0x23a0('0x16')]('ShowVoiceQueue',_0x305b4a['message'],_0x577c61);_0x2f4eb1(_0x6adeeb[_0x23a0('0x16')](0x1f4,_0x305b4a['message']));});});};
\ No newline at end of file
+var _0x2ce9=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','GetVoiceQueue','VoiceQueue','findAll','options','raw','attributes','limit','include','map','model','catch','ShowVoiceQueue','find','where','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x589d3a,_0x574831){var _0x2fbbc4=function(_0x5742a5){while(--_0x5742a5){_0x589d3a['push'](_0x589d3a['shift']());}};_0x2fbbc4(++_0x574831);}(_0x2ce9,0x1a7));var _0x92ce=function(_0x3c5e54,_0x2b991b){_0x3c5e54=_0x3c5e54-0x0;var _0x3ae1f3=_0x2ce9[_0x3c5e54];return _0x3ae1f3;};'use strict';var _=require(_0x92ce('0x0'));var util=require('util');var moment=require(_0x92ce('0x1'));var BPromise=require(_0x92ce('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x92ce('0x3'));var db=require(_0x92ce('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x92ce('0x5'))(_0x92ce('0x6'));var config=require(_0x92ce('0x7'));var jayson=require(_0x92ce('0x8'));var client=jayson[_0x92ce('0x9')][_0x92ce('0xa')]({'port':0x232a});config[_0x92ce('0xb')]=_[_0x92ce('0xc')](config[_0x92ce('0xb')],{'host':_0x92ce('0xd'),'port':0x18eb});var socket=require(_0x92ce('0xe'))(new Redis(config['redis']));require(_0x92ce('0xf'))[_0x92ce('0x10')](socket);function respondWithRpcPromise(_0x33dbdd,_0x288671,_0xe62eea){return new BPromise(function(_0x412711,_0xb45bb9){return client[_0x92ce('0x11')](_0x33dbdd,_0xe62eea)[_0x92ce('0x12')](function(_0x11a9e5){logger[_0x92ce('0x13')](_0x92ce('0x14'),_0x288671,_0x92ce('0x15'));logger[_0x92ce('0x16')](_0x92ce('0x17'),_0x288671,_0x92ce('0x15'),JSON[_0x92ce('0x18')](_0x11a9e5));if(_0x11a9e5['error']){if(_0x11a9e5['error'][_0x92ce('0x19')]===0x1f4){logger[_0x92ce('0x1a')](_0x92ce('0x14'),_0x288671,_0x11a9e5[_0x92ce('0x1a')][_0x92ce('0x1b')]);return _0xb45bb9(_0x11a9e5['error'][_0x92ce('0x1b')]);}logger['error'](_0x92ce('0x14'),_0x288671,_0x11a9e5[_0x92ce('0x1a')][_0x92ce('0x1b')]);return _0x412711(_0x11a9e5[_0x92ce('0x1a')][_0x92ce('0x1b')]);}else{logger[_0x92ce('0x13')](_0x92ce('0x14'),_0x288671,'request\x20sent');_0x412711(_0x11a9e5[_0x92ce('0x1c')][_0x92ce('0x1b')]);}})['catch'](function(_0x2884d1){logger[_0x92ce('0x1a')](_0x92ce('0x14'),_0x288671,_0x2884d1);_0xb45bb9(_0x2884d1);});});}exports[_0x92ce('0x1d')]=function(_0x59cef7){var _0x22055f=this;return new Promise(function(_0x16e50a,_0x4008ce){return db[_0x92ce('0x1e')][_0x92ce('0x1f')]({'raw':_0x59cef7['options']?_0x59cef7[_0x92ce('0x20')][_0x92ce('0x21')]===undefined?!![]:![]:!![],'where':_0x59cef7[_0x92ce('0x20')]?_0x59cef7[_0x92ce('0x20')]['where']||null:null,'attributes':_0x59cef7[_0x92ce('0x20')]?_0x59cef7['options'][_0x92ce('0x22')]||null:null,'limit':_0x59cef7[_0x92ce('0x20')]?_0x59cef7[_0x92ce('0x20')][_0x92ce('0x23')]||null:null,'include':_0x59cef7[_0x92ce('0x20')]?_0x59cef7['options'][_0x92ce('0x24')]?_[_0x92ce('0x25')](_0x59cef7[_0x92ce('0x20')][_0x92ce('0x24')],function(_0x121a3a){return{'model':db[_0x121a3a[_0x92ce('0x26')]],'as':_0x121a3a['as'],'attributes':_0x121a3a[_0x92ce('0x22')],'include':_0x121a3a[_0x92ce('0x24')]?_[_0x92ce('0x25')](_0x121a3a['include'],function(_0x365990){return{'model':db[_0x365990['model']],'as':_0x365990['as'],'attributes':_0x365990[_0x92ce('0x22')],'include':_0x365990[_0x92ce('0x24')]?_['map'](_0x365990[_0x92ce('0x24')],function(_0xbcc9eb){return{'model':db[_0xbcc9eb['model']],'as':_0xbcc9eb['as'],'attributes':_0xbcc9eb[_0x92ce('0x22')]};}):[]};}):[]};}):[]:[]})[_0x92ce('0x12')](function(_0x2f7845){logger[_0x92ce('0x13')](_0x92ce('0x1d'),_0x59cef7);logger[_0x92ce('0x16')]('GetVoiceQueue',_0x59cef7,JSON[_0x92ce('0x18')](_0x2f7845));_0x16e50a(_0x2f7845);})[_0x92ce('0x27')](function(_0x48d03d){logger[_0x92ce('0x1a')](_0x92ce('0x1d'),_0x48d03d[_0x92ce('0x1b')],_0x59cef7);_0x4008ce(_0x22055f[_0x92ce('0x1a')](0x1f4,_0x48d03d[_0x92ce('0x1b')]));});});};exports[_0x92ce('0x28')]=function(_0x29077d){var _0x427ebd=this;return new Promise(function(_0x11461b,_0x3438b3){return db[_0x92ce('0x1e')][_0x92ce('0x29')]({'raw':_0x29077d[_0x92ce('0x20')]?_0x29077d['options']['raw']===undefined?!![]:![]:!![],'where':_0x29077d[_0x92ce('0x20')]?_0x29077d[_0x92ce('0x20')][_0x92ce('0x2a')]||null:null,'attributes':_0x29077d[_0x92ce('0x20')]?_0x29077d['options']['attributes']||null:null,'include':_0x29077d['options']?_0x29077d['options'][_0x92ce('0x24')]?_['map'](_0x29077d[_0x92ce('0x20')][_0x92ce('0x24')],function(_0x19b398){return{'model':db[_0x19b398[_0x92ce('0x26')]],'as':_0x19b398['as'],'attributes':_0x19b398['attributes'],'include':_0x19b398['include']?_['map'](_0x19b398['include'],function(_0x25ff53){return{'model':db[_0x25ff53[_0x92ce('0x26')]],'as':_0x25ff53['as'],'attributes':_0x25ff53[_0x92ce('0x22')],'include':_0x25ff53['include']?_[_0x92ce('0x25')](_0x25ff53[_0x92ce('0x24')],function(_0x6828f2){return{'model':db[_0x6828f2[_0x92ce('0x26')]],'as':_0x6828f2['as'],'attributes':_0x6828f2['attributes']};}):[]};}):[]};}):[]:[]})[_0x92ce('0x12')](function(_0x2b1378){logger['info'](_0x92ce('0x28'),_0x29077d);logger['debug']('ShowVoiceQueue',_0x29077d,JSON['stringify'](_0x2b1378));_0x11461b(_0x2b1378);})['catch'](function(_0x454f59){logger['error'](_0x92ce('0x28'),_0x454f59[_0x92ce('0x1b')],_0x29077d);_0x3438b3(_0x427ebd[_0x92ce('0x1a')](0x1f4,_0x454f59[_0x92ce('0x1b')]));});});};
\ No newline at end of file