21e10858aeff6bec0e3640579bec54e91c1ad3b2
[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 _0xa7b9=['request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ScreenRecording,\x20%s,\x20%s','result','lodash','util','moment','bluebird','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x14f5d3,_0x290d89){var _0x3ed667=function(_0x4cd9ac){while(--_0x4cd9ac){_0x14f5d3['push'](_0x14f5d3['shift']());}};_0x3ed667(++_0x290d89);}(_0xa7b9,0xb1));var _0x9a7b=function(_0x59b48b,_0x584733){_0x59b48b=_0x59b48b-0x0;var _0x4c3f79=_0xa7b9[_0x59b48b];return _0x4c3f79;};'use strict';var _=require(_0x9a7b('0x0'));var util=require(_0x9a7b('0x1'));var moment=require(_0x9a7b('0x2'));var BPromise=require(_0x9a7b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9a7b('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x9a7b('0x5'));var jayson=require(_0x9a7b('0x6'));var client=jayson[_0x9a7b('0x7')][_0x9a7b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1eeaee,_0x44581d,_0x35b61a){return new BPromise(function(_0x1faa39,_0xac37d5){return client[_0x9a7b('0x9')](_0x1eeaee,_0x35b61a)[_0x9a7b('0xa')](function(_0x53e26e){logger[_0x9a7b('0xb')]('ScreenRecording,\x20%s,\x20%s',_0x44581d,_0x9a7b('0xc'));logger[_0x9a7b('0xd')](_0x9a7b('0xe'),_0x44581d,_0x9a7b('0xc'),JSON[_0x9a7b('0xf')](_0x53e26e));if(_0x53e26e[_0x9a7b('0x10')]){if(_0x53e26e['error'][_0x9a7b('0x11')]===0x1f4){logger[_0x9a7b('0x10')]('ScreenRecording,\x20%s,\x20%s',_0x44581d,_0x53e26e[_0x9a7b('0x10')]['message']);return _0xac37d5(_0x53e26e[_0x9a7b('0x10')][_0x9a7b('0x12')]);}logger['error'](_0x9a7b('0x13'),_0x44581d,_0x53e26e[_0x9a7b('0x10')]['message']);return _0x1faa39(_0x53e26e[_0x9a7b('0x10')][_0x9a7b('0x12')]);}else{logger[_0x9a7b('0xb')]('ScreenRecording,\x20%s,\x20%s',_0x44581d,'request\x20sent');_0x1faa39(_0x53e26e[_0x9a7b('0x14')]['message']);}})['catch'](function(_0x5a8046){logger['error']('ScreenRecording,\x20%s,\x20%s',_0x44581d,_0x5a8046);_0xac37d5(_0x5a8046);});});}