4eaadfff7a154ece30c01d6056128e9419c25106
[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 _0xb6c4=['code','message','info','request\x20sent','result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','ScreenRecording,\x20%s,\x20%s','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb6c4,0xed));var _0x4b6c=function(_0x424030,_0x306c28){_0x424030=_0x424030-0x0;var _0x5ae703=_0xb6c4[_0x424030];return _0x5ae703;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4b6c('0x0'));var BPromise=require(_0x4b6c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4b6c('0x2'));var db=require(_0x4b6c('0x3'))['db'];var utils=require(_0x4b6c('0x4'));var logger=require('../../config/logger')(_0x4b6c('0x5'));var config=require(_0x4b6c('0x6'));var jayson=require(_0x4b6c('0x7'));var client=jayson[_0x4b6c('0x8')][_0x4b6c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1f3577,_0x213578,_0x481ea8){return new BPromise(function(_0x58fe64,_0x1d2779){return client['request'](_0x1f3577,_0x481ea8)['then'](function(_0x43677a){logger['info'](_0x4b6c('0xa'),_0x213578,'request\x20sent');logger[_0x4b6c('0xb')](_0x4b6c('0xc'),_0x213578,'request\x20sent',JSON[_0x4b6c('0xd')](_0x43677a));if(_0x43677a[_0x4b6c('0xe')]){if(_0x43677a[_0x4b6c('0xe')][_0x4b6c('0xf')]===0x1f4){logger[_0x4b6c('0xe')](_0x4b6c('0xa'),_0x213578,_0x43677a[_0x4b6c('0xe')][_0x4b6c('0x10')]);return _0x1d2779(_0x43677a[_0x4b6c('0xe')]['message']);}logger[_0x4b6c('0xe')](_0x4b6c('0xa'),_0x213578,_0x43677a[_0x4b6c('0xe')]['message']);return _0x58fe64(_0x43677a[_0x4b6c('0xe')]['message']);}else{logger[_0x4b6c('0x11')](_0x4b6c('0xa'),_0x213578,_0x4b6c('0x12'));_0x58fe64(_0x43677a[_0x4b6c('0x13')][_0x4b6c('0x10')]);}})[_0x4b6c('0x14')](function(_0x514162){logger[_0x4b6c('0xe')]('ScreenRecording,\x20%s,\x20%s',_0x213578,_0x514162);_0x1d2779(_0x514162);});});}