Built motion from commit (unavailable).|2.5.4
[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 _0xf4ae=['info','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','request','debug','request\x20sent','error','JscriptySessionReport,\x20%s,\x20%s','message'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0xf4ae,0x69));var _0xef4a=function(_0x397014,_0x17cc12){_0x397014=_0x397014-0x0;var _0x1163f7=_0xf4ae[_0x397014];return _0x1163f7;};'use strict';var _=require(_0xef4a('0x0'));var util=require('util');var moment=require(_0xef4a('0x1'));var BPromise=require(_0xef4a('0x2'));var rs=require(_0xef4a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xef4a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xef4a('0x5'))(_0xef4a('0x6'));var config=require(_0xef4a('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x16f6bd,_0x938da0,_0x30282c){return new BPromise(function(_0x5eda83,_0x33ec86){return client[_0xef4a('0x8')](_0x16f6bd,_0x30282c)['then'](function(_0xd7be1b){logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0x938da0,'request\x20sent');logger[_0xef4a('0x9')]('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x938da0,_0xef4a('0xa'),JSON['stringify'](_0xd7be1b));if(_0xd7be1b[_0xef4a('0xb')]){if(_0xd7be1b[_0xef4a('0xb')]['code']===0x1f4){logger[_0xef4a('0xb')](_0xef4a('0xc'),_0x938da0,_0xd7be1b[_0xef4a('0xb')][_0xef4a('0xd')]);return _0x33ec86(_0xd7be1b['error'][_0xef4a('0xd')]);}logger[_0xef4a('0xb')](_0xef4a('0xc'),_0x938da0,_0xd7be1b[_0xef4a('0xb')][_0xef4a('0xd')]);return _0x5eda83(_0xd7be1b[_0xef4a('0xb')][_0xef4a('0xd')]);}else{logger[_0xef4a('0xe')](_0xef4a('0xc'),_0x938da0,_0xef4a('0xa'));_0x5eda83(_0xd7be1b[_0xef4a('0xf')]['message']);}})[_0xef4a('0x10')](function(_0x5a72a6){logger[_0xef4a('0xb')](_0xef4a('0xc'),_0x938da0,_0x5a72a6);_0x33ec86(_0x5a72a6);});});}