Revision
15928
Author
anthm
Date
2009-12-11 18:04:07 -0600 (Fri, 11 Dec 2009)

Log Message

FSCORE-510 part 12

Modified Paths

Diff

Modified: freeswitch/trunk/src/switch_rtp.c (15927 => 15928)


--- freeswitch/trunk/src/switch_rtp.c	2009-12-11 23:23:14 UTC (rev 15927)
+++ freeswitch/trunk/src/switch_rtp.c	2009-12-12 00:04:07 UTC (rev 15928)
@@ -215,7 +215,6 @@
 	switch_rtp_stats_t stats;
 	uint32_t hot_hits;
 	uint32_t sync_packets;
-	uint32_t dtmf_wait;
 
 #ifdef ENABLE_ZRTP
 	zrtp_session_t *zrtp_session;
@@ -1605,7 +1604,6 @@
 				rtp_session->next_write_samplecount = rtp_session->timer.samplecount + samples * 5;
 			}
 			rtp_session->dtmf_data.out_digit_dur = 0;
-			rtp_session->dtmf_wait = rtp_session->samples_per_interval ? ((rtp_session->samples_per_second / 4) / rtp_session->samples_per_interval) : 12;
 		}
 	}
 
@@ -1618,11 +1616,7 @@
 			}
 		}
 
-		if (rtp_session->dtmf_wait) {
-			rtp_session->dtmf_wait--;
-		}
-
-		if (!rtp_session->dtmf_wait && switch_queue_trypop(rtp_session->dtmf_data.dtmf_queue, &pop) == SWITCH_STATUS_SUCCESS) {
+		if (switch_queue_trypop(rtp_session->dtmf_data.dtmf_queue, &pop) == SWITCH_STATUS_SUCCESS) {
 			switch_dtmf_t *rdigit = pop;
 			int64_t offset;
 			switch_size_t wrote;
@@ -1824,6 +1818,7 @@
 
 	while (switch_rtp_ready(rtp_session)) {
 		int do_cng = 0;
+		bytes = 0;
 
 		if (rtp_session->timer.interval) {
 			if ((switch_test_flag(rtp_session, SWITCH_RTP_FLAG_AUTOFLUSH) || switch_test_flag(rtp_session, SWITCH_RTP_FLAG_STICKY_FLUSH)) &&
@@ -1857,6 +1852,7 @@
 		}
 
 	recvfrom:
+		bytes = 0;
 
 		if (!switch_rtp_ready(rtp_session)) {
 			break;
@@ -1966,12 +1962,10 @@
 		if (bytes) {
 			if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_AUTOADJ)) {
 				if (((rtp_session->cng_pt && rtp_session->recv_msg.header.pt == rtp_session->cng_pt) || rtp_session->recv_msg.header.pt == 13)) {
-					bytes = 0;
 					goto recvfrom;			 
 					
 				} 
 			} else if (!switch_cmp_addr(rtp_session->from_addr, rtp_session->remote_addr)) {
-				bytes = 0;
 				goto recvfrom;			 
 				
 			}
@@ -2274,8 +2268,7 @@
 			if (!switch_rtp_ready(rtp_session)) {
 				goto end;
 			}
-			switch_cond_next();
-			goto recvfrom;
+			return_cng_frame();
 		}
 
 	timer_check: