44bc91d763ea2ce5a540e49f65c653a52ddd9418
[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 _0x6bae=['request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','ScreenRecording,\x20%s,\x20%s'];(function(_0x3ad669,_0x49feb3){var _0x52bfdd=function(_0x414155){while(--_0x414155){_0x3ad669['push'](_0x3ad669['shift']());}};_0x52bfdd(++_0x49feb3);}(_0x6bae,0x77));var _0xe6ba=function(_0xc48716,_0x1d3f9c){_0xc48716=_0xc48716-0x0;var _0x3b0858=_0x6bae[_0xc48716];return _0x3b0858;};'use strict';var _=require('lodash');var util=require(_0xe6ba('0x0'));var moment=require(_0xe6ba('0x1'));var BPromise=require(_0xe6ba('0x2'));var rs=require(_0xe6ba('0x3'));var fs=require('fs');var Redis=require(_0xe6ba('0x4'));var db=require(_0xe6ba('0x5'))['db'];var utils=require(_0xe6ba('0x6'));var logger=require('../../config/logger')(_0xe6ba('0x7'));var config=require('../../config/environment');var jayson=require(_0xe6ba('0x8'));var client=jayson[_0xe6ba('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x129343,_0x315f69,_0x41ecaa){return new BPromise(function(_0x55dcdd,_0xa2bfaa){return client[_0xe6ba('0xa')](_0x129343,_0x41ecaa)[_0xe6ba('0xb')](function(_0x5d9628){logger['info'](_0xe6ba('0xc'),_0x315f69,_0xe6ba('0xd'));logger[_0xe6ba('0xe')](_0xe6ba('0xf'),_0x315f69,_0xe6ba('0xd'),JSON[_0xe6ba('0x10')](_0x5d9628));if(_0x5d9628[_0xe6ba('0x11')]){if(_0x5d9628[_0xe6ba('0x11')][_0xe6ba('0x12')]===0x1f4){logger[_0xe6ba('0x11')]('ScreenRecording,\x20%s,\x20%s',_0x315f69,_0x5d9628['error'][_0xe6ba('0x13')]);return _0xa2bfaa(_0x5d9628['error'][_0xe6ba('0x13')]);}logger[_0xe6ba('0x11')](_0xe6ba('0xc'),_0x315f69,_0x5d9628[_0xe6ba('0x11')][_0xe6ba('0x13')]);return _0x55dcdd(_0x5d9628[_0xe6ba('0x11')][_0xe6ba('0x13')]);}else{logger[_0xe6ba('0x14')]('ScreenRecording,\x20%s,\x20%s',_0x315f69,'request\x20sent');_0x55dcdd(_0x5d9628['result'][_0xe6ba('0x13')]);}})[_0xe6ba('0x15')](function(_0x9759fa){logger[_0xe6ba('0x11')](_0xe6ba('0xc'),_0x315f69,_0x9759fa);_0xa2bfaa(_0x9759fa);});});}