3af4d7a987f7b6ba4d457037959d4e74c1f6f663
[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 _0xeea3=['JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0xeea3,0xd7));var _0x3eea=function(_0x1cc4da,_0x201bd5){_0x1cc4da=_0x1cc4da-0x0;var _0x2144f4=_0xeea3[_0x1cc4da];return _0x2144f4;};'use strict';var _=require(_0x3eea('0x0'));var util=require(_0x3eea('0x1'));var moment=require('moment');var BPromise=require(_0x3eea('0x2'));var rs=require(_0x3eea('0x3'));var fs=require('fs');var Redis=require(_0x3eea('0x4'));var db=require(_0x3eea('0x5'))['db'];var utils=require(_0x3eea('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x3eea('0x7'));var jayson=require(_0x3eea('0x8'));var client=jayson['client'][_0x3eea('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4123d9,_0x3e40c5,_0x545662){return new BPromise(function(_0x25fa3b,_0x2e2185){return client[_0x3eea('0xa')](_0x4123d9,_0x545662)[_0x3eea('0xb')](function(_0x3b59fd){logger['info'](_0x3eea('0xc'),_0x3e40c5,_0x3eea('0xd'));logger[_0x3eea('0xe')](_0x3eea('0xf'),_0x3e40c5,_0x3eea('0xd'),JSON[_0x3eea('0x10')](_0x3b59fd));if(_0x3b59fd[_0x3eea('0x11')]){if(_0x3b59fd[_0x3eea('0x11')][_0x3eea('0x12')]===0x1f4){logger['error'](_0x3eea('0xc'),_0x3e40c5,_0x3b59fd['error'][_0x3eea('0x13')]);return _0x2e2185(_0x3b59fd[_0x3eea('0x11')][_0x3eea('0x13')]);}logger['error'](_0x3eea('0xc'),_0x3e40c5,_0x3b59fd[_0x3eea('0x11')][_0x3eea('0x13')]);return _0x25fa3b(_0x3b59fd[_0x3eea('0x11')][_0x3eea('0x13')]);}else{logger[_0x3eea('0x14')]('JscriptySessionReport,\x20%s,\x20%s',_0x3e40c5,_0x3eea('0xd'));_0x25fa3b(_0x3b59fd[_0x3eea('0x15')][_0x3eea('0x13')]);}})[_0x3eea('0x16')](function(_0x5ee088){logger['error'](_0x3eea('0xc'),_0x3e40c5,_0x5ee088);_0x2e2185(_0x5ee088);});});}