#discord #networking #dmr #analog-bridge #usrp

bin+lib dmr-bridge-discord

Bridge a DMR network with a Discord voice channel

4 releases

0.2.0 May 10, 2023
0.1.2 Jun 6, 2022
0.1.1 Jan 30, 2022
0.1.0 Jan 30, 2022

#360 in Audio

GPL-3.0-only

35KB
454 lines

dmr-bridge-discord

License

Bridge a DMR network with a Discord voice channel.

Getting started

This script is inspired by https://github.com/jess-sys/DMRBridgeWAV/blob/master/DMRBridgeWAV.

The target server is AnalogBridge (see https://github.com/DVSwitch/Analog_Bridge).

Diagram

Build

Make sure you have Rust installed and also Opus codec library development files installed

cargo build --release
# or run it directly :
# cargo run

Install

Install binaries to /opt/dmr-bridge-discord/bin, default config to /opt/dmr-bridge-discord/.env and install systemd service to /lib/systemd/system/dmr-bridge-discord.

# Coming soon
make install
make install-config
make install-systemd

Configure

Edit the .env (the same directory or in /opt/dmr-bridge-discord) file to reflect your infrastructure :

  • BOT_TOKEN : see this link to know how to get a token
  • BOT_PREFIX : prefix to add before the bot's commands
  • TARGET_RX_ADDR : your Analog Bridge IP and port
  • LOCAL_RX_ADDR : your dmr-bridge-discord IP and port (is localhost)

Run

Systemctl service

systemctl start dmr-bridge-discord.service
# or enable it at boot:
# systemctl enable dmr-bridge-discord.service --now

Portable install

Do the following after you've built or downloaded the pre-compiled version.

Then execute the binary in the same folder or export the environment variables present in the .env file.

./dmr-bridge-discord-linux

Inside a container

You can use the docker-compose configuration file:

# coming soon - not available atm
docker-compose up

Usage

Here are the bot's commands:

  • !join : Make the bot join the channel (you need to be in a voice channel first)
  • !leave : Make the bot left the channel

The bot will join the voice channel you're in after your type !join.

Make sure you don't TX and RX at the same time, as AnalogBridge and the rest of the stack is half-duplex.

Todo

  • Discord multiple voice users at once (merge audio channels)
  • Verbosity levels
  • SMS and DTMF messages
  • Full Docker support
  • systemd services support

Bridge a DMR network with a Discord voice channel. Copyright (C) 2022 Jessy SOBREIRO

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 3.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

Dependencies

~12–20MB
~276K SLoC