Built motion from commit (unavailable).|2.5.19
[motion2.git] / server / api / cdr / cdr.rpc.js
index f9b1c6e..a768ae8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb778=['result','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Cdr,\x20%s,\x20%s','message'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0xb778,0x94));var _0x8b77=function(_0x4efc87,_0x17a7d1){_0x4efc87=_0x4efc87-0x0;var _0x191fc4=_0xb778[_0x4efc87];return _0x191fc4;};'use strict';var _=require('lodash');var util=require(_0x8b77('0x0'));var moment=require(_0x8b77('0x1'));var BPromise=require('bluebird');var rs=require(_0x8b77('0x2'));var fs=require('fs');var Redis=require(_0x8b77('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8b77('0x4'))(_0x8b77('0x5'));var config=require(_0x8b77('0x6'));var jayson=require(_0x8b77('0x7'));var client=jayson['client'][_0x8b77('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x290974,_0xcd6fd6,_0xdaf651){return new BPromise(function(_0x4deb2c,_0x219aa3){return client[_0x8b77('0x9')](_0x290974,_0xdaf651)[_0x8b77('0xa')](function(_0x3abc80){logger[_0x8b77('0xb')]('Cdr,\x20%s,\x20%s',_0xcd6fd6,'request\x20sent');logger[_0x8b77('0xc')](_0x8b77('0xd'),_0xcd6fd6,_0x8b77('0xe'),JSON[_0x8b77('0xf')](_0x3abc80));if(_0x3abc80[_0x8b77('0x10')]){if(_0x3abc80[_0x8b77('0x10')][_0x8b77('0x11')]===0x1f4){logger[_0x8b77('0x10')](_0x8b77('0x12'),_0xcd6fd6,_0x3abc80['error']['message']);return _0x219aa3(_0x3abc80['error'][_0x8b77('0x13')]);}logger['error'](_0x8b77('0x12'),_0xcd6fd6,_0x3abc80['error']['message']);return _0x4deb2c(_0x3abc80[_0x8b77('0x10')][_0x8b77('0x13')]);}else{logger[_0x8b77('0xb')]('Cdr,\x20%s,\x20%s',_0xcd6fd6,'request\x20sent');_0x4deb2c(_0x3abc80[_0x8b77('0x14')][_0x8b77('0x13')]);}})['catch'](function(_0x5d8708){logger[_0x8b77('0x10')]('Cdr,\x20%s,\x20%s',_0xcd6fd6,_0x5d8708);_0x219aa3(_0x5d8708);});});}
\ No newline at end of file
+var _0x3f2b=['../../config/utils','../../config/logger','../../config/environment','client','http','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','moment','bluebird','ioredis'];(function(_0x3e3b32,_0x3c4447){var _0x564cbc=function(_0x42e36a){while(--_0x42e36a){_0x3e3b32['push'](_0x3e3b32['shift']());}};_0x564cbc(++_0x3c4447);}(_0x3f2b,0x85));var _0xb3f2=function(_0x1c9524,_0x468fee){_0x1c9524=_0x1c9524-0x0;var _0x2c6416=_0x3f2b[_0x1c9524];return _0x2c6416;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb3f2('0x0'));var BPromise=require(_0xb3f2('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb3f2('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xb3f2('0x3'));var logger=require(_0xb3f2('0x4'))('rpc');var config=require(_0xb3f2('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xb3f2('0x6')][_0xb3f2('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x178ca9,_0x35616e,_0x11cd6d){return new BPromise(function(_0x18eefd,_0x541a99){return client['request'](_0x178ca9,_0x11cd6d)['then'](function(_0x4e886a){logger[_0xb3f2('0x8')](_0xb3f2('0x9'),_0x35616e,_0xb3f2('0xa'));logger[_0xb3f2('0xb')]('Cdr,\x20%s,\x20%s,\x20%s',_0x35616e,_0xb3f2('0xa'),JSON[_0xb3f2('0xc')](_0x4e886a));if(_0x4e886a['error']){if(_0x4e886a['error']['code']===0x1f4){logger[_0xb3f2('0xd')](_0xb3f2('0x9'),_0x35616e,_0x4e886a[_0xb3f2('0xd')][_0xb3f2('0xe')]);return _0x541a99(_0x4e886a['error'][_0xb3f2('0xe')]);}logger[_0xb3f2('0xd')](_0xb3f2('0x9'),_0x35616e,_0x4e886a[_0xb3f2('0xd')]['message']);return _0x18eefd(_0x4e886a['error']['message']);}else{logger['info'](_0xb3f2('0x9'),_0x35616e,'request\x20sent');_0x18eefd(_0x4e886a[_0xb3f2('0xf')][_0xb3f2('0xe')]);}})[_0xb3f2('0x10')](function(_0x54c91b){logger[_0xb3f2('0xd')]('Cdr,\x20%s,\x20%s',_0x35616e,_0x54c91b);_0x541a99(_0x54c91b);});});}
\ No newline at end of file