mirror of
https://github.com/strukturag/nextcloud-spreed-signaling
synced 2024-05-21 15:06:38 +02:00
Include backend URL to when starting dialout request.
This commit is contained in:
parent
c72c821687
commit
2a40c89585
|
@ -793,7 +793,8 @@ func (m *InternalClientMessage) CheckValid() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
type InternalServerDialoutRequest struct {
|
type InternalServerDialoutRequest struct {
|
||||||
RoomId string `json:"roomid"`
|
RoomId string `json:"roomid"`
|
||||||
|
Backend string `json:"backend"`
|
||||||
|
|
||||||
Request *BackendRoomDialoutRequest `json:"request"`
|
Request *BackendRoomDialoutRequest `json:"request"`
|
||||||
}
|
}
|
||||||
|
|
|
@ -698,6 +698,7 @@ func (b *BackendServer) startDialout(roomid string, backend *Backend, request *B
|
||||||
Type: "dialout",
|
Type: "dialout",
|
||||||
Dialout: &InternalServerDialoutRequest{
|
Dialout: &InternalServerDialoutRequest{
|
||||||
RoomId: roomid,
|
RoomId: roomid,
|
||||||
|
Backend: backend.Url(),
|
||||||
Request: request.Dialout,
|
Request: request.Dialout,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -79,11 +79,13 @@ func CreateBackendServerForTestFromConfig(t *testing.T, config *goconf.ConfigFil
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
config.AddOption("backend", "allowed", u.Host)
|
backendId := "backend1"
|
||||||
|
config.AddOption("backend", "backends", backendId)
|
||||||
|
config.AddOption(backendId, "url", server.URL)
|
||||||
if u.Scheme == "http" {
|
if u.Scheme == "http" {
|
||||||
config.AddOption("backend", "allowhttp", "true")
|
config.AddOption("backend", "allowhttp", "true")
|
||||||
}
|
}
|
||||||
config.AddOption("backend", "secret", string(testBackendSecret))
|
config.AddOption(backendId, "secret", string(testBackendSecret))
|
||||||
config.AddOption("sessions", "hashkey", "12345678901234567890123456789012")
|
config.AddOption("sessions", "hashkey", "12345678901234567890123456789012")
|
||||||
config.AddOption("sessions", "blockkey", "09876543210987654321098765432109")
|
config.AddOption("sessions", "blockkey", "09876543210987654321098765432109")
|
||||||
config.AddOption("clients", "internalsecret", string(testInternalSecret))
|
config.AddOption("clients", "internalsecret", string(testInternalSecret))
|
||||||
|
@ -1886,6 +1888,9 @@ func TestBackendServer_DialoutAccepted(t *testing.T) {
|
||||||
if msg.Internal.Dialout.RoomId != roomId {
|
if msg.Internal.Dialout.RoomId != roomId {
|
||||||
t.Errorf("expected room id %s, got %+v", roomId, msg)
|
t.Errorf("expected room id %s, got %+v", roomId, msg)
|
||||||
}
|
}
|
||||||
|
if url := server.URL + "/"; msg.Internal.Dialout.Backend != url {
|
||||||
|
t.Errorf("expected backend %s, got %+v", url, msg)
|
||||||
|
}
|
||||||
|
|
||||||
response := &ClientMessage{
|
response := &ClientMessage{
|
||||||
Id: msg.Id,
|
Id: msg.Id,
|
||||||
|
@ -1990,6 +1995,9 @@ func TestBackendServer_DialoutRejected(t *testing.T) {
|
||||||
if msg.Internal.Dialout.RoomId != roomId {
|
if msg.Internal.Dialout.RoomId != roomId {
|
||||||
t.Errorf("expected room id %s, got %+v", roomId, msg)
|
t.Errorf("expected room id %s, got %+v", roomId, msg)
|
||||||
}
|
}
|
||||||
|
if url := server.URL + "/"; msg.Internal.Dialout.Backend != url {
|
||||||
|
t.Errorf("expected backend %s, got %+v", url, msg)
|
||||||
|
}
|
||||||
|
|
||||||
response := &ClientMessage{
|
response := &ClientMessage{
|
||||||
Id: msg.Id,
|
Id: msg.Id,
|
||||||
|
|
Loading…
Reference in a new issue