Skip to content

Commit c998449

Browse files
conference: add additional call invite logging
1 parent 6433cbd commit c998449

File tree

4 files changed

+17
-19
lines changed

4 files changed

+17
-19
lines changed

pkg/conference/matrix.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ func (c *Conference) onNewParticipant(participantID ParticipantID, inviteEvent *
7272
// Send the answer back to the remote peer.
7373
recipient := participant.asMatrixRecipient()
7474
streamMetadata := c.getAvailableStreamsFor(participantID)
75+
participant.logger.WithField("sdpAnswer", sdpAnswer.SDP).Debug("Sending SDP answer")
7576
c.signaling.SendSDPAnswer(recipient, streamMetadata, sdpAnswer.SDP)
7677
return nil
7778
}

pkg/main.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ func main() {
4040
// Initialize logging subsystem (formatting, global logging framework etc).
4141
logrus.SetFormatter(&logrus.TextFormatter{FullTimestamp: true, ForceColors: true})
4242

43+
// Temporarily enable debug logging.
44+
logrus.SetLevel(logrus.DebugLevel)
45+
4346
// Define functions that are called before exiting.
4447
// This is useful to stop the profiler if it's enabled.
4548
deferred_functions := []func(){}

pkg/peer/peer.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ func (p *Peer[ID]) ProcessSDPAnswer(sdpAnswer string) error {
165165

166166
// Applies the sdp offer received from the remote peer and generates an SDP answer.
167167
func (p *Peer[ID]) ProcessSDPOffer(sdpOffer string) (*webrtc.SessionDescription, error) {
168+
p.logger.WithField("sdpOffer", sdpOffer).Debug("processing SDP offer")
168169
err := p.peerConnection.SetRemoteDescription(webrtc.SessionDescription{
169170
Type: webrtc.SDPTypeOffer,
170171
SDP: sdpOffer,
@@ -185,8 +186,6 @@ func (p *Peer[ID]) ProcessSDPOffer(sdpOffer string) (*webrtc.SessionDescription,
185186
return nil, ErrCantSetLocalDescription
186187
}
187188

188-
// TODO: Do we really need to call `webrtc.GatheringCompletePromise` here?
189-
190189
sdpAnswer := p.peerConnection.LocalDescription()
191190
if sdpAnswer == nil {
192191
p.logger.WithError(err).Error("could not generate a local description")

pkg/router.go

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -95,26 +95,21 @@ func (r *Router) handleMatrixEvent(evt *event.Event) {
9595
// Only ToDeviceCallInvite events are allowed to create a new conference, others
9696
// are expected to operate on an existing conference that is running on the SFU.
9797
if conference == nil && evt.Type.Type == event.ToDeviceCallInvite.Type {
98-
if evt.Type.Type == event.ToDeviceCallInvite.Type {
99-
logger.Infof("creating new conference %s", conferenceID)
100-
conferenceSink, err := conf.StartConference(
101-
conferenceID,
102-
r.config,
103-
r.matrix.CreateForConference(conferenceID),
104-
createConferenceEndNotifier(conferenceID, r.channel),
105-
evt.Sender,
106-
evt.Content.AsCallInvite(),
107-
)
108-
if err != nil {
109-
logger.WithError(err).Errorf("failed to start conference %s", conferenceID)
110-
return
111-
}
112-
113-
r.conferenceSinks[conferenceID] = conferenceSink
98+
logger.Infof("creating new conference %s", conferenceID)
99+
conferenceSink, err := conf.StartConference(
100+
conferenceID,
101+
r.config,
102+
r.matrix.CreateForConference(conferenceID),
103+
createConferenceEndNotifier(conferenceID, r.channel),
104+
evt.Sender,
105+
evt.Content.AsCallInvite(),
106+
)
107+
if err != nil {
108+
logger.WithError(err).Errorf("failed to start conference %s", conferenceID)
114109
return
115110
}
116111

117-
logger.Warnf("ignoring %s since the conference is unknown", event.ToDeviceCallInvite.Type)
112+
r.conferenceSinks[conferenceID] = conferenceSink
118113
return
119114
}
120115

0 commit comments

Comments
 (0)