[asterisk-commits] irroot: branch irroot/distrotech-customers-1.8 r334218 - /team/irroot/distrot...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Sep 1 08:32:28 CDT 2011


Author: irroot
Date: Thu Sep  1 08:32:24 2011
New Revision: 334218

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=334218
Log:
chan_misdn.c round robin routing does not work well it will only use one channel on a port 
im happy with it using any available channel on a port that is selected.


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=334218&r1=334217&r2=334218
==============================================================================
--- team/irroot/distrotech-customers-1.8/channels/chan_misdn.c (original)
+++ team/irroot/distrotech-customers-1.8/channels/chan_misdn.c Thu Sep  1 08:32:24 2011
@@ -7871,9 +7871,7 @@
 		}
 
 		if (rr) {
-			int robin_channel = rr->channel;
 			int port_start;
-			int next_chan = 1;
 
 			do {
 				port_start = 0;
@@ -7884,19 +7882,6 @@
 						port_start = port;
 					}
 
-					if (port >= port_start) {
-						next_chan = 1;
-					}
-
-					if (port <= port_start && next_chan) {
-						int maxbchans = misdn_lib_get_maxchans(port);
-
-						if (++robin_channel >= maxbchans) {
-							robin_channel = 1;
-						}
-						next_chan = 0;
-					}
-
 					misdn_cfg_get(port, MISDN_CFG_GROUPNAME, cfg_group, sizeof(cfg_group));
 
 					if (!strcasecmp(cfg_group, group)) {
@@ -7914,13 +7899,11 @@
 							ast_log(LOG_WARNING, "This port (%d) is blocked\n", port);
 						}
 
-						if (port_up > 0)	{
-							newbc = misdn_lib_get_free_bc(port, robin_channel, 0, 0);
+						if (port_up > 0) {
+							newbc = misdn_lib_get_free_bc(port, 0, 0, dec);
 							if (newbc) {
 								chan_misdn_log(4, port, " Success! Found port:%d channel:%d\n", newbc->port, newbc->channel);
-								if (port_up) {
-									chan_misdn_log(4, port, "portup:%d\n",  port_up);
-								}
+								chan_misdn_log(4, port, "portup:%d\n",  port_up);
 								rr->port = newbc->port;
 								rr->channel = newbc->channel;
 								break;
@@ -7928,7 +7911,7 @@
 						}
 					}
 				}
-			} while (!newbc && robin_channel != rr->channel);
+			} while (!newbc);
 		} else {
 			for (port = misdn_cfg_get_next_port(0); port > 0;
 				port = misdn_cfg_get_next_port(port)) {




More information about the asterisk-commits mailing list