dafe4eae68025bc843a768ffce442a1588b96a95
[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 _0xec39=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xec39,0x19f));var _0x9ec3=function(_0x4fdc92,_0x4456ab){_0x4fdc92=_0x4fdc92-0x0;var _0x1417d3=_0xec39[_0x4fdc92];return _0x1417d3;};'use strict';var _=require(_0x9ec3('0x0'));var util=require(_0x9ec3('0x1'));var moment=require(_0x9ec3('0x2'));var BPromise=require(_0x9ec3('0x3'));var rs=require(_0x9ec3('0x4'));var fs=require('fs');var Redis=require(_0x9ec3('0x5'));var db=require(_0x9ec3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9ec3('0x7'))(_0x9ec3('0x8'));var config=require(_0x9ec3('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3742c5,_0x11c4d1,_0x29a6a2){return new BPromise(function(_0x595e3a,_0x570a91){return client[_0x9ec3('0xa')](_0x3742c5,_0x29a6a2)[_0x9ec3('0xb')](function(_0x2d0c30){logger[_0x9ec3('0xc')](_0x9ec3('0xd'),_0x11c4d1,_0x9ec3('0xe'));logger['debug'](_0x9ec3('0xf'),_0x11c4d1,_0x9ec3('0xe'),JSON[_0x9ec3('0x10')](_0x2d0c30));if(_0x2d0c30[_0x9ec3('0x11')]){if(_0x2d0c30[_0x9ec3('0x11')][_0x9ec3('0x12')]===0x1f4){logger[_0x9ec3('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x11c4d1,_0x2d0c30[_0x9ec3('0x11')][_0x9ec3('0x13')]);return _0x570a91(_0x2d0c30[_0x9ec3('0x11')]['message']);}logger[_0x9ec3('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x11c4d1,_0x2d0c30[_0x9ec3('0x11')][_0x9ec3('0x13')]);return _0x595e3a(_0x2d0c30[_0x9ec3('0x11')][_0x9ec3('0x13')]);}else{logger[_0x9ec3('0xc')](_0x9ec3('0xd'),_0x11c4d1,_0x9ec3('0xe'));_0x595e3a(_0x2d0c30[_0x9ec3('0x14')][_0x9ec3('0x13')]);}})['catch'](function(_0x39ca26){logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x11c4d1,_0x39ca26);_0x570a91(_0x39ca26);});});}