Built motion from commit (unavailable).|2.5.13
[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 _0xba05=['message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x2e3bad,_0x67f113){var _0x19e3bf=function(_0x2b4baf){while(--_0x2b4baf){_0x2e3bad['push'](_0x2e3bad['shift']());}};_0x19e3bf(++_0x67f113);}(_0xba05,0x11a));var _0x5ba0=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0xba05[_0x42bdad];return _0x122626;};'use strict';var _=require(_0x5ba0('0x0'));var util=require(_0x5ba0('0x1'));var moment=require(_0x5ba0('0x2'));var BPromise=require(_0x5ba0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5ba0('0x4'));var db=require(_0x5ba0('0x5'))['db'];var utils=require(_0x5ba0('0x6'));var logger=require(_0x5ba0('0x7'))(_0x5ba0('0x8'));var config=require(_0x5ba0('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5ba0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x300f64,_0x1d3056,_0x1827ac){return new BPromise(function(_0x2fdd15,_0x49a6d9){return client[_0x5ba0('0xb')](_0x300f64,_0x1827ac)[_0x5ba0('0xc')](function(_0xe235cf){logger[_0x5ba0('0xd')](_0x5ba0('0xe'),_0x1d3056,_0x5ba0('0xf'));logger['debug']('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x1d3056,_0x5ba0('0xf'),JSON['stringify'](_0xe235cf));if(_0xe235cf['error']){if(_0xe235cf[_0x5ba0('0x10')][_0x5ba0('0x11')]===0x1f4){logger[_0x5ba0('0x10')](_0x5ba0('0xe'),_0x1d3056,_0xe235cf[_0x5ba0('0x10')][_0x5ba0('0x12')]);return _0x49a6d9(_0xe235cf['error'][_0x5ba0('0x12')]);}logger[_0x5ba0('0x10')](_0x5ba0('0xe'),_0x1d3056,_0xe235cf[_0x5ba0('0x10')][_0x5ba0('0x12')]);return _0x2fdd15(_0xe235cf[_0x5ba0('0x10')][_0x5ba0('0x12')]);}else{logger[_0x5ba0('0xd')](_0x5ba0('0xe'),_0x1d3056,'request\x20sent');_0x2fdd15(_0xe235cf[_0x5ba0('0x13')][_0x5ba0('0x12')]);}})['catch'](function(_0x15c1af){logger[_0x5ba0('0x10')](_0x5ba0('0xe'),_0x1d3056,_0x15c1af);_0x49a6d9(_0x15c1af);});});}