Built motion from commit da617fac.|2.6.6
[motion2.git] / server / api / voiceExtension / voiceExtension.rpc.js
index adeceb2..d6ddd82 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f6b=['then','info','VoiceExtension,\x20%s,\x20%s','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch','GetVoiceExtension','VoiceExtension','options','raw','where','limit','include','map','model','attributes','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','redis','localhost','./voiceExtension.socket','register','request'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0x8f6b,0x146));var _0xb8f6=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0x8f6b[_0x3635ce];return _0x97ecd0;};'use strict';var _=require(_0xb8f6('0x0'));var util=require(_0xb8f6('0x1'));var moment=require(_0xb8f6('0x2'));var BPromise=require('bluebird');var rs=require(_0xb8f6('0x3'));var fs=require('fs');var Redis=require(_0xb8f6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb8f6('0x5'));var logger=require(_0xb8f6('0x6'))('rpc');var config=require(_0xb8f6('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb8f6('0x8')]['http']({'port':0x232a});config[_0xb8f6('0x9')]=_['defaults'](config[_0xb8f6('0x9')],{'host':_0xb8f6('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb8f6('0xb'))[_0xb8f6('0xc')](socket);function respondWithRpcPromise(_0x14cc71,_0x379ed5,_0x165d17){return new BPromise(function(_0x3f8e2a,_0x210f71){return client[_0xb8f6('0xd')](_0x14cc71,_0x165d17)[_0xb8f6('0xe')](function(_0x2ef5c1){logger[_0xb8f6('0xf')](_0xb8f6('0x10'),_0x379ed5,'request\x20sent');logger[_0xb8f6('0x11')](_0xb8f6('0x12'),_0x379ed5,'request\x20sent',JSON[_0xb8f6('0x13')](_0x2ef5c1));if(_0x2ef5c1[_0xb8f6('0x14')]){if(_0x2ef5c1[_0xb8f6('0x14')]['code']===0x1f4){logger[_0xb8f6('0x14')]('VoiceExtension,\x20%s,\x20%s',_0x379ed5,_0x2ef5c1[_0xb8f6('0x14')][_0xb8f6('0x15')]);return _0x210f71(_0x2ef5c1['error']['message']);}logger[_0xb8f6('0x14')](_0xb8f6('0x10'),_0x379ed5,_0x2ef5c1[_0xb8f6('0x14')][_0xb8f6('0x15')]);return _0x3f8e2a(_0x2ef5c1[_0xb8f6('0x14')][_0xb8f6('0x15')]);}else{logger[_0xb8f6('0xf')](_0xb8f6('0x10'),_0x379ed5,_0xb8f6('0x16'));_0x3f8e2a(_0x2ef5c1['result']['message']);}})[_0xb8f6('0x17')](function(_0x4566c5){logger[_0xb8f6('0x14')](_0xb8f6('0x10'),_0x379ed5,_0x4566c5);_0x210f71(_0x4566c5);});});}exports[_0xb8f6('0x18')]=function(_0x5c2506){var _0x113cf8=this;return new Promise(function(_0x13f964,_0x44e6a8){return db[_0xb8f6('0x19')]['findAll']({'raw':_0x5c2506[_0xb8f6('0x1a')]?_0x5c2506[_0xb8f6('0x1a')][_0xb8f6('0x1b')]===undefined?!![]:![]:!![],'where':_0x5c2506[_0xb8f6('0x1a')]?_0x5c2506[_0xb8f6('0x1a')][_0xb8f6('0x1c')]||null:null,'attributes':_0x5c2506[_0xb8f6('0x1a')]?_0x5c2506[_0xb8f6('0x1a')]['attributes']||null:null,'limit':_0x5c2506[_0xb8f6('0x1a')]?_0x5c2506[_0xb8f6('0x1a')][_0xb8f6('0x1d')]||null:null,'include':_0x5c2506[_0xb8f6('0x1a')]?_0x5c2506['options'][_0xb8f6('0x1e')]?_[_0xb8f6('0x1f')](_0x5c2506['options'][_0xb8f6('0x1e')],function(_0x4ee750){return{'model':db[_0x4ee750[_0xb8f6('0x20')]],'as':_0x4ee750['as'],'attributes':_0x4ee750[_0xb8f6('0x21')],'include':_0x4ee750[_0xb8f6('0x1e')]?_[_0xb8f6('0x1f')](_0x4ee750['include'],function(_0x36ad7a){return{'model':db[_0x36ad7a[_0xb8f6('0x20')]],'as':_0x36ad7a['as'],'attributes':_0x36ad7a[_0xb8f6('0x21')],'include':_0x36ad7a['include']?_[_0xb8f6('0x1f')](_0x36ad7a[_0xb8f6('0x1e')],function(_0x2c47e7){return{'model':db[_0x2c47e7[_0xb8f6('0x20')]],'as':_0x2c47e7['as'],'attributes':_0x2c47e7[_0xb8f6('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5d2895){logger[_0xb8f6('0xf')]('GetVoiceExtension',_0x5c2506);logger[_0xb8f6('0x11')]('GetVoiceExtension',_0x5c2506,JSON[_0xb8f6('0x13')](_0x5d2895));_0x13f964(_0x5d2895);})[_0xb8f6('0x17')](function(_0xb1f317){logger[_0xb8f6('0x14')](_0xb8f6('0x18'),_0xb1f317[_0xb8f6('0x15')],_0x5c2506);_0x44e6a8(_0x113cf8[_0xb8f6('0x14')](0x1f4,_0xb1f317[_0xb8f6('0x15')]));});});};
\ 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