openvidu-server: return "customSessionId" property on Session fetch

pull/121/head
pabloFuente 2018-09-20 18:18:32 +02:00
parent 04cf3f3630
commit c917164657
3 changed files with 9 additions and 4 deletions

View File

@ -570,7 +570,7 @@ export class OpenVidu {
let changed = !storedSession.equalTo(fetchedSession); let changed = !storedSession.equalTo(fetchedSession);
fetchedSession.activeConnections.forEach((connection, index1) => { fetchedSession.activeConnections.forEach((connection, index1) => {
addWebRtcStatsToConnections(connection, session.connections.content); addWebRtcStatsToConnections(connection, session.connections.content);
if (!changed) { // Check if server information has changed in any Publisher/Subscriber if (!changed) { // Check if server webrtc information has changed in any Publisher/Subscriber
for (let index2 = 0; (index2 < connection['publishersWebRtc'].length && !changed); index2++) { for (let index2 = 0; (index2 < connection['publishersWebRtc'].length && !changed); index2++) {
changed = changed || JSON.stringify(connection['publishersWebRtc'][index2]['webRtc']) !== JSON.stringify(storedSession.activeConnections[index1]['publishersWebRtc'][index2]['webRtc']); changed = changed || JSON.stringify(connection['publishersWebRtc'][index2]['webRtc']) !== JSON.stringify(storedSession.activeConnections[index1]['publishersWebRtc'][index2]['webRtc']);
} }

View File

@ -444,6 +444,8 @@ export class Session {
}; };
if (!!customSessionId) { if (!!customSessionId) {
this.properties.customSessionId = customSessionId; this.properties.customSessionId = customSessionId;
} else if (!!json.customSessionId) {
this.properties.customSessionId = json.customSessionId;
} }
if (!!defaultCustomLayout) { if (!!defaultCustomLayout) {
this.properties.defaultCustomLayout = defaultCustomLayout; this.properties.defaultCustomLayout = defaultCustomLayout;

View File

@ -83,9 +83,9 @@ public class KurentoSession implements Session {
public final ConcurrentHashMap<String, String> publishedStreamIds = new ConcurrentHashMap<>(); public final ConcurrentHashMap<String, String> publishedStreamIds = new ConcurrentHashMap<>();
public KurentoSession(String sessionId, Long startTime, SessionProperties sessionProperties, KurentoClient kurentoClient, public KurentoSession(String sessionId, Long startTime, SessionProperties sessionProperties,
KurentoSessionEventsHandler kurentoSessionHandler, boolean destroyKurentoClient, CallDetailRecord CDR, KurentoClient kurentoClient, KurentoSessionEventsHandler kurentoSessionHandler,
OpenviduConfig openviduConfig) { boolean destroyKurentoClient, CallDetailRecord CDR, OpenviduConfig openviduConfig) {
this.sessionId = sessionId; this.sessionId = sessionId;
this.sessionProperties = sessionProperties; this.sessionProperties = sessionProperties;
this.kurentoClient = kurentoClient; this.kurentoClient = kurentoClient;
@ -387,6 +387,9 @@ public class KurentoSession implements Session {
if (RecordingLayout.CUSTOM.equals(this.sessionProperties.defaultRecordingLayout())) { if (RecordingLayout.CUSTOM.equals(this.sessionProperties.defaultRecordingLayout())) {
json.addProperty("defaultCustomLayout", this.sessionProperties.defaultCustomLayout()); json.addProperty("defaultCustomLayout", this.sessionProperties.defaultCustomLayout());
} }
if (this.sessionProperties.customSessionId() != null) {
json.addProperty("customSessionId", this.sessionProperties.customSessionId());
}
JsonObject connections = new JsonObject(); JsonObject connections = new JsonObject();
JsonArray participants = new JsonArray(); JsonArray participants = new JsonArray();
this.participants.values().forEach(p -> { this.participants.values().forEach(p -> {