Built motion from commit b5413ace.|2.6.9
[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 _0x8217=['ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ScreenRecording,\x20%s,\x20%s','request\x20sent'];(function(_0x56eb4f,_0x345164){var _0x248b79=function(_0x254520){while(--_0x254520){_0x56eb4f['push'](_0x56eb4f['shift']());}};_0x248b79(++_0x345164);}(_0x8217,0xed));var _0x7821=function(_0x1168a1,_0xa0d8c9){_0x1168a1=_0x1168a1-0x0;var _0xcc5ad8=_0x8217[_0x1168a1];return _0xcc5ad8;};'use strict';var _=require('lodash');var util=require(_0x7821('0x0'));var moment=require(_0x7821('0x1'));var BPromise=require(_0x7821('0x2'));var rs=require(_0x7821('0x3'));var fs=require('fs');var Redis=require(_0x7821('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7821('0x5'));var logger=require(_0x7821('0x6'))(_0x7821('0x7'));var config=require(_0x7821('0x8'));var jayson=require(_0x7821('0x9'));var client=jayson[_0x7821('0xa')][_0x7821('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ba43c,_0x331b21,_0x1a1317){return new BPromise(function(_0x21c42e,_0x2d2890){return client[_0x7821('0xc')](_0x1ba43c,_0x1a1317)['then'](function(_0x497908){logger[_0x7821('0xd')](_0x7821('0xe'),_0x331b21,_0x7821('0xf'));logger['debug'](_0x7821('0x10'),_0x331b21,'request\x20sent',JSON[_0x7821('0x11')](_0x497908));if(_0x497908[_0x7821('0x12')]){if(_0x497908[_0x7821('0x12')][_0x7821('0x13')]===0x1f4){logger[_0x7821('0x12')](_0x7821('0xe'),_0x331b21,_0x497908['error'][_0x7821('0x14')]);return _0x2d2890(_0x497908[_0x7821('0x12')][_0x7821('0x14')]);}logger[_0x7821('0x12')]('ScreenRecording,\x20%s,\x20%s',_0x331b21,_0x497908[_0x7821('0x12')][_0x7821('0x14')]);return _0x21c42e(_0x497908[_0x7821('0x12')]['message']);}else{logger[_0x7821('0xd')](_0x7821('0xe'),_0x331b21,_0x7821('0xf'));_0x21c42e(_0x497908[_0x7821('0x15')]['message']);}})[_0x7821('0x16')](function(_0x59411a){logger[_0x7821('0x12')](_0x7821('0xe'),_0x331b21,_0x59411a);_0x2d2890(_0x59411a);});});}