[Asterisk-code-review] chan sip: Fix lastrtprx always updated (asterisk[14])

Matt Jordan asteriskteam at digium.com
Mon Aug 15 16:55:55 CDT 2016


Matt Jordan has uploaded a new change for review.

  https://gerrit.asterisk.org/3563

Change subject: chan_sip: Fix lastrtprx always updated
......................................................................

chan_sip: Fix lastrtprx always updated

Packets are read regulary, when there is no data in buffer fr->frametype
is AST_FRAME_NULL. There was no check of frametype and lastrtprx always 
updated and, therefore, rtptimeout did not work at all.

ASTERISK-25270 #close

Change-Id: If3b5ca0dbb822582a86eb7d01dcae4e83448c41d
---
M channels/chan_sip.c
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/63/3563/1

diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 6913a03..af7d3a5 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -8604,7 +8604,9 @@
 
 	sip_pvt_lock(p);
 	fr = sip_rtp_read(ast, p, &faxdetected);
-	p->lastrtprx = time(NULL);
+	if (fr && fr->frametype != AST_FRAME_NULL) {
+		p->lastrtprx = time(NULL);
+	}
 
 	/* If we detect a CNG tone and fax detection is enabled then send us off to the fax extension */
 	if (faxdetected && ast_test_flag(&p->flags[1], SIP_PAGE2_FAX_DETECT_CNG)) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If3b5ca0dbb822582a86eb7d01dcae4e83448c41d
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 14
Gerrit-Owner: Matt Jordan <mjordan at digium.com>
Gerrit-Reviewer: Evgeniy Tsybra <cjack at yandex.ru>



More information about the asterisk-code-review mailing list