mirror of
https://github.com/jambonz/jambonz-api-server.git
synced 2025-12-19 05:47:46 +00:00
* #361 * fix typo in db upgrade script --------- Co-authored-by: Hoan Luu Huu <110280845+xquanluu@users.noreply.github.com>
This commit is contained in:
@@ -162,7 +162,7 @@ regex VARCHAR(32) NOT NULL COMMENT 'regex-based pattern match against dialed num
|
||||
description VARCHAR(1024),
|
||||
priority INTEGER NOT NULL COMMENT 'lower priority routes are attempted first',
|
||||
PRIMARY KEY (lcr_route_sid)
|
||||
) COMMENT='An ordered list of digit patterns in an LCR table. The patterns are tested in sequence until one matches';
|
||||
) COMMENT='An ordered list of digit patterns in an LCR table. The pat';
|
||||
|
||||
CREATE TABLE lcr
|
||||
(
|
||||
@@ -173,7 +173,7 @@ default_carrier_set_entry_sid CHAR(36) COMMENT 'default carrier/route to use whe
|
||||
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.';
|
||||
) COMMENT='An LCR (least cost routing) table that is used by a service ';
|
||||
|
||||
CREATE TABLE password_settings
|
||||
(
|
||||
@@ -416,6 +416,7 @@ register_from_user VARCHAR(128),
|
||||
register_from_domain VARCHAR(255),
|
||||
register_public_ip_in_contact BOOLEAN NOT NULL DEFAULT false,
|
||||
register_status VARCHAR(4096),
|
||||
dtmf_type ENUM('rfc2833','tones','info') NOT NULL DEFAULT 'rfc2833',
|
||||
PRIMARY KEY (voip_carrier_sid)
|
||||
) COMMENT='A Carrier or customer PBX that can send or receive calls';
|
||||
|
||||
|
||||
@@ -551,7 +551,7 @@
|
||||
</location>
|
||||
<size>
|
||||
<width>293.00</width>
|
||||
<height>540.00</height>
|
||||
<height>560.00</height>
|
||||
</size>
|
||||
<zorder>6</zorder>
|
||||
<SQLField>
|
||||
@@ -737,6 +737,13 @@
|
||||
<type><![CDATA[VARCHAR(4096)]]></type>
|
||||
<uid><![CDATA[7C7DFE92-D7AC-4447-A1C2-E0F10C1EA26A]]></uid>
|
||||
</SQLField>
|
||||
<SQLField>
|
||||
<name><![CDATA[dtmf_type]]></name>
|
||||
<type><![CDATA[ENUM('rfc2833','tones','info')]]></type>
|
||||
<defaultValue><![CDATA[rfc2833]]></defaultValue>
|
||||
<notNull><![CDATA[1]]></notNull>
|
||||
<uid><![CDATA[87355F68-CC01-4B7C-855A-976CE634634D]]></uid>
|
||||
</SQLField>
|
||||
<labelWindowIndex><![CDATA[28]]></labelWindowIndex>
|
||||
<objectComment><![CDATA[A Carrier or customer PBX that can send or receive calls]]></objectComment>
|
||||
<ui.treeExpanded><![CDATA[1]]></ui.treeExpanded>
|
||||
@@ -1280,8 +1287,8 @@
|
||||
<schema><![CDATA[]]></schema>
|
||||
<comment><![CDATA[a regex-based pattern match for call routing]]></comment>
|
||||
<location>
|
||||
<x>31.00</x>
|
||||
<y>983.00</y>
|
||||
<x>25.00</x>
|
||||
<y>997.00</y>
|
||||
</location>
|
||||
<size>
|
||||
<width>254.00</width>
|
||||
@@ -3144,17 +3151,17 @@
|
||||
<overviewPanelHidden><![CDATA[0]]></overviewPanelHidden>
|
||||
<pageBoundariesVisible><![CDATA[0]]></pageBoundariesVisible>
|
||||
<PageGridVisible><![CDATA[0]]></PageGridVisible>
|
||||
<RightSidebarWidth><![CDATA[1403.000000]]></RightSidebarWidth>
|
||||
<RightSidebarWidth><![CDATA[1235.000000]]></RightSidebarWidth>
|
||||
<sidebarIndex><![CDATA[2]]></sidebarIndex>
|
||||
<snapToGrid><![CDATA[0]]></snapToGrid>
|
||||
<SourceSidebarWidth><![CDATA[312.000000]]></SourceSidebarWidth>
|
||||
<SourceSidebarWidth><![CDATA[0.000000]]></SourceSidebarWidth>
|
||||
<SQLEditorFileFormatVersion><![CDATA[4]]></SQLEditorFileFormatVersion>
|
||||
<uid><![CDATA[58C99A00-06C9-478C-A667-C63842E088F3]]></uid>
|
||||
<windowHeight><![CDATA[1079.000000]]></windowHeight>
|
||||
<windowLocationX><![CDATA[48.000000]]></windowLocationX>
|
||||
<windowLocationY><![CDATA[0.000000]]></windowLocationY>
|
||||
<windowScrollOrigin><![CDATA[{969, 523}]]></windowScrollOrigin>
|
||||
<windowWidth><![CDATA[1680.000000]]></windowWidth>
|
||||
<windowHeight><![CDATA[871.000000]]></windowHeight>
|
||||
<windowLocationX><![CDATA[-1516.000000]]></windowLocationX>
|
||||
<windowLocationY><![CDATA[1121.000000]]></windowLocationY>
|
||||
<windowScrollOrigin><![CDATA[{10, 338}]]></windowScrollOrigin>
|
||||
<windowWidth><![CDATA[1512.000000]]></windowWidth>
|
||||
</SQLDocumentInfo>
|
||||
<AllowsIndexRenamingOnInsert><![CDATA[1]]></AllowsIndexRenamingOnInsert>
|
||||
<defaultLabelExpanded><![CDATA[1]]></defaultLabelExpanded>
|
||||
|
||||
@@ -204,6 +204,11 @@ const sql = {
|
||||
'ALTER TABLE accounts ADD COLUMN enable_debug_log BOOLEAN NOT NULL DEFAULT false',
|
||||
'ALTER TABLE google_custom_voices ADD COLUMN use_voice_cloning_key BOOLEAN DEFAULT false',
|
||||
'ALTER TABLE google_custom_voices ADD COLUMN voice_cloning_key MEDIUMTEXT',
|
||||
],
|
||||
9003: [
|
||||
'ALTER TABLE google_custom_voices ADD COLUMN voice_cloning_key MEDIUMTEXT',
|
||||
'ALTER TABLE google_custom_voices ADD COLUMN use_voice_cloning_key BOOLEAN DEFAULT false',
|
||||
'ALTER TABLE voip_carriers ADD COLUMN dtmf_type ENUM(\'rfc2833\',\'tones\',\'info\') NOT NULL DEFAULT \'rfc2833\'',
|
||||
]
|
||||
};
|
||||
|
||||
@@ -238,6 +243,7 @@ const doIt = async() => {
|
||||
if (val < 8005) upgrades.push(...sql['8005']);
|
||||
if (val < 9000) upgrades.push(...sql['9000']);
|
||||
if (val < 9002) upgrades.push(...sql['9002']);
|
||||
if (val < 9003) upgrades.push(...sql['9003']);
|
||||
|
||||
// perform all upgrades
|
||||
logger.info({upgrades}, 'applying schema upgrades..');
|
||||
|
||||
@@ -136,6 +136,10 @@ VoipCarrier.fields = [
|
||||
{
|
||||
name: 'register_status',
|
||||
type: 'string'
|
||||
},
|
||||
{
|
||||
name: 'dtmf_type',
|
||||
type: 'string'
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
@@ -24,16 +24,24 @@ function makeSynthKey({account_sid = '', vendor, language, voice, engine = '', t
|
||||
test('tts-cache', async(t) => {
|
||||
const app = require('../app');
|
||||
try {
|
||||
// clear cache to start
|
||||
let result = await request.delete('/TtsCache', {
|
||||
auth: authAdmin,
|
||||
resolveWithFullResponse: true,
|
||||
});
|
||||
t.ok(result.statusCode === 204, 'successfully purged cache for start of test');
|
||||
|
||||
// create caches
|
||||
const minRecords = 8;
|
||||
for (const i in Array(minRecords).fill(0)) {
|
||||
await client.set(makeSynthKey({vendor: i, language: i, voice: i, engine: i, text: i}), i);
|
||||
}
|
||||
|
||||
let result = await request.get('/TtsCache', {
|
||||
result = await request.get('/TtsCache', {
|
||||
auth: authAdmin,
|
||||
json: true,
|
||||
});
|
||||
//console.log(result);
|
||||
|
||||
t.ok(result.size === minRecords, 'get cache correctly');
|
||||
|
||||
@@ -41,7 +49,7 @@ test('tts-cache', async(t) => {
|
||||
auth: authAdmin,
|
||||
resolveWithFullResponse: true,
|
||||
});
|
||||
t.ok(result.statusCode === 204, 'successfully deleted application after removing phone number');
|
||||
t.ok(result.statusCode === 204, 'successfully purged cache');
|
||||
|
||||
result = await request.get('/TtsCache', {
|
||||
auth: authAdmin,
|
||||
|
||||
@@ -207,7 +207,8 @@ test('voip carrier tests', async(t) => {
|
||||
json: true,
|
||||
body: {
|
||||
name: 'twilio',
|
||||
e164_leading_plus: true
|
||||
e164_leading_plus: true,
|
||||
dtmf_type: 'tones'
|
||||
}
|
||||
});
|
||||
t.ok(result.statusCode === 201, 'successfully created voip carrier for a service provider');
|
||||
@@ -221,6 +222,7 @@ test('voip carrier tests', async(t) => {
|
||||
});
|
||||
//console.log(result.body);
|
||||
t.ok(result.statusCode === 200, 'successfully retrieved voip carrier for a service provider');
|
||||
//console.log(result.body);
|
||||
sid = result.body[0].voip_carrier_sid;
|
||||
|
||||
await deleteObjectBySid(request, '/VoipCarriers', sid);
|
||||
|
||||
Reference in New Issue
Block a user