8260d2c0f7f9554ec45bf9380d96f6ce630cac4b
[motion2.git] / server / api / screenRecording / screenRecording.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 _0xc3b0=['../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x4cd22f,_0x57c3ea){var _0x2342d3=function(_0x16684f){while(--_0x16684f){_0x4cd22f['push'](_0x4cd22f['shift']());}};_0x2342d3(++_0x57c3ea);}(_0xc3b0,0xb8));var _0x0c3b=function(_0x960bec,_0x32741d){_0x960bec=_0x960bec-0x0;var _0x22e3d5=_0xc3b0[_0x960bec];return _0x22e3d5;};'use strict';var _=require(_0x0c3b('0x0'));var util=require(_0x0c3b('0x1'));var moment=require(_0x0c3b('0x2'));var BPromise=require(_0x0c3b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0c3b('0x4'));var db=require(_0x0c3b('0x5'))['db'];var utils=require(_0x0c3b('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x0c3b('0x7'));var client=jayson[_0x0c3b('0x8')][_0x0c3b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5eb326,_0x1b3dde,_0x1b38a2){return new BPromise(function(_0x22fc9c,_0x1bfa79){return client[_0x0c3b('0xa')](_0x5eb326,_0x1b38a2)[_0x0c3b('0xb')](function(_0x3eb482){logger[_0x0c3b('0xc')](_0x0c3b('0xd'),_0x1b3dde,_0x0c3b('0xe'));logger[_0x0c3b('0xf')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x1b3dde,_0x0c3b('0xe'),JSON[_0x0c3b('0x10')](_0x3eb482));if(_0x3eb482[_0x0c3b('0x11')]){if(_0x3eb482['error']['code']===0x1f4){logger['error'](_0x0c3b('0xd'),_0x1b3dde,_0x3eb482[_0x0c3b('0x11')][_0x0c3b('0x12')]);return _0x1bfa79(_0x3eb482[_0x0c3b('0x11')][_0x0c3b('0x12')]);}logger[_0x0c3b('0x11')](_0x0c3b('0xd'),_0x1b3dde,_0x3eb482[_0x0c3b('0x11')][_0x0c3b('0x12')]);return _0x22fc9c(_0x3eb482[_0x0c3b('0x11')][_0x0c3b('0x12')]);}else{logger[_0x0c3b('0xc')](_0x0c3b('0xd'),_0x1b3dde,'request\x20sent');_0x22fc9c(_0x3eb482[_0x0c3b('0x13')][_0x0c3b('0x12')]);}})[_0x0c3b('0x14')](function(_0x312e18){logger[_0x0c3b('0x11')]('ScreenRecording,\x20%s,\x20%s',_0x1b3dde,_0x312e18);_0x1bfa79(_0x312e18);});});}