[Asterisk-cvs] asterisk rtp.c,1.128,1.129

kpfleming at lists.digium.com kpfleming at lists.digium.com
Sun May 15 00:00:46 CDT 2005


Update of /usr/cvsroot/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv1279

Modified Files:
	rtp.c 
Log Message:
fix RTP DTMF for Sipura SPA-3000 (bug #3675, yet again)


Index: rtp.c
===================================================================
RCS file: /usr/cvsroot/asterisk/rtp.c,v
retrieving revision 1.128
retrieving revision 1.129
diff -u -d -r1.128 -r1.129
--- rtp.c	15 May 2005 03:21:51 -0000	1.128
+++ rtp.c	15 May 2005 04:06:16 -0000	1.129
@@ -1077,21 +1077,25 @@
 	rtpheader[3] = htonl((digit << 24) | (0xa << 16) | (0));
 	for (x=0;x<6;x++) {
 		if (rtp->them.sin_port && rtp->them.sin_addr.s_addr) {
-			res = sendto(rtp->s, (void *)rtpheader, hdrlen + 4, 0, (struct sockaddr *)&rtp->them, sizeof(rtp->them));
+			res = sendto(rtp->s, (void *) rtpheader, hdrlen + 4, 0, (struct sockaddr *) &rtp->them, sizeof(rtp->them));
 			if (res < 0) 
-				ast_log(LOG_ERROR, "RTP Transmission error to %s:%d: %s\n", ast_inet_ntoa(iabuf, sizeof(iabuf), rtp->them.sin_addr), ntohs(rtp->them.sin_port), strerror(errno));
-			if(rtp_debug_test_addr(&rtp->them))
-				ast_verbose("Sent RTP packet to %s:%d (type %d, seq %d, ts %d, len %d)\n"
-						, ast_inet_ntoa(iabuf, sizeof(iabuf), rtp->them.sin_addr), ntohs(rtp->them.sin_port), payload, rtp->seqno, rtp->lastdigitts, res - hdrlen);		   
-		   
+				ast_log(LOG_ERROR, "RTP Transmission error to %s:%d: %s\n",
+					ast_inet_ntoa(iabuf, sizeof(iabuf), rtp->them.sin_addr),
+					ntohs(rtp->them.sin_port), strerror(errno));
+			if (rtp_debug_test_addr(&rtp->them))
+				ast_verbose("Sent RTP packet to %s:%d (type %d, seq %d, ts %d, len %d)\n",
+					    ast_inet_ntoa(iabuf, sizeof(iabuf), rtp->them.sin_addr),
+					    ntohs(rtp->them.sin_port), payload, rtp->seqno, rtp->lastdigitts, res - hdrlen);
 		}
 		/* Clear marker bit and increment seqno */
-		rtpheader[0] = htonl((2 << 30)  | (payload << 16) | (rtp->seqno++));
+		rtpheader[0] = htonl((2 << 30) | (payload << 16) | (rtp->seqno++));
 		/* For the last three packets, set the duration and the end bit */
 		if (x == 2) {
+			rtp->lastdigitts++; /* or else the SPA3000 will click instead of beeping... */
+			rtpheader[1] = htonl(rtp->lastdigitts);
 			/* Make duration 800 (100ms) */
 			rtpheader[3] |= htonl((800));
-			/* Set the End bit for the last 3 */
+			/* Set the End bit */
 			rtpheader[3] |= htonl((1 << 23));
 		}
 	}




More information about the svn-commits mailing list