Built motion from commit (unavailable).|2.5.14
[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 _0x9901=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring'];(function(_0x5f1617,_0x46277b){var _0x3af5da=function(_0x15b934){while(--_0x15b934){_0x5f1617['push'](_0x5f1617['shift']());}};_0x3af5da(++_0x46277b);}(_0x9901,0xcb));var _0x1990=function(_0x528b92,_0x2a3971){_0x528b92=_0x528b92-0x0;var _0x171eba=_0x9901[_0x528b92];return _0x171eba;};'use strict';var _=require('lodash');var util=require(_0x1990('0x0'));var moment=require(_0x1990('0x1'));var BPromise=require(_0x1990('0x2'));var rs=require(_0x1990('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1990('0x4'));var logger=require('../../config/logger')(_0x1990('0x5'));var config=require(_0x1990('0x6'));var jayson=require(_0x1990('0x7'));var client=jayson[_0x1990('0x8')][_0x1990('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x547543,_0x3b260c,_0xfd9513){return new BPromise(function(_0x33f5f4,_0x3a464f){return client[_0x1990('0xa')](_0x547543,_0xfd9513)[_0x1990('0xb')](function(_0x19a686){logger[_0x1990('0xc')](_0x1990('0xd'),_0x3b260c,_0x1990('0xe'));logger[_0x1990('0xf')](_0x1990('0x10'),_0x3b260c,'request\x20sent',JSON[_0x1990('0x11')](_0x19a686));if(_0x19a686['error']){if(_0x19a686[_0x1990('0x12')][_0x1990('0x13')]===0x1f4){logger[_0x1990('0x12')]('JscriptySessionReport,\x20%s,\x20%s',_0x3b260c,_0x19a686[_0x1990('0x12')][_0x1990('0x14')]);return _0x3a464f(_0x19a686[_0x1990('0x12')][_0x1990('0x14')]);}logger['error'](_0x1990('0xd'),_0x3b260c,_0x19a686[_0x1990('0x12')][_0x1990('0x14')]);return _0x33f5f4(_0x19a686['error']['message']);}else{logger[_0x1990('0xc')](_0x1990('0xd'),_0x3b260c,'request\x20sent');_0x33f5f4(_0x19a686[_0x1990('0x15')][_0x1990('0x14')]);}})[_0x1990('0x16')](function(_0x578e56){logger[_0x1990('0x12')]('JscriptySessionReport,\x20%s,\x20%s',_0x3b260c,_0x578e56);_0x3a464f(_0x578e56);});});}