[Freeswitch-svn] [commit] r7853 - in freeswitch/trunk/src: . mod/endpoints/mod_sofia

Freeswitch SVN anthm at freeswitch.org
Mon Mar 10 15:04:01 EDT 2008


Author: anthm
Date: Mon Mar 10 15:04:01 2008
New Revision: 7853

Modified:
   freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
   freeswitch/trunk/src/switch_core_io.c

Log:
update

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c	Mon Mar 10 15:04:01 2008
@@ -636,7 +636,9 @@
 {
 	private_object_t *tech_pvt = switch_core_session_get_private(session);
 
-	switch_assert(tech_pvt != NULL);
+	if (!tech_pvt) {
+		return SWITCH_STATUS_FALSE;
+	}
 
 	switch (sig) {
 	case SWITCH_SIG_BREAK:

Modified: freeswitch/trunk/src/switch_core_io.c
==============================================================================
--- freeswitch/trunk/src/switch_core_io.c	(original)
+++ freeswitch/trunk/src/switch_core_io.c	Mon Mar 10 15:04:01 2008
@@ -40,6 +40,11 @@
 	switch_io_event_hook_video_write_frame_t *ptr;
 	switch_status_t status = SWITCH_STATUS_FALSE;
 	switch_io_flag_t flags = 0;
+
+	if (switch_channel_get_state(session->channel) >= CS_HANGUP) {
+		return SWITCH_STATUS_FALSE;
+	}
+
 	if (session->endpoint_interface->io_routines->write_video_frame) {
 		if ((status = session->endpoint_interface->io_routines->write_video_frame(session, frame, timeout, flags, stream_id)) == SWITCH_STATUS_SUCCESS) {
 			for (ptr = session->event_hooks.video_write_frame; ptr; ptr = ptr->next) {
@@ -57,6 +62,10 @@
 	switch_status_t status = SWITCH_STATUS_FALSE;
 	switch_io_event_hook_video_read_frame_t *ptr;
 
+	if (switch_channel_get_state(session->channel) >= CS_HANGUP) {
+		return SWITCH_STATUS_FALSE;
+	}
+
 	if (session->endpoint_interface->io_routines->read_video_frame) {
 		if ((status =
 			 session->endpoint_interface->io_routines->read_video_frame(session, frame, timeout, SWITCH_IO_FLAG_NOOP, stream_id)) == SWITCH_STATUS_SUCCESS) {
@@ -97,6 +106,11 @@
 	unsigned int flag = 0;
   top:
 
+	if (switch_channel_get_state(session->channel) >= CS_HANGUP) {
+		return SWITCH_STATUS_FALSE;
+	}
+
+
 	status = SWITCH_STATUS_FALSE;
 	need_codec = perfect = 0;
 
@@ -466,6 +480,9 @@
 	switch_assert(session != NULL);
 	switch_assert(frame != NULL);
 
+	if (switch_channel_get_state(session->channel) >= CS_HANGUP) {
+		return SWITCH_STATUS_FALSE;
+	}
 
 	if (switch_channel_test_flag(session->channel, CF_HOLD)) {
 		return SWITCH_STATUS_SUCCESS;
@@ -917,6 +934,10 @@
 	switch_status_t status;
 	switch_dtmf_t new_dtmf;
 	
+	if (switch_channel_get_state(session->channel) >= CS_HANGUP) {
+		return SWITCH_STATUS_FALSE;
+	}
+
 	switch_assert(dtmf);
 
 	new_dtmf = *dtmf;
@@ -943,6 +964,10 @@
 	switch_status_t status = SWITCH_STATUS_FALSE;
 	switch_dtmf_t new_dtmf;
 	
+	if (switch_channel_get_state(session->channel) >= CS_HANGUP) {
+		return SWITCH_STATUS_FALSE;
+	}
+
 	switch_assert(dtmf);
 
 	new_dtmf = *dtmf;
@@ -983,9 +1008,13 @@
 	int i, argc;
 	char *argv[256];
 	
-
 	switch_assert(session != NULL);
 
+
+	if (switch_channel_get_state(session->channel) >= CS_HANGUP) {
+		return SWITCH_STATUS_FALSE;
+	}
+	
 	if (switch_strlen_zero(dtmf_string)) {
 		return SWITCH_STATUS_FALSE;
 	}



More information about the Freeswitch-svn mailing list