Built motion from commit 87cd5f02.|2.5.48
[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 _0xdd8b=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result'];(function(_0x234efe,_0x5e41d0){var _0x184168=function(_0x51585b){while(--_0x51585b){_0x234efe['push'](_0x234efe['shift']());}};_0x184168(++_0x5e41d0);}(_0xdd8b,0x7e));var _0xbdd8=function(_0x3124f8,_0x1a8b23){_0x3124f8=_0x3124f8-0x0;var _0x5bab5f=_0xdd8b[_0x3124f8];return _0x5bab5f;};'use strict';var _=require('lodash');var util=require(_0xbdd8('0x0'));var moment=require(_0xbdd8('0x1'));var BPromise=require(_0xbdd8('0x2'));var rs=require(_0xbdd8('0x3'));var fs=require('fs');var Redis=require(_0xbdd8('0x4'));var db=require(_0xbdd8('0x5'))['db'];var utils=require(_0xbdd8('0x6'));var logger=require(_0xbdd8('0x7'))(_0xbdd8('0x8'));var config=require(_0xbdd8('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbdd8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x34e8c1,_0x250cf5,_0x575dc4){return new BPromise(function(_0x2f7e62,_0x4377fd){return client[_0xbdd8('0xb')](_0x34e8c1,_0x575dc4)[_0xbdd8('0xc')](function(_0x337503){logger[_0xbdd8('0xd')](_0xbdd8('0xe'),_0x250cf5,_0xbdd8('0xf'));logger[_0xbdd8('0x10')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x250cf5,_0xbdd8('0xf'),JSON['stringify'](_0x337503));if(_0x337503[_0xbdd8('0x11')]){if(_0x337503['error'][_0xbdd8('0x12')]===0x1f4){logger['error'](_0xbdd8('0xe'),_0x250cf5,_0x337503[_0xbdd8('0x11')]['message']);return _0x4377fd(_0x337503[_0xbdd8('0x11')][_0xbdd8('0x13')]);}logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x250cf5,_0x337503['error'][_0xbdd8('0x13')]);return _0x2f7e62(_0x337503['error']['message']);}else{logger['info'](_0xbdd8('0xe'),_0x250cf5,_0xbdd8('0xf'));_0x2f7e62(_0x337503[_0xbdd8('0x14')][_0xbdd8('0x13')]);}})['catch'](function(_0x3f57c6){logger['error'](_0xbdd8('0xe'),_0x250cf5,_0x3f57c6);_0x4377fd(_0x3f57c6);});});}