Built motion from commit 9d7072cc.|2.5.39
[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 _0x7c6a=['rpc','jayson/promise','client','http','request','then','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','error','message','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4526ee,_0x1b275b){var _0x36ed69=function(_0x2cca0b){while(--_0x2cca0b){_0x4526ee['push'](_0x4526ee['shift']());}};_0x36ed69(++_0x1b275b);}(_0x7c6a,0x197));var _0xa7c6=function(_0x3eb59c,_0x146eaa){_0x3eb59c=_0x3eb59c-0x0;var _0x1a79cc=_0x7c6a[_0x3eb59c];return _0x1a79cc;};'use strict';var _=require(_0xa7c6('0x0'));var util=require('util');var moment=require(_0xa7c6('0x1'));var BPromise=require(_0xa7c6('0x2'));var rs=require(_0xa7c6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa7c6('0x4'))['db'];var utils=require(_0xa7c6('0x5'));var logger=require(_0xa7c6('0x6'))(_0xa7c6('0x7'));var config=require('../../config/environment');var jayson=require(_0xa7c6('0x8'));var client=jayson[_0xa7c6('0x9')][_0xa7c6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x32a160,_0x48a397,_0x543f0c){return new BPromise(function(_0x33cc8a,_0x4f5893){return client[_0xa7c6('0xb')](_0x32a160,_0x543f0c)[_0xa7c6('0xc')](function(_0x329a84){logger['info'](_0xa7c6('0xd'),_0x48a397,_0xa7c6('0xe'));logger[_0xa7c6('0xf')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x48a397,_0xa7c6('0xe'),JSON['stringify'](_0x329a84));if(_0x329a84['error']){if(_0x329a84['error']['code']===0x1f4){logger[_0xa7c6('0x10')](_0xa7c6('0xd'),_0x48a397,_0x329a84['error'][_0xa7c6('0x11')]);return _0x4f5893(_0x329a84[_0xa7c6('0x10')][_0xa7c6('0x11')]);}logger[_0xa7c6('0x10')]('ScreenRecording,\x20%s,\x20%s',_0x48a397,_0x329a84[_0xa7c6('0x10')][_0xa7c6('0x11')]);return _0x33cc8a(_0x329a84[_0xa7c6('0x10')][_0xa7c6('0x11')]);}else{logger['info'](_0xa7c6('0xd'),_0x48a397,_0xa7c6('0xe'));_0x33cc8a(_0x329a84['result'][_0xa7c6('0x11')]);}})['catch'](function(_0x148148){logger[_0xa7c6('0x10')]('ScreenRecording,\x20%s,\x20%s',_0x48a397,_0x148148);_0x4f5893(_0x148148);});});}