Built motion from commit 2b9af5da.|2.6.26
[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 _0x23b3=['ioredis','../../mysqldb','../../config/utils','../../config/logger','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','code','error','message','result','catch','lodash','bluebird'];(function(_0x5c337e,_0x12c0cb){var _0x3c8041=function(_0x44d366){while(--_0x44d366){_0x5c337e['push'](_0x5c337e['shift']());}};_0x3c8041(++_0x12c0cb);}(_0x23b3,0xb6));var _0x323b=function(_0x1a8caa,_0x195483){_0x1a8caa=_0x1a8caa-0x0;var _0x9021fe=_0x23b3[_0x1a8caa];return _0x9021fe;};'use strict';var _=require(_0x323b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x323b('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x323b('0x2'));var db=require(_0x323b('0x3'))['db'];var utils=require(_0x323b('0x4'));var logger=require(_0x323b('0x5'))(_0x323b('0x6'));var config=require(_0x323b('0x7'));var jayson=require(_0x323b('0x8'));var client=jayson[_0x323b('0x9')][_0x323b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b7de3,_0x43667e,_0x58198e){return new BPromise(function(_0x439706,_0x378c55){return client[_0x323b('0xb')](_0x4b7de3,_0x58198e)[_0x323b('0xc')](function(_0x50c8c1){logger[_0x323b('0xd')](_0x323b('0xe'),_0x43667e,_0x323b('0xf'));logger[_0x323b('0x10')](_0x323b('0x11'),_0x43667e,_0x323b('0xf'),JSON['stringify'](_0x50c8c1));if(_0x50c8c1['error']){if(_0x50c8c1['error'][_0x323b('0x12')]===0x1f4){logger[_0x323b('0x13')]('ScreenRecording,\x20%s,\x20%s',_0x43667e,_0x50c8c1[_0x323b('0x13')][_0x323b('0x14')]);return _0x378c55(_0x50c8c1['error'][_0x323b('0x14')]);}logger[_0x323b('0x13')](_0x323b('0xe'),_0x43667e,_0x50c8c1[_0x323b('0x13')]['message']);return _0x439706(_0x50c8c1[_0x323b('0x13')][_0x323b('0x14')]);}else{logger[_0x323b('0xd')](_0x323b('0xe'),_0x43667e,_0x323b('0xf'));_0x439706(_0x50c8c1[_0x323b('0x15')][_0x323b('0x14')]);}})[_0x323b('0x16')](function(_0x166293){logger[_0x323b('0x13')](_0x323b('0xe'),_0x43667e,_0x166293);_0x378c55(_0x166293);});});}