Built motion from commit (unavailable).|2.5.4
[motion2.git] / server / api / voiceQueue / voiceQueue.rpc.js
index c4ab88d..436370a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf433=['http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','VoiceQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','include','map','model','attributes','debug','raw','where','stringify','ShowVoiceQueue','lodash','util','bluebird','ioredis','../../config/utils','rpc','../../config/environment'];(function(_0x4ecd76,_0x79f1f3){var _0x240f34=function(_0x563f79){while(--_0x563f79){_0x4ecd76['push'](_0x4ecd76['shift']());}};_0x240f34(++_0x79f1f3);}(_0xf433,0x1cd));var _0x3f43=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf433[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x3f43('0x0'));var util=require(_0x3f43('0x1'));var moment=require('moment');var BPromise=require(_0x3f43('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3f43('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3f43('0x4'));var logger=require('../../config/logger')(_0x3f43('0x5'));var config=require(_0x3f43('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3f43('0x7')]({'port':0x232a});config[_0x3f43('0x8')]=_[_0x3f43('0x9')](config['redis'],{'host':_0x3f43('0xa'),'port':0x18eb});var socket=require(_0x3f43('0xb'))(new Redis(config[_0x3f43('0x8')]));require(_0x3f43('0xc'))['register'](socket);function respondWithRpcPromise(_0xe4e9f7,_0x1e522b,_0x45b632){return new BPromise(function(_0x298190,_0x45b7dd){return client[_0x3f43('0xd')](_0xe4e9f7,_0x45b632)[_0x3f43('0xe')](function(_0x28e763){logger[_0x3f43('0xf')](_0x3f43('0x10'),_0x1e522b,_0x3f43('0x11'));logger['debug'](_0x3f43('0x12'),_0x1e522b,_0x3f43('0x11'),JSON['stringify'](_0x28e763));if(_0x28e763[_0x3f43('0x13')]){if(_0x28e763[_0x3f43('0x13')]['code']===0x1f4){logger[_0x3f43('0x13')]('VoiceQueue,\x20%s,\x20%s',_0x1e522b,_0x28e763[_0x3f43('0x13')][_0x3f43('0x14')]);return _0x45b7dd(_0x28e763[_0x3f43('0x13')][_0x3f43('0x14')]);}logger['error'](_0x3f43('0x10'),_0x1e522b,_0x28e763['error'][_0x3f43('0x14')]);return _0x298190(_0x28e763[_0x3f43('0x13')]['message']);}else{logger[_0x3f43('0xf')](_0x3f43('0x10'),_0x1e522b,_0x3f43('0x11'));_0x298190(_0x28e763[_0x3f43('0x15')][_0x3f43('0x14')]);}})[_0x3f43('0x16')](function(_0x5addc7){logger['error'](_0x3f43('0x10'),_0x1e522b,_0x5addc7);_0x45b7dd(_0x5addc7);});});}exports[_0x3f43('0x17')]=function(_0x44a7cd){var _0x123537=this;return new Promise(function(_0x20febf,_0x50ef62){return db[_0x3f43('0x18')][_0x3f43('0x19')]({'raw':_0x44a7cd['options']?_0x44a7cd[_0x3f43('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x44a7cd[_0x3f43('0x1a')]?_0x44a7cd[_0x3f43('0x1a')]['where']||null:null,'attributes':_0x44a7cd['options']?_0x44a7cd[_0x3f43('0x1a')]['attributes']||null:null,'limit':_0x44a7cd[_0x3f43('0x1a')]?_0x44a7cd[_0x3f43('0x1a')]['limit']||null:null,'include':_0x44a7cd[_0x3f43('0x1a')]?_0x44a7cd[_0x3f43('0x1a')][_0x3f43('0x1b')]?_[_0x3f43('0x1c')](_0x44a7cd[_0x3f43('0x1a')][_0x3f43('0x1b')],function(_0x5a8a4a){return{'model':db[_0x5a8a4a[_0x3f43('0x1d')]],'as':_0x5a8a4a['as'],'attributes':_0x5a8a4a[_0x3f43('0x1e')],'include':_0x5a8a4a[_0x3f43('0x1b')]?_[_0x3f43('0x1c')](_0x5a8a4a[_0x3f43('0x1b')],function(_0x2443fb){return{'model':db[_0x2443fb[_0x3f43('0x1d')]],'as':_0x2443fb['as'],'attributes':_0x2443fb[_0x3f43('0x1e')],'include':_0x2443fb[_0x3f43('0x1b')]?_[_0x3f43('0x1c')](_0x2443fb[_0x3f43('0x1b')],function(_0x297481){return{'model':db[_0x297481[_0x3f43('0x1d')]],'as':_0x297481['as'],'attributes':_0x297481[_0x3f43('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x3f43('0xe')](function(_0x1650e0){logger[_0x3f43('0xf')](_0x3f43('0x17'),_0x44a7cd);logger[_0x3f43('0x1f')](_0x3f43('0x17'),_0x44a7cd,JSON['stringify'](_0x1650e0));_0x20febf(_0x1650e0);})[_0x3f43('0x16')](function(_0x374cca){logger[_0x3f43('0x13')]('GetVoiceQueue',_0x374cca[_0x3f43('0x14')],_0x44a7cd);_0x50ef62(_0x123537[_0x3f43('0x13')](0x1f4,_0x374cca[_0x3f43('0x14')]));});});};exports['ShowVoiceQueue']=function(_0x3ab7fa){var _0xf0448=this;return new Promise(function(_0x2ba229,_0x45066a){return db[_0x3f43('0x18')]['find']({'raw':_0x3ab7fa[_0x3f43('0x1a')]?_0x3ab7fa['options'][_0x3f43('0x20')]===undefined?!![]:![]:!![],'where':_0x3ab7fa[_0x3f43('0x1a')]?_0x3ab7fa[_0x3f43('0x1a')][_0x3f43('0x21')]||null:null,'attributes':_0x3ab7fa[_0x3f43('0x1a')]?_0x3ab7fa['options'][_0x3f43('0x1e')]||null:null,'include':_0x3ab7fa[_0x3f43('0x1a')]?_0x3ab7fa[_0x3f43('0x1a')][_0x3f43('0x1b')]?_[_0x3f43('0x1c')](_0x3ab7fa[_0x3f43('0x1a')][_0x3f43('0x1b')],function(_0x7d19fb){return{'model':db[_0x7d19fb[_0x3f43('0x1d')]],'as':_0x7d19fb['as'],'attributes':_0x7d19fb['attributes'],'include':_0x7d19fb[_0x3f43('0x1b')]?_['map'](_0x7d19fb[_0x3f43('0x1b')],function(_0x19bdba){return{'model':db[_0x19bdba[_0x3f43('0x1d')]],'as':_0x19bdba['as'],'attributes':_0x19bdba[_0x3f43('0x1e')],'include':_0x19bdba['include']?_[_0x3f43('0x1c')](_0x19bdba[_0x3f43('0x1b')],function(_0x14928a){return{'model':db[_0x14928a['model']],'as':_0x14928a['as'],'attributes':_0x14928a[_0x3f43('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x3f43('0xe')](function(_0x10da39){logger[_0x3f43('0xf')]('ShowVoiceQueue',_0x3ab7fa);logger['debug']('ShowVoiceQueue',_0x3ab7fa,JSON[_0x3f43('0x22')](_0x10da39));_0x2ba229(_0x10da39);})[_0x3f43('0x16')](function(_0x37272c){logger['error'](_0x3f43('0x23'),_0x37272c['message'],_0x3ab7fa);_0x45066a(_0xf0448[_0x3f43('0x13')](0x1f4,_0x37272c['message']));});});};
\ No newline at end of file
+var _0x92a6=['../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','request','info','VoiceQueue,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','GetVoiceQueue','findAll','options','raw','attributes','include','map','model','then','stringify','ShowVoiceQueue','VoiceQueue','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3cef48,_0x4b8910){var _0x25b578=function(_0xe33e9e){while(--_0xe33e9e){_0x3cef48['push'](_0x3cef48['shift']());}};_0x25b578(++_0x4b8910);}(_0x92a6,0xa4));var _0x692a=function(_0x5b323a,_0x17f67f){_0x5b323a=_0x5b323a-0x0;var _0x1c2826=_0x92a6[_0x5b323a];return _0x1c2826;};'use strict';var _=require(_0x692a('0x0'));var util=require(_0x692a('0x1'));var moment=require(_0x692a('0x2'));var BPromise=require(_0x692a('0x3'));var rs=require(_0x692a('0x4'));var fs=require('fs');var Redis=require(_0x692a('0x5'));var db=require(_0x692a('0x6'))['db'];var utils=require(_0x692a('0x7'));var logger=require(_0x692a('0x8'))(_0x692a('0x9'));var config=require(_0x692a('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x692a('0xb')][_0x692a('0xc')]({'port':0x232a});config[_0x692a('0xd')]=_[_0x692a('0xe')](config[_0x692a('0xd')],{'host':_0x692a('0xf'),'port':0x18eb});var socket=require(_0x692a('0x10'))(new Redis(config['redis']));require(_0x692a('0x11'))[_0x692a('0x12')](socket);function respondWithRpcPromise(_0x2d4ae3,_0xda3fa3,_0x418635){return new BPromise(function(_0x375afc,_0x12220f){return client[_0x692a('0x13')](_0x2d4ae3,_0x418635)['then'](function(_0x140acc){logger[_0x692a('0x14')](_0x692a('0x15'),_0xda3fa3,'request\x20sent');logger[_0x692a('0x16')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0xda3fa3,_0x692a('0x17'),JSON['stringify'](_0x140acc));if(_0x140acc['error']){if(_0x140acc[_0x692a('0x18')][_0x692a('0x19')]===0x1f4){logger[_0x692a('0x18')](_0x692a('0x15'),_0xda3fa3,_0x140acc[_0x692a('0x18')][_0x692a('0x1a')]);return _0x12220f(_0x140acc[_0x692a('0x18')]['message']);}logger['error'](_0x692a('0x15'),_0xda3fa3,_0x140acc[_0x692a('0x18')]['message']);return _0x375afc(_0x140acc[_0x692a('0x18')][_0x692a('0x1a')]);}else{logger[_0x692a('0x14')](_0x692a('0x15'),_0xda3fa3,_0x692a('0x17'));_0x375afc(_0x140acc[_0x692a('0x1b')][_0x692a('0x1a')]);}})[_0x692a('0x1c')](function(_0x57c4e1){logger[_0x692a('0x18')]('VoiceQueue,\x20%s,\x20%s',_0xda3fa3,_0x57c4e1);_0x12220f(_0x57c4e1);});});}exports[_0x692a('0x1d')]=function(_0xde407b){var _0x283928=this;return new Promise(function(_0x89524c,_0xabe7e0){return db['VoiceQueue'][_0x692a('0x1e')]({'raw':_0xde407b[_0x692a('0x1f')]?_0xde407b[_0x692a('0x1f')][_0x692a('0x20')]===undefined?!![]:![]:!![],'where':_0xde407b[_0x692a('0x1f')]?_0xde407b['options']['where']||null:null,'attributes':_0xde407b[_0x692a('0x1f')]?_0xde407b['options'][_0x692a('0x21')]||null:null,'limit':_0xde407b['options']?_0xde407b[_0x692a('0x1f')]['limit']||null:null,'include':_0xde407b['options']?_0xde407b[_0x692a('0x1f')][_0x692a('0x22')]?_[_0x692a('0x23')](_0xde407b[_0x692a('0x1f')]['include'],function(_0x5a7c8c){return{'model':db[_0x5a7c8c[_0x692a('0x24')]],'as':_0x5a7c8c['as'],'attributes':_0x5a7c8c[_0x692a('0x21')],'include':_0x5a7c8c['include']?_[_0x692a('0x23')](_0x5a7c8c[_0x692a('0x22')],function(_0x22b8c9){return{'model':db[_0x22b8c9[_0x692a('0x24')]],'as':_0x22b8c9['as'],'attributes':_0x22b8c9[_0x692a('0x21')],'include':_0x22b8c9[_0x692a('0x22')]?_['map'](_0x22b8c9[_0x692a('0x22')],function(_0x1374ed){return{'model':db[_0x1374ed[_0x692a('0x24')]],'as':_0x1374ed['as'],'attributes':_0x1374ed[_0x692a('0x21')]};}):[]};}):[]};}):[]:[]})[_0x692a('0x25')](function(_0x1c90dc){logger['info']('GetVoiceQueue',_0xde407b);logger[_0x692a('0x16')](_0x692a('0x1d'),_0xde407b,JSON[_0x692a('0x26')](_0x1c90dc));_0x89524c(_0x1c90dc);})[_0x692a('0x1c')](function(_0x1f80c3){logger[_0x692a('0x18')](_0x692a('0x1d'),_0x1f80c3[_0x692a('0x1a')],_0xde407b);_0xabe7e0(_0x283928['error'](0x1f4,_0x1f80c3['message']));});});};exports[_0x692a('0x27')]=function(_0x4171b7){var _0xef1d7a=this;return new Promise(function(_0x20a8c4,_0x4742ee){return db[_0x692a('0x28')][_0x692a('0x29')]({'raw':_0x4171b7[_0x692a('0x1f')]?_0x4171b7[_0x692a('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x4171b7[_0x692a('0x1f')]?_0x4171b7[_0x692a('0x1f')][_0x692a('0x2a')]||null:null,'attributes':_0x4171b7[_0x692a('0x1f')]?_0x4171b7[_0x692a('0x1f')]['attributes']||null:null,'include':_0x4171b7[_0x692a('0x1f')]?_0x4171b7[_0x692a('0x1f')]['include']?_[_0x692a('0x23')](_0x4171b7[_0x692a('0x1f')][_0x692a('0x22')],function(_0x1dab59){return{'model':db[_0x1dab59[_0x692a('0x24')]],'as':_0x1dab59['as'],'attributes':_0x1dab59['attributes'],'include':_0x1dab59[_0x692a('0x22')]?_[_0x692a('0x23')](_0x1dab59[_0x692a('0x22')],function(_0x209b30){return{'model':db[_0x209b30[_0x692a('0x24')]],'as':_0x209b30['as'],'attributes':_0x209b30['attributes'],'include':_0x209b30['include']?_['map'](_0x209b30['include'],function(_0x3b2aef){return{'model':db[_0x3b2aef[_0x692a('0x24')]],'as':_0x3b2aef['as'],'attributes':_0x3b2aef['attributes']};}):[]};}):[]};}):[]:[]})[_0x692a('0x25')](function(_0x1e8fe4){logger[_0x692a('0x14')](_0x692a('0x27'),_0x4171b7);logger[_0x692a('0x16')](_0x692a('0x27'),_0x4171b7,JSON[_0x692a('0x26')](_0x1e8fe4));_0x20a8c4(_0x1e8fe4);})[_0x692a('0x1c')](function(_0x47b319){logger['error'](_0x692a('0x27'),_0x47b319[_0x692a('0x1a')],_0x4171b7);_0x4742ee(_0xef1d7a[_0x692a('0x18')](0x1f4,_0x47b319[_0x692a('0x1a')]));});});};
\ No newline at end of file