Built motion from commit a61a4a20.|2.5.46
[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 _0xed59=['../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','ScreenRecording,\x20%s,\x20%s','message','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x9a9b10,_0x2bbc5d){var _0x145900=function(_0xa29474){while(--_0xa29474){_0x9a9b10['push'](_0x9a9b10['shift']());}};_0x145900(++_0x2bbc5d);}(_0xed59,0x149));var _0x9ed5=function(_0x3ea28b,_0x4affce){_0x3ea28b=_0x3ea28b-0x0;var _0x103846=_0xed59[_0x3ea28b];return _0x103846;};'use strict';var _=require(_0x9ed5('0x0'));var util=require(_0x9ed5('0x1'));var moment=require(_0x9ed5('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9ed5('0x3'));var db=require(_0x9ed5('0x4'))['db'];var utils=require(_0x9ed5('0x5'));var logger=require(_0x9ed5('0x6'))('rpc');var config=require(_0x9ed5('0x7'));var jayson=require(_0x9ed5('0x8'));var client=jayson[_0x9ed5('0x9')][_0x9ed5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4f41b4,_0x10150e,_0x1c7ae7){return new BPromise(function(_0xc86e94,_0xe5dd44){return client['request'](_0x4f41b4,_0x1c7ae7)[_0x9ed5('0xb')](function(_0x238d4b){logger[_0x9ed5('0xc')]('ScreenRecording,\x20%s,\x20%s',_0x10150e,_0x9ed5('0xd'));logger[_0x9ed5('0xe')](_0x9ed5('0xf'),_0x10150e,_0x9ed5('0xd'),JSON[_0x9ed5('0x10')](_0x238d4b));if(_0x238d4b[_0x9ed5('0x11')]){if(_0x238d4b[_0x9ed5('0x11')]['code']===0x1f4){logger[_0x9ed5('0x11')](_0x9ed5('0x12'),_0x10150e,_0x238d4b[_0x9ed5('0x11')][_0x9ed5('0x13')]);return _0xe5dd44(_0x238d4b['error'][_0x9ed5('0x13')]);}logger[_0x9ed5('0x11')]('ScreenRecording,\x20%s,\x20%s',_0x10150e,_0x238d4b[_0x9ed5('0x11')][_0x9ed5('0x13')]);return _0xc86e94(_0x238d4b[_0x9ed5('0x11')][_0x9ed5('0x13')]);}else{logger['info']('ScreenRecording,\x20%s,\x20%s',_0x10150e,_0x9ed5('0xd'));_0xc86e94(_0x238d4b[_0x9ed5('0x14')][_0x9ed5('0x13')]);}})['catch'](function(_0x20d98d){logger[_0x9ed5('0x11')]('ScreenRecording,\x20%s,\x20%s',_0x10150e,_0x20d98d);_0xe5dd44(_0x20d98d);});});}