20c87338a189dbc95a27d763ad5be0cabc994b44
[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 _0xc106=['http','request','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client'];(function(_0x1e0d8c,_0xce70){var _0x8b25c=function(_0x491458){while(--_0x491458){_0x1e0d8c['push'](_0x1e0d8c['shift']());}};_0x8b25c(++_0xce70);}(_0xc106,0x17d));var _0x6c10=function(_0x138cdd,_0x5d0708){_0x138cdd=_0x138cdd-0x0;var _0x285a91=_0xc106[_0x138cdd];return _0x285a91;};'use strict';var _=require(_0x6c10('0x0'));var util=require(_0x6c10('0x1'));var moment=require(_0x6c10('0x2'));var BPromise=require('bluebird');var rs=require(_0x6c10('0x3'));var fs=require('fs');var Redis=require(_0x6c10('0x4'));var db=require(_0x6c10('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6c10('0x6'))(_0x6c10('0x7'));var config=require('../../config/environment');var jayson=require(_0x6c10('0x8'));var client=jayson[_0x6c10('0x9')][_0x6c10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x367f44,_0x4256f4,_0x4ffb1c){return new BPromise(function(_0x52b2ff,_0x3ad018){return client[_0x6c10('0xb')](_0x367f44,_0x4ffb1c)['then'](function(_0x2a59f3){logger[_0x6c10('0xc')](_0x6c10('0xd'),_0x4256f4,'request\x20sent');logger[_0x6c10('0xe')](_0x6c10('0xf'),_0x4256f4,_0x6c10('0x10'),JSON[_0x6c10('0x11')](_0x2a59f3));if(_0x2a59f3[_0x6c10('0x12')]){if(_0x2a59f3[_0x6c10('0x12')][_0x6c10('0x13')]===0x1f4){logger[_0x6c10('0x12')](_0x6c10('0xd'),_0x4256f4,_0x2a59f3[_0x6c10('0x12')][_0x6c10('0x14')]);return _0x3ad018(_0x2a59f3[_0x6c10('0x12')][_0x6c10('0x14')]);}logger[_0x6c10('0x12')](_0x6c10('0xd'),_0x4256f4,_0x2a59f3[_0x6c10('0x12')][_0x6c10('0x14')]);return _0x52b2ff(_0x2a59f3['error'][_0x6c10('0x14')]);}else{logger[_0x6c10('0xc')]('ChatTransferReport,\x20%s,\x20%s',_0x4256f4,_0x6c10('0x10'));_0x52b2ff(_0x2a59f3[_0x6c10('0x15')][_0x6c10('0x14')]);}})[_0x6c10('0x16')](function(_0x53483c){logger['error'](_0x6c10('0xd'),_0x4256f4,_0x53483c);_0x3ad018(_0x53483c);});});}