Built motion from commit da617fac.|2.6.6
[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 _0xf068=['../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','request\x20sent','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','ScreenRecording,\x20%s,\x20%s','message','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x261305,_0x2efc00){var _0x5808b1=function(_0x5d070b){while(--_0x5d070b){_0x261305['push'](_0x261305['shift']());}};_0x5808b1(++_0x2efc00);}(_0xf068,0xd6));var _0x8f06=function(_0x256973,_0x38d186){_0x256973=_0x256973-0x0;var _0x5bdf0a=_0xf068[_0x256973];return _0x5bdf0a;};'use strict';var _=require(_0x8f06('0x0'));var util=require('util');var moment=require(_0x8f06('0x1'));var BPromise=require(_0x8f06('0x2'));var rs=require(_0x8f06('0x3'));var fs=require('fs');var Redis=require(_0x8f06('0x4'));var db=require(_0x8f06('0x5'))['db'];var utils=require(_0x8f06('0x6'));var logger=require(_0x8f06('0x7'))(_0x8f06('0x8'));var config=require('../../config/environment');var jayson=require(_0x8f06('0x9'));var client=jayson['client'][_0x8f06('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x24561d,_0x8369b4,_0x477c34){return new BPromise(function(_0xffef68,_0x18201c){return client[_0x8f06('0xb')](_0x24561d,_0x477c34)[_0x8f06('0xc')](function(_0x491d8d){logger[_0x8f06('0xd')]('ScreenRecording,\x20%s,\x20%s',_0x8369b4,_0x8f06('0xe'));logger['debug'](_0x8f06('0xf'),_0x8369b4,_0x8f06('0xe'),JSON[_0x8f06('0x10')](_0x491d8d));if(_0x491d8d['error']){if(_0x491d8d[_0x8f06('0x11')]['code']===0x1f4){logger[_0x8f06('0x11')](_0x8f06('0x12'),_0x8369b4,_0x491d8d[_0x8f06('0x11')][_0x8f06('0x13')]);return _0x18201c(_0x491d8d['error'][_0x8f06('0x13')]);}logger[_0x8f06('0x11')](_0x8f06('0x12'),_0x8369b4,_0x491d8d['error']['message']);return _0xffef68(_0x491d8d[_0x8f06('0x11')][_0x8f06('0x13')]);}else{logger['info'](_0x8f06('0x12'),_0x8369b4,_0x8f06('0xe'));_0xffef68(_0x491d8d['result'][_0x8f06('0x13')]);}})['catch'](function(_0x252512){logger[_0x8f06('0x11')](_0x8f06('0x12'),_0x8369b4,_0x252512);_0x18201c(_0x252512);});});}