Skip to content

Conversation

@ajay-sabat
Copy link
Contributor

Now storing the local key corresponding to the crypto type that was negotiated with the remote side
in the channel variable 'rtp_last_audio_local_crypto_key'.

Now storing the local key corresponding to the crypto type that was negotiated with the remote side
in the channel variable 'rtp_last_audio_local_crypto_key'.
@andywolk
Copy link
Contributor

Can you more widely describe what you are trying to fix here?

@Five9Voice
Copy link

From the comments in the commit: Now storing the local key corresponding to the crypto type that was negotiated with the remote side in the channel variable 'rtp_last_audio_local_crypto_key'.

We found that during call recovery, TLS negotiation would fail because this variable was sent to the "last crypto key in the list", not the "negotiated crypto key". This fix allows the recovered TLS call to use the key that had been previously negotiated.

if (engine->type == SWITCH_MEDIA_TYPE_AUDIO) {
switch_channel_set_variable(session->channel, "srtp_remote_audio_crypto_key", crypto);
switch_channel_set_variable_printf(session->channel, "srtp_remote_audio_crypto_type", "%s", switch_core_media_crypto_type2str(ctype));
switch_channel_set_variable_printf(session->channel, "rtp_last_audio_local_crypto_key", "%s", engine->ssec[engine->crypto_type].local_crypto_key);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about VIDEO and TEXT? See "rtp_last_%s_local_crypto_key", type2str(type)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants