Built motion from commit 0900f080.|2.5.45
[motion2.git] / server / api / cdr / cdr.rpc.js
index af317d4..ea07c90 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f24=['stringify','error','code','message','info','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','http','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s'];(function(_0x1c8341,_0x3a43b0){var _0x33b933=function(_0x2d34b1){while(--_0x2d34b1){_0x1c8341['push'](_0x1c8341['shift']());}};_0x33b933(++_0x3a43b0);}(_0x4f24,0x72));var _0x44f2=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x4f24[_0x45d55e];return _0x29812a;};'use strict';var _=require(_0x44f2('0x0'));var util=require('util');var moment=require(_0x44f2('0x1'));var BPromise=require(_0x44f2('0x2'));var rs=require(_0x44f2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x44f2('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x44f2('0x5'))('rpc');var config=require(_0x44f2('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x44f2('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x50ea58,_0x229904,_0x49a435){return new BPromise(function(_0x22b19f,_0xfd7fda){return client['request'](_0x50ea58,_0x49a435)['then'](function(_0x384e16){logger['info'](_0x44f2('0x8'),_0x229904,_0x44f2('0x9'));logger[_0x44f2('0xa')](_0x44f2('0xb'),_0x229904,_0x44f2('0x9'),JSON[_0x44f2('0xc')](_0x384e16));if(_0x384e16[_0x44f2('0xd')]){if(_0x384e16[_0x44f2('0xd')][_0x44f2('0xe')]===0x1f4){logger[_0x44f2('0xd')](_0x44f2('0x8'),_0x229904,_0x384e16[_0x44f2('0xd')][_0x44f2('0xf')]);return _0xfd7fda(_0x384e16[_0x44f2('0xd')][_0x44f2('0xf')]);}logger[_0x44f2('0xd')]('Cdr,\x20%s,\x20%s',_0x229904,_0x384e16[_0x44f2('0xd')][_0x44f2('0xf')]);return _0x22b19f(_0x384e16[_0x44f2('0xd')]['message']);}else{logger[_0x44f2('0x10')](_0x44f2('0x8'),_0x229904,_0x44f2('0x9'));_0x22b19f(_0x384e16[_0x44f2('0x11')][_0x44f2('0xf')]);}})['catch'](function(_0x2a7d6e){logger[_0x44f2('0xd')]('Cdr,\x20%s,\x20%s',_0x229904,_0x2a7d6e);_0xfd7fda(_0x2a7d6e);});});}
\ No newline at end of file
+var _0xe9af=['then','info','stringify','error','code','Cdr,\x20%s,\x20%s','message','result','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x5c4e16,_0x113035){var _0x36044a=function(_0xde2f25){while(--_0xde2f25){_0x5c4e16['push'](_0x5c4e16['shift']());}};_0x36044a(++_0x113035);}(_0xe9af,0xc7));var _0xfe9a=function(_0x35735d,_0x2d32de){_0x35735d=_0x35735d-0x0;var _0x5b75de=_0xe9af[_0x35735d];return _0x5b75de;};'use strict';var _=require(_0xfe9a('0x0'));var util=require(_0xfe9a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfe9a('0x2'));var db=require(_0xfe9a('0x3'))['db'];var utils=require(_0xfe9a('0x4'));var logger=require('../../config/logger')(_0xfe9a('0x5'));var config=require(_0xfe9a('0x6'));var jayson=require(_0xfe9a('0x7'));var client=jayson['client'][_0xfe9a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x130f2a,_0x39a5a6,_0x3299c4){return new BPromise(function(_0x2a9550,_0x5661f0){return client[_0xfe9a('0x9')](_0x130f2a,_0x3299c4)[_0xfe9a('0xa')](function(_0x46b0c7){logger[_0xfe9a('0xb')]('Cdr,\x20%s,\x20%s',_0x39a5a6,'request\x20sent');logger['debug']('Cdr,\x20%s,\x20%s,\x20%s',_0x39a5a6,'request\x20sent',JSON[_0xfe9a('0xc')](_0x46b0c7));if(_0x46b0c7['error']){if(_0x46b0c7[_0xfe9a('0xd')][_0xfe9a('0xe')]===0x1f4){logger[_0xfe9a('0xd')](_0xfe9a('0xf'),_0x39a5a6,_0x46b0c7['error']['message']);return _0x5661f0(_0x46b0c7['error'][_0xfe9a('0x10')]);}logger['error'](_0xfe9a('0xf'),_0x39a5a6,_0x46b0c7[_0xfe9a('0xd')]['message']);return _0x2a9550(_0x46b0c7[_0xfe9a('0xd')]['message']);}else{logger['info'](_0xfe9a('0xf'),_0x39a5a6,'request\x20sent');_0x2a9550(_0x46b0c7[_0xfe9a('0x11')][_0xfe9a('0x10')]);}})[_0xfe9a('0x12')](function(_0x40e3d8){logger[_0xfe9a('0xd')]('Cdr,\x20%s,\x20%s',_0x39a5a6,_0x40e3d8);_0x5661f0(_0x40e3d8);});});}
\ No newline at end of file