Files
go-sip/contracts/schema/http-sip.schema.json
T

137 lines
3.0 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://go-sip.local/contracts/schema/http-sip.schema.json",
"title": "GET /internal/v1/dispatcher/sip response; external SaaS compatibility unverified",
"oneOf": [
{
"type": "object",
"additionalProperties": false,
"required": [
"resource",
"dispatcher_id",
"trunks"
],
"properties": {
"resource": {
"const": "sip_config"
},
"dispatcher_id": {
"$ref": "./common.schema.json#/$defs/dispatcher_id"
},
"revision": {
"type": "integer",
"minimum": 1
},
"trunks": {
"type": "array",
"items": {
"$ref": "#/$defs/trunk"
}
}
}
},
{
"$ref": "./common.schema.json#/$defs/error"
}
],
"$defs": {
"trunk": {
"type": "object",
"additionalProperties": false,
"required": [
"trunk_id",
"provider_id",
"codec",
"dial_prefix",
"enabled",
"server_host",
"server_port",
"transport",
"auth_mode",
"registration_required",
"max_concurrent_calls",
"caller_id",
"schedule"
],
"properties": {
"trunk_id": {
"type": "string",
"minLength": 1
},
"provider_id": {
"type": "string",
"minLength": 1
},
"codec": {
"const": "PCMA"
},
"dial_prefix": {
"type": "string"
},
"enabled": {
"type": "boolean"
},
"server_host": {
"type": "string",
"minLength": 1
},
"server_port": {
"type": "integer",
"minimum": 1,
"maximum": 65535
},
"transport": {
"type": [
"string",
"null"
],
"pattern": "^(?:[uU][dD][pP]|[tT][cC][pP]|[tT][lL][sS])$"
},
"auth_mode": {
"type": [
"string",
"null"
],
"pattern": "^(?:[iI][pP]|[dD][iI][gG][eE][sS][tT]|[nN][oO][nN][eE])$"
},
"registration_required": {
"type": [
"boolean",
"null"
]
},
"max_concurrent_calls": {
"type": [
"integer",
"null"
],
"minimum": 1
},
"caller_id": {
"type": "string",
"pattern": "^[A-Za-z0-9][A-Za-z0-9._+-]{0,63}$"
},
"schedule": {
"$ref": "#/$defs/weekly_schedule"
}
}
},
"weekly_schedule": {
"type": "object",
"additionalProperties": false,
"required": [
"time_zone",
"weekly_windows"
],
"properties": {
"time_zone": {
"const": "Asia/Shanghai"
},
"weekly_windows": {
"$ref": "./common.schema.json#/$defs/weekly_windows"
}
}
}
}
}