Built motion from commit eddce310.|2.6.12
[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 _0x19fc=['lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch'];(function(_0x1f5849,_0x59deb6){var _0x5bf165=function(_0x2ce300){while(--_0x2ce300){_0x1f5849['push'](_0x1f5849['shift']());}};_0x5bf165(++_0x59deb6);}(_0x19fc,0xe7));var _0xc19f=function(_0x1af1e1,_0x37bc24){_0x1af1e1=_0x1af1e1-0x0;var _0x5f3450=_0x19fc[_0x1af1e1];return _0x5f3450;};'use strict';var _=require(_0xc19f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc19f('0x1'));var rs=require(_0xc19f('0x2'));var fs=require('fs');var Redis=require(_0xc19f('0x3'));var db=require(_0xc19f('0x4'))['db'];var utils=require(_0xc19f('0x5'));var logger=require(_0xc19f('0x6'))('rpc');var config=require(_0xc19f('0x7'));var jayson=require(_0xc19f('0x8'));var client=jayson['client'][_0xc19f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ee52e,_0x32e333,_0xdfda83){return new BPromise(function(_0x5b1d3b,_0x12ab30){return client[_0xc19f('0xa')](_0x5ee52e,_0xdfda83)[_0xc19f('0xb')](function(_0x2b0062){logger['info'](_0xc19f('0xc'),_0x32e333,_0xc19f('0xd'));logger[_0xc19f('0xe')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x32e333,'request\x20sent',JSON['stringify'](_0x2b0062));if(_0x2b0062[_0xc19f('0xf')]){if(_0x2b0062[_0xc19f('0xf')][_0xc19f('0x10')]===0x1f4){logger[_0xc19f('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x32e333,_0x2b0062[_0xc19f('0xf')][_0xc19f('0x11')]);return _0x12ab30(_0x2b0062[_0xc19f('0xf')]['message']);}logger[_0xc19f('0xf')](_0xc19f('0xc'),_0x32e333,_0x2b0062[_0xc19f('0xf')][_0xc19f('0x11')]);return _0x5b1d3b(_0x2b0062['error'][_0xc19f('0x11')]);}else{logger[_0xc19f('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x32e333,_0xc19f('0xd'));_0x5b1d3b(_0x2b0062[_0xc19f('0x13')][_0xc19f('0x11')]);}})[_0xc19f('0x14')](function(_0x594332){logger[_0xc19f('0xf')](_0xc19f('0xc'),_0x32e333,_0x594332);_0x12ab30(_0x594332);});});}