Built motion from commit 449495f6.|2.6.27
[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 _0x2296=['result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','ScreenRecording,\x20%s,\x20%s','message','info'];(function(_0x421649,_0x3bc1f3){var _0x48176b=function(_0xf57c15){while(--_0xf57c15){_0x421649['push'](_0x421649['shift']());}};_0x48176b(++_0x3bc1f3);}(_0x2296,0x121));var _0x6229=function(_0x14c770,_0x129972){_0x14c770=_0x14c770-0x0;var _0x31a0f1=_0x2296[_0x14c770];return _0x31a0f1;};'use strict';var _=require(_0x6229('0x0'));var util=require(_0x6229('0x1'));var moment=require('moment');var BPromise=require(_0x6229('0x2'));var rs=require(_0x6229('0x3'));var fs=require('fs');var Redis=require(_0x6229('0x4'));var db=require(_0x6229('0x5'))['db'];var utils=require(_0x6229('0x6'));var logger=require('../../config/logger')(_0x6229('0x7'));var config=require(_0x6229('0x8'));var jayson=require(_0x6229('0x9'));var client=jayson[_0x6229('0xa')][_0x6229('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x523562,_0x422d27,_0x436062){return new BPromise(function(_0x3d53b1,_0x3fc1c6){return client[_0x6229('0xc')](_0x523562,_0x436062)[_0x6229('0xd')](function(_0xf7be09){logger['info']('ScreenRecording,\x20%s,\x20%s',_0x422d27,_0x6229('0xe'));logger[_0x6229('0xf')](_0x6229('0x10'),_0x422d27,_0x6229('0xe'),JSON[_0x6229('0x11')](_0xf7be09));if(_0xf7be09['error']){if(_0xf7be09[_0x6229('0x12')][_0x6229('0x13')]===0x1f4){logger[_0x6229('0x12')](_0x6229('0x14'),_0x422d27,_0xf7be09[_0x6229('0x12')][_0x6229('0x15')]);return _0x3fc1c6(_0xf7be09[_0x6229('0x12')][_0x6229('0x15')]);}logger['error'](_0x6229('0x14'),_0x422d27,_0xf7be09[_0x6229('0x12')][_0x6229('0x15')]);return _0x3d53b1(_0xf7be09['error'][_0x6229('0x15')]);}else{logger[_0x6229('0x16')](_0x6229('0x14'),_0x422d27,_0x6229('0xe'));_0x3d53b1(_0xf7be09[_0x6229('0x17')][_0x6229('0x15')]);}})['catch'](function(_0x112cf5){logger['error'](_0x6229('0x14'),_0x422d27,_0x112cf5);_0x3fc1c6(_0x112cf5);});});}