Built motion from commit 753c950e.|2.5.42
[motion2.git] / server / api / voiceExtension / voiceExtension.rpc.js
index d8f2653..17e26b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8458=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','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','code','message','result','GetVoiceExtension','options','attributes','include','map','model'];(function(_0x5748c6,_0x555ade){var _0x3215b5=function(_0x26bad6){while(--_0x26bad6){_0x5748c6['push'](_0x5748c6['shift']());}};_0x3215b5(++_0x555ade);}(_0x8458,0x1a5));var _0x8845=function(_0x561a44,_0x4db061){_0x561a44=_0x561a44-0x0;var _0x57d714=_0x8458[_0x561a44];return _0x57d714;};'use strict';var _=require(_0x8845('0x0'));var util=require('util');var moment=require(_0x8845('0x1'));var BPromise=require(_0x8845('0x2'));var rs=require(_0x8845('0x3'));var fs=require('fs');var Redis=require(_0x8845('0x4'));var db=require(_0x8845('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8845('0x6'))(_0x8845('0x7'));var config=require(_0x8845('0x8'));var jayson=require(_0x8845('0x9'));var client=jayson[_0x8845('0xa')]['http']({'port':0x232a});config[_0x8845('0xb')]=_['defaults'](config[_0x8845('0xb')],{'host':_0x8845('0xc'),'port':0x18eb});var socket=require(_0x8845('0xd'))(new Redis(config['redis']));require(_0x8845('0xe'))[_0x8845('0xf')](socket);function respondWithRpcPromise(_0x59cd0b,_0x33d23e,_0xd846f1){return new BPromise(function(_0x55703d,_0x3b9c78){return client[_0x8845('0x10')](_0x59cd0b,_0xd846f1)[_0x8845('0x11')](function(_0x1f1027){logger[_0x8845('0x12')](_0x8845('0x13'),_0x33d23e,_0x8845('0x14'));logger[_0x8845('0x15')](_0x8845('0x16'),_0x33d23e,_0x8845('0x14'),JSON[_0x8845('0x17')](_0x1f1027));if(_0x1f1027[_0x8845('0x18')]){if(_0x1f1027[_0x8845('0x18')][_0x8845('0x19')]===0x1f4){logger['error'](_0x8845('0x13'),_0x33d23e,_0x1f1027[_0x8845('0x18')]['message']);return _0x3b9c78(_0x1f1027[_0x8845('0x18')][_0x8845('0x1a')]);}logger[_0x8845('0x18')]('VoiceExtension,\x20%s,\x20%s',_0x33d23e,_0x1f1027['error']['message']);return _0x55703d(_0x1f1027[_0x8845('0x18')][_0x8845('0x1a')]);}else{logger[_0x8845('0x12')](_0x8845('0x13'),_0x33d23e,_0x8845('0x14'));_0x55703d(_0x1f1027[_0x8845('0x1b')][_0x8845('0x1a')]);}})['catch'](function(_0x4e6a6f){logger['error'](_0x8845('0x13'),_0x33d23e,_0x4e6a6f);_0x3b9c78(_0x4e6a6f);});});}exports[_0x8845('0x1c')]=function(_0x122c92){var _0x380010=this;return new Promise(function(_0x49ec66,_0x2e94f5){return db['VoiceExtension']['findAll']({'raw':_0x122c92[_0x8845('0x1d')]?_0x122c92[_0x8845('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x122c92[_0x8845('0x1d')]?_0x122c92[_0x8845('0x1d')]['where']||null:null,'attributes':_0x122c92[_0x8845('0x1d')]?_0x122c92[_0x8845('0x1d')][_0x8845('0x1e')]||null:null,'limit':_0x122c92[_0x8845('0x1d')]?_0x122c92['options']['limit']||null:null,'include':_0x122c92[_0x8845('0x1d')]?_0x122c92[_0x8845('0x1d')][_0x8845('0x1f')]?_[_0x8845('0x20')](_0x122c92[_0x8845('0x1d')][_0x8845('0x1f')],function(_0x37eea4){return{'model':db[_0x37eea4[_0x8845('0x21')]],'as':_0x37eea4['as'],'attributes':_0x37eea4[_0x8845('0x1e')],'include':_0x37eea4[_0x8845('0x1f')]?_[_0x8845('0x20')](_0x37eea4[_0x8845('0x1f')],function(_0x3d8c5d){return{'model':db[_0x3d8c5d[_0x8845('0x21')]],'as':_0x3d8c5d['as'],'attributes':_0x3d8c5d[_0x8845('0x1e')],'include':_0x3d8c5d[_0x8845('0x1f')]?_[_0x8845('0x20')](_0x3d8c5d['include'],function(_0x47dfff){return{'model':db[_0x47dfff[_0x8845('0x21')]],'as':_0x47dfff['as'],'attributes':_0x47dfff[_0x8845('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x8845('0x11')](function(_0x3cc594){logger[_0x8845('0x12')](_0x8845('0x1c'),_0x122c92);logger[_0x8845('0x15')]('GetVoiceExtension',_0x122c92,JSON[_0x8845('0x17')](_0x3cc594));_0x49ec66(_0x3cc594);})[_0x8845('0x22')](function(_0x501362){logger[_0x8845('0x18')](_0x8845('0x1c'),_0x501362[_0x8845('0x1a')],_0x122c92);_0x2e94f5(_0x380010[_0x8845('0x18')](0x1f4,_0x501362[_0x8845('0x1a')]));});});};
\ No newline at end of file
+var _0xc01b=['util','moment','bluebird','ioredis','../../mysqldb','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVoiceExtension','options','raw','where','attributes','include','model','map','stringify','lodash'];(function(_0x462c8f,_0x5817e3){var _0x45f8c1=function(_0x1b0abb){while(--_0x1b0abb){_0x462c8f['push'](_0x462c8f['shift']());}};_0x45f8c1(++_0x5817e3);}(_0xc01b,0x65));var _0xbc01=function(_0x4089c5,_0x2bf8b1){_0x4089c5=_0x4089c5-0x0;var _0x9ae197=_0xc01b[_0x4089c5];return _0x9ae197;};'use strict';var _=require(_0xbc01('0x0'));var util=require(_0xbc01('0x1'));var moment=require(_0xbc01('0x2'));var BPromise=require(_0xbc01('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbc01('0x4'));var db=require(_0xbc01('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xbc01('0x6'));var jayson=require(_0xbc01('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0xbc01('0x8')]=_[_0xbc01('0x9')](config[_0xbc01('0x8')],{'host':_0xbc01('0xa'),'port':0x18eb});var socket=require(_0xbc01('0xb'))(new Redis(config[_0xbc01('0x8')]));require(_0xbc01('0xc'))['register'](socket);function respondWithRpcPromise(_0x46f01c,_0x3cc11e,_0x3b7f4d){return new BPromise(function(_0x1d84e8,_0xa0d0b1){return client[_0xbc01('0xd')](_0x46f01c,_0x3b7f4d)[_0xbc01('0xe')](function(_0x28067a){logger[_0xbc01('0xf')](_0xbc01('0x10'),_0x3cc11e,_0xbc01('0x11'));logger[_0xbc01('0x12')](_0xbc01('0x13'),_0x3cc11e,_0xbc01('0x11'),JSON['stringify'](_0x28067a));if(_0x28067a[_0xbc01('0x14')]){if(_0x28067a[_0xbc01('0x14')][_0xbc01('0x15')]===0x1f4){logger['error'](_0xbc01('0x10'),_0x3cc11e,_0x28067a[_0xbc01('0x14')]['message']);return _0xa0d0b1(_0x28067a[_0xbc01('0x14')][_0xbc01('0x16')]);}logger[_0xbc01('0x14')](_0xbc01('0x10'),_0x3cc11e,_0x28067a['error']['message']);return _0x1d84e8(_0x28067a[_0xbc01('0x14')][_0xbc01('0x16')]);}else{logger['info'](_0xbc01('0x10'),_0x3cc11e,'request\x20sent');_0x1d84e8(_0x28067a[_0xbc01('0x17')][_0xbc01('0x16')]);}})[_0xbc01('0x18')](function(_0x1e79d0){logger['error'](_0xbc01('0x10'),_0x3cc11e,_0x1e79d0);_0xa0d0b1(_0x1e79d0);});});}exports[_0xbc01('0x19')]=function(_0x40162b){var _0x4a579c=this;return new Promise(function(_0x364c87,_0x121670){return db['VoiceExtension']['findAll']({'raw':_0x40162b['options']?_0x40162b[_0xbc01('0x1a')][_0xbc01('0x1b')]===undefined?!![]:![]:!![],'where':_0x40162b[_0xbc01('0x1a')]?_0x40162b[_0xbc01('0x1a')][_0xbc01('0x1c')]||null:null,'attributes':_0x40162b[_0xbc01('0x1a')]?_0x40162b['options'][_0xbc01('0x1d')]||null:null,'limit':_0x40162b['options']?_0x40162b[_0xbc01('0x1a')]['limit']||null:null,'include':_0x40162b[_0xbc01('0x1a')]?_0x40162b[_0xbc01('0x1a')][_0xbc01('0x1e')]?_['map'](_0x40162b[_0xbc01('0x1a')][_0xbc01('0x1e')],function(_0x56383f){return{'model':db[_0x56383f[_0xbc01('0x1f')]],'as':_0x56383f['as'],'attributes':_0x56383f[_0xbc01('0x1d')],'include':_0x56383f[_0xbc01('0x1e')]?_[_0xbc01('0x20')](_0x56383f[_0xbc01('0x1e')],function(_0x2ca748){return{'model':db[_0x2ca748[_0xbc01('0x1f')]],'as':_0x2ca748['as'],'attributes':_0x2ca748[_0xbc01('0x1d')],'include':_0x2ca748[_0xbc01('0x1e')]?_[_0xbc01('0x20')](_0x2ca748[_0xbc01('0x1e')],function(_0x5778d7){return{'model':db[_0x5778d7[_0xbc01('0x1f')]],'as':_0x5778d7['as'],'attributes':_0x5778d7[_0xbc01('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xbc01('0xe')](function(_0xc51dea){logger[_0xbc01('0xf')](_0xbc01('0x19'),_0x40162b);logger[_0xbc01('0x12')]('GetVoiceExtension',_0x40162b,JSON[_0xbc01('0x21')](_0xc51dea));_0x364c87(_0xc51dea);})['catch'](function(_0x11e8b9){logger[_0xbc01('0x14')]('GetVoiceExtension',_0x11e8b9[_0xbc01('0x16')],_0x40162b);_0x121670(_0x4a579c[_0xbc01('0x14')](0x1f4,_0x11e8b9['message']));});});};
\ No newline at end of file