ICE controlling/controlled agents in Janus

546 views
Skip to first unread message

Anand Sivaram

unread,
Feb 20, 2016, 6:42:08 AM2/20/16
to meetech...@googlegroups.com
Dear All,

I was using Janus Video Call Plugin, opened two google-chrome browser sessions, registered two users (user1, user2) and trying to make a video call from user2 to user1.

Janus was started with full logging (janus -d 7). With the above call scenario user2 (offer) has become the "controlled" agent and user1 (answer) has become the "controlling" agent.
Also from code, In ice.c function janus_ice_setup_local()
handle->controlling = janus_ice_lite_enabled ? FALSE : !offer;

That means if ICE lite is not enabled, the answering endpoint becomes the controlling agent.

But, it has been explained in many places that the endpoint doing offer is normally the controlling agent and the answering endpoint is the controlled agent.
For example in ICE RFC

Any specific reason for this difference?

Thanks and Regards

Anand

Lorenzo Miniero

unread,
Feb 20, 2016, 7:07:31 AM2/20/16
to meetecho-janus
Both users are establishing a session with Janus, not with themselves. It's only the media that is forwarded from one to another. As such, different users can have the same role even when "talking" to each other, as that role only refers to the ICE session between each user and Janus. As to the roles, I can't remember exactly what lead to that, but IIRC it's related to DTLS: DTLS clients take the controlling role, and typically the callee is the DTLS client, hence answerer=controlling.

L.

Anand Sivaram

unread,
Feb 20, 2016, 1:04:01 PM2/20/16
to meetecho-janus
Thanks Lorenzo.  I will try Janus to get log of the DTLS client/server session soon.

BTW, is it possible for both users to establish a session directly between themselves without the media going through Janus?
Is it required to write a custom plugin to get it done?

Thanks and Regards

Anand

Lorenzo Miniero

unread,
Feb 20, 2016, 1:41:52 PM2/20/16
to meetecho-janus
You don't need Janus to do that, just do a plain P2P session.
And no, no plugin can help you with that: when you go through Janus, it's always going to bridge the media.

L.

Anand Sivaram

unread,
Feb 21, 2016, 11:00:29 AM2/21/16
to meetecho-janus
Thanks Lorenzo for the clarification. 

Anand Sivaram

unread,
Feb 23, 2016, 2:09:39 AM2/23/16
to meetecho-janus
I have tried both Streaming and Videocall plugins and got the logs.
Pasting only ICE and DTLS initialization logs below.

This is what effectively I am seeing about ICE and DTLS initialization.
Hope my understanding is correct..

## In Streaming usecase:
Janus   = Caller, ICE Controlling, DTLS Server
Firefox = Callee, ICE Controlled,  DTLS Client

## In Videocall usecase:
For the Originationg Call Leg,
Firefox(user2) = Caller, ICE Controlling, DTLS Server
Janus(user2)   = Callee, ICE Controlled,  DTLS Client
For the Terminating Call Leg,
Janus(user1)   = Caller, ICE Controlling, DTLS Server
Firefox(user1) = Callee, ICE Controlled,  DTLS Client

Thanks and Regards

Anand


**************************************************
Streaming Plugin Logs: with test_gstreamer_1.sh
**************************************************

streaming plugin session, handle created: janus/3436128489/2462724269
Line  574: [2462724269] Setting ICE locally: got ANSWER (1 audios, 1 videos)
Line  575: [2462724269] Creating ICE agent (ICE Full mode, controlling) 0

Line  730: HTTP Response ==> SDP: Offer from Janus, ufrag=QBFL, FingerPrint: D2:B9.....
Line  775: POST [/janus/3436128489/2462724269]
           SDP: Answer from Firefox, ufrag=7553f804, FingerPrint: BB:B6.....

Line 1097: [2462724269] Setting accept state (DTLS server)

**************************************************
Videocall Plugin Logs: user2 calling user1
**************************************************

user1 session, handle created: janus/1301692670/419015803
Line  431: POST Request to Register user1

user2 session, handle created: janus/3584623772/568636380
Line  832: POST Request to Register user2
Line 1071: POST [/janus/3584623772/568636380]
           SDP: Offer from Firefox, ufrag=f3162385, FingerPrint: 72:02.....
Line 1151: [568636380] Setting ICE locally: got OFFER (1 audios, 1 videos)
Line 1152: [568636380] Creating ICE agent (ICE Full mode, controlled) 1
Line 1220: user2 is calling user1
Line 1265: [419015803] Setting ICE locally: got ANSWER (1 audios, 1 videos)
Line 1266: [419015803] Creating ICE agent (ICE Full mode, controlling) 0
Line 2255: HTTP Response ==> To user1 (janus/1301692670/419015803)
           SDP: Offer from Janus, forwarded parameters from user2 to user1,
           ufrag=FSXU, FingerPrint: D2:B9.....
Line 2403: POST [/janus/1301692670/419015803]
           SDP: Answer from Firefox, ufrag=d09b9d32, FingerPrint: BA:16.....
Line 2894: [419015803] Setting accept state (DTLS server)
Line 3051: [568636380] Setting connect state (DTLS client)
Line 3020: HTTP Response ==> To user2 (janus/3584623772/568636380)
           SDP: Answer from Janus, forward parameters from user1 to user2,
           ufrag=E/ot, FingerPrint: D2:B9.....

**************************************************
Reply all
Reply to author
Forward
0 new messages