add some robustness to deal with runaway threads

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5140 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale committed 2007-05-11 00:27:55 +00:00
1 parent 6b1f10b9e9
commit 1cb336eaf0
10 files changed
+94 -19

No files matched your search

@@ -1562,6 +1562,12 @@ static int on_ring(struct sangoma_pri *spri, sangoma_pri_event_t event_type, pri
switch_copy_string(chanmap->map[pevent->ring.channel], switch_core_session_get_uuid(session), sizeof(chanmap->map[pevent->ring.channel]));
switch_channel_set_state(channel, CS_INIT);
if (switch_core_session_thread_launch(session) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Error spawning thread\n");
switch_core_session_destroy(&session);
ret = 0;
goto done;
}
switch_core_session_thread_launch(session);
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cannot Create new Inbound Channel!\n");