[Asterisk-code-review] channels/chan sip: Fix rtptimeout (asterisk[master])

Kelvin asteriskteam at digium.com
Wed Jul 29 05:05:10 CDT 2015


Kelvin has uploaded a new change for review.

  https://gerrit.asterisk.org/981

Change subject: channels/chan_sip: Fix rtptimeout
......................................................................

channels/chan_sip: Fix rtptimeout

RTP timeout should hangup the call when asterisk
stops receiving rtp on a leg. Because sip_read()
process lost packets as zero sized packets,
lastrtprx always gets updated thus will never
timeout at all. This fix solves the problem by
updating only nonzero packets.

ASTERISK-25282

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


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/81/981/1

diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 412a257..5389976 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -8416,7 +8416,9 @@
 
 	sip_pvt_lock(p);
 	fr = sip_rtp_read(ast, p, &faxdetected);
-	p->lastrtprx = time(NULL);
+	if (fr->datalen > 0)  {
+		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/981
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2650224ee99df87c102c58fcb54ffae383d0c8c3
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Kelvin <kelchy at gmail.com>



More information about the asterisk-code-review mailing list