Built motion from commit e6806ed6.|2.6.0
[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 _0x8b15=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../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','code','message','lodash','util'];(function(_0x3e182f,_0x380ec7){var _0x23edc9=function(_0x3ca65e){while(--_0x3ca65e){_0x3e182f['push'](_0x3e182f['shift']());}};_0x23edc9(++_0x380ec7);}(_0x8b15,0x1e1));var _0x58b1=function(_0x3990bb,_0x1c6512){_0x3990bb=_0x3990bb-0x0;var _0x584611=_0x8b15[_0x3990bb];return _0x584611;};'use strict';var _=require(_0x58b1('0x0'));var util=require(_0x58b1('0x1'));var moment=require(_0x58b1('0x2'));var BPromise=require(_0x58b1('0x3'));var rs=require(_0x58b1('0x4'));var fs=require('fs');var Redis=require(_0x58b1('0x5'));var db=require(_0x58b1('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x58b1('0x7'))(_0x58b1('0x8'));var config=require(_0x58b1('0x9'));var jayson=require(_0x58b1('0xa'));var client=jayson[_0x58b1('0xb')][_0x58b1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1b42d9,_0x8d6f71,_0x26175e){return new BPromise(function(_0x3325f0,_0x3662ea){return client[_0x58b1('0xd')](_0x1b42d9,_0x26175e)[_0x58b1('0xe')](function(_0x4dfb29){logger[_0x58b1('0xf')](_0x58b1('0x10'),_0x8d6f71,_0x58b1('0x11'));logger[_0x58b1('0x12')](_0x58b1('0x13'),_0x8d6f71,'request\x20sent',JSON['stringify'](_0x4dfb29));if(_0x4dfb29['error']){if(_0x4dfb29[_0x58b1('0x14')][_0x58b1('0x15')]===0x1f4){logger[_0x58b1('0x14')](_0x58b1('0x10'),_0x8d6f71,_0x4dfb29[_0x58b1('0x14')][_0x58b1('0x16')]);return _0x3662ea(_0x4dfb29[_0x58b1('0x14')][_0x58b1('0x16')]);}logger[_0x58b1('0x14')](_0x58b1('0x10'),_0x8d6f71,_0x4dfb29[_0x58b1('0x14')][_0x58b1('0x16')]);return _0x3325f0(_0x4dfb29[_0x58b1('0x14')][_0x58b1('0x16')]);}else{logger['info'](_0x58b1('0x10'),_0x8d6f71,_0x58b1('0x11'));_0x3325f0(_0x4dfb29['result'][_0x58b1('0x16')]);}})['catch'](function(_0x551a95){logger[_0x58b1('0x14')](_0x58b1('0x10'),_0x8d6f71,_0x551a95);_0x3662ea(_0x551a95);});});}