Skip to content

Commit 5880f70

Browse files
authored
Fix SDP codec selection (#97)
Fix SDP codec selection. Fixes #95.
1 parent 418097f commit 5880f70

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

pkg/sip/signaling.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,13 @@ func sdpAnswerMediaDesc(rtpListenerPort int, res *sdpCodecResult) []*sdp.MediaDe
136136
return []*sdp.MediaDescription{
137137
{
138138
MediaName: sdp.MediaName{
139-
Media: "audio",
140-
Port: sdp.RangedPort{Value: rtpListenerPort},
141-
Protos: []string{"RTP", "AVP"},
142-
Formats: []string{"0", "101"},
139+
Media: "audio",
140+
Port: sdp.RangedPort{Value: rtpListenerPort},
141+
Protos: []string{"RTP", "AVP"},
142+
Formats: []string{
143+
strconv.Itoa(int(res.AudioType)),
144+
strconv.Itoa(int(res.DTMFType)),
145+
},
143146
},
144147
Attributes: attrs,
145148
},

0 commit comments

Comments
 (0)