]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
added RR patch from iroot #10908, thanks.
authorChristian Richter <christian.richter@beronet.com>
Tue, 20 Nov 2007 13:40:55 +0000 (13:40 +0000)
committerChristian Richter <christian.richter@beronet.com>
Tue, 20 Nov 2007 13:40:55 +0000 (13:40 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89445 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_misdn.c

index 81577113b3678fd59db9497c049f29592d74f4fd..ac7f2fc245adfb2931cd260b7655607a70c15947 100644 (file)
@@ -3143,16 +3143,12 @@ static struct ast_channel *misdn_request(const char *type, int format, void *dat
                        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;
                                int last_chance = 0;
 
-                               if (!port_start)
-                                       port_start = rr->port;
-
                                misdn_cfg_get(rr->port, MISDN_CFG_GROUPNAME, cfg_group, BUFFERSIZE);
                                if (strcasecmp(cfg_group, group))
                                        continue;
@@ -3166,6 +3162,12 @@ static struct ast_channel *misdn_request(const char *type, int format, void *dat
                                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_start)
+                                       port_start = rr->port;
+
                                if (port_up <= 0)
                                        continue;