Built motion from commit (unavailable).|2.5.16
[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 _0xad69=['../../config/logger','../../config/environment','jayson/promise','http','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x34b661,_0x507a7a){var _0x4a97dc=function(_0x5366d8){while(--_0x5366d8){_0x34b661['push'](_0x34b661['shift']());}};_0x4a97dc(++_0x507a7a);}(_0xad69,0x12a));var _0x9ad6=function(_0x462493,_0x35a197){_0x462493=_0x462493-0x0;var _0x2b4aed=_0xad69[_0x462493];return _0x2b4aed;};'use strict';var _=require(_0x9ad6('0x0'));var util=require('util');var moment=require(_0x9ad6('0x1'));var BPromise=require('bluebird');var rs=require(_0x9ad6('0x2'));var fs=require('fs');var Redis=require(_0x9ad6('0x3'));var db=require(_0x9ad6('0x4'))['db'];var utils=require(_0x9ad6('0x5'));var logger=require(_0x9ad6('0x6'))('rpc');var config=require(_0x9ad6('0x7'));var jayson=require(_0x9ad6('0x8'));var client=jayson['client'][_0x9ad6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8200a5,_0x4e14ec,_0xb0b1ea){return new BPromise(function(_0x53205c,_0x4083b8){return client['request'](_0x8200a5,_0xb0b1ea)['then'](function(_0x2c7ed5){logger['info'](_0x9ad6('0xa'),_0x4e14ec,_0x9ad6('0xb'));logger[_0x9ad6('0xc')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x4e14ec,_0x9ad6('0xb'),JSON[_0x9ad6('0xd')](_0x2c7ed5));if(_0x2c7ed5[_0x9ad6('0xe')]){if(_0x2c7ed5[_0x9ad6('0xe')][_0x9ad6('0xf')]===0x1f4){logger[_0x9ad6('0xe')](_0x9ad6('0xa'),_0x4e14ec,_0x2c7ed5[_0x9ad6('0xe')][_0x9ad6('0x10')]);return _0x4083b8(_0x2c7ed5[_0x9ad6('0xe')][_0x9ad6('0x10')]);}logger['error'](_0x9ad6('0xa'),_0x4e14ec,_0x2c7ed5['error']['message']);return _0x53205c(_0x2c7ed5[_0x9ad6('0xe')][_0x9ad6('0x10')]);}else{logger['info'](_0x9ad6('0xa'),_0x4e14ec,_0x9ad6('0xb'));_0x53205c(_0x2c7ed5[_0x9ad6('0x11')][_0x9ad6('0x10')]);}})[_0x9ad6('0x12')](function(_0x31129e){logger[_0x9ad6('0xe')]('ChatTransferReport,\x20%s,\x20%s',_0x4e14ec,_0x31129e);_0x4083b8(_0x31129e);});});}