mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-16 14:58:25 +00:00
Quiet RTCP Receiver Reports during fax transmission
RTCP is now disabled for "inactive" RTP audio streams during SIP T.38 sessions. The ability to disable RTCP streams in res_rtp_asterisk was missing, so this code was added to support the bug fix. (closes issue ASTERISK-18400) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@340970 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -8928,6 +8928,9 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req, int t38action
|
|||||||
}
|
}
|
||||||
|
|
||||||
ast_rtp_codecs_payloads_copy(&newaudiortp, ast_rtp_instance_get_codecs(p->rtp), p->rtp);
|
ast_rtp_codecs_payloads_copy(&newaudiortp, ast_rtp_instance_get_codecs(p->rtp), p->rtp);
|
||||||
|
/* Ensure RTCP is enabled since it may be inactive
|
||||||
|
if we're coming back from a T.38 session */
|
||||||
|
ast_rtp_instance_set_prop(p->rtp, AST_RTP_PROPERTY_RTCP, 1);
|
||||||
|
|
||||||
if (ast_test_flag(&p->flags[0], SIP_DTMF) == SIP_DTMF_AUTO) {
|
if (ast_test_flag(&p->flags[0], SIP_DTMF) == SIP_DTMF_AUTO) {
|
||||||
ast_clear_flag(&p->flags[0], SIP_DTMF);
|
ast_clear_flag(&p->flags[0], SIP_DTMF);
|
||||||
@@ -8944,6 +8947,8 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req, int t38action
|
|||||||
} else if (udptlportno > 0) {
|
} else if (udptlportno > 0) {
|
||||||
if (debug)
|
if (debug)
|
||||||
ast_verbose("Got T.38 Re-invite without audio. Keeping RTP active during T.38 session.\n");
|
ast_verbose("Got T.38 Re-invite without audio. Keeping RTP active during T.38 session.\n");
|
||||||
|
/* Silence RTCP while audio RTP is inactive */
|
||||||
|
ast_rtp_instance_set_prop(p->rtp, AST_RTP_PROPERTY_RTCP, 0);
|
||||||
} else {
|
} else {
|
||||||
ast_rtp_instance_stop(p->rtp);
|
ast_rtp_instance_stop(p->rtp);
|
||||||
if (debug)
|
if (debug)
|
||||||
|
|||||||
@@ -2381,10 +2381,12 @@ static void ast_rtp_prop_set(struct ast_rtp_instance *instance, enum ast_rtp_pro
|
|||||||
struct ast_rtp *rtp = ast_rtp_instance_get_data(instance);
|
struct ast_rtp *rtp = ast_rtp_instance_get_data(instance);
|
||||||
|
|
||||||
if (property == AST_RTP_PROPERTY_RTCP) {
|
if (property == AST_RTP_PROPERTY_RTCP) {
|
||||||
|
if (value) {
|
||||||
if (rtp->rtcp) {
|
if (rtp->rtcp) {
|
||||||
ast_debug(1, "Ignoring duplicate RTCP property on RTP instance '%p'\n", instance);
|
ast_debug(1, "Ignoring duplicate RTCP property on RTP instance '%p'\n", instance);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
/* Setup RTCP to be activated on the next RTP write */
|
||||||
if (!(rtp->rtcp = ast_calloc(1, sizeof(*rtp->rtcp)))) {
|
if (!(rtp->rtcp = ast_calloc(1, sizeof(*rtp->rtcp)))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -2419,6 +2421,25 @@ static void ast_rtp_prop_set(struct ast_rtp_instance *instance, enum ast_rtp_pro
|
|||||||
rtp->rtcp->schedid = -1;
|
rtp->rtcp->schedid = -1;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
} else {
|
||||||
|
if (rtp->rtcp) {
|
||||||
|
if (rtp->rtcp->schedid > 0) {
|
||||||
|
if (!ast_sched_del(rtp->sched, rtp->rtcp->schedid)) {
|
||||||
|
/* Successfully cancelled scheduler entry. */
|
||||||
|
ao2_ref(instance, -1);
|
||||||
|
} else {
|
||||||
|
/* Unable to cancel scheduler entry */
|
||||||
|
ast_debug(1, "Failed to tear down RTCP on RTP instance '%p'\n", instance);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
rtp->rtcp->schedid = -1;
|
||||||
|
}
|
||||||
|
close(rtp->rtcp->s);
|
||||||
|
ast_free(rtp->rtcp);
|
||||||
|
rtp->rtcp = NULL;
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user