77861379d95615c172877567c45aac0edb27210f
[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 _0x6bff=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','result','message','catch','lodash','util'];(function(_0x2c9a23,_0x185878){var _0x1db5d6=function(_0x24aa9e){while(--_0x24aa9e){_0x2c9a23['push'](_0x2c9a23['shift']());}};_0x1db5d6(++_0x185878);}(_0x6bff,0xa6));var _0xf6bf=function(_0x593180,_0x4c7742){_0x593180=_0x593180-0x0;var _0x33857e=_0x6bff[_0x593180];return _0x33857e;};'use strict';var _=require(_0xf6bf('0x0'));var util=require(_0xf6bf('0x1'));var moment=require('moment');var BPromise=require(_0xf6bf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf6bf('0x3'));var db=require(_0xf6bf('0x4'))['db'];var utils=require(_0xf6bf('0x5'));var logger=require(_0xf6bf('0x6'))('rpc');var config=require(_0xf6bf('0x7'));var jayson=require(_0xf6bf('0x8'));var client=jayson[_0xf6bf('0x9')][_0xf6bf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x9cf3a4,_0x139f2f,_0x199047){return new BPromise(function(_0x180f54,_0x5e135f){return client['request'](_0x9cf3a4,_0x199047)['then'](function(_0x2daaa0){logger[_0xf6bf('0xb')](_0xf6bf('0xc'),_0x139f2f,_0xf6bf('0xd'));logger[_0xf6bf('0xe')]('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x139f2f,_0xf6bf('0xd'),JSON[_0xf6bf('0xf')](_0x2daaa0));if(_0x2daaa0['error']){if(_0x2daaa0['error'][_0xf6bf('0x10')]===0x1f4){logger[_0xf6bf('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x139f2f,_0x2daaa0[_0xf6bf('0x11')]['message']);return _0x5e135f(_0x2daaa0[_0xf6bf('0x11')]['message']);}logger[_0xf6bf('0x11')](_0xf6bf('0xc'),_0x139f2f,_0x2daaa0['error']['message']);return _0x180f54(_0x2daaa0[_0xf6bf('0x11')]['message']);}else{logger[_0xf6bf('0xb')](_0xf6bf('0xc'),_0x139f2f,_0xf6bf('0xd'));_0x180f54(_0x2daaa0[_0xf6bf('0x12')][_0xf6bf('0x13')]);}})[_0xf6bf('0x14')](function(_0x5caf5f){logger[_0xf6bf('0x11')](_0xf6bf('0xc'),_0x139f2f,_0x5caf5f);_0x5e135f(_0x5caf5f);});});}