Built motion from commit 538092ac.|2.6.10
[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 _0xa7ca=['client','http','request','then','request\x20sent','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','ScreenRecording,\x20%s,\x20%s','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x197b20,_0x580b0c){var _0x1f63f8=function(_0x235c8c){while(--_0x235c8c){_0x197b20['push'](_0x197b20['shift']());}};_0x1f63f8(++_0x580b0c);}(_0xa7ca,0x1c7));var _0xaa7c=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa7ca[_0x173d7e];return _0x2220d6;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xaa7c('0x0'));var rs=require(_0xaa7c('0x1'));var fs=require('fs');var Redis=require(_0xaa7c('0x2'));var db=require(_0xaa7c('0x3'))['db'];var utils=require(_0xaa7c('0x4'));var logger=require(_0xaa7c('0x5'))('rpc');var config=require(_0xaa7c('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xaa7c('0x7')][_0xaa7c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x47db95,_0x433dfc,_0x4b9b84){return new BPromise(function(_0x1282f8,_0x5710d6){return client[_0xaa7c('0x9')](_0x47db95,_0x4b9b84)[_0xaa7c('0xa')](function(_0x5308e5){logger['info']('ScreenRecording,\x20%s,\x20%s',_0x433dfc,_0xaa7c('0xb'));logger['debug'](_0xaa7c('0xc'),_0x433dfc,_0xaa7c('0xb'),JSON[_0xaa7c('0xd')](_0x5308e5));if(_0x5308e5[_0xaa7c('0xe')]){if(_0x5308e5[_0xaa7c('0xe')][_0xaa7c('0xf')]===0x1f4){logger[_0xaa7c('0xe')]('ScreenRecording,\x20%s,\x20%s',_0x433dfc,_0x5308e5['error']['message']);return _0x5710d6(_0x5308e5['error'][_0xaa7c('0x10')]);}logger[_0xaa7c('0xe')]('ScreenRecording,\x20%s,\x20%s',_0x433dfc,_0x5308e5['error'][_0xaa7c('0x10')]);return _0x1282f8(_0x5308e5[_0xaa7c('0xe')][_0xaa7c('0x10')]);}else{logger[_0xaa7c('0x11')](_0xaa7c('0x12'),_0x433dfc,_0xaa7c('0xb'));_0x1282f8(_0x5308e5[_0xaa7c('0x13')][_0xaa7c('0x10')]);}})[_0xaa7c('0x14')](function(_0xf38a35){logger[_0xaa7c('0xe')]('ScreenRecording,\x20%s,\x20%s',_0x433dfc,_0xf38a35);_0x5710d6(_0xf38a35);});});}