[asterisk-bugs] [Asterisk 0019179]: DTMF transmission does not meet the recommendations of the rfc2833(4733).

Asterisk Bug Tracker noreply at bugs.digium.com
Tue Apr 26 08:47:59 CDT 2011


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=19179 
====================================================================== 
Reported By:                muhlik
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   19179
Category:                   Core/RTP
Reproducibility:            always
Severity:                   trivial
Priority:                   normal
Status:                     acknowledged
Asterisk Version:           1.8.3.3 
JIRA:                       SWP-3386 
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2011-04-25 08:51 CDT
Last Modified:              2011-04-26 08:47 CDT
====================================================================== 
Summary:                    DTMF transmission does not meet the recommendations
of the rfc2833(4733).
Description: 
According to rfc4733:

Network Working Group                                     H. Schulzrinne
Request for Comments: 4733                                   Columbia U.
Obsoletes: 2833                                                T. Taylor
Category: Standards Track                                         Nortel
                                                           December 2006
2.5.1.6.  RTP Sequence Number

   The RTP sequence number MUST be incremented by one in each successive
   RTP packet sent.  Incrementing applies to retransmitted as well as
   initial instances of event reports, to permit the receiver to detect
   lost packets for RTP Control Protocol (RTCP) receiver reports.


We can see in res_rtp_asterisk.c
644: static int ast_rtp_dtmf_end_with_duration(struct ast_rtp_instance
*instance, char digit, unsigned int duration)
...
692:	for (i = 0; i < 3; i++) {
693:		res = rtp_sendto(instance, (void *) rtpheader, hdrlen + 4, 0,
&remote_address);
694:		if (res < 0) {
695:			ast_log(LOG_ERROR, "RTP Transmission error to %s: %s\n",
696:				ast_sockaddr_stringify(&remote_address),
				strerror(errno));
698:		}
699:		if (rtp_debug_test_addr(&remote_address)) {
700:			ast_verbose("Sent RTP DTMF packet to %s (type %-2.2d, seq %-6.6u,
ts %-6.6u, len %-6.6u)\n",
701:				    ast_sockaddr_stringify(&remote_address),
702:				    rtp->send_payload, rtp->seqno, rtp->lastdigitts, res -
hdrlen);
703:		}
704:	}

in this function rtp->seqno++ is absent

In 1.6.2.17.3 version * in file rtp.c:
3295: int ast_rtp_senddigit_end_with_duration(struct ast_rtp *rtp, char
digit, unsigned int duration)
...
3336:	for (i = 0; i < 3; i++) {
3337:		rtpheader[0] = htonl((2 << 30) | (rtp->send_payload << 16) |
(rtp->seqno));
3338:		res = sendto(rtp->s, (void *) rtpheader, hdrlen + 4, 0, (struct
sockaddr *) &rtp->them, sizeof(rtp->them));
3339:		rtp->seqno++;
3340:		if (res < 0)
3341:			ast_log(LOG_ERROR, "RTP Transmission error to %s:%d: %s\n",
3342:				ast_inet_ntoa(rtp->them.sin_addr),
3343:				ntohs(rtp->them.sin_port), strerror(errno));
3344:		if (rtp_debug_test_addr(&rtp->them))
3345:			ast_verbose("Sent RTP DTMF packet to %s:%u (type %-2.2d, seq
%-6.6u, ts %-6.6u, len %-6.6u)\n",
3346:				    ast_inet_ntoa(rtp->them.sin_addr),
3347:				    ntohs(rtp->them.sin_port), rtp->send_payload, rtp->seqno,
rtp->lastdigitts, res - hdrlen);
3348:	}

Some SIP-gateway work incorrectly in this situation. If you are using
Dial() with option D(some_number), SIP-gateway taking only the first tone.
======================================================================
Relationships       ID      Summary
----------------------------------------------------------------------
related to          0012983 [patch] Retransmitted RFC 2833 RTP even...
====================================================================== 

---------------------------------------------------------------------- 
 (0134123) muhlik (reporter) - 2011-04-26 08:47
 https://issues.asterisk.org/view.php?id=19179#c134123 
---------------------------------------------------------------------- 
my patch:

--- res/res_rtp_asterisk.c	2010-10-06 08:35:51.000000000 +0400
+++ res/res_rtp_asterisk.c	2011-04-26 17:39:55.237263918 +0400
@@ -686,10 +686,10 @@
 	rtpheader[2] = htonl(rtp->ssrc);
 	rtpheader[3] = htonl((digit << 24) | (0xa << 16) |
(rtp->send_duration));
 	rtpheader[3] |= htonl((1 << 23));
-	rtpheader[0] = htonl((2 << 30) | (rtp->send_payload << 16) |
(rtp->seqno));
 
 	/* Send it 3 times, that's the magical number */
 	for (i = 0; i < 3; i++) {
+		rtpheader[0] = htonl((2 << 30) | (rtp->send_payload << 16) |
(rtp->seqno));
 		res = rtp_sendto(instance, (void *) rtpheader, hdrlen + 4, 0,
&remote_address);
 		if (res < 0) {
 			ast_log(LOG_ERROR, "RTP Transmission error to %s: %s\n",
@@ -701,6 +701,7 @@
 				    ast_sockaddr_stringify(&remote_address),
 				    rtp->send_payload, rtp->seqno, rtp->lastdigitts, res - hdrlen);
 		}
+		rtp->seqno++;
 	}
 
 	/* Oh and we can't forget to turn off the stuff that says we are sending
DTMF */ 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-04-26 08:47 muhlik         Note Added: 0134123                          
======================================================================




More information about the asterisk-bugs mailing list