Built motion from commit (unavailable).|2.5.30
[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 _0xeda3=['code','message','result','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x4d7116,_0xdb8175){var _0x4593dc=function(_0x51d44e){while(--_0x51d44e){_0x4d7116['push'](_0x4d7116['shift']());}};_0x4593dc(++_0xdb8175);}(_0xeda3,0x17f));var _0x3eda=function(_0x35351c,_0x470ac6){_0x35351c=_0x35351c-0x0;var _0x1f82a6=_0xeda3[_0x35351c];return _0x1f82a6;};'use strict';var _=require(_0x3eda('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3eda('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3eda('0x2'));var db=require(_0x3eda('0x3'))['db'];var utils=require(_0x3eda('0x4'));var logger=require(_0x3eda('0x5'))('rpc');var config=require(_0x3eda('0x6'));var jayson=require(_0x3eda('0x7'));var client=jayson[_0x3eda('0x8')][_0x3eda('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xcab0a9,_0x4aca23,_0x36ce68){return new BPromise(function(_0x3aca96,_0x2da7fd){return client['request'](_0xcab0a9,_0x36ce68)[_0x3eda('0xa')](function(_0x4cd0d3){logger[_0x3eda('0xb')](_0x3eda('0xc'),_0x4aca23,_0x3eda('0xd'));logger[_0x3eda('0xe')](_0x3eda('0xf'),_0x4aca23,_0x3eda('0xd'),JSON['stringify'](_0x4cd0d3));if(_0x4cd0d3[_0x3eda('0x10')]){if(_0x4cd0d3[_0x3eda('0x10')][_0x3eda('0x11')]===0x1f4){logger[_0x3eda('0x10')](_0x3eda('0xc'),_0x4aca23,_0x4cd0d3[_0x3eda('0x10')][_0x3eda('0x12')]);return _0x2da7fd(_0x4cd0d3[_0x3eda('0x10')][_0x3eda('0x12')]);}logger[_0x3eda('0x10')](_0x3eda('0xc'),_0x4aca23,_0x4cd0d3[_0x3eda('0x10')][_0x3eda('0x12')]);return _0x3aca96(_0x4cd0d3[_0x3eda('0x10')][_0x3eda('0x12')]);}else{logger[_0x3eda('0xb')](_0x3eda('0xc'),_0x4aca23,_0x3eda('0xd'));_0x3aca96(_0x4cd0d3[_0x3eda('0x13')][_0x3eda('0x12')]);}})['catch'](function(_0x2ff48f){logger[_0x3eda('0x10')](_0x3eda('0xc'),_0x4aca23,_0x2ff48f);_0x2da7fd(_0x2ff48f);});});}