ef832c6f22f638d181fa6b808d8432f8d31319f3
[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 _0x5d0c=['http','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x5d0c,0xf8));var _0xc5d0=function(_0x3673a9,_0xbd430){_0x3673a9=_0x3673a9-0x0;var _0x243008=_0x5d0c[_0x3673a9];return _0x243008;};'use strict';var _=require(_0xc5d0('0x0'));var util=require(_0xc5d0('0x1'));var moment=require(_0xc5d0('0x2'));var BPromise=require(_0xc5d0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc5d0('0x4'));var db=require(_0xc5d0('0x5'))['db'];var utils=require(_0xc5d0('0x6'));var logger=require(_0xc5d0('0x7'))(_0xc5d0('0x8'));var config=require(_0xc5d0('0x9'));var jayson=require(_0xc5d0('0xa'));var client=jayson[_0xc5d0('0xb')][_0xc5d0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2a44ae,_0x3c90f9,_0xd3efc0){return new BPromise(function(_0x1dea6c,_0x4d0f1b){return client[_0xc5d0('0xd')](_0x2a44ae,_0xd3efc0)[_0xc5d0('0xe')](function(_0x1a7a7a){logger[_0xc5d0('0xf')](_0xc5d0('0x10'),_0x3c90f9,_0xc5d0('0x11'));logger[_0xc5d0('0x12')](_0xc5d0('0x13'),_0x3c90f9,'request\x20sent',JSON[_0xc5d0('0x14')](_0x1a7a7a));if(_0x1a7a7a['error']){if(_0x1a7a7a[_0xc5d0('0x15')][_0xc5d0('0x16')]===0x1f4){logger[_0xc5d0('0x15')](_0xc5d0('0x10'),_0x3c90f9,_0x1a7a7a['error'][_0xc5d0('0x17')]);return _0x4d0f1b(_0x1a7a7a[_0xc5d0('0x15')][_0xc5d0('0x17')]);}logger[_0xc5d0('0x15')](_0xc5d0('0x10'),_0x3c90f9,_0x1a7a7a[_0xc5d0('0x15')]['message']);return _0x1dea6c(_0x1a7a7a[_0xc5d0('0x15')][_0xc5d0('0x17')]);}else{logger[_0xc5d0('0xf')]('ScreenRecording,\x20%s,\x20%s',_0x3c90f9,_0xc5d0('0x11'));_0x1dea6c(_0x1a7a7a[_0xc5d0('0x18')][_0xc5d0('0x17')]);}})[_0xc5d0('0x19')](function(_0xf7c207){logger['error'](_0xc5d0('0x10'),_0x3c90f9,_0xf7c207);_0x4d0f1b(_0xf7c207);});});}