mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-27 14:41:58 +00:00
Ensure entering T.38 passthrough does not cause an infinite loop
After R340970 Asterisk was still polling the RTCP file descriptor after RTCP is shut down and removed. If the descriptor happened to have data ready when the removal occured then Asterisk would go into an infinite loop trying to read data that it can never actually access. This change disables the audio RTCP file descriptor for the duration of the T.38 transaction. (closes issue ASTERISK-18951) Reported-by: Kristijan Vrban git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@353915 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -9216,6 +9216,10 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req, int t38action
|
|||||||
/* Ensure RTCP is enabled since it may be inactive
|
/* Ensure RTCP is enabled since it may be inactive
|
||||||
if we're coming back from a T.38 session */
|
if we're coming back from a T.38 session */
|
||||||
ast_rtp_instance_set_prop(p->rtp, AST_RTP_PROPERTY_RTCP, 1);
|
ast_rtp_instance_set_prop(p->rtp, AST_RTP_PROPERTY_RTCP, 1);
|
||||||
|
/* Ensure audio RTCP reads are enabled */
|
||||||
|
if (p->owner) {
|
||||||
|
ast_channel_set_fd(p->owner, 1, ast_rtp_instance_fd(p->rtp, 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);
|
||||||
@@ -9232,6 +9236,10 @@ 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");
|
||||||
|
/* Prevent audio RTCP reads */
|
||||||
|
if (p->owner) {
|
||||||
|
ast_channel_set_fd(p->owner, 1, -1);
|
||||||
|
}
|
||||||
/* Silence RTCP while audio RTP is inactive */
|
/* Silence RTCP while audio RTP is inactive */
|
||||||
ast_rtp_instance_set_prop(p->rtp, AST_RTP_PROPERTY_RTCP, 0);
|
ast_rtp_instance_set_prop(p->rtp, AST_RTP_PROPERTY_RTCP, 0);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user