314973966881aa9b1c9b42f7cb02362079777573
[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 _0x04e4=['moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util'];(function(_0x9b8963,_0x1d0588){var _0x4db0d8=function(_0x49defc){while(--_0x49defc){_0x9b8963['push'](_0x9b8963['shift']());}};_0x4db0d8(++_0x1d0588);}(_0x04e4,0xa6));var _0x404e=function(_0x559e74,_0x1696ed){_0x559e74=_0x559e74-0x0;var _0x2daf2f=_0x04e4[_0x559e74];return _0x2daf2f;};'use strict';var _=require(_0x404e('0x0'));var util=require(_0x404e('0x1'));var moment=require(_0x404e('0x2'));var BPromise=require(_0x404e('0x3'));var rs=require(_0x404e('0x4'));var fs=require('fs');var Redis=require(_0x404e('0x5'));var db=require(_0x404e('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x404e('0x7'));var config=require(_0x404e('0x8'));var jayson=require(_0x404e('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x37a4af,_0x33e944,_0x2ec305){return new BPromise(function(_0x5b7510,_0xfd4fdc){return client[_0x404e('0xa')](_0x37a4af,_0x2ec305)[_0x404e('0xb')](function(_0x57cd93){logger[_0x404e('0xc')](_0x404e('0xd'),_0x33e944,_0x404e('0xe'));logger['debug']('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x33e944,_0x404e('0xe'),JSON[_0x404e('0xf')](_0x57cd93));if(_0x57cd93[_0x404e('0x10')]){if(_0x57cd93['error'][_0x404e('0x11')]===0x1f4){logger['error'](_0x404e('0xd'),_0x33e944,_0x57cd93[_0x404e('0x10')][_0x404e('0x12')]);return _0xfd4fdc(_0x57cd93['error']['message']);}logger[_0x404e('0x10')](_0x404e('0xd'),_0x33e944,_0x57cd93[_0x404e('0x10')]['message']);return _0x5b7510(_0x57cd93['error'][_0x404e('0x12')]);}else{logger[_0x404e('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x33e944,_0x404e('0xe'));_0x5b7510(_0x57cd93[_0x404e('0x13')][_0x404e('0x12')]);}})[_0x404e('0x14')](function(_0x2825c7){logger[_0x404e('0x10')](_0x404e('0xd'),_0x33e944,_0x2825c7);_0xfd4fdc(_0x2825c7);});});}