Built motion from commit (unavailable).|2.4.18
[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 _0x693b=['request\x20sent','debug','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s'];(function(_0xfc81e3,_0x57d42a){var _0x473d29=function(_0x2e903b){while(--_0x2e903b){_0xfc81e3['push'](_0xfc81e3['shift']());}};_0x473d29(++_0x57d42a);}(_0x693b,0x13b));var _0xb693=function(_0x2fdfda,_0x35fc00){_0x2fdfda=_0x2fdfda-0x0;var _0x284bc9=_0x693b[_0x2fdfda];return _0x284bc9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb693('0x0'));var BPromise=require(_0xb693('0x1'));var rs=require(_0xb693('0x2'));var fs=require('fs');var Redis=require(_0xb693('0x3'));var db=require(_0xb693('0x4'))['db'];var utils=require(_0xb693('0x5'));var logger=require('../../config/logger')(_0xb693('0x6'));var config=require(_0xb693('0x7'));var jayson=require(_0xb693('0x8'));var client=jayson[_0xb693('0x9')][_0xb693('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4a4680,_0x4d1ea5,_0xd4cff9){return new BPromise(function(_0x57378d,_0x44ca77){return client[_0xb693('0xb')](_0x4a4680,_0xd4cff9)[_0xb693('0xc')](function(_0x238e03){logger[_0xb693('0xd')](_0xb693('0xe'),_0x4d1ea5,_0xb693('0xf'));logger[_0xb693('0x10')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x4d1ea5,'request\x20sent',JSON['stringify'](_0x238e03));if(_0x238e03[_0xb693('0x11')]){if(_0x238e03[_0xb693('0x11')][_0xb693('0x12')]===0x1f4){logger['error'](_0xb693('0xe'),_0x4d1ea5,_0x238e03[_0xb693('0x11')]['message']);return _0x44ca77(_0x238e03['error'][_0xb693('0x13')]);}logger[_0xb693('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x4d1ea5,_0x238e03['error'][_0xb693('0x13')]);return _0x57378d(_0x238e03[_0xb693('0x11')][_0xb693('0x13')]);}else{logger[_0xb693('0xd')](_0xb693('0xe'),_0x4d1ea5,'request\x20sent');_0x57378d(_0x238e03[_0xb693('0x14')][_0xb693('0x13')]);}})[_0xb693('0x15')](function(_0x1d3075){logger[_0xb693('0x11')](_0xb693('0xe'),_0x4d1ea5,_0x1d3075);_0x44ca77(_0x1d3075);});});}