Built motion from commit 00bf23f6.|2.6.16
[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 _0x0c2e=['rpc','../../config/environment','client','http','request','then','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3550e8,_0x424fea){var _0x18eb61=function(_0x2dcb49){while(--_0x2dcb49){_0x3550e8['push'](_0x3550e8['shift']());}};_0x18eb61(++_0x424fea);}(_0x0c2e,0x1c5));var _0xe0c2=function(_0x84b164,_0x13cd9d){_0x84b164=_0x84b164-0x0;var _0x173942=_0x0c2e[_0x84b164];return _0x173942;};'use strict';var _=require(_0xe0c2('0x0'));var util=require(_0xe0c2('0x1'));var moment=require(_0xe0c2('0x2'));var BPromise=require('bluebird');var rs=require(_0xe0c2('0x3'));var fs=require('fs');var Redis=require(_0xe0c2('0x4'));var db=require(_0xe0c2('0x5'))['db'];var utils=require(_0xe0c2('0x6'));var logger=require('../../config/logger')(_0xe0c2('0x7'));var config=require(_0xe0c2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe0c2('0x9')][_0xe0c2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x48402c,_0x4df742,_0x4b3111){return new BPromise(function(_0x46c87a,_0x462ef5){return client[_0xe0c2('0xb')](_0x48402c,_0x4b3111)[_0xe0c2('0xc')](function(_0x3735f2){logger['info'](_0xe0c2('0xd'),_0x4df742,_0xe0c2('0xe'));logger[_0xe0c2('0xf')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x4df742,_0xe0c2('0xe'),JSON[_0xe0c2('0x10')](_0x3735f2));if(_0x3735f2['error']){if(_0x3735f2[_0xe0c2('0x11')][_0xe0c2('0x12')]===0x1f4){logger[_0xe0c2('0x11')](_0xe0c2('0xd'),_0x4df742,_0x3735f2[_0xe0c2('0x11')][_0xe0c2('0x13')]);return _0x462ef5(_0x3735f2['error'][_0xe0c2('0x13')]);}logger[_0xe0c2('0x11')](_0xe0c2('0xd'),_0x4df742,_0x3735f2['error'][_0xe0c2('0x13')]);return _0x46c87a(_0x3735f2[_0xe0c2('0x11')][_0xe0c2('0x13')]);}else{logger[_0xe0c2('0x14')]('ScreenRecording,\x20%s,\x20%s',_0x4df742,_0xe0c2('0xe'));_0x46c87a(_0x3735f2[_0xe0c2('0x15')][_0xe0c2('0x13')]);}})[_0xe0c2('0x16')](function(_0x5239e9){logger[_0xe0c2('0x11')]('ScreenRecording,\x20%s,\x20%s',_0x4df742,_0x5239e9);_0x462ef5(_0x5239e9);});});}