Built motion from commit 53172ac8.|2.6.30
[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 _0xc83f=['debug','request\x20sent','stringify','error','ScreenRecording,\x20%s,\x20%s','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info'];(function(_0x2ce991,_0x1d97fd){var _0x3451a1=function(_0x334a5d){while(--_0x334a5d){_0x2ce991['push'](_0x2ce991['shift']());}};_0x3451a1(++_0x1d97fd);}(_0xc83f,0x184));var _0xfc83=function(_0x13188a,_0x2f635f){_0x13188a=_0x13188a-0x0;var _0x2f5716=_0xc83f[_0x13188a];return _0x2f5716;};'use strict';var _=require('lodash');var util=require(_0xfc83('0x0'));var moment=require('moment');var BPromise=require(_0xfc83('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfc83('0x2'));var db=require(_0xfc83('0x3'))['db'];var utils=require(_0xfc83('0x4'));var logger=require(_0xfc83('0x5'))(_0xfc83('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfc83('0x7')][_0xfc83('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2cb2e0,_0x4c38bc,_0x385cce){return new BPromise(function(_0x13e927,_0x18f083){return client[_0xfc83('0x9')](_0x2cb2e0,_0x385cce)[_0xfc83('0xa')](function(_0x1d695d){logger[_0xfc83('0xb')]('ScreenRecording,\x20%s,\x20%s',_0x4c38bc,'request\x20sent');logger[_0xfc83('0xc')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x4c38bc,_0xfc83('0xd'),JSON[_0xfc83('0xe')](_0x1d695d));if(_0x1d695d['error']){if(_0x1d695d[_0xfc83('0xf')]['code']===0x1f4){logger[_0xfc83('0xf')](_0xfc83('0x10'),_0x4c38bc,_0x1d695d[_0xfc83('0xf')][_0xfc83('0x11')]);return _0x18f083(_0x1d695d[_0xfc83('0xf')][_0xfc83('0x11')]);}logger[_0xfc83('0xf')](_0xfc83('0x10'),_0x4c38bc,_0x1d695d[_0xfc83('0xf')][_0xfc83('0x11')]);return _0x13e927(_0x1d695d[_0xfc83('0xf')][_0xfc83('0x11')]);}else{logger[_0xfc83('0xb')](_0xfc83('0x10'),_0x4c38bc,_0xfc83('0xd'));_0x13e927(_0x1d695d[_0xfc83('0x12')]['message']);}})[_0xfc83('0x13')](function(_0x2d37b3){logger['error'](_0xfc83('0x10'),_0x4c38bc,_0x2d37b3);_0x18f083(_0x2d37b3);});});}