Built motion from commit da617fac.|2.6.6
[motion2.git] / server / api / voiceExtension / voiceExtension.rpc.js
index 27dc092..d6ddd82 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x83dd=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./voiceExtension.socket','register','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','VoiceExtension','findAll','options','where','limit','include','map','attributes','model','then','GetVoiceExtension'];(function(_0x517be1,_0x354331){var _0x33e557=function(_0x12d741){while(--_0x12d741){_0x517be1['push'](_0x517be1['shift']());}};_0x33e557(++_0x354331);}(_0x83dd,0xa0));var _0xd83d=function(_0x35b873,_0x3659c2){_0x35b873=_0x35b873-0x0;var _0x35e12b=_0x83dd[_0x35b873];return _0x35e12b;};'use strict';var _=require(_0xd83d('0x0'));var util=require(_0xd83d('0x1'));var moment=require(_0xd83d('0x2'));var BPromise=require(_0xd83d('0x3'));var rs=require(_0xd83d('0x4'));var fs=require('fs');var Redis=require(_0xd83d('0x5'));var db=require(_0xd83d('0x6'))['db'];var utils=require(_0xd83d('0x7'));var logger=require(_0xd83d('0x8'))(_0xd83d('0x9'));var config=require('../../config/environment');var jayson=require(_0xd83d('0xa'));var client=jayson[_0xd83d('0xb')][_0xd83d('0xc')]({'port':0x232a});config['redis']=_[_0xd83d('0xd')](config['redis'],{'host':_0xd83d('0xe'),'port':0x18eb});var socket=require(_0xd83d('0xf'))(new Redis(config[_0xd83d('0x10')]));require(_0xd83d('0x11'))[_0xd83d('0x12')](socket);function respondWithRpcPromise(_0x46577d,_0x72a688,_0x23f4eb){return new BPromise(function(_0x129383,_0x5bf63c){return client['request'](_0x46577d,_0x23f4eb)['then'](function(_0x5b8710){logger[_0xd83d('0x13')](_0xd83d('0x14'),_0x72a688,_0xd83d('0x15'));logger[_0xd83d('0x16')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x72a688,_0xd83d('0x15'),JSON[_0xd83d('0x17')](_0x5b8710));if(_0x5b8710['error']){if(_0x5b8710[_0xd83d('0x18')][_0xd83d('0x19')]===0x1f4){logger[_0xd83d('0x18')](_0xd83d('0x14'),_0x72a688,_0x5b8710[_0xd83d('0x18')][_0xd83d('0x1a')]);return _0x5bf63c(_0x5b8710['error'][_0xd83d('0x1a')]);}logger[_0xd83d('0x18')]('VoiceExtension,\x20%s,\x20%s',_0x72a688,_0x5b8710['error'][_0xd83d('0x1a')]);return _0x129383(_0x5b8710[_0xd83d('0x18')][_0xd83d('0x1a')]);}else{logger[_0xd83d('0x13')](_0xd83d('0x14'),_0x72a688,_0xd83d('0x15'));_0x129383(_0x5b8710[_0xd83d('0x1b')][_0xd83d('0x1a')]);}})[_0xd83d('0x1c')](function(_0x32acfa){logger[_0xd83d('0x18')](_0xd83d('0x14'),_0x72a688,_0x32acfa);_0x5bf63c(_0x32acfa);});});}exports['GetVoiceExtension']=function(_0x4f632b){var _0x32ce69=this;return new Promise(function(_0x3527d8,_0x29e13b){return db[_0xd83d('0x1d')][_0xd83d('0x1e')]({'raw':_0x4f632b[_0xd83d('0x1f')]?_0x4f632b[_0xd83d('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x4f632b[_0xd83d('0x1f')]?_0x4f632b[_0xd83d('0x1f')][_0xd83d('0x20')]||null:null,'attributes':_0x4f632b['options']?_0x4f632b['options']['attributes']||null:null,'limit':_0x4f632b['options']?_0x4f632b['options'][_0xd83d('0x21')]||null:null,'include':_0x4f632b['options']?_0x4f632b['options'][_0xd83d('0x22')]?_[_0xd83d('0x23')](_0x4f632b[_0xd83d('0x1f')][_0xd83d('0x22')],function(_0x236456){return{'model':db[_0x236456['model']],'as':_0x236456['as'],'attributes':_0x236456[_0xd83d('0x24')],'include':_0x236456[_0xd83d('0x22')]?_[_0xd83d('0x23')](_0x236456[_0xd83d('0x22')],function(_0x2b5227){return{'model':db[_0x2b5227[_0xd83d('0x25')]],'as':_0x2b5227['as'],'attributes':_0x2b5227[_0xd83d('0x24')],'include':_0x2b5227[_0xd83d('0x22')]?_[_0xd83d('0x23')](_0x2b5227[_0xd83d('0x22')],function(_0x15cc4e){return{'model':db[_0x15cc4e[_0xd83d('0x25')]],'as':_0x15cc4e['as'],'attributes':_0x15cc4e[_0xd83d('0x24')]};}):[]};}):[]};}):[]:[]})[_0xd83d('0x26')](function(_0x100e76){logger['info']('GetVoiceExtension',_0x4f632b);logger[_0xd83d('0x16')](_0xd83d('0x27'),_0x4f632b,JSON[_0xd83d('0x17')](_0x100e76));_0x3527d8(_0x100e76);})[_0xd83d('0x1c')](function(_0x48699b){logger[_0xd83d('0x18')](_0xd83d('0x27'),_0x48699b['message'],_0x4f632b);_0x29e13b(_0x32ce69['error'](0x1f4,_0x48699b[_0xd83d('0x1a')]));});});};
\ No newline at end of file
+var _0xafb9=['../../config/utils','../../config/logger','jayson/promise','http','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetVoiceExtension','findAll','raw','options','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x197185,_0x251145){var _0x2c8af1=function(_0x1dbcfd){while(--_0x1dbcfd){_0x197185['push'](_0x197185['shift']());}};_0x2c8af1(++_0x251145);}(_0xafb9,0x68));var _0x9afb=function(_0x2819c5,_0x1b3d18){_0x2819c5=_0x2819c5-0x0;var _0x101dea=_0xafb9[_0x2819c5];return _0x101dea;};'use strict';var _=require(_0x9afb('0x0'));var util=require(_0x9afb('0x1'));var moment=require(_0x9afb('0x2'));var BPromise=require(_0x9afb('0x3'));var rs=require(_0x9afb('0x4'));var fs=require('fs');var Redis=require(_0x9afb('0x5'));var db=require(_0x9afb('0x6'))['db'];var utils=require(_0x9afb('0x7'));var logger=require(_0x9afb('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9afb('0x9'));var client=jayson['client'][_0x9afb('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x9afb('0xb')],{'host':_0x9afb('0xc'),'port':0x18eb});var socket=require(_0x9afb('0xd'))(new Redis(config['redis']));require(_0x9afb('0xe'))[_0x9afb('0xf')](socket);function respondWithRpcPromise(_0x2aaefe,_0x27fa71,_0x1e5325){return new BPromise(function(_0x56f477,_0x5bb974){return client[_0x9afb('0x10')](_0x2aaefe,_0x1e5325)[_0x9afb('0x11')](function(_0x3e6a29){logger[_0x9afb('0x12')](_0x9afb('0x13'),_0x27fa71,_0x9afb('0x14'));logger[_0x9afb('0x15')](_0x9afb('0x16'),_0x27fa71,_0x9afb('0x14'),JSON[_0x9afb('0x17')](_0x3e6a29));if(_0x3e6a29['error']){if(_0x3e6a29[_0x9afb('0x18')]['code']===0x1f4){logger['error'](_0x9afb('0x13'),_0x27fa71,_0x3e6a29[_0x9afb('0x18')][_0x9afb('0x19')]);return _0x5bb974(_0x3e6a29[_0x9afb('0x18')][_0x9afb('0x19')]);}logger[_0x9afb('0x18')](_0x9afb('0x13'),_0x27fa71,_0x3e6a29['error'][_0x9afb('0x19')]);return _0x56f477(_0x3e6a29[_0x9afb('0x18')][_0x9afb('0x19')]);}else{logger[_0x9afb('0x12')](_0x9afb('0x13'),_0x27fa71,'request\x20sent');_0x56f477(_0x3e6a29[_0x9afb('0x1a')]['message']);}})[_0x9afb('0x1b')](function(_0x12aa19){logger['error']('VoiceExtension,\x20%s,\x20%s',_0x27fa71,_0x12aa19);_0x5bb974(_0x12aa19);});});}exports[_0x9afb('0x1c')]=function(_0x1217d9){var _0x3d8450=this;return new Promise(function(_0x424692,_0x3bd256){return db['VoiceExtension'][_0x9afb('0x1d')]({'raw':_0x1217d9['options']?_0x1217d9['options'][_0x9afb('0x1e')]===undefined?!![]:![]:!![],'where':_0x1217d9[_0x9afb('0x1f')]?_0x1217d9[_0x9afb('0x1f')][_0x9afb('0x20')]||null:null,'attributes':_0x1217d9['options']?_0x1217d9[_0x9afb('0x1f')][_0x9afb('0x21')]||null:null,'limit':_0x1217d9['options']?_0x1217d9['options']['limit']||null:null,'include':_0x1217d9[_0x9afb('0x1f')]?_0x1217d9['options'][_0x9afb('0x22')]?_[_0x9afb('0x23')](_0x1217d9['options'][_0x9afb('0x22')],function(_0x28beba){return{'model':db[_0x28beba[_0x9afb('0x24')]],'as':_0x28beba['as'],'attributes':_0x28beba[_0x9afb('0x21')],'include':_0x28beba['include']?_[_0x9afb('0x23')](_0x28beba['include'],function(_0x29e092){return{'model':db[_0x29e092['model']],'as':_0x29e092['as'],'attributes':_0x29e092['attributes'],'include':_0x29e092[_0x9afb('0x22')]?_[_0x9afb('0x23')](_0x29e092[_0x9afb('0x22')],function(_0x13a33e){return{'model':db[_0x13a33e[_0x9afb('0x24')]],'as':_0x13a33e['as'],'attributes':_0x13a33e[_0x9afb('0x21')]};}):[]};}):[]};}):[]:[]})[_0x9afb('0x11')](function(_0x5aabd5){logger['info'](_0x9afb('0x1c'),_0x1217d9);logger[_0x9afb('0x15')]('GetVoiceExtension',_0x1217d9,JSON[_0x9afb('0x17')](_0x5aabd5));_0x424692(_0x5aabd5);})[_0x9afb('0x1b')](function(_0x5560bd){logger[_0x9afb('0x18')](_0x9afb('0x1c'),_0x5560bd[_0x9afb('0x19')],_0x1217d9);_0x3bd256(_0x3d8450[_0x9afb('0x18')](0x1f4,_0x5560bd[_0x9afb('0x19')]));});});};
\ No newline at end of file