Janus lua plugin, SDP handling: missing ICE username fragment

62 views
Skip to first unread message

Alexei Golovko

unread,
Sep 5, 2022, 12:41:53 PM9/5/22
to meetech...@googlegroups.com
I am trying to use lua plugin for datachannel publishing: some clients, marked as publishers, can send messages via datachannel to Janus, and others, marked as subscribers, should receive all these messages.

I've made some version based on samples (echotest.lua, videoroom.lua): https://gist.github.com/le-chat/3ddf52e083dba73d8a3dc4794ad53e1a#file-pubsub-lua It receives an SDP offer from a client and generates an answer.

When I connect from python (aiortc) client, I get an error "ICE username fragment or password is missing". I don't understand how to fix this: Janus definitely does some processing of incoming SDP, and lua function handleMessage sees not the same SDP as was sent by client (I've checked this also with copying SDP to message body). Another part of SDP processing happens in janus-sdp.lua.

Documentation does not explain how SDPs are processed in general and how I should manipulate them in lua code. I've tried to copy ice-ufrag, ice-pwd from incoming SDP directly, but without success, and I am not sure this is the suggested way.

Any help is appreciated.

Btw, similar python code is able to connect with datachannel originating from a streaming plugin. So I don't think it's a client issue.

The code from gist above contains a docker file to allow fully reproducing my example (run Janus with my lua script and python client).

Regards, Alexei Golovko.

Lorenzo Miniero

unread,
Sep 6, 2022, 4:16:23 AM9/6/22
to meetecho-janus
Use the Admin API ( https://www.meetecho.com/blog/understanding-the-janus-admin-api/ ) to look at the exchanged SDPs and check what's wrong. That said, plugins (including Lua) never see ICE/DTLS/WebRTC stuff, which is terminated by the core, so the plugin you use should be irrelevant, only the barebone SDP you generate is.

L.
Reply all
Reply to author
Forward
0 new messages