--- ../clean/asterisk-1.4.12/channels/chan_misdn.c 2007-10-03 14:22:30.000000000 +0200 +++ channels/chan_misdn.c 2007-10-07 22:51:40.000000000 +0200 @@ -3141,8 +3141,7 @@ if (!rr->port) rr->port = misdn_cfg_get_next_port_spin(rr->port); - for (; rr->port > 0 && rr->port != port_start; - rr->port = misdn_cfg_get_next_port_spin(rr->port)) { + for (; rr->port > 0; rr->port = misdn_cfg_get_next_port_spin(rr->port)) { int port_up; int check; int max_chan; @@ -3164,6 +3163,9 @@ if (check && port_up < 0) ast_log(LOG_WARNING,"This port (%d) is blocked\n", rr->port); + if ((port_start == rr->port) && (port_up < 0)) + break; + if (port_up <= 0) continue;