Built motion from commit (unavailable).|2.5.25
[motion2.git] / server / api / voiceQueue / voiceQueue.rpc.js
index 5e7eb48..79626b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac2c=['request','then','VoiceQueue,\x20%s,\x20%s','request\x20sent','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','limit','include','map','attributes','model','info','debug','ShowVoiceQueue','find','catch','lodash','bluebird','../../mysqldb','../../config/logger','../../config/environment','http','redis','localhost','./voiceQueue.socket','register'];(function(_0x4d1e94,_0x238942){var _0x35ff4f=function(_0x90df21){while(--_0x90df21){_0x4d1e94['push'](_0x4d1e94['shift']());}};_0x35ff4f(++_0x238942);}(_0xac2c,0x16c));var _0xcac2=function(_0x52ce3e,_0x25abc7){_0x52ce3e=_0x52ce3e-0x0;var _0x49f0ef=_0xac2c[_0x52ce3e];return _0x49f0ef;};'use strict';var _=require(_0xcac2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xcac2('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcac2('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xcac2('0x3'))('rpc');var config=require(_0xcac2('0x4'));var jayson=require('jayson/promise');var client=jayson['client'][_0xcac2('0x5')]({'port':0x232a});config[_0xcac2('0x6')]=_['defaults'](config[_0xcac2('0x6')],{'host':_0xcac2('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcac2('0x6')]));require(_0xcac2('0x8'))[_0xcac2('0x9')](socket);function respondWithRpcPromise(_0x6c36f4,_0x14c8db,_0x38d152){return new BPromise(function(_0x46f0cf,_0x3e2de6){return client[_0xcac2('0xa')](_0x6c36f4,_0x38d152)[_0xcac2('0xb')](function(_0x28c0b3){logger['info'](_0xcac2('0xc'),_0x14c8db,_0xcac2('0xd'));logger['debug'](_0xcac2('0xe'),_0x14c8db,'request\x20sent',JSON[_0xcac2('0xf')](_0x28c0b3));if(_0x28c0b3['error']){if(_0x28c0b3[_0xcac2('0x10')]['code']===0x1f4){logger[_0xcac2('0x10')](_0xcac2('0xc'),_0x14c8db,_0x28c0b3[_0xcac2('0x10')]['message']);return _0x3e2de6(_0x28c0b3[_0xcac2('0x10')][_0xcac2('0x11')]);}logger['error'](_0xcac2('0xc'),_0x14c8db,_0x28c0b3['error'][_0xcac2('0x11')]);return _0x46f0cf(_0x28c0b3[_0xcac2('0x10')][_0xcac2('0x11')]);}else{logger['info'](_0xcac2('0xc'),_0x14c8db,_0xcac2('0xd'));_0x46f0cf(_0x28c0b3['result'][_0xcac2('0x11')]);}})['catch'](function(_0x47e848){logger['error'](_0xcac2('0xc'),_0x14c8db,_0x47e848);_0x3e2de6(_0x47e848);});});}exports[_0xcac2('0x12')]=function(_0x31eb16){var _0x4accfb=this;return new Promise(function(_0x3b4c4c,_0x51281e){return db[_0xcac2('0x13')][_0xcac2('0x14')]({'raw':_0x31eb16[_0xcac2('0x15')]?_0x31eb16['options'][_0xcac2('0x16')]===undefined?!![]:![]:!![],'where':_0x31eb16[_0xcac2('0x15')]?_0x31eb16[_0xcac2('0x15')][_0xcac2('0x17')]||null:null,'attributes':_0x31eb16[_0xcac2('0x15')]?_0x31eb16[_0xcac2('0x15')]['attributes']||null:null,'limit':_0x31eb16[_0xcac2('0x15')]?_0x31eb16[_0xcac2('0x15')][_0xcac2('0x18')]||null:null,'include':_0x31eb16[_0xcac2('0x15')]?_0x31eb16[_0xcac2('0x15')][_0xcac2('0x19')]?_[_0xcac2('0x1a')](_0x31eb16[_0xcac2('0x15')][_0xcac2('0x19')],function(_0x260382){return{'model':db[_0x260382['model']],'as':_0x260382['as'],'attributes':_0x260382[_0xcac2('0x1b')],'include':_0x260382['include']?_['map'](_0x260382[_0xcac2('0x19')],function(_0x10ceb5){return{'model':db[_0x10ceb5[_0xcac2('0x1c')]],'as':_0x10ceb5['as'],'attributes':_0x10ceb5[_0xcac2('0x1b')],'include':_0x10ceb5[_0xcac2('0x19')]?_[_0xcac2('0x1a')](_0x10ceb5[_0xcac2('0x19')],function(_0x4ec5de){return{'model':db[_0x4ec5de[_0xcac2('0x1c')]],'as':_0x4ec5de['as'],'attributes':_0x4ec5de['attributes']};}):[]};}):[]};}):[]:[]})[_0xcac2('0xb')](function(_0x2ec909){logger[_0xcac2('0x1d')](_0xcac2('0x12'),_0x31eb16);logger[_0xcac2('0x1e')]('GetVoiceQueue',_0x31eb16,JSON[_0xcac2('0xf')](_0x2ec909));_0x3b4c4c(_0x2ec909);})['catch'](function(_0x94812c){logger[_0xcac2('0x10')](_0xcac2('0x12'),_0x94812c[_0xcac2('0x11')],_0x31eb16);_0x51281e(_0x4accfb[_0xcac2('0x10')](0x1f4,_0x94812c[_0xcac2('0x11')]));});});};exports[_0xcac2('0x1f')]=function(_0x31cd5a){var _0x4112cc=this;return new Promise(function(_0x443662,_0x595189){return db[_0xcac2('0x13')][_0xcac2('0x20')]({'raw':_0x31cd5a[_0xcac2('0x15')]?_0x31cd5a[_0xcac2('0x15')][_0xcac2('0x16')]===undefined?!![]:![]:!![],'where':_0x31cd5a['options']?_0x31cd5a['options']['where']||null:null,'attributes':_0x31cd5a[_0xcac2('0x15')]?_0x31cd5a['options'][_0xcac2('0x1b')]||null:null,'include':_0x31cd5a['options']?_0x31cd5a[_0xcac2('0x15')][_0xcac2('0x19')]?_[_0xcac2('0x1a')](_0x31cd5a[_0xcac2('0x15')]['include'],function(_0x4886da){return{'model':db[_0x4886da[_0xcac2('0x1c')]],'as':_0x4886da['as'],'attributes':_0x4886da[_0xcac2('0x1b')],'include':_0x4886da['include']?_[_0xcac2('0x1a')](_0x4886da[_0xcac2('0x19')],function(_0x3f9f08){return{'model':db[_0x3f9f08['model']],'as':_0x3f9f08['as'],'attributes':_0x3f9f08['attributes'],'include':_0x3f9f08[_0xcac2('0x19')]?_[_0xcac2('0x1a')](_0x3f9f08[_0xcac2('0x19')],function(_0x18377a){return{'model':db[_0x18377a[_0xcac2('0x1c')]],'as':_0x18377a['as'],'attributes':_0x18377a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4f7062){logger[_0xcac2('0x1d')]('ShowVoiceQueue',_0x31cd5a);logger[_0xcac2('0x1e')]('ShowVoiceQueue',_0x31cd5a,JSON[_0xcac2('0xf')](_0x4f7062));_0x443662(_0x4f7062);})[_0xcac2('0x21')](function(_0x5bc742){logger[_0xcac2('0x10')](_0xcac2('0x1f'),_0x5bc742['message'],_0x31cd5a);_0x595189(_0x4112cc[_0xcac2('0x10')](0x1f4,_0x5bc742[_0xcac2('0x11')]));});});};
\ No newline at end of file
+var _0x79e1=['./voiceQueue.socket','register','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','options','raw','where','attributes','limit','include','map','model','GetVoiceQueue','ShowVoiceQueue','VoiceQueue','find','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x245cc4,_0x1ce370){var _0x137104=function(_0x885d85){while(--_0x885d85){_0x245cc4['push'](_0x245cc4['shift']());}};_0x137104(++_0x1ce370);}(_0x79e1,0x1b4));var _0x179e=function(_0x5dee2a,_0x47d02a){_0x5dee2a=_0x5dee2a-0x0;var _0x31e98e=_0x79e1[_0x5dee2a];return _0x31e98e;};'use strict';var _=require(_0x179e('0x0'));var util=require(_0x179e('0x1'));var moment=require(_0x179e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x179e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x179e('0x4'));var logger=require(_0x179e('0x5'))(_0x179e('0x6'));var config=require(_0x179e('0x7'));var jayson=require(_0x179e('0x8'));var client=jayson[_0x179e('0x9')][_0x179e('0xa')]({'port':0x232a});config[_0x179e('0xb')]=_[_0x179e('0xc')](config['redis'],{'host':_0x179e('0xd'),'port':0x18eb});var socket=require(_0x179e('0xe'))(new Redis(config['redis']));require(_0x179e('0xf'))[_0x179e('0x10')](socket);function respondWithRpcPromise(_0x4c97ca,_0x1a588d,_0x98139f){return new BPromise(function(_0x29a626,_0x16b813){return client['request'](_0x4c97ca,_0x98139f)[_0x179e('0x11')](function(_0x2875e7){logger[_0x179e('0x12')](_0x179e('0x13'),_0x1a588d,_0x179e('0x14'));logger[_0x179e('0x15')](_0x179e('0x16'),_0x1a588d,_0x179e('0x14'),JSON[_0x179e('0x17')](_0x2875e7));if(_0x2875e7[_0x179e('0x18')]){if(_0x2875e7[_0x179e('0x18')][_0x179e('0x19')]===0x1f4){logger[_0x179e('0x18')](_0x179e('0x13'),_0x1a588d,_0x2875e7['error'][_0x179e('0x1a')]);return _0x16b813(_0x2875e7[_0x179e('0x18')][_0x179e('0x1a')]);}logger['error']('VoiceQueue,\x20%s,\x20%s',_0x1a588d,_0x2875e7[_0x179e('0x18')][_0x179e('0x1a')]);return _0x29a626(_0x2875e7['error'][_0x179e('0x1a')]);}else{logger[_0x179e('0x12')]('VoiceQueue,\x20%s,\x20%s',_0x1a588d,_0x179e('0x14'));_0x29a626(_0x2875e7[_0x179e('0x1b')]['message']);}})[_0x179e('0x1c')](function(_0x790528){logger[_0x179e('0x18')](_0x179e('0x13'),_0x1a588d,_0x790528);_0x16b813(_0x790528);});});}exports['GetVoiceQueue']=function(_0x2a32d2){var _0xaaf8c0=this;return new Promise(function(_0x389f03,_0x198693){return db['VoiceQueue']['findAll']({'raw':_0x2a32d2[_0x179e('0x1d')]?_0x2a32d2['options'][_0x179e('0x1e')]===undefined?!![]:![]:!![],'where':_0x2a32d2[_0x179e('0x1d')]?_0x2a32d2[_0x179e('0x1d')][_0x179e('0x1f')]||null:null,'attributes':_0x2a32d2[_0x179e('0x1d')]?_0x2a32d2['options'][_0x179e('0x20')]||null:null,'limit':_0x2a32d2[_0x179e('0x1d')]?_0x2a32d2['options'][_0x179e('0x21')]||null:null,'include':_0x2a32d2[_0x179e('0x1d')]?_0x2a32d2['options'][_0x179e('0x22')]?_[_0x179e('0x23')](_0x2a32d2[_0x179e('0x1d')][_0x179e('0x22')],function(_0x263d81){return{'model':db[_0x263d81[_0x179e('0x24')]],'as':_0x263d81['as'],'attributes':_0x263d81[_0x179e('0x20')],'include':_0x263d81['include']?_[_0x179e('0x23')](_0x263d81[_0x179e('0x22')],function(_0x10c9f){return{'model':db[_0x10c9f['model']],'as':_0x10c9f['as'],'attributes':_0x10c9f[_0x179e('0x20')],'include':_0x10c9f['include']?_['map'](_0x10c9f['include'],function(_0x3e8b6b){return{'model':db[_0x3e8b6b['model']],'as':_0x3e8b6b['as'],'attributes':_0x3e8b6b['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2f4bec){logger['info'](_0x179e('0x25'),_0x2a32d2);logger[_0x179e('0x15')]('GetVoiceQueue',_0x2a32d2,JSON['stringify'](_0x2f4bec));_0x389f03(_0x2f4bec);})[_0x179e('0x1c')](function(_0x39aa63){logger['error'](_0x179e('0x25'),_0x39aa63[_0x179e('0x1a')],_0x2a32d2);_0x198693(_0xaaf8c0[_0x179e('0x18')](0x1f4,_0x39aa63['message']));});});};exports[_0x179e('0x26')]=function(_0x4ab3f9){var _0x42e513=this;return new Promise(function(_0x3d2dc1,_0x35dcb){return db[_0x179e('0x27')][_0x179e('0x28')]({'raw':_0x4ab3f9[_0x179e('0x1d')]?_0x4ab3f9['options'][_0x179e('0x1e')]===undefined?!![]:![]:!![],'where':_0x4ab3f9[_0x179e('0x1d')]?_0x4ab3f9[_0x179e('0x1d')][_0x179e('0x1f')]||null:null,'attributes':_0x4ab3f9['options']?_0x4ab3f9[_0x179e('0x1d')][_0x179e('0x20')]||null:null,'include':_0x4ab3f9['options']?_0x4ab3f9[_0x179e('0x1d')][_0x179e('0x22')]?_['map'](_0x4ab3f9[_0x179e('0x1d')][_0x179e('0x22')],function(_0x516bf9){return{'model':db[_0x516bf9[_0x179e('0x24')]],'as':_0x516bf9['as'],'attributes':_0x516bf9[_0x179e('0x20')],'include':_0x516bf9[_0x179e('0x22')]?_['map'](_0x516bf9['include'],function(_0x3f73d6){return{'model':db[_0x3f73d6[_0x179e('0x24')]],'as':_0x3f73d6['as'],'attributes':_0x3f73d6['attributes'],'include':_0x3f73d6[_0x179e('0x22')]?_['map'](_0x3f73d6[_0x179e('0x22')],function(_0x10cf7a){return{'model':db[_0x10cf7a[_0x179e('0x24')]],'as':_0x10cf7a['as'],'attributes':_0x10cf7a[_0x179e('0x20')]};}):[]};}):[]};}):[]:[]})[_0x179e('0x11')](function(_0x469d0a){logger['info']('ShowVoiceQueue',_0x4ab3f9);logger[_0x179e('0x15')](_0x179e('0x26'),_0x4ab3f9,JSON[_0x179e('0x17')](_0x469d0a));_0x3d2dc1(_0x469d0a);})[_0x179e('0x1c')](function(_0x586ab6){logger['error'](_0x179e('0x26'),_0x586ab6[_0x179e('0x1a')],_0x4ab3f9);_0x35dcb(_0x42e513[_0x179e('0x18')](0x1f4,_0x586ab6[_0x179e('0x1a')]));});});};
\ No newline at end of file