🐛 Bug fixes of Video/Audio Call

This commit is contained in:
LittleSheep 2024-04-06 17:28:21 +08:00
parent eaf074609e
commit 476466f8c6
4 changed files with 11 additions and 5 deletions

View File

@ -137,7 +137,12 @@ func exchangeCallToken(c *fiber.Ctx) error {
return c.JSON(fiber.Map{
"token": tk,
"endpoint": viper.GetString("meeting.endpoint"),
"full_url": fmt.Sprintf("%s?jwt=%s", viper.GetString("meeting.endpoint"), url.QueryEscape(tk)),
"full_url": fmt.Sprintf(
"%s/%s?jwt=%s",
viper.GetString("meeting.endpoint"),
call.ExternalID,
url.QueryEscape(tk),
),
})
}
}

View File

@ -99,7 +99,7 @@ func NewServer() {
channels.Get("/:channel/calls", listCall)
channels.Get("/:channel/calls/ongoing", getOngoingCall)
channels.Post("/:channel/calls", authMiddleware, startCall)
channels.Delete("/:channel/calls", authMiddleware, endCall)
channels.Delete("/:channel/calls/ongoing", authMiddleware, endCall)
channels.Post("/:channel/calls/ongoing/token", authMiddleware, exchangeCallToken)
}

View File

@ -129,7 +129,8 @@ func EndCall(call models.Call) (models.Call, error) {
}
func EncodeCallToken(call models.Call, user models.Account) (string, error) {
tk := jwt.NewWithClaims(jwt.SigningMethodHS512, jwt.MapClaims{
// Jitsi requires HS256 as algorithm, so we cannot use HS512
tk := jwt.NewWithClaims(jwt.SigningMethodHS256, jwt.MapClaims{
"context": jwt.MapClaims{
"user": jwt.MapClaims{
"avatar": user.Avatar,

View File

@ -4,7 +4,7 @@ maintainer = "SmartSheep Studio"
frontend = "https://lian.solsynth.dev"
bind = "0.0.0.0:8447"
domain = "feed.smartsheep.studio"
domain = "im.solsynth.dev"
secret = "LtTjzAGFLshwXhN4ZD4nG5KlMv1MWcsvfv03TSZYnT1VhiAnLIZFTnHUwR0XhGgi"
content = "uploads"
@ -20,7 +20,7 @@ endpoint = "https://id.solsynth.dev"
grpc_endpoint = "id.solsynth.dev:7444"
[meeting]
client_id = "solarmeet"
client_id = "solsynth-meeting"
client_secret = "1234567890"
endpoint = "https://meet.solsynth.dev"