Built motion from commit 9d1906d1.|2.5.40
[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 _0x1417=['bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','ScreenRecording,\x20%s,\x20%s','message','lodash','util','moment'];(function(_0x12ab57,_0x333b14){var _0x2c73fd=function(_0x1e6edf){while(--_0x1e6edf){_0x12ab57['push'](_0x12ab57['shift']());}};_0x2c73fd(++_0x333b14);}(_0x1417,0x138));var _0x7141=function(_0x3b0105,_0x42f600){_0x3b0105=_0x3b0105-0x0;var _0x1a6531=_0x1417[_0x3b0105];return _0x1a6531;};'use strict';var _=require(_0x7141('0x0'));var util=require(_0x7141('0x1'));var moment=require(_0x7141('0x2'));var BPromise=require(_0x7141('0x3'));var rs=require(_0x7141('0x4'));var fs=require('fs');var Redis=require(_0x7141('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7141('0x6'));var logger=require('../../config/logger')(_0x7141('0x7'));var config=require(_0x7141('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7141('0x9')][_0x7141('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b8440,_0x3c29a2,_0xdd5009){return new BPromise(function(_0x29ef85,_0x31376b){return client[_0x7141('0xb')](_0x4b8440,_0xdd5009)[_0x7141('0xc')](function(_0x5b8988){logger[_0x7141('0xd')]('ScreenRecording,\x20%s,\x20%s',_0x3c29a2,_0x7141('0xe'));logger[_0x7141('0xf')](_0x7141('0x10'),_0x3c29a2,_0x7141('0xe'),JSON[_0x7141('0x11')](_0x5b8988));if(_0x5b8988['error']){if(_0x5b8988[_0x7141('0x12')]['code']===0x1f4){logger[_0x7141('0x12')](_0x7141('0x13'),_0x3c29a2,_0x5b8988[_0x7141('0x12')]['message']);return _0x31376b(_0x5b8988[_0x7141('0x12')][_0x7141('0x14')]);}logger[_0x7141('0x12')](_0x7141('0x13'),_0x3c29a2,_0x5b8988[_0x7141('0x12')][_0x7141('0x14')]);return _0x29ef85(_0x5b8988[_0x7141('0x12')][_0x7141('0x14')]);}else{logger[_0x7141('0xd')]('ScreenRecording,\x20%s,\x20%s',_0x3c29a2,_0x7141('0xe'));_0x29ef85(_0x5b8988['result'][_0x7141('0x14')]);}})['catch'](function(_0x103911){logger[_0x7141('0x12')]('ScreenRecording,\x20%s,\x20%s',_0x3c29a2,_0x103911);_0x31376b(_0x103911);});});}