Built motion from commit da617fac.|2.6.6
[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 _0x0423=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','randomstring','../../mysqldb','../../config/utils'];(function(_0x5c5fe7,_0x2a64eb){var _0xd817f=function(_0x54b2f2){while(--_0x54b2f2){_0x5c5fe7['push'](_0x5c5fe7['shift']());}};_0xd817f(++_0x2a64eb);}(_0x0423,0x18b));var _0x3042=function(_0x43028e,_0x33a648){_0x43028e=_0x43028e-0x0;var _0x2fed6d=_0x0423[_0x43028e];return _0x2fed6d;};'use strict';var _=require(_0x3042('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3042('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3042('0x2'))['db'];var utils=require(_0x3042('0x3'));var logger=require(_0x3042('0x4'))(_0x3042('0x5'));var config=require(_0x3042('0x6'));var jayson=require(_0x3042('0x7'));var client=jayson['client'][_0x3042('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x21a40d,_0x298fff,_0x55ce30){return new BPromise(function(_0x37daed,_0x373f35){return client[_0x3042('0x9')](_0x21a40d,_0x55ce30)[_0x3042('0xa')](function(_0x514e3a){logger['info'](_0x3042('0xb'),_0x298fff,_0x3042('0xc'));logger['debug'](_0x3042('0xd'),_0x298fff,'request\x20sent',JSON[_0x3042('0xe')](_0x514e3a));if(_0x514e3a[_0x3042('0xf')]){if(_0x514e3a[_0x3042('0xf')]['code']===0x1f4){logger[_0x3042('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x298fff,_0x514e3a[_0x3042('0xf')][_0x3042('0x10')]);return _0x373f35(_0x514e3a[_0x3042('0xf')][_0x3042('0x10')]);}logger[_0x3042('0xf')](_0x3042('0xb'),_0x298fff,_0x514e3a['error'][_0x3042('0x10')]);return _0x37daed(_0x514e3a[_0x3042('0xf')][_0x3042('0x10')]);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x298fff,_0x3042('0xc'));_0x37daed(_0x514e3a[_0x3042('0x11')][_0x3042('0x10')]);}})[_0x3042('0x12')](function(_0x41884d){logger[_0x3042('0xf')](_0x3042('0xb'),_0x298fff,_0x41884d);_0x373f35(_0x41884d);});});}