Built motion from commit ffdca78c.|2.6.24
[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 _0x0115=['client','http','request','then','info','ScreenRecording,\x20%s,\x20%s','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x3c8e9a,_0x384306){var _0x2d4c57=function(_0x43d408){while(--_0x43d408){_0x3c8e9a['push'](_0x3c8e9a['shift']());}};_0x2d4c57(++_0x384306);}(_0x0115,0x1d7));var _0x5011=function(_0xe584e8,_0x252ffb){_0xe584e8=_0xe584e8-0x0;var _0x1a5720=_0x0115[_0xe584e8];return _0x1a5720;};'use strict';var _=require(_0x5011('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5011('0x1'));var rs=require(_0x5011('0x2'));var fs=require('fs');var Redis=require(_0x5011('0x3'));var db=require(_0x5011('0x4'))['db'];var utils=require(_0x5011('0x5'));var logger=require('../../config/logger')(_0x5011('0x6'));var config=require(_0x5011('0x7'));var jayson=require(_0x5011('0x8'));var client=jayson[_0x5011('0x9')][_0x5011('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1baa14,_0xb85193,_0x387deb){return new BPromise(function(_0x2db33b,_0x44cd0d){return client[_0x5011('0xb')](_0x1baa14,_0x387deb)[_0x5011('0xc')](function(_0xb49754){logger[_0x5011('0xd')](_0x5011('0xe'),_0xb85193,'request\x20sent');logger[_0x5011('0xf')](_0x5011('0x10'),_0xb85193,_0x5011('0x11'),JSON[_0x5011('0x12')](_0xb49754));if(_0xb49754['error']){if(_0xb49754[_0x5011('0x13')][_0x5011('0x14')]===0x1f4){logger[_0x5011('0x13')](_0x5011('0xe'),_0xb85193,_0xb49754[_0x5011('0x13')][_0x5011('0x15')]);return _0x44cd0d(_0xb49754[_0x5011('0x13')][_0x5011('0x15')]);}logger[_0x5011('0x13')](_0x5011('0xe'),_0xb85193,_0xb49754['error'][_0x5011('0x15')]);return _0x2db33b(_0xb49754[_0x5011('0x13')][_0x5011('0x15')]);}else{logger[_0x5011('0xd')](_0x5011('0xe'),_0xb85193,_0x5011('0x11'));_0x2db33b(_0xb49754[_0x5011('0x16')][_0x5011('0x15')]);}})[_0x5011('0x17')](function(_0x2be0e3){logger[_0x5011('0x13')](_0x5011('0xe'),_0xb85193,_0x2be0e3);_0x44cd0d(_0x2be0e3);});});}