10c0ced29958745c641c023b6ab2db8b57d06a5a
[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 _0x3db7=['info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then'];(function(_0x3d2d6f,_0x368872){var _0x5c0022=function(_0x408819){while(--_0x408819){_0x3d2d6f['push'](_0x3d2d6f['shift']());}};_0x5c0022(++_0x368872);}(_0x3db7,0x198));var _0x73db=function(_0x1d3d58,_0x13bc04){_0x1d3d58=_0x1d3d58-0x0;var _0x3cce7a=_0x3db7[_0x1d3d58];return _0x3cce7a;};'use strict';var _=require(_0x73db('0x0'));var util=require(_0x73db('0x1'));var moment=require('moment');var BPromise=require(_0x73db('0x2'));var rs=require(_0x73db('0x3'));var fs=require('fs');var Redis=require(_0x73db('0x4'));var db=require(_0x73db('0x5'))['db'];var utils=require(_0x73db('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x73db('0x7'));var jayson=require(_0x73db('0x8'));var client=jayson['client'][_0x73db('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c8516,_0x4421ac,_0x16d4d0){return new BPromise(function(_0x34a5ed,_0xe7e0f8){return client[_0x73db('0xa')](_0x2c8516,_0x16d4d0)[_0x73db('0xb')](function(_0x50cf14){logger[_0x73db('0xc')](_0x73db('0xd'),_0x4421ac,_0x73db('0xe'));logger[_0x73db('0xf')](_0x73db('0x10'),_0x4421ac,_0x73db('0xe'),JSON['stringify'](_0x50cf14));if(_0x50cf14[_0x73db('0x11')]){if(_0x50cf14[_0x73db('0x11')]['code']===0x1f4){logger['error'](_0x73db('0xd'),_0x4421ac,_0x50cf14[_0x73db('0x11')]['message']);return _0xe7e0f8(_0x50cf14[_0x73db('0x11')][_0x73db('0x12')]);}logger['error'](_0x73db('0xd'),_0x4421ac,_0x50cf14[_0x73db('0x11')][_0x73db('0x12')]);return _0x34a5ed(_0x50cf14['error'][_0x73db('0x12')]);}else{logger[_0x73db('0xc')](_0x73db('0xd'),_0x4421ac,'request\x20sent');_0x34a5ed(_0x50cf14['result'][_0x73db('0x12')]);}})[_0x73db('0x13')](function(_0xc26c80){logger[_0x73db('0x11')](_0x73db('0xd'),_0x4421ac,_0xc26c80);_0xe7e0f8(_0xc26c80);});});}