Review Board 1.7.16


Add a name to a sig_pri span

Review Request #800 - Created July 25, 2010 and updated

Tzafrir Cohen
/trunk
Reviewers
asterisk-dev
rmudgett
Asterisk
sig_pri of chan_dahdi gives annoying messages such as:

[Jul 25 20:58:14] WARNING[2289]: sig_pri.c:985 pri_find_dchan: No D-channels available.  Using Primary channel as D-channel anyway.
[Jul 25 20:58:14] WARNING[2290]: sig_pri.c:985 pri_find_dchan: No D-channels available.  Using Primary channel as D-channel anyway.
[Jul 25 20:58:14] WARNING[2287]: sig_pri.c:985 pri_find_dchan: No D-channels available.  Using Primary channel as D-channel anyway.
[Jul 25 20:58:14] WARNING[2288]: sig_pri.c:985 pri_find_dchan: No D-channels available.  Using Primary channel as D-channel anyway.

This change is intended to transform them to equally annoying and yet slightly more meaningful messages:
 
[Jul 25 20:58:14] WARNING[2289]: sig_pri.c:985 pri_find_dchan: Span DAHDI/3: No D-channels available.  Using Primary channel as D-channel anyway.
[Jul 25 20:58:14] WARNING[2290]: sig_pri.c:985 pri_find_dchan: Span DAHDI/4: No D-channels available.  Using Primary channel as D-channel anyway.
[Jul 25 20:58:14] WARNING[2287]: sig_pri.c:985 pri_find_dchan: Span DAHDI/1: No D-channels available.  Using Primary channel as D-channel anyway.
[Jul 25 20:58:14] WARNING[2288]: sig_pri.c:985 pri_find_dchan: Span DAHDI/2: No D-channels available.  Using Primary channel as D-channel anyway.

As for the original issue, see https://issues.asterisk.org/view.php?id=17270 .

This fix adds a field called 'name' to the struct sig_pri_span, and uses it when displaying span information, and also in that specific message as a demonstration.

Note that the code in chan_dahdi.c:mkintf() at that point could use some indentation-level reduction as well at the same spot.
Lightly tested loading, unloading and such.
Review request changed
Updated (July 27, 2010, 9:46 a.m.)
Addresses rmugget's comments.
Posted (July 27, 2010, 10:05 a.m.)

   

  
/trunk/channels/chan_dahdi.c (Diff revision 2)
 
 
 
 
For chan_dahdi, the name should be just "%d" so it could replace sig_pri_span.span entirely.
/trunk/channels/sig_pri.c (Diff revision 2)
 
 
I think the S in switching should still be capitalized.
/trunk/channels/sig_pri.c (Diff revision 2)
 
 
I think the U in unable should still be capitalized.
/trunk/channels/sig_pri.c (Diff revision 2)
 
 
For consistency should change to "Span: %s\n".

https://reviewboard.asterisk.org/ runs on a server provided by Digium, Inc. and uses bandwidth donated to the open source Asterisk community by API Digital Communications in Huntsville, AL USA.
Please report problems with this site to asteriskteam@digium.com.