Merge branch 'main' into feat/playht30

This commit is contained in:
Hoan Luu Huu
2024-10-10 10:38:13 +07:00
committed by GitHub
7 changed files with 49 additions and 22 deletions

View File

@@ -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 pat';
) COMMENT='An ordered list of digit patterns in an LCR table. The patterns are tested in sequence until one matches';
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 ';
) 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
(
@@ -359,7 +359,8 @@ CREATE TABLE system_information
domain_name VARCHAR(255),
sip_domain_name VARCHAR(255),
monitoring_domain_name VARCHAR(255),
private_network_cidr VARCHAR(8192)
private_network_cidr VARCHAR(8192),
log_level ENUM('info', 'debug') NOT NULL DEFAULT 'info'
);
CREATE TABLE users
@@ -553,6 +554,7 @@ 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',
enable_debug_log BOOLEAN NOT NULL DEFAULT false,
PRIMARY KEY (account_sid)
) COMMENT='An enterprise that uses the platform for comm services';

File diff suppressed because one or more lines are too long

View File

@@ -200,6 +200,8 @@ const sql = {
],
9002: [
'ALTER TABLE system_information ADD COLUMN private_network_cidr VARCHAR(8192)',
'ALTER TABLE system_information ADD COLUMN log_level ENUM(\'info\', \'debug\') NOT NULL DEFAULT \'info\'',
'ALTER TABLE accounts ADD COLUMN enable_debug_log BOOLEAN NOT NULL DEFAULT false',
]
};

8
package-lock.json generated
View File

@@ -19,7 +19,7 @@
"@jambonz/lamejs": "^1.2.2",
"@jambonz/mw-registrar": "^0.2.7",
"@jambonz/realtimedb-helpers": "^0.8.10",
"@jambonz/speech-utils": "^0.1.13",
"@jambonz/speech-utils": "^0.1.17",
"@jambonz/time-series": "^0.2.8",
"@jambonz/verb-specifications": "^0.0.72",
"@soniox/soniox-node": "^1.2.2",
@@ -2223,9 +2223,9 @@
}
},
"node_modules/@jambonz/speech-utils": {
"version": "0.1.13",
"resolved": "https://registry.npmjs.org/@jambonz/speech-utils/-/speech-utils-0.1.13.tgz",
"integrity": "sha512-QeVmNFLtJGPGQfmp7jXpy742AyJIv2EteelDmNTqWGFEwTBj88q8GLP51hUsIR2ZbE5n/ZmZb/ytT6Y6LIQSDg==",
"version": "0.1.17",
"resolved": "https://registry.npmjs.org/@jambonz/speech-utils/-/speech-utils-0.1.17.tgz",
"integrity": "sha512-H5v0WAamoOJ70fNH2EOvIOvvyz9Mme1uwLlv9qx1jZ3u+Ag+mAyXQUN27Q/QHivpcFdl6s4no5iSYUb/3Z12xQ==",
"license": "MIT",
"dependencies": {
"@aws-sdk/client-polly": "^3.496.0",

View File

@@ -29,7 +29,7 @@
"@jambonz/lamejs": "^1.2.2",
"@jambonz/mw-registrar": "^0.2.7",
"@jambonz/realtimedb-helpers": "^0.8.10",
"@jambonz/speech-utils": "^0.1.13",
"@jambonz/speech-utils": "^0.1.17",
"@jambonz/time-series": "^0.2.8",
"@jambonz/verb-specifications": "^0.0.72",
"@soniox/soniox-node": "^1.2.2",

View File

@@ -152,7 +152,9 @@ test('account tests', async(t) => {
auth: authAdmin,
json: true,
});
console.log(result);
t.ok(result.name === 'daveh' , 'successfully retrieved account by sid');
t.ok(result.enable_debug_log === 0 , 'enable_debug_log default value ok');
/* update account with account level token */
result = await request.put(`/Accounts/${sid}`, {
@@ -177,8 +179,8 @@ test('account tests', async(t) => {
name: 'recordings',
access_key_id: 'access_key_id',
secret_access_key: 'secret access key'
}
},
enable_debug_log: true
}
});
t.ok(result.statusCode === 204, 'successfully updated account using account level token');
@@ -194,6 +196,7 @@ test('account tests', async(t) => {
t.ok(result.bucket_credential.access_key_id === 'access_key_id', 'bucket_access_key_id was updated');
t.ok(result.record_all_calls === 1, 'record_all_calls was updated');
t.ok(result.record_format === 'wav', 'record_format was updated');
t.ok(result.enable_debug_log, 'enable_debug_log was updated');
/* verify that account level api key last_used was updated*/
result = await request.get(`/Accounts/${sid}/ApiKeys`, {

View File

@@ -17,7 +17,8 @@ test('system information test', async(t) => {
domain_name: 'test.com',
sip_domain_name: 'sip.test.com',
monitoring_domain_name: 'monitor.test.com',
private_network_cidr: '192.168.1.0/24, 10.10.100.1'
private_network_cidr: '192.168.1.0/24, 10.10.100.1',
log_level: 'info'
}
});
t.ok(result.statusCode === 201, 'successfully created system information ');
@@ -26,6 +27,7 @@ test('system information test', async(t) => {
t.ok(body.sip_domain_name === 'sip.test.com', 'added sip_domain_name ok');
t.ok(body.monitoring_domain_name === 'monitor.test.com', 'added monitoring_domain_name ok');
t.ok(body.private_network_cidr === '192.168.1.0/24, 10.10.100.1', 'added private_network_cidr ok');
t.ok(body.log_level === 'info', 'added log_level ok');
result = await request.get('/SystemInformation', {
auth: authAdmin,
@@ -35,6 +37,7 @@ test('system information test', async(t) => {
t.ok(result.sip_domain_name === 'sip.test.com', 'get sip_domain_name ok');
t.ok(result.monitoring_domain_name === 'monitor.test.com', 'get monitoring_domain_name ok');
t.ok(result.private_network_cidr === '192.168.1.0/24, 10.10.100.1', 'get private_network_cidr ok');
t.ok(result.log_level === 'info', 'added log_level ok');
result = await request.post('/SystemInformation', {
resolveWithFullResponse: true,
@@ -44,7 +47,8 @@ test('system information test', async(t) => {
domain_name: 'test1.com',
sip_domain_name: 'sip1.test.com',
monitoring_domain_name: 'monitor1.test.com',
private_network_cidr: ''
private_network_cidr: '',
log_level: 'debug'
}
});
t.ok(result.statusCode === 201, 'successfully updated system information ');
@@ -53,6 +57,7 @@ test('system information test', async(t) => {
t.ok(body.sip_domain_name === 'sip1.test.com', 'updated sip_domain_name ok');
t.ok(body.monitoring_domain_name === 'monitor1.test.com', 'updated monitoring_domain_name ok');
t.ok(body.private_network_cidr === '', 'updated private_network_cidr ok');
t.ok(body.log_level === 'debug', 'updated log_level ok');
result = await request.get('/SystemInformation', {
auth: authAdmin,
@@ -61,6 +66,7 @@ test('system information test', async(t) => {
t.ok(result.domain_name === 'test1.com', 'get domain_name ok');
t.ok(result.sip_domain_name === 'sip1.test.com', 'get sip_domain_name ok');
t.ok(result.monitoring_domain_name === 'monitor1.test.com', 'get monitoring_domain_name ok');
t.ok(result.log_level === 'debug', 'updated log_level ok');
} catch(err) {
console.error(err);