Built motion from commit (unavailable).|2.5.1
[motion2.git] / server / api / jscriptySessionReport / jscriptySessionReport.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 _0x1599=['jayson/promise','then','info','JscriptySessionReport,\x20%s,\x20%s','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','bluebird','ioredis','../../config/utils','../../config/environment'];(function(_0x398cd1,_0x20ca40){var _0x23b058=function(_0x4640fc){while(--_0x4640fc){_0x398cd1['push'](_0x398cd1['shift']());}};_0x23b058(++_0x20ca40);}(_0x1599,0xaa));var _0x9159=function(_0x1a8051,_0x44842e){_0x1a8051=_0x1a8051-0x0;var _0x5826b3=_0x1599[_0x1a8051];return _0x5826b3;};'use strict';var _=require(_0x9159('0x0'));var util=require(_0x9159('0x1'));var moment=require('moment');var BPromise=require(_0x9159('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9159('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9159('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x9159('0x5'));var jayson=require(_0x9159('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4d9338,_0x114b9c,_0x281108){return new BPromise(function(_0xd13216,_0x30250a){return client['request'](_0x4d9338,_0x281108)[_0x9159('0x7')](function(_0xa42043){logger[_0x9159('0x8')](_0x9159('0x9'),_0x114b9c,'request\x20sent');logger[_0x9159('0xa')](_0x9159('0xb'),_0x114b9c,'request\x20sent',JSON[_0x9159('0xc')](_0xa42043));if(_0xa42043[_0x9159('0xd')]){if(_0xa42043[_0x9159('0xd')]['code']===0x1f4){logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x114b9c,_0xa42043['error'][_0x9159('0xe')]);return _0x30250a(_0xa42043[_0x9159('0xd')][_0x9159('0xe')]);}logger[_0x9159('0xd')](_0x9159('0x9'),_0x114b9c,_0xa42043['error'][_0x9159('0xe')]);return _0xd13216(_0xa42043[_0x9159('0xd')][_0x9159('0xe')]);}else{logger[_0x9159('0x8')](_0x9159('0x9'),_0x114b9c,'request\x20sent');_0xd13216(_0xa42043[_0x9159('0xf')][_0x9159('0xe')]);}})['catch'](function(_0x59224c){logger[_0x9159('0xd')]('JscriptySessionReport,\x20%s,\x20%s',_0x114b9c,_0x59224c);_0x30250a(_0x59224c);});});}