Built motion from commit 1fa89557.|2.6.10
[motion2.git] / server / api / voiceExtension / voiceExtension.rpc.js
index a2c8229..665319c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0309=['../../config/logger','rpc','../../config/environment','http','redis','socket.io-emitter','./voiceExtension.socket','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceExtension','options','where','attributes','limit','map','include','model','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x5efb3e,_0x19c48b){var _0x5d56fa=function(_0x2db9d2){while(--_0x2db9d2){_0x5efb3e['push'](_0x5efb3e['shift']());}};_0x5d56fa(++_0x19c48b);}(_0x0309,0x165));var _0x9030=function(_0x2a91a7,_0x3db2bd){_0x2a91a7=_0x2a91a7-0x0;var _0xc15540=_0x0309[_0x2a91a7];return _0xc15540;};'use strict';var _=require(_0x9030('0x0'));var util=require('util');var moment=require(_0x9030('0x1'));var BPromise=require('bluebird');var rs=require(_0x9030('0x2'));var fs=require('fs');var Redis=require(_0x9030('0x3'));var db=require(_0x9030('0x4'))['db'];var utils=require(_0x9030('0x5'));var logger=require(_0x9030('0x6'))(_0x9030('0x7'));var config=require(_0x9030('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9030('0x9')]({'port':0x232a});config[_0x9030('0xa')]=_['defaults'](config[_0x9030('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x9030('0xb'))(new Redis(config[_0x9030('0xa')]));require(_0x9030('0xc'))['register'](socket);function respondWithRpcPromise(_0xe2c28b,_0x1da9ec,_0x337b86){return new BPromise(function(_0x53ef39,_0x37d6e0){return client[_0x9030('0xd')](_0xe2c28b,_0x337b86)[_0x9030('0xe')](function(_0x11a539){logger[_0x9030('0xf')](_0x9030('0x10'),_0x1da9ec,_0x9030('0x11'));logger['debug'](_0x9030('0x12'),_0x1da9ec,_0x9030('0x11'),JSON[_0x9030('0x13')](_0x11a539));if(_0x11a539[_0x9030('0x14')]){if(_0x11a539['error'][_0x9030('0x15')]===0x1f4){logger[_0x9030('0x14')](_0x9030('0x10'),_0x1da9ec,_0x11a539[_0x9030('0x14')][_0x9030('0x16')]);return _0x37d6e0(_0x11a539[_0x9030('0x14')][_0x9030('0x16')]);}logger[_0x9030('0x14')](_0x9030('0x10'),_0x1da9ec,_0x11a539['error'][_0x9030('0x16')]);return _0x53ef39(_0x11a539[_0x9030('0x14')][_0x9030('0x16')]);}else{logger[_0x9030('0xf')](_0x9030('0x10'),_0x1da9ec,_0x9030('0x11'));_0x53ef39(_0x11a539[_0x9030('0x17')][_0x9030('0x16')]);}})[_0x9030('0x18')](function(_0x31e196){logger[_0x9030('0x14')](_0x9030('0x10'),_0x1da9ec,_0x31e196);_0x37d6e0(_0x31e196);});});}exports[_0x9030('0x19')]=function(_0x243e7d){var _0x1e5988=this;return new Promise(function(_0x285d93,_0x4105ec){return db['VoiceExtension']['findAll']({'raw':_0x243e7d[_0x9030('0x1a')]?_0x243e7d[_0x9030('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x243e7d[_0x9030('0x1a')]?_0x243e7d[_0x9030('0x1a')][_0x9030('0x1b')]||null:null,'attributes':_0x243e7d[_0x9030('0x1a')]?_0x243e7d['options'][_0x9030('0x1c')]||null:null,'limit':_0x243e7d['options']?_0x243e7d['options'][_0x9030('0x1d')]||null:null,'include':_0x243e7d[_0x9030('0x1a')]?_0x243e7d[_0x9030('0x1a')]['include']?_[_0x9030('0x1e')](_0x243e7d[_0x9030('0x1a')][_0x9030('0x1f')],function(_0xce2840){return{'model':db[_0xce2840[_0x9030('0x20')]],'as':_0xce2840['as'],'attributes':_0xce2840['attributes'],'include':_0xce2840[_0x9030('0x1f')]?_[_0x9030('0x1e')](_0xce2840[_0x9030('0x1f')],function(_0x463dda){return{'model':db[_0x463dda[_0x9030('0x20')]],'as':_0x463dda['as'],'attributes':_0x463dda[_0x9030('0x1c')],'include':_0x463dda[_0x9030('0x1f')]?_[_0x9030('0x1e')](_0x463dda[_0x9030('0x1f')],function(_0x11c47d){return{'model':db[_0x11c47d[_0x9030('0x20')]],'as':_0x11c47d['as'],'attributes':_0x11c47d[_0x9030('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x9030('0xe')](function(_0x18de34){logger['info'](_0x9030('0x19'),_0x243e7d);logger['debug'](_0x9030('0x19'),_0x243e7d,JSON['stringify'](_0x18de34));_0x285d93(_0x18de34);})[_0x9030('0x18')](function(_0x37bee3){logger[_0x9030('0x14')]('GetVoiceExtension',_0x37bee3[_0x9030('0x16')],_0x243e7d);_0x4105ec(_0x1e5988[_0x9030('0x14')](0x1f4,_0x37bee3[_0x9030('0x16')]));});});};
\ No newline at end of file
+var _0xab86=['attributes','limit','include','map','model','stringify','lodash','util','moment','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','where'];(function(_0x4baa79,_0x34b8cf){var _0x1357f1=function(_0x5287c2){while(--_0x5287c2){_0x4baa79['push'](_0x4baa79['shift']());}};_0x1357f1(++_0x34b8cf);}(_0xab86,0x13e));var _0x6ab8=function(_0x27c011,_0x234899){_0x27c011=_0x27c011-0x0;var _0x4b210c=_0xab86[_0x27c011];return _0x4b210c;};'use strict';var _=require(_0x6ab8('0x0'));var util=require(_0x6ab8('0x1'));var moment=require(_0x6ab8('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6ab8('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6ab8('0x4'));var logger=require('../../config/logger')(_0x6ab8('0x5'));var config=require(_0x6ab8('0x6'));var jayson=require(_0x6ab8('0x7'));var client=jayson[_0x6ab8('0x8')][_0x6ab8('0x9')]({'port':0x232a});config[_0x6ab8('0xa')]=_[_0x6ab8('0xb')](config[_0x6ab8('0xa')],{'host':_0x6ab8('0xc'),'port':0x18eb});var socket=require(_0x6ab8('0xd'))(new Redis(config[_0x6ab8('0xa')]));require(_0x6ab8('0xe'))[_0x6ab8('0xf')](socket);function respondWithRpcPromise(_0x5127eb,_0x5ea6e6,_0x383594){return new BPromise(function(_0x5b7732,_0x18d3a3){return client[_0x6ab8('0x10')](_0x5127eb,_0x383594)[_0x6ab8('0x11')](function(_0x52d636){logger[_0x6ab8('0x12')](_0x6ab8('0x13'),_0x5ea6e6,'request\x20sent');logger[_0x6ab8('0x14')](_0x6ab8('0x15'),_0x5ea6e6,_0x6ab8('0x16'),JSON['stringify'](_0x52d636));if(_0x52d636[_0x6ab8('0x17')]){if(_0x52d636[_0x6ab8('0x17')][_0x6ab8('0x18')]===0x1f4){logger[_0x6ab8('0x17')](_0x6ab8('0x13'),_0x5ea6e6,_0x52d636[_0x6ab8('0x17')][_0x6ab8('0x19')]);return _0x18d3a3(_0x52d636[_0x6ab8('0x17')][_0x6ab8('0x19')]);}logger['error'](_0x6ab8('0x13'),_0x5ea6e6,_0x52d636[_0x6ab8('0x17')][_0x6ab8('0x19')]);return _0x5b7732(_0x52d636['error'][_0x6ab8('0x19')]);}else{logger[_0x6ab8('0x12')]('VoiceExtension,\x20%s,\x20%s',_0x5ea6e6,'request\x20sent');_0x5b7732(_0x52d636[_0x6ab8('0x1a')]['message']);}})[_0x6ab8('0x1b')](function(_0x292b36){logger[_0x6ab8('0x17')]('VoiceExtension,\x20%s,\x20%s',_0x5ea6e6,_0x292b36);_0x18d3a3(_0x292b36);});});}exports[_0x6ab8('0x1c')]=function(_0x3de5b3){var _0x2d2a80=this;return new Promise(function(_0x312183,_0x5227c6){return db[_0x6ab8('0x1d')][_0x6ab8('0x1e')]({'raw':_0x3de5b3['options']?_0x3de5b3['options']['raw']===undefined?!![]:![]:!![],'where':_0x3de5b3[_0x6ab8('0x1f')]?_0x3de5b3[_0x6ab8('0x1f')][_0x6ab8('0x20')]||null:null,'attributes':_0x3de5b3['options']?_0x3de5b3[_0x6ab8('0x1f')][_0x6ab8('0x21')]||null:null,'limit':_0x3de5b3['options']?_0x3de5b3['options'][_0x6ab8('0x22')]||null:null,'include':_0x3de5b3[_0x6ab8('0x1f')]?_0x3de5b3['options'][_0x6ab8('0x23')]?_[_0x6ab8('0x24')](_0x3de5b3[_0x6ab8('0x1f')][_0x6ab8('0x23')],function(_0x3ddaeb){return{'model':db[_0x3ddaeb[_0x6ab8('0x25')]],'as':_0x3ddaeb['as'],'attributes':_0x3ddaeb[_0x6ab8('0x21')],'include':_0x3ddaeb[_0x6ab8('0x23')]?_['map'](_0x3ddaeb['include'],function(_0x334e21){return{'model':db[_0x334e21['model']],'as':_0x334e21['as'],'attributes':_0x334e21[_0x6ab8('0x21')],'include':_0x334e21[_0x6ab8('0x23')]?_[_0x6ab8('0x24')](_0x334e21['include'],function(_0x525687){return{'model':db[_0x525687['model']],'as':_0x525687['as'],'attributes':_0x525687[_0x6ab8('0x21')]};}):[]};}):[]};}):[]:[]})[_0x6ab8('0x11')](function(_0x3723a7){logger[_0x6ab8('0x12')](_0x6ab8('0x1c'),_0x3de5b3);logger[_0x6ab8('0x14')](_0x6ab8('0x1c'),_0x3de5b3,JSON[_0x6ab8('0x26')](_0x3723a7));_0x312183(_0x3723a7);})[_0x6ab8('0x1b')](function(_0x1f6dbc){logger[_0x6ab8('0x17')](_0x6ab8('0x1c'),_0x1f6dbc[_0x6ab8('0x19')],_0x3de5b3);_0x5227c6(_0x2d2a80['error'](0x1f4,_0x1f6dbc['message']));});});};
\ No newline at end of file