Built motion from commit (unavailable).|2.5.6
[motion2.git] / server / api / cdr / cdr.rpc.js
index 51c96e4..14e584d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf7a7=['request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','client','http'];(function(_0x334651,_0x6e99f6){var _0x29657c=function(_0x420a94){while(--_0x420a94){_0x334651['push'](_0x334651['shift']());}};_0x29657c(++_0x6e99f6);}(_0xf7a7,0x15f));var _0x7f7a=function(_0x2e82df,_0x468707){_0x2e82df=_0x2e82df-0x0;var _0x47222d=_0xf7a7[_0x2e82df];return _0x47222d;};'use strict';var _=require('lodash');var util=require(_0x7f7a('0x0'));var moment=require(_0x7f7a('0x1'));var BPromise=require(_0x7f7a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7f7a('0x3'));var db=require(_0x7f7a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7f7a('0x5'))(_0x7f7a('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7f7a('0x7')][_0x7f7a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x82d0d7,_0x9a8a42,_0x8c17db){return new BPromise(function(_0x5b0fed,_0x4e0e6b){return client[_0x7f7a('0x9')](_0x82d0d7,_0x8c17db)[_0x7f7a('0xa')](function(_0x41f39e){logger[_0x7f7a('0xb')](_0x7f7a('0xc'),_0x9a8a42,_0x7f7a('0xd'));logger['debug'](_0x7f7a('0xe'),_0x9a8a42,'request\x20sent',JSON[_0x7f7a('0xf')](_0x41f39e));if(_0x41f39e[_0x7f7a('0x10')]){if(_0x41f39e[_0x7f7a('0x10')][_0x7f7a('0x11')]===0x1f4){logger[_0x7f7a('0x10')](_0x7f7a('0xc'),_0x9a8a42,_0x41f39e[_0x7f7a('0x10')][_0x7f7a('0x12')]);return _0x4e0e6b(_0x41f39e[_0x7f7a('0x10')][_0x7f7a('0x12')]);}logger[_0x7f7a('0x10')](_0x7f7a('0xc'),_0x9a8a42,_0x41f39e[_0x7f7a('0x10')][_0x7f7a('0x12')]);return _0x5b0fed(_0x41f39e[_0x7f7a('0x10')][_0x7f7a('0x12')]);}else{logger[_0x7f7a('0xb')](_0x7f7a('0xc'),_0x9a8a42,_0x7f7a('0xd'));_0x5b0fed(_0x41f39e['result']['message']);}})[_0x7f7a('0x13')](function(_0x3336a6){logger[_0x7f7a('0x10')](_0x7f7a('0xc'),_0x9a8a42,_0x3336a6);_0x4e0e6b(_0x3336a6);});});}
\ No newline at end of file
+var _0x910f=['http','request','Cdr,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x42f233,_0x3fb3a2){var _0x1cbe12=function(_0x220b5a){while(--_0x220b5a){_0x42f233['push'](_0x42f233['shift']());}};_0x1cbe12(++_0x3fb3a2);}(_0x910f,0x170));var _0xf910=function(_0x27def7,_0x3f0835){_0x27def7=_0x27def7-0x0;var _0x581cbc=_0x910f[_0x27def7];return _0x581cbc;};'use strict';var _=require(_0xf910('0x0'));var util=require('util');var moment=require(_0xf910('0x1'));var BPromise=require(_0xf910('0x2'));var rs=require(_0xf910('0x3'));var fs=require('fs');var Redis=require(_0xf910('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf910('0x5'));var logger=require(_0xf910('0x6'))(_0xf910('0x7'));var config=require('../../config/environment');var jayson=require(_0xf910('0x8'));var client=jayson[_0xf910('0x9')][_0xf910('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1982c0,_0x283982,_0x26c4e1){return new BPromise(function(_0x127b8c,_0x2793f0){return client[_0xf910('0xb')](_0x1982c0,_0x26c4e1)['then'](function(_0x335fe3){logger['info'](_0xf910('0xc'),_0x283982,'request\x20sent');logger[_0xf910('0xd')]('Cdr,\x20%s,\x20%s,\x20%s',_0x283982,_0xf910('0xe'),JSON[_0xf910('0xf')](_0x335fe3));if(_0x335fe3[_0xf910('0x10')]){if(_0x335fe3['error'][_0xf910('0x11')]===0x1f4){logger[_0xf910('0x10')]('Cdr,\x20%s,\x20%s',_0x283982,_0x335fe3[_0xf910('0x10')][_0xf910('0x12')]);return _0x2793f0(_0x335fe3[_0xf910('0x10')][_0xf910('0x12')]);}logger[_0xf910('0x10')](_0xf910('0xc'),_0x283982,_0x335fe3[_0xf910('0x10')]['message']);return _0x127b8c(_0x335fe3['error'][_0xf910('0x12')]);}else{logger['info'](_0xf910('0xc'),_0x283982,_0xf910('0xe'));_0x127b8c(_0x335fe3[_0xf910('0x13')][_0xf910('0x12')]);}})[_0xf910('0x14')](function(_0x38e36d){logger[_0xf910('0x10')](_0xf910('0xc'),_0x283982,_0x38e36d);_0x2793f0(_0x38e36d);});});}
\ No newline at end of file