Built motion from commit 6a0adb95.|2.6.31
[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 _0xbd1b=['ChatTransferReport,\x20%s,\x20%s','info','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x567f53,_0x1e0fc4){var _0x589467=function(_0x4cf0a7){while(--_0x4cf0a7){_0x567f53['push'](_0x567f53['shift']());}};_0x589467(++_0x1e0fc4);}(_0xbd1b,0x1e8));var _0xbbd1=function(_0x1c9528,_0x4d2c69){_0x1c9528=_0x1c9528-0x0;var _0x33d4b7=_0xbd1b[_0x1c9528];return _0x33d4b7;};'use strict';var _=require(_0xbbd1('0x0'));var util=require(_0xbbd1('0x1'));var moment=require(_0xbbd1('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbbd1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbbd1('0x4'));var logger=require(_0xbbd1('0x5'))(_0xbbd1('0x6'));var config=require(_0xbbd1('0x7'));var jayson=require(_0xbbd1('0x8'));var client=jayson[_0xbbd1('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x989f92,_0x51f8dc,_0x307995){return new BPromise(function(_0x17026d,_0x308de4){return client[_0xbbd1('0xa')](_0x989f92,_0x307995)[_0xbbd1('0xb')](function(_0x408181){logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x51f8dc,_0xbbd1('0xc'));logger[_0xbbd1('0xd')](_0xbbd1('0xe'),_0x51f8dc,_0xbbd1('0xc'),JSON['stringify'](_0x408181));if(_0x408181[_0xbbd1('0xf')]){if(_0x408181[_0xbbd1('0xf')][_0xbbd1('0x10')]===0x1f4){logger[_0xbbd1('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x51f8dc,_0x408181[_0xbbd1('0xf')][_0xbbd1('0x11')]);return _0x308de4(_0x408181[_0xbbd1('0xf')]['message']);}logger[_0xbbd1('0xf')](_0xbbd1('0x12'),_0x51f8dc,_0x408181[_0xbbd1('0xf')][_0xbbd1('0x11')]);return _0x17026d(_0x408181[_0xbbd1('0xf')][_0xbbd1('0x11')]);}else{logger[_0xbbd1('0x13')](_0xbbd1('0x12'),_0x51f8dc,_0xbbd1('0xc'));_0x17026d(_0x408181[_0xbbd1('0x14')]['message']);}})[_0xbbd1('0x15')](function(_0x4ea44d){logger[_0xbbd1('0xf')](_0xbbd1('0x12'),_0x51f8dc,_0x4ea44d);_0x308de4(_0x4ea44d);});});}