[asterisk-commits] file: branch group/vldtmf r39456 - in /team/group/vldtmf: channel.c rtp.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Aug 8 21:46:51 MST 2006


Author: file
Date: Tue Aug  8 23:46:51 2006
New Revision: 39456

URL: http://svn.digium.com/view/asterisk?rev=39456&view=rev
Log:
Minor mod to bridging, and make compensate work.

Modified:
    team/group/vldtmf/channel.c
    team/group/vldtmf/rtp.c

Modified: team/group/vldtmf/channel.c
URL: http://svn.digium.com/view/asterisk/team/group/vldtmf/channel.c?rev=39456&r1=39455&r2=39456&view=diff
==============================================================================
--- team/group/vldtmf/channel.c (original)
+++ team/group/vldtmf/channel.c Tue Aug  8 23:46:51 2006
@@ -3524,6 +3524,7 @@
 				break;
 		}
 		if ((f->frametype == AST_FRAME_VOICE) ||
+		    (f->frametype == AST_FRAME_DTMF_BEGIN) ||
 		    (f->frametype == AST_FRAME_DTMF) ||
 		    (f->frametype == AST_FRAME_VIDEO) ||
 		    (f->frametype == AST_FRAME_IMAGE) ||

Modified: team/group/vldtmf/rtp.c
URL: http://svn.digium.com/view/asterisk/team/group/vldtmf/rtp.c?rev=39456&r1=39455&r2=39456&view=diff
==============================================================================
--- team/group/vldtmf/rtp.c (original)
+++ team/group/vldtmf/rtp.c Tue Aug  8 23:46:51 2006
@@ -1118,19 +1118,6 @@
 
 	rtp->rxseqno = seqno;
 
-	if (rtp->dtmfcount) {
-#if 0
-		printf("dtmfcount was %d\n", rtp->dtmfcount);
-#endif		
-		rtp->dtmfcount -= (timestamp - rtp->lastrxts);
-		if (rtp->dtmfcount < 0)
-			rtp->dtmfcount = 0;
-#if 0
-		if (dtmftimeout != rtp->dtmfcount)
-			printf("dtmfcount is %d\n", rtp->dtmfcount);
-#endif
-	}
-
 	/* If we are compensating for lack of VLDTMF, then check to see if we need to send an AST_FRAME_DTMF_END */
 	if (rtp->resp && ast_test_flag(rtp, FLAG_DTMF_COMPENSATE) && (timestamp - rtp->lastrxts) >= rtp->dtmfduration) {
 		fr = send_dtmf(rtp, AST_FRAME_DTMF_END);
@@ -1141,13 +1128,6 @@
 
 	/* Record received timestamp as last received now */
 	rtp->lastrxts = timestamp;
-
-	/* Send any pending DTMF */
-	if (rtp->resp && !rtp->dtmfcount) {
-		if (option_debug)
-			ast_log(LOG_DEBUG, "Sending pending DTMF\n");
-		return send_dtmf(rtp, AST_FRAME_DTMF_BEGIN);
-	}
 
 	rtp->f.mallocd = 0;
 	rtp->f.datalen = res - hdrlen;
@@ -2008,7 +1988,7 @@
 		return -1;
 
 	/* If no digit was pressed initially, then we need to compensate */
-	if (!rtp->send_digit || rtp->send_digit != digit) {
+	if (rtp->send_digit == 0) {
 		if ((res = ast_rtp_senddigit_begin(rtp, original_digit)))
 			return res;
 		/* Initialize compensation */
@@ -2023,7 +2003,8 @@
 		/* Send duration to 100ms */
 		rtpheader[3] |= htonl((800));
 		/* Set end bit */
-		rtpheader[3] |= htonl((1 << 23));		
+		rtpheader[3] |= htonl((1 << 23));
+		rtpheader[0] = htonl((2 << 30) | (rtp->send_payload << 16) | (rtp->seqno));
 		/* Send 3 termination packets */
 		for (i = 0; i < 3; i++) {
 			if (rtp->them.sin_port && rtp->them.sin_addr.s_addr) {
@@ -2431,6 +2412,10 @@
 		ast_log(LOG_WARNING, "RTP can only send voice and video\n");
 		return -1;
 	}
+
+	/* If a digit is currently active then send a continuation frame */
+	if (rtp->send_digit)
+		ast_rtp_senddigit_continuation(rtp);
 
 	subclass = _f->subclass;
 	if (_f->frametype == AST_FRAME_VIDEO)



More information about the asterisk-commits mailing list