30aa2d70f3ddadbdba5f2678f40b764657c38395
[motion2.git] / server / api / openchannelTransferReport / openchannelTransferReport.rpc.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0xff2a=['request\x20sent','stringify','error','message','info','result','catch','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then','OpenchannelTransferReport,\x20%s,\x20%s','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0xa6d63,_0x331cd0){var _0x1e4156=function(_0x51ca0f){while(--_0x51ca0f){_0xa6d63['push'](_0xa6d63['shift']());}};_0x1e4156(++_0x331cd0);}(_0xff2a,0x93));var _0xaff2=function(_0x28b301,_0x1dd9f9){_0x28b301=_0x28b301-0x0;var _0x4febe0=_0xff2a[_0x28b301];return _0x4febe0;};'use strict';var _=require('lodash');var util=require(_0xaff2('0x0'));var moment=require(_0xaff2('0x1'));var BPromise=require('bluebird');var rs=require(_0xaff2('0x2'));var fs=require('fs');var Redis=require(_0xaff2('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xaff2('0x4'));var logger=require('../../config/logger')(_0xaff2('0x5'));var config=require(_0xaff2('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xaff2('0x7')][_0xaff2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2e4f44,_0x3498b7,_0x33229b){return new BPromise(function(_0x1125e,_0xe0d6d3){return client[_0xaff2('0x9')](_0x2e4f44,_0x33229b)[_0xaff2('0xa')](function(_0x3ecb3f){logger['info'](_0xaff2('0xb'),_0x3498b7,'request\x20sent');logger['debug'](_0xaff2('0xc'),_0x3498b7,_0xaff2('0xd'),JSON[_0xaff2('0xe')](_0x3ecb3f));if(_0x3ecb3f[_0xaff2('0xf')]){if(_0x3ecb3f[_0xaff2('0xf')]['code']===0x1f4){logger[_0xaff2('0xf')](_0xaff2('0xb'),_0x3498b7,_0x3ecb3f[_0xaff2('0xf')]['message']);return _0xe0d6d3(_0x3ecb3f[_0xaff2('0xf')][_0xaff2('0x10')]);}logger['error'](_0xaff2('0xb'),_0x3498b7,_0x3ecb3f['error'][_0xaff2('0x10')]);return _0x1125e(_0x3ecb3f['error']['message']);}else{logger[_0xaff2('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x3498b7,_0xaff2('0xd'));_0x1125e(_0x3ecb3f[_0xaff2('0x12')][_0xaff2('0x10')]);}})[_0xaff2('0x13')](function(_0x1bb23f){logger['error'](_0xaff2('0xb'),_0x3498b7,_0x1bb23f);_0xe0d6d3(_0x1bb23f);});});}