Built motion from commit 863c3375.|2.6.28
[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 _0x911b=['ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment'];(function(_0x4e339b,_0x3a3153){var _0x5870b2=function(_0x5b2948){while(--_0x5b2948){_0x4e339b['push'](_0x4e339b['shift']());}};_0x5870b2(++_0x3a3153);}(_0x911b,0x179));var _0xb911=function(_0x3dc7cf,_0x143993){_0x3dc7cf=_0x3dc7cf-0x0;var _0x2ee068=_0x911b[_0x3dc7cf];return _0x2ee068;};'use strict';var _=require(_0xb911('0x0'));var util=require(_0xb911('0x1'));var moment=require(_0xb911('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb911('0x3'));var db=require(_0xb911('0x4'))['db'];var utils=require(_0xb911('0x5'));var logger=require(_0xb911('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb911('0x7')][_0xb911('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x360667,_0x45de33,_0x3d6663){return new BPromise(function(_0x595f8b,_0x273477){return client['request'](_0x360667,_0x3d6663)[_0xb911('0x9')](function(_0x196271){logger[_0xb911('0xa')](_0xb911('0xb'),_0x45de33,_0xb911('0xc'));logger[_0xb911('0xd')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x45de33,_0xb911('0xc'),JSON['stringify'](_0x196271));if(_0x196271[_0xb911('0xe')]){if(_0x196271[_0xb911('0xe')][_0xb911('0xf')]===0x1f4){logger[_0xb911('0xe')](_0xb911('0xb'),_0x45de33,_0x196271['error'][_0xb911('0x10')]);return _0x273477(_0x196271[_0xb911('0xe')][_0xb911('0x10')]);}logger[_0xb911('0xe')](_0xb911('0xb'),_0x45de33,_0x196271[_0xb911('0xe')][_0xb911('0x10')]);return _0x595f8b(_0x196271[_0xb911('0xe')]['message']);}else{logger['info'](_0xb911('0xb'),_0x45de33,'request\x20sent');_0x595f8b(_0x196271[_0xb911('0x11')][_0xb911('0x10')]);}})[_0xb911('0x12')](function(_0x5be8fe){logger['error'](_0xb911('0xb'),_0x45de33,_0x5be8fe);_0x273477(_0x5be8fe);});});}