3a2b77f4c046194ec1b73f9b478e5f89abef63b1
[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 _0xa316=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util'];(function(_0x264ca3,_0x65b645){var _0x156d1e=function(_0x3c2990){while(--_0x3c2990){_0x264ca3['push'](_0x264ca3['shift']());}};_0x156d1e(++_0x65b645);}(_0xa316,0xf0));var _0x6a31=function(_0x29eb66,_0x3aecf4){_0x29eb66=_0x29eb66-0x0;var _0x534052=_0xa316[_0x29eb66];return _0x534052;};'use strict';var _=require(_0x6a31('0x0'));var util=require(_0x6a31('0x1'));var moment=require(_0x6a31('0x2'));var BPromise=require(_0x6a31('0x3'));var rs=require(_0x6a31('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6a31('0x5'))['db'];var utils=require(_0x6a31('0x6'));var logger=require(_0x6a31('0x7'))(_0x6a31('0x8'));var config=require(_0x6a31('0x9'));var jayson=require(_0x6a31('0xa'));var client=jayson[_0x6a31('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x48d0bf,_0x36659c,_0x8a7e8c){return new BPromise(function(_0x28213f,_0x2cb8dc){return client[_0x6a31('0xc')](_0x48d0bf,_0x8a7e8c)['then'](function(_0x455331){logger['info'](_0x6a31('0xd'),_0x36659c,_0x6a31('0xe'));logger[_0x6a31('0xf')](_0x6a31('0x10'),_0x36659c,'request\x20sent',JSON[_0x6a31('0x11')](_0x455331));if(_0x455331[_0x6a31('0x12')]){if(_0x455331[_0x6a31('0x12')][_0x6a31('0x13')]===0x1f4){logger[_0x6a31('0x12')](_0x6a31('0xd'),_0x36659c,_0x455331[_0x6a31('0x12')]['message']);return _0x2cb8dc(_0x455331['error']['message']);}logger[_0x6a31('0x12')](_0x6a31('0xd'),_0x36659c,_0x455331[_0x6a31('0x12')][_0x6a31('0x14')]);return _0x28213f(_0x455331[_0x6a31('0x12')]['message']);}else{logger['info'](_0x6a31('0xd'),_0x36659c,'request\x20sent');_0x28213f(_0x455331['result'][_0x6a31('0x14')]);}})[_0x6a31('0x15')](function(_0x2b12b3){logger[_0x6a31('0x12')]('ScreenRecording,\x20%s,\x20%s',_0x36659c,_0x2b12b3);_0x2cb8dc(_0x2b12b3);});});}