fixed endpoint data
This commit is contained in:
@@ -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();
|
||||
});
|
||||
|
||||
|
||||
@@ -98,9 +98,8 @@ public sealed class RtcCallService
|
||||
/// </summary>
|
||||
/// <param name="channelId">The channel the answer belongs to.</param>
|
||||
/// <param name="offerUser">The original offer owner.</param>
|
||||
/// <param name="answerUser">The user submitting the answer.</param>
|
||||
/// <param name="sdp">The SDP answer payload.</param>
|
||||
public async Task WriteAnswerAsync(string channelId, string offerUser, string answerUser, string sdp)
|
||||
/// <param name="sessionDescription">The SDP and type answer payload.</param>
|
||||
public async Task WriteAnswerAsync(string channelId, RtcSessionDescription sessionDescription)
|
||||
{
|
||||
var activeCalls = await _db.Select<RtcActiveCall>("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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user