Built motion from commit 3c2ce842.|2.6.31
[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 _0x45d1=['randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','OpenchannelTransferReport,\x20%s,\x20%s','result','lodash','util','bluebird'];(function(_0x27526e,_0x3f2c11){var _0x1db58f=function(_0x31f9c1){while(--_0x31f9c1){_0x27526e['push'](_0x27526e['shift']());}};_0x1db58f(++_0x3f2c11);}(_0x45d1,0x1cb));var _0x145d=function(_0x561f25,_0x2d95c1){_0x561f25=_0x561f25-0x0;var _0x150e4c=_0x45d1[_0x561f25];return _0x150e4c;};'use strict';var _=require(_0x145d('0x0'));var util=require(_0x145d('0x1'));var moment=require('moment');var BPromise=require(_0x145d('0x2'));var rs=require(_0x145d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x145d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x145d('0x5'))(_0x145d('0x6'));var config=require(_0x145d('0x7'));var jayson=require(_0x145d('0x8'));var client=jayson[_0x145d('0x9')][_0x145d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbc4161,_0x45ff66,_0x46a729){return new BPromise(function(_0x47eadc,_0x4ef552){return client['request'](_0xbc4161,_0x46a729)[_0x145d('0xb')](function(_0x183afe){logger[_0x145d('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x45ff66,_0x145d('0xd'));logger['debug'](_0x145d('0xe'),_0x45ff66,_0x145d('0xd'),JSON[_0x145d('0xf')](_0x183afe));if(_0x183afe[_0x145d('0x10')]){if(_0x183afe['error'][_0x145d('0x11')]===0x1f4){logger[_0x145d('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x45ff66,_0x183afe[_0x145d('0x10')][_0x145d('0x12')]);return _0x4ef552(_0x183afe[_0x145d('0x10')][_0x145d('0x12')]);}logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x45ff66,_0x183afe[_0x145d('0x10')][_0x145d('0x12')]);return _0x47eadc(_0x183afe[_0x145d('0x10')]['message']);}else{logger[_0x145d('0xc')](_0x145d('0x13'),_0x45ff66,_0x145d('0xd'));_0x47eadc(_0x183afe[_0x145d('0x14')][_0x145d('0x12')]);}})['catch'](function(_0x1c9ee2){logger[_0x145d('0x10')](_0x145d('0x13'),_0x45ff66,_0x1c9ee2);_0x4ef552(_0x1c9ee2);});});}