Built motion from commit 9d0783e6.|2.6.13
[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 _0xfd76=['debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent'];(function(_0x5d0755,_0x5dd13b){var _0x6565ba=function(_0x84e65b){while(--_0x84e65b){_0x5d0755['push'](_0x5d0755['shift']());}};_0x6565ba(++_0x5dd13b);}(_0xfd76,0x6c));var _0x6fd7=function(_0x58e61e,_0x43f377){_0x58e61e=_0x58e61e-0x0;var _0x40fecd=_0xfd76[_0x58e61e];return _0x40fecd;};'use strict';var _=require(_0x6fd7('0x0'));var util=require('util');var moment=require(_0x6fd7('0x1'));var BPromise=require(_0x6fd7('0x2'));var rs=require(_0x6fd7('0x3'));var fs=require('fs');var Redis=require(_0x6fd7('0x4'));var db=require(_0x6fd7('0x5'))['db'];var utils=require(_0x6fd7('0x6'));var logger=require(_0x6fd7('0x7'))(_0x6fd7('0x8'));var config=require(_0x6fd7('0x9'));var jayson=require(_0x6fd7('0xa'));var client=jayson[_0x6fd7('0xb')][_0x6fd7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x55c3f8,_0x34b58b,_0x33adb8){return new BPromise(function(_0x248812,_0x47b140){return client['request'](_0x55c3f8,_0x33adb8)[_0x6fd7('0xd')](function(_0x521187){logger[_0x6fd7('0xe')](_0x6fd7('0xf'),_0x34b58b,_0x6fd7('0x10'));logger[_0x6fd7('0x11')](_0x6fd7('0x12'),_0x34b58b,_0x6fd7('0x10'),JSON[_0x6fd7('0x13')](_0x521187));if(_0x521187['error']){if(_0x521187[_0x6fd7('0x14')][_0x6fd7('0x15')]===0x1f4){logger['error'](_0x6fd7('0xf'),_0x34b58b,_0x521187[_0x6fd7('0x14')][_0x6fd7('0x16')]);return _0x47b140(_0x521187[_0x6fd7('0x14')][_0x6fd7('0x16')]);}logger[_0x6fd7('0x14')]('ScreenRecording,\x20%s,\x20%s',_0x34b58b,_0x521187['error'][_0x6fd7('0x16')]);return _0x248812(_0x521187[_0x6fd7('0x14')][_0x6fd7('0x16')]);}else{logger[_0x6fd7('0xe')](_0x6fd7('0xf'),_0x34b58b,_0x6fd7('0x10'));_0x248812(_0x521187[_0x6fd7('0x17')][_0x6fd7('0x16')]);}})[_0x6fd7('0x18')](function(_0xa23d33){logger['error'](_0x6fd7('0xf'),_0x34b58b,_0xa23d33);_0x47b140(_0xa23d33);});});}