[Freeswitch-svn] [commit] r9811 - in freeswitch/trunk: scripts/trace src

Freeswitch SVN anthm at freeswitch.org
Fri Oct 3 14:14:12 EDT 2008


Author: anthm
Date: Fri Oct  3 14:14:11 2008
New Revision: 9811

Modified:
   freeswitch/trunk/scripts/trace/sipgrep
   freeswitch/trunk/src/switch_ivr.c

Log:
write cng frames during sleep

Modified: freeswitch/trunk/scripts/trace/sipgrep
==============================================================================
--- freeswitch/trunk/scripts/trace/sipgrep	(original)
+++ freeswitch/trunk/scripts/trace/sipgrep	Fri Oct  3 14:14:11 2008
@@ -17,8 +17,8 @@
 $COLORS{'viabranch'} = 'bold cyan';
 
 $limit=2000;
-$ngrep="/usr/local/bin/ngrep"; #path to NGREP
-$ngrep_flags="-l"; # Flag for Ngrep
+$ngrep="/usr/bin/ngrep"; #path to NGREP
+$ngrep_flags="-l -d eth1"; # Flag for Ngrep
 
 $colorsmethods="INVITE|REGISTER|BYE|ACK|CANCEL|OPTIONS|REFER|NOTIFY|MESSAGE|INFO|PRACK|UPDATE";
 

Modified: freeswitch/trunk/src/switch_ivr.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr.c	(original)
+++ freeswitch/trunk/src/switch_ivr.c	Fri Oct  3 14:14:11 2008
@@ -43,8 +43,14 @@
 	switch_channel_t *channel = switch_core_session_get_channel(session);
 	switch_status_t status = SWITCH_STATUS_SUCCESS;
 	switch_time_t start = switch_timestamp_now(), now, done = switch_timestamp_now() + (ms * 1000);
-	switch_frame_t *read_frame;
+	switch_frame_t *read_frame, cng_frame = { 0 };
 	int32_t left, elapsed;
+	char data[2] = "";
+
+	cng_frame.data = data;
+	cng_frame.datalen = 2;
+	cng_frame.buflen = 2;
+	cng_frame.flags = SFF_CNG;
 
 	for (;;) {
 		now = switch_timestamp_now();
@@ -119,6 +125,9 @@
 				break;
 			}
 		}
+
+		switch_core_session_write_frame(session, &cng_frame, SWITCH_IO_FLAG_NONE, 0);
+
 	}
 
 	return status;



More information about the Freeswitch-svn mailing list