[Freeswitch-svn] [commit] r4735 - freeswitch/trunk/src

Freeswitch SVN anthm at freeswitch.org
Thu Mar 22 16:55:47 EDT 2007


Author: anthm
Date: Thu Mar 22 16:55:46 2007
New Revision: 4735

Modified:
   freeswitch/trunk/src/switch_rtp.c

Log:
dunno maybe this will work

Modified: freeswitch/trunk/src/switch_rtp.c
==============================================================================
--- freeswitch/trunk/src/switch_rtp.c	(original)
+++ freeswitch/trunk/src/switch_rtp.c	Thu Mar 22 16:55:46 2007
@@ -105,6 +105,7 @@
 	unsigned char out_digit_packet[4];
 	unsigned int out_digit_sofar;
 	unsigned int out_digit_dur;
+	uint16_t in_digit_seq;
 	uint16_t out_digit_seq;
 	uint32_t out_digit_ssrc;
 	int32_t timestamp_dtmf;
@@ -910,31 +911,36 @@
 			int end = packet[1]&0x80;
 			int duration = (packet[2]<<8) + packet[3];
 			char key = switch_rfc2833_to_char(packet[0]);
+			uint16_t in_digit_seq = ntohs((uint16_t)rtp_session->recv_msg.header.seq);
 
 			/* SHEESH.... Curse you RFC2833 inventors!!!!*/
 			if ((time(NULL) - rtp_session->dtmf_data.last_digit_time) > 2) {
 				rtp_session->dtmf_data.last_digit = 0;
 				rtp_session->dtmf_data.dc = 0;
 			}
+			if (in_digit_seq > rtp_session->dtmf_data.in_digit_seq) {
+				rtp_session->dtmf_data.in_digit_seq = in_digit_seq;
+			
+				if (duration && end) {
+					if (key != rtp_session->dtmf_data.last_digit) {
+						char digit_str[] = {key, 0};
+						time(&rtp_session->dtmf_data.last_digit_time);
+						switch_rtp_queue_dtmf(rtp_session, digit_str);
+					}
+					if (++rtp_session->dtmf_data.dc >= 3) {
+						rtp_session->dtmf_data.last_digit = 0;
+						rtp_session->dtmf_data.dc = 0;
+					}
 
-			if (duration && end) {
-				if (key != rtp_session->dtmf_data.last_digit) {
-					char digit_str[] = {key, 0};
-					time(&rtp_session->dtmf_data.last_digit_time);
-					switch_rtp_queue_dtmf(rtp_session, digit_str);
-				}
-				if (++rtp_session->dtmf_data.dc >= 3) {
+					rtp_session->dtmf_data.last_digit = key;
+				} else {
 					rtp_session->dtmf_data.last_digit = 0;
 					rtp_session->dtmf_data.dc = 0;
 				}
-
-				rtp_session->dtmf_data.last_digit = key;
-			} else {
-				rtp_session->dtmf_data.last_digit = 0;
-				rtp_session->dtmf_data.dc = 0;
 			}
 
 			continue;
+
 		}
 
 		break;



More information about the Freeswitch-svn mailing list