diff --git a/.env.example b/.env.example index 28515ce..53f16e6 100644 --- a/.env.example +++ b/.env.example @@ -36,3 +36,7 @@ MONGODB_PORT_NUMBER=27017 # Nats NATS_PORT_NUMBER=4222 NATS_BIND_IP=127.0.0.1 + +# SIP +VOIP_DOMAIN=valid.voip.domain.com +FREESWITCH_PASSWORD=admin_1234 diff --git a/README.md b/README.md index a314fc7..d06f155 100644 --- a/README.md +++ b/README.md @@ -136,4 +136,16 @@ When running multiple Rocket.Chat servers, you can configure Traefik to discover ```env ROCKETCHAT_BACKEND_SERVERS=rocketchat-1:3000,rocketchat-2:3000,rocketchat-3:3000 ``` - +### VoIP setup +There is a quick way for rolling out a VoIP solution using Drachtio and FreeSwitch as a SIP proxy. To achieve this some network configurations are required. `compose.network.yml` defines a network private network called `rc_voip_private` for VoIP servers. Currently it uses subnet 172.28.0.0/16 and assigns static IP 172.28.0.10 and 172.28.0.11. If you would want to change this network configuration, add desired value for subnet and static ip addresses in that subnet to `freeswitch` and `drachtio` service. `compose.network.yml` also configures rocketchat service to have access to default and `rc_voip_private` network. It communicates with non VoIP services on default network and VoIP services on `rc_voip_private` network. Once the desired configuration changes are made, run +```bash + docker compose \ + -f compose.monitoring.yml \ + -f compose.traefik.yml \ + -f compose.database.yml \ + -f compose.yml \ + -f compose.voip.yml \ + -f compose.network.yml \ + up -d +``` +to start the stack. Once the stack is running, do the necessary VoIP configurations using the static ips for FreeSwitch and Drachtio. diff --git a/compose.voip.yml b/compose.voip.yml new file mode 100644 index 0000000..9116840 --- /dev/null +++ b/compose.voip.yml @@ -0,0 +1,29 @@ +services: + freeswitch: + image: docker.io/rocketchat/freeswitch:latest + # build: . + restart: always + environment: + EXTERNAL_ADDRESS_FQDN: ${VOIP_DOMAIN:-} + FREESWITCH_PASSWORD: ${FREESWITCH_PASSWORD:-} + RTP_START_PORT: 20000 + RTP_END_PORT: 20046 + DEBUG_MODE: "true" + ACCEPT_EXTERNAL_CALLS: false + USE_LEGACY_ARCH: false + DRACHTIO_DOMAIN: ${VOIP_DRACHTIO_DOMAIN:-drachtio} + expose: + - 5060 + ports: + - 20000-20046:20000-20046/udp + + drachtio: + image: drachtio/drachtio-server:latest + restart: always + ports: + - "9022:9022" + - "5060:5060/udp" + volumes: + # Drachtio params are configured on this file + # You must modify it to configure a strong and unique secret string + - ./files/drachtio/drachtio.conf.xml:/etc/drachtio.conf.xml diff --git a/files/drachtio/drachtio.conf.xml b/files/drachtio/drachtio.conf.xml new file mode 100644 index 0000000..7d88ec4 --- /dev/null +++ b/files/drachtio/drachtio.conf.xml @@ -0,0 +1,200 @@ + + + + 0.0.0.0 + + + + + + + + + sip:*;transport=udp + + + + + + + + + + + + + + + + + 8192 + + + + + + +
+ sip-cli + sipcli + friendly-scanner +
+
+ sipvicious +
+
+
+ + + false + + + 127.0.0.1 + + + + + + + + + + + + + + /var/log/drachtio/drachtio.log + /var/log/drachtio/archive + 100 + 20 + true + + + + 3 + + + info + + +
\ No newline at end of file