diff --git a/RelayServer/Endpoints/RtcEndpoints.cs b/RelayServer/Endpoints/RtcEndpoints.cs
index 35446ce..4d06f90 100644
--- a/RelayServer/Endpoints/RtcEndpoints.cs
+++ b/RelayServer/Endpoints/RtcEndpoints.cs
@@ -47,9 +47,9 @@ public static class RtcEndpoints
});
// Store a new SDP answer for the specified channel call.
- app.MapPost("/api/rtc/answer", async (RtcAnswer request, RtcCallService rtcCallService) =>
+ app.MapPost("/api/rtc/answer", async (RtcOffer request, RtcCallService rtcCallService) =>
{
- await rtcCallService.WriteAnswerAsync(request.ChannelId, request.OfferUser, request.AnswerUser, request.Sdp);
+ await rtcCallService.WriteAnswerAsync(request.ChannelId, request.SessionDescription);
return Results.Ok();
});
diff --git a/RelayServer/Services/Rtc/RtcCallService.cs b/RelayServer/Services/Rtc/RtcCallService.cs
index 2585ce3..a47b307 100644
--- a/RelayServer/Services/Rtc/RtcCallService.cs
+++ b/RelayServer/Services/Rtc/RtcCallService.cs
@@ -98,9 +98,8 @@ public sealed class RtcCallService
///
/// The channel the answer belongs to.
/// The original offer owner.
- /// The user submitting the answer.
- /// The SDP answer payload.
- public async Task WriteAnswerAsync(string channelId, string offerUser, string answerUser, string sdp)
+ /// The SDP and type answer payload.
+ public async Task WriteAnswerAsync(string channelId, RtcSessionDescription sessionDescription)
{
var activeCalls = await _db.Select("rtc_active_calls");
var activeCall = activeCalls.FirstOrDefault(x => x.ChannelId == channelId && x.IsActive);
@@ -110,8 +109,8 @@ public sealed class RtcCallService
activeCall.Answer = new RtcSessionDescription
{
- Type = "answer",
- Sdp = sdp
+ Type = sessionDescription.Type,
+ Sdp = sessionDescription.Sdp
};
activeCall.UpdatedAt = DateTime.UtcNow;