99c3edeec394f8b0a141596d9242dd5bbb3ee7a5
[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 _0xc61c=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','ChatTransferReport,\x20%s,\x20%s','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x344bd7,_0x38a213){var _0x2a2b98=function(_0x1624be){while(--_0x1624be){_0x344bd7['push'](_0x344bd7['shift']());}};_0x2a2b98(++_0x38a213);}(_0xc61c,0x73));var _0xcc61=function(_0x50004c,_0x55215d){_0x50004c=_0x50004c-0x0;var _0x3c8b0=_0xc61c[_0x50004c];return _0x3c8b0;};'use strict';var _=require(_0xcc61('0x0'));var util=require(_0xcc61('0x1'));var moment=require(_0xcc61('0x2'));var BPromise=require(_0xcc61('0x3'));var rs=require(_0xcc61('0x4'));var fs=require('fs');var Redis=require(_0xcc61('0x5'));var db=require(_0xcc61('0x6'))['db'];var utils=require(_0xcc61('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xcc61('0x8'));var jayson=require(_0xcc61('0x9'));var client=jayson[_0xcc61('0xa')][_0xcc61('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x29bc4f,_0x1af7f3,_0x2a5073){return new BPromise(function(_0x43649c,_0x5b69fd){return client[_0xcc61('0xc')](_0x29bc4f,_0x2a5073)['then'](function(_0xfd1517){logger[_0xcc61('0xd')](_0xcc61('0xe'),_0x1af7f3,'request\x20sent');logger['debug'](_0xcc61('0xf'),_0x1af7f3,_0xcc61('0x10'),JSON[_0xcc61('0x11')](_0xfd1517));if(_0xfd1517['error']){if(_0xfd1517[_0xcc61('0x12')][_0xcc61('0x13')]===0x1f4){logger[_0xcc61('0x12')](_0xcc61('0xe'),_0x1af7f3,_0xfd1517['error'][_0xcc61('0x14')]);return _0x5b69fd(_0xfd1517[_0xcc61('0x12')]['message']);}logger[_0xcc61('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x1af7f3,_0xfd1517['error'][_0xcc61('0x14')]);return _0x43649c(_0xfd1517[_0xcc61('0x12')]['message']);}else{logger[_0xcc61('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0x1af7f3,_0xcc61('0x10'));_0x43649c(_0xfd1517[_0xcc61('0x15')][_0xcc61('0x14')]);}})[_0xcc61('0x16')](function(_0x5e6926){logger[_0xcc61('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x1af7f3,_0x5e6926);_0x5b69fd(_0x5e6926);});});}