b190c3c18ac0d1c881325504cd9964562f7ce4e8
[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 _0x68cc=['request\x20sent','stringify','error','message','result','catch','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','debug'];(function(_0x34ad72,_0x1e43f6){var _0x5c9aa8=function(_0x144388){while(--_0x144388){_0x34ad72['push'](_0x34ad72['shift']());}};_0x5c9aa8(++_0x1e43f6);}(_0x68cc,0x146));var _0xc68c=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x68cc[_0x465028];return _0xb783d4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc68c('0x0'));var BPromise=require(_0xc68c('0x1'));var rs=require(_0xc68c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc68c('0x3'));var logger=require('../../config/logger')(_0xc68c('0x4'));var config=require(_0xc68c('0x5'));var jayson=require(_0xc68c('0x6'));var client=jayson[_0xc68c('0x7')][_0xc68c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4619a8,_0x18b9c5,_0x5a9004){return new BPromise(function(_0x740113,_0x19f9ac){return client[_0xc68c('0x9')](_0x4619a8,_0x5a9004)[_0xc68c('0xa')](function(_0x125657){logger[_0xc68c('0xb')](_0xc68c('0xc'),_0x18b9c5,'request\x20sent');logger[_0xc68c('0xd')]('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x18b9c5,_0xc68c('0xe'),JSON[_0xc68c('0xf')](_0x125657));if(_0x125657['error']){if(_0x125657[_0xc68c('0x10')]['code']===0x1f4){logger[_0xc68c('0x10')]('JscriptySessionReport,\x20%s,\x20%s',_0x18b9c5,_0x125657[_0xc68c('0x10')][_0xc68c('0x11')]);return _0x19f9ac(_0x125657['error'][_0xc68c('0x11')]);}logger[_0xc68c('0x10')](_0xc68c('0xc'),_0x18b9c5,_0x125657['error'][_0xc68c('0x11')]);return _0x740113(_0x125657[_0xc68c('0x10')][_0xc68c('0x11')]);}else{logger[_0xc68c('0xb')](_0xc68c('0xc'),_0x18b9c5,_0xc68c('0xe'));_0x740113(_0x125657[_0xc68c('0x12')][_0xc68c('0x11')]);}})[_0xc68c('0x13')](function(_0x33ce07){logger[_0xc68c('0x10')]('JscriptySessionReport,\x20%s,\x20%s',_0x18b9c5,_0x33ce07);_0x19f9ac(_0x33ce07);});});}