Merge pull request #9855 from pedrobmarin/fix-voice-bridge-compare

Fix voice bridge compare
This commit is contained in:
Anton Georgiev 2020-06-17 14:15:53 -04:00 committed by GitHub
commit c33ed683f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 3 deletions

View File

@ -36,6 +36,10 @@ public class ApiErrors {
errors.add(new String[] {"NotUniqueMeetingID", "A meeting already exists with that meeting ID. Please use a different meeting ID."});
}
public void nonUniqueVoiceBridgeError() {
errors.add(new String[] {"nonUniqueVoiceBridge", "The selected voice bridge is already in use."});
}
public void invalidMeetingIdError() {
errors.add(new String[] {"invalidMeetingId", "The meeting ID that you supplied did not match any existing meetings"});
}

View File

@ -444,7 +444,7 @@ public class MeetingService implements MessageListener {
return null;
for (Map.Entry<String, Meeting> entry : meetings.entrySet()) {
Meeting m = entry.getValue();
if (m.getTelVoice() == telVoice) {
if (telVoice.equals(m.getTelVoice())) {
if (!m.isForciblyEnded())
return m;
}
@ -457,7 +457,7 @@ public class MeetingService implements MessageListener {
return null;
for (Map.Entry<String, Meeting> entry : meetings.entrySet()) {
Meeting m = entry.getValue();
if (m.getWebVoice() == webVoice) {
if (webVoice.equals(m.getWebVoice())) {
if (!m.isForciblyEnded())
return m;
}

View File

@ -181,7 +181,7 @@ class ApiController {
Meeting existingWebVoice = meetingService.getNotEndedMeetingWithWebVoice(newMeeting.getWebVoice());
if (existingTelVoice != null || existingWebVoice != null) {
log.error "VoiceBridge already in use by another meeting (different meetingId)"
errors.nonUniqueMeetingIdError()
errors.nonUniqueVoiceBridgeError()
respondWithErrors(errors)
}
}