add database schema for recording daemon

closes #716

Change-Id: I2684b3e74f4a676fd6aa6e2f1c24bfed37bd6db0
changes/08/27608/1
Richard Fuchs 6 years ago
parent 6ab75c040f
commit 0e0a55ce34

@ -9,6 +9,48 @@
#include "tag.h"
/*
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,
`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
)
*/
static MYSQL __thread *mysql_conn;
static MYSQL_STMT __thread
*stm_insert_call,

Loading…
Cancel
Save