Subject: [rtcweb] How to get a diff between the remote SDP in an established session and a new received SDP offer

From: Iñaki Baz Castillo <[email-masked]>
Date: Wed, 4 Jul 2012 18:25:51 +0200

Hi, let's assume I have an established audio session. Later the remote
sends me a new SDP offer (let's say a SIP re-INVITE) and I want to
analyze what is new in the new SDP (in order to ask the user for
consent). So for example when the new SDP arrives I need to know
whether it contains audio and video or whatever.

With the current JSEP API I see no way. The only I can do with the new
received SDP is:

  pc.setRemoteDescription(SDP_OFFER, REMOTE_SDP_TEXT)

but this would alter my multimedia session before I can ask my user
for consent. Do I miss something?

And I would also like to know whether the received SDP contains
dissabled streams (i.e. a video stream with port 0) before accepting
it. Basically I want a mechanism for getting a diff between the
existing remote SDP and the new received one.

-- 
Iñaki Baz Castillo
<[email-masked]>

---

From: Iñaki Baz Castillo <[email-masked]>
Date: Fri, 6 Jul 2012 09:33:22 +0200

Hi, I would really appreciate some explanation about this subject.
Basically the aim of my question is to imitate the behavior of
existing chat+audio+video clients in which the session is initially
started with just audio, and video is added later (by asking for user
consent).

I hope that raw parsing of the received SDP is not needed for achieving this :)

Regards.

-- 
Iñaki Baz Castillo
<[email-masked]>

---

From: Martin Thomson <[email-masked]>
Date: Fri, 6 Jul 2012 09:16:10 -0700

> I hope that raw parsing of the received SDP is not needed for achieving this :)

I'm surprised that you think that.

I believe that the subject is one of the open issues, though I believe
that the current discussion was heading toward the conclusion that
calling set<X>Description() on a PeerConnection was the blessed method
for determining what streams are present in an offer or answer.

Therefore, the process is something like...

# Take existing session, look at the attached streams (and their tracks).
# Take new offer, create new PeerConnection, attach the same local
streams, call pc.setRemoteDescription(OFFER, sdpOffer), examine the
resulting attached streams (and their tracks).
# Discard the new PeerConnection.

Of course, this is highly likely to fail because the resources
necessary to create and configure the second PeerConnection are likely
taken by the first.  So your best bet is to scrounge through the SDP.
But SDP is awesome, so it's OK.

--Martin

---

From: Stefan Hakansson LK <[email-masked]>
Date: Tue, 10 Jul 2012 10:11:53 +0200

> I hope that raw parsing of the received SDP is not needed for achieving this :)

The API is designed around MediaStreams and MediaStream tracks. So, for 
the app receiving a MediaStream that travels from another app using a 
PeerConnection, any change would (if you do not do SDP parsing!) be 
shown by events such as "addstream"/"removestream" (for PeerConnection) 
"addtrack"/"removetrack" (for a MediaStream) and "mute"/"unmute" (for a 
MediaStream track). Could not these events be used to trigger change at 
the receiving app (e.g. if the incoming video track changes to "unmute" 
the outgoing one is enabled in response)?

In addition, the app's can signal anything they would like to using 
proprietary signaling ("I would like to enable video, OK?").

Br,
Stefan

---

From: Iñaki Baz Castillo <[email-masked]>
Date: Tue, 10 Jul 2012 12:07:17 +0200

> But SDP is awesome, so it's OK.

I strongly hope WebRTC API will provide something much better for a
simple and usual task like adding video to an audio session with
previous user consent.

-- 
Iñaki Baz Castillo
<[email-masked]>

---

From: Stefan Hakansson LK <[email-masked]>
Date: Tue, 10 Jul 2012 14:12:07 +0200

> simple and usual task like adding video to an audio session with
Note my answer at 
http://www.ietf.org/mail-archive/web/rtcweb/current/msg04859.html

---

From: Eric Rescorla <[email-masked]>
Date: Tue, 10 Jul 2012 05:56:35 -0700

> simple and usual task like adding video to an audio session with

Yes. PeerConnection.AddStream()