[Freeswitch-svn] [commit] r6869 - in freeswitch/trunk: libs/stfu src

Freeswitch SVN mikej at freeswitch.org
Tue Dec 18 12:50:40 EST 2007


Author: mikej
Date: Tue Dec 18 12:50:39 2007
New Revision: 6869

Modified:
   freeswitch/trunk/libs/stfu/stfu.c
   freeswitch/trunk/src/switch_ivr.c
   freeswitch/trunk/src/switch_ivr_originate.c
   freeswitch/trunk/src/switch_ivr_play_say.c

Log:
cleanups

Modified: freeswitch/trunk/libs/stfu/stfu.c
==============================================================================
--- freeswitch/trunk/libs/stfu/stfu.c	(original)
+++ freeswitch/trunk/libs/stfu/stfu.c	Tue Dec 18 12:50:39 2007
@@ -81,7 +81,9 @@
 	struct stfu_instance *i;
 
 	i = malloc(sizeof(*i));
-	assert(i != NULL);
+	if (!i) {
+		return NULL;
+	}
 	memset(i, 0, sizeof(*i));
 	stfu_n_init_aqueue(&i->a_queue, qlen);
 	stfu_n_init_aqueue(&i->b_queue, qlen);

Modified: freeswitch/trunk/src/switch_ivr.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr.c	(original)
+++ freeswitch/trunk/src/switch_ivr.c	Tue Dec 18 12:50:39 2007
@@ -441,7 +441,7 @@
 					switch_byte_t decoded[SWITCH_RECOMMENDED_BUFFER_SIZE];
 					uint32_t rate = read_codec->implementation->actual_samples_per_second;
 					uint32_t dlen = sizeof(decoded);
-					switch_status_t status;
+					switch_status_t tstatus;
 					switch_byte_t *sendbuf = NULL;
 					uint32_t sendlen = 0;
 
@@ -452,9 +452,9 @@
 						status = SWITCH_STATUS_SUCCESS;
 					} else {
 						if (switch_test_flag(conninfo, SUF_NATIVE)) {
-							status = SWITCH_STATUS_NOOP;
+							tstatus = SWITCH_STATUS_NOOP;
 						} else {
-							status = switch_core_codec_decode(
+							tstatus = switch_core_codec_decode(
 															  read_codec,
 															  &conninfo->read_codec,
 															  read_frame->data,
@@ -462,17 +462,17 @@
 															  read_codec->implementation->actual_samples_per_second,
 															  decoded, &dlen, &rate, &flags);
 						}
-						switch (status) {
+						switch (tstatus) {
 						case SWITCH_STATUS_NOOP:
 						case SWITCH_STATUS_BREAK:
 							sendbuf = read_frame->data;
 							sendlen = read_frame->datalen;
-							status = SWITCH_STATUS_SUCCESS;
+							tstatus = SWITCH_STATUS_SUCCESS;
 							break;
 						case SWITCH_STATUS_SUCCESS:
 							sendbuf = decoded;
 							sendlen = dlen;
-							status = SWITCH_STATUS_SUCCESS;
+							tstatus = SWITCH_STATUS_SUCCESS;
 							break;
 						default:
 							switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Codec Error\n");
@@ -481,7 +481,7 @@
 						}
 					}
 
-					if (status == SWITCH_STATUS_SUCCESS) {
+					if (tstatus == SWITCH_STATUS_SUCCESS) {
 						len = sendlen;
 						if (switch_socket_sendto(conninfo->socket, conninfo->remote_addr, 0, (void *)sendbuf, &len) != SWITCH_STATUS_SUCCESS) {
 							switch_ivr_deactivate_unicast(session);

Modified: freeswitch/trunk/src/switch_ivr_originate.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr_originate.c	(original)
+++ freeswitch/trunk/src/switch_ivr_originate.c	Tue Dec 18 12:50:39 2007
@@ -785,9 +785,9 @@
 				/* read from the channel while we wait if the audio is up on it */
 				if (session && (ringback_data || !switch_channel_test_flag(caller_channel, CF_BYPASS_MEDIA)) &&
 					(switch_channel_test_flag(caller_channel, CF_ANSWERED) || switch_channel_test_flag(caller_channel, CF_EARLY_MEDIA))) {
-					switch_status_t status = switch_core_session_read_frame(session, &read_frame, 1000, 0);
+					switch_status_t tstatus = switch_core_session_read_frame(session, &read_frame, 1000, 0);
 					
-					if (!SWITCH_READ_ACCEPTABLE(status)) {
+					if (!SWITCH_READ_ACCEPTABLE(tstatus)) {
 						break;
 					}
 					

Modified: freeswitch/trunk/src/switch_ivr_play_say.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr_play_say.c	(original)
+++ freeswitch/trunk/src/switch_ivr_play_say.c	Tue Dec 18 12:50:39 2007
@@ -1063,13 +1063,13 @@
 			}
 		} else {				/* time off the channel (if you must) */
 			switch_frame_t *read_frame;
-			switch_status_t status;
+			switch_status_t tstatus;
 			while (switch_channel_ready(channel) && switch_channel_test_flag(channel, CF_HOLD)) {
 				switch_yield(10000);
 			}
-			status = switch_core_session_read_frame(session, &read_frame, -1, 0);
+			tstatus = switch_core_session_read_frame(session, &read_frame, -1, 0);
 
-			if (!SWITCH_READ_ACCEPTABLE(status)) {
+			if (!SWITCH_READ_ACCEPTABLE(tstatus)) {
 				break;
 			}
 
@@ -1387,13 +1387,13 @@
 				}
 			} else {
 				switch_frame_t *read_frame;
-				switch_status_t status = switch_core_session_read_frame(session, &read_frame, -1, 0);
+				switch_status_t tstatus = switch_core_session_read_frame(session, &read_frame, -1, 0);
 
 				while (switch_channel_ready(channel) && switch_channel_test_flag(channel, CF_HOLD)) {
 					switch_yield(10000);
 				}
 
-				if (!SWITCH_READ_ACCEPTABLE(status)) {
+				if (!SWITCH_READ_ACCEPTABLE(tstatus)) {
 					break;
 				}
 
@@ -1450,13 +1450,13 @@
 			}
 		} else {				/* time off the channel (if you must) */
 			switch_frame_t *read_frame;
-			switch_status_t status = switch_core_session_read_frame(session, &read_frame, -1, 0);
+			switch_status_t tstatus = switch_core_session_read_frame(session, &read_frame, -1, 0);
 
 			while (switch_channel_ready(channel) && switch_channel_test_flag(channel, CF_HOLD)) {
 				switch_yield(10000);
 			}
 
-			if (!SWITCH_READ_ACCEPTABLE(status)) {
+			if (!SWITCH_READ_ACCEPTABLE(tstatus)) {
 				break;
 			}
 



More information about the Freeswitch-svn mailing list