Built motion from commit (unavailable).|2.5.21
[motion2.git] / server / api / voiceExtension / voiceExtension.rpc.js
index 6dad9fc..74634bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe9d9=['attributes','map','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','./voiceExtension.socket','register','request','then','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetVoiceExtension','VoiceExtension','options','raw','limit','include','model'];(function(_0x271607,_0x1cdaf2){var _0x2e87c1=function(_0x3186b2){while(--_0x3186b2){_0x271607['push'](_0x271607['shift']());}};_0x2e87c1(++_0x1cdaf2);}(_0xe9d9,0x1d6));var _0x9e9d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe9d9[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x9e9d('0x0'));var util=require(_0x9e9d('0x1'));var moment=require(_0x9e9d('0x2'));var BPromise=require(_0x9e9d('0x3'));var rs=require(_0x9e9d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9e9d('0x5'))['db'];var utils=require(_0x9e9d('0x6'));var logger=require('../../config/logger')(_0x9e9d('0x7'));var config=require(_0x9e9d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9e9d('0x9')][_0x9e9d('0xa')]({'port':0x232a});config[_0x9e9d('0xb')]=_['defaults'](config[_0x9e9d('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9e9d('0xb')]));require(_0x9e9d('0xc'))[_0x9e9d('0xd')](socket);function respondWithRpcPromise(_0x24b07d,_0x36ff98,_0x263664){return new BPromise(function(_0x597b42,_0x8f8fd7){return client[_0x9e9d('0xe')](_0x24b07d,_0x263664)[_0x9e9d('0xf')](function(_0x4ac5c0){logger['info'](_0x9e9d('0x10'),_0x36ff98,_0x9e9d('0x11'));logger[_0x9e9d('0x12')](_0x9e9d('0x13'),_0x36ff98,'request\x20sent',JSON[_0x9e9d('0x14')](_0x4ac5c0));if(_0x4ac5c0[_0x9e9d('0x15')]){if(_0x4ac5c0[_0x9e9d('0x15')][_0x9e9d('0x16')]===0x1f4){logger[_0x9e9d('0x15')]('VoiceExtension,\x20%s,\x20%s',_0x36ff98,_0x4ac5c0[_0x9e9d('0x15')]['message']);return _0x8f8fd7(_0x4ac5c0[_0x9e9d('0x15')]['message']);}logger['error'](_0x9e9d('0x10'),_0x36ff98,_0x4ac5c0[_0x9e9d('0x15')][_0x9e9d('0x17')]);return _0x597b42(_0x4ac5c0['error'][_0x9e9d('0x17')]);}else{logger[_0x9e9d('0x18')](_0x9e9d('0x10'),_0x36ff98,_0x9e9d('0x11'));_0x597b42(_0x4ac5c0[_0x9e9d('0x19')][_0x9e9d('0x17')]);}})[_0x9e9d('0x1a')](function(_0x24ecce){logger[_0x9e9d('0x15')](_0x9e9d('0x10'),_0x36ff98,_0x24ecce);_0x8f8fd7(_0x24ecce);});});}exports[_0x9e9d('0x1b')]=function(_0xeb994c){var _0x1c574e=this;return new Promise(function(_0x1b54ee,_0x3fc91a){return db[_0x9e9d('0x1c')]['findAll']({'raw':_0xeb994c['options']?_0xeb994c[_0x9e9d('0x1d')][_0x9e9d('0x1e')]===undefined?!![]:![]:!![],'where':_0xeb994c[_0x9e9d('0x1d')]?_0xeb994c[_0x9e9d('0x1d')]['where']||null:null,'attributes':_0xeb994c[_0x9e9d('0x1d')]?_0xeb994c['options']['attributes']||null:null,'limit':_0xeb994c[_0x9e9d('0x1d')]?_0xeb994c['options'][_0x9e9d('0x1f')]||null:null,'include':_0xeb994c[_0x9e9d('0x1d')]?_0xeb994c[_0x9e9d('0x1d')][_0x9e9d('0x20')]?_['map'](_0xeb994c[_0x9e9d('0x1d')]['include'],function(_0x21aa49){return{'model':db[_0x21aa49[_0x9e9d('0x21')]],'as':_0x21aa49['as'],'attributes':_0x21aa49[_0x9e9d('0x22')],'include':_0x21aa49[_0x9e9d('0x20')]?_[_0x9e9d('0x23')](_0x21aa49[_0x9e9d('0x20')],function(_0x2c3729){return{'model':db[_0x2c3729[_0x9e9d('0x21')]],'as':_0x2c3729['as'],'attributes':_0x2c3729[_0x9e9d('0x22')],'include':_0x2c3729['include']?_[_0x9e9d('0x23')](_0x2c3729['include'],function(_0x15f888){return{'model':db[_0x15f888[_0x9e9d('0x21')]],'as':_0x15f888['as'],'attributes':_0x15f888[_0x9e9d('0x22')]};}):[]};}):[]};}):[]:[]})[_0x9e9d('0xf')](function(_0x421864){logger[_0x9e9d('0x18')]('GetVoiceExtension',_0xeb994c);logger['debug']('GetVoiceExtension',_0xeb994c,JSON[_0x9e9d('0x14')](_0x421864));_0x1b54ee(_0x421864);})[_0x9e9d('0x1a')](function(_0x191529){logger[_0x9e9d('0x15')]('GetVoiceExtension',_0x191529[_0x9e9d('0x17')],_0xeb994c);_0x3fc91a(_0x1c574e[_0x9e9d('0x15')](0x1f4,_0x191529[_0x9e9d('0x17')]));});});};
\ No newline at end of file
+var _0x9da9=['randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','info','VoiceExtension,\x20%s,\x20%s','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','limit','include','attributes','model','map','then','lodash','bluebird'];(function(_0x4ac266,_0x197dab){var _0x3c8fe3=function(_0x500837){while(--_0x500837){_0x4ac266['push'](_0x4ac266['shift']());}};_0x3c8fe3(++_0x197dab);}(_0x9da9,0x14b));var _0x99da=function(_0x533381,_0x8a69fa){_0x533381=_0x533381-0x0;var _0x2877ed=_0x9da9[_0x533381];return _0x2877ed;};'use strict';var _=require(_0x99da('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x99da('0x1'));var rs=require(_0x99da('0x2'));var fs=require('fs');var Redis=require(_0x99da('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x99da('0x4'))('rpc');var config=require(_0x99da('0x5'));var jayson=require(_0x99da('0x6'));var client=jayson[_0x99da('0x7')][_0x99da('0x8')]({'port':0x232a});config[_0x99da('0x9')]=_[_0x99da('0xa')](config[_0x99da('0x9')],{'host':_0x99da('0xb'),'port':0x18eb});var socket=require(_0x99da('0xc'))(new Redis(config[_0x99da('0x9')]));require('./voiceExtension.socket')[_0x99da('0xd')](socket);function respondWithRpcPromise(_0x1a9d7d,_0x410cfb,_0x186f9a){return new BPromise(function(_0x462bb5,_0x4144dd){return client['request'](_0x1a9d7d,_0x186f9a)['then'](function(_0x5122a2){logger[_0x99da('0xe')](_0x99da('0xf'),_0x410cfb,'request\x20sent');logger[_0x99da('0x10')](_0x99da('0x11'),_0x410cfb,_0x99da('0x12'),JSON[_0x99da('0x13')](_0x5122a2));if(_0x5122a2[_0x99da('0x14')]){if(_0x5122a2[_0x99da('0x14')][_0x99da('0x15')]===0x1f4){logger[_0x99da('0x14')](_0x99da('0xf'),_0x410cfb,_0x5122a2[_0x99da('0x14')][_0x99da('0x16')]);return _0x4144dd(_0x5122a2[_0x99da('0x14')]['message']);}logger[_0x99da('0x14')](_0x99da('0xf'),_0x410cfb,_0x5122a2[_0x99da('0x14')][_0x99da('0x16')]);return _0x462bb5(_0x5122a2[_0x99da('0x14')][_0x99da('0x16')]);}else{logger['info'](_0x99da('0xf'),_0x410cfb,'request\x20sent');_0x462bb5(_0x5122a2[_0x99da('0x17')][_0x99da('0x16')]);}})[_0x99da('0x18')](function(_0x34e4fb){logger['error'](_0x99da('0xf'),_0x410cfb,_0x34e4fb);_0x4144dd(_0x34e4fb);});});}exports[_0x99da('0x19')]=function(_0x33f1b5){var _0xaa6acf=this;return new Promise(function(_0x3627a8,_0x14d64b){return db[_0x99da('0x1a')][_0x99da('0x1b')]({'raw':_0x33f1b5['options']?_0x33f1b5[_0x99da('0x1c')][_0x99da('0x1d')]===undefined?!![]:![]:!![],'where':_0x33f1b5[_0x99da('0x1c')]?_0x33f1b5[_0x99da('0x1c')][_0x99da('0x1e')]||null:null,'attributes':_0x33f1b5['options']?_0x33f1b5[_0x99da('0x1c')]['attributes']||null:null,'limit':_0x33f1b5[_0x99da('0x1c')]?_0x33f1b5[_0x99da('0x1c')][_0x99da('0x1f')]||null:null,'include':_0x33f1b5[_0x99da('0x1c')]?_0x33f1b5[_0x99da('0x1c')]['include']?_['map'](_0x33f1b5[_0x99da('0x1c')][_0x99da('0x20')],function(_0x52b8a3){return{'model':db[_0x52b8a3['model']],'as':_0x52b8a3['as'],'attributes':_0x52b8a3[_0x99da('0x21')],'include':_0x52b8a3[_0x99da('0x20')]?_['map'](_0x52b8a3[_0x99da('0x20')],function(_0x3c9820){return{'model':db[_0x3c9820[_0x99da('0x22')]],'as':_0x3c9820['as'],'attributes':_0x3c9820[_0x99da('0x21')],'include':_0x3c9820['include']?_[_0x99da('0x23')](_0x3c9820[_0x99da('0x20')],function(_0x1ba5a9){return{'model':db[_0x1ba5a9[_0x99da('0x22')]],'as':_0x1ba5a9['as'],'attributes':_0x1ba5a9[_0x99da('0x21')]};}):[]};}):[]};}):[]:[]})[_0x99da('0x24')](function(_0x309757){logger[_0x99da('0xe')](_0x99da('0x19'),_0x33f1b5);logger[_0x99da('0x10')](_0x99da('0x19'),_0x33f1b5,JSON[_0x99da('0x13')](_0x309757));_0x3627a8(_0x309757);})[_0x99da('0x18')](function(_0x564f20){logger[_0x99da('0x14')](_0x99da('0x19'),_0x564f20[_0x99da('0x16')],_0x33f1b5);_0x14d64b(_0xaa6acf[_0x99da('0x14')](0x1f4,_0x564f20[_0x99da('0x16')]));});});};
\ No newline at end of file