b6b914d3622a6f4202073cf52f8f41d33338bec2
[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 _0xa023=['code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x117d33,_0x518604){var _0x2e858b=function(_0x225bdf){while(--_0x225bdf){_0x117d33['push'](_0x117d33['shift']());}};_0x2e858b(++_0x518604);}(_0xa023,0x101));var _0x3a02=function(_0x22fb5b,_0x4d747a){_0x22fb5b=_0x22fb5b-0x0;var _0xf98be5=_0xa023[_0x22fb5b];return _0xf98be5;};'use strict';var _=require(_0x3a02('0x0'));var util=require('util');var moment=require(_0x3a02('0x1'));var BPromise=require(_0x3a02('0x2'));var rs=require(_0x3a02('0x3'));var fs=require('fs');var Redis=require(_0x3a02('0x4'));var db=require(_0x3a02('0x5'))['db'];var utils=require(_0x3a02('0x6'));var logger=require(_0x3a02('0x7'))(_0x3a02('0x8'));var config=require(_0x3a02('0x9'));var jayson=require(_0x3a02('0xa'));var client=jayson['client'][_0x3a02('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2d5931,_0x145779,_0x3ee833){return new BPromise(function(_0x436018,_0x4490c8){return client[_0x3a02('0xc')](_0x2d5931,_0x3ee833)[_0x3a02('0xd')](function(_0x3055c3){logger['info'](_0x3a02('0xe'),_0x145779,_0x3a02('0xf'));logger[_0x3a02('0x10')](_0x3a02('0x11'),_0x145779,'request\x20sent',JSON['stringify'](_0x3055c3));if(_0x3055c3[_0x3a02('0x12')]){if(_0x3055c3[_0x3a02('0x12')][_0x3a02('0x13')]===0x1f4){logger[_0x3a02('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x145779,_0x3055c3[_0x3a02('0x12')][_0x3a02('0x14')]);return _0x4490c8(_0x3055c3[_0x3a02('0x12')]['message']);}logger[_0x3a02('0x12')](_0x3a02('0xe'),_0x145779,_0x3055c3[_0x3a02('0x12')][_0x3a02('0x14')]);return _0x436018(_0x3055c3['error'][_0x3a02('0x14')]);}else{logger['info'](_0x3a02('0xe'),_0x145779,_0x3a02('0xf'));_0x436018(_0x3055c3[_0x3a02('0x15')][_0x3a02('0x14')]);}})[_0x3a02('0x16')](function(_0x50104c){logger[_0x3a02('0x12')](_0x3a02('0xe'),_0x145779,_0x50104c);_0x4490c8(_0x50104c);});});}