83d72a085c390497223e92537507852a4ae0d6df
[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 _0xf31c=['info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x511907,_0x4ae413){var _0x5e58e6=function(_0xfd27e3){while(--_0xfd27e3){_0x511907['push'](_0x511907['shift']());}};_0x5e58e6(++_0x4ae413);}(_0xf31c,0x1a8));var _0xcf31=function(_0x2aecb2,_0x343312){_0x2aecb2=_0x2aecb2-0x0;var _0x3ebb80=_0xf31c[_0x2aecb2];return _0x3ebb80;};'use strict';var _=require('lodash');var util=require(_0xcf31('0x0'));var moment=require(_0xcf31('0x1'));var BPromise=require(_0xcf31('0x2'));var rs=require(_0xcf31('0x3'));var fs=require('fs');var Redis=require(_0xcf31('0x4'));var db=require(_0xcf31('0x5'))['db'];var utils=require(_0xcf31('0x6'));var logger=require(_0xcf31('0x7'))(_0xcf31('0x8'));var config=require(_0xcf31('0x9'));var jayson=require(_0xcf31('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x15f9ea,_0x74649a,_0x3e8ad8){return new BPromise(function(_0x1aec13,_0x12fcd5){return client[_0xcf31('0xb')](_0x15f9ea,_0x3e8ad8)[_0xcf31('0xc')](function(_0x3c1192){logger[_0xcf31('0xd')](_0xcf31('0xe'),_0x74649a,_0xcf31('0xf'));logger[_0xcf31('0x10')](_0xcf31('0x11'),_0x74649a,_0xcf31('0xf'),JSON[_0xcf31('0x12')](_0x3c1192));if(_0x3c1192[_0xcf31('0x13')]){if(_0x3c1192[_0xcf31('0x13')][_0xcf31('0x14')]===0x1f4){logger[_0xcf31('0x13')]('ScreenRecording,\x20%s,\x20%s',_0x74649a,_0x3c1192[_0xcf31('0x13')][_0xcf31('0x15')]);return _0x12fcd5(_0x3c1192[_0xcf31('0x13')][_0xcf31('0x15')]);}logger[_0xcf31('0x13')](_0xcf31('0xe'),_0x74649a,_0x3c1192[_0xcf31('0x13')][_0xcf31('0x15')]);return _0x1aec13(_0x3c1192[_0xcf31('0x13')][_0xcf31('0x15')]);}else{logger[_0xcf31('0xd')](_0xcf31('0xe'),_0x74649a,_0xcf31('0xf'));_0x1aec13(_0x3c1192[_0xcf31('0x16')][_0xcf31('0x15')]);}})['catch'](function(_0x3b5b24){logger[_0xcf31('0x13')](_0xcf31('0xe'),_0x74649a,_0x3b5b24);_0x12fcd5(_0x3b5b24);});});}