-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add simple webhook * add hook event for track * add docs for third party hook * fix lint and typos * add uuid for each hook event * add worker and storage for hook * update doc * fix clippy and typos error * refactor worker and added room events * feat: room last_peer_leaved and destroy event * fix missing connector storage tick * feat: record event * fix clippy * fix record upload failed --------- Co-authored-by: Giang Minh <[email protected]>
- Loading branch information
1 parent
220067c
commit 1843b2a
Showing
30 changed files
with
1,356 additions
and
286 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Third party system hook | ||
|
||
A third-party system hook is a provider that sends internal events from the media server to other systems. The events sent through the hook contain session, peer, and track. | ||
|
||
## Usage | ||
|
||
The `connector` node sends the hook. So, to enable the hook to provide, you need to use `--hook-uri` to pass the provider's URI when starting the node. | ||
|
||
```bash | ||
RUST_LOG=info \ | ||
RUST_BACKTRACE=1 \ | ||
cargo run -- \ | ||
--sdn-zone-id 0 \ | ||
--sdn-zone-node-id 4 \ | ||
--seeds 1@/ip4/127.0.0.1/udp/10001 \ | ||
connector \ | ||
--hook-uri "http://localhost:30798/webhook" | ||
``` | ||
|
||
## Message format | ||
|
||
Message will sent to another system by using JSON (serde and serde_json) or Binary format which is generated from Protobuf, defined by HookEvent message: | ||
|
||
```protobuf | ||
message HookEvent { | ||
uint32 node = 1; | ||
uint64 ts = 2; | ||
oneof event { | ||
RoomEvent room = 3; | ||
PeerEvent peer = 4; | ||
RecordEvent record = 5; | ||
} | ||
} | ||
``` | ||
|
||
Example with Json: | ||
|
||
```json | ||
{ | ||
"node":1, | ||
"ts":1724605969302, | ||
"event":{ | ||
"Peer":{ | ||
"session_id":3005239549225289700, | ||
"event":{ | ||
"RouteBegin":{ | ||
"remote_ip":"127.0.0.1" | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
|
||
## Supported Provider | ||
|
||
| provider | status | description | | ||
| -------- | -------------------- | ------------------------------------------------------- | | ||
| webhook | :white_check_mark: | Will send each event using Restful API with POST method | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.