--- ../original/asterisk-1.2.13/channel.c 2006-09-27 19:54:30.000000000 +0300 +++ ./channel.c 2006-11-20 19:12:19.000000000 +0200 @@ -353,12 +353,15 @@ void ast_channel_unregister(const struct ast_channel_tech *tech) { struct chanlist *chan, *last=NULL; - if (option_debug) + if (option_debug && tech && tech->type ) ast_log(LOG_DEBUG, "Unregistering channel type '%s'\n", tech->type); + else if (option_debug) + ast_log(LOG_DEBUG, "Unregistering channel, tech is NULL!!!\n"); + ast_mutex_lock(&chlock); chan = backends; while (chan) { @@ -3508,14 +3511,15 @@ to = -1; if (!ast_tvzero(nexteventts)) { now = ast_tvnow(); to = ast_tvdiff_ms(nexteventts, now); - if (to <= 0) { + if (to <= 0 && !config->timelimit) { res = AST_BRIDGE_COMPLETE; break; - } + } + } if (config->timelimit) { time_left_ms = config->timelimit - ast_tvdiff_ms(now, config->start_time); if (time_left_ms < to) @@ -3531,11 +3535,11 @@ *rc = who; res = 0; break; } - if (!to) { + if (to <= 0) { if (time_left_ms >= 5000) { /* force the time left to round up if appropriate */ if (caller_warning && config->warning_sound && config->play_warning) bridge_playfile(c0, c1, config->warning_sound, (time_left_ms + 500) / 1000); @@ -3642,12 +3646,10 @@ } o0nativeformats = c0->nativeformats; o1nativeformats = c1->nativeformats; } res = ast_generic_bridge(c0, c1, config, fo, rc, nexteventts); - if (res != AST_BRIDGE_RETRY) - break; } c0->_bridge = NULL; c1->_bridge = NULL;