Built motion from commit b0a9a629.|2.6.33
[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 _0xa275=['error','code','message','lodash','util','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s'];(function(_0x3e21f4,_0x43d310){var _0x40fc49=function(_0x54a8f6){while(--_0x54a8f6){_0x3e21f4['push'](_0x3e21f4['shift']());}};_0x40fc49(++_0x43d310);}(_0xa275,0x8b));var _0x5a27=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xa275[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x5a27('0x0'));var util=require(_0x5a27('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5a27('0x2'));var logger=require(_0x5a27('0x3'))(_0x5a27('0x4'));var config=require(_0x5a27('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5a27('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1c0709,_0x5c9141,_0x3733c3){return new BPromise(function(_0x16921b,_0x435478){return client[_0x5a27('0x7')](_0x1c0709,_0x3733c3)[_0x5a27('0x8')](function(_0x1d9549){logger[_0x5a27('0x9')](_0x5a27('0xa'),_0x5c9141,_0x5a27('0xb'));logger[_0x5a27('0xc')](_0x5a27('0xd'),_0x5c9141,_0x5a27('0xb'),JSON['stringify'](_0x1d9549));if(_0x1d9549[_0x5a27('0xe')]){if(_0x1d9549[_0x5a27('0xe')][_0x5a27('0xf')]===0x1f4){logger[_0x5a27('0xe')](_0x5a27('0xa'),_0x5c9141,_0x1d9549['error'][_0x5a27('0x10')]);return _0x435478(_0x1d9549[_0x5a27('0xe')][_0x5a27('0x10')]);}logger[_0x5a27('0xe')](_0x5a27('0xa'),_0x5c9141,_0x1d9549[_0x5a27('0xe')][_0x5a27('0x10')]);return _0x16921b(_0x1d9549[_0x5a27('0xe')][_0x5a27('0x10')]);}else{logger['info'](_0x5a27('0xa'),_0x5c9141,_0x5a27('0xb'));_0x16921b(_0x1d9549['result'][_0x5a27('0x10')]);}})['catch'](function(_0x35589b){logger[_0x5a27('0xe')]('ScreenRecording,\x20%s,\x20%s',_0x5c9141,_0x35589b);_0x435478(_0x35589b);});});}