[Freeswitch-svn] [commit] r5446 - in freeswitch/trunk: scripts/socket src

Freeswitch SVN anthm at freeswitch.org
Fri Jun 22 23:26:13 EDT 2007


Author: anthm
Date: Fri Jun 22 23:26:12 2007
New Revision: 5446

Modified:
   freeswitch/trunk/scripts/socket/sock.pl
   freeswitch/trunk/src/switch_rtp.c

Log:
avoiding racing cpu (part 2)

Modified: freeswitch/trunk/scripts/socket/sock.pl
==============================================================================
--- freeswitch/trunk/scripts/socket/sock.pl	(original)
+++ freeswitch/trunk/scripts/socket/sock.pl	Fri Jun 22 23:26:12 2007
@@ -21,12 +21,12 @@
 
 $o = $fs->call_command("answer");
 #to turn on events when in async mode
-#$o = $fs->raw_command("myevents");
+$o = $fs->raw_command("myevents");
 $o = $fs->call_command("playback", "/ram/swimp.raw");
 $o = $fs->call_command("hangup");
 
 #comment exit in async mode
-exit;
+#exit;
 
 while(my $r = $fs->readhash(undef)) {
   if ($r->{socketerror}) {

Modified: freeswitch/trunk/src/switch_rtp.c
==============================================================================
--- freeswitch/trunk/src/switch_rtp.c	(original)
+++ freeswitch/trunk/src/switch_rtp.c	Fri Jun 22 23:26:12 2007
@@ -964,12 +964,7 @@
 
 		if (status == SWITCH_STATUS_BREAK || bytes == 0) {
 			if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_DATAWAIT)) {
-				if (rtp_session->ms_per_packet) {
-					switch_yield((rtp_session->ms_per_packet / 1000) * 750);
-				} else {
-					switch_yield(1000);
-				}
-				continue;
+				goto do_continue;
 			}
 			return 0;
 		}
@@ -1005,12 +1000,7 @@
 
 
 		if (bytes && rtp_session->cng_pt && rtp_session->recv_msg.header.pt == rtp_session->cng_pt) {
-			if (rtp_session->ms_per_packet) {
-				switch_yield((rtp_session->ms_per_packet / 1000) * 750);
-			} else {
-				switch_yield(1000);
-			}
-			continue;
+			goto do_continue;
 		}
 		
 
@@ -1059,11 +1049,19 @@
 				}
 			}
 			
-			continue;
+			goto do_continue;
 		}
 	
 
 		break;
+
+	do_continue:
+
+		if (rtp_session->ms_per_packet) {
+			switch_yield((rtp_session->ms_per_packet / 1000) * 750);
+		} else {
+			switch_yield(1000);
+		}
 	}
 
 	*payload_type = (switch_payload_t) rtp_session->recv_msg.header.pt;



More information about the Freeswitch-svn mailing list