Browse Source

MT#55283 Add documentation for MySQL database schema

closes #1967

Change-Id: I0e839ce0dd6c2e13f6f35d1ec006d1c1e904b40e
rfuchs/1971
Aki Huolman 5 months ago
committed by Richard Fuchs
parent
commit
2abda66667
1 changed files with 48 additions and 0 deletions
  1. +48
    -0
      docs/rtpengine-recording.md

+ 48
- 0
docs/rtpengine-recording.md View File

@ -310,6 +310,8 @@ sufficient for a standard installation of rtpengine.
Configuration for a MySQL storage backend. Details about calls and media files
that are produced are stored into the database. Optionally the media files
themselves can be stored as well (see __output-storage__).
For MySQL database schema, see [Database schema](#database-schema)
- __\-\-forward-to=__*PATH*
@ -402,6 +404,52 @@ sufficient for a standard installation of rtpengine.
Configuration file.
## DATABASE SCHEMA
Saving recording into MySQL database requires correct database schema:
```
CREATE TABLE `recording_calls` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`call_id` varchar(250) NOT NULL,
`start_timestamp` decimal(13,3) DEFAULT NULL,
`end_timestamp` decimal(13,3) DEFAULT NULL,
`status` enum('recording','completed','confirmed') DEFAULT 'recording',
PRIMARY KEY (`id`),
KEY `call_id` (`call_id`)
);
CREATE TABLE `recording_streams` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`call` int(10) unsigned NOT NULL,
`local_filename` varchar(250) NOT NULL,
`full_filename` varchar(250) NOT NULL,
`file_format` varchar(10) NOT NULL,
`stream` mediumblob,
`output_type` enum('mixed','single') NOT NULL,
`stream_id` int(10) unsigned NOT NULL,
`sample_rate` int(10) unsigned NOT NULL DEFAULT '0',
`channels` int(10) unsigned NOT NULL DEFAULT '0',
`ssrc` int(10) unsigned NOT NULL,
`start_timestamp` decimal(13,3) DEFAULT NULL,
`end_timestamp` decimal(13,3) DEFAULT NULL,
`tag_label` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
KEY `call` (`call`),
CONSTRAINT `fk_call_id` FOREIGN KEY (`call`) REFERENCES `recording_calls` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
);
CREATE TABLE `recording_metakeys` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`call` int(10) unsigned NOT NULL,
`key` char(255) NOT NULL,
`value` char(255) NOT NULL,
PRIMARY KEY (`id`),
KEY `prim_lookup` (`value`,`key`),
KEY `fk_call_idx` (`call`),
CONSTRAINT `fk_call_idx` FOREIGN KEY (`call`) REFERENCES `recording_calls` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
);
```
## SEE ALSO
[rtpengine(8)](http://man.he.net/man8/rtpengine).

Loading…
Cancel
Save