Built motion from commit f25620e4.|2.6.30
[motion2.git] / server / api / voiceQueue / voiceQueue.rpc.js
index 39c27c0..154afa8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5033=['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','error','code','message','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','limit','model','include','map','find','ShowVoiceQueue','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x926861,_0x4dd567){var _0x1654f5=function(_0x339c83){while(--_0x339c83){_0x926861['push'](_0x926861['shift']());}};_0x1654f5(++_0x4dd567);}(_0x5033,0x1d6));var _0x3503=function(_0x2cebbc,_0x5cc7a7){_0x2cebbc=_0x2cebbc-0x0;var _0x2b8cf6=_0x5033[_0x2cebbc];return _0x2b8cf6;};'use strict';var _=require(_0x3503('0x0'));var util=require(_0x3503('0x1'));var moment=require(_0x3503('0x2'));var BPromise=require(_0x3503('0x3'));var rs=require(_0x3503('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3503('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3503('0x6'))(_0x3503('0x7'));var config=require(_0x3503('0x8'));var jayson=require(_0x3503('0x9'));var client=jayson[_0x3503('0xa')][_0x3503('0xb')]({'port':0x232a});config[_0x3503('0xc')]=_[_0x3503('0xd')](config[_0x3503('0xc')],{'host':_0x3503('0xe'),'port':0x18eb});var socket=require(_0x3503('0xf'))(new Redis(config['redis']));require(_0x3503('0x10'))[_0x3503('0x11')](socket);function respondWithRpcPromise(_0x272e53,_0x19a374,_0x4233a5){return new BPromise(function(_0x54d955,_0x1fda4d){return client[_0x3503('0x12')](_0x272e53,_0x4233a5)[_0x3503('0x13')](function(_0x82da3b){logger[_0x3503('0x14')](_0x3503('0x15'),_0x19a374,_0x3503('0x16'));logger[_0x3503('0x17')](_0x3503('0x18'),_0x19a374,'request\x20sent',JSON[_0x3503('0x19')](_0x82da3b));if(_0x82da3b[_0x3503('0x1a')]){if(_0x82da3b[_0x3503('0x1a')][_0x3503('0x1b')]===0x1f4){logger['error'](_0x3503('0x15'),_0x19a374,_0x82da3b['error'][_0x3503('0x1c')]);return _0x1fda4d(_0x82da3b[_0x3503('0x1a')][_0x3503('0x1c')]);}logger[_0x3503('0x1a')](_0x3503('0x15'),_0x19a374,_0x82da3b[_0x3503('0x1a')]['message']);return _0x54d955(_0x82da3b['error'][_0x3503('0x1c')]);}else{logger['info'](_0x3503('0x15'),_0x19a374,_0x3503('0x16'));_0x54d955(_0x82da3b[_0x3503('0x1d')][_0x3503('0x1c')]);}})[_0x3503('0x1e')](function(_0x1e8891){logger[_0x3503('0x1a')](_0x3503('0x15'),_0x19a374,_0x1e8891);_0x1fda4d(_0x1e8891);});});}exports[_0x3503('0x1f')]=function(_0x266cbd){var _0xce3307=this;return new Promise(function(_0x548377,_0x5bce80){return db[_0x3503('0x20')][_0x3503('0x21')]({'raw':_0x266cbd[_0x3503('0x22')]?_0x266cbd[_0x3503('0x22')][_0x3503('0x23')]===undefined?!![]:![]:!![],'where':_0x266cbd[_0x3503('0x22')]?_0x266cbd[_0x3503('0x22')][_0x3503('0x24')]||null:null,'attributes':_0x266cbd[_0x3503('0x22')]?_0x266cbd[_0x3503('0x22')][_0x3503('0x25')]||null:null,'limit':_0x266cbd['options']?_0x266cbd[_0x3503('0x22')][_0x3503('0x26')]||null:null,'include':_0x266cbd[_0x3503('0x22')]?_0x266cbd[_0x3503('0x22')]['include']?_['map'](_0x266cbd['options']['include'],function(_0x2f2975){return{'model':db[_0x2f2975[_0x3503('0x27')]],'as':_0x2f2975['as'],'attributes':_0x2f2975['attributes'],'include':_0x2f2975[_0x3503('0x28')]?_['map'](_0x2f2975[_0x3503('0x28')],function(_0x178044){return{'model':db[_0x178044['model']],'as':_0x178044['as'],'attributes':_0x178044[_0x3503('0x25')],'include':_0x178044[_0x3503('0x28')]?_[_0x3503('0x29')](_0x178044[_0x3503('0x28')],function(_0xc57709){return{'model':db[_0xc57709[_0x3503('0x27')]],'as':_0xc57709['as'],'attributes':_0xc57709['attributes']};}):[]};}):[]};}):[]:[]})[_0x3503('0x13')](function(_0x140e20){logger[_0x3503('0x14')]('GetVoiceQueue',_0x266cbd);logger[_0x3503('0x17')](_0x3503('0x1f'),_0x266cbd,JSON['stringify'](_0x140e20));_0x548377(_0x140e20);})[_0x3503('0x1e')](function(_0x6b46a2){logger[_0x3503('0x1a')](_0x3503('0x1f'),_0x6b46a2[_0x3503('0x1c')],_0x266cbd);_0x5bce80(_0xce3307[_0x3503('0x1a')](0x1f4,_0x6b46a2[_0x3503('0x1c')]));});});};exports['ShowVoiceQueue']=function(_0x3db46d){var _0x542b0e=this;return new Promise(function(_0x863f1f,_0x220382){return db[_0x3503('0x20')][_0x3503('0x2a')]({'raw':_0x3db46d['options']?_0x3db46d[_0x3503('0x22')]['raw']===undefined?!![]:![]:!![],'where':_0x3db46d['options']?_0x3db46d['options']['where']||null:null,'attributes':_0x3db46d[_0x3503('0x22')]?_0x3db46d['options'][_0x3503('0x25')]||null:null,'include':_0x3db46d[_0x3503('0x22')]?_0x3db46d[_0x3503('0x22')][_0x3503('0x28')]?_['map'](_0x3db46d[_0x3503('0x22')]['include'],function(_0x56d36b){return{'model':db[_0x56d36b[_0x3503('0x27')]],'as':_0x56d36b['as'],'attributes':_0x56d36b['attributes'],'include':_0x56d36b[_0x3503('0x28')]?_[_0x3503('0x29')](_0x56d36b[_0x3503('0x28')],function(_0xb27f00){return{'model':db[_0xb27f00[_0x3503('0x27')]],'as':_0xb27f00['as'],'attributes':_0xb27f00[_0x3503('0x25')],'include':_0xb27f00['include']?_['map'](_0xb27f00[_0x3503('0x28')],function(_0x5cbc2a){return{'model':db[_0x5cbc2a[_0x3503('0x27')]],'as':_0x5cbc2a['as'],'attributes':_0x5cbc2a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2cb061){logger['info'](_0x3503('0x2b'),_0x3db46d);logger[_0x3503('0x17')](_0x3503('0x2b'),_0x3db46d,JSON['stringify'](_0x2cb061));_0x863f1f(_0x2cb061);})[_0x3503('0x1e')](function(_0x372e86){logger['error'](_0x3503('0x2b'),_0x372e86['message'],_0x3db46d);_0x220382(_0x542b0e[_0x3503('0x1a')](0x1f4,_0x372e86['message']));});});};
\ No newline at end of file
+var _0x2aa9=['include','map','model','attributes','ShowVoiceQueue','find','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','request','then','request\x20sent','stringify','error','code','VoiceQueue,\x20%s,\x20%s','message','info','result','catch','GetVoiceQueue','VoiceQueue','options','raw','where','limit'];(function(_0x2e6006,_0x314c29){var _0x701665=function(_0x219014){while(--_0x219014){_0x2e6006['push'](_0x2e6006['shift']());}};_0x701665(++_0x314c29);}(_0x2aa9,0x118));var _0x92aa=function(_0x5bc154,_0x34ff78){_0x5bc154=_0x5bc154-0x0;var _0x538e20=_0x2aa9[_0x5bc154];return _0x538e20;};'use strict';var _=require(_0x92aa('0x0'));var util=require(_0x92aa('0x1'));var moment=require(_0x92aa('0x2'));var BPromise=require(_0x92aa('0x3'));var rs=require(_0x92aa('0x4'));var fs=require('fs');var Redis=require(_0x92aa('0x5'));var db=require(_0x92aa('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x92aa('0x7'));var jayson=require(_0x92aa('0x8'));var client=jayson[_0x92aa('0x9')]['http']({'port':0x232a});config[_0x92aa('0xa')]=_['defaults'](config[_0x92aa('0xa')],{'host':_0x92aa('0xb'),'port':0x18eb});var socket=require(_0x92aa('0xc'))(new Redis(config[_0x92aa('0xa')]));require(_0x92aa('0xd'))[_0x92aa('0xe')](socket);function respondWithRpcPromise(_0x4b066b,_0x3bc63f,_0x19048b){return new BPromise(function(_0x20f185,_0xe3e503){return client[_0x92aa('0xf')](_0x4b066b,_0x19048b)[_0x92aa('0x10')](function(_0x2ef941){logger['info']('VoiceQueue,\x20%s,\x20%s',_0x3bc63f,_0x92aa('0x11'));logger['debug']('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x3bc63f,'request\x20sent',JSON[_0x92aa('0x12')](_0x2ef941));if(_0x2ef941[_0x92aa('0x13')]){if(_0x2ef941[_0x92aa('0x13')][_0x92aa('0x14')]===0x1f4){logger[_0x92aa('0x13')](_0x92aa('0x15'),_0x3bc63f,_0x2ef941[_0x92aa('0x13')][_0x92aa('0x16')]);return _0xe3e503(_0x2ef941[_0x92aa('0x13')][_0x92aa('0x16')]);}logger[_0x92aa('0x13')](_0x92aa('0x15'),_0x3bc63f,_0x2ef941[_0x92aa('0x13')]['message']);return _0x20f185(_0x2ef941['error'][_0x92aa('0x16')]);}else{logger[_0x92aa('0x17')](_0x92aa('0x15'),_0x3bc63f,_0x92aa('0x11'));_0x20f185(_0x2ef941[_0x92aa('0x18')][_0x92aa('0x16')]);}})[_0x92aa('0x19')](function(_0x1b8f45){logger[_0x92aa('0x13')](_0x92aa('0x15'),_0x3bc63f,_0x1b8f45);_0xe3e503(_0x1b8f45);});});}exports[_0x92aa('0x1a')]=function(_0x2ce705){var _0x160a49=this;return new Promise(function(_0x16153b,_0x25b5c9){return db[_0x92aa('0x1b')]['findAll']({'raw':_0x2ce705[_0x92aa('0x1c')]?_0x2ce705['options'][_0x92aa('0x1d')]===undefined?!![]:![]:!![],'where':_0x2ce705['options']?_0x2ce705[_0x92aa('0x1c')][_0x92aa('0x1e')]||null:null,'attributes':_0x2ce705[_0x92aa('0x1c')]?_0x2ce705[_0x92aa('0x1c')]['attributes']||null:null,'limit':_0x2ce705[_0x92aa('0x1c')]?_0x2ce705[_0x92aa('0x1c')][_0x92aa('0x1f')]||null:null,'include':_0x2ce705[_0x92aa('0x1c')]?_0x2ce705[_0x92aa('0x1c')][_0x92aa('0x20')]?_[_0x92aa('0x21')](_0x2ce705['options']['include'],function(_0x1be0ad){return{'model':db[_0x1be0ad[_0x92aa('0x22')]],'as':_0x1be0ad['as'],'attributes':_0x1be0ad['attributes'],'include':_0x1be0ad[_0x92aa('0x20')]?_[_0x92aa('0x21')](_0x1be0ad[_0x92aa('0x20')],function(_0x237bcf){return{'model':db[_0x237bcf[_0x92aa('0x22')]],'as':_0x237bcf['as'],'attributes':_0x237bcf['attributes'],'include':_0x237bcf[_0x92aa('0x20')]?_[_0x92aa('0x21')](_0x237bcf[_0x92aa('0x20')],function(_0x1eebaa){return{'model':db[_0x1eebaa[_0x92aa('0x22')]],'as':_0x1eebaa['as'],'attributes':_0x1eebaa[_0x92aa('0x23')]};}):[]};}):[]};}):[]:[]})[_0x92aa('0x10')](function(_0x5bf10e){logger['info'](_0x92aa('0x1a'),_0x2ce705);logger['debug'](_0x92aa('0x1a'),_0x2ce705,JSON[_0x92aa('0x12')](_0x5bf10e));_0x16153b(_0x5bf10e);})[_0x92aa('0x19')](function(_0x1d0744){logger[_0x92aa('0x13')](_0x92aa('0x1a'),_0x1d0744['message'],_0x2ce705);_0x25b5c9(_0x160a49['error'](0x1f4,_0x1d0744['message']));});});};exports[_0x92aa('0x24')]=function(_0x1eb7b9){var _0x4aef8d=this;return new Promise(function(_0x21cb43,_0xa7b7eb){return db[_0x92aa('0x1b')][_0x92aa('0x25')]({'raw':_0x1eb7b9[_0x92aa('0x1c')]?_0x1eb7b9[_0x92aa('0x1c')][_0x92aa('0x1d')]===undefined?!![]:![]:!![],'where':_0x1eb7b9[_0x92aa('0x1c')]?_0x1eb7b9[_0x92aa('0x1c')][_0x92aa('0x1e')]||null:null,'attributes':_0x1eb7b9['options']?_0x1eb7b9[_0x92aa('0x1c')][_0x92aa('0x23')]||null:null,'include':_0x1eb7b9['options']?_0x1eb7b9[_0x92aa('0x1c')]['include']?_[_0x92aa('0x21')](_0x1eb7b9['options']['include'],function(_0x56e0ef){return{'model':db[_0x56e0ef['model']],'as':_0x56e0ef['as'],'attributes':_0x56e0ef[_0x92aa('0x23')],'include':_0x56e0ef[_0x92aa('0x20')]?_[_0x92aa('0x21')](_0x56e0ef[_0x92aa('0x20')],function(_0x31e9c1){return{'model':db[_0x31e9c1[_0x92aa('0x22')]],'as':_0x31e9c1['as'],'attributes':_0x31e9c1[_0x92aa('0x23')],'include':_0x31e9c1[_0x92aa('0x20')]?_['map'](_0x31e9c1[_0x92aa('0x20')],function(_0x1f5e37){return{'model':db[_0x1f5e37[_0x92aa('0x22')]],'as':_0x1f5e37['as'],'attributes':_0x1f5e37[_0x92aa('0x23')]};}):[]};}):[]};}):[]:[]})[_0x92aa('0x10')](function(_0x5e36e4){logger[_0x92aa('0x17')](_0x92aa('0x24'),_0x1eb7b9);logger[_0x92aa('0x26')]('ShowVoiceQueue',_0x1eb7b9,JSON['stringify'](_0x5e36e4));_0x21cb43(_0x5e36e4);})['catch'](function(_0x3673f0){logger[_0x92aa('0x13')](_0x92aa('0x24'),_0x3673f0['message'],_0x1eb7b9);_0xa7b7eb(_0x4aef8d['error'](0x1f4,_0x3673f0['message']));});});};
\ No newline at end of file