changes to account and application

This commit is contained in:
Dave Horton
2019-12-20 15:37:44 -05:00
parent 7c2e12a4be
commit b2760a2d75
5 changed files with 109 additions and 39 deletions
+19 -16
View File
@@ -42,13 +42,16 @@ CREATE TABLE IF NOT EXISTS `applications`
`account_sid` CHAR(36) NOT NULL,
`call_hook` VARCHAR(255) NOT NULL,
`call_status_hook` VARCHAR(255) NOT NULL,
`hook_basic_auth_user` VARCHAR(255),
`hook_basic_auth_password` VARCHAR(255),
`hook_http_method` ENUM('get','post') NOT NULL DEFAULT 'get',
PRIMARY KEY (`application_sid`)
) ENGINE=InnoDB COMMENT='A defined set of behaviors to be applied to phone calls with';
CREATE TABLE IF NOT EXISTS `call_routes`
(
`call_route_sid` CHAR(36) NOT NULL UNIQUE ,
`order` INTEGER NOT NULL,
`priority` INTEGER NOT NULL,
`account_sid` CHAR(36) NOT NULL,
`regex` VARCHAR(255) NOT NULL,
`application_sid` CHAR(36) NOT NULL,
@@ -203,6 +206,16 @@ CREATE TABLE IF NOT EXISTS `phone_numbers`
PRIMARY KEY (`phone_number_sid`)
) ENGINE=InnoDB COMMENT='A phone number that has been assigned to an account';
CREATE TABLE IF NOT EXISTS `lcr_carrier_set_entry`
(
`lcr_carrier_set_entry_sid` CHAR(36),
`workload` INTEGER NOT NULL DEFAULT 1,
`lcr_route_sid` CHAR(36) NOT NULL,
`voip_carrier_sid` CHAR(36) NOT NULL,
`priority` INTEGER NOT NULL DEFAULT 0,
PRIMARY KEY (`lcr_carrier_set_entry_sid`)
);
CREATE TABLE IF NOT EXISTS `sip_gateways`
(
`sip_gateway_sid` CHAR(36),
@@ -215,16 +228,6 @@ CREATE TABLE IF NOT EXISTS `sip_gateways`
PRIMARY KEY (`sip_gateway_sid`)
);
CREATE TABLE IF NOT EXISTS `lcr_carrier_set_entry`
(
`lcr_carrier_set_entry_sid` CHAR(36),
`workload` INTEGER NOT NULL DEFAULT 1,
`lcr_route_sid` CHAR(36) NOT NULL,
`voip_carrier_sid` CHAR(36) NOT NULL,
`priority` INTEGER NOT NULL DEFAULT 0,
PRIMARY KEY (`lcr_carrier_set_entry_sid`)
);
CREATE UNIQUE INDEX `applications_idx_name` ON `applications` (`account_sid`,`name`);
CREATE INDEX `applications_application_sid_idx` ON `applications` (`application_sid`);
@@ -290,10 +293,10 @@ ALTER TABLE `phone_numbers` ADD FOREIGN KEY account_sid_idxfk_3 (`account_sid`)
ALTER TABLE `phone_numbers` ADD FOREIGN KEY application_sid_idxfk_2 (`application_sid`) REFERENCES `applications` (`application_sid`);
CREATE UNIQUE INDEX `sip_gateways_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`);
ALTER TABLE `lcr_carrier_set_entry` ADD FOREIGN KEY voip_carrier_sid_idxfk_1 (`voip_carrier_sid`) REFERENCES `voip_carriers` (`voip_carrier_sid`);
CREATE UNIQUE INDEX `sip_gateways_sip_gateway_idx_hostport` ON `sip_gateways` (`ipv4`,`port`);
ALTER TABLE `sip_gateways` ADD FOREIGN KEY voip_carrier_sid_idxfk_2 (`voip_carrier_sid`) REFERENCES `voip_carriers` (`voip_carrier_sid`);
+46 -23
View File
@@ -48,7 +48,7 @@
<type><![CDATA[VARCHAR(255)]]></type>
<uid><![CDATA[7B5CFAB8-1489-4FCC-AA0F-8F5159C2A4E6]]></uid>
</SQLField>
<labelWindowIndex><![CDATA[13]]></labelWindowIndex>
<labelWindowIndex><![CDATA[16]]></labelWindowIndex>
<objectComment><![CDATA[An active sip registration]]></objectComment>
<ui.treeExpanded><![CDATA[1]]></ui.treeExpanded>
<uid><![CDATA[09D20234-503B-42B4-B34D-BDE7FC2FFA6E]]></uid>
@@ -93,7 +93,7 @@
<type><![CDATA[VARCHAR(255)]]></type>
<uid><![CDATA[4D191E4E-BAC3-4131-A06F-66CF45127D92]]></uid>
</SQLField>
<labelWindowIndex><![CDATA[12]]></labelWindowIndex>
<labelWindowIndex><![CDATA[15]]></labelWindowIndex>
<objectComment><![CDATA[A set of behaviors to be applied to parked calls]]></objectComment>
<ui.treeExpanded><![CDATA[1]]></ui.treeExpanded>
<uid><![CDATA[2FBA947F-0976-491E-B9DE-7812B44A663A]]></uid>
@@ -137,7 +137,7 @@
<type><![CDATA[VARCHAR(255)]]></type>
<uid><![CDATA[27E702F3-73ED-43F4-8B40-3C170AA17445]]></uid>
</SQLField>
<labelWindowIndex><![CDATA[1]]></labelWindowIndex>
<labelWindowIndex><![CDATA[4]]></labelWindowIndex>
<objectComment><![CDATA[An external organization that can provide sip trunking and DIDs]]></objectComment>
<ui.treeExpanded><![CDATA[1]]></ui.treeExpanded>
<uid><![CDATA[3D3136A7-AFC0-4A70-AEC3-68577955CA2E]]></uid>
@@ -202,7 +202,7 @@
<indexed><![CDATA[1]]></indexed>
<uid><![CDATA[3F553F20-AA47-471E-A650-0B4CEC9DCB0A]]></uid>
</SQLField>
<labelWindowIndex><![CDATA[11]]></labelWindowIndex>
<labelWindowIndex><![CDATA[14]]></labelWindowIndex>
<objectComment><![CDATA[An authorization token that is used to access the REST api]]></objectComment>
<ui.treeExpanded><![CDATA[1]]></ui.treeExpanded>
<uid><![CDATA[3EDF89A0-FD38-4DF9-BB65-E0FCD0A678BE]]></uid>
@@ -231,7 +231,7 @@
<unique><![CDATA[1]]></unique>
</SQLField>
<SQLField>
<name><![CDATA[order]]></name>
<name><![CDATA[priority]]></name>
<type><![CDATA[INTEGER]]></type>
<notNull><![CDATA[1]]></notNull>
<uid><![CDATA[C1C84C91-F37F-49E0-8D2E-681097AB92AB]]></uid>
@@ -272,7 +272,7 @@
<uid><![CDATA[9B4208B5-9E3B-4B76-B7F7-4E5D36B99BF2]]></uid>
<unsigned><![CDATA[0]]></unsigned>
</SQLField>
<labelWindowIndex><![CDATA[10]]></labelWindowIndex>
<labelWindowIndex><![CDATA[13]]></labelWindowIndex>
<ui.treeExpanded><![CDATA[1]]></ui.treeExpanded>
<uid><![CDATA[78584D93-2CD7-4495-9C5E-893C7B869133]]></uid>
</SQLTable>
@@ -337,7 +337,7 @@
<type><![CDATA[INTEGER]]></type>
<uid><![CDATA[96823D87-D5BE-4D15-BC31-BE44485DC303]]></uid>
</SQLField>
<labelWindowIndex><![CDATA[9]]></labelWindowIndex>
<labelWindowIndex><![CDATA[12]]></labelWindowIndex>
<objectComment><![CDATA[A relationship between a call and a queue that it is waiting in]]></objectComment>
<ui.treeExpanded><![CDATA[1]]></ui.treeExpanded>
<uid><![CDATA[8FA89482-40F1-46E5-8652-03CE22395A7B]]></uid>
@@ -403,6 +403,8 @@
<notNull><![CDATA[1]]></notNull>
<uid><![CDATA[01F61C68-799B-49B0-9E6A-0E2162EE5A54]]></uid>
</SQLField>
<labelWindowIndex><![CDATA[3]]></labelWindowIndex>
<ui.treeExpanded><![CDATA[1]]></ui.treeExpanded>
<uid><![CDATA[956025F5-0798-47F7-B76C-457814C7B52E]]></uid>
</SQLTable>
<SQLTable>
@@ -483,7 +485,7 @@
<notNull><![CDATA[1]]></notNull>
<uid><![CDATA[C7130A90-DBB4-424D-A9A9-CB203C32350C]]></uid>
</SQLField>
<labelWindowIndex><![CDATA[8]]></labelWindowIndex>
<labelWindowIndex><![CDATA[11]]></labelWindowIndex>
<objectComment><![CDATA[A single end-user of the platform]]></objectComment>
<ui.treeExpanded><![CDATA[1]]></ui.treeExpanded>
<uid><![CDATA[985D6997-B1A7-4AB3-80F4-4D59B45480C8]]></uid>
@@ -540,7 +542,7 @@
<type><![CDATA[VARCHAR(255)]]></type>
<uid><![CDATA[318884AC-2CC4-4975-9973-606D2E9206BD]]></uid>
</SQLField>
<labelWindowIndex><![CDATA[7]]></labelWindowIndex>
<labelWindowIndex><![CDATA[10]]></labelWindowIndex>
<objectComment><![CDATA[An active sip subscription]]></objectComment>
<ui.treeExpanded><![CDATA[1]]></ui.treeExpanded>
<uid><![CDATA[997ED97A-3E4E-4CDC-8F48-9C0FE9F913B2]]></uid>
@@ -775,7 +777,7 @@
<type><![CDATA[VARCHAR(255)]]></type>
<uid><![CDATA[47EBED41-CCBE-42F6-9615-78D44720ADED]]></uid>
</SQLField>
<labelWindowIndex><![CDATA[6]]></labelWindowIndex>
<labelWindowIndex><![CDATA[9]]></labelWindowIndex>
<objectComment><![CDATA[A phone call]]></objectComment>
<ui.treeExpanded><![CDATA[1]]></ui.treeExpanded>
<uid><![CDATA[A58DEB6C-A5C6-441A-8659-5BC27A53FB00]]></uid>
@@ -857,7 +859,7 @@
<uid><![CDATA[962CB80A-54CB-4C6A-9591-9BFC644CF80F]]></uid>
<unsigned><![CDATA[0]]></unsigned>
</SQLField>
<labelWindowIndex><![CDATA[5]]></labelWindowIndex>
<labelWindowIndex><![CDATA[8]]></labelWindowIndex>
<objectComment><![CDATA[A phone number that has been assigned to an account]]></objectComment>
<ui.treeExpanded><![CDATA[1]]></ui.treeExpanded>
<uid><![CDATA[BA650DDC-AC7B-4DFE-A5E5-828C75607807]]></uid>
@@ -915,7 +917,7 @@
<uid><![CDATA[E07F5855-50C6-4D6E-92EC-724E299B2CF5]]></uid>
<unsigned><![CDATA[0]]></unsigned>
</SQLField>
<labelWindowIndex><![CDATA[4]]></labelWindowIndex>
<labelWindowIndex><![CDATA[7]]></labelWindowIndex>
<objectComment><![CDATA[A relationship between a call and a conference that it is connected to]]></objectComment>
<ui.treeExpanded><![CDATA[1]]></ui.treeExpanded>
<uid><![CDATA[C415EB08-CA27-42B5-AE94-2681B6B6DC93]]></uid>
@@ -1002,6 +1004,8 @@
<indexType><![CDATA[UNIQUE]]></indexType>
<uid><![CDATA[1C744DE3-39BD-4EC6-B427-7EB2DD258771]]></uid>
</SQLIndex>
<labelWindowIndex><![CDATA[2]]></labelWindowIndex>
<ui.treeExpanded><![CDATA[1]]></ui.treeExpanded>
<uid><![CDATA[D8A564E2-DA41-4217-8ACE-06CF77E9BEC1]]></uid>
</SQLTable>
<SQLTable>
@@ -1044,7 +1048,7 @@
<type><![CDATA[VARCHAR(255)]]></type>
<uid><![CDATA[3FB439EC-7146-4A77-8204-AC4B38BE4825]]></uid>
</SQLField>
<labelWindowIndex><![CDATA[3]]></labelWindowIndex>
<labelWindowIndex><![CDATA[6]]></labelWindowIndex>
<objectComment><![CDATA[An audio conference]]></objectComment>
<ui.treeExpanded><![CDATA[1]]></ui.treeExpanded>
<uid><![CDATA[DAED2AAE-A146-4F09-809A-CC453E2CDFE9]]></uid>
@@ -1055,12 +1059,12 @@
<comment><![CDATA[A defined set of behaviors to be applied to phone calls within an account]]></comment>
<tableType><![CDATA[InnoDB]]></tableType>
<location>
<x>809.00</x>
<y>443.00</y>
<x>830.00</x>
<y>431.00</y>
</location>
<size>
<width>345.00</width>
<height>140.00</height>
<height>200.00</height>
</size>
<zorder>0</zorder>
<SQLField>
@@ -1108,6 +1112,23 @@
<notNull><![CDATA[1]]></notNull>
<uid><![CDATA[B22DE754-1A59-45BB-9650-F0B12F07393D]]></uid>
</SQLField>
<SQLField>
<name><![CDATA[hook_basic_auth_user]]></name>
<type><![CDATA[VARCHAR(255)]]></type>
<uid><![CDATA[B1F4D817-C8BF-47AA-81C3-257095D37335]]></uid>
</SQLField>
<SQLField>
<name><![CDATA[hook_basic_auth_password]]></name>
<type><![CDATA[VARCHAR(255)]]></type>
<uid><![CDATA[1E8D916B-AFB6-4AE2-A1EA-70DFA4FF459D]]></uid>
</SQLField>
<SQLField>
<name><![CDATA[hook_http_method]]></name>
<type><![CDATA[ENUM('get','post')]]></type>
<defaultValue><![CDATA[get]]></defaultValue>
<notNull><![CDATA[1]]></notNull>
<uid><![CDATA[19DB8C91-9309-4DA9-9D3D-279EF7036A7B]]></uid>
</SQLField>
<SQLIndex>
<name><![CDATA[applications_idx_name]]></name>
<fieldName><![CDATA[account_sid]]></fieldName>
@@ -1126,7 +1147,7 @@
<indexType><![CDATA[UNIQUE]]></indexType>
<uid><![CDATA[3FDDDF3B-375D-4DE4-B759-514438845F7D]]></uid>
</SQLIndex>
<labelWindowIndex><![CDATA[2]]></labelWindowIndex>
<labelWindowIndex><![CDATA[5]]></labelWindowIndex>
<objectComment><![CDATA[A defined set of behaviors to be applied to phone calls within an account]]></objectComment>
<ui.treeExpanded><![CDATA[1]]></ui.treeExpanded>
<uid><![CDATA[E97EE4F0-7ED7-4E8C-862E-D98192D6EAE0]]></uid>
@@ -1169,6 +1190,8 @@
<uid><![CDATA[B73773BA-AB1B-47AA-B995-2D2FE006198F]]></uid>
<unique><![CDATA[1]]></unique>
</SQLField>
<labelWindowIndex><![CDATA[1]]></labelWindowIndex>
<ui.treeExpanded><![CDATA[1]]></ui.treeExpanded>
<uid><![CDATA[F283D572-F670-4571-91FD-A665A9D3E15D]]></uid>
</SQLTable>
<SQLTable>
@@ -1250,17 +1273,17 @@
<overviewPanelHidden><![CDATA[0]]></overviewPanelHidden>
<pageBoundariesVisible><![CDATA[0]]></pageBoundariesVisible>
<PageGridVisible><![CDATA[0]]></PageGridVisible>
<RightSidebarWidth><![CDATA[2024.000000]]></RightSidebarWidth>
<RightSidebarWidth><![CDATA[1574.000000]]></RightSidebarWidth>
<sidebarIndex><![CDATA[2]]></sidebarIndex>
<snapToGrid><![CDATA[0]]></snapToGrid>
<SourceSidebarWidth><![CDATA[0.000000]]></SourceSidebarWidth>
<SQLEditorFileFormatVersion><![CDATA[4]]></SQLEditorFileFormatVersion>
<uid><![CDATA[58C99A00-06C9-478C-A667-C63842E088F3]]></uid>
<windowHeight><![CDATA[1417.000000]]></windowHeight>
<windowLocationX><![CDATA[2816.000000]]></windowLocationX>
<windowLocationY><![CDATA[-0.000000]]></windowLocationY>
<windowScrollOrigin><![CDATA[{0, 0}]]></windowScrollOrigin>
<windowWidth><![CDATA[2301.000000]]></windowWidth>
<windowHeight><![CDATA[1641.000000]]></windowHeight>
<windowLocationX><![CDATA[1108.000000]]></windowLocationX>
<windowLocationY><![CDATA[-15.000000]]></windowLocationY>
<windowScrollOrigin><![CDATA[{136.5, 0}]]></windowScrollOrigin>
<windowWidth><![CDATA[1851.000000]]></windowWidth>
</SQLDocumentInfo>
<AllowsIndexRenamingOnInsert><![CDATA[1]]></AllowsIndexRenamingOnInsert>
<defaultLabelExpanded><![CDATA[1]]></defaultLabelExpanded>
+8
View File
@@ -71,6 +71,14 @@ Account.fields = [
{
name: 'registration_hook',
type: 'string',
},
{
name: 'hook_basic_auth_user',
type: 'string',
},
{
name: 'hook_basic_auth_password',
type: 'string',
}
];
+12
View File
@@ -90,6 +90,18 @@ Application.fields = [
name: 'call_status_hook',
type: 'string',
required: true
},
{
name: 'hook_basic_auth_user',
type: 'string',
},
{
name: 'hook_basic_auth_password',
type: 'string',
},
{
name: 'hook_http_method',
type: 'string',
}
];
+24
View File
@@ -929,6 +929,18 @@ paths:
type: string
format: url
description: webhook to pass call status updates to
hook_basic_auth_user:
type: string
description: username to use for http basic auth when calling hook
hook_basic_auth_password:
type: string
description: password to use for http basic auth when calling hook
hook_http_method:
type: string
description: whether to use GET or POST
enum:
- get
- post
required:
- name
- account_sid
@@ -1263,6 +1275,18 @@ components:
call_status_hook:
type: string
format: url
hook_http_method:
type: string
enum:
- get
- post
default: get
hook_basic_auth_user:
type: string
format: url
hook_basic_auth_password:
type: string
format: url
required:
- application_sid
- name