Built motion from commit 10af8726.|2.6.34
[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 _0x27f9=['randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','moment','bluebird'];(function(_0x31eab0,_0x14be89){var _0x36a7eb=function(_0x3ae825){while(--_0x3ae825){_0x31eab0['push'](_0x31eab0['shift']());}};_0x36a7eb(++_0x14be89);}(_0x27f9,0x1de));var _0x927f=function(_0x490daf,_0x4be094){_0x490daf=_0x490daf-0x0;var _0x52b0dd=_0x27f9[_0x490daf];return _0x52b0dd;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x927f('0x0'));var BPromise=require(_0x927f('0x1'));var rs=require(_0x927f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x927f('0x3'))['db'];var utils=require(_0x927f('0x4'));var logger=require(_0x927f('0x5'))('rpc');var config=require(_0x927f('0x6'));var jayson=require(_0x927f('0x7'));var client=jayson[_0x927f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x136873,_0x1524d2,_0x58f8bf){return new BPromise(function(_0x241996,_0x9a533b){return client['request'](_0x136873,_0x58f8bf)[_0x927f('0x9')](function(_0x54795a){logger[_0x927f('0xa')](_0x927f('0xb'),_0x1524d2,_0x927f('0xc'));logger[_0x927f('0xd')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x1524d2,_0x927f('0xc'),JSON[_0x927f('0xe')](_0x54795a));if(_0x54795a[_0x927f('0xf')]){if(_0x54795a[_0x927f('0xf')][_0x927f('0x10')]===0x1f4){logger[_0x927f('0xf')](_0x927f('0xb'),_0x1524d2,_0x54795a[_0x927f('0xf')][_0x927f('0x11')]);return _0x9a533b(_0x54795a[_0x927f('0xf')][_0x927f('0x11')]);}logger[_0x927f('0xf')]('ScreenRecording,\x20%s,\x20%s',_0x1524d2,_0x54795a[_0x927f('0xf')][_0x927f('0x11')]);return _0x241996(_0x54795a[_0x927f('0xf')][_0x927f('0x11')]);}else{logger[_0x927f('0xa')](_0x927f('0xb'),_0x1524d2,_0x927f('0xc'));_0x241996(_0x54795a[_0x927f('0x12')][_0x927f('0x11')]);}})[_0x927f('0x13')](function(_0x411531){logger[_0x927f('0xf')](_0x927f('0xb'),_0x1524d2,_0x411531);_0x9a533b(_0x411531);});});}