Built motion from commit bbec7235.|2.6.20
[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 _0x4ed9=['debug','ScreenRecording,\x20%s,\x20%s,\x20%s','error','code','message','info','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','ScreenRecording,\x20%s,\x20%s','request\x20sent'];(function(_0x37c22c,_0x28a70d){var _0x119d79=function(_0x243a13){while(--_0x243a13){_0x37c22c['push'](_0x37c22c['shift']());}};_0x119d79(++_0x28a70d);}(_0x4ed9,0x13a));var _0x94ed=function(_0x3d2a33,_0x76d73f){_0x3d2a33=_0x3d2a33-0x0;var _0x210589=_0x4ed9[_0x3d2a33];return _0x210589;};'use strict';var _=require(_0x94ed('0x0'));var util=require(_0x94ed('0x1'));var moment=require(_0x94ed('0x2'));var BPromise=require(_0x94ed('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x94ed('0x4'));var db=require(_0x94ed('0x5'))['db'];var utils=require(_0x94ed('0x6'));var logger=require('../../config/logger')(_0x94ed('0x7'));var config=require(_0x94ed('0x8'));var jayson=require(_0x94ed('0x9'));var client=jayson[_0x94ed('0xa')][_0x94ed('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x17744a,_0x1fa260,_0x5c2a80){return new BPromise(function(_0x19fd1f,_0x38d22c){return client[_0x94ed('0xc')](_0x17744a,_0x5c2a80)[_0x94ed('0xd')](function(_0x2ea255){logger['info'](_0x94ed('0xe'),_0x1fa260,_0x94ed('0xf'));logger[_0x94ed('0x10')](_0x94ed('0x11'),_0x1fa260,_0x94ed('0xf'),JSON['stringify'](_0x2ea255));if(_0x2ea255['error']){if(_0x2ea255[_0x94ed('0x12')][_0x94ed('0x13')]===0x1f4){logger[_0x94ed('0x12')](_0x94ed('0xe'),_0x1fa260,_0x2ea255[_0x94ed('0x12')][_0x94ed('0x14')]);return _0x38d22c(_0x2ea255[_0x94ed('0x12')]['message']);}logger[_0x94ed('0x12')]('ScreenRecording,\x20%s,\x20%s',_0x1fa260,_0x2ea255[_0x94ed('0x12')][_0x94ed('0x14')]);return _0x19fd1f(_0x2ea255[_0x94ed('0x12')]['message']);}else{logger[_0x94ed('0x15')]('ScreenRecording,\x20%s,\x20%s',_0x1fa260,_0x94ed('0xf'));_0x19fd1f(_0x2ea255['result'][_0x94ed('0x14')]);}})['catch'](function(_0x112e67){logger[_0x94ed('0x12')](_0x94ed('0xe'),_0x1fa260,_0x112e67);_0x38d22c(_0x112e67);});});}