From: cjack Date: Wed, 15 Jun 2016 22:10:11 +0000 (+0300) Subject: chan_sip: Fix lastrtprx always updated X-Git-Tag: 13.12.0-rc1~124^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=93332cb1d0eea18021ea6538237297e627d6e2fc;p=thirdparty%2Fasterisk.git 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 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 77f4382626..8f3296adfa 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -8598,7 +8598,9 @@ static struct ast_frame *sip_read(struct ast_channel *ast) 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)) {