-
Notifications
You must be signed in to change notification settings - Fork 491
Description
Currently using libsrtp version - v2.4.2.
We need to support server failover/switchover scenarios. When a server transitions from the standby state to the active state, the SRTCP Index value must be passed to the newly active server.
Currently, I don’t see an existing API in libsrtp to set the SRTCP Index value.
To handle this, I created a new function srtp_set_stream_srtcp_index() and call it before invoking srtp_protect_rtcp().
In this function, I set the updated SRTCP Index value i.e. 'srtcp_index_to_set' value to 'stream->rtcp_rdb.window_start'.
/******************** new code below *********************************************/
srtp_err_status_t srtp_set_stream_srtcp_index(srtp_t ctx,
void *rtcp_hdr,
uint32_t srtcp_index_to_set)
{
srtp_stream_ctx_t *stream;
srtcp_hdr_t *hdr = (srtcp_hdr_t *)rtcp_hdr;
stream = srtp_get_stream(ctx, hdr->ssrc);
if (stream == NULL)
return srtp_err_status_bad_param;
stream->rtcp_rdb.window_start = srtcp_index_to_set;
return srtp_err_status_ok;
}
/******************** new code above *********************************************/
Could you please review this approach? Do you see any potential issues or risks with this implementation?