9b54781608b81ce83bf93ad57c09c778c6a8b1a3
[motion2.git] / server / api / chatTransferReport / chatTransferReport.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 _0x7939=['../../config/environment','client','http','request','then','info','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatTransferReport,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x514a70,_0x3fa95f){var _0x5896c0=function(_0x26bc5f){while(--_0x26bc5f){_0x514a70['push'](_0x514a70['shift']());}};_0x5896c0(++_0x3fa95f);}(_0x7939,0x1f2));var _0x9793=function(_0x120294,_0x193e17){_0x120294=_0x120294-0x0;var _0xd92627=_0x7939[_0x120294];return _0xd92627;};'use strict';var _=require(_0x9793('0x0'));var util=require('util');var moment=require(_0x9793('0x1'));var BPromise=require(_0x9793('0x2'));var rs=require(_0x9793('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9793('0x4'))['db'];var utils=require(_0x9793('0x5'));var logger=require(_0x9793('0x6'))(_0x9793('0x7'));var config=require(_0x9793('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9793('0x9')][_0x9793('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5d9ecd,_0x36027d,_0x229d6b){return new BPromise(function(_0x2d21f5,_0x4d69da){return client[_0x9793('0xb')](_0x5d9ecd,_0x229d6b)[_0x9793('0xc')](function(_0x498a1d){logger[_0x9793('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0x36027d,_0x9793('0xe'));logger[_0x9793('0xf')](_0x9793('0x10'),_0x36027d,_0x9793('0xe'),JSON[_0x9793('0x11')](_0x498a1d));if(_0x498a1d['error']){if(_0x498a1d[_0x9793('0x12')][_0x9793('0x13')]===0x1f4){logger['error'](_0x9793('0x14'),_0x36027d,_0x498a1d[_0x9793('0x12')][_0x9793('0x15')]);return _0x4d69da(_0x498a1d[_0x9793('0x12')][_0x9793('0x15')]);}logger[_0x9793('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x36027d,_0x498a1d[_0x9793('0x12')][_0x9793('0x15')]);return _0x2d21f5(_0x498a1d['error'][_0x9793('0x15')]);}else{logger[_0x9793('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0x36027d,'request\x20sent');_0x2d21f5(_0x498a1d['result'][_0x9793('0x15')]);}})[_0x9793('0x16')](function(_0x5cbdd2){logger[_0x9793('0x12')](_0x9793('0x14'),_0x36027d,_0x5cbdd2);_0x4d69da(_0x5cbdd2);});});}