Built motion from commit (unavailable).|2.5.26
[motion2.git] / server / api / voiceQueue / voiceQueue.rpc.js
index 79626b3..9641f00 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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
+var _0xc367=['VoiceQueue','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./voiceQueue.socket','request','then','info','request\x20sent','debug','stringify','error','VoiceQueue,\x20%s,\x20%s','message','result','catch','GetVoiceQueue','findAll','options','where','attributes','include','map','model','ShowVoiceQueue'];(function(_0x15e1b8,_0x10d3a9){var _0x46f7e9=function(_0xae110e){while(--_0xae110e){_0x15e1b8['push'](_0x15e1b8['shift']());}};_0x46f7e9(++_0x10d3a9);}(_0xc367,0x14b));var _0x7c36=function(_0x39dfce,_0x37f996){_0x39dfce=_0x39dfce-0x0;var _0x496ab3=_0xc367[_0x39dfce];return _0x496ab3;};'use strict';var _=require(_0x7c36('0x0'));var util=require(_0x7c36('0x1'));var moment=require(_0x7c36('0x2'));var BPromise=require(_0x7c36('0x3'));var rs=require(_0x7c36('0x4'));var fs=require('fs');var Redis=require(_0x7c36('0x5'));var db=require(_0x7c36('0x6'))['db'];var utils=require(_0x7c36('0x7'));var logger=require(_0x7c36('0x8'))(_0x7c36('0x9'));var config=require(_0x7c36('0xa'));var jayson=require(_0x7c36('0xb'));var client=jayson[_0x7c36('0xc')][_0x7c36('0xd')]({'port':0x232a});config[_0x7c36('0xe')]=_[_0x7c36('0xf')](config[_0x7c36('0xe')],{'host':_0x7c36('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7c36('0xe')]));require(_0x7c36('0x11'))['register'](socket);function respondWithRpcPromise(_0x54be5f,_0x4f16a9,_0x1825bd){return new BPromise(function(_0x51d12d,_0x372688){return client[_0x7c36('0x12')](_0x54be5f,_0x1825bd)[_0x7c36('0x13')](function(_0x2f17fb){logger[_0x7c36('0x14')]('VoiceQueue,\x20%s,\x20%s',_0x4f16a9,_0x7c36('0x15'));logger[_0x7c36('0x16')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x4f16a9,'request\x20sent',JSON[_0x7c36('0x17')](_0x2f17fb));if(_0x2f17fb['error']){if(_0x2f17fb[_0x7c36('0x18')]['code']===0x1f4){logger[_0x7c36('0x18')](_0x7c36('0x19'),_0x4f16a9,_0x2f17fb[_0x7c36('0x18')][_0x7c36('0x1a')]);return _0x372688(_0x2f17fb[_0x7c36('0x18')][_0x7c36('0x1a')]);}logger['error'](_0x7c36('0x19'),_0x4f16a9,_0x2f17fb['error'][_0x7c36('0x1a')]);return _0x51d12d(_0x2f17fb[_0x7c36('0x18')][_0x7c36('0x1a')]);}else{logger['info'](_0x7c36('0x19'),_0x4f16a9,'request\x20sent');_0x51d12d(_0x2f17fb[_0x7c36('0x1b')][_0x7c36('0x1a')]);}})[_0x7c36('0x1c')](function(_0x2008d2){logger['error'](_0x7c36('0x19'),_0x4f16a9,_0x2008d2);_0x372688(_0x2008d2);});});}exports[_0x7c36('0x1d')]=function(_0x352842){var _0x1af4ea=this;return new Promise(function(_0x5342dc,_0x5d5cba){return db['VoiceQueue'][_0x7c36('0x1e')]({'raw':_0x352842['options']?_0x352842[_0x7c36('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x352842[_0x7c36('0x1f')]?_0x352842[_0x7c36('0x1f')][_0x7c36('0x20')]||null:null,'attributes':_0x352842['options']?_0x352842[_0x7c36('0x1f')][_0x7c36('0x21')]||null:null,'limit':_0x352842[_0x7c36('0x1f')]?_0x352842['options']['limit']||null:null,'include':_0x352842[_0x7c36('0x1f')]?_0x352842[_0x7c36('0x1f')][_0x7c36('0x22')]?_[_0x7c36('0x23')](_0x352842[_0x7c36('0x1f')]['include'],function(_0x29b1d7){return{'model':db[_0x29b1d7[_0x7c36('0x24')]],'as':_0x29b1d7['as'],'attributes':_0x29b1d7[_0x7c36('0x21')],'include':_0x29b1d7[_0x7c36('0x22')]?_['map'](_0x29b1d7['include'],function(_0x416114){return{'model':db[_0x416114[_0x7c36('0x24')]],'as':_0x416114['as'],'attributes':_0x416114[_0x7c36('0x21')],'include':_0x416114[_0x7c36('0x22')]?_['map'](_0x416114[_0x7c36('0x22')],function(_0x58621a){return{'model':db[_0x58621a['model']],'as':_0x58621a['as'],'attributes':_0x58621a[_0x7c36('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7c36('0x13')](function(_0x394629){logger[_0x7c36('0x14')](_0x7c36('0x1d'),_0x352842);logger[_0x7c36('0x16')](_0x7c36('0x1d'),_0x352842,JSON[_0x7c36('0x17')](_0x394629));_0x5342dc(_0x394629);})[_0x7c36('0x1c')](function(_0x157765){logger[_0x7c36('0x18')](_0x7c36('0x1d'),_0x157765[_0x7c36('0x1a')],_0x352842);_0x5d5cba(_0x1af4ea[_0x7c36('0x18')](0x1f4,_0x157765[_0x7c36('0x1a')]));});});};exports[_0x7c36('0x25')]=function(_0xffd6f5){var _0x4f3cab=this;return new Promise(function(_0xc0520,_0x3e090f){return db[_0x7c36('0x26')][_0x7c36('0x27')]({'raw':_0xffd6f5['options']?_0xffd6f5['options'][_0x7c36('0x28')]===undefined?!![]:![]:!![],'where':_0xffd6f5[_0x7c36('0x1f')]?_0xffd6f5[_0x7c36('0x1f')]['where']||null:null,'attributes':_0xffd6f5[_0x7c36('0x1f')]?_0xffd6f5[_0x7c36('0x1f')]['attributes']||null:null,'include':_0xffd6f5[_0x7c36('0x1f')]?_0xffd6f5['options'][_0x7c36('0x22')]?_['map'](_0xffd6f5[_0x7c36('0x1f')][_0x7c36('0x22')],function(_0x19fd6c){return{'model':db[_0x19fd6c[_0x7c36('0x24')]],'as':_0x19fd6c['as'],'attributes':_0x19fd6c['attributes'],'include':_0x19fd6c[_0x7c36('0x22')]?_[_0x7c36('0x23')](_0x19fd6c['include'],function(_0x150c8f){return{'model':db[_0x150c8f[_0x7c36('0x24')]],'as':_0x150c8f['as'],'attributes':_0x150c8f[_0x7c36('0x21')],'include':_0x150c8f[_0x7c36('0x22')]?_[_0x7c36('0x23')](_0x150c8f[_0x7c36('0x22')],function(_0x16f03c){return{'model':db[_0x16f03c[_0x7c36('0x24')]],'as':_0x16f03c['as'],'attributes':_0x16f03c[_0x7c36('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7c36('0x13')](function(_0x32ba49){logger[_0x7c36('0x14')](_0x7c36('0x25'),_0xffd6f5);logger[_0x7c36('0x16')](_0x7c36('0x25'),_0xffd6f5,JSON[_0x7c36('0x17')](_0x32ba49));_0xc0520(_0x32ba49);})['catch'](function(_0x5e5a94){logger[_0x7c36('0x18')]('ShowVoiceQueue',_0x5e5a94[_0x7c36('0x1a')],_0xffd6f5);_0x3e090f(_0x4f3cab[_0x7c36('0x18')](0x1f4,_0x5e5a94[_0x7c36('0x1a')]));});});};
\ No newline at end of file