]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
chan_sip: Fix lastrtprx always updated 63/3563/1
authorcjack <cjack@yandex.ru>
Wed, 15 Jun 2016 22:10:11 +0000 (01:10 +0300)
committerMatt Jordan <mjordan@digium.com>
Mon, 15 Aug 2016 21:55:54 +0000 (16:55 -0500)
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

channels/chan_sip.c

index 6913a039b502a20727d3baa83c30af7960d04e50..af7d3a550249c68f5de961c157af0e9fb7a0c9cf 100644 (file)
@@ -8604,7 +8604,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)) {