1 CREATE TABLE "ipypbxweb_connection" (
2 "id" integer NOT NULL PRIMARY KEY,
3 "name" varchar(100) NOT NULL,
4 "local_ip_address" char(15) NOT NULL,
5 "local_port" integer unsigned NOT NULL,
6 "freeswitch_ip_address" char(15) NOT NULL,
7 "freeswitch_port" integer unsigned NOT NULL
10 CREATE TABLE "ipypbxweb_sipprofile" (
11 "id" integer NOT NULL PRIMARY KEY,
12 "connection_id" integer NOT NULL REFERENCES "ipypbxweb_connection" ("id"),
13 "name" varchar(100) NOT NULL,
14 "external_rtp_ip" varchar(100) NOT NULL,
15 "external_sip_ip" varchar(100) NOT NULL,
16 "rtp_ip" varchar(100) NOT NULL,
17 "sip_ip" varchar(100) NOT NULL,
18 "sip_port" integer unsigned NOT NULL,
19 "accept_blind_registration" bool NOT NULL,
20 "authenticate_calls" bool NOT NULL,
21 "is_active" bool NOT NULL
24 CREATE TABLE "ipypbxweb_domain" (
25 "id" integer NOT NULL PRIMARY KEY,
26 "connection_id" integer NOT NULL REFERENCES "ipypbxweb_connection" ("id"),
27 "sip_profile_id" integer NOT NULL REFERENCES "ipypbxweb_sipprofile" ("id"),
28 "host_name" varchar(100) NOT NULL,
29 "is_active" bool NOT NULL
32 CREATE TABLE "ipypbxweb_gateway" (
33 "id" integer NOT NULL PRIMARY KEY,
34 "connection_id" integer NOT NULL REFERENCES "ipypbxweb_connection" ("id"),
35 "sip_profile_id" integer NOT NULL REFERENCES "ipypbxweb_sipprofile" ("id"),
36 "name" varchar(100) NOT NULL,
37 "username" varchar(100) NOT NULL,
38 "password" varchar(100) NOT NULL,
39 "realm" varchar(100) NOT NULL,
40 "from_domain" varchar(100) NOT NULL,
41 "expire_in_seconds" integer unsigned NOT NULL,
42 "retry_in_seconds" integer unsigned NOT NULL,
43 "caller_id_in_from_field" bool NOT NULL,
44 "is_active" bool NOT NULL
47 CREATE TABLE "ipypbxweb_endpoint" (
48 "id" integer NOT NULL PRIMARY KEY,
49 "connection_id" integer NOT NULL REFERENCES "ipypbxweb_connection" ("id"),
50 "user_id" varchar(100) NOT NULL,
51 "password" varchar(100) NOT NULL,
52 "domain_id" integer NOT NULL REFERENCES "ipypbxweb_domain" ("id"),
53 "is_active" bool NOT NULL
56 CREATE TABLE "ipypbxweb_extension" (
57 "id" integer NOT NULL PRIMARY KEY,
58 "connection_id" integer NOT NULL REFERENCES "ipypbxweb_connection" ("id"),
59 "destination_match" varchar(100) NOT NULL,
60 "xml_dialplan" text NOT NULL,
61 "domain_id" integer REFERENCES "ipypbxweb_domain" ("id"),
62 "endpoint_id" integer REFERENCES "ipypbxweb_endpoint" ("id"),
63 "authenticate_calls" bool NOT NULL,
64 "is_active" bool NOT NULL
67 CREATE INDEX "ipypbxweb_sipprofile_connection_id" ON "ipypbxweb_sipprofile" ("connection_id");
68 CREATE INDEX "ipypbxweb_domain_connection_id" ON "ipypbxweb_domain" ("connection_id");
69 CREATE INDEX "ipypbxweb_domain_sip_profile_id" ON "ipypbxweb_domain" ("sip_profile_id");
70 CREATE INDEX "ipypbxweb_gateway_connection_id" ON "ipypbxweb_gateway" ("connection_id");
71 CREATE INDEX "ipypbxweb_gateway_sip_profile_id" ON "ipypbxweb_gateway" ("sip_profile_id");
72 CREATE INDEX "ipypbxweb_endpoint_connection_id" ON "ipypbxweb_endpoint" ("connection_id");
73 CREATE INDEX "ipypbxweb_endpoint_domain_id" ON "ipypbxweb_endpoint" ("domain_id");
74 CREATE INDEX "ipypbxweb_extension_connection_id" ON "ipypbxweb_extension" ("connection_id");
75 CREATE INDEX "ipypbxweb_extension_domain_id" ON "ipypbxweb_extension" ("domain_id");
76 CREATE INDEX "ipypbxweb_extension_endpoint_id" ON "ipypbxweb_extension" ("endpoint_id");