Built motion from commit da24aabd.|2.6.20
[motion2.git] / server / api / cdr / cdr.rpc.js
index 2bb5ef1..ca97f97 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5110=['error','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','request','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','message'];(function(_0x25d32f,_0xa94269){var _0x925e6e=function(_0x570a3a){while(--_0x570a3a){_0x25d32f['push'](_0x25d32f['shift']());}};_0x925e6e(++_0xa94269);}(_0x5110,0x16b));var _0x0511=function(_0x2311df,_0x55a309){_0x2311df=_0x2311df-0x0;var _0x1eece9=_0x5110[_0x2311df];return _0x1eece9;};'use strict';var _=require(_0x0511('0x0'));var util=require(_0x0511('0x1'));var moment=require('moment');var BPromise=require(_0x0511('0x2'));var rs=require(_0x0511('0x3'));var fs=require('fs');var Redis=require(_0x0511('0x4'));var db=require(_0x0511('0x5'))['db'];var utils=require(_0x0511('0x6'));var logger=require('../../config/logger')(_0x0511('0x7'));var config=require(_0x0511('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x315fa3,_0x4ab067,_0x43f88e){return new BPromise(function(_0x2d9d84,_0x1afade){return client[_0x0511('0x9')](_0x315fa3,_0x43f88e)['then'](function(_0x406baa){logger[_0x0511('0xa')](_0x0511('0xb'),_0x4ab067,_0x0511('0xc'));logger[_0x0511('0xd')](_0x0511('0xe'),_0x4ab067,_0x0511('0xc'),JSON[_0x0511('0xf')](_0x406baa));if(_0x406baa['error']){if(_0x406baa['error']['code']===0x1f4){logger['error'](_0x0511('0xb'),_0x4ab067,_0x406baa['error'][_0x0511('0x10')]);return _0x1afade(_0x406baa[_0x0511('0x11')][_0x0511('0x10')]);}logger[_0x0511('0x11')]('Cdr,\x20%s,\x20%s',_0x4ab067,_0x406baa[_0x0511('0x11')][_0x0511('0x10')]);return _0x2d9d84(_0x406baa['error'][_0x0511('0x10')]);}else{logger[_0x0511('0xa')](_0x0511('0xb'),_0x4ab067,_0x0511('0xc'));_0x2d9d84(_0x406baa[_0x0511('0x12')][_0x0511('0x10')]);}})['catch'](function(_0x44f5db){logger[_0x0511('0x11')](_0x0511('0xb'),_0x4ab067,_0x44f5db);_0x1afade(_0x44f5db);});});}
\ No newline at end of file
+var _0xf977=['moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','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','catch','lodash','util'];(function(_0x3f3d4a,_0x29db30){var _0x32e876=function(_0x815fdd){while(--_0x815fdd){_0x3f3d4a['push'](_0x3f3d4a['shift']());}};_0x32e876(++_0x29db30);}(_0xf977,0x82));var _0x7f97=function(_0x41d436,_0x2b97f2){_0x41d436=_0x41d436-0x0;var _0x19e918=_0xf977[_0x41d436];return _0x19e918;};'use strict';var _=require(_0x7f97('0x0'));var util=require(_0x7f97('0x1'));var moment=require(_0x7f97('0x2'));var BPromise=require(_0x7f97('0x3'));var rs=require(_0x7f97('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7f97('0x5'));var logger=require('../../config/logger')(_0x7f97('0x6'));var config=require(_0x7f97('0x7'));var jayson=require(_0x7f97('0x8'));var client=jayson[_0x7f97('0x9')][_0x7f97('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x542d00,_0x4c86ca,_0x48523d){return new BPromise(function(_0x3fdcaa,_0x56cde7){return client[_0x7f97('0xb')](_0x542d00,_0x48523d)[_0x7f97('0xc')](function(_0x583a76){logger[_0x7f97('0xd')](_0x7f97('0xe'),_0x4c86ca,_0x7f97('0xf'));logger['debug'](_0x7f97('0x10'),_0x4c86ca,'request\x20sent',JSON['stringify'](_0x583a76));if(_0x583a76[_0x7f97('0x11')]){if(_0x583a76[_0x7f97('0x11')][_0x7f97('0x12')]===0x1f4){logger[_0x7f97('0x11')]('Cdr,\x20%s,\x20%s',_0x4c86ca,_0x583a76[_0x7f97('0x11')][_0x7f97('0x13')]);return _0x56cde7(_0x583a76['error'][_0x7f97('0x13')]);}logger[_0x7f97('0x11')](_0x7f97('0xe'),_0x4c86ca,_0x583a76['error']['message']);return _0x3fdcaa(_0x583a76[_0x7f97('0x11')][_0x7f97('0x13')]);}else{logger[_0x7f97('0xd')]('Cdr,\x20%s,\x20%s',_0x4c86ca,_0x7f97('0xf'));_0x3fdcaa(_0x583a76[_0x7f97('0x14')][_0x7f97('0x13')]);}})[_0x7f97('0x15')](function(_0x5db77c){logger[_0x7f97('0x11')](_0x7f97('0xe'),_0x4c86ca,_0x5db77c);_0x56cde7(_0x5db77c);});});}
\ No newline at end of file