Built motion from commit da24aabd.|2.6.20
[motion2.git] / server / api / voiceQueue / voiceQueue.rpc.js
index 3833096..460d2cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d3c=['socket.io-emitter','request','then','VoiceQueue,\x20%s,\x20%s','request\x20sent','error','code','message','info','catch','GetVoiceQueue','findAll','options','raw','limit','include','model','map','attributes','stringify','ShowVoiceQueue','where','debug','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost'];(function(_0x26f639,_0x1bcf59){var _0x405890=function(_0x4b9538){while(--_0x4b9538){_0x26f639['push'](_0x26f639['shift']());}};_0x405890(++_0x1bcf59);}(_0x1d3c,0xd5));var _0xc1d3=function(_0x3005d5,_0xf588c7){_0x3005d5=_0x3005d5-0x0;var _0x547c7e=_0x1d3c[_0x3005d5];return _0x547c7e;};'use strict';var _=require(_0xc1d3('0x0'));var util=require(_0xc1d3('0x1'));var moment=require(_0xc1d3('0x2'));var BPromise=require(_0xc1d3('0x3'));var rs=require(_0xc1d3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc1d3('0x5'))['db'];var utils=require(_0xc1d3('0x6'));var logger=require(_0xc1d3('0x7'))(_0xc1d3('0x8'));var config=require(_0xc1d3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc1d3('0xa')][_0xc1d3('0xb')]({'port':0x232a});config[_0xc1d3('0xc')]=_[_0xc1d3('0xd')](config['redis'],{'host':_0xc1d3('0xe'),'port':0x18eb});var socket=require(_0xc1d3('0xf'))(new Redis(config['redis']));require('./voiceQueue.socket')['register'](socket);function respondWithRpcPromise(_0x9e694e,_0x16764f,_0x2f2079){return new BPromise(function(_0x2da452,_0x28cd79){return client[_0xc1d3('0x10')](_0x9e694e,_0x2f2079)[_0xc1d3('0x11')](function(_0x3cc2a4){logger['info'](_0xc1d3('0x12'),_0x16764f,_0xc1d3('0x13'));logger['debug']('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x16764f,_0xc1d3('0x13'),JSON['stringify'](_0x3cc2a4));if(_0x3cc2a4['error']){if(_0x3cc2a4[_0xc1d3('0x14')][_0xc1d3('0x15')]===0x1f4){logger[_0xc1d3('0x14')](_0xc1d3('0x12'),_0x16764f,_0x3cc2a4[_0xc1d3('0x14')][_0xc1d3('0x16')]);return _0x28cd79(_0x3cc2a4['error'][_0xc1d3('0x16')]);}logger[_0xc1d3('0x14')](_0xc1d3('0x12'),_0x16764f,_0x3cc2a4[_0xc1d3('0x14')][_0xc1d3('0x16')]);return _0x2da452(_0x3cc2a4[_0xc1d3('0x14')][_0xc1d3('0x16')]);}else{logger[_0xc1d3('0x17')]('VoiceQueue,\x20%s,\x20%s',_0x16764f,_0xc1d3('0x13'));_0x2da452(_0x3cc2a4['result'][_0xc1d3('0x16')]);}})[_0xc1d3('0x18')](function(_0x2da940){logger[_0xc1d3('0x14')](_0xc1d3('0x12'),_0x16764f,_0x2da940);_0x28cd79(_0x2da940);});});}exports[_0xc1d3('0x19')]=function(_0x279edc){var _0x27fb7f=this;return new Promise(function(_0x5e4b43,_0x1dc10a){return db['VoiceQueue'][_0xc1d3('0x1a')]({'raw':_0x279edc[_0xc1d3('0x1b')]?_0x279edc[_0xc1d3('0x1b')][_0xc1d3('0x1c')]===undefined?!![]:![]:!![],'where':_0x279edc[_0xc1d3('0x1b')]?_0x279edc[_0xc1d3('0x1b')]['where']||null:null,'attributes':_0x279edc['options']?_0x279edc[_0xc1d3('0x1b')]['attributes']||null:null,'limit':_0x279edc['options']?_0x279edc[_0xc1d3('0x1b')][_0xc1d3('0x1d')]||null:null,'include':_0x279edc[_0xc1d3('0x1b')]?_0x279edc[_0xc1d3('0x1b')][_0xc1d3('0x1e')]?_['map'](_0x279edc[_0xc1d3('0x1b')]['include'],function(_0x2a65b0){return{'model':db[_0x2a65b0[_0xc1d3('0x1f')]],'as':_0x2a65b0['as'],'attributes':_0x2a65b0['attributes'],'include':_0x2a65b0[_0xc1d3('0x1e')]?_[_0xc1d3('0x20')](_0x2a65b0[_0xc1d3('0x1e')],function(_0x3bcb77){return{'model':db[_0x3bcb77['model']],'as':_0x3bcb77['as'],'attributes':_0x3bcb77[_0xc1d3('0x21')],'include':_0x3bcb77[_0xc1d3('0x1e')]?_[_0xc1d3('0x20')](_0x3bcb77[_0xc1d3('0x1e')],function(_0x23f3b0){return{'model':db[_0x23f3b0[_0xc1d3('0x1f')]],'as':_0x23f3b0['as'],'attributes':_0x23f3b0[_0xc1d3('0x21')]};}):[]};}):[]};}):[]:[]})[_0xc1d3('0x11')](function(_0x558eb4){logger[_0xc1d3('0x17')](_0xc1d3('0x19'),_0x279edc);logger['debug'](_0xc1d3('0x19'),_0x279edc,JSON[_0xc1d3('0x22')](_0x558eb4));_0x5e4b43(_0x558eb4);})['catch'](function(_0x3d12eb){logger[_0xc1d3('0x14')]('GetVoiceQueue',_0x3d12eb['message'],_0x279edc);_0x1dc10a(_0x27fb7f['error'](0x1f4,_0x3d12eb[_0xc1d3('0x16')]));});});};exports[_0xc1d3('0x23')]=function(_0x3462ae){var _0x20944d=this;return new Promise(function(_0x36ef72,_0x23bc26){return db['VoiceQueue']['find']({'raw':_0x3462ae[_0xc1d3('0x1b')]?_0x3462ae[_0xc1d3('0x1b')][_0xc1d3('0x1c')]===undefined?!![]:![]:!![],'where':_0x3462ae[_0xc1d3('0x1b')]?_0x3462ae[_0xc1d3('0x1b')][_0xc1d3('0x24')]||null:null,'attributes':_0x3462ae[_0xc1d3('0x1b')]?_0x3462ae[_0xc1d3('0x1b')][_0xc1d3('0x21')]||null:null,'include':_0x3462ae[_0xc1d3('0x1b')]?_0x3462ae[_0xc1d3('0x1b')][_0xc1d3('0x1e')]?_['map'](_0x3462ae[_0xc1d3('0x1b')][_0xc1d3('0x1e')],function(_0x15f186){return{'model':db[_0x15f186[_0xc1d3('0x1f')]],'as':_0x15f186['as'],'attributes':_0x15f186['attributes'],'include':_0x15f186[_0xc1d3('0x1e')]?_[_0xc1d3('0x20')](_0x15f186[_0xc1d3('0x1e')],function(_0x1fe7a2){return{'model':db[_0x1fe7a2[_0xc1d3('0x1f')]],'as':_0x1fe7a2['as'],'attributes':_0x1fe7a2['attributes'],'include':_0x1fe7a2['include']?_[_0xc1d3('0x20')](_0x1fe7a2[_0xc1d3('0x1e')],function(_0x35d22d){return{'model':db[_0x35d22d[_0xc1d3('0x1f')]],'as':_0x35d22d['as'],'attributes':_0x35d22d['attributes']};}):[]};}):[]};}):[]:[]})[_0xc1d3('0x11')](function(_0x37db91){logger[_0xc1d3('0x17')](_0xc1d3('0x23'),_0x3462ae);logger[_0xc1d3('0x25')](_0xc1d3('0x23'),_0x3462ae,JSON[_0xc1d3('0x22')](_0x37db91));_0x36ef72(_0x37db91);})[_0xc1d3('0x18')](function(_0x14cc15){logger[_0xc1d3('0x14')](_0xc1d3('0x23'),_0x14cc15[_0xc1d3('0x16')],_0x3462ae);_0x23bc26(_0x20944d[_0xc1d3('0x14')](0x1f4,_0x14cc15[_0xc1d3('0x16')]));});});};
\ No newline at end of file
+var _0xafd9=['http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','request','then','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','GetVoiceQueue','findAll','options','where','attributes','include','map','model','catch','ShowVoiceQueue','VoiceQueue','find','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x238a15,_0x3bc459){var _0x4d5d19=function(_0x50fbc7){while(--_0x50fbc7){_0x238a15['push'](_0x238a15['shift']());}};_0x4d5d19(++_0x3bc459);}(_0xafd9,0xb9));var _0x9afd=function(_0x5c368b,_0x427a8d){_0x5c368b=_0x5c368b-0x0;var _0x2ce687=_0xafd9[_0x5c368b];return _0x2ce687;};'use strict';var _=require(_0x9afd('0x0'));var util=require(_0x9afd('0x1'));var moment=require(_0x9afd('0x2'));var BPromise=require('bluebird');var rs=require(_0x9afd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9afd('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9afd('0x5'))(_0x9afd('0x6'));var config=require(_0x9afd('0x7'));var jayson=require(_0x9afd('0x8'));var client=jayson[_0x9afd('0x9')][_0x9afd('0xa')]({'port':0x232a});config[_0x9afd('0xb')]=_[_0x9afd('0xc')](config[_0x9afd('0xb')],{'host':_0x9afd('0xd'),'port':0x18eb});var socket=require(_0x9afd('0xe'))(new Redis(config[_0x9afd('0xb')]));require(_0x9afd('0xf'))['register'](socket);function respondWithRpcPromise(_0x1367af,_0x3d0496,_0x19e0ff){return new BPromise(function(_0x4f690a,_0xbfbfc1){return client[_0x9afd('0x10')](_0x1367af,_0x19e0ff)[_0x9afd('0x11')](function(_0xdf621c){logger['info'](_0x9afd('0x12'),_0x3d0496,_0x9afd('0x13'));logger[_0x9afd('0x14')](_0x9afd('0x15'),_0x3d0496,_0x9afd('0x13'),JSON[_0x9afd('0x16')](_0xdf621c));if(_0xdf621c[_0x9afd('0x17')]){if(_0xdf621c[_0x9afd('0x17')][_0x9afd('0x18')]===0x1f4){logger[_0x9afd('0x17')](_0x9afd('0x12'),_0x3d0496,_0xdf621c[_0x9afd('0x17')][_0x9afd('0x19')]);return _0xbfbfc1(_0xdf621c[_0x9afd('0x17')][_0x9afd('0x19')]);}logger[_0x9afd('0x17')](_0x9afd('0x12'),_0x3d0496,_0xdf621c[_0x9afd('0x17')][_0x9afd('0x19')]);return _0x4f690a(_0xdf621c['error'][_0x9afd('0x19')]);}else{logger[_0x9afd('0x1a')]('VoiceQueue,\x20%s,\x20%s',_0x3d0496,'request\x20sent');_0x4f690a(_0xdf621c['result']['message']);}})['catch'](function(_0x3a96f9){logger['error'](_0x9afd('0x12'),_0x3d0496,_0x3a96f9);_0xbfbfc1(_0x3a96f9);});});}exports[_0x9afd('0x1b')]=function(_0x4fa266){var _0x263ad6=this;return new Promise(function(_0x5aab9b,_0x441b55){return db['VoiceQueue'][_0x9afd('0x1c')]({'raw':_0x4fa266[_0x9afd('0x1d')]?_0x4fa266[_0x9afd('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x4fa266['options']?_0x4fa266['options'][_0x9afd('0x1e')]||null:null,'attributes':_0x4fa266[_0x9afd('0x1d')]?_0x4fa266[_0x9afd('0x1d')][_0x9afd('0x1f')]||null:null,'limit':_0x4fa266['options']?_0x4fa266[_0x9afd('0x1d')]['limit']||null:null,'include':_0x4fa266[_0x9afd('0x1d')]?_0x4fa266[_0x9afd('0x1d')][_0x9afd('0x20')]?_[_0x9afd('0x21')](_0x4fa266[_0x9afd('0x1d')][_0x9afd('0x20')],function(_0x1e806c){return{'model':db[_0x1e806c[_0x9afd('0x22')]],'as':_0x1e806c['as'],'attributes':_0x1e806c[_0x9afd('0x1f')],'include':_0x1e806c[_0x9afd('0x20')]?_[_0x9afd('0x21')](_0x1e806c[_0x9afd('0x20')],function(_0x356c30){return{'model':db[_0x356c30[_0x9afd('0x22')]],'as':_0x356c30['as'],'attributes':_0x356c30[_0x9afd('0x1f')],'include':_0x356c30['include']?_[_0x9afd('0x21')](_0x356c30[_0x9afd('0x20')],function(_0x3fcd03){return{'model':db[_0x3fcd03[_0x9afd('0x22')]],'as':_0x3fcd03['as'],'attributes':_0x3fcd03['attributes']};}):[]};}):[]};}):[]:[]})[_0x9afd('0x11')](function(_0xcdfef4){logger[_0x9afd('0x1a')]('GetVoiceQueue',_0x4fa266);logger['debug'](_0x9afd('0x1b'),_0x4fa266,JSON[_0x9afd('0x16')](_0xcdfef4));_0x5aab9b(_0xcdfef4);})[_0x9afd('0x23')](function(_0xb4aee6){logger['error'](_0x9afd('0x1b'),_0xb4aee6['message'],_0x4fa266);_0x441b55(_0x263ad6[_0x9afd('0x17')](0x1f4,_0xb4aee6[_0x9afd('0x19')]));});});};exports[_0x9afd('0x24')]=function(_0x11bbe6){var _0x4ceab7=this;return new Promise(function(_0x169e3d,_0x36c526){return db[_0x9afd('0x25')][_0x9afd('0x26')]({'raw':_0x11bbe6[_0x9afd('0x1d')]?_0x11bbe6[_0x9afd('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x11bbe6[_0x9afd('0x1d')]?_0x11bbe6[_0x9afd('0x1d')][_0x9afd('0x1e')]||null:null,'attributes':_0x11bbe6['options']?_0x11bbe6[_0x9afd('0x1d')][_0x9afd('0x1f')]||null:null,'include':_0x11bbe6[_0x9afd('0x1d')]?_0x11bbe6[_0x9afd('0x1d')][_0x9afd('0x20')]?_[_0x9afd('0x21')](_0x11bbe6[_0x9afd('0x1d')][_0x9afd('0x20')],function(_0xceb815){return{'model':db[_0xceb815[_0x9afd('0x22')]],'as':_0xceb815['as'],'attributes':_0xceb815[_0x9afd('0x1f')],'include':_0xceb815[_0x9afd('0x20')]?_[_0x9afd('0x21')](_0xceb815['include'],function(_0x49c996){return{'model':db[_0x49c996['model']],'as':_0x49c996['as'],'attributes':_0x49c996[_0x9afd('0x1f')],'include':_0x49c996[_0x9afd('0x20')]?_[_0x9afd('0x21')](_0x49c996[_0x9afd('0x20')],function(_0x2272dc){return{'model':db[_0x2272dc[_0x9afd('0x22')]],'as':_0x2272dc['as'],'attributes':_0x2272dc[_0x9afd('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x376637){logger[_0x9afd('0x1a')](_0x9afd('0x24'),_0x11bbe6);logger[_0x9afd('0x14')](_0x9afd('0x24'),_0x11bbe6,JSON[_0x9afd('0x16')](_0x376637));_0x169e3d(_0x376637);})[_0x9afd('0x23')](function(_0x2982e1){logger[_0x9afd('0x17')](_0x9afd('0x24'),_0x2982e1[_0x9afd('0x19')],_0x11bbe6);_0x36c526(_0x4ceab7[_0x9afd('0x17')](0x1f4,_0x2982e1[_0x9afd('0x19')]));});});};
\ No newline at end of file