├── .gitignore ├── Dockerfile ├── README.md ├── Vagrantfile └── vagrant ├── coturn ├── turnserver.conf └── turnserver.service └── janus ├── config ├── janus.cfg ├── janus.plugin.audiobridge.cfg ├── janus.plugin.echotest.cfg ├── janus.plugin.recordplay.cfg ├── janus.plugin.sip.cfg ├── janus.plugin.streaming.cfg ├── janus.plugin.textroom.cfg ├── janus.plugin.videocall.cfg ├── janus.plugin.videoroom.cfg ├── janus.plugin.voicemail.cfg ├── janus.transport.http.cfg ├── janus.transport.pfunix.cfg └── janus.transport.websockets.cfg └── janus.service /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | ### OSX template 3 | *.DS_Store 4 | .AppleDouble 5 | .LSOverride 6 | 7 | # Icon must end with two \r 8 | Icon 9 | 10 | # Thumbnails 11 | ._* 12 | 13 | # Files that might appear in the root of a volume 14 | .DocumentRevisions-V100 15 | .fseventsd 16 | .Spotlight-V100 17 | .TemporaryItems 18 | .Trashes 19 | .VolumeIcon.icns 20 | .com.apple.timemachine.donotpresent 21 | 22 | # Directories potentially created on remote AFP share 23 | .AppleDB 24 | .AppleDesktop 25 | Network Trash Folder 26 | Temporary Items 27 | .apdisk 28 | ### JetBrains template 29 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm 30 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 31 | 32 | # User-specific stuff: 33 | .idea/workspace.xml 34 | .idea/tasks.xml 35 | .idea/dictionaries 36 | .idea/vcs.xml 37 | .idea/jsLibraryMappings.xml 38 | 39 | # Sensitive or high-churn files: 40 | .idea/dataSources.ids 41 | .idea/dataSources.xml 42 | .idea/dataSources.local.xml 43 | .idea/sqlDataSources.xml 44 | .idea/dynamic.xml 45 | .idea/uiDesigner.xml 46 | 47 | # Gradle: 48 | .idea/gradle.xml 49 | .idea/libraries 50 | 51 | # Mongo Explorer plugin: 52 | .idea/mongoSettings.xml 53 | 54 | ## File-based project format: 55 | *.iws 56 | 57 | ## Plugin-specific files: 58 | 59 | # IntelliJ 60 | /out/ 61 | 62 | # mpeltonen/sbt-idea plugin 63 | .idea_modules/ 64 | 65 | # JIRA plugin 66 | atlassian-ide-plugin.xml 67 | 68 | # Crashlytics plugin (for Android Studio and IntelliJ) 69 | com_crashlytics_export_strings.xml 70 | crashlytics.properties 71 | crashlytics-build.properties 72 | fabric.properties 73 | ### Vagrant template 74 | .vagrant/ 75 | webrtc.box -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:16.04 2 | RUN apt-get update -y \ 3 | && apt-get upgrade -y \ 4 | && apt-get install -y apt-utils bash wget libmicrohttpd-dev \ 5 | libjansson-dev libnice-dev libssl-dev libsofia-sip-ua-dev \ 6 | libglib2.0-dev libopus-dev libogg-dev libcurl4-openssl-dev \ 7 | pkg-config gengetopt libtool automake git cmake 8 | 9 | RUN cd ~ && \ 10 | wget https://github.com/cisco/libsrtp/archive/v2.0.0.tar.gz && \ 11 | tar xfv v2.0.0.tar.gz && \ 12 | cd libsrtp-2.0.0 && \ 13 | ./configure --prefix=/usr --enable-openssl && \ 14 | make shared_library && make install && \ 15 | cd ~ && rm -rf libsrtp-2.0.0 16 | 17 | RUN git clone https://github.com/sctplab/usrsctp && \ 18 | cd usrsctp && \ 19 | ./bootstrap && \ 20 | ./configure --prefix=/usr && make && make install && \ 21 | cd ~ && rm -rf usrsctp 22 | 23 | RUN git clone https://github.com/warmcat/libwebsockets.git && \ 24 | cd libwebsockets && \ 25 | git checkout v2.4-stable && \ 26 | mkdir build && \ 27 | cd build && \ 28 | cmake -DLWS_MAX_SMP=1 -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_C_FLAGS="-fpic" .. && \ 29 | make && make install && \ 30 | cd ~ && rm -rf libwebsockets 31 | 32 | RUN git clone https://github.com/meetecho/janus-gateway.git && \ 33 | cd janus-gateway && \ 34 | sh autogen.sh && \ 35 | ./configure --prefix=/opt/janus --disable-rabbitmq --disable-mqtt --disable-plugin-sip && \ 36 | make && \ 37 | make install && make configs && \ 38 | rm /opt/janus/etc/janus/*.cfg.sample && \ 39 | mkdir -p /opt/janus/certs && \ 40 | openssl req -x509 -sha256 -nodes -days 365 -newkey rsa:1024 -keyout /opt/janus/certs/privateKey.key -out /opt/janus/certs/certificate.crt -subj '/C=US/ST=California/L=Palo Alto/O=Mattermost/OU=WebRTC/CN=dockerhost' && \ 41 | cd ~ && rm -rf janus-gateway 42 | 43 | COPY vagrant/janus/config/*.cfg /opt/janus/etc/janus/ 44 | 45 | EXPOSE 7088 46 | EXPOSE 7089 47 | EXPOSE 8188 48 | EXPOSE 8189 49 | 50 | CMD /opt/janus/bin/janus -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Mattermost WebRTC 2 | 3 | **WebRTC was removed in Mattermost 5.6 in favor of open source plugins**. For more information, see [this forum post](https://forum.mattermost.org/t/built-in-webrtc-video-and-audio-calls-removed-in-v5-6-in-favor-of-open-source-plugins/5998). 4 | 5 | This is a repository to generate a Vagrant machine or a docker image to use the WebRTC functionality in Mattermost. 6 | 7 | The feature is currently intended as a working prototype for community development and not recommended for production. [See documentation to learn more](https://docs.mattermost.com/deployment/webrtc.html) 8 | 9 | To contribute, please see [Contribution Guidelines](https://docs.mattermost.com/developer/contribution-guide.html). 10 | 11 | To file issues, [search for existing bugs and file a GitHub issue if your bug is new](https://www.mattermost.org/filing-issues/). For connection issues, see [existing forum thread to torubleshoot](https://forum.mattermost.org/t/troubleshooting-there-was-a-problem-connecting-the-video-call-errors/2521). 12 | 13 | ## Mattermost WebRTC Vagrant machine 14 | 15 | ### Requirements 16 | - Vagrant 17 | - Virtualbox 18 | 19 | TODO: Create a functional vagrant machine 20 | 21 | ## Mattermost WebRTC Docker Preview Image 22 | 23 | This is a single-machine Docker image for previewing the Mattermost WebRTC features. 24 | 25 | ### Usage 26 | 27 | Please see [documentation for usage](https://docs.mattermost.com/deployment/webrtc.html). 28 | 29 | If you have Docker already set up, you can run this image in one line: 30 | 31 | ``` 32 | docker run --name mattermost-webrtc -p 7088:7088 -p 7089:7089 -p 8188:8188 -p 8189:8189 -d mattermost/webrtc:latest 33 | ``` 34 | 35 | ### Configuring Mattermost WebRTC 36 | 37 | In Mattermost System Console -> Integrations -> **WebRTC (Beta)** and set the following: 38 | 39 | - Enable Mattermost WebRTC: **true** 40 | - Gateway Websocket URL: **wss://dockerhost:8189** 41 | - Gateway Admin URL: **https://dockerhost:7089/admin** 42 | - Gateway Admin Secret: **janusoverlord** 43 | - Leave Blank **STUN URI**, **TURN URI**, **TURN Username** and **TURN Shared Key** unless you have [Coturn](https://github.com/coturn/coturn/wiki) configured. 44 | 45 | Because the WebRTC docker image uses a self-signed certificate you need to enable the ability to make 46 | requests from Mattermost to external services using insecure connections. 47 | 48 | In Mattermost System Console -> Security -> **Connections**: 49 | - Enable Insecure Outgoing Connections: true 50 | -------------------------------------------------------------------------------- /Vagrantfile: -------------------------------------------------------------------------------- 1 | # -*- mode: ruby -*- 2 | # vi: set ft=ruby : 3 | 4 | Vagrant.configure(2) do |config| 5 | config.vm.box = "ubuntu/xenial64" 6 | 7 | config.vm.network 'private_network', ip: '192.168.90.10' 8 | config.vm.hostname = 'webrtc.mattermost.dev' 9 | 10 | config.vm.synced_folder "./vagrant", "/vagrant_data" 11 | 12 | config.vm.provider 'virtualbox' do |v| 13 | v.memory = 2048 14 | v.cpus = 2 15 | v.name = 'Mattermost Webrtc' 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /vagrant/coturn/turnserver.conf: -------------------------------------------------------------------------------- 1 | # Coturn TURN SERVER configuration file 2 | # 3 | # Boolean values note: where boolean value is supposed to be used, 4 | # you can use '0', 'off', 'no', 'false', 'f' as 'false, 5 | # and you can use '1', 'on', 'yes', 'true', 't' as 'true' 6 | # If the value is missed, then it means 'true'. 7 | # 8 | 9 | # Listener interface device (optional, Linux only). 10 | # NOT RECOMMENDED. 11 | # 12 | #listening-device=eth0 13 | 14 | # TURN listener port for UDP and TCP (Default: 3478). 15 | # Note: actually, TLS & DTLS sessions can connect to the 16 | # "plain" TCP & UDP port(s), too - if allowed by configuration. 17 | # 18 | listening-port=3478 19 | 20 | # TURN listener port for TLS (Default: 5349). 21 | # Note: actually, "plain" TCP & UDP sessions can connect to the TLS & DTLS 22 | # port(s), too - if allowed by configuration. The TURN server 23 | # "automatically" recognizes the type of traffic. Actually, two listening 24 | # endpoints (the "plain" one and the "tls" one) are equivalent in terms of 25 | # functionality; but we keep both endpoints to satisfy the RFC 5766 specs. 26 | # For secure TCP connections, we currently support SSL version 3 and 27 | # TLS version 1.0, 1.1 and 1.2. 28 | # For secure UDP connections, we support DTLS version 1. 29 | # 30 | tls-listening-port=5349 31 | 32 | # Alternative listening port for UDP and TCP listeners; 33 | # default (or zero) value means "listening port plus one". 34 | # This is needed for RFC 5780 support 35 | # (STUN extension specs, NAT behavior discovery). The TURN Server 36 | # supports RFC 5780 only if it is started with more than one 37 | # listening IP address of the same family (IPv4 or IPv6). 38 | # RFC 5780 is supported only by UDP protocol, other protocols 39 | # are listening to that endpoint only for "symmetry". 40 | # 41 | alt-listening-port=0 42 | 43 | # Alternative listening port for TLS and DTLS protocols. 44 | # Default (or zero) value means "TLS listening port plus one". 45 | # 46 | alt-tls-listening-port=0 47 | 48 | # Listener IP address of relay server. Multiple listeners can be specified. 49 | # If no IP(s) specified in the config file or in the command line options, 50 | # then all IPv4 and IPv6 system IPs will be used for listening. 51 | # 52 | listening-ip=192.168.90.10 53 | #listening-ip=10.207.21.238 54 | #listening-ip=2607:f0d0:1002:51::4 55 | 56 | # Auxiliary STUN/TURN server listening endpoint. 57 | # Aux servers have almost full TURN and STUN functionality. 58 | # The (minor) limitations are: 59 | # 60 | # 1) Auxiliary servers do not have alternative ports and 61 | # they do not support STUN RFC 5780 functionality (CHANGE REQUEST). 62 | # 63 | # 2) Auxiliary servers also are never returning ALTERNATIVE-SERVER reply. 64 | # 65 | # Valid formats are 1.2.3.4:5555 for IPv4 and [1:2::3:4]:5555 for IPv6. 66 | # 67 | # There may be multiple aux-server options, each will be used for listening 68 | # to client requests. 69 | # 70 | #aux-server=172.17.19.110:33478 71 | #aux-server=[2607:f0d0:1002:51::4]:33478 72 | 73 | # (recommended for older Linuxes only) 74 | # Automatically balance UDP traffic over auxiliary servers (if configured). 75 | # The load balancing is using the ALTERNATE-SERVER mechanism. 76 | # The TURN client must support 300 ALTERNATE-SERVER response for this 77 | # functionality. 78 | # 79 | #udp-self-balance 80 | 81 | # Relay interface device for relay sockets (optional, Linux only). 82 | # NOT RECOMMENDED. 83 | # 84 | #relay-device=eth1 85 | 86 | # Relay address (the local IP address that will be used to relay the 87 | # packets to the peer). 88 | # Multiple relay addresses may be used. 89 | # The same IP(s) can be used as both listening IP(s) and relay IP(s). 90 | # 91 | # If no relay IP(s) specified, then the turnserver will apply the default 92 | # policy: it will decide itself which relay addresses to be used, and it 93 | # will always be using the client socket IP address as the relay IP address 94 | # of the TURN session (if the requested relay address family is the same 95 | # as the family of the client socket). 96 | # 97 | #relay-ip=172.17.19.105 98 | #relay-ip=2607:f0d0:1002:51::5 99 | 100 | # For Amazon EC2 users: 101 | # 102 | # TURN Server public/private address mapping, if the server is behind NAT. 103 | # In that situation, if a -X is used in form "-X " then that ip will be reported 104 | # as relay IP address of all allocations. This scenario works only in a simple case 105 | # when one single relay address is be used, and no RFC5780 functionality is required. 106 | # That single relay address must be mapped by NAT to the 'external' IP. 107 | # The "external-ip" value, if not empty, is returned in XOR-RELAYED-ADDRESS field. 108 | # For that 'external' IP, NAT must forward ports directly (relayed port 12345 109 | # must be always mapped to the same 'external' port 12345). 110 | # 111 | # In more complex case when more than one IP address is involved, 112 | # that option must be used several times, each entry must 113 | # have form "-X ", to map all involved addresses. 114 | # RFC5780 NAT discovery STUN functionality will work correctly, 115 | # if the addresses are mapped properly, even when the TURN server itself 116 | # is behind A NAT. 117 | # 118 | # By default, this value is empty, and no address mapping is used. 119 | # 120 | #external-ip=60.70.80.91 121 | # 122 | #OR: 123 | # 124 | #external-ip=60.70.80.91/172.17.19.101 125 | #external-ip=60.70.80.92/172.17.19.102 126 | 127 | 128 | # Number of the relay threads to handle the established connections 129 | # (in addition to authentication thread and the listener thread). 130 | # If explicitly set to 0 then application runs relay process in a 131 | # single thread, in the same thread with the listener process 132 | # (the authentication thread will still be a separate thread). 133 | # 134 | # If this parameter is not set, then the default OS-dependent 135 | # thread pattern algorithm will be employed. Usually the default 136 | # algorithm is the most optimal, so you have to change this option 137 | # only if you want to make some fine tweaks. 138 | # 139 | # In the older systems (Linux kernel before 3.9), 140 | # the number of UDP threads is always one thread per network listening 141 | # endpoint - including the auxiliary endpoints - unless 0 (zero) or 142 | # 1 (one) value is set. 143 | # 144 | #relay-threads=0 145 | 146 | # Lower and upper bounds of the UDP relay endpoints: 147 | # (default values are 49152 and 65535) 148 | # 149 | min-port=49152 150 | max-port=65535 151 | 152 | # Uncomment to run TURN server in 'normal' 'moderate' verbose mode. 153 | # By default the verbose mode is off. 154 | verbose 155 | 156 | # Uncomment to run TURN server in 'extra' verbose mode. 157 | # This mode is very annoying and produces lots of output. 158 | # Not recommended under any normal circumstances. 159 | # 160 | #Verbose 161 | 162 | # Uncomment to use fingerprints in the TURN messages. 163 | # By default the fingerprints are off. 164 | # 165 | fingerprint 166 | 167 | # Uncomment to use long-term credential mechanism. 168 | # By default no credentials mechanism is used (any user allowed). 169 | # 170 | lt-cred-mech 171 | 172 | # This option is opposite to lt-cred-mech. 173 | # (TURN Server with no-auth option allows anonymous access). 174 | # If neither option is defined, and no users are defined, 175 | # then no-auth is default. If at least one user is defined, 176 | # in this file or in command line or in usersdb file, then 177 | # lt-cred-mech is default. 178 | # 179 | #no-auth 180 | 181 | # TURN REST API flag. 182 | # Flag that sets a special authorization option that is based upon authentication secret. 183 | # This feature can be used with the long-term authentication mechanism, only. 184 | # This feature purpose is to support "TURN Server REST API", see 185 | # "TURN REST API" link in the project's page 186 | # https://github.com/coturn/coturn/ 187 | # 188 | # This option is used with timestamp: 189 | # 190 | # usercombo -> "timestamp:userid" 191 | # turn user -> usercombo 192 | # turn password -> base64(hmac(secret key, usercombo)) 193 | # 194 | # This allows TURN credentials to be accounted for a specific user id. 195 | # If you don't have a suitable id, the timestamp alone can be used. 196 | # This option is just turning on secret-based authentication. 197 | # The actual value of the secret is defined either by option static-auth-secret, 198 | # or can be found in the turn_secret table in the database (see below). 199 | # 200 | use-auth-secret 201 | 202 | # 'Static' authentication secret value (a string) for TURN REST API only. 203 | # If not set, then the turn server 204 | # will try to use the 'dynamic' value in turn_secret table 205 | # in user database (if present). The database-stored value can be changed on-the-fly 206 | # by a separate program, so this is why that other mode is 'dynamic'. 207 | # 208 | #static-auth-secret=north 209 | 210 | # Server name used for 211 | # the oAuth authentication purposes. 212 | # The default value is the realm name. 213 | # 214 | server-name=webrtc.mattermost.dev 215 | 216 | # Flag that allows oAuth authentication. 217 | # 218 | #oauth 219 | 220 | # 'Static' user accounts for long term credentials mechanism, only. 221 | # This option cannot be used with TURN REST API. 222 | # 'Static' user accounts are NOT dynamically checked by the turnserver process, 223 | # so that they can NOT be changed while the turnserver is running. 224 | # 225 | #user=username1:key1 226 | #user=username2:key2 227 | # OR: 228 | #user=username1:password1 229 | #user=username2:password2 230 | # 231 | # Keys must be generated by turnadmin utility. The key value depends 232 | # on user name, realm, and password: 233 | # 234 | # Example: 235 | # $ turnadmin -k -u ninefingers -r north.gov -p youhavetoberealistic 236 | # Output: 0xbc807ee29df3c9ffa736523fb2c4e8ee 237 | # ('0x' in the beginning of the key is what differentiates the key from 238 | # password. If it has 0x then it is a key, otherwise it is a password). 239 | # 240 | # The corresponding user account entry in the config file will be: 241 | # 242 | #user=ninefingers:0xbc807ee29df3c9ffa736523fb2c4e8ee 243 | # Or, equivalently, with open clear password (less secure): 244 | #user=ninefingers:youhavetoberealistic 245 | # 246 | 247 | # SQLite database file name. 248 | # 249 | # Default file name is /var/db/turndb or /usr/local/var/db/turndb or 250 | # /var/lib/turn/turndb. 251 | # 252 | userdb=/var/lib/turn/turndb 253 | 254 | # PostgreSQL database connection string in the case that we are using PostgreSQL 255 | # as the user database. 256 | # This database can be used for long-term credential mechanism 257 | # and it can store the secret value for secret-based timed authentication in TURN RESP API. 258 | # See http://www.postgresql.org/docs/8.4/static/libpq-connect.html for 8.x PostgreSQL 259 | # versions connection string format, see 260 | # http://www.postgresql.org/docs/9.2/static/libpq-connect.html#LIBPQ-CONNSTRING 261 | # for 9.x and newer connection string formats. 262 | # 263 | #psql-userdb="host= dbname= user= password= connect_timeout=30" 264 | 265 | # MySQL database connection string in the case that we are using MySQL 266 | # as the user database. 267 | # This database can be used for long-term credential mechanism 268 | # and it can store the secret value for secret-based timed authentication in TURN RESP API. 269 | # 270 | # Optional connection string parameters for the secure communications (SSL): 271 | # ca, capath, cert, key, cipher 272 | # (see http://dev.mysql.com/doc/refman/5.1/en/ssl-options.html for the 273 | # command options description). 274 | # 275 | # Use string format as below (space separated parameters, all optional): 276 | # 277 | #mysql-userdb="host= dbname= user= password= port= connect_timeout=" 278 | 279 | # MongoDB database connection string in the case that we are using MongoDB 280 | # as the user database. 281 | # This database can be used for long-term credential mechanism 282 | # and it can store the secret value for secret-based timed authentication in TURN RESP API. 283 | # Use string format is described at http://hergert.me/docs/mongo-c-driver/mongoc_uri.html 284 | # 285 | #mongo-userdb="mongodb://[username:password@]host1[:port1][,host2[:port2],...[,hostN[:portN]]][/[database][?options]]" 286 | 287 | # Redis database connection string in the case that we are using Redis 288 | # as the user database. 289 | # This database can be used for long-term credential mechanism 290 | # and it can store the secret value for secret-based timed authentication in TURN RESP API. 291 | # Use string format as below (space separated parameters, all optional): 292 | # 293 | #redis-userdb="ip= dbname= password= port= connect_timeout=" 294 | 295 | # Redis status and statistics database connection string, if used (default - empty, no Redis stats DB used). 296 | # This database keeps allocations status information, and it can be also used for publishing 297 | # and delivering traffic and allocation event notifications. 298 | # The connection string has the same parameters as redis-userdb connection string. 299 | # Use string format as below (space separated parameters, all optional): 300 | # 301 | #redis-statsdb="ip= dbname= password= port= connect_timeout=" 302 | 303 | # The default realm to be used for the users when no explicit 304 | # origin/realm relationship was found in the database, or if the TURN 305 | # server is not using any database (just the commands-line settings 306 | # and the userdb file). Must be used with long-term credentials 307 | # mechanism or with TURN REST API. 308 | # 309 | realm=mattermost.dev 310 | 311 | # The flag that sets the origin consistency 312 | # check: across the session, all requests must have the same 313 | # main ORIGIN attribute value (if the ORIGIN was 314 | # initially used by the session). 315 | # 316 | #check-origin-consistency 317 | 318 | # Per-user allocation quota. 319 | # default value is 0 (no quota, unlimited number of sessions per user). 320 | # This option can also be set through the database, for a particular realm. 321 | # 322 | #user-quota=0 323 | 324 | # Total allocation quota. 325 | # default value is 0 (no quota). 326 | # This option can also be set through the database, for a particular realm. 327 | # 328 | #total-quota=0 329 | 330 | # Max bytes-per-second bandwidth a TURN session is allowed to handle 331 | # (input and output network streams are treated separately). Anything above 332 | # that limit will be dropped or temporary suppressed (within 333 | # the available buffer limits). 334 | # This option can also be set through the database, for a particular realm. 335 | # 336 | #max-bps=0 337 | 338 | # 339 | # Maximum server capacity. 340 | # Total bytes-per-second bandwidth the TURN server is allowed to allocate 341 | # for the sessions, combined (input and output network streams are treated separately). 342 | # 343 | # bps-capacity=0 344 | 345 | # Uncomment if no UDP client listener is desired. 346 | # By default UDP client listener is always started. 347 | # 348 | #no-udp 349 | 350 | # Uncomment if no TCP client listener is desired. 351 | # By default TCP client listener is always started. 352 | # 353 | #no-tcp 354 | 355 | # Uncomment if no TLS client listener is desired. 356 | # By default TLS client listener is always started. 357 | # 358 | #no-tls 359 | 360 | # Uncomment if no DTLS client listener is desired. 361 | # By default DTLS client listener is always started. 362 | # 363 | #no-dtls 364 | 365 | # Uncomment if no UDP relay endpoints are allowed. 366 | # By default UDP relay endpoints are enabled (like in RFC 5766). 367 | # 368 | #no-udp-relay 369 | 370 | # Uncomment if no TCP relay endpoints are allowed. 371 | # By default TCP relay endpoints are enabled (like in RFC 6062). 372 | # 373 | #no-tcp-relay 374 | 375 | # Uncomment if extra security is desired, 376 | # with nonce value having limited lifetime (600 secs). 377 | # By default, the nonce value is unique for a session, 378 | # but it has unlimited lifetime. With this option, 379 | # the nonce lifetime is limited to 600 seconds, after that 380 | # the client will get 438 error and will have to re-authenticate itself. 381 | # 382 | #stale-nonce 383 | 384 | # Certificate file. 385 | # Use an absolute path or path relative to the 386 | # configuration file. 387 | # 388 | cert=/opt/janus/certs/certificate.crt 389 | 390 | # Private key file. 391 | # Use an absolute path or path relative to the 392 | # configuration file. 393 | # Use PEM file format. 394 | # 395 | pkey=/opt/janus/certs/privateKey.key 396 | 397 | # Private key file password, if it is in encoded format. 398 | # This option has no default value. 399 | # 400 | #pkey-pwd=... 401 | 402 | # Allowed OpenSSL cipher list for TLS/DTLS connections. 403 | # Default value is "DEFAULT". 404 | # 405 | #cipher-list="DEFAULT" 406 | 407 | # CA file in OpenSSL format. 408 | # Forces TURN server to verify the client SSL certificates. 409 | # By default it is not set: there is no default value and the client 410 | # certificate is not checked. 411 | # 412 | # Example: 413 | #CA-file=/etc/ssh/id_rsa.cert 414 | 415 | # Curve name for EC ciphers, if supported by OpenSSL 416 | # library (TLS and DTLS). The default value is prime256v1, 417 | # if pre-OpenSSL 1.0.2 is used. With OpenSSL 1.0.2+, 418 | # an optimal curve will be automatically calculated, if not defined 419 | # by this option. 420 | # 421 | #ec-curve-name=prime256v1 422 | 423 | # Use 566 bits predefined DH TLS key. Default size of the key is 1066. 424 | # 425 | #dh566 426 | 427 | # Use 2066 bits predefined DH TLS key. Default size of the key is 1066. 428 | # 429 | #dh2066 430 | 431 | # Use custom DH TLS key, stored in PEM format in the file. 432 | # Flags --dh566 and --dh2066 are ignored when the DH key is taken from a file. 433 | # 434 | #dh-file= 435 | 436 | # Flag to prevent stdout log messages. 437 | # By default, all log messages are going to both stdout and to 438 | # the configured log file. With this option everything will be 439 | # going to the configured log only (unless the log file itself is stdout). 440 | # 441 | #no-stdout-log 442 | 443 | # Option to set the log file name. 444 | # By default, the turnserver tries to open a log file in 445 | # /var/log, /var/tmp, /tmp and current directories directories 446 | # (which open operation succeeds first that file will be used). 447 | # With this option you can set the definite log file name. 448 | # The special names are "stdout" and "-" - they will force everything 449 | # to the stdout. Also, the "syslog" name will force everything to 450 | # the system log (syslog). 451 | # In the runtime, the logfile can be reset with the SIGHUP signal 452 | # to the turnserver process. 453 | # 454 | log-file=/var/tmp/turn.log 455 | 456 | # Option to redirect all log output into system log (syslog). 457 | # 458 | #syslog 459 | 460 | # This flag means that no log file rollover will be used, and the log file 461 | # name will be constructed as-is, without PID and date appendage. 462 | # This option can be used, for example, together with the logrotate tool. 463 | # 464 | #simple-log 465 | 466 | # Option to set the "redirection" mode. The value of this option 467 | # will be the address of the alternate server for UDP & TCP service in form of 468 | # [:]. The server will send this value in the attribute 469 | # ALTERNATE-SERVER, with error 300, on ALLOCATE request, to the client. 470 | # Client will receive only values with the same address family 471 | # as the client network endpoint address family. 472 | # See RFC 5389 and RFC 5766 for ALTERNATE-SERVER functionality description. 473 | # The client must use the obtained value for subsequent TURN communications. 474 | # If more than one --alternate-server options are provided, then the functionality 475 | # can be more accurately described as "load-balancing" than a mere "redirection". 476 | # If the port number is omitted, then the default port 477 | # number 3478 for the UDP/TCP protocols will be used. 478 | # Colon (:) characters in IPv6 addresses may conflict with the syntax of 479 | # the option. To alleviate this conflict, literal IPv6 addresses are enclosed 480 | # in square brackets in such resource identifiers, for example: 481 | # [2001:db8:85a3:8d3:1319:8a2e:370:7348]:3478 . 482 | # Multiple alternate servers can be set. They will be used in the 483 | # round-robin manner. All servers in the pool are considered of equal weight and 484 | # the load will be distributed equally. For example, if we have 4 alternate servers, 485 | # then each server will receive 25% of ALLOCATE requests. A alternate TURN server 486 | # address can be used more than one time with the alternate-server option, so this 487 | # can emulate "weighting" of the servers. 488 | # 489 | # Examples: 490 | #alternate-server=1.2.3.4:5678 491 | #alternate-server=11.22.33.44:56789 492 | #alternate-server=5.6.7.8 493 | #alternate-server=[2001:db8:85a3:8d3:1319:8a2e:370:7348]:3478 494 | 495 | # Option to set alternative server for TLS & DTLS services in form of 496 | # :. If the port number is omitted, then the default port 497 | # number 5349 for the TLS/DTLS protocols will be used. See the previous 498 | # option for the functionality description. 499 | # 500 | # Examples: 501 | #tls-alternate-server=1.2.3.4:5678 502 | #tls-alternate-server=11.22.33.44:56789 503 | #tls-alternate-server=[2001:db8:85a3:8d3:1319:8a2e:370:7348]:3478 504 | 505 | # Option to suppress TURN functionality, only STUN requests will be processed. 506 | # Run as STUN server only, all TURN requests will be ignored. 507 | # By default, this option is NOT set. 508 | # 509 | #stun-only 510 | 511 | # Option to suppress STUN functionality, only TURN requests will be processed. 512 | # Run as TURN server only, all STUN requests will be ignored. 513 | # By default, this option is NOT set. 514 | # 515 | #no-stun 516 | 517 | # This is the timestamp/username separator symbol (character) in TURN REST API. 518 | # The default value is ':'. 519 | # rest-api-separator=: 520 | 521 | # Flag that can be used to disallow peers on the loopback addresses (127.x.x.x and ::1). 522 | # This is an extra security measure. 523 | # 524 | #no-loopback-peers 525 | 526 | # Flag that can be used to disallow peers on well-known broadcast addresses (224.0.0.0 and above, and FFXX:*). 527 | # This is an extra security measure. 528 | # 529 | #no-multicast-peers 530 | 531 | # Option to set the max time, in seconds, allowed for full allocation establishment. 532 | # Default is 60 seconds. 533 | # 534 | #max-allocate-timeout=60 535 | 536 | # Option to allow or ban specific ip addresses or ranges of ip addresses. 537 | # If an ip address is specified as both allowed and denied, then the ip address is 538 | # considered to be allowed. This is useful when you wish to ban a range of ip 539 | # addresses, except for a few specific ips within that range. 540 | # 541 | # This can be used when you do not want users of the turn server to be able to access 542 | # machines reachable by the turn server, but would otherwise be unreachable from the 543 | # internet (e.g. when the turn server is sitting behind a NAT) 544 | # 545 | # Examples: 546 | # denied-peer-ip=83.166.64.0-83.166.95.255 547 | # allowed-peer-ip=83.166.68.45 548 | 549 | # File name to store the pid of the process. 550 | # Default is /var/run/turnserver.pid (if superuser account is used) or 551 | # /var/tmp/turnserver.pid . 552 | # 553 | pidfile="/var/tmp/turnserver.pid" 554 | 555 | # Require authentication of the STUN Binding request. 556 | # By default, the clients are allowed anonymous access to the STUN Binding functionality. 557 | # 558 | #secure-stun 559 | 560 | # Mobility with ICE (MICE) specs support. 561 | # 562 | #mobility 563 | 564 | # User name to run the process. After the initialization, the turnserver process 565 | # will make an attempt to change the current user ID to that user. 566 | # 567 | #proc-user= 568 | 569 | # Group name to run the process. After the initialization, the turnserver process 570 | # will make an attempt to change the current group ID to that group. 571 | # 572 | #proc-group= 573 | 574 | # Turn OFF the CLI support. 575 | # By default it is always ON. 576 | # See also options cli-ip and cli-port. 577 | # 578 | #no-cli 579 | 580 | #Local system IP address to be used for CLI server endpoint. Default value 581 | # is 127.0.0.1. 582 | # 583 | #cli-ip=127.0.0.1 584 | 585 | # CLI server port. Default is 5766. 586 | # 587 | #cli-port=5766 588 | 589 | # CLI access password. Default is empty (no password). 590 | # For the security reasons, it is recommended to use the encrypted 591 | # for of the password (see the -P command in the turnadmin utility). 592 | # 593 | # Secure form for password 'qwerty': 594 | # 595 | #cli-password=$5$79a316b350311570$81df9cfb9af7f5e5a76eada31e7097b663a0670f99a3c07ded3f1c8e59c5658a 596 | # 597 | # Or unsecure form for the same paassword: 598 | # 599 | #cli-password=qwerty 600 | 601 | # Server relay. NON-STANDARD AND DANGEROUS OPTION. 602 | # Only for those applications when we want to run 603 | # server applications on the relay endpoints. 604 | # This option eliminates the IP permissions check on 605 | # the packets incoming to the relay endpoints. 606 | # 607 | #server-relay 608 | 609 | # Maximum number of output sessions in ps CLI command. 610 | # This value can be changed on-the-fly in CLI. The default value is 256. 611 | # 612 | #cli-max-output-sessions 613 | 614 | # Set network engine type for the process (for internal purposes). 615 | # 616 | #ne=[1|2|3] 617 | 618 | # Do not allow an TLS/DTLS version of protocol 619 | # 620 | #no-tlsv1 621 | #no-tlsv1_1 622 | #no-tlsv1_2 623 | -------------------------------------------------------------------------------- /vagrant/coturn/turnserver.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Coturn Server 3 | After=network.target 4 | 5 | [Service] 6 | Type=simple 7 | User=ubuntu 8 | ExecStart=/usr/bin/turnserver -c /etc/turnserver.conf -v 9 | Restart=on-abnormal 10 | LimitNOFILE=65536 11 | 12 | [Install] 13 | WantedBy=multi-user.target 14 | -------------------------------------------------------------------------------- /vagrant/janus/config/janus.cfg: -------------------------------------------------------------------------------- 1 | ; General configuration: folders where the configuration and the plugins 2 | ; can be found, how output should be logged, whether Janus should run as 3 | ; a daemon or in foreground, default interface to use, debug/logging level 4 | ; and, if needed, shared apisecret and/or token authentication mechanism 5 | ; between application(s) and Janus. 6 | [general] 7 | configs_folder = /opt/janus/etc/janus ; Configuration files folder 8 | plugins_folder = /opt/janus/lib/janus/plugins ; Plugins folder 9 | transports_folder = /opt/janus/lib/janus/transports ; Transports folder 10 | ;log_to_stdout = false ; Whether the Janus output should be written 11 | ; to stdout or not (default=true) 12 | log_to_file = /var/log/janus.log ; Whether to use a log file or not 13 | :daemonize = true ; Whether Janus should run as a daemon 14 | ; or not (default=run in foreground) 15 | pid_file = /var/run/janus.pid ; PID file to create when Janus has been 16 | ; started, and to destroy at shutdown 17 | ;interface = 1.2.3.4 ; Interface to use (will be used in SDP) 18 | debug_level = 4 ; Debug/logging level, valid values are 0-7 19 | ;debug_timestamps = yes ; Whether to show a timestamp for each log line 20 | ;debug_colors = no ; Whether colors should be disabled in the log 21 | ;api_secret = mattermost ; String that all Janus requests must contain 22 | ; to be accepted/authorized by the Janus core. 23 | ; Useful if you're wrapping all Janus API requests 24 | ; in your servers (that is, not in the browser, 25 | ; where you do the things your way) and you 26 | ; don't want other application to mess with 27 | ; this Janus instance. 28 | token_auth = yes ; Enable a token based authentication 29 | ; mechanism to force users to always provide 30 | ; a valid token in all requests. Useful if 31 | ; you want to authenticate requests from web 32 | ; users. For this to work, the Admin API MUST 33 | ; be enabled, as tokens are added and removed 34 | ; through messages sent there. 35 | admin_secret = janusoverlord ; String that all Janus requests must contain 36 | ; to be accepted/authorized by the admin/monitor. 37 | ; only needed if you enabled the admin API 38 | ; in any of the available transports. 39 | server_name = MattermostWebRTC ; Public name of this Janus instance 40 | ; as it will appear in an info request 41 | 42 | 43 | ; Certificate and key to use for DTLS. 44 | [certificates] 45 | cert_pem = /opt/janus/certs/certificate.crt 46 | cert_key = /opt/janus/certs/privateKey.key 47 | 48 | 49 | ; Media-related stuff: you can configure whether if you want 50 | ; to enable IPv6 support (still WIP, so handle with care), the maximum size 51 | ; of the NACK queue (in milliseconds, defaults to 1000ms=1s) for retransmissions, the 52 | ; range of ports to use for RTP and RTCP (by default, no range is envisaged), the 53 | ; starting MTU for DTLS (1472 by default, it adapts automatically), 54 | ; if BUNDLE should be forced (defaults to false) and if RTCP muxing should 55 | ; be forced (defaults to false). 56 | [media] 57 | ;ipv6 = true 58 | ;max_nack_queue = 1000 59 | ;rtp_port_range = 20000-40000 60 | ;dtls_mtu = 1200 61 | ;force-bundle = true 62 | ;force-rtcp-mux = true 63 | 64 | 65 | ; NAT-related stuff: specifically, you can configure the STUN/TURN 66 | ; servers to use to gather candidates if the gateway is behind a NAT, 67 | ; and srflx/relay candidates are needed. In case STUN is not enough and 68 | ; this is needed (it shouldn't), you can also configure Janus to use a 69 | ; TURN server; please notice that this does NOT refer to TURN usage in 70 | ; browsers, but in the gathering of relay candidates by Janus itself, 71 | ; e.g., if you want to limit the ports used by a Janus instance on a 72 | ; private machine. Furthermore, you can choose whether Janus should be 73 | ; configured to work in ICE-Lite mode (by default it doesn't). Finally, 74 | ; you can also enable ICE-TCP support (beware that it currently *only* 75 | ; works if you enable ICE Lite as well), choose which interfaces should 76 | ; be used for gathering candidates, and enable or disable the 77 | ; internal libnice debugging, if needed. 78 | [nat] 79 | stun_server = stun.l.google.com 80 | stun_port = 19302 81 | ;nice_debug = false 82 | ;ice_lite = true 83 | ;ice_tcp = true 84 | 85 | ; In case you're deploying Janus on a server which is configured with 86 | ; a 1:1 NAT (e.g., Amazon EC2), you might want to also specify the public 87 | ; address of the machine using the setting below. This will result in 88 | ; all host candidates (which normally have a private IP address) to 89 | ; be rewritten with the public address provided in the settings. As 90 | ; such, use the option with caution and only if you know what you're doing. 91 | ; Besides, it's still recommended to also enable STUN in those cases, 92 | ; and keep ICE Lite disabled as it's not strictly speaking a public server. 93 | ;nat_1_1_mapping = 1.2.3.4 94 | 95 | ; You can configure a TURN server in two different ways: specifying a 96 | ; statically configured TURN server, and thus provide the address of the 97 | ; TURN server, the transport (udp/tcp/tls) to use, and a set of valid 98 | ; credentials to authenticate... 99 | ;turn_server = myturnserver.com 100 | ;turn_port = 3478 101 | ;turn_type = udp 102 | ;turn_user = myuser 103 | ;turn_pwd = mypassword 104 | 105 | ; ... or you can make use of the TURN REST API to get info on one or more 106 | ; TURN services dynamically. This makes use of the proposed standard of 107 | ; such an API (https://tools.ietf.org/html/draft-uberti-behave-turn-rest-00) 108 | ; which is currently available in both rfc5766-turn-server and coturn. 109 | ; You enable this by specifying the address of your TURN REST API backend, 110 | ; the HTTP method to use (GET or POST) and, if required, the API key Janus 111 | ; must provide. 112 | ;turn_rest_api = http://yourbackend.com/path/to/api 113 | ;turn_rest_api_key = anyapikeyyoumayhaveset 114 | ;turn_rest_api_method = GET 115 | 116 | ; You can also choose which interfaces should be explicitly used by the 117 | ; gateway for the purpose of ICE candidates gathering, thus excluding 118 | ; others that may be available. To do so, use the 'ice_enforce_list' 119 | ; setting and pass it a comma-separated list of interfaces or IP addresses 120 | ; to enforce. This is especially useful if the server hosting the gateway 121 | ; has several interfaces, and you only want a subset to be used. Any of 122 | ; the following examples are valid: 123 | ; ice_enforce_list = eth0 124 | ; ice_enforce_list = eth0,eth1 125 | ; ice_enforce_list = eth0,192.168. 126 | ; ice_enforce_list = eth0,192.168.0.1 127 | ; By default, no interface is enforced, meaning Janus will try to use them all. 128 | ;ice_enforce_list = eth0 129 | 130 | ; In case you don't want to specify specific interfaces to use, but would 131 | ; rather tell Janus to use all the available interfaces except some that 132 | ; you don't want to involve, you can also choose which interfaces or IP 133 | ; addresses should be excluded and ignored by the gateway for the purpose 134 | ; of ICE candidates gathering. To do so, use the 'ice_ignore_list' setting 135 | ; and pass it a comma-separated list of interfaces or IP addresses to 136 | ; ignore. This is especially useful if the server hosting the gateway 137 | ; has several interfaces you already know will not be used or will simply 138 | ; always slow down ICE (e.g., virtual interfaces created by VMware). 139 | ; Partial strings are supported, which means that any of the following 140 | ; examples are valid: 141 | ; ice_ignore_list = vmnet8,192.168.0.1,10.0.0.1 142 | ; ice_ignore_list = vmnet,192.168. 143 | ; Just beware that the ICE ignore list is not used if an enforce list 144 | ; has been configured. By default, Janus ignores all interfaces whose 145 | ; name starts with 'vmnet', to skip VMware interfaces: 146 | ice_ignore_list = vmnet 147 | 148 | ; You can choose which of the available plugins should be 149 | ; enabled or not. Use the 'disable' directive to prevent Janus from 150 | ; loading one or more plugins: use a comma separated list of plugin file 151 | ; names to identify the plugins to disable. By default all available 152 | ; plugins are enabled and loaded at startup. 153 | [plugins] 154 | ; disable = libjanus_voicemail.so,libjanus_recordplay.so 155 | 156 | ; You can choose which of the available transports should be enabled or 157 | ; not. Use the 'disable' directive to prevent Janus from loading one 158 | ; or more transport: use a comma separated list of transport file names 159 | ; to identify the transports to disable. By default all available 160 | ; transports are enabled and loaded at startup. 161 | [transports] 162 | ; disable = libjanus_rabbitmq.so 163 | 164 | ; Event handlers allow you to receive live events from Janus happening 165 | ; in core and/or plugins. Since this can require some more resources, 166 | ; the feature is disabled by default. Setting broadcast to yes will 167 | ; enable them. You can then choose which of the available event handlers 168 | ; should be loaded or not. Use the 'disable' directive to prevent Janus 169 | ; from loading one or more event handlers: use a comma separated list of 170 | ; file names to identify the event handlers to disable. By default, if 171 | ; broadcast is set to yes all available event handlers are enabled and 172 | ; loaded at startup. 173 | [events] 174 | ; broadcast = yes 175 | ; disable = libjanus_sampleevh.so 176 | -------------------------------------------------------------------------------- /vagrant/janus/config/janus.plugin.audiobridge.cfg: -------------------------------------------------------------------------------- 1 | ; [] 2 | ; description = This is my awesome room 3 | ; is_private = yes|no (whether this room should be in the public list, default=yes) 4 | ; secret = 5 | ; pin = 6 | ; sampling_rate = (e.g., 16000 for wideband mixing) 7 | ; audiolevel_ext = yes|no (whether the ssrc-audio-level RTP extension must 8 | ; be negotiated/used or not for new joins, default=yes) 9 | ; record = true|false (whether this room should be recorded, default=false) 10 | ; record_file = /path/to/recording.wav (where to save the recording) 11 | 12 | [general] 13 | ;admin_key = supersecret ; If set, rooms can be created via API only 14 | ; if this key is provided in the request 15 | ;events = no ; Whether events should be sent to event 16 | ; handlers (default is yes) 17 | 18 | [1234] 19 | description = Demo Room 20 | secret = adminpwd 21 | sampling_rate = 16000 22 | record = false 23 | ;record_file = /tmp/janus-audioroom-1234.wav 24 | -------------------------------------------------------------------------------- /vagrant/janus/config/janus.plugin.echotest.cfg: -------------------------------------------------------------------------------- 1 | ; events = yes|no, whether events should be sent to event handlers 2 | 3 | [general] 4 | ;events = no 5 | -------------------------------------------------------------------------------- /vagrant/janus/config/janus.plugin.recordplay.cfg: -------------------------------------------------------------------------------- 1 | ; path = where to place recordings in the file system 2 | ; events = yes|no, whether events should be sent to event handlers 3 | 4 | [general] 5 | path = /opt/janus/share/janus/recordings 6 | ;events = no 7 | -------------------------------------------------------------------------------- /vagrant/janus/config/janus.plugin.sip.cfg: -------------------------------------------------------------------------------- 1 | [general] 2 | ; Specify which local IP address to use. If not set it will be automatically 3 | ; guessed from the system 4 | ;local_ip = 1.2.3.4 5 | 6 | ; Enable local keep-alives to keep the registration open. Keep-alives are 7 | ; sent in the form of OPTIONS requests, at the given interval inseconds. 8 | ; (0 to disable) 9 | keepalive_interval = 120 10 | 11 | ; Indicate if the server is behind NAT. If so, the server will use STUN 12 | ; to guess its own public IP address and use it in the Contact header of 13 | ; outgoing requests 14 | behind_nat = no 15 | 16 | ; User-Agent string to be used 17 | ; user_agent = Cool WebRTC Gateway 18 | ; Expiration time for registrations 19 | register_ttl = 3600 20 | 21 | ; Whether events should be sent to event handlers (default is yes) 22 | ;events = no 23 | -------------------------------------------------------------------------------- /vagrant/janus/config/janus.plugin.streaming.cfg: -------------------------------------------------------------------------------- 1 | ; [stream-name] 2 | ; type = rtp|live|ondemand|rtsp 3 | ; rtp = stream originated by an external tool (e.g., gstreamer or 4 | ; ffmpeg) and sent to the plugin via RTP 5 | ; live = local file streamed live to multiple listeners 6 | ; (multiple listeners = same streaming context) 7 | ; ondemand = local file streamed on-demand to a single listener 8 | ; (multiple listeners = different streaming contexts) 9 | ; rtsp = stream originated by an external RTSP feed (only 10 | ; available if libcurl support was compiled) 11 | ; id = (if missing, a random one will be generated) 12 | ; description = This is my awesome stream 13 | ; is_private = yes|no (private streams don't appear when you do a 'list' 14 | ; request) 15 | ; secret = 17 | ; pin = 18 | ; filename = path to the local file to stream (only for live/ondemand) 19 | ; audio = yes|no (do/don't stream audio) 20 | ; video = yes|no (do/don't stream video) 21 | ; The following options are only valid for the 'rtp' type: 22 | ; audioport = local port for receiving audio frames 23 | ; audiomcast = multicast group port for receiving audio frames, if any 24 | ; audiopt =