2157b03a64e4fd9afff9ba429a2b4f113411ed82
[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 _0x81ed=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','ChatTransferReport,\x20%s,\x20%s','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x153fef,_0x4aabbc){var _0x5ad855=function(_0x37abc2){while(--_0x37abc2){_0x153fef['push'](_0x153fef['shift']());}};_0x5ad855(++_0x4aabbc);}(_0x81ed,0x69));var _0xd81e=function(_0x343c8d,_0xa735ac){_0x343c8d=_0x343c8d-0x0;var _0x270f07=_0x81ed[_0x343c8d];return _0x270f07;};'use strict';var _=require('lodash');var util=require(_0xd81e('0x0'));var moment=require(_0xd81e('0x1'));var BPromise=require(_0xd81e('0x2'));var rs=require(_0xd81e('0x3'));var fs=require('fs');var Redis=require(_0xd81e('0x4'));var db=require(_0xd81e('0x5'))['db'];var utils=require(_0xd81e('0x6'));var logger=require(_0xd81e('0x7'))('rpc');var config=require(_0xd81e('0x8'));var jayson=require(_0xd81e('0x9'));var client=jayson[_0xd81e('0xa')][_0xd81e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x12c2cc,_0x5cd6a0,_0x1fbe1b){return new BPromise(function(_0x212b7d,_0x41b30d){return client['request'](_0x12c2cc,_0x1fbe1b)[_0xd81e('0xc')](function(_0x17ea9f){logger[_0xd81e('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0x5cd6a0,'request\x20sent');logger[_0xd81e('0xe')](_0xd81e('0xf'),_0x5cd6a0,_0xd81e('0x10'),JSON[_0xd81e('0x11')](_0x17ea9f));if(_0x17ea9f[_0xd81e('0x12')]){if(_0x17ea9f[_0xd81e('0x12')]['code']===0x1f4){logger[_0xd81e('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x5cd6a0,_0x17ea9f[_0xd81e('0x12')][_0xd81e('0x13')]);return _0x41b30d(_0x17ea9f[_0xd81e('0x12')]['message']);}logger[_0xd81e('0x12')](_0xd81e('0x14'),_0x5cd6a0,_0x17ea9f[_0xd81e('0x12')][_0xd81e('0x13')]);return _0x212b7d(_0x17ea9f['error'][_0xd81e('0x13')]);}else{logger['info'](_0xd81e('0x14'),_0x5cd6a0,_0xd81e('0x10'));_0x212b7d(_0x17ea9f['result'][_0xd81e('0x13')]);}})[_0xd81e('0x15')](function(_0x579de3){logger[_0xd81e('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x5cd6a0,_0x579de3);_0x41b30d(_0x579de3);});});}