Built motion from commit 953226e6.|2.6.32
[motion2.git] / server / api / voiceExtension / voiceExtension.rpc.js
index fedf18b..57e2b25 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2171=['debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','code','error','message','VoiceExtension,\x20%s,\x20%s','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','include','model','map','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','info','request\x20sent'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2171,0x143));var _0x1217=function(_0x1f961d,_0x14fd96){_0x1f961d=_0x1f961d-0x0;var _0x26d648=_0x2171[_0x1f961d];return _0x26d648;};'use strict';var _=require('lodash');var util=require(_0x1217('0x0'));var moment=require(_0x1217('0x1'));var BPromise=require(_0x1217('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1217('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x1217('0x4'))(_0x1217('0x5'));var config=require(_0x1217('0x6'));var jayson=require(_0x1217('0x7'));var client=jayson['client'][_0x1217('0x8')]({'port':0x232a});config[_0x1217('0x9')]=_[_0x1217('0xa')](config['redis'],{'host':_0x1217('0xb'),'port':0x18eb});var socket=require(_0x1217('0xc'))(new Redis(config[_0x1217('0x9')]));require(_0x1217('0xd'))[_0x1217('0xe')](socket);function respondWithRpcPromise(_0x35f3a8,_0x5a321c,_0x125efc){return new BPromise(function(_0x5114fd,_0x42abbf){return client[_0x1217('0xf')](_0x35f3a8,_0x125efc)[_0x1217('0x10')](function(_0x24336c){logger[_0x1217('0x11')]('VoiceExtension,\x20%s,\x20%s',_0x5a321c,_0x1217('0x12'));logger[_0x1217('0x13')](_0x1217('0x14'),_0x5a321c,_0x1217('0x12'),JSON[_0x1217('0x15')](_0x24336c));if(_0x24336c['error']){if(_0x24336c['error'][_0x1217('0x16')]===0x1f4){logger['error']('VoiceExtension,\x20%s,\x20%s',_0x5a321c,_0x24336c[_0x1217('0x17')]['message']);return _0x42abbf(_0x24336c['error'][_0x1217('0x18')]);}logger[_0x1217('0x17')](_0x1217('0x19'),_0x5a321c,_0x24336c[_0x1217('0x17')]['message']);return _0x5114fd(_0x24336c[_0x1217('0x17')][_0x1217('0x18')]);}else{logger[_0x1217('0x11')](_0x1217('0x19'),_0x5a321c,'request\x20sent');_0x5114fd(_0x24336c[_0x1217('0x1a')][_0x1217('0x18')]);}})[_0x1217('0x1b')](function(_0x1a0a6c){logger[_0x1217('0x17')](_0x1217('0x19'),_0x5a321c,_0x1a0a6c);_0x42abbf(_0x1a0a6c);});});}exports[_0x1217('0x1c')]=function(_0xa0a5fd){var _0x48fd63=this;return new Promise(function(_0x3546a1,_0x49382b){return db[_0x1217('0x1d')][_0x1217('0x1e')]({'raw':_0xa0a5fd['options']?_0xa0a5fd[_0x1217('0x1f')][_0x1217('0x20')]===undefined?!![]:![]:!![],'where':_0xa0a5fd[_0x1217('0x1f')]?_0xa0a5fd[_0x1217('0x1f')][_0x1217('0x21')]||null:null,'attributes':_0xa0a5fd['options']?_0xa0a5fd[_0x1217('0x1f')][_0x1217('0x22')]||null:null,'limit':_0xa0a5fd[_0x1217('0x1f')]?_0xa0a5fd['options']['limit']||null:null,'include':_0xa0a5fd[_0x1217('0x1f')]?_0xa0a5fd[_0x1217('0x1f')][_0x1217('0x23')]?_['map'](_0xa0a5fd[_0x1217('0x1f')][_0x1217('0x23')],function(_0x1bde0b){return{'model':db[_0x1bde0b[_0x1217('0x24')]],'as':_0x1bde0b['as'],'attributes':_0x1bde0b[_0x1217('0x22')],'include':_0x1bde0b[_0x1217('0x23')]?_['map'](_0x1bde0b['include'],function(_0x1c61b2){return{'model':db[_0x1c61b2[_0x1217('0x24')]],'as':_0x1c61b2['as'],'attributes':_0x1c61b2['attributes'],'include':_0x1c61b2[_0x1217('0x23')]?_[_0x1217('0x25')](_0x1c61b2[_0x1217('0x23')],function(_0x21392c){return{'model':db[_0x21392c[_0x1217('0x24')]],'as':_0x21392c['as'],'attributes':_0x21392c['attributes']};}):[]};}):[]};}):[]:[]})[_0x1217('0x10')](function(_0x46b735){logger[_0x1217('0x11')]('GetVoiceExtension',_0xa0a5fd);logger['debug'](_0x1217('0x1c'),_0xa0a5fd,JSON[_0x1217('0x15')](_0x46b735));_0x3546a1(_0x46b735);})[_0x1217('0x1b')](function(_0x5c7fe3){logger['error'](_0x1217('0x1c'),_0x5c7fe3[_0x1217('0x18')],_0xa0a5fd);_0x49382b(_0x48fd63[_0x1217('0x17')](0x1f4,_0x5c7fe3['message']));});});};
\ 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