Hello everyone,
I'm having an issue and could use some help:
[srtp] SRTP output wanted, but no crypto suite was negotiated
My setup is: WebRTC → WSS → Kamailio → UDP → Asterisk
Here’s the Kamailio configuration I’m using:
`route[SET_RTP_DIRECTION] {
$var(dst_a)=$du;
(var(dst_a){s.replace,sip:,});
(var(dst_b){s.replace,:5080,});
if (!is_ip_rfc1918("$si") && !is_ip_rfc1918("$var(dst)")) {
$dlg_var(rtp_direction) = "direction=external direction=external";
return;
} else if (!is_ip_rfc1918("$si") && is_ip_rfc1918("$var(dst)")) {
$dlg_var(rtp_direction) = "direction=external direction=internal";
return;
} else if (is_ip_rfc1918("$si")) {
$dlg_var(rtp_direction) = "direction=internal direction=external";
return;
} else if (!is_ip_rfc1918("$si")) {
$dlg_var(rtp_direction) = "direction=external direction=external";
return;
}
}
route[GET_ICE] {
if (isflagset(FLT_FROM_TLS)) {
if (is_ip_rfc1918("$si")) {
$dlg_var(ice) = "ICE=force RTP/SAVPF";
} else {
$dlg_var(ice) = "ICE=remove RTP/AVP";
}
} else {
$dlg_var(ice) = "ICE=remove";
}
}
route[BUILD_RTPENGINE_PARAMETER] {
route(SET_RTP_DIRECTION); # returns $dlg_var(rtp_direction)
if ( is_method("INVITE") ) {
route(GET_ICE); # returns $dlg_var(ice)
}
$var(rtp_param) = "replace-origin replace-session-connection " + $dlg_var(ice) + " " + $dlg_var(rtp_direction);
rtpengine_manage($var(rtp_param));
}`
Logs:
`[srtp] Processing incoming DTLS packet
[srtp] Sending DTLS packet
[srtp] Sending DTLS packet
[srtp] Sending DTLS packet
[srtp] Sending DTLS packet
[srtp] Sending DTLS packet
[srtp] Processing incoming DTLS packet
[crypto] DTLS: Peer certificate accepted
[srtp] Sending DTLS packet
[srtp] Sending DTLS packet
[crypto] DTLS handshake successful
[crypto] DTLS-SRTP successfully negotiated using AES_CM_128_HMAC_SHA1_80
[srtp] SRTP keys, incoming:
[srtp] --- AES_CM_128_HMAC_SHA1_80 key YortX5/hCupZzMIF/cWE1w== salt Hb0TpUrEoL0PPSZ9uRE=
[srtp] SRTP keys, outgoing:
[srtp] --- AES_CM_128_HMAC_SHA1_80 key FNPwtH7FmgWQVn+m5+Do3A== salt vUUSrJJacQo9r1MWk20=
[crypto] DTLS-SRTP successfully negotiated using AES_CM_128_HMAC_SHA1_80
[srtp] SRTP keys, incoming:
[srtp] --- AES_CM_128_HMAC_SHA1_80 key YortX5/hCupZzMIF/cWE1w== salt Hb0TpUrEoL0PPSZ9uRE=
[srtp] SRTP keys, outgoing:
[srtp] --- AES_CM_128_HMAC_SHA1_80 key FNPwtH7FmgWQVn+m5+Do3A== salt vUUSrJJacQo9r1MWk20=
[ice] Sending ICE/STUN request for candidate pair udlODE5B1Kl51a8f:4284775548:1 from 10.5.0.8 to 169.254.226.251:49156
[ice] Sending ICE/STUN request for candidate pair udlODE5B1Kl51a8f:3499111857:1 from 10.5.0.8 to 172.31.208.1:49157
[ice] Sending ICE/STUN request for candidate pair udlODE5B1Kl51a8f:3181892339:1 from 10.5.0.8 to 192.168.1.165:49158
[ice] Sending ICE/STUN request for candidate pair udlODE5B1Kl51a8f:2087290297:1 from 10.5.0.8 to 176.223.17.217:49158
[ice] Sending ICE/STUN request for candidate pair mKKrzeQ2xypmkl66:Hac1fd94a:1 from 10.5.0.8 to 172.31.217.74:35826
[core] New ingress SSRC for: 10.5.0.2:35826 SSRC: 61cc1d7f
[srtp] Generated session key: master key 14d3f0b4..., master salt bd4512ac..., label 00, length 16, result 1965d69c...
[srtp] Generated session key: master key 14d3f0b4..., master salt bd4512ac..., label 01, length 20, result 166d5684...
[srtp] Generated session key: master key 14d3f0b4..., master salt bd4512ac..., label 02, length 14, result 1d205ab9...
[core] Handling packet: remote 10.5.0.2:35826 (expected: 10.5.0.2:35826) -> local 10.5.0.8:19316 (RTP seq 5382 TS 80 SSRC 61cc1d7f)
[core] New egress (direct) SSRC for: 176.223.17.217:49158 SSRC: 61cc1d7f
[srtp] SRTP output wanted, but no crypto suite was negotiated
[core] Error when sending message. Error: Inappropriate ioctl for device
[core] Handling packet: remote 10.5.0.2:35826 (expected: 10.5.0.2:35826) -> local 10.5.0.8:19316 (RTP seq 5383 TS 160 SSRC 61cc1d7f)
[core] Closing call due to timeout
[core] Final packet stats:
[core] --- Tag 'm5qgq6plgn', created 1:51 ago for branch ''
[core] --- subscribed to media with monologue tag '3cbf0a9a-4818-487a-8c77-2e9f2afdaa81' (index: 1)
[core] --- subscription for media with monologue tag '3cbf0a9a-4818-487a-8c77-2e9f2afdaa81' (index: 1)
[core] ------ Media #1 (audio over RTP/SAVPF) using unknown codec
[core] --------- Port 10.5.0.8:16324 <> 176.223.17.217:49158, SSRC 0, in 0 p, 0 b, 112 e, 111 ts, out 0 p, 0 b, 0 e
[core] --- Tag '3cbf0a9a-4818-487a-8c77-2e9f2afdaa81', created 1:51 ago for branch ''
[core] --- subscribed to media with monologue tag 'm5qgq6plgn' (index: 1)
[core] --- subscription for media with monologue tag 'm5qgq6plgn' (index: 1)
[core] ------ Media #1 (audio over RTP/SAVPF) using G722/8000
[core] --------- Port 10.5.0.8:19316 <> 10.5.0.2:35826, SSRC 61cc1d7f, in 112 p, 10304 b, 0 e, 106 ts, out 7 p, 1947 b, 0 e`
Thank you.
Hello everyone,
I'm having an issue and could use some help:
[srtp] SRTP output wanted, but no crypto suite was negotiated
My setup is: WebRTC → WSS → Kamailio → UDP → Asterisk
[core] --- Tag 'm5qgq6plgn', created 1:51 ago for branch ''
[core] --- subscribed to media with monologue tag '3cbf0a9a-4818-487a-8c77-2e9f2afdaa81' (index: 1)
[core] --- subscription for media with monologue tag '3cbf0a9a-4818-487a-8c77-2e9f2afdaa81' (index: 1)
[core] ------ Media #1 (audio over RTP/SAVPF) using unknown codec
[core] --------- Port 10.5.0.8:16324 <> 176.223.17.217:49158, SSRC 0, in 0 p, 0 b, 112 e, 111 ts, out 0 p, 0 b, 0 e
[core] --- Tag '3cbf0a9a-4818-487a-8c77-2e9f2afdaa81', created 1:51 ago for branch ''
[core] --- subscribed to media with monologue tag 'm5qgq6plgn' (index: 1)
[core] --- subscription for media with monologue tag 'm5qgq6plgn' (index: 1)
[core] ------ Media #1 (audio over RTP/SAVPF) using G722/8000
[core] --------- Port 10.5.0.8:19316 <> 10.5.0.2:35826, SSRC 61cc1d7f, in 112 p, 10304 b, 0 e, 106 ts, out 7 p, 1947 b, 0 e`
it looks like you're trying to do SRTP on both sides, when I'm guessing the Asterisk side should be plain RTP.
Also as already mentioned, enable debug logging and inspect the flags passed to rtpengine for the offers and answers. From there you should be able to see which flags are passed wrong, or which are missing.
Cheers