Built motion from commit (unavailable).|2.5.14
[motion2.git] / server / api / voiceQueue / voiceQueue.rpc.js
index d3e188b..1990b30 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf061=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./voiceQueue.socket','request','then','VoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','VoiceQueue,\x20%s,\x20%s','message','info','catch','GetVoiceQueue','VoiceQueue','options','raw','attributes','include','map','model','debug','find','ShowVoiceQueue','util','moment','randomstring'];(function(_0x50fb75,_0x379974){var _0x531b40=function(_0x28554b){while(--_0x28554b){_0x50fb75['push'](_0x50fb75['shift']());}};_0x531b40(++_0x379974);}(_0xf061,0x165));var _0x1f06=function(_0x5d7006,_0x4f7094){_0x5d7006=_0x5d7006-0x0;var _0x5ed777=_0xf061[_0x5d7006];return _0x5ed777;};'use strict';var _=require('lodash');var util=require(_0x1f06('0x0'));var moment=require(_0x1f06('0x1'));var BPromise=require('bluebird');var rs=require(_0x1f06('0x2'));var fs=require('fs');var Redis=require(_0x1f06('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1f06('0x4'));var logger=require(_0x1f06('0x5'))(_0x1f06('0x6'));var config=require(_0x1f06('0x7'));var jayson=require(_0x1f06('0x8'));var client=jayson[_0x1f06('0x9')][_0x1f06('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x1f06('0xb')],{'host':_0x1f06('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1f06('0xb')]));require(_0x1f06('0xd'))['register'](socket);function respondWithRpcPromise(_0x1acfe9,_0x61562f,_0x4f78a2){return new BPromise(function(_0x4a02df,_0xdd90bb){return client[_0x1f06('0xe')](_0x1acfe9,_0x4f78a2)[_0x1f06('0xf')](function(_0x163a5e){logger['info']('VoiceQueue,\x20%s,\x20%s',_0x61562f,'request\x20sent');logger['debug'](_0x1f06('0x10'),_0x61562f,_0x1f06('0x11'),JSON[_0x1f06('0x12')](_0x163a5e));if(_0x163a5e['error']){if(_0x163a5e['error'][_0x1f06('0x13')]===0x1f4){logger[_0x1f06('0x14')](_0x1f06('0x15'),_0x61562f,_0x163a5e[_0x1f06('0x14')][_0x1f06('0x16')]);return _0xdd90bb(_0x163a5e[_0x1f06('0x14')][_0x1f06('0x16')]);}logger[_0x1f06('0x14')](_0x1f06('0x15'),_0x61562f,_0x163a5e[_0x1f06('0x14')]['message']);return _0x4a02df(_0x163a5e[_0x1f06('0x14')][_0x1f06('0x16')]);}else{logger[_0x1f06('0x17')](_0x1f06('0x15'),_0x61562f,_0x1f06('0x11'));_0x4a02df(_0x163a5e['result']['message']);}})[_0x1f06('0x18')](function(_0xa8f94d){logger[_0x1f06('0x14')](_0x1f06('0x15'),_0x61562f,_0xa8f94d);_0xdd90bb(_0xa8f94d);});});}exports[_0x1f06('0x19')]=function(_0x3e257e){var _0x4ef8d1=this;return new Promise(function(_0x4440f9,_0x54b584){return db[_0x1f06('0x1a')]['findAll']({'raw':_0x3e257e['options']?_0x3e257e[_0x1f06('0x1b')][_0x1f06('0x1c')]===undefined?!![]:![]:!![],'where':_0x3e257e[_0x1f06('0x1b')]?_0x3e257e[_0x1f06('0x1b')]['where']||null:null,'attributes':_0x3e257e[_0x1f06('0x1b')]?_0x3e257e[_0x1f06('0x1b')][_0x1f06('0x1d')]||null:null,'limit':_0x3e257e[_0x1f06('0x1b')]?_0x3e257e['options']['limit']||null:null,'include':_0x3e257e[_0x1f06('0x1b')]?_0x3e257e[_0x1f06('0x1b')][_0x1f06('0x1e')]?_[_0x1f06('0x1f')](_0x3e257e[_0x1f06('0x1b')]['include'],function(_0x3bfae3){return{'model':db[_0x3bfae3[_0x1f06('0x20')]],'as':_0x3bfae3['as'],'attributes':_0x3bfae3[_0x1f06('0x1d')],'include':_0x3bfae3['include']?_[_0x1f06('0x1f')](_0x3bfae3[_0x1f06('0x1e')],function(_0x2dbc33){return{'model':db[_0x2dbc33[_0x1f06('0x20')]],'as':_0x2dbc33['as'],'attributes':_0x2dbc33['attributes'],'include':_0x2dbc33[_0x1f06('0x1e')]?_[_0x1f06('0x1f')](_0x2dbc33[_0x1f06('0x1e')],function(_0x3cbb76){return{'model':db[_0x3cbb76[_0x1f06('0x20')]],'as':_0x3cbb76['as'],'attributes':_0x3cbb76[_0x1f06('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1f06('0xf')](function(_0x2cf229){logger[_0x1f06('0x17')](_0x1f06('0x19'),_0x3e257e);logger[_0x1f06('0x21')](_0x1f06('0x19'),_0x3e257e,JSON[_0x1f06('0x12')](_0x2cf229));_0x4440f9(_0x2cf229);})[_0x1f06('0x18')](function(_0xaec1d4){logger[_0x1f06('0x14')]('GetVoiceQueue',_0xaec1d4[_0x1f06('0x16')],_0x3e257e);_0x54b584(_0x4ef8d1[_0x1f06('0x14')](0x1f4,_0xaec1d4[_0x1f06('0x16')]));});});};exports['ShowVoiceQueue']=function(_0x236597){var _0xfe0c75=this;return new Promise(function(_0x1144ec,_0x199ee4){return db[_0x1f06('0x1a')][_0x1f06('0x22')]({'raw':_0x236597['options']?_0x236597['options'][_0x1f06('0x1c')]===undefined?!![]:![]:!![],'where':_0x236597[_0x1f06('0x1b')]?_0x236597['options']['where']||null:null,'attributes':_0x236597[_0x1f06('0x1b')]?_0x236597[_0x1f06('0x1b')][_0x1f06('0x1d')]||null:null,'include':_0x236597[_0x1f06('0x1b')]?_0x236597['options'][_0x1f06('0x1e')]?_['map'](_0x236597['options']['include'],function(_0x41995b){return{'model':db[_0x41995b['model']],'as':_0x41995b['as'],'attributes':_0x41995b[_0x1f06('0x1d')],'include':_0x41995b[_0x1f06('0x1e')]?_['map'](_0x41995b[_0x1f06('0x1e')],function(_0x3921b8){return{'model':db[_0x3921b8['model']],'as':_0x3921b8['as'],'attributes':_0x3921b8['attributes'],'include':_0x3921b8[_0x1f06('0x1e')]?_[_0x1f06('0x1f')](_0x3921b8[_0x1f06('0x1e')],function(_0x121246){return{'model':db[_0x121246['model']],'as':_0x121246['as'],'attributes':_0x121246[_0x1f06('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1f06('0xf')](function(_0x22ff50){logger[_0x1f06('0x17')]('ShowVoiceQueue',_0x236597);logger[_0x1f06('0x21')](_0x1f06('0x23'),_0x236597,JSON[_0x1f06('0x12')](_0x22ff50));_0x1144ec(_0x22ff50);})[_0x1f06('0x18')](function(_0x4e60d4){logger[_0x1f06('0x14')](_0x1f06('0x23'),_0x4e60d4['message'],_0x236597);_0x199ee4(_0xfe0c75[_0x1f06('0x14')](0x1f4,_0x4e60d4[_0x1f06('0x16')]));});});};
\ No newline at end of file
+var _0x69a4=['find','util','moment','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','VoiceQueue','findAll','raw','options','where','limit','map','include','model','attributes','GetVoiceQueue','ShowVoiceQueue'];(function(_0x45be7a,_0x150ca7){var _0x4a9234=function(_0x59f220){while(--_0x59f220){_0x45be7a['push'](_0x45be7a['shift']());}};_0x4a9234(++_0x150ca7);}(_0x69a4,0x76));var _0x469a=function(_0x3be169,_0x2f4727){_0x3be169=_0x3be169-0x0;var _0x4849d8=_0x69a4[_0x3be169];return _0x4849d8;};'use strict';var _=require('lodash');var util=require(_0x469a('0x0'));var moment=require(_0x469a('0x1'));var BPromise=require('bluebird');var rs=require(_0x469a('0x2'));var fs=require('fs');var Redis=require(_0x469a('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x469a('0x4'))(_0x469a('0x5'));var config=require('../../config/environment');var jayson=require(_0x469a('0x6'));var client=jayson[_0x469a('0x7')][_0x469a('0x8')]({'port':0x232a});config[_0x469a('0x9')]=_[_0x469a('0xa')](config[_0x469a('0x9')],{'host':_0x469a('0xb'),'port':0x18eb});var socket=require(_0x469a('0xc'))(new Redis(config[_0x469a('0x9')]));require('./voiceQueue.socket')[_0x469a('0xd')](socket);function respondWithRpcPromise(_0x1a26a3,_0x4de19f,_0x49d74a){return new BPromise(function(_0xd3fcce,_0x8aa78){return client[_0x469a('0xe')](_0x1a26a3,_0x49d74a)[_0x469a('0xf')](function(_0xc3dc5e){logger[_0x469a('0x10')](_0x469a('0x11'),_0x4de19f,_0x469a('0x12'));logger[_0x469a('0x13')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x4de19f,'request\x20sent',JSON[_0x469a('0x14')](_0xc3dc5e));if(_0xc3dc5e[_0x469a('0x15')]){if(_0xc3dc5e[_0x469a('0x15')][_0x469a('0x16')]===0x1f4){logger[_0x469a('0x15')]('VoiceQueue,\x20%s,\x20%s',_0x4de19f,_0xc3dc5e['error'][_0x469a('0x17')]);return _0x8aa78(_0xc3dc5e[_0x469a('0x15')][_0x469a('0x17')]);}logger[_0x469a('0x15')](_0x469a('0x11'),_0x4de19f,_0xc3dc5e['error'][_0x469a('0x17')]);return _0xd3fcce(_0xc3dc5e['error'][_0x469a('0x17')]);}else{logger[_0x469a('0x10')](_0x469a('0x11'),_0x4de19f,_0x469a('0x12'));_0xd3fcce(_0xc3dc5e[_0x469a('0x18')]['message']);}})[_0x469a('0x19')](function(_0x440040){logger[_0x469a('0x15')](_0x469a('0x11'),_0x4de19f,_0x440040);_0x8aa78(_0x440040);});});}exports['GetVoiceQueue']=function(_0x524a77){var _0x126c5=this;return new Promise(function(_0x4ab05a,_0x5f122a){return db[_0x469a('0x1a')][_0x469a('0x1b')]({'raw':_0x524a77['options']?_0x524a77['options'][_0x469a('0x1c')]===undefined?!![]:![]:!![],'where':_0x524a77[_0x469a('0x1d')]?_0x524a77[_0x469a('0x1d')][_0x469a('0x1e')]||null:null,'attributes':_0x524a77['options']?_0x524a77[_0x469a('0x1d')]['attributes']||null:null,'limit':_0x524a77['options']?_0x524a77[_0x469a('0x1d')][_0x469a('0x1f')]||null:null,'include':_0x524a77[_0x469a('0x1d')]?_0x524a77[_0x469a('0x1d')]['include']?_[_0x469a('0x20')](_0x524a77[_0x469a('0x1d')][_0x469a('0x21')],function(_0x40555c){return{'model':db[_0x40555c[_0x469a('0x22')]],'as':_0x40555c['as'],'attributes':_0x40555c[_0x469a('0x23')],'include':_0x40555c['include']?_[_0x469a('0x20')](_0x40555c['include'],function(_0x103497){return{'model':db[_0x103497[_0x469a('0x22')]],'as':_0x103497['as'],'attributes':_0x103497[_0x469a('0x23')],'include':_0x103497[_0x469a('0x21')]?_[_0x469a('0x20')](_0x103497[_0x469a('0x21')],function(_0x4de8b0){return{'model':db[_0x4de8b0[_0x469a('0x22')]],'as':_0x4de8b0['as'],'attributes':_0x4de8b0[_0x469a('0x23')]};}):[]};}):[]};}):[]:[]})[_0x469a('0xf')](function(_0x414fca){logger[_0x469a('0x10')]('GetVoiceQueue',_0x524a77);logger[_0x469a('0x13')](_0x469a('0x24'),_0x524a77,JSON[_0x469a('0x14')](_0x414fca));_0x4ab05a(_0x414fca);})[_0x469a('0x19')](function(_0xdf9336){logger['error'](_0x469a('0x24'),_0xdf9336['message'],_0x524a77);_0x5f122a(_0x126c5[_0x469a('0x15')](0x1f4,_0xdf9336[_0x469a('0x17')]));});});};exports[_0x469a('0x25')]=function(_0x4deb07){var _0x557240=this;return new Promise(function(_0x1ed10b,_0x38154a){return db[_0x469a('0x1a')][_0x469a('0x26')]({'raw':_0x4deb07[_0x469a('0x1d')]?_0x4deb07[_0x469a('0x1d')][_0x469a('0x1c')]===undefined?!![]:![]:!![],'where':_0x4deb07[_0x469a('0x1d')]?_0x4deb07['options'][_0x469a('0x1e')]||null:null,'attributes':_0x4deb07[_0x469a('0x1d')]?_0x4deb07['options'][_0x469a('0x23')]||null:null,'include':_0x4deb07['options']?_0x4deb07['options'][_0x469a('0x21')]?_[_0x469a('0x20')](_0x4deb07[_0x469a('0x1d')][_0x469a('0x21')],function(_0x3f9a9a){return{'model':db[_0x3f9a9a[_0x469a('0x22')]],'as':_0x3f9a9a['as'],'attributes':_0x3f9a9a[_0x469a('0x23')],'include':_0x3f9a9a['include']?_[_0x469a('0x20')](_0x3f9a9a['include'],function(_0x21a3d2){return{'model':db[_0x21a3d2[_0x469a('0x22')]],'as':_0x21a3d2['as'],'attributes':_0x21a3d2[_0x469a('0x23')],'include':_0x21a3d2[_0x469a('0x21')]?_[_0x469a('0x20')](_0x21a3d2['include'],function(_0x22b43d){return{'model':db[_0x22b43d[_0x469a('0x22')]],'as':_0x22b43d['as'],'attributes':_0x22b43d[_0x469a('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x233eb2){logger['info'](_0x469a('0x25'),_0x4deb07);logger[_0x469a('0x13')](_0x469a('0x25'),_0x4deb07,JSON['stringify'](_0x233eb2));_0x1ed10b(_0x233eb2);})['catch'](function(_0x35bbe6){logger['error'](_0x469a('0x25'),_0x35bbe6[_0x469a('0x17')],_0x4deb07);_0x38154a(_0x557240[_0x469a('0x15')](0x1f4,_0x35bbe6[_0x469a('0x17')]));});});};
\ No newline at end of file