diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c index 04e9fa5716..350b29374d 100644 --- a/res/res_rtp_asterisk.c +++ b/res/res_rtp_asterisk.c @@ -38,6 +38,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") + #include #include #include @@ -5128,6 +5129,7 @@ static int bridge_p2p_rtp_write(struct ast_rtp_instance *instance, int res = 0, payload = 0, bridged_payload = 0, mark; RAII_VAR(struct ast_rtp_payload_type *, payload_type, NULL, ao2_cleanup); int reconstruct = ntohl(rtpheader[0]); + unsigned int ssrc = ntohl(rtpheader[2]); struct ast_sockaddr remote_address = { {0,} }; int ice; unsigned int timestamp = ntohl(rtpheader[1]); @@ -5234,6 +5236,17 @@ static int bridge_p2p_rtp_write(struct ast_rtp_instance *instance, ast_clear_flag(bridged, FLAG_NEED_MARKER_BIT); } + /* + * Check for this condition as increasing the lock duration we find marker bit may need setting + * for a changed SSRC + */ + if(!mark && ssrc != bridged->ssrc) { + bridged->ssrc = ssrc; + mark = 1; + ast_debug(1, "Setting Marker bit for ssrc change\n"); + ast_clear_flag(bridged, FLAG_NEED_MARKER_BIT); + } + /* Reconstruct part of the packet */ reconstruct &= 0xFF80FFFF; reconstruct |= (bridged_payload << 16);