Built motion from commit f7863d46.|2.5.41
[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 _0xf3d0=['../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x575c76,_0x1ae7fb){var _0x436c95=function(_0x3c33ba){while(--_0x3c33ba){_0x575c76['push'](_0x575c76['shift']());}};_0x436c95(++_0x1ae7fb);}(_0xf3d0,0x17f));var _0x0f3d=function(_0x483ba9,_0x2dc0bf){_0x483ba9=_0x483ba9-0x0;var _0x22448f=_0xf3d0[_0x483ba9];return _0x22448f;};'use strict';var _=require(_0x0f3d('0x0'));var util=require(_0x0f3d('0x1'));var moment=require(_0x0f3d('0x2'));var BPromise=require(_0x0f3d('0x3'));var rs=require(_0x0f3d('0x4'));var fs=require('fs');var Redis=require(_0x0f3d('0x5'));var db=require(_0x0f3d('0x6'))['db'];var utils=require(_0x0f3d('0x7'));var logger=require(_0x0f3d('0x8'))('rpc');var config=require(_0x0f3d('0x9'));var jayson=require(_0x0f3d('0xa'));var client=jayson[_0x0f3d('0xb')][_0x0f3d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x33fea7,_0x3d4d2a,_0x1ffa68){return new BPromise(function(_0x44c5dc,_0x2f5123){return client[_0x0f3d('0xd')](_0x33fea7,_0x1ffa68)[_0x0f3d('0xe')](function(_0x552929){logger[_0x0f3d('0xf')](_0x0f3d('0x10'),_0x3d4d2a,_0x0f3d('0x11'));logger[_0x0f3d('0x12')](_0x0f3d('0x13'),_0x3d4d2a,_0x0f3d('0x11'),JSON['stringify'](_0x552929));if(_0x552929[_0x0f3d('0x14')]){if(_0x552929[_0x0f3d('0x14')]['code']===0x1f4){logger[_0x0f3d('0x14')](_0x0f3d('0x10'),_0x3d4d2a,_0x552929[_0x0f3d('0x14')]['message']);return _0x2f5123(_0x552929[_0x0f3d('0x14')][_0x0f3d('0x15')]);}logger[_0x0f3d('0x14')]('ScreenRecording,\x20%s,\x20%s',_0x3d4d2a,_0x552929[_0x0f3d('0x14')][_0x0f3d('0x15')]);return _0x44c5dc(_0x552929['error']['message']);}else{logger['info'](_0x0f3d('0x10'),_0x3d4d2a,_0x0f3d('0x11'));_0x44c5dc(_0x552929[_0x0f3d('0x16')][_0x0f3d('0x15')]);}})['catch'](function(_0x7a926d){logger['error']('ScreenRecording,\x20%s,\x20%s',_0x3d4d2a,_0x7a926d);_0x2f5123(_0x7a926d);});});}