Built motion from commit 97f2f211.|2.6.31
[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 _0x5e99=['request\x20sent','ScreenRecording,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','ScreenRecording,\x20%s,\x20%s'];(function(_0x47ebd8,_0x452946){var _0x2c4566=function(_0x51e5f7){while(--_0x51e5f7){_0x47ebd8['push'](_0x47ebd8['shift']());}};_0x2c4566(++_0x452946);}(_0x5e99,0x1d5));var _0x95e9=function(_0x1d2099,_0x2d71e6){_0x1d2099=_0x1d2099-0x0;var _0x23be0b=_0x5e99[_0x1d2099];return _0x23be0b;};'use strict';var _=require(_0x95e9('0x0'));var util=require(_0x95e9('0x1'));var moment=require('moment');var BPromise=require(_0x95e9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x95e9('0x3'));var db=require(_0x95e9('0x4'))['db'];var utils=require(_0x95e9('0x5'));var logger=require(_0x95e9('0x6'))('rpc');var config=require(_0x95e9('0x7'));var jayson=require(_0x95e9('0x8'));var client=jayson[_0x95e9('0x9')][_0x95e9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7d8989,_0x4c44bd,_0x4c6a77){return new BPromise(function(_0x5b31a1,_0x125da8){return client['request'](_0x7d8989,_0x4c6a77)[_0x95e9('0xb')](function(_0x3a13ce){logger[_0x95e9('0xc')](_0x95e9('0xd'),_0x4c44bd,_0x95e9('0xe'));logger['debug'](_0x95e9('0xf'),_0x4c44bd,_0x95e9('0xe'),JSON['stringify'](_0x3a13ce));if(_0x3a13ce['error']){if(_0x3a13ce[_0x95e9('0x10')][_0x95e9('0x11')]===0x1f4){logger[_0x95e9('0x10')](_0x95e9('0xd'),_0x4c44bd,_0x3a13ce[_0x95e9('0x10')][_0x95e9('0x12')]);return _0x125da8(_0x3a13ce[_0x95e9('0x10')][_0x95e9('0x12')]);}logger[_0x95e9('0x10')](_0x95e9('0xd'),_0x4c44bd,_0x3a13ce[_0x95e9('0x10')]['message']);return _0x5b31a1(_0x3a13ce[_0x95e9('0x10')][_0x95e9('0x12')]);}else{logger[_0x95e9('0xc')](_0x95e9('0xd'),_0x4c44bd,_0x95e9('0xe'));_0x5b31a1(_0x3a13ce[_0x95e9('0x13')][_0x95e9('0x12')]);}})[_0x95e9('0x14')](function(_0x1115c6){logger[_0x95e9('0x10')](_0x95e9('0xd'),_0x4c44bd,_0x1115c6);_0x125da8(_0x1115c6);});});}