Built motion from commit 3d3e98f2.|2.6.29
[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 _0x3a9b=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','ScreenRecording,\x20%s,\x20%s','ScreenRecording,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x165935,_0x1ee745){var _0x107459=function(_0x50d7ad){while(--_0x50d7ad){_0x165935['push'](_0x165935['shift']());}};_0x107459(++_0x1ee745);}(_0x3a9b,0x18b));var _0xb3a9=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x3a9b[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xb3a9('0x0'));var util=require('util');var moment=require(_0xb3a9('0x1'));var BPromise=require(_0xb3a9('0x2'));var rs=require(_0xb3a9('0x3'));var fs=require('fs');var Redis=require(_0xb3a9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb3a9('0x5'));var logger=require(_0xb3a9('0x6'))(_0xb3a9('0x7'));var config=require('../../config/environment');var jayson=require(_0xb3a9('0x8'));var client=jayson[_0xb3a9('0x9')][_0xb3a9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xcc72ef,_0x5b48fc,_0x3a0a7a){return new BPromise(function(_0xdaa7bc,_0x4c13b5){return client['request'](_0xcc72ef,_0x3a0a7a)[_0xb3a9('0xb')](function(_0x2fe4fe){logger['info'](_0xb3a9('0xc'),_0x5b48fc,'request\x20sent');logger['debug'](_0xb3a9('0xd'),_0x5b48fc,_0xb3a9('0xe'),JSON['stringify'](_0x2fe4fe));if(_0x2fe4fe[_0xb3a9('0xf')]){if(_0x2fe4fe[_0xb3a9('0xf')][_0xb3a9('0x10')]===0x1f4){logger[_0xb3a9('0xf')](_0xb3a9('0xc'),_0x5b48fc,_0x2fe4fe['error'][_0xb3a9('0x11')]);return _0x4c13b5(_0x2fe4fe['error'][_0xb3a9('0x11')]);}logger['error'](_0xb3a9('0xc'),_0x5b48fc,_0x2fe4fe[_0xb3a9('0xf')][_0xb3a9('0x11')]);return _0xdaa7bc(_0x2fe4fe[_0xb3a9('0xf')][_0xb3a9('0x11')]);}else{logger['info'](_0xb3a9('0xc'),_0x5b48fc,_0xb3a9('0xe'));_0xdaa7bc(_0x2fe4fe[_0xb3a9('0x12')]['message']);}})[_0xb3a9('0x13')](function(_0x51ff9f){logger['error']('ScreenRecording,\x20%s,\x20%s',_0x5b48fc,_0x51ff9f);_0x4c13b5(_0x51ff9f);});});}