Built motion from commit a679711e.|2.6.15
[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 _0x0a35=['code','ScreenRecording,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x28b930,_0x19b05f){var _0x112256=function(_0x3b3f61){while(--_0x3b3f61){_0x28b930['push'](_0x28b930['shift']());}};_0x112256(++_0x19b05f);}(_0x0a35,0x123));var _0x50a3=function(_0x65ff6c,_0x4c2da3){_0x65ff6c=_0x65ff6c-0x0;var _0x238215=_0x0a35[_0x65ff6c];return _0x238215;};'use strict';var _=require(_0x50a3('0x0'));var util=require('util');var moment=require(_0x50a3('0x1'));var BPromise=require('bluebird');var rs=require(_0x50a3('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x50a3('0x3'))['db'];var utils=require(_0x50a3('0x4'));var logger=require(_0x50a3('0x5'))(_0x50a3('0x6'));var config=require(_0x50a3('0x7'));var jayson=require(_0x50a3('0x8'));var client=jayson[_0x50a3('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8a88fd,_0x8cbf07,_0x4858ff){return new BPromise(function(_0x50675a,_0x1196d0){return client[_0x50a3('0xa')](_0x8a88fd,_0x4858ff)[_0x50a3('0xb')](function(_0x1449b8){logger['info']('ScreenRecording,\x20%s,\x20%s',_0x8cbf07,_0x50a3('0xc'));logger[_0x50a3('0xd')](_0x50a3('0xe'),_0x8cbf07,_0x50a3('0xc'),JSON[_0x50a3('0xf')](_0x1449b8));if(_0x1449b8[_0x50a3('0x10')]){if(_0x1449b8[_0x50a3('0x10')][_0x50a3('0x11')]===0x1f4){logger['error'](_0x50a3('0x12'),_0x8cbf07,_0x1449b8[_0x50a3('0x10')]['message']);return _0x1196d0(_0x1449b8[_0x50a3('0x10')][_0x50a3('0x13')]);}logger['error']('ScreenRecording,\x20%s,\x20%s',_0x8cbf07,_0x1449b8[_0x50a3('0x10')][_0x50a3('0x13')]);return _0x50675a(_0x1449b8['error'][_0x50a3('0x13')]);}else{logger['info']('ScreenRecording,\x20%s,\x20%s',_0x8cbf07,_0x50a3('0xc'));_0x50675a(_0x1449b8[_0x50a3('0x14')][_0x50a3('0x13')]);}})[_0x50a3('0x15')](function(_0x4035bd){logger['error'](_0x50a3('0x12'),_0x8cbf07,_0x4035bd);_0x1196d0(_0x4035bd);});});}