67190e370adbd6656f132f227c17094719ed8525
[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 _0x2d0e=['ScreenRecording,\x20%s,\x20%s,\x20%s','error','code','ScreenRecording,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','../../config/utils','rpc','client','then','info','request\x20sent','debug'];(function(_0x266ddc,_0x45aa52){var _0x39c1d7=function(_0x4cd07c){while(--_0x4cd07c){_0x266ddc['push'](_0x266ddc['shift']());}};_0x39c1d7(++_0x45aa52);}(_0x2d0e,0x149));var _0xe2d0=function(_0x239ad3,_0x24ec65){_0x239ad3=_0x239ad3-0x0;var _0x352a38=_0x2d0e[_0x239ad3];return _0x352a38;};'use strict';var _=require(_0xe2d0('0x0'));var util=require('util');var moment=require(_0xe2d0('0x1'));var BPromise=require(_0xe2d0('0x2'));var rs=require(_0xe2d0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe2d0('0x4'));var logger=require('../../config/logger')(_0xe2d0('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe2d0('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd2149,_0x259972,_0x25ed0a){return new BPromise(function(_0x3ea3bb,_0xcd336b){return client['request'](_0xd2149,_0x25ed0a)[_0xe2d0('0x7')](function(_0x565541){logger[_0xe2d0('0x8')]('ScreenRecording,\x20%s,\x20%s',_0x259972,_0xe2d0('0x9'));logger[_0xe2d0('0xa')](_0xe2d0('0xb'),_0x259972,_0xe2d0('0x9'),JSON['stringify'](_0x565541));if(_0x565541[_0xe2d0('0xc')]){if(_0x565541[_0xe2d0('0xc')][_0xe2d0('0xd')]===0x1f4){logger['error'](_0xe2d0('0xe'),_0x259972,_0x565541[_0xe2d0('0xc')][_0xe2d0('0xf')]);return _0xcd336b(_0x565541[_0xe2d0('0xc')][_0xe2d0('0xf')]);}logger[_0xe2d0('0xc')](_0xe2d0('0xe'),_0x259972,_0x565541[_0xe2d0('0xc')][_0xe2d0('0xf')]);return _0x3ea3bb(_0x565541[_0xe2d0('0xc')]['message']);}else{logger[_0xe2d0('0x8')](_0xe2d0('0xe'),_0x259972,'request\x20sent');_0x3ea3bb(_0x565541[_0xe2d0('0x10')][_0xe2d0('0xf')]);}})['catch'](function(_0x5e4f17){logger[_0xe2d0('0xc')](_0xe2d0('0xe'),_0x259972,_0x5e4f17);_0xcd336b(_0x5e4f17);});});}