Built motion from commit fe909640.|2.6.8
[motion2.git] / server / api / cannedAnswer / cannedAnswer.rpc.js
index fee347d..5bd8c3e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb26f=['CannedAnswer,\x20%s,\x20%s,\x20%s','stringify','error','code','CannedAnswer,\x20%s,\x20%s','message','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent'];(function(_0x259a42,_0x2b4483){var _0x548d68=function(_0x47656e){while(--_0x47656e){_0x259a42['push'](_0x259a42['shift']());}};_0x548d68(++_0x2b4483);}(_0xb26f,0x149));var _0xfb26=function(_0x289e64,_0x5adb3c){_0x289e64=_0x289e64-0x0;var _0x30246c=_0xb26f[_0x289e64];return _0x30246c;};'use strict';var _=require(_0xfb26('0x0'));var util=require(_0xfb26('0x1'));var moment=require(_0xfb26('0x2'));var BPromise=require(_0xfb26('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfb26('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xfb26('0x5'))('rpc');var config=require(_0xfb26('0x6'));var jayson=require(_0xfb26('0x7'));var client=jayson[_0xfb26('0x8')][_0xfb26('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59f559,_0x40e508,_0x49cb46){return new BPromise(function(_0x541e6a,_0x6c3c28){return client[_0xfb26('0xa')](_0x59f559,_0x49cb46)['then'](function(_0x5773a1){logger[_0xfb26('0xb')]('CannedAnswer,\x20%s,\x20%s',_0x40e508,_0xfb26('0xc'));logger['debug'](_0xfb26('0xd'),_0x40e508,_0xfb26('0xc'),JSON[_0xfb26('0xe')](_0x5773a1));if(_0x5773a1[_0xfb26('0xf')]){if(_0x5773a1['error'][_0xfb26('0x10')]===0x1f4){logger['error'](_0xfb26('0x11'),_0x40e508,_0x5773a1['error'][_0xfb26('0x12')]);return _0x6c3c28(_0x5773a1['error'][_0xfb26('0x12')]);}logger[_0xfb26('0xf')](_0xfb26('0x11'),_0x40e508,_0x5773a1[_0xfb26('0xf')]['message']);return _0x541e6a(_0x5773a1[_0xfb26('0xf')][_0xfb26('0x12')]);}else{logger['info'](_0xfb26('0x11'),_0x40e508,_0xfb26('0xc'));_0x541e6a(_0x5773a1['result'][_0xfb26('0x12')]);}})['catch'](function(_0xc533bc){logger[_0xfb26('0xf')]('CannedAnswer,\x20%s,\x20%s',_0x40e508,_0xc533bc);_0x6c3c28(_0xc533bc);});});}
\ No newline at end of file
+var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4f302c,_0x50c134){var _0x47f2a5=function(_0x3a07b3){while(--_0x3a07b3){_0x4f302c['push'](_0x4f302c['shift']());}};_0x47f2a5(++_0x50c134);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file