Built motion from commit 0900f080.|2.5.45
[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 _0x3b2c=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','code','message','error','result','util','moment','bluebird','randomstring','ioredis'];(function(_0x2deb01,_0x4e741c){var _0x3920b3=function(_0x391a64){while(--_0x391a64){_0x2deb01['push'](_0x2deb01['shift']());}};_0x3920b3(++_0x4e741c);}(_0x3b2c,0x10c));var _0xc3b2=function(_0x14910c,_0x2f2a10){_0x14910c=_0x14910c-0x0;var _0x5012ec=_0x3b2c[_0x14910c];return _0x5012ec;};'use strict';var _=require('lodash');var util=require(_0xc3b2('0x0'));var moment=require(_0xc3b2('0x1'));var BPromise=require(_0xc3b2('0x2'));var rs=require(_0xc3b2('0x3'));var fs=require('fs');var Redis=require(_0xc3b2('0x4'));var db=require(_0xc3b2('0x5'))['db'];var utils=require(_0xc3b2('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xc3b2('0x7'));var jayson=require(_0xc3b2('0x8'));var client=jayson[_0xc3b2('0x9')][_0xc3b2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x31390e,_0x5285b8,_0x711e8b){return new BPromise(function(_0x4f2c51,_0x52852e){return client[_0xc3b2('0xb')](_0x31390e,_0x711e8b)[_0xc3b2('0xc')](function(_0x33cd8a){logger['info'](_0xc3b2('0xd'),_0x5285b8,_0xc3b2('0xe'));logger['debug'](_0xc3b2('0xf'),_0x5285b8,_0xc3b2('0xe'),JSON[_0xc3b2('0x10')](_0x33cd8a));if(_0x33cd8a['error']){if(_0x33cd8a['error'][_0xc3b2('0x11')]===0x1f4){logger['error'](_0xc3b2('0xd'),_0x5285b8,_0x33cd8a['error'][_0xc3b2('0x12')]);return _0x52852e(_0x33cd8a[_0xc3b2('0x13')][_0xc3b2('0x12')]);}logger['error'](_0xc3b2('0xd'),_0x5285b8,_0x33cd8a['error'][_0xc3b2('0x12')]);return _0x4f2c51(_0x33cd8a[_0xc3b2('0x13')][_0xc3b2('0x12')]);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x5285b8,'request\x20sent');_0x4f2c51(_0x33cd8a[_0xc3b2('0x14')][_0xc3b2('0x12')]);}})['catch'](function(_0x231a1e){logger[_0xc3b2('0x13')](_0xc3b2('0xd'),_0x5285b8,_0x231a1e);_0x52852e(_0x231a1e);});});}