Built motion from commit 00bf23f6.|2.6.16
[motion2.git] / server / api / cdr / cdr.rpc.js
index a44f6ca..6042c9b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x95c4=['error','message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x16ac1f,_0x155974){var _0x462e17=function(_0x4aa15b){while(--_0x4aa15b){_0x16ac1f['push'](_0x16ac1f['shift']());}};_0x462e17(++_0x155974);}(_0x95c4,0x1bd));var _0x495c=function(_0x725b8e,_0xc22b48){_0x725b8e=_0x725b8e-0x0;var _0x43ac45=_0x95c4[_0x725b8e];return _0x43ac45;};'use strict';var _=require(_0x495c('0x0'));var util=require('util');var moment=require(_0x495c('0x1'));var BPromise=require(_0x495c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x495c('0x3'))['db'];var utils=require(_0x495c('0x4'));var logger=require(_0x495c('0x5'))(_0x495c('0x6'));var config=require(_0x495c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x495c('0x8')][_0x495c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3dade4,_0x57341e,_0x3934e9){return new BPromise(function(_0x4fde61,_0x550a59){return client[_0x495c('0xa')](_0x3dade4,_0x3934e9)[_0x495c('0xb')](function(_0x2338ec){logger[_0x495c('0xc')](_0x495c('0xd'),_0x57341e,_0x495c('0xe'));logger[_0x495c('0xf')]('Cdr,\x20%s,\x20%s,\x20%s',_0x57341e,_0x495c('0xe'),JSON[_0x495c('0x10')](_0x2338ec));if(_0x2338ec[_0x495c('0x11')]){if(_0x2338ec[_0x495c('0x11')]['code']===0x1f4){logger[_0x495c('0x11')]('Cdr,\x20%s,\x20%s',_0x57341e,_0x2338ec[_0x495c('0x11')][_0x495c('0x12')]);return _0x550a59(_0x2338ec[_0x495c('0x11')]['message']);}logger['error']('Cdr,\x20%s,\x20%s',_0x57341e,_0x2338ec[_0x495c('0x11')]['message']);return _0x4fde61(_0x2338ec[_0x495c('0x11')][_0x495c('0x12')]);}else{logger['info']('Cdr,\x20%s,\x20%s',_0x57341e,'request\x20sent');_0x4fde61(_0x2338ec[_0x495c('0x13')][_0x495c('0x12')]);}})[_0x495c('0x14')](function(_0xd2ce9c){logger['error']('Cdr,\x20%s,\x20%s',_0x57341e,_0xd2ce9c);_0x550a59(_0xd2ce9c);});});}
\ No newline at end of file
+var _0x8863=['stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s'];(function(_0x5a1de2,_0x56daed){var _0xf89bf3=function(_0x5ead7b){while(--_0x5ead7b){_0x5a1de2['push'](_0x5a1de2['shift']());}};_0xf89bf3(++_0x56daed);}(_0x8863,0xe2));var _0x3886=function(_0x38cb37,_0x499145){_0x38cb37=_0x38cb37-0x0;var _0x2efd84=_0x8863[_0x38cb37];return _0x2efd84;};'use strict';var _=require('lodash');var util=require(_0x3886('0x0'));var moment=require('moment');var BPromise=require(_0x3886('0x1'));var rs=require(_0x3886('0x2'));var fs=require('fs');var Redis=require(_0x3886('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3886('0x4'));var config=require(_0x3886('0x5'));var jayson=require(_0x3886('0x6'));var client=jayson[_0x3886('0x7')][_0x3886('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x342a03,_0x358fe9,_0x4a0056){return new BPromise(function(_0x36d06a,_0x5a07c4){return client[_0x3886('0x9')](_0x342a03,_0x4a0056)[_0x3886('0xa')](function(_0x5962ef){logger[_0x3886('0xb')](_0x3886('0xc'),_0x358fe9,_0x3886('0xd'));logger[_0x3886('0xe')](_0x3886('0xf'),_0x358fe9,'request\x20sent',JSON[_0x3886('0x10')](_0x5962ef));if(_0x5962ef[_0x3886('0x11')]){if(_0x5962ef[_0x3886('0x11')][_0x3886('0x12')]===0x1f4){logger[_0x3886('0x11')](_0x3886('0xc'),_0x358fe9,_0x5962ef[_0x3886('0x11')][_0x3886('0x13')]);return _0x5a07c4(_0x5962ef[_0x3886('0x11')]['message']);}logger['error'](_0x3886('0xc'),_0x358fe9,_0x5962ef[_0x3886('0x11')][_0x3886('0x13')]);return _0x36d06a(_0x5962ef[_0x3886('0x11')][_0x3886('0x13')]);}else{logger[_0x3886('0xb')](_0x3886('0xc'),_0x358fe9,_0x3886('0xd'));_0x36d06a(_0x5962ef[_0x3886('0x14')][_0x3886('0x13')]);}})[_0x3886('0x15')](function(_0x47bb97){logger[_0x3886('0x11')](_0x3886('0xc'),_0x358fe9,_0x47bb97);_0x5a07c4(_0x47bb97);});});}
\ No newline at end of file