Skip to content

Commit

Permalink
docs: add rtp-engine
Browse files Browse the repository at this point in the history
  • Loading branch information
giangndm committed Dec 8, 2024
1 parent 5e38365 commit 40c8637
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 350 deletions.
8 changes: 5 additions & 3 deletions docs/contributor-guide/transports/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
We have some types of transports:

- [WebRTC](./webrtc.md)
- [SIP](./sip.md)
- [RTMP](./rtmp.md)
- [RTP-Engine](./rtp-engine.md)
- [Whip-Whep](./whip-whep.md)

Bellow transport will be implemented in next version:

- [RTMP](./rtmp.md)
- [Media over Quic](https://quic.video/)
- [SRT](https://www.haivision.com/products/srt-secure-reliable-transport/)
- [HLS](https://en.wikipedia.org/wiki/HTTP_Live_Streaming)

If you don't find the transport you need, you can implement it by yourself by implementing the `Transport` traits. Please refer to [Architecture](../architecture.md) for more info.
If you don't find the transport you need, you can implement it by yourself by
implementing the `Transport` traits. Please refer to
[Architecture](../architecture.md) for more info.
10 changes: 0 additions & 10 deletions docs/contributor-guide/transports/rtmp.md

This file was deleted.

3 changes: 3 additions & 0 deletions docs/contributor-guide/transports/rtp-engine.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# RTP Engine

RTP Engine is implemented in 'packages/transport_rtpengine/'
265 changes: 0 additions & 265 deletions docs/contributor-guide/transports/sip.md

This file was deleted.

19 changes: 0 additions & 19 deletions docs/getting-started/quick-start/rtmp.md
Original file line number Diff line number Diff line change
@@ -1,20 +1 @@
# RTMP

You can use RTMP to publish to our media server. Currently, we don't support transcoding, so you need to publish with the same resolution and codec that correspond to your viewers.

Preferred codecs:

- Video: H264, baseline profile, bitrate 2500kbps
- Audio: AAC, bitrate 128kbps

URL: `rtmp://{gateway}/live/{token}`

Demo configuration for OBS:

![Config OBS](../../imgs/demo-rtmp-config.png)

Pregenerated token for default secret and room `demo`, peer `publisher`:

```jwt
eyJhbGciOiJIUzI1NiJ9.eyJyb29tIjoiZGVtbyIsInBlZXIiOiJydG1wIiwicHJvdG9jb2wiOiJSdG1wIiwicHVibGlzaCI6dHJ1ZSwic3Vic2NyaWJlIjpmYWxzZSwidHMiOjE3MDM3NTIzMzU2OTV9.Gj0uCxPwqsFfMFLX8Cufrsyhtb7vedNp3GeUtKQCk3s
```
68 changes: 68 additions & 0 deletions docs/getting-started/quick-start/rtp-engine.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# RTP Engine

The atm0s-media-server supports RTP transport for integration with external
applications such as SIP Gateways. We have also developed a simple SIP Gateway
that supports basic call flows, including outgoing and incoming calls:
[atm0s-sip-gateway](https://github.com/8xFF/atm0s-media-sip-gateway).

## Integration Guide

Our RTP media endpoint and HTTP APIs enable integration with external SIP
Gateways. The integration process involves three main steps:

1. Creating an RTP token
2. Creating an SDP Offer for outgoing calls or an SDP Answer for incoming calls
3. Deleting the RTP media endpoint after the call ends

For more detailed API documentation, please visit:

`http://gateway/token/ui` and `http://gateway/rtpengine/ui`

### RTPEngine APIs

The RTPEngine APIs provide endpoints to manage RTP media endpoints for SIP
integration. All endpoints are prefixed with `/rtpengine/`.

#### Authentication

Most endpoints require Bearer token authentication. Include your token in the
Authorization header:

```
Authorization: Bearer <your-token>
```

#### Endpoints

##### Create Offer

- **POST** `/rtpengine/offer`
- **Summary**: Creates an RTPEngine endpoint with an offer
- **Security**: Bearer token required
- **Response**:
- Status: 200
- Content-Type: application/sdp
- Schema: SDP string

##### Create Answer

- **POST** `/rtpengine/answer`
- **Summary**: Creates an RTPEngine endpoint with an answer
- **Security**: Bearer token required
- **Request Body**:
- Content-Type: application/sdp
- Required: true
- Schema: SDP string
- **Response**:
- Status: 200
- Content-Type: application/sdp
- Schema: SDP string

##### Delete Connection

- **DELETE** `/rtpengine/conn/{conn_id}`
- **Summary**: Deletes an RTPEngine connection
- **Response**:
- Status: 200
- Content-Type: text/plain; charset=utf-8
- Schema: string
Loading

0 comments on commit 40c8637

Please sign in to comment.