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:
Hoan Luu Huu
2026-07-16 07:45:46 -04:00
committed by GitHub
co-authored by Claude Opus 4.8
parent 8c5fe31897
commit 34989ca59d
2 changed files with 32 additions and 1 deletions
+5 -1
View File
@@ -317,7 +317,11 @@
"amd": "#amd",
"dub": ["#dub"],
"tag": "object",
"forwardPAI": "boolean"
"forwardPAI": "boolean",
"srtpEncryption": {
"type": "string",
"enum": ["sdes", "dtls"]
}
},
"required": [
"target"
+27
View File
@@ -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();
});