git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10244 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2008-11-05 00:20:30 +00:00
parent 71f94e0ee5
commit c217d45cf0
11 changed files with 114 additions and 33 deletions
+10 -3
View File
@@ -170,6 +170,7 @@ void sofia_event_callback(nua_event_t event,
switch_core_session_t *session = NULL;
switch_channel_t *channel = NULL;
sofia_gateway_t *gateway = NULL;
int locked = 0;
if (sofia_private && sofia_private != &mod_sofia_globals.destroy_private && sofia_private != &mod_sofia_globals.keep_private) {
if ((gateway = sofia_private->gateway)) {
@@ -203,12 +204,15 @@ void sofia_event_callback(nua_event_t event,
}
if (session) {
switch_mutex_lock(tech_pvt->sofia_mutex);
if (channel && switch_channel_get_state(channel) >= CS_HANGUP) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Channel is already hungup.\n");
goto done;
}
if (tech_pvt) {
switch_mutex_lock(tech_pvt->sofia_mutex);
locked = 1;
}
} else if (sofia_private && sofia_private->is_call) {
sofia_private->destroy_me = 22;
}
@@ -360,9 +364,12 @@ void sofia_event_callback(nua_event_t event,
}
if (session) {
switch_mutex_unlock(tech_pvt->sofia_mutex);
switch_core_session_rwunlock(session);
}
if (tech_pvt && locked) {
switch_mutex_unlock(tech_pvt->sofia_mutex);
}
}
void event_handler(switch_event_t *event)