Built motion from commit 953226e6.|2.6.32
[motion2.git] / server / api / voiceExtension / voiceExtension.rpc.js
index cea44b3..57e2b25 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x16a6=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','socket.io-emitter','./voiceExtension.socket','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetVoiceExtension','options','attributes','limit','include','model','map','lodash','util','bluebird','randomstring'];(function(_0x43c970,_0x2540cb){var _0x1ca73a=function(_0x1b87c0){while(--_0x1b87c0){_0x43c970['push'](_0x43c970['shift']());}};_0x1ca73a(++_0x2540cb);}(_0x16a6,0x15c));var _0x616a=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x16a6[_0x2dadb9];return _0x2f0097;};'use strict';var _=require(_0x616a('0x0'));var util=require(_0x616a('0x1'));var moment=require('moment');var BPromise=require(_0x616a('0x2'));var rs=require(_0x616a('0x3'));var fs=require('fs');var Redis=require(_0x616a('0x4'));var db=require(_0x616a('0x5'))['db'];var utils=require(_0x616a('0x6'));var logger=require(_0x616a('0x7'))('rpc');var config=require(_0x616a('0x8'));var jayson=require(_0x616a('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x616a('0xa')]=_[_0x616a('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x616a('0xc'))(new Redis(config['redis']));require(_0x616a('0xd'))['register'](socket);function respondWithRpcPromise(_0x3256a1,_0x235970,_0x2a4984){return new BPromise(function(_0x57d339,_0x1ab052){return client[_0x616a('0xe')](_0x3256a1,_0x2a4984)[_0x616a('0xf')](function(_0x47674e){logger[_0x616a('0x10')](_0x616a('0x11'),_0x235970,_0x616a('0x12'));logger[_0x616a('0x13')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x235970,_0x616a('0x12'),JSON[_0x616a('0x14')](_0x47674e));if(_0x47674e[_0x616a('0x15')]){if(_0x47674e[_0x616a('0x15')][_0x616a('0x16')]===0x1f4){logger['error'](_0x616a('0x11'),_0x235970,_0x47674e[_0x616a('0x15')][_0x616a('0x17')]);return _0x1ab052(_0x47674e[_0x616a('0x15')][_0x616a('0x17')]);}logger['error'](_0x616a('0x11'),_0x235970,_0x47674e[_0x616a('0x15')]['message']);return _0x57d339(_0x47674e['error'][_0x616a('0x17')]);}else{logger[_0x616a('0x10')](_0x616a('0x11'),_0x235970,'request\x20sent');_0x57d339(_0x47674e[_0x616a('0x18')][_0x616a('0x17')]);}})['catch'](function(_0x535d2b){logger[_0x616a('0x15')](_0x616a('0x11'),_0x235970,_0x535d2b);_0x1ab052(_0x535d2b);});});}exports[_0x616a('0x19')]=function(_0x31b711){var _0x505b9f=this;return new Promise(function(_0x499132,_0x5568fd){return db['VoiceExtension']['findAll']({'raw':_0x31b711['options']?_0x31b711[_0x616a('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x31b711[_0x616a('0x1a')]?_0x31b711[_0x616a('0x1a')]['where']||null:null,'attributes':_0x31b711[_0x616a('0x1a')]?_0x31b711[_0x616a('0x1a')][_0x616a('0x1b')]||null:null,'limit':_0x31b711[_0x616a('0x1a')]?_0x31b711['options'][_0x616a('0x1c')]||null:null,'include':_0x31b711[_0x616a('0x1a')]?_0x31b711[_0x616a('0x1a')][_0x616a('0x1d')]?_['map'](_0x31b711[_0x616a('0x1a')]['include'],function(_0x30c1a){return{'model':db[_0x30c1a[_0x616a('0x1e')]],'as':_0x30c1a['as'],'attributes':_0x30c1a['attributes'],'include':_0x30c1a['include']?_['map'](_0x30c1a[_0x616a('0x1d')],function(_0x7ebd63){return{'model':db[_0x7ebd63[_0x616a('0x1e')]],'as':_0x7ebd63['as'],'attributes':_0x7ebd63[_0x616a('0x1b')],'include':_0x7ebd63['include']?_[_0x616a('0x1f')](_0x7ebd63[_0x616a('0x1d')],function(_0x195b73){return{'model':db[_0x195b73[_0x616a('0x1e')]],'as':_0x195b73['as'],'attributes':_0x195b73[_0x616a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x616a('0xf')](function(_0x41a22d){logger['info'](_0x616a('0x19'),_0x31b711);logger[_0x616a('0x13')]('GetVoiceExtension',_0x31b711,JSON[_0x616a('0x14')](_0x41a22d));_0x499132(_0x41a22d);})['catch'](function(_0x5f00d0){logger[_0x616a('0x15')](_0x616a('0x19'),_0x5f00d0[_0x616a('0x17')],_0x31b711);_0x5568fd(_0x505b9f['error'](0x1f4,_0x5f00d0[_0x616a('0x17')]));});});};
\ No newline at end of file
+var _0x8bc3=['redis','defaults','./voiceExtension.socket','register','request','then','debug','error','code','message','VoiceExtension,\x20%s,\x20%s','request\x20sent','result','catch','VoiceExtension','findAll','options','where','limit','include','map','model','attributes','info','GetVoiceExtension','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8bc3,0x82));var _0x38bc=function(_0x27b08a,_0x5166cd){_0x27b08a=_0x27b08a-0x0;var _0x1af9b9=_0x8bc3[_0x27b08a];return _0x1af9b9;};'use strict';var _=require(_0x38bc('0x0'));var util=require('util');var moment=require(_0x38bc('0x1'));var BPromise=require('bluebird');var rs=require(_0x38bc('0x2'));var fs=require('fs');var Redis=require(_0x38bc('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x38bc('0x4'));var logger=require(_0x38bc('0x5'))(_0x38bc('0x6'));var config=require(_0x38bc('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x38bc('0x8')][_0x38bc('0x9')]({'port':0x232a});config[_0x38bc('0xa')]=_[_0x38bc('0xb')](config[_0x38bc('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x38bc('0xa')]));require(_0x38bc('0xc'))[_0x38bc('0xd')](socket);function respondWithRpcPromise(_0x35ca89,_0x4b592a,_0x31ae45){return new BPromise(function(_0x122a46,_0x877def){return client[_0x38bc('0xe')](_0x35ca89,_0x31ae45)[_0x38bc('0xf')](function(_0x52abe8){logger['info']('VoiceExtension,\x20%s,\x20%s',_0x4b592a,'request\x20sent');logger[_0x38bc('0x10')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x4b592a,'request\x20sent',JSON['stringify'](_0x52abe8));if(_0x52abe8['error']){if(_0x52abe8[_0x38bc('0x11')][_0x38bc('0x12')]===0x1f4){logger[_0x38bc('0x11')]('VoiceExtension,\x20%s,\x20%s',_0x4b592a,_0x52abe8[_0x38bc('0x11')][_0x38bc('0x13')]);return _0x877def(_0x52abe8[_0x38bc('0x11')][_0x38bc('0x13')]);}logger[_0x38bc('0x11')](_0x38bc('0x14'),_0x4b592a,_0x52abe8[_0x38bc('0x11')][_0x38bc('0x13')]);return _0x122a46(_0x52abe8['error'][_0x38bc('0x13')]);}else{logger['info'](_0x38bc('0x14'),_0x4b592a,_0x38bc('0x15'));_0x122a46(_0x52abe8[_0x38bc('0x16')][_0x38bc('0x13')]);}})[_0x38bc('0x17')](function(_0x405366){logger['error'](_0x38bc('0x14'),_0x4b592a,_0x405366);_0x877def(_0x405366);});});}exports['GetVoiceExtension']=function(_0x5608be){var _0x465d0a=this;return new Promise(function(_0x2c54ac,_0x325b14){return db[_0x38bc('0x18')][_0x38bc('0x19')]({'raw':_0x5608be[_0x38bc('0x1a')]?_0x5608be[_0x38bc('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x5608be['options']?_0x5608be[_0x38bc('0x1a')][_0x38bc('0x1b')]||null:null,'attributes':_0x5608be['options']?_0x5608be[_0x38bc('0x1a')]['attributes']||null:null,'limit':_0x5608be[_0x38bc('0x1a')]?_0x5608be[_0x38bc('0x1a')][_0x38bc('0x1c')]||null:null,'include':_0x5608be['options']?_0x5608be[_0x38bc('0x1a')][_0x38bc('0x1d')]?_[_0x38bc('0x1e')](_0x5608be['options'][_0x38bc('0x1d')],function(_0x3daed5){return{'model':db[_0x3daed5[_0x38bc('0x1f')]],'as':_0x3daed5['as'],'attributes':_0x3daed5[_0x38bc('0x20')],'include':_0x3daed5['include']?_['map'](_0x3daed5[_0x38bc('0x1d')],function(_0x114cc8){return{'model':db[_0x114cc8[_0x38bc('0x1f')]],'as':_0x114cc8['as'],'attributes':_0x114cc8[_0x38bc('0x20')],'include':_0x114cc8['include']?_['map'](_0x114cc8['include'],function(_0x456a78){return{'model':db[_0x456a78[_0x38bc('0x1f')]],'as':_0x456a78['as'],'attributes':_0x456a78[_0x38bc('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x33f6cf){logger[_0x38bc('0x21')]('GetVoiceExtension',_0x5608be);logger['debug'](_0x38bc('0x22'),_0x5608be,JSON['stringify'](_0x33f6cf));_0x2c54ac(_0x33f6cf);})['catch'](function(_0x3d224c){logger[_0x38bc('0x11')](_0x38bc('0x22'),_0x3d224c[_0x38bc('0x13')],_0x5608be);_0x325b14(_0x465d0a[_0x38bc('0x11')](0x1f4,_0x3d224c['message']));});});};
\ No newline at end of file