mirror of
https://github.com/jambonz/jambonz-infrastructure.git
synced 2025-12-19 09:07:44 +00:00
docker compose file for running jambonz
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -4,3 +4,6 @@
|
||||
*.tfstate.backup
|
||||
gcp.json
|
||||
jambonz-mini/
|
||||
|
||||
data_volume/
|
||||
tmpAudio/
|
||||
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
[submodule "docker/webapp"]
|
||||
path = docker/webapp
|
||||
url = git@github.com:jambonz/jambonz-webapp.git
|
||||
7
docker/.env
Normal file
7
docker/.env
Normal file
@@ -0,0 +1,7 @@
|
||||
# Required. HOST_IP is the IP address of the host machine running docker
|
||||
HOST_IP=
|
||||
|
||||
# Optional. Set if you want to use AWS/Polly voices for TTS
|
||||
AWS_ACCESS_KEY_ID=
|
||||
AWS_SECRET_ACCESS_KEY=
|
||||
AWS_REGION=
|
||||
45
docker/README.md
Normal file
45
docker/README.md
Normal file
@@ -0,0 +1,45 @@
|
||||
# docker-compose
|
||||
|
||||
This folder contains a docker compose file that can be used to run a jambonz system for development purposes on your laptop or other docker machine. It is not intended to be used for production purposes.
|
||||
|
||||
The docker network will include all of components of a jambonz system:
|
||||
- a Session Border Controller (SBC)
|
||||
- a feature server
|
||||
- mysql database
|
||||
- redis server
|
||||
- web provisioning application
|
||||
|
||||
## Configuration
|
||||
There are a few configuration items you will need to supply before running docker-compose:
|
||||
|
||||
1. A json key from google cloud to use for text-to-speech and speech-to-text. Download the key from [GCP](https://console.cloud.google.com/) and save it as gcp.json in the [credentials subfolder](credentials/).
|
||||
|
||||
2. Edit the [.env](.env) file and minimally specify `HOST_IP` as the public ip address of the host machine on which you are running docker.
|
||||
>>If you are testing by using a softphone on your laptop you can simply use the loopback address; e.g. `HOST_IP=127.0.0.1`, otherwise specify the IP address that external SIP traffic will be sent to.
|
||||
|
||||
3. Optionally, if you want to use AWS/Polly for text-to-speech then specify your AWS credentials (access key id, secret access key, and region) in the [.env](.env) file.
|
||||
|
||||
## Running
|
||||
Checkout and install as follows:
|
||||
```
|
||||
git clone git@github.com:jambonz/jambonz-infrastructure.git
|
||||
git submodule update --init
|
||||
cd docker
|
||||
|
||||
# now copy json key to credentials/gcp.json and edit .env as described above
|
||||
|
||||
# now start up the docker network
|
||||
docker-compose -f docker-compose.yaml up -d
|
||||
```
|
||||
This step will take several minutes the first time you start it as several docker images need to be downloaded and built. Once all of the containers are running, it may take another minute for the webapp to be built and connect to the database.
|
||||
|
||||
Once it does, you can log into the webapp at `localhost:3001` and configure the system. As usual, the initial password will be admin/admin and you will be forced to change it.
|
||||
|
||||
You can then configure your account, applications, sip trunks and phone numbers as usual.
|
||||
|
||||
**Note**: The mysql database will be stored in the `data_volume/` subfolder that is created, so that your provisioning data will persist when you start and stop the docker network.
|
||||
|
||||
Once you have provisioned the system, you should be able to point sip devices to register and send INVITEs to port 5060 on host ip address that you configured above and have that traffic routed to your jambonz system.
|
||||
|
||||
## Capacity
|
||||
The system has limited capacity as it is intended to be used as a personal development / test machine. Specifically, the rtpengine container which is part of the SBC function is configured to handle at most 50 simultaneous calls.
|
||||
0
docker/credentials/.keep
Normal file
0
docker/credentials/.keep
Normal file
252
docker/docker-compose.yaml
Normal file
252
docker/docker-compose.yaml
Normal file
@@ -0,0 +1,252 @@
|
||||
version: "3.9"
|
||||
networks:
|
||||
jambonz:
|
||||
driver: bridge
|
||||
ipam:
|
||||
config:
|
||||
- subnet: 172.10.0.0/16
|
||||
services:
|
||||
mysql:
|
||||
build: ./mysql
|
||||
volumes:
|
||||
- ./data_volume:/var/lib/mysql
|
||||
ports:
|
||||
- "3360:3306"
|
||||
environment:
|
||||
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
|
||||
MYSQL_DATABASE: "jambones"
|
||||
MYSQL_USER: "jambones"
|
||||
MYSQL_PASSWORD: "jambones"
|
||||
healthcheck:
|
||||
test: ["CMD", "mysqladmin" ,"ping", "-h", "127.0.0.1", "--protocol", "tcp"]
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
networks:
|
||||
jambonz:
|
||||
ipv4_address: 172.10.0.2
|
||||
|
||||
redis:
|
||||
image: redis:alpine
|
||||
ports:
|
||||
- "16379:6379/tcp"
|
||||
networks:
|
||||
jambonz:
|
||||
ipv4_address: 172.10.0.3
|
||||
|
||||
drachtio-sbc:
|
||||
image: drachtio/drachtio-server:latest
|
||||
restart: always
|
||||
command: drachtio --contact sip:172.10.0.10;transport=udp --external-ip ${HOST_IP} --contact sip:172.10.0.10;transport=tcp --address 0.0.0.0 --port 9022
|
||||
volumes:
|
||||
- ./sbc/drachtio.conf.xml:/etc/drachtio.conf.xml
|
||||
ports:
|
||||
- "5060:5060/udp"
|
||||
depends_on:
|
||||
- rtpengine
|
||||
networks:
|
||||
jambonz:
|
||||
ipv4_address: 172.10.0.10
|
||||
|
||||
rtpengine:
|
||||
image: drachtio/rtpengine:jambonz-test
|
||||
restart: always
|
||||
command: rtpengine --interface private/172.10.0.11 --interface public/172.10.0.11!${HOST_IP} --log-level 7
|
||||
ports:
|
||||
- "40000-40100:40000-40100/udp"
|
||||
networks:
|
||||
jambonz:
|
||||
ipv4_address: 172.10.0.11
|
||||
|
||||
api-server:
|
||||
image: jambonz/jambonz-api-server:latest
|
||||
restart: always
|
||||
ports:
|
||||
- "3000:3000"
|
||||
environment:
|
||||
NODE_ENV: production
|
||||
JAMBONES_MYSQL_HOST: 172.10.0.2
|
||||
JAMBONES_MYSQL_USER: jambones
|
||||
JAMBONES_MYSQL_PASSWORD: jambones
|
||||
JAMBONES_MYSQL_DATABASE: jambones
|
||||
JAMBONES_REDIS_HOST: 172.10.0.3
|
||||
JAMBONES_REDIS_PORT: 6379
|
||||
JAMBONES_LOGLEVEL: info
|
||||
JAMBONE_API_VERSION: v1
|
||||
JAMBONES_CLUSTER_ID: jb
|
||||
ENABLE_METRICS: 0
|
||||
HTTP_PORT: 3000
|
||||
depends_on:
|
||||
- mysql
|
||||
- redis
|
||||
networks:
|
||||
jambonz:
|
||||
ipv4_address: 172.10.0.30
|
||||
|
||||
webapp:
|
||||
build: ./webapp
|
||||
networks:
|
||||
jambonz:
|
||||
ipv4_address: 172.10.0.31
|
||||
ports:
|
||||
- "3001:3001"
|
||||
environment:
|
||||
REACT_APP_API_BASE_URL: http://127.0.0.1:3000/v1
|
||||
depends_on:
|
||||
- api-server
|
||||
|
||||
registrar:
|
||||
image: jambonz/sbc-registrar:latest
|
||||
restart: always
|
||||
environment:
|
||||
NODE_ENV: production
|
||||
DRACHTIO_HOST: 172.10.0.10
|
||||
DRACHTIO_PORT: 9022
|
||||
DRACHTIO_SECRET: cymru
|
||||
JAMBONES_MYSQL_HOST: 172.10.0.2
|
||||
JAMBONES_MYSQL_USER: jambones
|
||||
JAMBONES_MYSQL_PASSWORD: jambones
|
||||
JAMBONES_MYSQL_DATABASE: jambones
|
||||
JAMBONES_REDIS_HOST: 172.10.0.3
|
||||
JAMBONES_REDIS_PORT: 6379
|
||||
JAMBONES_LOGLEVEL: info
|
||||
ENABLE_METRICS: 0
|
||||
DEBUG: jambonz:*
|
||||
depends_on:
|
||||
- mysql
|
||||
- redis
|
||||
networks:
|
||||
jambonz:
|
||||
ipv4_address: 172.10.0.32
|
||||
|
||||
call-router:
|
||||
image: jambonz/sbc-call-router:latest
|
||||
restart: always
|
||||
environment:
|
||||
NODE_ENV: production
|
||||
DOCKER_BRIDGE_IP: 172.10.0.1
|
||||
JAMBONES_LOGLEVEL: info
|
||||
JAMBONES_NETWORK_CIDR: 172.10.0.0/16
|
||||
HTTP_PORT: 4000
|
||||
JAMBONES_INBOUND_ROUTE: 127.0.0.1:4002
|
||||
JAMBONES_OUTBOUND_ROUTE: 127.0.0.1:4003
|
||||
JAMBONZ_TAGGED_INBOUND: 1
|
||||
ENABLE_METRICS: 0
|
||||
depends_on:
|
||||
- mysql
|
||||
- redis
|
||||
networks:
|
||||
jambonz:
|
||||
ipv4_address: 172.10.0.33
|
||||
|
||||
sbc-inbound:
|
||||
image: jambonz/sbc-inbound:latest
|
||||
restart: always
|
||||
environment:
|
||||
NODE_ENV: production
|
||||
DRACHTIO_HOST: 172.10.0.10
|
||||
DRACHTIO_PORT: 9022
|
||||
DRACHTIO_SECRET: cymru
|
||||
JAMBONES_RTPENGINES: '172.10.0.11:22222'
|
||||
JAMBONES_MYSQL_HOST: 172.10.0.2
|
||||
JAMBONES_MYSQL_USER: jambones
|
||||
JAMBONES_MYSQL_PASSWORD: jambones
|
||||
JAMBONES_MYSQL_DATABASE: jambones
|
||||
JAMBONES_REDIS_HOST: 172.10.0.3
|
||||
JAMBONES_REDIS_PORT: 6379
|
||||
JAMBONES_CLUSTER_ID: jb
|
||||
JAMBONES_LOGLEVEL: info
|
||||
ENABLE_METRICS: 0
|
||||
depends_on:
|
||||
- mysql
|
||||
- redis
|
||||
networks:
|
||||
jambonz:
|
||||
ipv4_address: 172.10.0.34
|
||||
|
||||
sbc-outbound:
|
||||
image: jambonz/sbc-outbound:latest
|
||||
restart: always
|
||||
environment:
|
||||
NODE_ENV: production
|
||||
DRACHTIO_HOST: 172.10.0.10
|
||||
DRACHTIO_PORT: 9022
|
||||
DRACHTIO_SECRET: cymru
|
||||
JAMBONES_RTPENGINES: '172.10.0.11:22222'
|
||||
JAMBONES_MYSQL_HOST: 172.10.0.2
|
||||
JAMBONES_MYSQL_USER: jambones
|
||||
JAMBONES_MYSQL_PASSWORD: jambones
|
||||
JAMBONES_MYSQL_DATABASE: jambones
|
||||
JAMBONES_REDIS_HOST: 172.10.0.3
|
||||
JAMBONES_REDIS_PORT: 6379
|
||||
JAMBONES_CLUSTER_ID: jb
|
||||
JAMBONES_LOGLEVEL: info
|
||||
ENABLE_METRICS: 0
|
||||
depends_on:
|
||||
- mysql
|
||||
- redis
|
||||
networks:
|
||||
jambonz:
|
||||
ipv4_address: 172.10.0.35
|
||||
|
||||
drachtio-fs:
|
||||
image: drachtio/drachtio-server:latest
|
||||
restart: always
|
||||
command: drachtio --contact sip:*;transport=udp,tcp --address 0.0.0.0 --port 9022
|
||||
networks:
|
||||
jambonz:
|
||||
ipv4_address: 172.10.0.50
|
||||
|
||||
freeswitch:
|
||||
image: drachtio/drachtio-freeswitch-mrf:v1.10.1-full
|
||||
restart: always
|
||||
command: freeswitch --rtp-range-start 20000 --rtp-range-end 20100
|
||||
ports:
|
||||
- "8022:8021/tcp"
|
||||
volumes:
|
||||
- ./tmpAudio:/tmp
|
||||
networks:
|
||||
jambonz:
|
||||
ipv4_address: 172.10.0.51
|
||||
|
||||
feature-server:
|
||||
image: jambonz/feature-server:latest
|
||||
restart: always
|
||||
volumes:
|
||||
- ./credentials:/opt/credentials
|
||||
- ./tmpAudio:/tmp
|
||||
environment:
|
||||
NODE_ENV: production
|
||||
GOOGLE_APPLICATION_CREDENTIALS: /opt/credentials/gcp.json
|
||||
DRACHTIO_HOST: 172.10.0.50
|
||||
DRACHTIO_PORT: 9022
|
||||
DRACHTIO_SECRET: cymru
|
||||
JAMBONES_MYSQL_HOST: 172.10.0.2
|
||||
JAMBONES_MYSQL_USER: jambones
|
||||
JAMBONES_MYSQL_PASSWORD: jambones
|
||||
JAMBONES_MYSQL_DATABASE: jambones
|
||||
JAMBONES_REDIS_HOST: 172.10.0.3
|
||||
JAMBONES_REDIS_PORT: 6379
|
||||
JAMBONES_LOGLEVEL: info
|
||||
AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID}
|
||||
AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY}
|
||||
AWS_REGION: ${AWS_REGION}
|
||||
ENABLE_METRICS: 0
|
||||
JAMBONES_NETWORK_CIDR: 172.10.0.0/16
|
||||
HTTP_PORT: 3000
|
||||
JAMBONES_SBCS: 172.10.0.10
|
||||
JAMBONES_FEATURE_SERVERS: 172.10.0.50:9022:cymru
|
||||
JAMBONES_FREESWITCH: 172.10.0.51:8021:ClueCon
|
||||
depends_on:
|
||||
- mysql
|
||||
- redis
|
||||
- sbc-inbound
|
||||
- sbc-outbound
|
||||
- api-server
|
||||
- drachtio-fs
|
||||
- freeswitch
|
||||
networks:
|
||||
jambonz:
|
||||
ipv4_address: 172.10.0.60
|
||||
|
||||
|
||||
|
||||
3
docker/mysql/Dockerfile
Normal file
3
docker/mysql/Dockerfile
Normal file
@@ -0,0 +1,3 @@
|
||||
FROM mysql:5.7
|
||||
ADD create_db.sql /docker-entrypoint-initdb.d/create_db.sql
|
||||
RUN chmod -R 775 /docker-entrypoint-initdb.d
|
||||
277
docker/mysql/create_db.sql
Normal file
277
docker/mysql/create_db.sql
Normal file
@@ -0,0 +1,277 @@
|
||||
|
||||
SET FOREIGN_KEY_CHECKS=0;
|
||||
|
||||
DROP TABLE IF EXISTS call_routes;
|
||||
|
||||
DROP TABLE IF EXISTS lcr_carrier_set_entry;
|
||||
|
||||
DROP TABLE IF EXISTS lcr_routes;
|
||||
|
||||
DROP TABLE IF EXISTS api_keys;
|
||||
|
||||
DROP TABLE IF EXISTS ms_teams_tenants;
|
||||
|
||||
DROP TABLE IF EXISTS sbc_addresses;
|
||||
|
||||
DROP TABLE IF EXISTS users;
|
||||
|
||||
DROP TABLE IF EXISTS phone_numbers;
|
||||
|
||||
DROP TABLE IF EXISTS sip_gateways;
|
||||
|
||||
DROP TABLE IF EXISTS voip_carriers;
|
||||
|
||||
DROP TABLE IF EXISTS accounts;
|
||||
|
||||
DROP TABLE IF EXISTS applications;
|
||||
|
||||
DROP TABLE IF EXISTS service_providers;
|
||||
|
||||
DROP TABLE IF EXISTS webhooks;
|
||||
|
||||
CREATE TABLE call_routes
|
||||
(
|
||||
call_route_sid CHAR(36) NOT NULL UNIQUE ,
|
||||
priority INTEGER NOT NULL,
|
||||
account_sid CHAR(36) NOT NULL,
|
||||
regex VARCHAR(255) NOT NULL,
|
||||
application_sid CHAR(36) NOT NULL,
|
||||
PRIMARY KEY (call_route_sid)
|
||||
) ENGINE=InnoDB COMMENT='a regex-based pattern match for call routing';
|
||||
|
||||
CREATE TABLE lcr_routes
|
||||
(
|
||||
lcr_route_sid CHAR(36),
|
||||
regex VARCHAR(32) NOT NULL COMMENT 'regex-based pattern match against dialed number, used for LCR routing of PSTN calls',
|
||||
description VARCHAR(1024),
|
||||
priority INTEGER NOT NULL UNIQUE COMMENT 'lower priority routes are attempted first',
|
||||
PRIMARY KEY (lcr_route_sid)
|
||||
) COMMENT='Least cost routing table';
|
||||
|
||||
CREATE TABLE api_keys
|
||||
(
|
||||
api_key_sid CHAR(36) NOT NULL UNIQUE ,
|
||||
token CHAR(36) NOT NULL UNIQUE ,
|
||||
account_sid CHAR(36),
|
||||
service_provider_sid CHAR(36),
|
||||
expires_at TIMESTAMP NULL DEFAULT NULL,
|
||||
last_used TIMESTAMP NULL DEFAULT NULL,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (api_key_sid)
|
||||
) ENGINE=InnoDB COMMENT='An authorization token that is used to access the REST api';
|
||||
|
||||
CREATE TABLE ms_teams_tenants
|
||||
(
|
||||
ms_teams_tenant_sid CHAR(36) NOT NULL UNIQUE ,
|
||||
service_provider_sid CHAR(36) NOT NULL,
|
||||
account_sid CHAR(36) NOT NULL,
|
||||
application_sid CHAR(36),
|
||||
tenant_fqdn VARCHAR(255) NOT NULL UNIQUE ,
|
||||
PRIMARY KEY (ms_teams_tenant_sid)
|
||||
) COMMENT='A Microsoft Teams customer tenant';
|
||||
|
||||
CREATE TABLE sbc_addresses
|
||||
(
|
||||
sbc_address_sid CHAR(36) NOT NULL UNIQUE ,
|
||||
ipv4 VARCHAR(255) NOT NULL,
|
||||
port INTEGER NOT NULL DEFAULT 5060,
|
||||
service_provider_sid CHAR(36),
|
||||
PRIMARY KEY (sbc_address_sid)
|
||||
);
|
||||
|
||||
CREATE TABLE users
|
||||
(
|
||||
user_sid CHAR(36) NOT NULL UNIQUE ,
|
||||
name CHAR(36) NOT NULL UNIQUE ,
|
||||
hashed_password VARCHAR(1024) NOT NULL,
|
||||
salt CHAR(16) NOT NULL,
|
||||
force_change BOOLEAN NOT NULL DEFAULT TRUE,
|
||||
PRIMARY KEY (user_sid)
|
||||
);
|
||||
|
||||
CREATE TABLE voip_carriers
|
||||
(
|
||||
voip_carrier_sid CHAR(36) NOT NULL UNIQUE ,
|
||||
name VARCHAR(64) NOT NULL UNIQUE ,
|
||||
description VARCHAR(255),
|
||||
account_sid CHAR(36) COMMENT 'if provided, indicates this entity represents a customer PBX that is associated with a specific account',
|
||||
application_sid CHAR(36) COMMENT 'If provided, all incoming calls from this source will be routed to the associated application',
|
||||
e164_leading_plus BOOLEAN NOT NULL DEFAULT false,
|
||||
requires_register BOOLEAN NOT NULL DEFAULT false,
|
||||
register_username VARCHAR(64),
|
||||
register_sip_realm VARCHAR(64),
|
||||
register_password VARCHAR(64),
|
||||
PRIMARY KEY (voip_carrier_sid)
|
||||
) ENGINE=InnoDB COMMENT='A Carrier or customer PBX that can send or receive calls';
|
||||
|
||||
CREATE TABLE phone_numbers
|
||||
(
|
||||
phone_number_sid CHAR(36) UNIQUE ,
|
||||
number VARCHAR(32) NOT NULL UNIQUE ,
|
||||
voip_carrier_sid CHAR(36) NOT NULL,
|
||||
account_sid CHAR(36),
|
||||
application_sid CHAR(36),
|
||||
PRIMARY KEY (phone_number_sid)
|
||||
) ENGINE=InnoDB COMMENT='A phone number that has been assigned to an account';
|
||||
|
||||
CREATE TABLE webhooks
|
||||
(
|
||||
webhook_sid CHAR(36) NOT NULL UNIQUE ,
|
||||
url VARCHAR(1024) NOT NULL,
|
||||
method ENUM("GET","POST") NOT NULL DEFAULT 'POST',
|
||||
username VARCHAR(255),
|
||||
password VARCHAR(255),
|
||||
PRIMARY KEY (webhook_sid)
|
||||
) COMMENT='An HTTP callback';
|
||||
|
||||
CREATE TABLE sip_gateways
|
||||
(
|
||||
sip_gateway_sid CHAR(36),
|
||||
ipv4 VARCHAR(128) NOT NULL COMMENT 'ip address or DNS name of the gateway. For gateways providing inbound calling service, ip address is required.',
|
||||
port INTEGER NOT NULL DEFAULT 5060 COMMENT 'sip signaling port',
|
||||
inbound BOOLEAN NOT NULL COMMENT 'if true, whitelist this IP to allow inbound calls from the gateway',
|
||||
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,
|
||||
is_active BOOLEAN NOT NULL DEFAULT 1,
|
||||
PRIMARY KEY (sip_gateway_sid)
|
||||
) COMMENT='A whitelisted sip gateway used for origination/termination';
|
||||
|
||||
CREATE TABLE lcr_carrier_set_entry
|
||||
(
|
||||
lcr_carrier_set_entry_sid CHAR(36),
|
||||
workload INTEGER NOT NULL DEFAULT 1 COMMENT 'represents a proportion of traffic to send through the associated carrier; can be used for load balancing traffic across carriers with a common priority for a destination',
|
||||
lcr_route_sid CHAR(36) NOT NULL,
|
||||
voip_carrier_sid CHAR(36) NOT NULL,
|
||||
priority INTEGER NOT NULL DEFAULT 0 COMMENT 'lower priority carriers are attempted first',
|
||||
PRIMARY KEY (lcr_carrier_set_entry_sid)
|
||||
) COMMENT='An entry in the LCR routing list';
|
||||
|
||||
CREATE TABLE applications
|
||||
(
|
||||
application_sid CHAR(36) NOT NULL UNIQUE ,
|
||||
name VARCHAR(64) NOT NULL,
|
||||
account_sid CHAR(36) NOT NULL COMMENT 'account that this application belongs to',
|
||||
call_hook_sid CHAR(36) COMMENT 'webhook to call for inbound calls ',
|
||||
call_status_hook_sid CHAR(36) COMMENT 'webhook to call for call status events',
|
||||
messaging_hook_sid CHAR(36) COMMENT 'webhook to call for inbound SMS/MMS ',
|
||||
speech_synthesis_vendor VARCHAR(64) NOT NULL DEFAULT 'google',
|
||||
speech_synthesis_language VARCHAR(12) NOT NULL DEFAULT 'en-US',
|
||||
speech_synthesis_voice VARCHAR(64),
|
||||
speech_recognizer_vendor VARCHAR(64) NOT NULL DEFAULT 'google',
|
||||
speech_recognizer_language VARCHAR(64) NOT NULL DEFAULT 'en-US',
|
||||
PRIMARY KEY (application_sid)
|
||||
) ENGINE=InnoDB COMMENT='A defined set of behaviors to be applied to phone calls ';
|
||||
|
||||
CREATE TABLE service_providers
|
||||
(
|
||||
service_provider_sid CHAR(36) NOT NULL UNIQUE ,
|
||||
name VARCHAR(64) NOT NULL UNIQUE ,
|
||||
description VARCHAR(255),
|
||||
root_domain VARCHAR(128) UNIQUE ,
|
||||
registration_hook_sid CHAR(36),
|
||||
ms_teams_fqdn VARCHAR(255),
|
||||
PRIMARY KEY (service_provider_sid)
|
||||
) ENGINE=InnoDB COMMENT='A partition of the platform used by one service provider';
|
||||
|
||||
CREATE TABLE accounts
|
||||
(
|
||||
account_sid CHAR(36) NOT NULL UNIQUE ,
|
||||
name VARCHAR(64) NOT NULL,
|
||||
sip_realm VARCHAR(132) UNIQUE COMMENT 'sip domain that will be used for devices registering under this account',
|
||||
service_provider_sid CHAR(36) NOT NULL COMMENT 'service provider that owns the customer relationship with this account',
|
||||
registration_hook_sid CHAR(36) COMMENT 'webhook to call when devices underr this account attempt to register',
|
||||
device_calling_application_sid CHAR(36) COMMENT 'application to use for outbound calling from an account',
|
||||
is_active BOOLEAN NOT NULL DEFAULT true,
|
||||
PRIMARY KEY (account_sid)
|
||||
) ENGINE=InnoDB COMMENT='An enterprise that uses the platform for comm services';
|
||||
|
||||
CREATE INDEX call_route_sid_idx ON call_routes (call_route_sid);
|
||||
ALTER TABLE call_routes ADD FOREIGN KEY account_sid_idxfk (account_sid) REFERENCES accounts (account_sid);
|
||||
|
||||
ALTER TABLE call_routes ADD FOREIGN KEY application_sid_idxfk (application_sid) REFERENCES applications (application_sid);
|
||||
|
||||
CREATE INDEX api_key_sid_idx ON api_keys (api_key_sid);
|
||||
CREATE INDEX account_sid_idx ON api_keys (account_sid);
|
||||
ALTER TABLE api_keys ADD FOREIGN KEY account_sid_idxfk_1 (account_sid) REFERENCES accounts (account_sid);
|
||||
|
||||
CREATE INDEX service_provider_sid_idx ON api_keys (service_provider_sid);
|
||||
ALTER TABLE api_keys ADD FOREIGN KEY service_provider_sid_idxfk (service_provider_sid) REFERENCES service_providers (service_provider_sid);
|
||||
|
||||
CREATE INDEX ms_teams_tenant_sid_idx ON ms_teams_tenants (ms_teams_tenant_sid);
|
||||
ALTER TABLE ms_teams_tenants ADD FOREIGN KEY service_provider_sid_idxfk_1 (service_provider_sid) REFERENCES service_providers (service_provider_sid);
|
||||
|
||||
ALTER TABLE ms_teams_tenants ADD FOREIGN KEY account_sid_idxfk_2 (account_sid) REFERENCES accounts (account_sid);
|
||||
|
||||
ALTER TABLE ms_teams_tenants ADD FOREIGN KEY application_sid_idxfk_1 (application_sid) REFERENCES applications (application_sid);
|
||||
|
||||
CREATE INDEX tenant_fqdn_idx ON ms_teams_tenants (tenant_fqdn);
|
||||
CREATE INDEX sbc_addresses_idx_host_port ON sbc_addresses (ipv4,port);
|
||||
|
||||
CREATE INDEX sbc_address_sid_idx ON sbc_addresses (sbc_address_sid);
|
||||
CREATE INDEX service_provider_sid_idx ON sbc_addresses (service_provider_sid);
|
||||
ALTER TABLE sbc_addresses ADD FOREIGN KEY service_provider_sid_idxfk_2 (service_provider_sid) REFERENCES service_providers (service_provider_sid);
|
||||
|
||||
CREATE INDEX user_sid_idx ON users (user_sid);
|
||||
CREATE INDEX name_idx ON users (name);
|
||||
CREATE INDEX voip_carrier_sid_idx ON voip_carriers (voip_carrier_sid);
|
||||
CREATE INDEX name_idx ON voip_carriers (name);
|
||||
ALTER TABLE voip_carriers ADD FOREIGN KEY account_sid_idxfk_3 (account_sid) REFERENCES accounts (account_sid);
|
||||
|
||||
ALTER TABLE voip_carriers ADD FOREIGN KEY application_sid_idxfk_2 (application_sid) REFERENCES applications (application_sid);
|
||||
|
||||
CREATE INDEX phone_number_sid_idx ON phone_numbers (phone_number_sid);
|
||||
CREATE INDEX voip_carrier_sid_idx ON phone_numbers (voip_carrier_sid);
|
||||
ALTER TABLE phone_numbers ADD FOREIGN KEY voip_carrier_sid_idxfk (voip_carrier_sid) REFERENCES voip_carriers (voip_carrier_sid);
|
||||
|
||||
ALTER TABLE phone_numbers ADD FOREIGN KEY account_sid_idxfk_4 (account_sid) REFERENCES accounts (account_sid);
|
||||
|
||||
ALTER TABLE phone_numbers ADD FOREIGN KEY application_sid_idxfk_3 (application_sid) REFERENCES applications (application_sid);
|
||||
|
||||
CREATE INDEX webhook_sid_idx ON webhooks (webhook_sid);
|
||||
CREATE UNIQUE INDEX sip_gateway_idx_hostport ON sip_gateways (ipv4,port);
|
||||
|
||||
ALTER TABLE sip_gateways ADD FOREIGN KEY voip_carrier_sid_idxfk_1 (voip_carrier_sid) REFERENCES voip_carriers (voip_carrier_sid);
|
||||
|
||||
ALTER TABLE lcr_carrier_set_entry ADD FOREIGN KEY lcr_route_sid_idxfk (lcr_route_sid) REFERENCES lcr_routes (lcr_route_sid);
|
||||
|
||||
ALTER TABLE lcr_carrier_set_entry ADD FOREIGN KEY voip_carrier_sid_idxfk_2 (voip_carrier_sid) REFERENCES voip_carriers (voip_carrier_sid);
|
||||
|
||||
CREATE UNIQUE INDEX applications_idx_name ON applications (account_sid,name);
|
||||
|
||||
CREATE INDEX application_sid_idx ON applications (application_sid);
|
||||
CREATE INDEX account_sid_idx ON applications (account_sid);
|
||||
ALTER TABLE applications ADD FOREIGN KEY account_sid_idxfk_5 (account_sid) REFERENCES accounts (account_sid);
|
||||
|
||||
ALTER TABLE applications ADD FOREIGN KEY call_hook_sid_idxfk (call_hook_sid) REFERENCES webhooks (webhook_sid);
|
||||
|
||||
ALTER TABLE applications ADD FOREIGN KEY call_status_hook_sid_idxfk (call_status_hook_sid) REFERENCES webhooks (webhook_sid);
|
||||
|
||||
ALTER TABLE applications ADD FOREIGN KEY messaging_hook_sid_idxfk (messaging_hook_sid) REFERENCES webhooks (webhook_sid);
|
||||
|
||||
CREATE INDEX service_provider_sid_idx ON service_providers (service_provider_sid);
|
||||
CREATE INDEX name_idx ON service_providers (name);
|
||||
CREATE INDEX root_domain_idx ON service_providers (root_domain);
|
||||
ALTER TABLE service_providers ADD FOREIGN KEY registration_hook_sid_idxfk (registration_hook_sid) REFERENCES webhooks (webhook_sid);
|
||||
|
||||
CREATE INDEX account_sid_idx ON accounts (account_sid);
|
||||
CREATE INDEX sip_realm_idx ON accounts (sip_realm);
|
||||
CREATE INDEX service_provider_sid_idx ON accounts (service_provider_sid);
|
||||
ALTER TABLE accounts ADD FOREIGN KEY service_provider_sid_idxfk_3 (service_provider_sid) REFERENCES service_providers (service_provider_sid);
|
||||
|
||||
ALTER TABLE accounts ADD FOREIGN KEY registration_hook_sid_idxfk_1 (registration_hook_sid) REFERENCES webhooks (webhook_sid);
|
||||
|
||||
ALTER TABLE accounts ADD FOREIGN KEY device_calling_application_sid_idxfk (device_calling_application_sid) REFERENCES applications (application_sid);
|
||||
|
||||
insert into api_keys (api_key_sid, token)
|
||||
values ('3f35518f-5a0d-4c2e-90a5-2407bb3b36f0', '746f1333-6a78-45ec-80f1-012f0f400a65');
|
||||
|
||||
insert into service_providers (service_provider_sid, name)
|
||||
values ('2708b1b3-2736-40ea-b502-c53d8396247f', 'default service provider');
|
||||
|
||||
insert into accounts (account_sid, service_provider_sid, name)
|
||||
values ('9351f46a-678c-43f5-b8a6-d4eb58d131af','2708b1b3-2736-40ea-b502-c53d8396247f', 'default account');
|
||||
|
||||
insert into users (user_sid, name, hashed_password, salt, force_change)
|
||||
values ('12c80508-edf9-4b22-8d09-55abd02648eb', 'admin', '333d7b724d42863840530c0d1d79c690fbcf22ee05eb988b905ce6d4f88a8c1c453dfdbf5add1b697c4b9f9dc37723052f3263590f77611a2b3669a7ce43fe7c', '38412b7eaff0edc5', 1);
|
||||
|
||||
SET FOREIGN_KEY_CHECKS=1;
|
||||
23
docker/sbc/drachtio.conf.xml
Normal file
23
docker/sbc/drachtio.conf.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<drachtio>
|
||||
|
||||
<!-- udp port to listen on for client connections and shared secret used to authenticate clients -->
|
||||
<admin port="9022" secret="cymru">0.0.0.0</admin>
|
||||
<request-handlers>
|
||||
<request-handler sip-method="INVITE">http://172.10.0.33:4000</request-handler>
|
||||
</request-handlers>
|
||||
<sip>
|
||||
<contacts>
|
||||
</contacts>
|
||||
|
||||
<udp-mtu>4096</udp-mtu>
|
||||
|
||||
</sip>
|
||||
|
||||
<cdrs>false</cdrs>
|
||||
|
||||
<logging>
|
||||
<sofia-loglevel>3</sofia-loglevel>
|
||||
<loglevel>info</loglevel>
|
||||
</logging>
|
||||
|
||||
</drachtio>
|
||||
1
docker/webapp
Submodule
1
docker/webapp
Submodule
Submodule docker/webapp added at f5f92e58e1
@@ -15,7 +15,6 @@
|
||||
"editable": true,
|
||||
"gnetId": null,
|
||||
"graphTooltip": 0,
|
||||
"id": 4,
|
||||
"links": [],
|
||||
"panels": [
|
||||
{
|
||||
@@ -1078,6 +1077,7 @@
|
||||
"steppedLine": false,
|
||||
"targets": [
|
||||
{
|
||||
"alias": "average",
|
||||
"groupBy": [
|
||||
{
|
||||
"params": [
|
||||
@@ -1085,12 +1085,6 @@
|
||||
],
|
||||
"type": "time"
|
||||
},
|
||||
{
|
||||
"params": [
|
||||
"host"
|
||||
],
|
||||
"type": "tag"
|
||||
},
|
||||
{
|
||||
"params": [
|
||||
"none"
|
||||
@@ -1108,7 +1102,44 @@
|
||||
[
|
||||
{
|
||||
"params": [
|
||||
"90_percentile"
|
||||
"mean"
|
||||
],
|
||||
"type": "field"
|
||||
},
|
||||
{
|
||||
"params": [],
|
||||
"type": "mean"
|
||||
}
|
||||
]
|
||||
],
|
||||
"tags": []
|
||||
},
|
||||
{
|
||||
"alias": "95%",
|
||||
"groupBy": [
|
||||
{
|
||||
"params": [
|
||||
"$__interval"
|
||||
],
|
||||
"type": "time"
|
||||
},
|
||||
{
|
||||
"params": [
|
||||
"null"
|
||||
],
|
||||
"type": "fill"
|
||||
}
|
||||
],
|
||||
"measurement": "tts_response_time",
|
||||
"orderByTime": "ASC",
|
||||
"policy": "default",
|
||||
"refId": "B",
|
||||
"resultFormat": "time_series",
|
||||
"select": [
|
||||
[
|
||||
{
|
||||
"params": [
|
||||
"95_percentile"
|
||||
],
|
||||
"type": "field"
|
||||
},
|
||||
@@ -1745,12 +1776,12 @@
|
||||
"list": []
|
||||
},
|
||||
"time": {
|
||||
"from": "now-1h",
|
||||
"from": "now-1d",
|
||||
"to": "now"
|
||||
},
|
||||
"timepicker": {},
|
||||
"timezone": "",
|
||||
"title": "Jambonz Metrics",
|
||||
"uid": "oAM51epMz",
|
||||
"version": 3
|
||||
"version": 1
|
||||
}
|
||||
Reference in New Issue
Block a user