Built motion from commit (unavailable).|2.4.5
[motion2.git] / server / api / voiceExtension / voiceExtension.rpc.js
index 95bec31..53cf478 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['raw','where','limit','include','map','attributes','model','debug','GetVoiceExtension','stringify','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','error','message','result','catch','VoiceExtension','options'];(function(_0x51d74a,_0x43ecaa){var _0x47221c=function(_0x3b360f){while(--_0x3b360f){_0x51d74a['push'](_0x51d74a['shift']());}};_0x47221c(++_0x43ecaa);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});config[_0x3071('0xb')]=_[_0x3071('0xc')](config[_0x3071('0xb')],{'host':_0x3071('0xd'),'port':0x18eb});var socket=require(_0x3071('0xe'))(new Redis(config[_0x3071('0xb')]));require(_0x3071('0xf'))['register'](socket);function respondWithRpcPromise(_0x3457cd,_0x2610b4,_0x937259){return new BPromise(function(_0xff9a29,_0x1ce844){return client['request'](_0x3457cd,_0x937259)[_0x3071('0x10')](function(_0x11a7ee){logger[_0x3071('0x11')](_0x3071('0x12'),_0x2610b4,_0x3071('0x13'));logger['debug']('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x2610b4,_0x3071('0x13'),JSON['stringify'](_0x11a7ee));if(_0x11a7ee[_0x3071('0x14')]){if(_0x11a7ee[_0x3071('0x14')]['code']===0x1f4){logger[_0x3071('0x14')]('VoiceExtension,\x20%s,\x20%s',_0x2610b4,_0x11a7ee[_0x3071('0x14')][_0x3071('0x15')]);return _0x1ce844(_0x11a7ee[_0x3071('0x14')][_0x3071('0x15')]);}logger[_0x3071('0x14')](_0x3071('0x12'),_0x2610b4,_0x11a7ee[_0x3071('0x14')][_0x3071('0x15')]);return _0xff9a29(_0x11a7ee[_0x3071('0x14')][_0x3071('0x15')]);}else{logger['info'](_0x3071('0x12'),_0x2610b4,_0x3071('0x13'));_0xff9a29(_0x11a7ee[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x17aee2){logger[_0x3071('0x14')](_0x3071('0x12'),_0x2610b4,_0x17aee2);_0x1ce844(_0x17aee2);});});}exports['GetVoiceExtension']=function(_0x359e66){var _0x2bfa33=this;return new Promise(function(_0xd3e23d,_0x56c267){return db[_0x3071('0x18')]['findAll']({'raw':_0x359e66[_0x3071('0x19')]?_0x359e66[_0x3071('0x19')][_0x3071('0x1a')]===undefined?!![]:![]:!![],'where':_0x359e66[_0x3071('0x19')]?_0x359e66[_0x3071('0x19')][_0x3071('0x1b')]||null:null,'attributes':_0x359e66[_0x3071('0x19')]?_0x359e66[_0x3071('0x19')]['attributes']||null:null,'limit':_0x359e66['options']?_0x359e66[_0x3071('0x19')][_0x3071('0x1c')]||null:null,'include':_0x359e66[_0x3071('0x19')]?_0x359e66[_0x3071('0x19')][_0x3071('0x1d')]?_[_0x3071('0x1e')](_0x359e66[_0x3071('0x19')][_0x3071('0x1d')],function(_0x1de5fb){return{'model':db[_0x1de5fb['model']],'as':_0x1de5fb['as'],'attributes':_0x1de5fb[_0x3071('0x1f')],'include':_0x1de5fb[_0x3071('0x1d')]?_[_0x3071('0x1e')](_0x1de5fb['include'],function(_0x4fb1ca){return{'model':db[_0x4fb1ca[_0x3071('0x20')]],'as':_0x4fb1ca['as'],'attributes':_0x4fb1ca[_0x3071('0x1f')],'include':_0x4fb1ca[_0x3071('0x1d')]?_[_0x3071('0x1e')](_0x4fb1ca[_0x3071('0x1d')],function(_0x177b5f){return{'model':db[_0x177b5f[_0x3071('0x20')]],'as':_0x177b5f['as'],'attributes':_0x177b5f[_0x3071('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x3071('0x10')](function(_0x254fc8){logger['info']('GetVoiceExtension',_0x359e66);logger[_0x3071('0x21')](_0x3071('0x22'),_0x359e66,JSON[_0x3071('0x23')](_0x254fc8));_0xd3e23d(_0x254fc8);})[_0x3071('0x17')](function(_0x3f6d90){logger[_0x3071('0x14')](_0x3071('0x22'),_0x3f6d90[_0x3071('0x15')],_0x359e66);_0x56c267(_0x2bfa33['error'](0x1f4,_0x3f6d90['message']));});});};
\ No newline at end of file
+var _0xac4a=['ioredis','../../config/logger','rpc','../../config/environment','client','redis','localhost','./voiceExtension.socket','request','then','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceExtension,\x20%s,\x20%s','message','result','catch','GetVoiceExtension','findAll','options','raw','where','attributes','limit','include','map','model','info','lodash','util','moment','bluebird','randomstring'];(function(_0x3abc09,_0x62ad68){var _0x227030=function(_0x40c9c3){while(--_0x40c9c3){_0x3abc09['push'](_0x3abc09['shift']());}};_0x227030(++_0x62ad68);}(_0xac4a,0x13f));var _0xaac4=function(_0x26c7ca,_0x4b9886){_0x26c7ca=_0x26c7ca-0x0;var _0x417f16=_0xac4a[_0x26c7ca];return _0x417f16;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var moment=require(_0xaac4('0x2'));var BPromise=require(_0xaac4('0x3'));var rs=require(_0xaac4('0x4'));var fs=require('fs');var Redis=require(_0xaac4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaac4('0x6'))(_0xaac4('0x7'));var config=require(_0xaac4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaac4('0x9')]['http']({'port':0x232a});config[_0xaac4('0xa')]=_['defaults'](config[_0xaac4('0xa')],{'host':_0xaac4('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xaac4('0xc'))['register'](socket);function respondWithRpcPromise(_0x452573,_0x59b992,_0x4f4c84){return new BPromise(function(_0xeb6b9a,_0x22cea4){return client[_0xaac4('0xd')](_0x452573,_0x4f4c84)[_0xaac4('0xe')](function(_0x3a983c){logger['info']('VoiceExtension,\x20%s,\x20%s',_0x59b992,_0xaac4('0xf'));logger[_0xaac4('0x10')](_0xaac4('0x11'),_0x59b992,'request\x20sent',JSON[_0xaac4('0x12')](_0x3a983c));if(_0x3a983c[_0xaac4('0x13')]){if(_0x3a983c['error'][_0xaac4('0x14')]===0x1f4){logger[_0xaac4('0x13')](_0xaac4('0x15'),_0x59b992,_0x3a983c[_0xaac4('0x13')][_0xaac4('0x16')]);return _0x22cea4(_0x3a983c[_0xaac4('0x13')][_0xaac4('0x16')]);}logger[_0xaac4('0x13')](_0xaac4('0x15'),_0x59b992,_0x3a983c[_0xaac4('0x13')][_0xaac4('0x16')]);return _0xeb6b9a(_0x3a983c[_0xaac4('0x13')][_0xaac4('0x16')]);}else{logger['info'](_0xaac4('0x15'),_0x59b992,'request\x20sent');_0xeb6b9a(_0x3a983c[_0xaac4('0x17')]['message']);}})[_0xaac4('0x18')](function(_0x27fe7b){logger[_0xaac4('0x13')](_0xaac4('0x15'),_0x59b992,_0x27fe7b);_0x22cea4(_0x27fe7b);});});}exports[_0xaac4('0x19')]=function(_0x2f3deb){var _0x44f0e8=this;return new Promise(function(_0x25b946,_0x4166ee){return db['VoiceExtension'][_0xaac4('0x1a')]({'raw':_0x2f3deb['options']?_0x2f3deb[_0xaac4('0x1b')][_0xaac4('0x1c')]===undefined?!![]:![]:!![],'where':_0x2f3deb[_0xaac4('0x1b')]?_0x2f3deb[_0xaac4('0x1b')][_0xaac4('0x1d')]||null:null,'attributes':_0x2f3deb[_0xaac4('0x1b')]?_0x2f3deb['options'][_0xaac4('0x1e')]||null:null,'limit':_0x2f3deb[_0xaac4('0x1b')]?_0x2f3deb[_0xaac4('0x1b')][_0xaac4('0x1f')]||null:null,'include':_0x2f3deb[_0xaac4('0x1b')]?_0x2f3deb[_0xaac4('0x1b')][_0xaac4('0x20')]?_['map'](_0x2f3deb[_0xaac4('0x1b')]['include'],function(_0x54203b){return{'model':db[_0x54203b['model']],'as':_0x54203b['as'],'attributes':_0x54203b['attributes'],'include':_0x54203b[_0xaac4('0x20')]?_[_0xaac4('0x21')](_0x54203b[_0xaac4('0x20')],function(_0xe93120){return{'model':db[_0xe93120[_0xaac4('0x22')]],'as':_0xe93120['as'],'attributes':_0xe93120[_0xaac4('0x1e')],'include':_0xe93120[_0xaac4('0x20')]?_[_0xaac4('0x21')](_0xe93120[_0xaac4('0x20')],function(_0x386c9b){return{'model':db[_0x386c9b['model']],'as':_0x386c9b['as'],'attributes':_0x386c9b[_0xaac4('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xaac4('0xe')](function(_0xda10b6){logger[_0xaac4('0x23')](_0xaac4('0x19'),_0x2f3deb);logger[_0xaac4('0x10')]('GetVoiceExtension',_0x2f3deb,JSON[_0xaac4('0x12')](_0xda10b6));_0x25b946(_0xda10b6);})['catch'](function(_0x2df7e3){logger[_0xaac4('0x13')](_0xaac4('0x19'),_0x2df7e3[_0xaac4('0x16')],_0x2f3deb);_0x4166ee(_0x44f0e8['error'](0x1f4,_0x2df7e3['message']));});});};
\ No newline at end of file