Built motion from commit ba71417a.|2.6.28
[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 _0x0789=['moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','error','code','message','util'];(function(_0x2f4382,_0x266785){var _0x3611cf=function(_0x20b481){while(--_0x20b481){_0x2f4382['push'](_0x2f4382['shift']());}};_0x3611cf(++_0x266785);}(_0x0789,0x164));var _0x9078=function(_0x5bff12,_0x9feaf5){_0x5bff12=_0x5bff12-0x0;var _0x5d73a8=_0x0789[_0x5bff12];return _0x5d73a8;};'use strict';var _=require('lodash');var util=require(_0x9078('0x0'));var moment=require(_0x9078('0x1'));var BPromise=require(_0x9078('0x2'));var rs=require(_0x9078('0x3'));var fs=require('fs');var Redis=require(_0x9078('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9078('0x5'));var logger=require('../../config/logger')(_0x9078('0x6'));var config=require(_0x9078('0x7'));var jayson=require(_0x9078('0x8'));var client=jayson[_0x9078('0x9')][_0x9078('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2cddc4,_0x3c032b,_0x21565f){return new BPromise(function(_0xf10354,_0x4148b4){return client[_0x9078('0xb')](_0x2cddc4,_0x21565f)[_0x9078('0xc')](function(_0x27986e){logger[_0x9078('0xd')](_0x9078('0xe'),_0x3c032b,_0x9078('0xf'));logger[_0x9078('0x10')](_0x9078('0x11'),_0x3c032b,_0x9078('0xf'),JSON['stringify'](_0x27986e));if(_0x27986e[_0x9078('0x12')]){if(_0x27986e[_0x9078('0x12')][_0x9078('0x13')]===0x1f4){logger['error']('ScreenRecording,\x20%s,\x20%s',_0x3c032b,_0x27986e[_0x9078('0x12')][_0x9078('0x14')]);return _0x4148b4(_0x27986e[_0x9078('0x12')][_0x9078('0x14')]);}logger[_0x9078('0x12')](_0x9078('0xe'),_0x3c032b,_0x27986e[_0x9078('0x12')][_0x9078('0x14')]);return _0xf10354(_0x27986e[_0x9078('0x12')][_0x9078('0x14')]);}else{logger[_0x9078('0xd')](_0x9078('0xe'),_0x3c032b,_0x9078('0xf'));_0xf10354(_0x27986e['result'][_0x9078('0x14')]);}})['catch'](function(_0x5d466c){logger[_0x9078('0x12')]('ScreenRecording,\x20%s,\x20%s',_0x3c032b,_0x5d466c);_0x4148b4(_0x5d466c);});});}