Skip to content

Commit

Permalink
Try to make audio track work
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerlong committed Feb 20, 2021
1 parent 3f4dde9 commit 4b68dd6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions softphone.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ func (softphone *Softphone) Answer(inviteMessage SipMessage) {
if err != nil {
panic(err)
}
peerConnection.CreateDataChannel("audio", nil)

if _, err = peerConnection.AddTransceiverFromKind(webrtc.RTPCodecTypeAudio); err != nil {
panic(err)
Expand All @@ -138,6 +139,12 @@ func (softphone *Softphone) Answer(inviteMessage SipMessage) {
panic(err)
}

peerConnection.OnTrack(func(track *webrtc.TrackRemote, receiver *webrtc.RTPReceiver) {
log.Println("OnTrack")
codec := track.Codec()
log.Println(codec)
})

responseMessage := SipMessage{
Subject: "SIP/2.0 200 OK",
Headers: map[string]string{
Expand Down

0 comments on commit 4b68dd6

Please sign in to comment.