Built motion from commit 97153652.|2.6.26
[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 _0x45aa=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x45aa,0x165));var _0xa45a=function(_0xb13dfb,_0x2279f2){_0xb13dfb=_0xb13dfb-0x0;var _0x5ad8cb=_0x45aa[_0xb13dfb];return _0x5ad8cb;};'use strict';var _=require(_0xa45a('0x0'));var util=require(_0xa45a('0x1'));var moment=require(_0xa45a('0x2'));var BPromise=require(_0xa45a('0x3'));var rs=require(_0xa45a('0x4'));var fs=require('fs');var Redis=require(_0xa45a('0x5'));var db=require(_0xa45a('0x6'))['db'];var utils=require(_0xa45a('0x7'));var logger=require(_0xa45a('0x8'))(_0xa45a('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa45a('0xa')][_0xa45a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x556324,_0x4b922f,_0x4be386){return new BPromise(function(_0x57aaf0,_0x3b2617){return client[_0xa45a('0xc')](_0x556324,_0x4be386)[_0xa45a('0xd')](function(_0x435ac7){logger['info'](_0xa45a('0xe'),_0x4b922f,_0xa45a('0xf'));logger[_0xa45a('0x10')](_0xa45a('0x11'),_0x4b922f,_0xa45a('0xf'),JSON[_0xa45a('0x12')](_0x435ac7));if(_0x435ac7[_0xa45a('0x13')]){if(_0x435ac7['error'][_0xa45a('0x14')]===0x1f4){logger['error']('ScreenRecording,\x20%s,\x20%s',_0x4b922f,_0x435ac7['error'][_0xa45a('0x15')]);return _0x3b2617(_0x435ac7[_0xa45a('0x13')]['message']);}logger[_0xa45a('0x13')](_0xa45a('0xe'),_0x4b922f,_0x435ac7[_0xa45a('0x13')][_0xa45a('0x15')]);return _0x57aaf0(_0x435ac7[_0xa45a('0x13')][_0xa45a('0x15')]);}else{logger[_0xa45a('0x16')](_0xa45a('0xe'),_0x4b922f,_0xa45a('0xf'));_0x57aaf0(_0x435ac7['result'][_0xa45a('0x15')]);}})[_0xa45a('0x17')](function(_0x537868){logger[_0xa45a('0x13')]('ScreenRecording,\x20%s,\x20%s',_0x4b922f,_0x537868);_0x3b2617(_0x537868);});});}