Built motion from commit c116dc8b.|2.6.30
[motion2.git] / server / api / voiceQueue / voiceQueue.rpc.js
index b4794f7..256f01b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c5b=['ShowVoiceQueue','find','where','lodash','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','VoiceQueue','options','raw','attributes','include','map','model','GetVoiceQueue'];(function(_0x5d4e83,_0x23c49e){var _0x503b36=function(_0xaabb32){while(--_0xaabb32){_0x5d4e83['push'](_0x5d4e83['shift']());}};_0x503b36(++_0x23c49e);}(_0x5c5b,0x93));var _0xb5c5=function(_0x53abe5,_0x33a9e5){_0x53abe5=_0x53abe5-0x0;var _0xc1c37e=_0x5c5b[_0x53abe5];return _0xc1c37e;};'use strict';var _=require(_0xb5c5('0x0'));var util=require('util');var moment=require(_0xb5c5('0x1'));var BPromise=require(_0xb5c5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb5c5('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb5c5('0x4'))(_0xb5c5('0x5'));var config=require(_0xb5c5('0x6'));var jayson=require(_0xb5c5('0x7'));var client=jayson[_0xb5c5('0x8')][_0xb5c5('0x9')]({'port':0x232a});config[_0xb5c5('0xa')]=_[_0xb5c5('0xb')](config[_0xb5c5('0xa')],{'host':_0xb5c5('0xc'),'port':0x18eb});var socket=require(_0xb5c5('0xd'))(new Redis(config[_0xb5c5('0xa')]));require(_0xb5c5('0xe'))['register'](socket);function respondWithRpcPromise(_0x4c03b3,_0x442a72,_0xe6a2c7){return new BPromise(function(_0x4c5c93,_0x585d56){return client['request'](_0x4c03b3,_0xe6a2c7)[_0xb5c5('0xf')](function(_0x5daae8){logger[_0xb5c5('0x10')](_0xb5c5('0x11'),_0x442a72,_0xb5c5('0x12'));logger[_0xb5c5('0x13')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x442a72,_0xb5c5('0x12'),JSON[_0xb5c5('0x14')](_0x5daae8));if(_0x5daae8[_0xb5c5('0x15')]){if(_0x5daae8[_0xb5c5('0x15')]['code']===0x1f4){logger[_0xb5c5('0x15')](_0xb5c5('0x11'),_0x442a72,_0x5daae8[_0xb5c5('0x15')][_0xb5c5('0x16')]);return _0x585d56(_0x5daae8[_0xb5c5('0x15')][_0xb5c5('0x16')]);}logger[_0xb5c5('0x15')](_0xb5c5('0x11'),_0x442a72,_0x5daae8[_0xb5c5('0x15')][_0xb5c5('0x16')]);return _0x4c5c93(_0x5daae8[_0xb5c5('0x15')]['message']);}else{logger[_0xb5c5('0x10')]('VoiceQueue,\x20%s,\x20%s',_0x442a72,'request\x20sent');_0x4c5c93(_0x5daae8[_0xb5c5('0x17')][_0xb5c5('0x16')]);}})[_0xb5c5('0x18')](function(_0x1322c2){logger[_0xb5c5('0x15')](_0xb5c5('0x11'),_0x442a72,_0x1322c2);_0x585d56(_0x1322c2);});});}exports['GetVoiceQueue']=function(_0x1ab5b0){var _0x41fb4b=this;return new Promise(function(_0x56cf9d,_0x3e6ead){return db[_0xb5c5('0x19')]['findAll']({'raw':_0x1ab5b0[_0xb5c5('0x1a')]?_0x1ab5b0[_0xb5c5('0x1a')][_0xb5c5('0x1b')]===undefined?!![]:![]:!![],'where':_0x1ab5b0[_0xb5c5('0x1a')]?_0x1ab5b0[_0xb5c5('0x1a')]['where']||null:null,'attributes':_0x1ab5b0[_0xb5c5('0x1a')]?_0x1ab5b0[_0xb5c5('0x1a')][_0xb5c5('0x1c')]||null:null,'limit':_0x1ab5b0[_0xb5c5('0x1a')]?_0x1ab5b0[_0xb5c5('0x1a')]['limit']||null:null,'include':_0x1ab5b0['options']?_0x1ab5b0['options'][_0xb5c5('0x1d')]?_[_0xb5c5('0x1e')](_0x1ab5b0[_0xb5c5('0x1a')][_0xb5c5('0x1d')],function(_0x165c8e){return{'model':db[_0x165c8e['model']],'as':_0x165c8e['as'],'attributes':_0x165c8e[_0xb5c5('0x1c')],'include':_0x165c8e[_0xb5c5('0x1d')]?_[_0xb5c5('0x1e')](_0x165c8e[_0xb5c5('0x1d')],function(_0x24e3d1){return{'model':db[_0x24e3d1[_0xb5c5('0x1f')]],'as':_0x24e3d1['as'],'attributes':_0x24e3d1['attributes'],'include':_0x24e3d1[_0xb5c5('0x1d')]?_[_0xb5c5('0x1e')](_0x24e3d1[_0xb5c5('0x1d')],function(_0x17ff1b){return{'model':db[_0x17ff1b['model']],'as':_0x17ff1b['as'],'attributes':_0x17ff1b[_0xb5c5('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xb5c5('0xf')](function(_0x262712){logger[_0xb5c5('0x10')]('GetVoiceQueue',_0x1ab5b0);logger[_0xb5c5('0x13')](_0xb5c5('0x20'),_0x1ab5b0,JSON['stringify'](_0x262712));_0x56cf9d(_0x262712);})[_0xb5c5('0x18')](function(_0xb553c9){logger[_0xb5c5('0x15')](_0xb5c5('0x20'),_0xb553c9['message'],_0x1ab5b0);_0x3e6ead(_0x41fb4b[_0xb5c5('0x15')](0x1f4,_0xb553c9[_0xb5c5('0x16')]));});});};exports[_0xb5c5('0x21')]=function(_0x49a149){var _0x55c5cb=this;return new Promise(function(_0x5b627d,_0x182279){return db['VoiceQueue'][_0xb5c5('0x22')]({'raw':_0x49a149[_0xb5c5('0x1a')]?_0x49a149[_0xb5c5('0x1a')][_0xb5c5('0x1b')]===undefined?!![]:![]:!![],'where':_0x49a149[_0xb5c5('0x1a')]?_0x49a149[_0xb5c5('0x1a')][_0xb5c5('0x23')]||null:null,'attributes':_0x49a149[_0xb5c5('0x1a')]?_0x49a149[_0xb5c5('0x1a')]['attributes']||null:null,'include':_0x49a149[_0xb5c5('0x1a')]?_0x49a149['options']['include']?_[_0xb5c5('0x1e')](_0x49a149['options'][_0xb5c5('0x1d')],function(_0x2fd9f1){return{'model':db[_0x2fd9f1[_0xb5c5('0x1f')]],'as':_0x2fd9f1['as'],'attributes':_0x2fd9f1[_0xb5c5('0x1c')],'include':_0x2fd9f1[_0xb5c5('0x1d')]?_[_0xb5c5('0x1e')](_0x2fd9f1['include'],function(_0x373f3d){return{'model':db[_0x373f3d[_0xb5c5('0x1f')]],'as':_0x373f3d['as'],'attributes':_0x373f3d[_0xb5c5('0x1c')],'include':_0x373f3d['include']?_['map'](_0x373f3d[_0xb5c5('0x1d')],function(_0x5e9b8d){return{'model':db[_0x5e9b8d[_0xb5c5('0x1f')]],'as':_0x5e9b8d['as'],'attributes':_0x5e9b8d[_0xb5c5('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xb5c5('0xf')](function(_0x7c64b9){logger[_0xb5c5('0x10')](_0xb5c5('0x21'),_0x49a149);logger[_0xb5c5('0x13')](_0xb5c5('0x21'),_0x49a149,JSON[_0xb5c5('0x14')](_0x7c64b9));_0x5b627d(_0x7c64b9);})[_0xb5c5('0x18')](function(_0xfb5780){logger[_0xb5c5('0x15')]('ShowVoiceQueue',_0xfb5780[_0xb5c5('0x16')],_0x49a149);_0x182279(_0x55c5cb['error'](0x1f4,_0xfb5780[_0xb5c5('0x16')]));});});};
\ No newline at end of file
+var _0x4411=['catch','GetVoiceQueue','findAll','options','where','attributes','limit','map','include','model','then','VoiceQueue','raw','ShowVoiceQueue','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','request','info','VoiceQueue,\x20%s,\x20%s','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message'];(function(_0x408947,_0x2fba0e){var _0x2b3448=function(_0x24eeb8){while(--_0x24eeb8){_0x408947['push'](_0x408947['shift']());}};_0x2b3448(++_0x2fba0e);}(_0x4411,0x1ee));var _0x1441=function(_0x54b36c,_0xd2ff4f){_0x54b36c=_0x54b36c-0x0;var _0x33d6f5=_0x4411[_0x54b36c];return _0x33d6f5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1441('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1441('0x1'));var db=require(_0x1441('0x2'))['db'];var utils=require(_0x1441('0x3'));var logger=require(_0x1441('0x4'))(_0x1441('0x5'));var config=require(_0x1441('0x6'));var jayson=require(_0x1441('0x7'));var client=jayson[_0x1441('0x8')][_0x1441('0x9')]({'port':0x232a});config[_0x1441('0xa')]=_[_0x1441('0xb')](config['redis'],{'host':_0x1441('0xc'),'port':0x18eb});var socket=require(_0x1441('0xd'))(new Redis(config[_0x1441('0xa')]));require(_0x1441('0xe'))[_0x1441('0xf')](socket);function respondWithRpcPromise(_0x153da3,_0x44dbf8,_0x188bf9){return new BPromise(function(_0xa255d0,_0x230525){return client[_0x1441('0x10')](_0x153da3,_0x188bf9)['then'](function(_0x1e1441){logger[_0x1441('0x11')](_0x1441('0x12'),_0x44dbf8,'request\x20sent');logger[_0x1441('0x13')](_0x1441('0x14'),_0x44dbf8,_0x1441('0x15'),JSON[_0x1441('0x16')](_0x1e1441));if(_0x1e1441['error']){if(_0x1e1441['error'][_0x1441('0x17')]===0x1f4){logger[_0x1441('0x18')](_0x1441('0x12'),_0x44dbf8,_0x1e1441[_0x1441('0x18')][_0x1441('0x19')]);return _0x230525(_0x1e1441[_0x1441('0x18')]['message']);}logger[_0x1441('0x18')]('VoiceQueue,\x20%s,\x20%s',_0x44dbf8,_0x1e1441[_0x1441('0x18')][_0x1441('0x19')]);return _0xa255d0(_0x1e1441[_0x1441('0x18')]['message']);}else{logger['info'](_0x1441('0x12'),_0x44dbf8,_0x1441('0x15'));_0xa255d0(_0x1e1441['result'][_0x1441('0x19')]);}})[_0x1441('0x1a')](function(_0x1dcc94){logger['error'](_0x1441('0x12'),_0x44dbf8,_0x1dcc94);_0x230525(_0x1dcc94);});});}exports[_0x1441('0x1b')]=function(_0x831cf3){var _0x8ba14e=this;return new Promise(function(_0x39c0cc,_0x1f766a){return db['VoiceQueue'][_0x1441('0x1c')]({'raw':_0x831cf3[_0x1441('0x1d')]?_0x831cf3['options']['raw']===undefined?!![]:![]:!![],'where':_0x831cf3['options']?_0x831cf3[_0x1441('0x1d')][_0x1441('0x1e')]||null:null,'attributes':_0x831cf3['options']?_0x831cf3[_0x1441('0x1d')][_0x1441('0x1f')]||null:null,'limit':_0x831cf3[_0x1441('0x1d')]?_0x831cf3[_0x1441('0x1d')][_0x1441('0x20')]||null:null,'include':_0x831cf3[_0x1441('0x1d')]?_0x831cf3['options']['include']?_[_0x1441('0x21')](_0x831cf3[_0x1441('0x1d')][_0x1441('0x22')],function(_0x1fe4bd){return{'model':db[_0x1fe4bd[_0x1441('0x23')]],'as':_0x1fe4bd['as'],'attributes':_0x1fe4bd[_0x1441('0x1f')],'include':_0x1fe4bd[_0x1441('0x22')]?_[_0x1441('0x21')](_0x1fe4bd[_0x1441('0x22')],function(_0x169e94){return{'model':db[_0x169e94[_0x1441('0x23')]],'as':_0x169e94['as'],'attributes':_0x169e94[_0x1441('0x1f')],'include':_0x169e94[_0x1441('0x22')]?_['map'](_0x169e94[_0x1441('0x22')],function(_0x1950b7){return{'model':db[_0x1950b7[_0x1441('0x23')]],'as':_0x1950b7['as'],'attributes':_0x1950b7[_0x1441('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x1441('0x24')](function(_0x9b0b1){logger['info'](_0x1441('0x1b'),_0x831cf3);logger[_0x1441('0x13')](_0x1441('0x1b'),_0x831cf3,JSON[_0x1441('0x16')](_0x9b0b1));_0x39c0cc(_0x9b0b1);})[_0x1441('0x1a')](function(_0x57a3bd){logger['error'](_0x1441('0x1b'),_0x57a3bd[_0x1441('0x19')],_0x831cf3);_0x1f766a(_0x8ba14e[_0x1441('0x18')](0x1f4,_0x57a3bd['message']));});});};exports['ShowVoiceQueue']=function(_0x8e34c4){var _0x24760b=this;return new Promise(function(_0x283146,_0x328dae){return db[_0x1441('0x25')]['find']({'raw':_0x8e34c4['options']?_0x8e34c4['options'][_0x1441('0x26')]===undefined?!![]:![]:!![],'where':_0x8e34c4[_0x1441('0x1d')]?_0x8e34c4['options'][_0x1441('0x1e')]||null:null,'attributes':_0x8e34c4[_0x1441('0x1d')]?_0x8e34c4[_0x1441('0x1d')]['attributes']||null:null,'include':_0x8e34c4['options']?_0x8e34c4[_0x1441('0x1d')]['include']?_['map'](_0x8e34c4[_0x1441('0x1d')][_0x1441('0x22')],function(_0x14c53c){return{'model':db[_0x14c53c['model']],'as':_0x14c53c['as'],'attributes':_0x14c53c['attributes'],'include':_0x14c53c['include']?_['map'](_0x14c53c[_0x1441('0x22')],function(_0x58a659){return{'model':db[_0x58a659[_0x1441('0x23')]],'as':_0x58a659['as'],'attributes':_0x58a659[_0x1441('0x1f')],'include':_0x58a659['include']?_['map'](_0x58a659[_0x1441('0x22')],function(_0x2ac16c){return{'model':db[_0x2ac16c[_0x1441('0x23')]],'as':_0x2ac16c['as'],'attributes':_0x2ac16c['attributes']};}):[]};}):[]};}):[]:[]})[_0x1441('0x24')](function(_0x3f284d){logger[_0x1441('0x11')](_0x1441('0x27'),_0x8e34c4);logger[_0x1441('0x13')](_0x1441('0x27'),_0x8e34c4,JSON[_0x1441('0x16')](_0x3f284d));_0x283146(_0x3f284d);})[_0x1441('0x1a')](function(_0x31953c){logger[_0x1441('0x18')](_0x1441('0x27'),_0x31953c[_0x1441('0x19')],_0x8e34c4);_0x328dae(_0x24760b['error'](0x1f4,_0x31953c['message']));});});};
\ No newline at end of file