]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
update
authorAnthony Minessale <anthony.minessale@gmail.com>
Mon, 10 Mar 2008 19:04:01 +0000 (19:04 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Mon, 10 Mar 2008 19:04:01 +0000 (19:04 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7853 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/mod_sofia.c
src/switch_core_io.c

index 4dfb4f8a6803222c25bc5b5609f82b725ef29b8a..505c63a08e00ab47548097ac7cc4aa3e7ccb4f53 100644 (file)
@@ -636,7 +636,9 @@ static switch_status_t sofia_kill_channel(switch_core_session_t *session, int si
 {
        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:
index 8c7ba6a6c16110f260b4531ee5b98502c1a956f3..cb93861ec19ee1952c95cc4816de300c38b9f5e0 100644 (file)
@@ -40,6 +40,11 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_video_frame(switch_cor
        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_DECLARE(switch_status_t) switch_core_session_read_video_frame(switch_core
        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 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi
        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_DECLARE(switch_status_t) switch_core_session_write_frame(switch_core_sess
        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_DECLARE(switch_status_t) switch_core_session_recv_dtmf(switch_core_sessio
        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_DECLARE(switch_status_t) switch_core_session_send_dtmf(switch_core_sessio
        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 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_send_dtmf_string(switch_core
        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;
        }