Associate application user ID with stream ID

77 views
Skip to first unread message

Hermawan Winata

unread,
May 21, 2020, 11:56:43 AM5/21/20
to Ant Media Server
Hi, I'm building a conference call application using AntMedia WebRTC, but I find it difficult to associate stream ID with my application user ID. Do you have suggestions how it can be achieved?
I'm thinking of below approaches:
  1. Using WebRTC data channel. Is it already supported in AntMedia server?
  2. Modifying SDP parameter `s={userID}` or `i={userID}` based on https://tools.ietf.org/html/rfc4566. Will AntMedia server preserves that data in the offer and answer SDP from clients during 'publish' and 'play' flow?
Any inputs are appreciated.

mahmut asım Onat

unread,
May 22, 2020, 6:41:18 PM5/22/20
to Ant Media Server
Hi Hermawan,

You can use a token based approach where you can assign a token to each user and let them use that token to publish or play. 
https://antmedia.io/secure-streaming-with-hash-based-tokens/

Data channels are supported in AntMedia Server but I'm not sure how it can be used for this use case.

Best,
Asim

Hermawan Winata

unread,
May 25, 2020, 12:09:56 PM5/25/20
to Ant Media Server
Hi Asim,

Thank you for your reply.

Based on that link, we can calculate token from
STREAM_ID: The id of stream, generated in Ant Media Server.
ROLE: “play” or "publish"
SECRET: Shared secret key (should be defined in the setting file)

Afterwards, that token should be sent to my application server in order to associate userID and streamID. 
But instead of token, I can also send streamID directly. Is my understanding correct?

What I have in mind is something like display_name in AntMedia WebSocket protocol
{
    command : "joinRoom",
    room : "room1",
    display_name: userIdOrUsername
}
Is it supported?

Best regards,
Hermawan.

mahmut asım Onat

unread,
May 27, 2020, 1:58:11 PM5/27/20
to Ant Media Server
Hi Hermawan,

Sorry for the late reply, you can think of the streamID as a property of the room and people joining has no such property. There is no real way to distinguish two users if you don't use an additional method. You can use a token based approach or maybe use session token in your website. Apart from that we don't have diplay_name or a similar function.

Best,
Asim
Reply all
Reply to author
Forward
0 new messages