mirror of
https://github.com/jambonz/jambonz-api-server.git
synced 2025-12-19 05:47:46 +00:00
support use sips scheme for outbound tls gateway (#332)
* support use sips scheme for outbound tls gateway * support use sips scheme for outbound tls gateway * update license
This commit is contained in:
2
LICENSE
2
LICENSE
@@ -1,6 +1,6 @@
|
|||||||
MIT License
|
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
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|||||||
@@ -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,
|
voip_carrier_sid CHAR(36) NOT NULL,
|
||||||
is_active BOOLEAN NOT NULL DEFAULT 1,
|
is_active BOOLEAN NOT NULL DEFAULT 1,
|
||||||
send_options_ping BOOLEAN NOT NULL DEFAULT 0,
|
send_options_ping BOOLEAN NOT NULL DEFAULT 0,
|
||||||
|
use_sips_scheme BOOLEAN NOT NULL DEFAULT 0,
|
||||||
pad_crypto 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',
|
protocol ENUM('udp','tcp','tls', 'tls/srtp') DEFAULT 'udp' COMMENT 'Outbound call protocol',
|
||||||
PRIMARY KEY (sip_gateway_sid)
|
PRIMARY KEY (sip_gateway_sid)
|
||||||
|
|||||||
@@ -2332,7 +2332,7 @@
|
|||||||
</location>
|
</location>
|
||||||
<size>
|
<size>
|
||||||
<width>281.00</width>
|
<width>281.00</width>
|
||||||
<height>260.00</height>
|
<height>280.00</height>
|
||||||
</size>
|
</size>
|
||||||
<zorder>7</zorder>
|
<zorder>7</zorder>
|
||||||
<SQLField>
|
<SQLField>
|
||||||
@@ -2406,6 +2406,13 @@
|
|||||||
<notNull><![CDATA[1]]></notNull>
|
<notNull><![CDATA[1]]></notNull>
|
||||||
<uid><![CDATA[E04C19A2-12BF-443F-AB61-96990224A18D]]></uid>
|
<uid><![CDATA[E04C19A2-12BF-443F-AB61-96990224A18D]]></uid>
|
||||||
</SQLField>
|
</SQLField>
|
||||||
|
<SQLField>
|
||||||
|
<name><![CDATA[use_sips_scheme]]></name>
|
||||||
|
<type><![CDATA[BOOLEAN]]></type>
|
||||||
|
<defaultValue><![CDATA[0]]></defaultValue>
|
||||||
|
<notNull><![CDATA[1]]></notNull>
|
||||||
|
<uid><![CDATA[5DCBDD48-913B-4580-B78C-9B06C939FEA8]]></uid>
|
||||||
|
</SQLField>
|
||||||
<SQLField>
|
<SQLField>
|
||||||
<name><![CDATA[pad_crypto]]></name>
|
<name><![CDATA[pad_crypto]]></name>
|
||||||
<type><![CDATA[BOOLEAN]]></type>
|
<type><![CDATA[BOOLEAN]]></type>
|
||||||
@@ -3111,11 +3118,11 @@
|
|||||||
<SourceSidebarWidth><![CDATA[312.000000]]></SourceSidebarWidth>
|
<SourceSidebarWidth><![CDATA[312.000000]]></SourceSidebarWidth>
|
||||||
<SQLEditorFileFormatVersion><![CDATA[4]]></SQLEditorFileFormatVersion>
|
<SQLEditorFileFormatVersion><![CDATA[4]]></SQLEditorFileFormatVersion>
|
||||||
<uid><![CDATA[58C99A00-06C9-478C-A667-C63842E088F3]]></uid>
|
<uid><![CDATA[58C99A00-06C9-478C-A667-C63842E088F3]]></uid>
|
||||||
<windowHeight><![CDATA[1027.000000]]></windowHeight>
|
<windowHeight><![CDATA[1079.000000]]></windowHeight>
|
||||||
<windowLocationX><![CDATA[1728.000000]]></windowLocationX>
|
<windowLocationX><![CDATA[0.000000]]></windowLocationX>
|
||||||
<windowLocationY><![CDATA[65.000000]]></windowLocationY>
|
<windowLocationY><![CDATA[0.000000]]></windowLocationY>
|
||||||
<windowScrollOrigin><![CDATA[{1, 0}]]></windowScrollOrigin>
|
<windowScrollOrigin><![CDATA[{1, 0}]]></windowScrollOrigin>
|
||||||
<windowWidth><![CDATA[1675.000000]]></windowWidth>
|
<windowWidth><![CDATA[1676.000000]]></windowWidth>
|
||||||
</SQLDocumentInfo>
|
</SQLDocumentInfo>
|
||||||
<AllowsIndexRenamingOnInsert><![CDATA[1]]></AllowsIndexRenamingOnInsert>
|
<AllowsIndexRenamingOnInsert><![CDATA[1]]></AllowsIndexRenamingOnInsert>
|
||||||
<defaultLabelExpanded><![CDATA[1]]></defaultLabelExpanded>
|
<defaultLabelExpanded><![CDATA[1]]></defaultLabelExpanded>
|
||||||
|
|||||||
@@ -196,6 +196,7 @@ const sql = {
|
|||||||
'ALTER TABLE sip_gateways ADD COLUMN send_options_ping BOOLEAN NOT NULL DEFAULT 0',
|
'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 speech_synthesis_voice VARCHAR(256)',
|
||||||
'ALTER TABLE applications MODIFY COLUMN fallback_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',
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -76,6 +76,44 @@ test('sip gateway tests', async(t) => {
|
|||||||
//console.log(`result: ${JSON.stringify(result)}`);
|
//console.log(`result: ${JSON.stringify(result)}`);
|
||||||
t.ok(result.statusCode === 204, 'successfully deleted sip gateway');
|
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);
|
await deleteObjectBySid(request, '/VoipCarriers', voip_carrier_sid);
|
||||||
|
|
||||||
t.end();
|
t.end();
|
||||||
|
|||||||
Reference in New Issue
Block a user