2160e2074ffdeb04d0c39dab90ca6ca314b282e4
[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 _0x4b6c=['../../config/logger','rpc','jayson/promise','client','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x5de202,_0x3ecc5b){var _0x116ef4=function(_0x2bf427){while(--_0x2bf427){_0x5de202['push'](_0x5de202['shift']());}};_0x116ef4(++_0x3ecc5b);}(_0x4b6c,0x14a));var _0xc4b6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4b6c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc4b6('0x0'));var util=require(_0xc4b6('0x1'));var moment=require('moment');var BPromise=require(_0xc4b6('0x2'));var rs=require(_0xc4b6('0x3'));var fs=require('fs');var Redis=require(_0xc4b6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc4b6('0x5'));var logger=require(_0xc4b6('0x6'))(_0xc4b6('0x7'));var config=require('../../config/environment');var jayson=require(_0xc4b6('0x8'));var client=jayson[_0xc4b6('0x9')][_0xc4b6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2948c6,_0x5829a9,_0x443998){return new BPromise(function(_0x4b935f,_0x4b723a){return client[_0xc4b6('0xb')](_0x2948c6,_0x443998)[_0xc4b6('0xc')](function(_0x433435){logger[_0xc4b6('0xd')](_0xc4b6('0xe'),_0x5829a9,_0xc4b6('0xf'));logger['debug'](_0xc4b6('0x10'),_0x5829a9,_0xc4b6('0xf'),JSON['stringify'](_0x433435));if(_0x433435[_0xc4b6('0x11')]){if(_0x433435[_0xc4b6('0x11')][_0xc4b6('0x12')]===0x1f4){logger[_0xc4b6('0x11')](_0xc4b6('0xe'),_0x5829a9,_0x433435[_0xc4b6('0x11')][_0xc4b6('0x13')]);return _0x4b723a(_0x433435[_0xc4b6('0x11')][_0xc4b6('0x13')]);}logger['error'](_0xc4b6('0xe'),_0x5829a9,_0x433435[_0xc4b6('0x11')]['message']);return _0x4b935f(_0x433435[_0xc4b6('0x11')]['message']);}else{logger[_0xc4b6('0xd')](_0xc4b6('0xe'),_0x5829a9,_0xc4b6('0xf'));_0x4b935f(_0x433435[_0xc4b6('0x14')]['message']);}})['catch'](function(_0x3e5527){logger[_0xc4b6('0x11')](_0xc4b6('0xe'),_0x5829a9,_0x3e5527);_0x4b723a(_0x3e5527);});});}