Built motion from commit 4ffc18b1.|2.6.31
[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 _0x5c3c=['JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','JscriptySessionReport,\x20%s,\x20%s','request\x20sent'];(function(_0x454e91,_0x534c69){var _0x13ee4e=function(_0x257198){while(--_0x257198){_0x454e91['push'](_0x454e91['shift']());}};_0x13ee4e(++_0x534c69);}(_0x5c3c,0x132));var _0xc5c3=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0x5c3c[_0x50aa2e];return _0x5e07f0;};'use strict';var _=require(_0xc5c3('0x0'));var util=require(_0xc5c3('0x1'));var moment=require(_0xc5c3('0x2'));var BPromise=require(_0xc5c3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc5c3('0x4'));var db=require(_0xc5c3('0x5'))['db'];var utils=require(_0xc5c3('0x6'));var logger=require(_0xc5c3('0x7'))(_0xc5c3('0x8'));var config=require(_0xc5c3('0x9'));var jayson=require(_0xc5c3('0xa'));var client=jayson[_0xc5c3('0xb')][_0xc5c3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5a392b,_0x4b8404,_0x591f7d){return new BPromise(function(_0x723c31,_0x522be1){return client['request'](_0x5a392b,_0x591f7d)[_0xc5c3('0xd')](function(_0x46e2c1){logger['info'](_0xc5c3('0xe'),_0x4b8404,_0xc5c3('0xf'));logger['debug'](_0xc5c3('0x10'),_0x4b8404,_0xc5c3('0xf'),JSON[_0xc5c3('0x11')](_0x46e2c1));if(_0x46e2c1['error']){if(_0x46e2c1[_0xc5c3('0x12')][_0xc5c3('0x13')]===0x1f4){logger['error'](_0xc5c3('0xe'),_0x4b8404,_0x46e2c1[_0xc5c3('0x12')][_0xc5c3('0x14')]);return _0x522be1(_0x46e2c1['error'][_0xc5c3('0x14')]);}logger[_0xc5c3('0x12')](_0xc5c3('0xe'),_0x4b8404,_0x46e2c1[_0xc5c3('0x12')][_0xc5c3('0x14')]);return _0x723c31(_0x46e2c1['error']['message']);}else{logger[_0xc5c3('0x15')](_0xc5c3('0xe'),_0x4b8404,_0xc5c3('0xf'));_0x723c31(_0x46e2c1[_0xc5c3('0x16')]['message']);}})['catch'](function(_0x467ba9){logger['error'](_0xc5c3('0xe'),_0x4b8404,_0x467ba9);_0x522be1(_0x467ba9);});});}