
One day knock on our help for us - to make a service radio. After a long search, the client could not find a suitable solution, so he turned to
VoxImplant . We wondered what he had in mind there and whether we could implement his idea on our platform. We rarely managed to find a script that could not be done on it. In general, we talked, we all listened carefully and went to write code. The radio should have been able to connect to several channels at the same time (similarly to the frequencies in analog radio sets), and also to give an opportunity to talk to one of the connected channels + it was desirable to display the activity in the channel. Under the cut a story about how we made this service for a few hours.
Scheme of work
It is always useful to draw a diagram before starting work. As a result of this operation, we got something like this:
The logic is as follows:
1. The SDK user makes the call, the script (
WTGatekeeper ) forwards the call to the conference
2. Such a conference is created for each user and is required in order to connect the incoming sound from all channels to which the user subscribes and forward the outgoing sound to the selected channel.
3. The local conference handles the signal events join_channel, leave_channel, choose_channel, and also sends channel_activity, channel_connected, channel_disconnected events (see
WTUserConf script) towards the user.
4. Conference channels (see
WTChannelConf script) simply connect all incoming calls from local conferences
')
Total it turns out that one conference is created for each user and for each channel.
Customer functionality includes:
- channel list with corresponding controls
- the ability to subscribe to the incoming sound from the channel
- button to select the channel, where we will talk
- push-to-talk button that activates sending outgoing audio to the selected channel
To speed up the process, we created a demo application using the
Web SDK and ReactJS. The result is such an interface:
To implement the visualization of voice activity in the connected channel, we used the built-in VAD platform. For each call, you can hang up the handler of this event and transmit information about the activity to the client:
call.addEventListener(CallEvents.MicStatusChange, handleChannelAudio); call.handleMicStatus(true); function handleChannelAudio(e) {
The visualization of activity in the channel was done as follows:

Despite the fact that everything looks simple, the VoxImplant backend performs many tasks to ensure the operation of the service. It was nice that we managed to set it all up quickly without dancing with a tambourine.
Look at the result
You can independently test the resulting service and chat in one of several available channels
via this link . Use Chrome / Firefox / another browser with WebRTC support.