]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix dtmf after hangup race condition
authorAnthony Minessale <anthony.minessale@gmail.com>
Sat, 14 Apr 2007 17:16:31 +0000 (17:16 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Sat, 14 Apr 2007 17:16:31 +0000 (17:16 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4934 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_wanpipe/mod_wanpipe.c

index 4e94b2005f85594fafe280bd3639242f914f5600..ec3c202549eaa8fd05fe4cf6205d6c300ce3173a 100644 (file)
@@ -876,6 +876,10 @@ static switch_status_t wanpipe_send_dtmf(switch_core_session_t *session, char *d
        tech_pvt = switch_core_session_get_private(session);
        assert(tech_pvt != NULL);
 
+       if (switch_test_flag(tech_pvt, TFLAG_BYE) || tech_pvt->wpsock->fd < 0) {
+               return SWITCH_STATUS_GENERR;
+       }
+
        if (!tech_pvt->dtmf_buffer) {
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Allocate DTMF Buffer....");
                if (switch_buffer_create_dynamic(&tech_pvt->dtmf_buffer, 1024, 3192, 0) != SWITCH_STATUS_SUCCESS) {
@@ -907,6 +911,9 @@ static switch_status_t wanpipe_receive_message(switch_core_session_t *session, s
        tech_pvt = (private_object_t *) switch_core_session_get_private(session);
        assert(tech_pvt != NULL);
 
+       if (switch_test_flag(tech_pvt, TFLAG_BYE) || tech_pvt->wpsock->fd < 0) {
+               return SWITCH_STATUS_GENERR;
+       }
 
        switch (msg->message_id) {
        case SWITCH_MESSAGE_INDICATE_NOMEDIA: