[Asterisk-code-review] res rtp asterisk: Don't clear RTCP address while on hold (asterisk[13])

Sean Bright asteriskteam at digium.com
Sun Mar 19 17:07:46 CDT 2017


Sean Bright has uploaded a new change for review. ( https://gerrit.asterisk.org/5255 )

Change subject: res_rtp_asterisk: Don't clear RTCP address while on hold
......................................................................

res_rtp_asterisk: Don't clear RTCP address while on hold

When we are on hold, we set the remote peer's RTCP address to NULL, causing
us to emit a netsock warning whenever an RTCP report is received. Instead,
only update the RTCP address if we're updating to a non-empty address.

Additionally remove a redundant call to ast_sockaddr_setnull().

ASTERISK-26860 #close
Reported by: Evers Lab

Change-Id: Icd08f3285908b9b8817a7bea5c44317784e1edfe
---
M res/res_rtp_asterisk.c
1 file changed, 2 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/55/5255/1

diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c
index d681fea..1dfb545 100644
--- a/res/res_rtp_asterisk.c
+++ b/res/res_rtp_asterisk.c
@@ -5168,8 +5168,9 @@
 
 	if (rtp->rtcp) {
 		ast_debug(1, "Setting RTCP address on RTP instance '%p'\n", instance);
-		ast_sockaddr_copy(&rtp->rtcp->them, addr);
 		if (!ast_sockaddr_isnull(addr)) {
+			ast_sockaddr_copy(&rtp->rtcp->them, addr);
+
 			if (rtp->rtcp->type == AST_RTP_INSTANCE_RTCP_STANDARD) {
 				ast_sockaddr_set_port(&rtp->rtcp->them, ast_sockaddr_port(addr) + 1);
 
@@ -5365,9 +5366,6 @@
 	}
 
 	ast_rtp_instance_set_remote_address(instance, &addr);
-	if (rtp->rtcp) {
-		ast_sockaddr_setnull(&rtp->rtcp->them);
-	}
 
 	ast_set_flag(rtp, FLAG_NEED_MARKER_BIT);
 }

-- 
To view, visit https://gerrit.asterisk.org/5255
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icd08f3285908b9b8817a7bea5c44317784e1edfe
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>



More information about the asterisk-code-review mailing list