cc339334f57d7ea17206184e392b101ed6079529
[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 _0xaa67=['error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5a8921,_0x2ce5cb){var _0x4e54a3=function(_0x11cc3d){while(--_0x11cc3d){_0x5a8921['push'](_0x5a8921['shift']());}};_0x4e54a3(++_0x2ce5cb);}(_0xaa67,0x162));var _0x7aa6=function(_0x5a7801,_0x48ac30){_0x5a7801=_0x5a7801-0x0;var _0x14426e=_0xaa67[_0x5a7801];return _0x14426e;};'use strict';var _=require(_0x7aa6('0x0'));var util=require(_0x7aa6('0x1'));var moment=require(_0x7aa6('0x2'));var BPromise=require(_0x7aa6('0x3'));var rs=require(_0x7aa6('0x4'));var fs=require('fs');var Redis=require(_0x7aa6('0x5'));var db=require(_0x7aa6('0x6'))['db'];var utils=require(_0x7aa6('0x7'));var logger=require('../../config/logger')(_0x7aa6('0x8'));var config=require(_0x7aa6('0x9'));var jayson=require(_0x7aa6('0xa'));var client=jayson[_0x7aa6('0xb')][_0x7aa6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x22d823,_0xc719d7,_0x3cd693){return new BPromise(function(_0x384062,_0x149b0d){return client[_0x7aa6('0xd')](_0x22d823,_0x3cd693)[_0x7aa6('0xe')](function(_0x5e9945){logger[_0x7aa6('0xf')](_0x7aa6('0x10'),_0xc719d7,_0x7aa6('0x11'));logger[_0x7aa6('0x12')](_0x7aa6('0x13'),_0xc719d7,_0x7aa6('0x11'),JSON[_0x7aa6('0x14')](_0x5e9945));if(_0x5e9945[_0x7aa6('0x15')]){if(_0x5e9945[_0x7aa6('0x15')]['code']===0x1f4){logger[_0x7aa6('0x15')](_0x7aa6('0x10'),_0xc719d7,_0x5e9945[_0x7aa6('0x15')]['message']);return _0x149b0d(_0x5e9945[_0x7aa6('0x15')][_0x7aa6('0x16')]);}logger['error'](_0x7aa6('0x10'),_0xc719d7,_0x5e9945[_0x7aa6('0x15')][_0x7aa6('0x16')]);return _0x384062(_0x5e9945['error'][_0x7aa6('0x16')]);}else{logger[_0x7aa6('0xf')](_0x7aa6('0x10'),_0xc719d7,'request\x20sent');_0x384062(_0x5e9945[_0x7aa6('0x17')][_0x7aa6('0x16')]);}})[_0x7aa6('0x18')](function(_0x4826e8){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0xc719d7,_0x4826e8);_0x149b0d(_0x4826e8);});});}