Built motion from commit 3e059bc2.|2.5.32
[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 _0x4182=['message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x239a8d,_0x44d875){var _0x303f84=function(_0x216012){while(--_0x216012){_0x239a8d['push'](_0x239a8d['shift']());}};_0x303f84(++_0x44d875);}(_0x4182,0x152));var _0x2418=function(_0x31172e,_0xa59e5){_0x31172e=_0x31172e-0x0;var _0x414ada=_0x4182[_0x31172e];return _0x414ada;};'use strict';var _=require(_0x2418('0x0'));var util=require('util');var moment=require(_0x2418('0x1'));var BPromise=require(_0x2418('0x2'));var rs=require(_0x2418('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2418('0x4'))['db'];var utils=require(_0x2418('0x5'));var logger=require(_0x2418('0x6'))(_0x2418('0x7'));var config=require('../../config/environment');var jayson=require(_0x2418('0x8'));var client=jayson['client'][_0x2418('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x57a319,_0x3947e9,_0x8c21ec){return new BPromise(function(_0x176fcc,_0x4a8425){return client['request'](_0x57a319,_0x8c21ec)[_0x2418('0xa')](function(_0x4f92b0){logger[_0x2418('0xb')](_0x2418('0xc'),_0x3947e9,_0x2418('0xd'));logger[_0x2418('0xe')](_0x2418('0xf'),_0x3947e9,'request\x20sent',JSON[_0x2418('0x10')](_0x4f92b0));if(_0x4f92b0[_0x2418('0x11')]){if(_0x4f92b0[_0x2418('0x11')][_0x2418('0x12')]===0x1f4){logger[_0x2418('0x11')](_0x2418('0xc'),_0x3947e9,_0x4f92b0[_0x2418('0x11')][_0x2418('0x13')]);return _0x4a8425(_0x4f92b0['error'][_0x2418('0x13')]);}logger['error'](_0x2418('0xc'),_0x3947e9,_0x4f92b0[_0x2418('0x11')][_0x2418('0x13')]);return _0x176fcc(_0x4f92b0[_0x2418('0x11')]['message']);}else{logger[_0x2418('0xb')](_0x2418('0xc'),_0x3947e9,_0x2418('0xd'));_0x176fcc(_0x4f92b0[_0x2418('0x14')]['message']);}})['catch'](function(_0x3d1700){logger[_0x2418('0x11')]('ScreenRecording,\x20%s,\x20%s',_0x3947e9,_0x3d1700);_0x4a8425(_0x3d1700);});});}