diff --git a/LICENSE b/LICENSE index 23369fa8..fe011cb1 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2021 Drachtio Communications Services, LLC +Copyright (c) 2018-2024 FirstFive8, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/db/jambones-sql.sql b/db/jambones-sql.sql index 31ac4d40..2f367f24 100644 --- a/db/jambones-sql.sql +++ b/db/jambones-sql.sql @@ -459,6 +459,7 @@ outbound BOOLEAN NOT NULL COMMENT 'if true, include in least-cost routing when p voip_carrier_sid CHAR(36) NOT NULL, is_active BOOLEAN NOT NULL DEFAULT 1, send_options_ping BOOLEAN NOT NULL DEFAULT 0, +use_sips_scheme BOOLEAN NOT NULL DEFAULT 0, pad_crypto BOOLEAN NOT NULL DEFAULT 0, protocol ENUM('udp','tcp','tls', 'tls/srtp') DEFAULT 'udp' COMMENT 'Outbound call protocol', PRIMARY KEY (sip_gateway_sid) diff --git a/db/jambones.sqs b/db/jambones.sqs index 10ad2846..cad0be22 100644 --- a/db/jambones.sqs +++ b/db/jambones.sqs @@ -2332,7 +2332,7 @@ 281.00 - 260.00 + 280.00 7 @@ -2406,6 +2406,13 @@ + + + + + + + @@ -3111,11 +3118,11 @@ - - - + + + - + diff --git a/db/upgrade-jambonz-db.js b/db/upgrade-jambonz-db.js index ec81e588..28c69d0a 100644 --- a/db/upgrade-jambonz-db.js +++ b/db/upgrade-jambonz-db.js @@ -196,6 +196,7 @@ const sql = { 'ALTER TABLE sip_gateways ADD COLUMN send_options_ping BOOLEAN NOT NULL DEFAULT 0', 'ALTER TABLE applications MODIFY COLUMN speech_synthesis_voice VARCHAR(256)', 'ALTER TABLE applications MODIFY COLUMN fallback_speech_synthesis_voice VARCHAR(256)', + 'ALTER TABLE sip_gateways ADD COLUMN use_sips_scheme BOOLEAN NOT NULL DEFAULT 0', ] }; diff --git a/test/sip-gateways.js b/test/sip-gateways.js index 8f6e17ff..7278c5e2 100644 --- a/test/sip-gateways.js +++ b/test/sip-gateways.js @@ -75,6 +75,44 @@ test('sip gateway tests', async(t) => { }); //console.log(`result: ${JSON.stringify(result)}`); t.ok(result.statusCode === 204, 'successfully deleted sip gateway'); + + /* add a sip gateway */ + result = await request.post('/SipGateways', { + resolveWithFullResponse: true, + auth: authAdmin, + json: true, + body: { + voip_carrier_sid, + ipv4: '192.168.1.2', + netmask: 32, + inbound: true, + outbound: true, + protocol: 'tls', + use_sips_scheme: true + } + }); + t.ok(result.statusCode === 201, 'successfully created sip gateway '); + const sipsSid = result.body.sid; + + /* query one sip gateway */ + result = await request.get(`/SipGateways/${sipsSid}`, { + auth: authAdmin, + json: true, + }); + //console.log(`result: ${JSON.stringify(result)}`); + t.ok(result.ipv4 === '192.168.1.2' , 'successfully retrieved voip carrier by sid'); + t.ok(result.protocol === 'tls' , 'successfully retrieved voip carrier by sid'); + t.ok(result.use_sips_scheme, 'successfully retrieved voip carrier by sid'); + + /* delete sip gateways */ + result = await request.delete(`/SipGateways/${sipsSid}`, { + resolveWithFullResponse: true, + simple: false, + json: true, + auth: authAdmin + }); + //console.log(`result: ${JSON.stringify(result)}`); + t.ok(result.statusCode === 204, 'successfully deleted sip gateway'); await deleteObjectBySid(request, '/VoipCarriers', voip_carrier_sid);