mirror of
https://github.com/jambonz/sbc-sip-sidecar.git
synced 2026-10-04 02:04:20 +00:00
update testbed to latest schema
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
/* SQLEditor (MySQL (2))*/
|
/* SQLEditor (MySQL (2))*/
|
||||||
|
|
||||||
SET FOREIGN_KEY_CHECKS=0;
|
SET FOREIGN_KEY_CHECKS=0;
|
||||||
|
|
||||||
DROP TABLE IF EXISTS account_static_ips;
|
DROP TABLE IF EXISTS account_static_ips;
|
||||||
@@ -16,6 +15,8 @@ DROP TABLE IF EXISTS call_routes;
|
|||||||
|
|
||||||
DROP TABLE IF EXISTS dns_records;
|
DROP TABLE IF EXISTS dns_records;
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS lcr;
|
||||||
|
|
||||||
DROP TABLE IF EXISTS lcr_carrier_set_entry;
|
DROP TABLE IF EXISTS lcr_carrier_set_entry;
|
||||||
|
|
||||||
DROP TABLE IF EXISTS lcr_routes;
|
DROP TABLE IF EXISTS lcr_routes;
|
||||||
@@ -52,6 +53,8 @@ DROP TABLE IF EXISTS smpp_addresses;
|
|||||||
|
|
||||||
DROP TABLE IF EXISTS speech_credentials;
|
DROP TABLE IF EXISTS speech_credentials;
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS system_information;
|
||||||
|
|
||||||
DROP TABLE IF EXISTS users;
|
DROP TABLE IF EXISTS users;
|
||||||
|
|
||||||
DROP TABLE IF EXISTS smpp_gateways;
|
DROP TABLE IF EXISTS smpp_gateways;
|
||||||
@@ -136,11 +139,23 @@ PRIMARY KEY (dns_record_sid)
|
|||||||
CREATE TABLE lcr_routes
|
CREATE TABLE lcr_routes
|
||||||
(
|
(
|
||||||
lcr_route_sid CHAR(36),
|
lcr_route_sid CHAR(36),
|
||||||
|
lcr_sid CHAR(36) NOT NULL,
|
||||||
regex VARCHAR(32) NOT NULL COMMENT 'regex-based pattern match against dialed number, used for LCR routing of PSTN calls',
|
regex VARCHAR(32) NOT NULL COMMENT 'regex-based pattern match against dialed number, used for LCR routing of PSTN calls',
|
||||||
description VARCHAR(1024),
|
description VARCHAR(1024),
|
||||||
priority INTEGER NOT NULL UNIQUE COMMENT 'lower priority routes are attempted first',
|
priority INTEGER NOT NULL COMMENT 'lower priority routes are attempted first',
|
||||||
PRIMARY KEY (lcr_route_sid)
|
PRIMARY KEY (lcr_route_sid)
|
||||||
) COMMENT='Least cost routing table';
|
) COMMENT='An ordered list of digit patterns in an LCR table. The patterns are tested in sequence until one matches';
|
||||||
|
|
||||||
|
CREATE TABLE lcr
|
||||||
|
(
|
||||||
|
lcr_sid CHAR(36) NOT NULL UNIQUE ,
|
||||||
|
name VARCHAR(64) COMMENT 'User-assigned name for this LCR table',
|
||||||
|
is_active BOOLEAN NOT NULL DEFAULT 1,
|
||||||
|
default_carrier_set_entry_sid CHAR(36) COMMENT 'default carrier/route to use when no digit match based results are found.',
|
||||||
|
service_provider_sid CHAR(36),
|
||||||
|
account_sid CHAR(36),
|
||||||
|
PRIMARY KEY (lcr_sid)
|
||||||
|
) COMMENT='An LCR (least cost routing) table that is used by a service provider or account to make decisions about routing outbound calls when multiple carriers are available.';
|
||||||
|
|
||||||
CREATE TABLE password_settings
|
CREATE TABLE password_settings
|
||||||
(
|
(
|
||||||
@@ -248,6 +263,8 @@ CREATE TABLE sbc_addresses
|
|||||||
sbc_address_sid CHAR(36) NOT NULL UNIQUE ,
|
sbc_address_sid CHAR(36) NOT NULL UNIQUE ,
|
||||||
ipv4 VARCHAR(255) NOT NULL,
|
ipv4 VARCHAR(255) NOT NULL,
|
||||||
port INTEGER NOT NULL DEFAULT 5060,
|
port INTEGER NOT NULL DEFAULT 5060,
|
||||||
|
tls_port INTEGER,
|
||||||
|
wss_port INTEGER,
|
||||||
service_provider_sid CHAR(36),
|
service_provider_sid CHAR(36),
|
||||||
last_updated DATETIME,
|
last_updated DATETIME,
|
||||||
PRIMARY KEY (sbc_address_sid)
|
PRIMARY KEY (sbc_address_sid)
|
||||||
@@ -308,6 +325,13 @@ created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|||||||
PRIMARY KEY (speech_credential_sid)
|
PRIMARY KEY (speech_credential_sid)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
CREATE TABLE system_information
|
||||||
|
(
|
||||||
|
domain_name VARCHAR(255),
|
||||||
|
sip_domain_name VARCHAR(255),
|
||||||
|
monitoring_domain_name VARCHAR(255)
|
||||||
|
);
|
||||||
|
|
||||||
CREATE TABLE users
|
CREATE TABLE users
|
||||||
(
|
(
|
||||||
user_sid CHAR(36) NOT NULL UNIQUE ,
|
user_sid CHAR(36) NOT NULL UNIQUE ,
|
||||||
@@ -405,6 +429,7 @@ inbound BOOLEAN NOT NULL COMMENT 'if true, whitelist this IP to allow inbound ca
|
|||||||
outbound BOOLEAN NOT NULL COMMENT 'if true, include in least-cost routing when placing calls to the PSTN',
|
outbound BOOLEAN NOT NULL COMMENT 'if true, include in least-cost routing when placing calls to the PSTN',
|
||||||
voip_carrier_sid CHAR(36) NOT NULL,
|
voip_carrier_sid CHAR(36) NOT NULL,
|
||||||
is_active BOOLEAN NOT NULL DEFAULT 1,
|
is_active BOOLEAN NOT NULL DEFAULT 1,
|
||||||
|
protocol ENUM('udp','tcp','tls', 'tls/srtp') DEFAULT 'udp' COMMENT 'Outbound call protocol',
|
||||||
PRIMARY KEY (sip_gateway_sid)
|
PRIMARY KEY (sip_gateway_sid)
|
||||||
) COMMENT='A whitelisted sip gateway used for origination/termination';
|
) COMMENT='A whitelisted sip gateway used for origination/termination';
|
||||||
|
|
||||||
@@ -444,6 +469,7 @@ speech_synthesis_voice VARCHAR(64),
|
|||||||
speech_recognizer_vendor VARCHAR(64) NOT NULL DEFAULT 'google',
|
speech_recognizer_vendor VARCHAR(64) NOT NULL DEFAULT 'google',
|
||||||
speech_recognizer_language VARCHAR(64) NOT NULL DEFAULT 'en-US',
|
speech_recognizer_language VARCHAR(64) NOT NULL DEFAULT 'en-US',
|
||||||
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
record_all_calls BOOLEAN NOT NULL DEFAULT false,
|
||||||
PRIMARY KEY (application_sid)
|
PRIMARY KEY (application_sid)
|
||||||
) COMMENT='A defined set of behaviors to be applied to phone calls ';
|
) COMMENT='A defined set of behaviors to be applied to phone calls ';
|
||||||
|
|
||||||
@@ -481,6 +507,9 @@ subspace_client_secret VARCHAR(255),
|
|||||||
subspace_sip_teleport_id VARCHAR(255),
|
subspace_sip_teleport_id VARCHAR(255),
|
||||||
subspace_sip_teleport_destinations VARCHAR(255),
|
subspace_sip_teleport_destinations VARCHAR(255),
|
||||||
siprec_hook_sid CHAR(36),
|
siprec_hook_sid CHAR(36),
|
||||||
|
record_all_calls BOOLEAN NOT NULL DEFAULT false,
|
||||||
|
record_format VARCHAR(16) NOT NULL DEFAULT 'mp3',
|
||||||
|
bucket_credential VARCHAR(8192) COMMENT 'credential used to authenticate with storage service',
|
||||||
PRIMARY KEY (account_sid)
|
PRIMARY KEY (account_sid)
|
||||||
) COMMENT='An enterprise that uses the platform for comm services';
|
) COMMENT='An enterprise that uses the platform for comm services';
|
||||||
|
|
||||||
@@ -504,6 +533,14 @@ ALTER TABLE call_routes ADD FOREIGN KEY application_sid_idxfk (application_sid)
|
|||||||
CREATE INDEX dns_record_sid_idx ON dns_records (dns_record_sid);
|
CREATE INDEX dns_record_sid_idx ON dns_records (dns_record_sid);
|
||||||
ALTER TABLE dns_records ADD FOREIGN KEY account_sid_idxfk_4 (account_sid) REFERENCES accounts (account_sid);
|
ALTER TABLE dns_records ADD FOREIGN KEY account_sid_idxfk_4 (account_sid) REFERENCES accounts (account_sid);
|
||||||
|
|
||||||
|
CREATE INDEX lcr_sid_idx ON lcr_routes (lcr_sid);
|
||||||
|
ALTER TABLE lcr_routes ADD FOREIGN KEY lcr_sid_idxfk (lcr_sid) REFERENCES lcr (lcr_sid);
|
||||||
|
|
||||||
|
CREATE INDEX lcr_sid_idx ON lcr (lcr_sid);
|
||||||
|
ALTER TABLE lcr ADD FOREIGN KEY default_carrier_set_entry_sid_idxfk (default_carrier_set_entry_sid) REFERENCES lcr_carrier_set_entry (lcr_carrier_set_entry_sid);
|
||||||
|
|
||||||
|
CREATE INDEX service_provider_sid_idx ON lcr (service_provider_sid);
|
||||||
|
CREATE INDEX account_sid_idx ON lcr (account_sid);
|
||||||
CREATE INDEX permission_sid_idx ON permissions (permission_sid);
|
CREATE INDEX permission_sid_idx ON permissions (permission_sid);
|
||||||
CREATE INDEX predefined_carrier_sid_idx ON predefined_carriers (predefined_carrier_sid);
|
CREATE INDEX predefined_carrier_sid_idx ON predefined_carriers (predefined_carrier_sid);
|
||||||
CREATE INDEX predefined_sip_gateway_sid_idx ON predefined_sip_gateways (predefined_sip_gateway_sid);
|
CREATE INDEX predefined_sip_gateway_sid_idx ON predefined_sip_gateways (predefined_sip_gateway_sid);
|
||||||
@@ -649,5 +686,4 @@ ALTER TABLE accounts ADD FOREIGN KEY queue_event_hook_sid_idxfk (queue_event_hoo
|
|||||||
ALTER TABLE accounts ADD FOREIGN KEY device_calling_application_sid_idxfk (device_calling_application_sid) REFERENCES applications (application_sid);
|
ALTER TABLE accounts ADD FOREIGN KEY device_calling_application_sid_idxfk (device_calling_application_sid) REFERENCES applications (application_sid);
|
||||||
|
|
||||||
ALTER TABLE accounts ADD FOREIGN KEY siprec_hook_sid_idxfk (siprec_hook_sid) REFERENCES applications (application_sid);
|
ALTER TABLE accounts ADD FOREIGN KEY siprec_hook_sid_idxfk (siprec_hook_sid) REFERENCES applications (application_sid);
|
||||||
|
|
||||||
SET FOREIGN_KEY_CHECKS=1;
|
SET FOREIGN_KEY_CHECKS=1;
|
||||||
Reference in New Issue
Block a user