Built motion from commit (unavailable).|2.3.1
[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 _0x3024=['rpc','../../config/environment','client','http','request','then','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','../../config/utils'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x3024,0x64));var _0x4302=function(_0x281480,_0x7c054b){_0x281480=_0x281480-0x0;var _0x3fe6a6=_0x3024[_0x281480];return _0x3fe6a6;};'use strict';var _=require(_0x4302('0x0'));var util=require(_0x4302('0x1'));var moment=require('moment');var BPromise=require(_0x4302('0x2'));var rs=require(_0x4302('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4302('0x4'));var logger=require('../../config/logger')(_0x4302('0x5'));var config=require(_0x4302('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x4302('0x7')][_0x4302('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4c3983,_0xced9fc,_0x2aecd7){return new BPromise(function(_0x3c007b,_0x285613){return client[_0x4302('0x9')](_0x4c3983,_0x2aecd7)[_0x4302('0xa')](function(_0x41580c){logger['info'](_0x4302('0xb'),_0xced9fc,_0x4302('0xc'));logger[_0x4302('0xd')]('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0xced9fc,_0x4302('0xc'),JSON[_0x4302('0xe')](_0x41580c));if(_0x41580c['error']){if(_0x41580c[_0x4302('0xf')][_0x4302('0x10')]===0x1f4){logger[_0x4302('0xf')]('JscriptySessionReport,\x20%s,\x20%s',_0xced9fc,_0x41580c[_0x4302('0xf')][_0x4302('0x11')]);return _0x285613(_0x41580c['error'][_0x4302('0x11')]);}logger[_0x4302('0xf')](_0x4302('0xb'),_0xced9fc,_0x41580c['error'][_0x4302('0x11')]);return _0x3c007b(_0x41580c[_0x4302('0xf')]['message']);}else{logger[_0x4302('0x12')](_0x4302('0xb'),_0xced9fc,'request\x20sent');_0x3c007b(_0x41580c[_0x4302('0x13')][_0x4302('0x11')]);}})[_0x4302('0x14')](function(_0x32178f){logger[_0x4302('0xf')](_0x4302('0xb'),_0xced9fc,_0x32178f);_0x285613(_0x32178f);});});}