Built motion from commit (unavailable).|2.3.97
[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 _0xe558=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','info'];(function(_0x5501cc,_0x39af71){var _0x31885a=function(_0x20120b){while(--_0x20120b){_0x5501cc['push'](_0x5501cc['shift']());}};_0x31885a(++_0x39af71);}(_0xe558,0x70));var _0x8e55=function(_0x5d94e3,_0x6008bc){_0x5d94e3=_0x5d94e3-0x0;var _0xb999fb=_0xe558[_0x5d94e3];return _0xb999fb;};'use strict';var _=require(_0x8e55('0x0'));var util=require(_0x8e55('0x1'));var moment=require(_0x8e55('0x2'));var BPromise=require(_0x8e55('0x3'));var rs=require(_0x8e55('0x4'));var fs=require('fs');var Redis=require(_0x8e55('0x5'));var db=require(_0x8e55('0x6'))['db'];var utils=require(_0x8e55('0x7'));var logger=require(_0x8e55('0x8'))('rpc');var config=require(_0x8e55('0x9'));var jayson=require(_0x8e55('0xa'));var client=jayson[_0x8e55('0xb')][_0x8e55('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3cef42,_0x13c5db,_0x493307){return new BPromise(function(_0xe27f09,_0x429679){return client['request'](_0x3cef42,_0x493307)[_0x8e55('0xd')](function(_0x578110){logger['info'](_0x8e55('0xe'),_0x13c5db,'request\x20sent');logger['debug']('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x13c5db,_0x8e55('0xf'),JSON[_0x8e55('0x10')](_0x578110));if(_0x578110[_0x8e55('0x11')]){if(_0x578110[_0x8e55('0x11')]['code']===0x1f4){logger[_0x8e55('0x11')]('JscriptySessionReport,\x20%s,\x20%s',_0x13c5db,_0x578110['error']['message']);return _0x429679(_0x578110[_0x8e55('0x11')]['message']);}logger[_0x8e55('0x11')](_0x8e55('0xe'),_0x13c5db,_0x578110[_0x8e55('0x11')][_0x8e55('0x12')]);return _0xe27f09(_0x578110[_0x8e55('0x11')][_0x8e55('0x12')]);}else{logger[_0x8e55('0x13')](_0x8e55('0xe'),_0x13c5db,_0x8e55('0xf'));_0xe27f09(_0x578110[_0x8e55('0x14')][_0x8e55('0x12')]);}})[_0x8e55('0x15')](function(_0x202bc4){logger[_0x8e55('0x11')](_0x8e55('0xe'),_0x13c5db,_0x202bc4);_0x429679(_0x202bc4);});});}