mirror of
https://github.com/jambonz/jambonz-webapp.git
synced 2025-12-19 05:37:43 +00:00
require IP auth trunk to have either inbound or outbound carrier (#579)
also cleaned up wordig to be consistent `IP Trunk` not `Static IP Whitelist`
This commit is contained in:
@@ -463,24 +463,18 @@ export const CarrierForm = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const getSipValidation = () => {
|
const getSipValidation = () => {
|
||||||
if (sipInboundGateways.length === 0 && sipOutboundGateways.length === 0) {
|
if (
|
||||||
if (trunkType === "static_ip") {
|
trunkType === "static_ip" &&
|
||||||
setActiveTab("inbound");
|
sipInboundGateways.length === 0 &&
|
||||||
return "Static IP Whitelist trunk type requires at least one inbound gateway.";
|
sipOutboundGateways.length === 0
|
||||||
} else if (trunkType === "reg") {
|
) {
|
||||||
setActiveTab("outbound");
|
setActiveTab("general");
|
||||||
return "Registration trunk type requires at least one outbound gateway.";
|
return "IP Trunk type requires at least one inbound or outbound gateway.";
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (trunkType === "static_ip" && sipInboundGateways.length < 1) {
|
|
||||||
setActiveTab("inbound");
|
|
||||||
return "Static IP Whitelist trunk type requires at least one inbound gateway.";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (trunkType === "reg" && sipOutboundGateways.length < 1) {
|
if (trunkType === "reg" && sipOutboundGateways.length < 1) {
|
||||||
setActiveTab("outbound");
|
setActiveTab("outbound");
|
||||||
return "Registration trunk type requires at least one outbound gateway.";
|
return "Registration Trunk type requires at least one outbound gateway.";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate Auth Trunk credentials
|
// Validate Auth Trunk credentials
|
||||||
@@ -701,9 +695,11 @@ export const CarrierForm = ({
|
|||||||
if (sipGatewayValidation) {
|
if (sipGatewayValidation) {
|
||||||
if (
|
if (
|
||||||
sipGatewayValidation ===
|
sipGatewayValidation ===
|
||||||
"Static IP Whitelist trunk type requires at least one inbound gateway."
|
"IP Trunk type requires at least one inbound or outbound gateway."
|
||||||
) {
|
) {
|
||||||
setSipInboundMessage(sipGatewayValidation);
|
setSipInboundMessage(sipGatewayValidation);
|
||||||
|
setSipOutboundMessage(sipGatewayValidation);
|
||||||
|
toastError(sipGatewayValidation);
|
||||||
} else if (
|
} else if (
|
||||||
sipGatewayValidation ===
|
sipGatewayValidation ===
|
||||||
"Auth Trunk requires both username and password credentials."
|
"Auth Trunk requires both username and password credentials."
|
||||||
@@ -711,7 +707,7 @@ export const CarrierForm = ({
|
|||||||
setSipInboundMessage(sipGatewayValidation);
|
setSipInboundMessage(sipGatewayValidation);
|
||||||
} else if (
|
} else if (
|
||||||
sipGatewayValidation ===
|
sipGatewayValidation ===
|
||||||
"Registration trunk type requires at least one outbound gateway."
|
"Registration Trunk type requires at least one outbound gateway."
|
||||||
) {
|
) {
|
||||||
setSipOutboundMessage(sipGatewayValidation);
|
setSipOutboundMessage(sipGatewayValidation);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user