Built motion from commit 3e059bc2.|2.5.32
[motion2.git] / server / api / cdr / cdr.rpc.js
index 30633b6..7b04f08 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a96=['debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','Cdr,\x20%s,\x20%s','request\x20sent'];(function(_0x1e6f26,_0x27d992){var _0x4820f9=function(_0x2d0c4b){while(--_0x2d0c4b){_0x1e6f26['push'](_0x1e6f26['shift']());}};_0x4820f9(++_0x27d992);}(_0x1a96,0x18e));var _0x61a9=function(_0x539243,_0x60bc3d){_0x539243=_0x539243-0x0;var _0x5cc843=_0x1a96[_0x539243];return _0x5cc843;};'use strict';var _=require(_0x61a9('0x0'));var util=require(_0x61a9('0x1'));var moment=require(_0x61a9('0x2'));var BPromise=require(_0x61a9('0x3'));var rs=require(_0x61a9('0x4'));var fs=require('fs');var Redis=require(_0x61a9('0x5'));var db=require(_0x61a9('0x6'))['db'];var utils=require(_0x61a9('0x7'));var logger=require(_0x61a9('0x8'))('rpc');var config=require(_0x61a9('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x61a9('0xa')][_0x61a9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x12d882,_0x81d646,_0xf4cdd9){return new BPromise(function(_0x399c6c,_0x4a6c6e){return client[_0x61a9('0xc')](_0x12d882,_0xf4cdd9)['then'](function(_0x13cdc4){logger[_0x61a9('0xd')](_0x61a9('0xe'),_0x81d646,_0x61a9('0xf'));logger[_0x61a9('0x10')](_0x61a9('0x11'),_0x81d646,_0x61a9('0xf'),JSON[_0x61a9('0x12')](_0x13cdc4));if(_0x13cdc4['error']){if(_0x13cdc4[_0x61a9('0x13')][_0x61a9('0x14')]===0x1f4){logger['error']('Cdr,\x20%s,\x20%s',_0x81d646,_0x13cdc4[_0x61a9('0x13')][_0x61a9('0x15')]);return _0x4a6c6e(_0x13cdc4[_0x61a9('0x13')][_0x61a9('0x15')]);}logger['error'](_0x61a9('0xe'),_0x81d646,_0x13cdc4[_0x61a9('0x13')][_0x61a9('0x15')]);return _0x399c6c(_0x13cdc4[_0x61a9('0x13')][_0x61a9('0x15')]);}else{logger['info'](_0x61a9('0xe'),_0x81d646,_0x61a9('0xf'));_0x399c6c(_0x13cdc4['result'][_0x61a9('0x15')]);}})[_0x61a9('0x16')](function(_0x3b5931){logger[_0x61a9('0x13')](_0x61a9('0xe'),_0x81d646,_0x3b5931);_0x4a6c6e(_0x3b5931);});});}
\ No newline at end of file
+var _0xfebc=['request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','Cdr,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','then'];(function(_0x11072e,_0x510877){var _0x21a203=function(_0xca5bcf){while(--_0xca5bcf){_0x11072e['push'](_0x11072e['shift']());}};_0x21a203(++_0x510877);}(_0xfebc,0x1ac));var _0xcfeb=function(_0x4459b8,_0x3271b8){_0x4459b8=_0x4459b8-0x0;var _0x4a4b07=_0xfebc[_0x4459b8];return _0x4a4b07;};'use strict';var _=require(_0xcfeb('0x0'));var util=require(_0xcfeb('0x1'));var moment=require(_0xcfeb('0x2'));var BPromise=require(_0xcfeb('0x3'));var rs=require(_0xcfeb('0x4'));var fs=require('fs');var Redis=require(_0xcfeb('0x5'));var db=require(_0xcfeb('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xcfeb('0x7'))('rpc');var config=require(_0xcfeb('0x8'));var jayson=require(_0xcfeb('0x9'));var client=jayson[_0xcfeb('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xfe3f56,_0xebac97,_0x522839){return new BPromise(function(_0x5c7f2d,_0x5a6aaf){return client['request'](_0xfe3f56,_0x522839)[_0xcfeb('0xb')](function(_0x5a69a4){logger['info']('Cdr,\x20%s,\x20%s',_0xebac97,_0xcfeb('0xc'));logger[_0xcfeb('0xd')](_0xcfeb('0xe'),_0xebac97,_0xcfeb('0xc'),JSON[_0xcfeb('0xf')](_0x5a69a4));if(_0x5a69a4[_0xcfeb('0x10')]){if(_0x5a69a4[_0xcfeb('0x10')]['code']===0x1f4){logger[_0xcfeb('0x10')](_0xcfeb('0x11'),_0xebac97,_0x5a69a4[_0xcfeb('0x10')][_0xcfeb('0x12')]);return _0x5a6aaf(_0x5a69a4[_0xcfeb('0x10')][_0xcfeb('0x12')]);}logger['error'](_0xcfeb('0x11'),_0xebac97,_0x5a69a4['error'][_0xcfeb('0x12')]);return _0x5c7f2d(_0x5a69a4['error'][_0xcfeb('0x12')]);}else{logger[_0xcfeb('0x13')](_0xcfeb('0x11'),_0xebac97,_0xcfeb('0xc'));_0x5c7f2d(_0x5a69a4[_0xcfeb('0x14')]['message']);}})[_0xcfeb('0x15')](function(_0x100925){logger['error'](_0xcfeb('0x11'),_0xebac97,_0x100925);_0x5a6aaf(_0x100925);});});}
\ No newline at end of file