[asterisk-bugs] [DAHDI-linux 0013205]: [patch] bad master selection

Asterisk Bug Tracker noreply at bugs.digium.com
Mon Mar 9 10:01:12 CDT 2009


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=13205 
====================================================================== 
Reported By:                biohumanoid
Assigned To:                kpfleming
====================================================================== 
Project:                    DAHDI-linux
Issue ID:                   13205
Category:                   dahdi (the module)
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     assigned
====================================================================== 
Date Submitted:             2008-07-31 00:11 CDT
Last Modified:              2009-03-09 10:01 CDT
====================================================================== 
Summary:                    [patch] bad master selection
Description: 
Current dahdi master handling work in the following way:
The first SPAN become a master
If a new registered !!! SPAN is preferred , it is the new master
If a span is unregistered - the new master is the first available span
If master SPAN is in alarm state - the new master is the first non in
alarm state SPAN

So
1. dahdi-dummy once loaded will be the master forever.
2. even not-running SPAN can be a master
3. master implementation is ugly...
====================================================================== 

---------------------------------------------------------------------- 
 (0101382) KNK (reporter) - 2009-03-09 10:01
 http://bugs.digium.com/view.php?id=13205#c101382 
---------------------------------------------------------------------- 
I am testing the patch provided from madrouter and it works fine (after
patching the wct4xxp driver too). I have actually changed it a bit:

       /* Good a time as any to check our clock config and
           to switch to other master if current master in alarm */
       master = NULL;
       for (x=1; x<maxspans; x++) {
               if (spans[x] && !spans[x]->alarms) {
                       if (!master || (spans[x]->syncprio > 0 &&
(spans[x]->syncprio < master->syncprio))) {
                               if (spans[x]->syncprio > 0) {
                                       module_printk(KERN_NOTICE, "Span
('%s') is new master with syncprio %d which is better than %d\n",
spans[x]->name, spans[x]->syncprio, (master) ? master->syncprio : 0);
                               }
                               master = spans[x];
                       }
               }
       }

so the first span will become a master if none of them have priority set
and dummy is not loaded. And in case it is loaded it will be used as last
resort (because of the hardcoded prio of 100), so it is perfectly safe to
leave it loaded.
About the order preference for PRI/BRI/analog etc. may be some
weight/offset hardcoded in the driver will do the trick in addition to the
config file clock value 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-03-09 10:01 KNK            Note Added: 0101382                          
======================================================================




More information about the asterisk-bugs mailing list