mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-02 19:16:15 +00:00
chan_pjsip.c: Change SSRC after media source change
When the RTP media source changes, such as after a blind transfer, the new source introduces a discontinuous timestamp. According to RFC 3550, Section 5.1, an RTP stream's timestamp for a given SSRC must increment monotonically and linearly. To comply with the standard and avoid a large timestamp jump on the existing SSRC, a new SSRC is generated for the new media stream. This change resolves known interoperability issues with certain SBCs (like Sonus/Ribbon) that stop forwarding media when they detect such a timestamp violation. This code uses the existing implementation from chan_sip. Resolves: #927
This commit is contained in:
committed by
github-actions[bot]
parent
415daae95f
commit
9e7788ad21
@@ -1820,6 +1820,14 @@ static int chan_pjsip_indicate(struct ast_channel *ast, int condition, const voi
|
|||||||
case AST_CONTROL_SRCUPDATE:
|
case AST_CONTROL_SRCUPDATE:
|
||||||
break;
|
break;
|
||||||
case AST_CONTROL_SRCCHANGE:
|
case AST_CONTROL_SRCCHANGE:
|
||||||
|
/* Generate a new SSRC due to media source change and RTP timestamp reset.
|
||||||
|
Ensures RFC 3550 compliance and avoids SBC interoperability issues (Sonus/Ribbon)*/
|
||||||
|
for (i = 0; i < AST_VECTOR_SIZE(&channel->session->active_media_state->sessions); ++i) {
|
||||||
|
media = AST_VECTOR_GET(&channel->session->active_media_state->sessions, i);
|
||||||
|
if (media && media->rtp) {
|
||||||
|
ast_rtp_instance_change_source(media->rtp);
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case AST_CONTROL_REDIRECTING:
|
case AST_CONTROL_REDIRECTING:
|
||||||
if (ast_channel_state(ast) != AST_STATE_UP) {
|
if (ast_channel_state(ast) != AST_STATE_UP) {
|
||||||
|
Reference in New Issue
Block a user