switch_mutex_unlock(channel->profile_mutex);
}
+ switch_set_flag(channel, CF_BREAK);
+ switch_clear_flag(channel, CF_BROADCAST);
+
if (channel->state < CS_HANGUP) {
switch_event_t *event;
switch_channel_state_t last_state = channel->state;
-
+
channel->state = CS_HANGUP;
channel->hangup_cause = hangup_cause;
switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, NULL, SWITCH_LOG_NOTICE, "Hangup %s [%s] [%s]\n",
switch_hash_this(hi, NULL, NULL, &val);
if (val) {
session = (switch_core_session_t *) val;
+ switch_core_session_read_lock(session);
+
channel = switch_core_session_get_channel(session);
switch_channel_hangup(channel, cause);
- switch_core_session_kill_channel(session, SWITCH_SIG_KILL);
+
+ switch_core_session_rwunlock(session);
}
}
switch_mutex_unlock(runtime.throttle_mutex);