mirror of
https://github.com/jambonz/verb-specifications.git
synced 2026-10-03 17:54:18 +00:00
feat: add srtpEncryption option to dial verb (#134)
Adds optional dial.srtpEncryption (enum: sdes | dtls). Without this the validator rejects the property as unknown. The feature-server maps it to an X-Jambonz-SRTP header honored by sbc-outbound for encrypted media on outbound SIP URI calls (e.g. sips:/TLS targets such as LiveKit). Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
8c5fe31897
commit
34989ca59d
+5
-1
@@ -317,7 +317,11 @@
|
||||
"amd": "#amd",
|
||||
"dub": ["#dub"],
|
||||
"tag": "object",
|
||||
"forwardPAI": "boolean"
|
||||
"forwardPAI": "boolean",
|
||||
"srtpEncryption": {
|
||||
"type": "string",
|
||||
"enum": ["sdes", "dtls"]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"target"
|
||||
|
||||
@@ -867,4 +867,31 @@ test('non-synonym verbs are unchanged', async (t) => {
|
||||
]);
|
||||
t.equal(Object.keys(result2[0])[0], 'llm', 'llm verb is not transformed');
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('dial: srtpEncryption sdes/dtls validate; invalid value rejected', async (t) => {
|
||||
for (const mode of ['sdes', 'dtls']) {
|
||||
try {
|
||||
validate(logger, [{
|
||||
"verb": "dial",
|
||||
"target": [{"type": "sip", "sipUri": "sips:alice@example.com;transport=tls"}],
|
||||
"srtpEncryption": mode
|
||||
}]);
|
||||
t.pass(`dial with srtpEncryption=${mode} validates`);
|
||||
} catch (err) {
|
||||
t.fail(`dial srtpEncryption=${mode} should validate: ${err}`);
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
validate(logger, [{
|
||||
"verb": "dial",
|
||||
"target": [{"type": "sip", "sipUri": "sips:alice@example.com"}],
|
||||
"srtpEncryption": "aes"
|
||||
}]);
|
||||
t.fail('dial with invalid srtpEncryption should not validate');
|
||||
} catch (err) {
|
||||
t.ok(/must be one of/.test(err.message), 'invalid srtpEncryption value rejected');
|
||||
}
|
||||
t.end();
|
||||
});
|
||||
Reference in New Issue
Block a user