Built motion from commit 47436d59.|2.6.7
[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 _0x0523=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch'];(function(_0x1cbcb2,_0x1237a3){var _0x41ac9f=function(_0xe32e6f){while(--_0xe32e6f){_0x1cbcb2['push'](_0x1cbcb2['shift']());}};_0x41ac9f(++_0x1237a3);}(_0x0523,0x1b9));var _0x3052=function(_0x3c2326,_0xc7a13d){_0x3c2326=_0x3c2326-0x0;var _0x452517=_0x0523[_0x3c2326];return _0x452517;};'use strict';var _=require('lodash');var util=require(_0x3052('0x0'));var moment=require('moment');var BPromise=require(_0x3052('0x1'));var rs=require(_0x3052('0x2'));var fs=require('fs');var Redis=require(_0x3052('0x3'));var db=require(_0x3052('0x4'))['db'];var utils=require(_0x3052('0x5'));var logger=require(_0x3052('0x6'))(_0x3052('0x7'));var config=require('../../config/environment');var jayson=require(_0x3052('0x8'));var client=jayson['client'][_0x3052('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x417bbd,_0xf01007,_0x1750fc){return new BPromise(function(_0x33cf95,_0x2083a9){return client[_0x3052('0xa')](_0x417bbd,_0x1750fc)[_0x3052('0xb')](function(_0x1bc876){logger[_0x3052('0xc')](_0x3052('0xd'),_0xf01007,_0x3052('0xe'));logger[_0x3052('0xf')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0xf01007,_0x3052('0xe'),JSON['stringify'](_0x1bc876));if(_0x1bc876[_0x3052('0x10')]){if(_0x1bc876[_0x3052('0x10')][_0x3052('0x11')]===0x1f4){logger[_0x3052('0x10')]('ScreenRecording,\x20%s,\x20%s',_0xf01007,_0x1bc876[_0x3052('0x10')][_0x3052('0x12')]);return _0x2083a9(_0x1bc876[_0x3052('0x10')][_0x3052('0x12')]);}logger['error'](_0x3052('0xd'),_0xf01007,_0x1bc876[_0x3052('0x10')]['message']);return _0x33cf95(_0x1bc876[_0x3052('0x10')][_0x3052('0x12')]);}else{logger['info'](_0x3052('0xd'),_0xf01007,_0x3052('0xe'));_0x33cf95(_0x1bc876[_0x3052('0x13')][_0x3052('0x12')]);}})[_0x3052('0x14')](function(_0x570eba){logger['error']('ScreenRecording,\x20%s,\x20%s',_0xf01007,_0x570eba);_0x2083a9(_0x570eba);});});}