Built motion from commit (unavailable).|2.5.16
[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 _0x16eb=['info','result','catch','util','bluebird','ioredis','../../mysqldb','rpc','jayson/promise','request','then','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0xd77fa2,_0x489a23){var _0x101679=function(_0xebb241){while(--_0xebb241){_0xd77fa2['push'](_0xd77fa2['shift']());}};_0x101679(++_0x489a23);}(_0x16eb,0xc1));var _0xb16e=function(_0x1b5256,_0x10179d){_0x1b5256=_0x1b5256-0x0;var _0x2ffa09=_0x16eb[_0x1b5256];return _0x2ffa09;};'use strict';var _=require('lodash');var util=require(_0xb16e('0x0'));var moment=require('moment');var BPromise=require(_0xb16e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb16e('0x2'));var db=require(_0xb16e('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb16e('0x4'));var config=require('../../config/environment');var jayson=require(_0xb16e('0x5'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x400ff4,_0x5141cd,_0x2a881e){return new BPromise(function(_0x55063d,_0x55d5c2){return client[_0xb16e('0x6')](_0x400ff4,_0x2a881e)[_0xb16e('0x7')](function(_0x47978c){logger['info'](_0xb16e('0x8'),_0x5141cd,_0xb16e('0x9'));logger[_0xb16e('0xa')](_0xb16e('0xb'),_0x5141cd,'request\x20sent',JSON[_0xb16e('0xc')](_0x47978c));if(_0x47978c[_0xb16e('0xd')]){if(_0x47978c[_0xb16e('0xd')][_0xb16e('0xe')]===0x1f4){logger[_0xb16e('0xd')](_0xb16e('0x8'),_0x5141cd,_0x47978c[_0xb16e('0xd')]['message']);return _0x55d5c2(_0x47978c[_0xb16e('0xd')]['message']);}logger['error'](_0xb16e('0x8'),_0x5141cd,_0x47978c[_0xb16e('0xd')][_0xb16e('0xf')]);return _0x55063d(_0x47978c['error'][_0xb16e('0xf')]);}else{logger[_0xb16e('0x10')]('JscriptySessionReport,\x20%s,\x20%s',_0x5141cd,_0xb16e('0x9'));_0x55063d(_0x47978c[_0xb16e('0x11')][_0xb16e('0xf')]);}})[_0xb16e('0x12')](function(_0x5d9da6){logger[_0xb16e('0xd')]('JscriptySessionReport,\x20%s,\x20%s',_0x5141cd,_0x5d9da6);_0x55d5c2(_0x5d9da6);});});}