[asterisk-commits] irroot: branch irroot/distrotech-customers-trunk r334219 - /team/irroot/distr...

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


Author: irroot
Date: Thu Sep  1 08:33:07 2011
New Revision: 334219

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=334219
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-trunk/channels/chan_misdn.c

Modified: team/irroot/distrotech-customers-trunk/channels/chan_misdn.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/distrotech-customers-trunk/channels/chan_misdn.c?view=diff&rev=334219&r1=334218&r2=334219
==============================================================================
--- team/irroot/distrotech-customers-trunk/channels/chan_misdn.c (original)
+++ team/irroot/distrotech-customers-trunk/channels/chan_misdn.c Thu Sep  1 08:33:07 2011
@@ -7873,9 +7873,7 @@
 		}
 
 		if (rr) {
-			int robin_channel = rr->channel;
 			int port_start;
-			int next_chan = 1;
 
 			do {
 				port_start = 0;
@@ -7886,19 +7884,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)) {
@@ -7916,13 +7901,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;
@@ -7930,7 +7913,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