]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix issue with dtmf continuation packets when the dtmf digit is 0...
authorJason Parker <jparker@digium.com>
Wed, 17 Jan 2007 00:20:56 +0000 (00:20 +0000)
committerJason Parker <jparker@digium.com>
Wed, 17 Jan 2007 00:20:56 +0000 (00:20 +0000)
Issue 8831

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51170 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/rtp.c

index c1285654d83845e58483f0436c650ca175ea4faf..ec4a93ab95ad826026cf88387c6179ca92bde0cb 100644 (file)
@@ -143,7 +143,8 @@ struct ast_rtp {
        unsigned int dtmfduration;
        /* DTMF Transmission Variables */
        unsigned int lastdigitts;
-       char send_digit;
+       char sending_digit;     /* boolean - are we sending digits */
+       char send_digit;        /* digit we are sending */
        int send_payload;
        int send_duration;
        int nat;
@@ -1091,7 +1092,7 @@ struct ast_frame *ast_rtp_read(struct ast_rtp *rtp)
        struct ast_rtp *bridged = NULL;
        
        /* If time is up, kill it */
-       if (rtp->send_digit)
+       if (rtp->sending_digit)
                ast_rtp_senddigit_continuation(rtp);
 
        len = sizeof(sin);
@@ -2138,6 +2139,7 @@ int ast_rtp_senddigit_begin(struct ast_rtp *rtp, char digit)
        }
 
        /* Since we received a begin, we can safely store the digit and disable any compensation */
+       rtp->sending_digit = 1;
        rtp->send_digit = digit;
        rtp->send_payload = payload;
 
@@ -2229,6 +2231,7 @@ int ast_rtp_senddigit_end(struct ast_rtp *rtp, char digit)
                                    ast_inet_ntoa(rtp->them.sin_addr),
                                    ntohs(rtp->them.sin_port), rtp->send_payload, rtp->seqno, rtp->lastdigitts, res - hdrlen);
        }
+       rtp->sending_digit = 0;
        rtp->send_digit = 0;
        /* Increment lastdigitts */
        rtp->lastdigitts += 960;