diff --git a/src/main/java/io/antmedia/rest/RestServiceBase.java b/src/main/java/io/antmedia/rest/RestServiceBase.java index fc0fa7d17..1d54f5981 100644 --- a/src/main/java/io/antmedia/rest/RestServiceBase.java +++ b/src/main/java/io/antmedia/rest/RestServiceBase.java @@ -631,8 +631,12 @@ public Result addEndpoint(String id, Endpoint endpoint) { String message = null; endpoint.setType(ENDPOINT_GENERIC); - //generate custom endpoint invidual ID - String endpointServiceId = "custom"+RandomStringUtils.randomAlphabetic(6); + + String endpointServiceId = endpoint.getEndpointServiceId(); + if (endpointServiceId == null || endpointServiceId.isEmpty()) { + //generate custom endpoint invidual ID + endpointServiceId = "custom"+RandomStringUtils.randomAlphabetic(6); + } endpoint.setEndpointServiceId(endpointServiceId);