Built motion from commit 775e2a94.|2.6.3
[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 _0x98e1=['client','http','request','then','ScreenRecording,\x20%s,\x20%s','request\x20sent','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x98e1,0x1bd));var _0x198e=function(_0x1c3cea,_0x57b8ca){_0x1c3cea=_0x1c3cea-0x0;var _0x2fa7be=_0x98e1[_0x1c3cea];return _0x2fa7be;};'use strict';var _=require(_0x198e('0x0'));var util=require('util');var moment=require(_0x198e('0x1'));var BPromise=require(_0x198e('0x2'));var rs=require(_0x198e('0x3'));var fs=require('fs');var Redis=require(_0x198e('0x4'));var db=require(_0x198e('0x5'))['db'];var utils=require(_0x198e('0x6'));var logger=require(_0x198e('0x7'))(_0x198e('0x8'));var config=require(_0x198e('0x9'));var jayson=require(_0x198e('0xa'));var client=jayson[_0x198e('0xb')][_0x198e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4f16e3,_0x1de072,_0x1c8ab3){return new BPromise(function(_0x15d517,_0x4158ee){return client[_0x198e('0xd')](_0x4f16e3,_0x1c8ab3)[_0x198e('0xe')](function(_0x176a62){logger['info'](_0x198e('0xf'),_0x1de072,_0x198e('0x10'));logger['debug'](_0x198e('0x11'),_0x1de072,_0x198e('0x10'),JSON[_0x198e('0x12')](_0x176a62));if(_0x176a62['error']){if(_0x176a62['error'][_0x198e('0x13')]===0x1f4){logger['error'](_0x198e('0xf'),_0x1de072,_0x176a62[_0x198e('0x14')][_0x198e('0x15')]);return _0x4158ee(_0x176a62[_0x198e('0x14')][_0x198e('0x15')]);}logger[_0x198e('0x14')](_0x198e('0xf'),_0x1de072,_0x176a62[_0x198e('0x14')][_0x198e('0x15')]);return _0x15d517(_0x176a62[_0x198e('0x14')]['message']);}else{logger[_0x198e('0x16')](_0x198e('0xf'),_0x1de072,_0x198e('0x10'));_0x15d517(_0x176a62['result'][_0x198e('0x15')]);}})[_0x198e('0x17')](function(_0x1674cd){logger[_0x198e('0x14')](_0x198e('0xf'),_0x1de072,_0x1674cd);_0x4158ee(_0x1674cd);});});}