Built motion from commit 775e2a94.|2.6.3
[motion2.git] / server / api / cdr / cdr.rpc.js
index 2c54d27..5431b2c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd88a=['rpc','../../config/environment','client','http','request','then','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','util','moment','randomstring','ioredis','../../config/utils'];(function(_0xcd2ef5,_0xe5b4de){var _0x5581a5=function(_0x27de02){while(--_0x27de02){_0xcd2ef5['push'](_0xcd2ef5['shift']());}};_0x5581a5(++_0xe5b4de);}(_0xd88a,0x14b));var _0xad88=function(_0x4c9be7,_0x538b4d){_0x4c9be7=_0x4c9be7-0x0;var _0x5250a7=_0xd88a[_0x4c9be7];return _0x5250a7;};'use strict';var _=require('lodash');var util=require(_0xad88('0x0'));var moment=require(_0xad88('0x1'));var BPromise=require('bluebird');var rs=require(_0xad88('0x2'));var fs=require('fs');var Redis=require(_0xad88('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xad88('0x4'));var logger=require('../../config/logger')(_0xad88('0x5'));var config=require(_0xad88('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xad88('0x7')][_0xad88('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x429d7f,_0x70746c,_0x35cde8){return new BPromise(function(_0xd3ea34,_0x28ad4e){return client[_0xad88('0x9')](_0x429d7f,_0x35cde8)[_0xad88('0xa')](function(_0x5b394d){logger['info'](_0xad88('0xb'),_0x70746c,_0xad88('0xc'));logger[_0xad88('0xd')](_0xad88('0xe'),_0x70746c,_0xad88('0xc'),JSON[_0xad88('0xf')](_0x5b394d));if(_0x5b394d[_0xad88('0x10')]){if(_0x5b394d[_0xad88('0x10')][_0xad88('0x11')]===0x1f4){logger['error'](_0xad88('0xb'),_0x70746c,_0x5b394d[_0xad88('0x10')][_0xad88('0x12')]);return _0x28ad4e(_0x5b394d['error'][_0xad88('0x12')]);}logger[_0xad88('0x10')](_0xad88('0xb'),_0x70746c,_0x5b394d[_0xad88('0x10')]['message']);return _0xd3ea34(_0x5b394d[_0xad88('0x10')][_0xad88('0x12')]);}else{logger[_0xad88('0x13')]('Cdr,\x20%s,\x20%s',_0x70746c,_0xad88('0xc'));_0xd3ea34(_0x5b394d[_0xad88('0x14')][_0xad88('0x12')]);}})['catch'](function(_0x5bc169){logger[_0xad88('0x10')]('Cdr,\x20%s,\x20%s',_0x70746c,_0x5bc169);_0x28ad4e(_0x5bc169);});});}
\ No newline at end of file
+var _0x77f1=['bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','error','code','message','result','util','moment'];(function(_0x1288d5,_0x37e407){var _0xf9a949=function(_0x40a710){while(--_0x40a710){_0x1288d5['push'](_0x1288d5['shift']());}};_0xf9a949(++_0x37e407);}(_0x77f1,0x13e));var _0x177f=function(_0x45f2d6,_0x22516c){_0x45f2d6=_0x45f2d6-0x0;var _0x37ccac=_0x77f1[_0x45f2d6];return _0x37ccac;};'use strict';var _=require('lodash');var util=require(_0x177f('0x0'));var moment=require(_0x177f('0x1'));var BPromise=require(_0x177f('0x2'));var rs=require(_0x177f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x177f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x177f('0x5'))(_0x177f('0x6'));var config=require('../../config/environment');var jayson=require(_0x177f('0x7'));var client=jayson[_0x177f('0x8')][_0x177f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf096c3,_0x10bba5,_0xf056f3){return new BPromise(function(_0x272345,_0x1f4464){return client[_0x177f('0xa')](_0xf096c3,_0xf056f3)[_0x177f('0xb')](function(_0x50f2c9){logger[_0x177f('0xc')](_0x177f('0xd'),_0x10bba5,_0x177f('0xe'));logger['debug'](_0x177f('0xf'),_0x10bba5,_0x177f('0xe'),JSON['stringify'](_0x50f2c9));if(_0x50f2c9[_0x177f('0x10')]){if(_0x50f2c9[_0x177f('0x10')][_0x177f('0x11')]===0x1f4){logger[_0x177f('0x10')]('Cdr,\x20%s,\x20%s',_0x10bba5,_0x50f2c9[_0x177f('0x10')][_0x177f('0x12')]);return _0x1f4464(_0x50f2c9['error']['message']);}logger['error'](_0x177f('0xd'),_0x10bba5,_0x50f2c9[_0x177f('0x10')]['message']);return _0x272345(_0x50f2c9[_0x177f('0x10')][_0x177f('0x12')]);}else{logger['info'](_0x177f('0xd'),_0x10bba5,_0x177f('0xe'));_0x272345(_0x50f2c9[_0x177f('0x13')]['message']);}})['catch'](function(_0x6c24ac){logger['error'](_0x177f('0xd'),_0x10bba5,_0x6c24ac);_0x1f4464(_0x6c24ac);});});}
\ No newline at end of file