Table of Contents

Group call sequence

A client currently in call with other clients can create a group call by asking those clients to connect to each other too.

An alternative way of adding clients to a group call is to ask them to join the group with a special group call link.

Group calls use a mesh architecture with a bridged fallback solution for audio:

The wrtc_kit automatically connects participating group call clients with each other and the voice bridge depending on their capabilities. Mixed group calls with both wrtc and SIP clients in one group are possible.

wrtc clients

Group calls between wrtc clients are connected as mesh calls with a bridged audio fallback. It means everyone connects to everyone else, plus a fallback to the voice bridge.

A client A is currently in call with two other clients B and C:

     A
    / \
   /   \
  B     C

Client A starts the group call by first connecting to the voice bridge VB:

     A
    /|\
   / | \
  B  |  C
     |
     |
    VB

Then it asks clients B and C to connect to voice bridge V too:

     A
    /|\
   / | \
  B  |  C
   \ | /
    \|/
    VB

Now clients B and C receive info from voice bridge V that the group contains members A, B and C. B realizes that it does not have a connection to C thus it calls C. As C recognizes B as a group member it automatically answers the call:

     A
    /|\
   / | \
  B--+--C
   \ | /
    \|/
    VB

Now all three group members A, B and C are connected to each other and to the voice bridge.

The ladder diagram is:

   B                  A                  C                  VB
   |                  |                  |                  |
1  | ================ | ================ |                  |
   |                  |                  |                  |
2  |                  | =====call=========================> |
3  | <---joingroup--- | ---joingroup---> |                  |
4  | =====call============================================> |
   |                  |                  | =====call======> |
5  | <--------------------------------------multi_user_info-|
   |                  | <-------------------multi_user_info-|
   |                  |                  |<-multi_user_info-|
6  | =====call=========================> |                  |
   |                  |                  |                  |
  1. Client A has already two active calls: one to client B and one to client C. Client A can hear them both but client B can't hear client C.
  2. Client A calls Voice Bridge with a hash of the group ID to establish a call group on it.
  3. Client A asks clients B and C to join the group by sending the group ID to them.
  4. Clients B and C calls Voice Bridge too with the hash of the group ID to get into the same group call.
  5. Voice Bridge sends a list of group members to all group participants.
  6. Each client checks if it has connections to all other clients in the group. Client B realizes it does not have a connection to client C thus it makes a call with the group ID in the offer. Client C recognizes client B as part of the group and answers the incoming call automatically.

Now the group call has been established.

Now there are sex active calls:

As all three clients A, B and C all used the same group ID when connecting to the voice bridge it will automatically connect them into the same group. Participants in a group can request to receive audio stream from the voice bridge of other group members.

Audio fallback

By default, if everything works OK, the voice bridge do not transmit any audio to group call clients at all.

But if a connection between clients is abrupted the clients will detect it and request audio fallback from the voice bridge instead. Say for example connection between clients A and B is broken: then client A will request voice bridge to send client B's audio to it and client B will request client A's. That way though client A and B will no longer see each other they will be at least capable to hear each other.

At the same time client A will start to try to connect to client B again. As soon as that call is connected A and B can see and hear each other again, and then they will ask the voice bridge to no longer transmit the audio fallback to them.

SIP clients

As many SIP clients only support one call at a time, and certainly none of them support RTCgate's joingroup mechanism they cannot use the mesh connect described above.

When attempting to connect a SIP client to a group call the client will instead be redirected to the voice bridge that connects it to the other members of the group call.

At the beginning client A is having two calls going on: a call to wrtc client B and a call to SIP client C:

     A
    / \
   /   \
  B     C(SIP)

We can't connect client B and C together as client C only supports one call at a time. So instead we connect to voice bridge VB:

     A
    /|\
   / | \
  B  |  C
     |
     |
    VB

and ask client C to connect to it using a call transfer:

     A
    /|
   / |
  B  |  C
     | /
     |/
    VB

then we ask client B to connect to the voice bridge:

     A
    /|
   / |
  B  |  C
   \ | /
    \|/
    VB

