2017-10-13 21:50:17 +08:00
|
|
|
"use strict";
|
2017-11-25 02:59:40 +08:00
|
|
|
|
|
|
|
const config = require('config');
|
2017-10-13 21:50:17 +08:00
|
|
|
/**
|
|
|
|
* @classdesc
|
|
|
|
* Message constants for the communication with BigBlueButton
|
|
|
|
* @constructor
|
|
|
|
*/
|
|
|
|
function Constants () {
|
|
|
|
return {
|
|
|
|
// Media elements
|
|
|
|
WebRTC: "WebRtcEndpoint",
|
|
|
|
RTP: "RtpEndpoint",
|
|
|
|
AUDIO: "AUDIO",
|
|
|
|
VIDEO: "VIDEO",
|
|
|
|
ALL: "ALL",
|
|
|
|
|
2018-04-26 00:56:16 +08:00
|
|
|
// SFU app types
|
|
|
|
SCREENSHARE_APP: 'screenshare',
|
|
|
|
VIDEO_APP: 'video',
|
|
|
|
AUDIO_APP: 'audio',
|
|
|
|
|
|
|
|
// SFU requisition roles
|
|
|
|
SEND_ROLE: 'send',
|
|
|
|
RECV_ROLE: 'recv',
|
|
|
|
SEND_RECV_ROLE: 'sendrecv',
|
|
|
|
|
2017-10-13 21:50:17 +08:00
|
|
|
// Redis channels
|
|
|
|
FROM_BBB_TRANSCODE_SYSTEM_CHAN : "bigbluebutton:from-bbb-transcode:system",
|
|
|
|
FROM_VOICE_CONF_SYSTEM_CHAN: "from-voice-conf-redis-channel",
|
|
|
|
TO_BBB_TRANSCODE_SYSTEM_CHAN: "bigbluebutton:to-bbb-transcode:system",
|
2017-11-25 02:59:40 +08:00
|
|
|
FROM_SCREENSHARE: config.get('from-screenshare'),
|
|
|
|
TO_SCREENSHARE: config.get('to-screenshare'),
|
|
|
|
FROM_VIDEO: config.get('from-video'),
|
|
|
|
TO_VIDEO: config.get('to-video'),
|
|
|
|
FROM_AUDIO: config.get('from-audio'),
|
|
|
|
TO_AUDIO: config.get('to-audio'),
|
2018-03-20 01:50:38 +08:00
|
|
|
TO_AKKA_APPS: config.get('to-akka'),
|
2017-10-13 21:50:17 +08:00
|
|
|
|
|
|
|
// RedisWrapper events
|
|
|
|
REDIS_MESSAGE : "redis_message",
|
|
|
|
WEBSOCKET_MESAGE: "ws_message",
|
|
|
|
GATEWAY_MESSAGE: "gateway_message",
|
|
|
|
|
|
|
|
// Message identifiers 1x
|
|
|
|
START_TRANSCODER_REQUEST: "start_transcoder_request_message",
|
|
|
|
START_TRANSCODER_REPLY: "start_transcoder_reply_message",
|
|
|
|
STOP_TRANSCODER_REQUEST: "stop_transcoder_request_message",
|
|
|
|
STOP_TRANSCODER_REPLY: "stop_transcoder_reply_message",
|
|
|
|
DESKSHARE_RTMP_BROADCAST_STARTED: "deskshare_rtmp_broadcast_started_message",
|
|
|
|
DESKSHARE_RTMP_BROADCAST_STOPPED: "deskshare_rtmp_broadcast_stopped_message",
|
|
|
|
|
|
|
|
//Message identifiers 2x
|
|
|
|
SCREENSHARE_RTMP_BROADCAST_STARTED_2x: "ScreenshareRtmpBroadcastStartedVoiceConfEvtMsg",
|
|
|
|
SCREENSHARE_RTMP_BROADCAST_STOPPED_2x: "ScreenshareRtmpBroadcastStoppedVoiceConfEvtMsg",
|
|
|
|
START_TRANSCODER_REQ_2x: "StartTranscoderSysReqMsg",
|
|
|
|
START_TRANSCODER_RESP_2x: "StartTranscoderSysRespMsg",
|
|
|
|
STOP_TRANSCODER_REQ_2x: "StopTranscoderSysReqMsg",
|
|
|
|
STOP_TRANSCODER_RESP_2x: "StopTranscoderSysRespMsg",
|
|
|
|
|
2018-04-27 05:29:46 +08:00
|
|
|
USER_CAM_BROADCAST_STARTED_2x: "UserBroadcastCamStartMsg",
|
2018-03-20 01:50:38 +08:00
|
|
|
USER_CAM_BROADCAST_STOPPED_2x: "UserBroadcastCamStopMsg",
|
|
|
|
|
2018-04-26 09:52:48 +08:00
|
|
|
STREAM_IS_RECORDED: "StreamIsRecordedMsg",
|
|
|
|
|
2018-04-25 02:05:51 +08:00
|
|
|
START_WEBCAM_SHARE: "StartWebRTCShareEvent",
|
|
|
|
STOP_WEBCAM_SHARE: "StopWebRTCShareEvent",
|
2018-04-24 03:17:17 +08:00
|
|
|
|
2017-10-13 21:50:17 +08:00
|
|
|
// Redis messages fields
|
|
|
|
// Transcoder 1x
|
|
|
|
USER_ID : "user_id",
|
|
|
|
OPTIONS: "options",
|
|
|
|
VOICE_CONF_ID : "voice_conf_id",
|
|
|
|
TRANSCODER_ID : "transcoder_id",
|
|
|
|
|
|
|
|
// Transcoder 2x
|
|
|
|
USER_ID_2x : "userId",
|
|
|
|
TRANSCODER_ID_2x : "transcoderId",
|
|
|
|
MEETING_ID_2x: "meetingId",
|
|
|
|
|
|
|
|
// Screenshare 2x
|
|
|
|
CONFERENCE_NAME: "voiceConf",
|
|
|
|
SCREENSHARE_CONF: "screenshareConf",
|
|
|
|
STREAM_URL: "stream",
|
|
|
|
TIMESTAMP: "timestamp",
|
|
|
|
VIDEO_WIDTH: "vidWidth",
|
|
|
|
VIDEO_HEIGHT: "vidHeight",
|
|
|
|
|
|
|
|
// RTP params
|
|
|
|
MEETING_ID : "meeting_id",
|
|
|
|
VOICE_CONF : "voice_conf",
|
|
|
|
KURENTO_ENDPOINT_ID : "kurento_endpoint_id",
|
|
|
|
PARAMS : "params",
|
|
|
|
MEDIA_DESCRIPTION: "media_description",
|
|
|
|
LOCAL_IP_ADDRESS: "local_ip_address",
|
|
|
|
LOCAL_VIDEO_PORT: "local_video_port",
|
|
|
|
DESTINATION_IP_ADDRESS : "destination_ip_address",
|
|
|
|
DESTINATION_VIDEO_PORT : "destination_video_port",
|
|
|
|
REMOTE_VIDEO_PORT : "remote_video_port",
|
|
|
|
CODEC_NAME: "codec_name",
|
|
|
|
CODEC_ID: "codec_id",
|
|
|
|
CODEC_RATE: "codec_rate",
|
|
|
|
RTP_PROFILE: "rtp_profile",
|
|
|
|
SEND_RECEIVE: "send_receive",
|
|
|
|
FRAME_RATE: "frame_rate",
|
|
|
|
INPUT: "input",
|
|
|
|
KURENTO_TOKEN : "kurento_token",
|
|
|
|
SCREENSHARE: "deskShare",
|
|
|
|
STREAM_TYPE: "stream_type",
|
|
|
|
STREAM_TYPE_SCREENSHARE: "stream_type_deskshare",
|
|
|
|
STREAM_TYPE_VIDEO: "stream_type_video",
|
|
|
|
RTP_TO_RTMP: "transcode_rtp_to_rtmp",
|
|
|
|
TRANSCODER_CODEC: "codec",
|
|
|
|
TRANSCODER_TYPE: "transcoder_type",
|
2018-03-15 04:44:47 +08:00
|
|
|
CALLERNAME: "callername",
|
|
|
|
|
2018-04-25 02:05:51 +08:00
|
|
|
EVENT_NAME: 'eventName',
|
2018-04-24 03:17:17 +08:00
|
|
|
|
|
|
|
TIMESTAMP: 'timestamp',
|
|
|
|
TIMESTAMP_UTC: 'timestampUTC',
|
|
|
|
|
|
|
|
MODULE: 'module',
|
2018-04-25 02:05:51 +08:00
|
|
|
MODULE_WEBCAM: 'bbb-webrtc-sfu',
|
|
|
|
|
|
|
|
FILENAME: 'filename',
|
2018-04-24 03:17:17 +08:00
|
|
|
|
2018-03-15 04:44:47 +08:00
|
|
|
// Log prefixes
|
|
|
|
BASE_PROCESS_PREFIX: '[BaseProcess]',
|
|
|
|
BASE_MANAGER_PREFIX: '[BaseManager]',
|
|
|
|
BASE_PROVIDER_PREFIX: '[BaseProvider]',
|
|
|
|
SCREENSHARE_PROCESS_PREFIX: '[ScreenshareProcess]',
|
|
|
|
SCREENSHARE_MANAGER_PREFIX: '[ScreenshareManager]',
|
|
|
|
SCREENSHARE_PROVIDER_PREFIX: '[ScreenshareProvider]',
|
|
|
|
VIDEO_PROCESS_PREFIX: '[VideoProcess]',
|
|
|
|
VIDEO_MANAGER_PREFIX: '[VideoManager]',
|
2018-04-10 21:32:03 +08:00
|
|
|
VIDEO_PROVIDER_PREFIX: '[VideoProvider]',
|
|
|
|
|
|
|
|
// MCS error codes
|
2018-04-13 00:40:32 +08:00
|
|
|
MEDIA_SERVER_OFFLINE: "1000",
|
|
|
|
|
|
|
|
// Media states'
|
2018-04-26 00:56:16 +08:00
|
|
|
MEDIA_FLOWING_IN: 'MEDIA_FLOWING_IN',
|
|
|
|
MEDIA_FLOWING_OUT: 'MEDIA_FLOWING_OUT',
|
|
|
|
MEDIA_NOT_FLOWING_IN: 'MEDIA_NOT_FLOWING_IN',
|
|
|
|
MEDIA_NOT_FLOWING_OUT: 'MEDIA_NOT_FLOWING_OUT',
|
|
|
|
MEDIA_CONNECTED: 'MEDIA_CONNECTED',
|
|
|
|
MEDIA_DISCONNECTED: 'MEDIA_DISCONNECTED',
|
|
|
|
ON_ICE_CANDIDATE: 'ON_ICE_CANDIDATE',
|
|
|
|
|
2018-04-13 00:40:32 +08:00
|
|
|
MEDIA_STARTED: 'MEDIA_STARTED',
|
|
|
|
MEDIA_STOPPED: 'MEDIA_STOPPED',
|
2018-05-05 04:58:35 +08:00
|
|
|
MEDIA_STARTING: 'MEDIA_STARTING',
|
|
|
|
MEDIA_PAUSED: 'MEDIA_PAUSE'
|
2017-10-13 21:50:17 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = Constants();
|
|
|
|
|