720afa96a4b26f2dece4640c27bfb1c97f8d3587
[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 _0x3a58=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','ScreenRecording,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x32eb7f,_0x5cc11f){var _0x470a3e=function(_0x1e2009){while(--_0x1e2009){_0x32eb7f['push'](_0x32eb7f['shift']());}};_0x470a3e(++_0x5cc11f);}(_0x3a58,0x18b));var _0x83a5=function(_0x4eb822,_0x56d2ef){_0x4eb822=_0x4eb822-0x0;var _0x27d901=_0x3a58[_0x4eb822];return _0x27d901;};'use strict';var _=require(_0x83a5('0x0'));var util=require('util');var moment=require(_0x83a5('0x1'));var BPromise=require(_0x83a5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x83a5('0x3'));var db=require(_0x83a5('0x4'))['db'];var utils=require(_0x83a5('0x5'));var logger=require(_0x83a5('0x6'))(_0x83a5('0x7'));var config=require(_0x83a5('0x8'));var jayson=require(_0x83a5('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2895e7,_0xfb8c68,_0x3e038d){return new BPromise(function(_0x2cc75a,_0x4a52cb){return client[_0x83a5('0xa')](_0x2895e7,_0x3e038d)['then'](function(_0x1f4c01){logger[_0x83a5('0xb')]('ScreenRecording,\x20%s,\x20%s',_0xfb8c68,_0x83a5('0xc'));logger[_0x83a5('0xd')](_0x83a5('0xe'),_0xfb8c68,_0x83a5('0xc'),JSON[_0x83a5('0xf')](_0x1f4c01));if(_0x1f4c01[_0x83a5('0x10')]){if(_0x1f4c01['error'][_0x83a5('0x11')]===0x1f4){logger[_0x83a5('0x10')](_0x83a5('0x12'),_0xfb8c68,_0x1f4c01['error'][_0x83a5('0x13')]);return _0x4a52cb(_0x1f4c01[_0x83a5('0x10')][_0x83a5('0x13')]);}logger[_0x83a5('0x10')](_0x83a5('0x12'),_0xfb8c68,_0x1f4c01[_0x83a5('0x10')]['message']);return _0x2cc75a(_0x1f4c01[_0x83a5('0x10')][_0x83a5('0x13')]);}else{logger[_0x83a5('0xb')](_0x83a5('0x12'),_0xfb8c68,'request\x20sent');_0x2cc75a(_0x1f4c01[_0x83a5('0x14')]['message']);}})[_0x83a5('0x15')](function(_0x1662e6){logger[_0x83a5('0x10')](_0x83a5('0x12'),_0xfb8c68,_0x1662e6);_0x4a52cb(_0x1662e6);});});}