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
This commit is contained in:
cjack 2016-06-16 01:10:11 +03:00 committed by Matt Jordan
parent 922b74169f
commit 957df73301
1 changed files with 3 additions and 1 deletions

View File

@ -8595,7 +8595,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)) {