Now client A and B can see and hear each other using their direct connection. They can also hear SIP client C through the voice bridge. SIP client C can hear both client A and B through the voice bridge. The group call will thus treat client C as a client that has permanent connection problems with other group members and constantly rely on audio fallback.

The ladder diagram is:

   B                  A                  C(SIP)             VB
   |                  |                  |                  |
1  | ================ | ================ |                  |
   |                  |                  |                  |
2  |                  | =====call=========================> |
3  | <---joingroup--- |                  |                  |
4  |                  | ----transfer---> |                  |
   |                  |                  | ====transfer===> |
5  | =====call============================================> |
6  | <--------------------------------------multi_user_info-|
   |                  | <-------------------multi_user_info-|
   |                  |                  |                  |
  1. Client A has already two active calls: one to client B and one to client C. Client A can hear them both but client B can't hear client C. Client A already knows client C is a SIP client unable to make multiple simultaneous calls, it obtained that information when that call was established.
  2. Client A calls Voice Bridge with a hash of the group ID to establish a call group on it.
  3. Client A asks client B join the group by sending the group ID to it.
  4. Client A asks SIP client C to join the group by transferring it to the Voice Bridge server. Client C will then hang up on A and call Voice Bridge instead. As the SIP address used by C contains the group ID hash the Voice Bridge will accept the call from A.
  5. Client B calls Voice Bridge with the hash of the group ID to get into the group call.
  6. Voice Bridge sends a list of group members to all group participants. According to the list clients A and B are wrtc clients and should have direct connection, client C is a SIP client that is accessed through the Voice Bridge. As we already have a direct connection between A and B nothing more is required.

In this example the group call progress is now finished. Now there are four active calls:

In more complex scenarios where there are both wrtc and SIP clients in the group the wrtc clients should connect directly with each other and SIP clients use the Voice Bridge.

Force bridge

Wrtc_kit automatically use mesh group to connect wrtc group members. This behavior is the preferred one most of the times. Advanced users might however want to force wrtc clients to use the voice bridge connection.

To force wrtc clients use the voice bridge all you need to do is convince the client initiating the group call that these clients are not wrtc but SIP.
For instance to force client B in the example above to not keep the direct connection to A but go through the voice bridge all you need to do is alter it's classification in client A from wrtc to SIP client. Eg in javascript set callobj.x.remoteWrtc=false in wrtc.onNewCallObject()

voice bridge / audio fallback

The voice bridge is basically a voice conference server that puts all clients with matching group ID hash sums connecting to it into the same conference room.

The voice bridge conference server is always active in IXNX, ready to receive group calls. It creates conference rooms dynamically: the first time a client with a new group ID hash sum connects to it a new conference room is created. Other clients with the same group ID hash sum are put in the same conference room. Once everyone has left a conference room (or no SIP clients connected to it any more, only wrtc clients) is it removed.

Audio is mixed in a special way:

By default only audio from SIP clients that are sent to wrtc clients and vice versa. In groups with wrtc clients only the audio bridge is by default silent.

If a client detects it has lost connection to another client it might request receiving its audio from the voice bridge by sending a control message to the voice bridge. After connection is regained a new control message can stop audio again. This mechanism is called the audio fallback.

Add member to group

You can add new members to an existing group. Any of the group members can add new members to the group. The client adding the new member already have a connected call to the new member.

The call setup is very similar to normal group call setup. A joingroup is sent out to the new member asking it to connect to the voice bridge using the group ID. Alternatively, if the new member is a SIP client a transfer command is sent to it making it connect to the voice bridge, as described above.

Add-to-group

As an alternative to already having a connected call the client inviting a new member to the group can use the group feature of the Call() function of wrtc_kit.

Then first a normal call is made to the new member, but as soon as the call has been connected and media starts to flow the new client is added as a new member to the group as described above.

See:

An alternative method is to send a special group call link to the user you want to join the group.

A group call link may look like:

https://webclient.com/?call=conf_groupcall@webclient.com;gc_gid=656982117;gid=AkvVWhVW1XJ4zeIjfoOH

There:

There are checksums to make sure users can't fake group call links.

The user clicks on the group call link that loads the web client and makes it call the voice bridge. The voice bridge sends then the list of participants in the group call. The web client connects then to the group call as described above.