19ed3e12efc849c2bdcaf00a8e23f5210af00f64
[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 _0xc504=['http','request','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5c034a,_0x131fd6){var _0x176d53=function(_0x1d6a20){while(--_0x1d6a20){_0x5c034a['push'](_0x5c034a['shift']());}};_0x176d53(++_0x131fd6);}(_0xc504,0x16d));var _0x4c50=function(_0x5d10a5,_0x348356){_0x5d10a5=_0x5d10a5-0x0;var _0xf72ff6=_0xc504[_0x5d10a5];return _0xf72ff6;};'use strict';var _=require(_0x4c50('0x0'));var util=require(_0x4c50('0x1'));var moment=require('moment');var BPromise=require(_0x4c50('0x2'));var rs=require(_0x4c50('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4c50('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4c50('0x5'))(_0x4c50('0x6'));var config=require(_0x4c50('0x7'));var jayson=require(_0x4c50('0x8'));var client=jayson['client'][_0x4c50('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xfc2e89,_0x2b58e4,_0x2d644f){return new BPromise(function(_0x2ba43a,_0x8a442a){return client[_0x4c50('0xa')](_0xfc2e89,_0x2d644f)['then'](function(_0xe0ca97){logger[_0x4c50('0xb')](_0x4c50('0xc'),_0x2b58e4,_0x4c50('0xd'));logger[_0x4c50('0xe')](_0x4c50('0xf'),_0x2b58e4,'request\x20sent',JSON[_0x4c50('0x10')](_0xe0ca97));if(_0xe0ca97['error']){if(_0xe0ca97[_0x4c50('0x11')][_0x4c50('0x12')]===0x1f4){logger[_0x4c50('0x11')](_0x4c50('0xc'),_0x2b58e4,_0xe0ca97[_0x4c50('0x11')]['message']);return _0x8a442a(_0xe0ca97['error']['message']);}logger['error'](_0x4c50('0xc'),_0x2b58e4,_0xe0ca97[_0x4c50('0x11')][_0x4c50('0x13')]);return _0x2ba43a(_0xe0ca97['error']['message']);}else{logger[_0x4c50('0xb')](_0x4c50('0xc'),_0x2b58e4,_0x4c50('0xd'));_0x2ba43a(_0xe0ca97[_0x4c50('0x14')][_0x4c50('0x13')]);}})[_0x4c50('0x15')](function(_0x4978a0){logger[_0x4c50('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x2b58e4,_0x4978a0);_0x8a442a(_0x4978a0);});});}