Writing a custom xmpp client: Endpoint ID does not match channel bundle ID

Hey guys,

I’m trying to write a custom xmpp client for Jitsi meet in C++.

I’m using the latest docker-jitsi-meet repo in order to run a local jitsi instance. Web client works fine, there are no problems.

But in my custom terminal client I’m getting this error:

Jicofo 2020-05-17 18:11:30.359 SEVERE: [314] org.jitsi.jicofo.AbstractChannelAllocator.log() jvbbrewery@internal-muc.meet.jitsi/8fe84fcdfdbc - the bridge indicated bad-request: <iq to='focus@auth.meet.jitsi/focus28022956168278' from='jvbbrewery@internal-muc.meet.jitsi/8fe84fcdfdbc' id='7C6vp-2134' type='error'><error type='modify'><bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/><text xmlns='urn:ietf:params:xml:ns:xmpp-stanzas' xml:lang='en'>Endpoint ID does not match channel bundle ID</text></error></iq>

(Endpoint ID does not match channel bundle ID )


Here’s how I see the process:

(Based on this answer: How Jitsi work and this diagram: https://www.gliffy.com/go/publish/7649541/

  1. My client connects to the xmpp through 5222 port, authenticates using ANONYMOUS, creates session using <bind> and <session> stanzas and sends <conference> stanza to jicofo.
  2. Jicofo creates a room, joins the room, and makes the one who requested to create the room an owner in the room, if he is the first one.
  3. The client receives the succesfull response from jicofo and joins the room
  4. Nothing happens, here as there is just one participant.
  5. A second participant joins, jicofo sees that and starts the process of connecting both clients
  • sends an IQ to the jvb component address to allocate channels for both participants.
  • uses the allocated channels data to create jingle session-initiate, which then sends to both clients
  1. Clients accept it and start sending and they are now connected using jvb.

But here’s what I get :frowning:

  1. OK.
  2. It works, Everything is OK
  3. Everything is OK, I can even send and respond to messages, also I send <ping> and <presence> stanzas.
  4. Yep, right.
  5. Right, jicofo starts to connect my client & web client, BUT:
  • jicofo sends iq to jvb - at this point, jicofo tries to allocate channels for web & my clients. Everything should be fine, but JVB responds with Endpoint ID does not match channel bundle ID when jicofo tries to allocate channel for my client.
  • *jicofo sends jingle to the browser client, but not to my client due to the error above.
    and in jicofoc logs there’s Jicofo 2020-05-17 18:11:31.037 WARNING: [30] org.jitsi.jicofo.JitsiMeetConferenceImpl.log() No jingle session yet for room@muc.meet.jitsi/urxvt
  1. My client has nothing to accept and jicofo logs something like No jingle session yet for room@muc.meet.jitsi/urxvt

Here are my logs my client and jicofo:

github/QXmppClientLog.log
github/jicofo.log

jicofo (re-uploaded).log (8.7 KB)
QXmppClientLog (re-uploaded).log (26.2 KB)


Could you help me with this issue? I’m not sure where am I wrong… Jicofo creates a conference, joins the room, my client appears in the room and even can send messages to others, can leave and rejoin the muc, but the call is not working because I don’t get session-initiate jingle from jicofo. And there are also no error stanzas from jicofo.


I’ve read almost everything on https://community.jitsi.org/ and haven’t found anything about this error, but I’ve found this code:
https://github.com/jitsi/jicofo/blob/b3821f58b1ed3ebbda986e27fdca0ab6f054dcd2/src/main/java/org/jitsi/jicofo/AbstractChannelAllocator.java#L301

Also, I’ve read all these source files below and found out that Jicofo sets Bundle ID equal to Endpoint ID which is my nickname, is that right?

Thank you,

Vlad.


Check out this issue: https://github.com/jitsi/jicofo/issues/531


@bbaldino wrote:

Thanks for the well-written report, clearly you’ve done your research :slight_smile: In general this sort of thing should be posted over at community.jitsi.org, though, until we confirm there’s an actual issue.

Can you include logs from the bridge with
?

org.jitsi.videobridge.xmpp.XmppCommon.level=FINE

Added in /etc/jitsi/videobridge/logging.properties ? That will allow us to see the Colibri that the bridge is seeing that would generate this error.

Is your client doing max-bundle? (all RTP + RTCP sent and received over a single port?) This is required. If it is, perhaps it’s not advertising its transport bundles correctly (it should be a single channel-bundle). Also, I don’t see any session-initiate or session-accept in there your client logs?


My answer:

Thanks for the well-written report, clearly you’ve done your research :slight_smile: In general this sort of thing should be posted over at community.jitsi.org, though, until we confirm there’s an actual issue.

I think it’s not an issue with jiicofo, it’s me doing something wrong, I just can’t figure out what exactly. I’m pretty new to jitsi (I’ve been playing with it just for the last week or less), so there may be some obvious mistakes from my side.

If you want I’ll move this issue to the community.jitsi, but please do not remove this one until I’ve moved it to the community forum.

Can you include logs from the bridge with…

Yes, thank for that, here’s the JVB log: github/ jvb.log / re-uploaded to jitsi.org: jvb.log (31.1 KB)
and jicofo (FINE) github/ jicofo.log / re-uploaded to jitsi.org: jicofo (3).log (12.1 KB)

And I see the reason for the error (there’s no <channel-bundle> in the allocate request iq), but why?
I thought I shound send bundle group on session-accept, but I do not get any session-initiate iq from focus.

<group semantics="BUNDLE" xmlns="urn:xmpp:jingle:apps:grouping:0">
	<content name="audio"/>
	<content name="video"/>
        <content name="data"/>
</group>

Is your client doing max-bundle? (all RTP + RTCP sent and received over a single port?) This is required. If it is, perhaps it’s not advertising its transport bundles correctly (it should be a single channel-bundle). Also, I don’t see any session-initiate or session-accept in there your client logs?

Do you mean rtcp-mux and bundle? I use gstreamer and they have rtp funnel which adds bundle capabilities, also I have rtpmux element, but these should be used after session-initiate in XMPP, right?

I should advertise my channel-bundle after session-initiate in session-accept jingle, is that right?

Or I should send something else to jicofo in order to promote my bundle & mux caps before I get session-initiate jingle?


I know It’s a huge issue from me, sorry :slight_smile:

Please try to help me solve this problem. As far as I know, there is not much documentation on XMPP connection process with the focus participant except the diagram and comments in code.

If there’are any docs describing the process of call initiation with focus please share them :slight_smile: (Except XEP standards, of course, I’ve read some parts of them in order to understand how jitsi works).


Also, I’ve tried a lot of other projects like uv4l, they seem to have problems as well. I’m not sure why, but I believe their client can’t even join MUC. Unfortunately, a lot of these solutions are closed-source, so I’m trying to write my own. And I do not want to use chrome / any headless browser for that, I’m writing my client in c++.


Thank you

Vlad

I think maybe it’s a disco thing, I think you need to make sure you advertise the mux (bundle) features: https://github.com/jitsi/jicofo/blob/master/src/main/java/org/jitsi/jicofo/discovery/DiscoveryUtil.java#L84-L92

Thank you a lot!

Yes, it is a disco thing. My XMPP client does not support these features and hence does not send them to jicofo. I’ve added them to the disco response and have got my session-initiate jingle.

Now I’ll try to find a way to accept mux/bundle sessions.

I had seen this post before [jitsi-users] Writing a jitsi-meet client for raspberry pi , but forgot about it.

So, now, with a new videobridge, the mux and bundle standarts are mandatory for clients, right?

Yup

Thanks, have a nice day :slight_smile: