Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assign mid to creaeSDPOffer #2490

Open
lisay-yan opened this issue May 24, 2023 · 1 comment
Open

Assign mid to creaeSDPOffer #2490

lisay-yan opened this issue May 24, 2023 · 1 comment

Comments

@lisay-yan
Copy link
Contributor

Summary

Based on #879
It is force setSDPRemote with mid, then suppose when new local SDP, the mid should be kept.
BTW, can I know Pion take mid as mandatory due to correlate RTP sender/receiver?

Then, go to my new request.
Is it possible pass mid value when createSDPOffer??

Motivation

In Telecommunications industry, maybe audio/video/application m lines received at incoming SIP, such as:
m=video
mid=0
m=audio
mid=1
m=application 9 UDP/DTLS/SCTP webrtc-datachannel
mid =2

So, peerConn is only for webrtc-datachannel with mid=2, Pion is great to give SDP answer for the received mid=2.
While, if request a totally new SDP Offer for outgoing side, Pion generated offer will merged with audio/video together at call processing, currently, it is default start mid since 0, while, as above sdp example show, mid=0 and mid=1 had been used by audio/video lines. I prefer pass mid=3 to the SDP Offer to prevent duplicate mid in while SIP/SDP negotiation.

Describe alternatives you've considered

In peerconnection.go
if pc.sctpTransport.dataChannelsRequested != 0 {
mediaSections = append(mediaSections, mediaSection{id: strconv.Itoa(len(mediaSections)), data: true})
}

if createOffer not pass mid, keep 0.
if createOffer pass mid, use the mid to customize it per user needs.

Additional context

Pion is work well for below case.
UE1 ----Offer ----->WEBRTC Media
UE1 <----Answer ----->WEBRTC Media

Request Pion enhanced for below case:
WEBRTC Media(Pion) ----Offer (with specific mid) ----> UE2
WEBRTC Media <----Answer ---------------- ----> UE2

@Sean-Der
Copy link
Member

Sean-Der commented Apr 2, 2024

This is a great API suggestion @lisay-yan I would be happy to add it!

We could put it in the SettingEngine maybe? Tell me what I can do to help here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants