mirror of
https://github.com/strukturag/nextcloud-spreed-signaling
synced 2026-03-14 14:35:44 +01:00
Add "version" to dialin sessions.
This commit is contained in:
parent
6bb2582b61
commit
957d930613
3 changed files with 13 additions and 1 deletions
|
|
@ -525,6 +525,7 @@ type BackendServerInfoDialout struct {
|
|||
Connected bool `json:"connected"`
|
||||
Address string `json:"address,omitempty"`
|
||||
UserAgent string `json:"useragent,omitempty"`
|
||||
Version string `json:"version,omitempty"`
|
||||
Features []string `json:"features,omitempty"`
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1023,7 +1023,17 @@ func (b *BackendServer) serverinfoHandler(w http.ResponseWriter, r *http.Request
|
|||
if client := session.GetClient(); client != nil && client.IsConnected() {
|
||||
dialout.Connected = true
|
||||
dialout.Address = client.RemoteAddr()
|
||||
dialout.UserAgent = client.UserAgent()
|
||||
if ua := client.UserAgent(); ua != "" {
|
||||
dialout.UserAgent = ua
|
||||
// Extract version from user-agent, expects "software/version".
|
||||
if pos := strings.IndexByte(ua, '/'); pos != -1 {
|
||||
version := ua[pos+1:]
|
||||
if pos = strings.IndexByte(version, ' '); pos != -1 {
|
||||
version = version[:pos]
|
||||
}
|
||||
dialout.Version = version
|
||||
}
|
||||
}
|
||||
dialout.Features = session.GetFeatures()
|
||||
}
|
||||
info.Dialout = append(info.Dialout, dialout)
|
||||
|
|
|
|||
|
|
@ -1549,6 +1549,7 @@ will contain an additional property `dialout` with the following contents:
|
|||
"connected": true,
|
||||
"address": "192.168.1.0",
|
||||
"useragent": "spreed-webrtc-sip-bridge/1.2.3",
|
||||
"version": "1.2.3",
|
||||
"features": [
|
||||
"start-dialout",
|
||||
"datachannels",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue