fix dtmf after hangup race condition

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4934 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2007-04-14 17:16:31 +00:00
parent f3b1bec5fb
commit 18ae7f381a
1 changed files with 7 additions and 0 deletions

View 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: