a4d3a5de7dcc696a9714b974bf89e5857174508d
[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 _0x1f99=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1f99,0x125));var _0x91f9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1f99[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x91f9('0x0'));var util=require(_0x91f9('0x1'));var moment=require(_0x91f9('0x2'));var BPromise=require(_0x91f9('0x3'));var rs=require(_0x91f9('0x4'));var fs=require('fs');var Redis=require(_0x91f9('0x5'));var db=require(_0x91f9('0x6'))['db'];var utils=require(_0x91f9('0x7'));var logger=require(_0x91f9('0x8'))(_0x91f9('0x9'));var config=require(_0x91f9('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x91f9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x40e090,_0x285357,_0xca3b7c){return new BPromise(function(_0x46d6da,_0x3c2647){return client[_0x91f9('0xc')](_0x40e090,_0xca3b7c)[_0x91f9('0xd')](function(_0x32a2f7){logger['info'](_0x91f9('0xe'),_0x285357,_0x91f9('0xf'));logger[_0x91f9('0x10')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x285357,'request\x20sent',JSON['stringify'](_0x32a2f7));if(_0x32a2f7['error']){if(_0x32a2f7[_0x91f9('0x11')][_0x91f9('0x12')]===0x1f4){logger['error'](_0x91f9('0xe'),_0x285357,_0x32a2f7[_0x91f9('0x11')][_0x91f9('0x13')]);return _0x3c2647(_0x32a2f7[_0x91f9('0x11')][_0x91f9('0x13')]);}logger[_0x91f9('0x11')](_0x91f9('0xe'),_0x285357,_0x32a2f7[_0x91f9('0x11')][_0x91f9('0x13')]);return _0x46d6da(_0x32a2f7['error'][_0x91f9('0x13')]);}else{logger['info'](_0x91f9('0xe'),_0x285357,_0x91f9('0xf'));_0x46d6da(_0x32a2f7[_0x91f9('0x14')][_0x91f9('0x13')]);}})['catch'](function(_0x372b59){logger[_0x91f9('0x11')](_0x91f9('0xe'),_0x285357,_0x372b59);_0x3c2647(_0x372b59);});});}