d4c80947cf31686fedf001087dc6d7972127ff1e
[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 _0x81b0=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ScreenRecording,\x20%s,\x20%s','debug','request\x20sent','error','message','result','lodash','moment'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x81b0,0x139));var _0x081b=function(_0x599929,_0x466c1a){_0x599929=_0x599929-0x0;var _0x30d427=_0x81b0[_0x599929];return _0x30d427;};'use strict';var _=require(_0x081b('0x0'));var util=require('util');var moment=require(_0x081b('0x1'));var BPromise=require(_0x081b('0x2'));var rs=require(_0x081b('0x3'));var fs=require('fs');var Redis=require(_0x081b('0x4'));var db=require(_0x081b('0x5'))['db'];var utils=require(_0x081b('0x6'));var logger=require(_0x081b('0x7'))(_0x081b('0x8'));var config=require(_0x081b('0x9'));var jayson=require(_0x081b('0xa'));var client=jayson[_0x081b('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x15a653,_0x24b233,_0x2df2ff){return new BPromise(function(_0x4acb27,_0x4a9216){return client[_0x081b('0xc')](_0x15a653,_0x2df2ff)[_0x081b('0xd')](function(_0x9c296b){logger[_0x081b('0xe')](_0x081b('0xf'),_0x24b233,'request\x20sent');logger[_0x081b('0x10')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x24b233,_0x081b('0x11'),JSON['stringify'](_0x9c296b));if(_0x9c296b[_0x081b('0x12')]){if(_0x9c296b[_0x081b('0x12')]['code']===0x1f4){logger['error'](_0x081b('0xf'),_0x24b233,_0x9c296b[_0x081b('0x12')][_0x081b('0x13')]);return _0x4a9216(_0x9c296b[_0x081b('0x12')][_0x081b('0x13')]);}logger[_0x081b('0x12')](_0x081b('0xf'),_0x24b233,_0x9c296b[_0x081b('0x12')][_0x081b('0x13')]);return _0x4acb27(_0x9c296b[_0x081b('0x12')]['message']);}else{logger[_0x081b('0xe')]('ScreenRecording,\x20%s,\x20%s',_0x24b233,_0x081b('0x11'));_0x4acb27(_0x9c296b[_0x081b('0x14')][_0x081b('0x13')]);}})['catch'](function(_0x32c6c7){logger[_0x081b('0x12')](_0x081b('0xf'),_0x24b233,_0x32c6c7);_0x4a9216(_0x32c6c7);});});}