Built motion from commit (unavailable).|2.5.22
[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 _0x9b2f=['util','moment','bluebird','randomstring','../../config/logger','rpc','client','http','request','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','info','result','catch'];(function(_0x296c05,_0x167a34){var _0x26a4f0=function(_0x24e635){while(--_0x24e635){_0x296c05['push'](_0x296c05['shift']());}};_0x26a4f0(++_0x167a34);}(_0x9b2f,0x12c));var _0xf9b2=function(_0x2a0738,_0x3c0bc5){_0x2a0738=_0x2a0738-0x0;var _0x159679=_0x9b2f[_0x2a0738];return _0x159679;};'use strict';var _=require('lodash');var util=require(_0xf9b2('0x0'));var moment=require(_0xf9b2('0x1'));var BPromise=require(_0xf9b2('0x2'));var rs=require(_0xf9b2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf9b2('0x4'))(_0xf9b2('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf9b2('0x6')][_0xf9b2('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1cdc78,_0x36cf63,_0x3a0a18){return new BPromise(function(_0x443f04,_0x3b8bc6){return client[_0xf9b2('0x8')](_0x1cdc78,_0x3a0a18)[_0xf9b2('0x9')](function(_0x27f34e){logger['info'](_0xf9b2('0xa'),_0x36cf63,_0xf9b2('0xb'));logger[_0xf9b2('0xc')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x36cf63,'request\x20sent',JSON[_0xf9b2('0xd')](_0x27f34e));if(_0x27f34e['error']){if(_0x27f34e['error'][_0xf9b2('0xe')]===0x1f4){logger['error'](_0xf9b2('0xa'),_0x36cf63,_0x27f34e[_0xf9b2('0xf')][_0xf9b2('0x10')]);return _0x3b8bc6(_0x27f34e[_0xf9b2('0xf')]['message']);}logger[_0xf9b2('0xf')](_0xf9b2('0xa'),_0x36cf63,_0x27f34e[_0xf9b2('0xf')][_0xf9b2('0x10')]);return _0x443f04(_0x27f34e['error']['message']);}else{logger[_0xf9b2('0x11')](_0xf9b2('0xa'),_0x36cf63,'request\x20sent');_0x443f04(_0x27f34e[_0xf9b2('0x12')]['message']);}})[_0xf9b2('0x13')](function(_0x2155fd){logger[_0xf9b2('0xf')](_0xf9b2('0xa'),_0x36cf63,_0x2155fd);_0x3b8bc6(_0x2155fd);});});}