Built motion from commit ddca4d0d.|2.5.47
[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 _0x28be=['message','result','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x65dab6,_0x3f05b2){var _0x1083ee=function(_0x111ba5){while(--_0x111ba5){_0x65dab6['push'](_0x65dab6['shift']());}};_0x1083ee(++_0x3f05b2);}(_0x28be,0x113));var _0xe28b=function(_0x973ab1,_0x8f3d63){_0x973ab1=_0x973ab1-0x0;var _0x33f3b4=_0x28be[_0x973ab1];return _0x33f3b4;};'use strict';var _=require('lodash');var util=require(_0xe28b('0x0'));var moment=require(_0xe28b('0x1'));var BPromise=require('bluebird');var rs=require(_0xe28b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe28b('0x3'));var logger=require(_0xe28b('0x4'))(_0xe28b('0x5'));var config=require(_0xe28b('0x6'));var jayson=require(_0xe28b('0x7'));var client=jayson['client'][_0xe28b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x467e79,_0x389c7d,_0x5e31ba){return new BPromise(function(_0x282d8e,_0x458366){return client[_0xe28b('0x9')](_0x467e79,_0x5e31ba)[_0xe28b('0xa')](function(_0x197af0){logger[_0xe28b('0xb')](_0xe28b('0xc'),_0x389c7d,_0xe28b('0xd'));logger[_0xe28b('0xe')](_0xe28b('0xf'),_0x389c7d,_0xe28b('0xd'),JSON[_0xe28b('0x10')](_0x197af0));if(_0x197af0[_0xe28b('0x11')]){if(_0x197af0[_0xe28b('0x11')][_0xe28b('0x12')]===0x1f4){logger['error'](_0xe28b('0xc'),_0x389c7d,_0x197af0[_0xe28b('0x11')][_0xe28b('0x13')]);return _0x458366(_0x197af0[_0xe28b('0x11')][_0xe28b('0x13')]);}logger[_0xe28b('0x11')](_0xe28b('0xc'),_0x389c7d,_0x197af0[_0xe28b('0x11')][_0xe28b('0x13')]);return _0x282d8e(_0x197af0[_0xe28b('0x11')][_0xe28b('0x13')]);}else{logger[_0xe28b('0xb')](_0xe28b('0xc'),_0x389c7d,_0xe28b('0xd'));_0x282d8e(_0x197af0[_0xe28b('0x14')][_0xe28b('0x13')]);}})['catch'](function(_0x5cd67b){logger[_0xe28b('0x11')](_0xe28b('0xc'),_0x389c7d,_0x5cd67b);_0x458366(_0x5cd67b);});});}