364 lines
7.6 KiB
JSON
364 lines
7.6 KiB
JSON
{
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"$id": "https://go-sip.local/contracts/proposals/static-cell-artifact-v0.2.schema.json",
|
|
"title": "Project-owned v1 static Cell/SIP hand-off artifact",
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"artifact_id",
|
|
"source_release",
|
|
"source_digest",
|
|
"approval_reference",
|
|
"cell_id",
|
|
"revision",
|
|
"config_sha256",
|
|
"mode",
|
|
"allowed_targets",
|
|
"trunks"
|
|
],
|
|
"properties": {
|
|
"artifact_id": {
|
|
"type": "string",
|
|
"minLength": 1,
|
|
"maxLength": 128
|
|
},
|
|
"source_release": {
|
|
"type": "string",
|
|
"minLength": 1,
|
|
"maxLength": 128
|
|
},
|
|
"source_digest": {
|
|
"type": "string",
|
|
"pattern": "^[a-f0-9]{64}$"
|
|
},
|
|
"approval_reference": {
|
|
"type": "string",
|
|
"minLength": 1,
|
|
"maxLength": 256
|
|
},
|
|
"cell_id": {
|
|
"type": "string",
|
|
"minLength": 1,
|
|
"maxLength": 128
|
|
},
|
|
"revision": {
|
|
"type": "integer",
|
|
"minimum": 1
|
|
},
|
|
"config_sha256": {
|
|
"type": "string",
|
|
"pattern": "^[a-f0-9]{64}$"
|
|
},
|
|
"mode": {
|
|
"enum": [
|
|
"mock",
|
|
"mixed",
|
|
"real"
|
|
]
|
|
},
|
|
"allowed_targets": {
|
|
"type": "array",
|
|
"minItems": 1,
|
|
"maxItems": 1000,
|
|
"uniqueItems": true,
|
|
"items": {
|
|
"type": "string",
|
|
"pattern": "^[0-9]{11,15}$"
|
|
}
|
|
},
|
|
"trunks": {
|
|
"type": "array",
|
|
"minItems": 1,
|
|
"maxItems": 32,
|
|
"items": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"trunk_id",
|
|
"provider_id",
|
|
"codec",
|
|
"caller_profile_ids",
|
|
"dial_prefix",
|
|
"enabled",
|
|
"media_profile_id"
|
|
],
|
|
"properties": {
|
|
"trunk_id": {
|
|
"type": "string",
|
|
"minLength": 1,
|
|
"maxLength": 128
|
|
},
|
|
"provider_id": {
|
|
"type": "string",
|
|
"minLength": 1,
|
|
"maxLength": 128
|
|
},
|
|
"codec": {
|
|
"const": "PCMA"
|
|
},
|
|
"caller_profile_ids": {
|
|
"type": "array",
|
|
"minItems": 1,
|
|
"uniqueItems": true,
|
|
"items": {
|
|
"type": "string",
|
|
"minLength": 1,
|
|
"maxLength": 128
|
|
}
|
|
},
|
|
"dial_prefix": {
|
|
"type": "string",
|
|
"maxLength": 32
|
|
},
|
|
"enabled": {
|
|
"type": "boolean"
|
|
},
|
|
"sip_endpoint_ref": {
|
|
"type": "string",
|
|
"maxLength": 128
|
|
},
|
|
"credential_ref": {
|
|
"type": [
|
|
"string",
|
|
"null"
|
|
],
|
|
"maxLength": 128
|
|
},
|
|
"media_profile_id": {
|
|
"type": "string",
|
|
"minLength": 1,
|
|
"maxLength": 128
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"ari": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"base_url",
|
|
"websocket_url",
|
|
"application",
|
|
"credential_ref"
|
|
],
|
|
"properties": {
|
|
"base_url": {
|
|
"type": "string",
|
|
"format": "uri",
|
|
"pattern": "^https?://"
|
|
},
|
|
"websocket_url": {
|
|
"type": "string",
|
|
"format": "uri",
|
|
"pattern": "^wss?://"
|
|
},
|
|
"application": {
|
|
"type": "string",
|
|
"pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$"
|
|
},
|
|
"credential_ref": {
|
|
"type": "string",
|
|
"minLength": 1,
|
|
"maxLength": 128
|
|
}
|
|
}
|
|
},
|
|
"media_profiles": {
|
|
"type": "object",
|
|
"minProperties": 1,
|
|
"maxProperties": 16,
|
|
"additionalProperties": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"format",
|
|
"sample_rate_hz",
|
|
"channels",
|
|
"payload_type"
|
|
],
|
|
"properties": {
|
|
"format": {
|
|
"enum": [
|
|
"slin16",
|
|
"alaw"
|
|
]
|
|
},
|
|
"sample_rate_hz": {
|
|
"enum": [
|
|
8000,
|
|
16000
|
|
]
|
|
},
|
|
"channels": {
|
|
"const": 1
|
|
},
|
|
"payload_type": {
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"maximum": 127
|
|
}
|
|
},
|
|
"allOf": [
|
|
{
|
|
"if": {
|
|
"properties": {
|
|
"format": {
|
|
"const": "alaw"
|
|
}
|
|
}
|
|
},
|
|
"then": {
|
|
"properties": {
|
|
"sample_rate_hz": {
|
|
"const": 8000
|
|
},
|
|
"payload_type": {
|
|
"const": 8
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"if": {
|
|
"properties": {
|
|
"format": {
|
|
"const": "slin16"
|
|
}
|
|
}
|
|
},
|
|
"then": {
|
|
"properties": {
|
|
"sample_rate_hz": {
|
|
"const": 16000
|
|
},
|
|
"payload_type": {
|
|
"type": "integer",
|
|
"minimum": 96,
|
|
"maximum": 127
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"media": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"bind_address",
|
|
"port",
|
|
"format",
|
|
"sample_rate_hz",
|
|
"channels",
|
|
"payload_type"
|
|
],
|
|
"properties": {
|
|
"bind_address": {
|
|
"type": "string",
|
|
"minLength": 1,
|
|
"maxLength": 255
|
|
},
|
|
"port": {
|
|
"type": "integer",
|
|
"minimum": 1024,
|
|
"maximum": 65535
|
|
},
|
|
"format": {
|
|
"enum": [
|
|
"slin16",
|
|
"alaw"
|
|
]
|
|
},
|
|
"sample_rate_hz": {
|
|
"enum": [
|
|
8000,
|
|
16000
|
|
]
|
|
},
|
|
"channels": {
|
|
"const": 1
|
|
},
|
|
"payload_type": {
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"maximum": 127
|
|
}
|
|
}
|
|
},
|
|
"recording": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"enabled",
|
|
"format",
|
|
"directory",
|
|
"max_bytes"
|
|
],
|
|
"properties": {
|
|
"enabled": {
|
|
"const": true
|
|
},
|
|
"format": {
|
|
"const": "wav"
|
|
},
|
|
"directory": {
|
|
"type": "string",
|
|
"minLength": 1,
|
|
"maxLength": 512
|
|
},
|
|
"max_bytes": {
|
|
"type": "integer",
|
|
"minimum": 16000,
|
|
"maximum": 1073741824
|
|
}
|
|
}
|
|
},
|
|
"load_evidence": {
|
|
"type": [
|
|
"object",
|
|
"null"
|
|
],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"asterisk_config_sha256": {
|
|
"type": "string",
|
|
"pattern": "^[a-f0-9]{64}$"
|
|
},
|
|
"loaded_at": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"status": {
|
|
"enum": [
|
|
"not-yet-loaded",
|
|
"loaded"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"allOf": [
|
|
{
|
|
"if": {
|
|
"properties": {
|
|
"mode": {
|
|
"enum": [
|
|
"mixed",
|
|
"real"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"then": {
|
|
"required": [
|
|
"ari",
|
|
"media",
|
|
"media_profiles",
|
|
"recording"
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|