Built motion from commit 5ae82ce5.|2.6.7
[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 _0x305f=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','request','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','lodash','util'];(function(_0x47e41e,_0x12bf58){var _0xf81f18=function(_0x217456){while(--_0x217456){_0x47e41e['push'](_0x47e41e['shift']());}};_0xf81f18(++_0x12bf58);}(_0x305f,0x1c6));var _0xf305=function(_0x1b0bd0,_0xbbe219){_0x1b0bd0=_0x1b0bd0-0x0;var _0x2a0018=_0x305f[_0x1b0bd0];return _0x2a0018;};'use strict';var _=require(_0xf305('0x0'));var util=require(_0xf305('0x1'));var moment=require(_0xf305('0x2'));var BPromise=require(_0xf305('0x3'));var rs=require(_0xf305('0x4'));var fs=require('fs');var Redis=require(_0xf305('0x5'));var db=require(_0xf305('0x6'))['db'];var utils=require(_0xf305('0x7'));var logger=require('../../config/logger')(_0xf305('0x8'));var config=require('../../config/environment');var jayson=require(_0xf305('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x176f8c,_0xd87da6,_0x2e1d5b){return new BPromise(function(_0x29d811,_0x338014){return client[_0xf305('0xa')](_0x176f8c,_0x2e1d5b)['then'](function(_0x33a479){logger[_0xf305('0xb')](_0xf305('0xc'),_0xd87da6,_0xf305('0xd'));logger[_0xf305('0xe')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0xd87da6,_0xf305('0xd'),JSON['stringify'](_0x33a479));if(_0x33a479[_0xf305('0xf')]){if(_0x33a479[_0xf305('0xf')][_0xf305('0x10')]===0x1f4){logger[_0xf305('0xf')](_0xf305('0xc'),_0xd87da6,_0x33a479[_0xf305('0xf')][_0xf305('0x11')]);return _0x338014(_0x33a479[_0xf305('0xf')][_0xf305('0x11')]);}logger['error'](_0xf305('0xc'),_0xd87da6,_0x33a479['error'][_0xf305('0x11')]);return _0x29d811(_0x33a479[_0xf305('0xf')][_0xf305('0x11')]);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0xd87da6,_0xf305('0xd'));_0x29d811(_0x33a479[_0xf305('0x12')]['message']);}})['catch'](function(_0x42edb8){logger[_0xf305('0xf')](_0xf305('0xc'),_0xd87da6,_0x42edb8);_0x338014(_0x42edb8);});});}