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

Freeswitch SVN anthm at freeswitch.org
Sat Feb 17 23:37:06 EST 2007


Author: anthm
Date: Sat Feb 17 23:37:06 2007
New Revision: 4315

Modified:
   freeswitch/trunk/src/switch_rtp.c

Log:
update

Modified: freeswitch/trunk/src/switch_rtp.c
==============================================================================
--- freeswitch/trunk/src/switch_rtp.c	(original)
+++ freeswitch/trunk/src/switch_rtp.c	Sat Feb 17 23:37:06 2007
@@ -567,7 +567,7 @@
 
 SWITCH_DECLARE(uint8_t) switch_rtp_ready(switch_rtp_t *rtp_session)
 {
-	return (rtp_session != NULL && rtp_session->ready) ? 1 : 0;
+	return (rtp_session != NULL && rtp_session->sock && rtp_session->ready) ? 1 : 0;
 }
 
 SWITCH_DECLARE(void) switch_rtp_destroy(switch_rtp_t **rtp_session)
@@ -576,6 +576,8 @@
 		return;
 	}
 
+	rtp_session->ready = 0;
+
 	switch_mutex_lock((*rtp_session)->flag_mutex);
 	
 	if ((*rtp_session)->dtmf_data.dtmf_buffer) {
@@ -760,7 +762,7 @@
 		rtp_session->last_time = switch_time_now();
 	}
 
-	while(rtp_session->ready) {
+	while(switch_rtp_ready(rtp_session)) {
 		bytes = sizeof(rtp_msg_t);	
 		status = switch_socket_recvfrom(rtp_session->from_addr, rtp_session->sock, 0, (void *)&rtp_session->recv_msg, &bytes);
 



More information about the Freeswitch-svn mailing list