Built motion from commit efa66e19.|2.6.22
[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 _0x19df=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','ChatTransferReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x2a5b3b,_0x4ebe31){var _0xae665a=function(_0x59e86a){while(--_0x59e86a){_0x2a5b3b['push'](_0x2a5b3b['shift']());}};_0xae665a(++_0x4ebe31);}(_0x19df,0xb4));var _0xf19d=function(_0x1a21ff,_0x4a7550){_0x1a21ff=_0x1a21ff-0x0;var _0x25afc1=_0x19df[_0x1a21ff];return _0x25afc1;};'use strict';var _=require(_0xf19d('0x0'));var util=require('util');var moment=require(_0xf19d('0x1'));var BPromise=require(_0xf19d('0x2'));var rs=require(_0xf19d('0x3'));var fs=require('fs');var Redis=require(_0xf19d('0x4'));var db=require(_0xf19d('0x5'))['db'];var utils=require(_0xf19d('0x6'));var logger=require(_0xf19d('0x7'))(_0xf19d('0x8'));var config=require('../../config/environment');var jayson=require(_0xf19d('0x9'));var client=jayson[_0xf19d('0xa')][_0xf19d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x345d8d,_0x56ee14,_0x30ccac){return new BPromise(function(_0x1a90b7,_0x5af20d){return client[_0xf19d('0xc')](_0x345d8d,_0x30ccac)[_0xf19d('0xd')](function(_0x3243cc){logger[_0xf19d('0xe')]('ChatTransferReport,\x20%s,\x20%s',_0x56ee14,_0xf19d('0xf'));logger['debug'](_0xf19d('0x10'),_0x56ee14,_0xf19d('0xf'),JSON['stringify'](_0x3243cc));if(_0x3243cc[_0xf19d('0x11')]){if(_0x3243cc[_0xf19d('0x11')][_0xf19d('0x12')]===0x1f4){logger['error'](_0xf19d('0x13'),_0x56ee14,_0x3243cc[_0xf19d('0x11')][_0xf19d('0x14')]);return _0x5af20d(_0x3243cc['error']['message']);}logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x56ee14,_0x3243cc['error']['message']);return _0x1a90b7(_0x3243cc[_0xf19d('0x11')]['message']);}else{logger[_0xf19d('0xe')]('ChatTransferReport,\x20%s,\x20%s',_0x56ee14,_0xf19d('0xf'));_0x1a90b7(_0x3243cc[_0xf19d('0x15')][_0xf19d('0x14')]);}})[_0xf19d('0x16')](function(_0x28be91){logger[_0xf19d('0x11')](_0xf19d('0x13'),_0x56ee14,_0x28be91);_0x5af20d(_0x28be91);});});}