[svn-commits] irroot: branch irroot/distrotech-customers-1.8 r344959 - /team/irroot/distrot...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Sat Nov 12 08:37:00 CST 2011


Author: irroot
Date: Sat Nov 12 08:36:56 2011
New Revision: 344959

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=344959
Log:
Fixup wrap arround in chan_misdn round robin routing

Modified:
    team/irroot/distrotech-customers-1.8/channels/chan_misdn.c

Modified: team/irroot/distrotech-customers-1.8/channels/chan_misdn.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/distrotech-customers-1.8/channels/chan_misdn.c?view=diff&rev=344959&r1=344958&r2=344959
==============================================================================
--- team/irroot/distrotech-customers-1.8/channels/chan_misdn.c (original)
+++ team/irroot/distrotech-customers-1.8/channels/chan_misdn.c Sat Nov 12 08:36:56 2011
@@ -7889,6 +7889,7 @@
 			int port_up;
 			int check;
 			int maxbchans;
+			int wraped = 0;
 
 			if (!rr->port) {
 				rr->port = misdn_cfg_get_next_port_spin(0);
@@ -7924,6 +7925,11 @@
 					maxbchans = misdn_lib_get_maxchans(rr->port);
 
 					for (;rr->channel <= maxbchans;rr->channel++) {
+						/* ive come full circle and can stop now */
+						if (wraped && (rr->port == port_start) && (rr->channel == bchan_start)) {
+							break;
+						}
+
 						chan_misdn_log(4, rr->port, "Checking channel %d\n",  rr->channel);
 
 						if ((newbc = misdn_lib_get_free_bc(rr->port, rr->channel, 0, 0))) {
@@ -7938,9 +7944,9 @@
 					}
 
 				}
+				wraped = 1;
 			} while (!newbc && (rr->port > 0) &&
 				 ((rr->port != port_start) || ((rr->port == port_start) && (rr->channel < bchan_start))));
-
 		} else {
 			for (port = misdn_cfg_get_next_port(0); port > 0;
 				port = misdn_cfg_get_next_port(port)) {




More information about the svn-commits mailing list