66ef2f87bb4a4a4e8d4c2a512ffb9e11924b0a8c
[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 _0xa6bc=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','ScreenRecording,\x20%s,\x20%s','message','info','result','catch'];(function(_0x516cc8,_0x5f04ee){var _0x12e7d7=function(_0x3df4d2){while(--_0x3df4d2){_0x516cc8['push'](_0x516cc8['shift']());}};_0x12e7d7(++_0x5f04ee);}(_0xa6bc,0x138));var _0xca6b=function(_0x4b5bab,_0x1d73d4){_0x4b5bab=_0x4b5bab-0x0;var _0x5abd6b=_0xa6bc[_0x4b5bab];return _0x5abd6b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xca6b('0x0'));var BPromise=require(_0xca6b('0x1'));var rs=require(_0xca6b('0x2'));var fs=require('fs');var Redis=require(_0xca6b('0x3'));var db=require(_0xca6b('0x4'))['db'];var utils=require(_0xca6b('0x5'));var logger=require(_0xca6b('0x6'))(_0xca6b('0x7'));var config=require(_0xca6b('0x8'));var jayson=require(_0xca6b('0x9'));var client=jayson['client'][_0xca6b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x521463,_0xeefe11,_0x2aff6b){return new BPromise(function(_0x268582,_0x408b7f){return client[_0xca6b('0xb')](_0x521463,_0x2aff6b)[_0xca6b('0xc')](function(_0x1c4bdf){logger['info']('ScreenRecording,\x20%s,\x20%s',_0xeefe11,_0xca6b('0xd'));logger[_0xca6b('0xe')](_0xca6b('0xf'),_0xeefe11,_0xca6b('0xd'),JSON[_0xca6b('0x10')](_0x1c4bdf));if(_0x1c4bdf[_0xca6b('0x11')]){if(_0x1c4bdf['error'][_0xca6b('0x12')]===0x1f4){logger[_0xca6b('0x11')](_0xca6b('0x13'),_0xeefe11,_0x1c4bdf['error']['message']);return _0x408b7f(_0x1c4bdf['error']['message']);}logger[_0xca6b('0x11')](_0xca6b('0x13'),_0xeefe11,_0x1c4bdf[_0xca6b('0x11')][_0xca6b('0x14')]);return _0x268582(_0x1c4bdf[_0xca6b('0x11')]['message']);}else{logger[_0xca6b('0x15')](_0xca6b('0x13'),_0xeefe11,'request\x20sent');_0x268582(_0x1c4bdf[_0xca6b('0x16')][_0xca6b('0x14')]);}})[_0xca6b('0x17')](function(_0x23f526){logger[_0xca6b('0x11')]('ScreenRecording,\x20%s,\x20%s',_0xeefe11,_0x23f526);_0x408b7f(_0x23f526);});});}