[asterisk-dev] [Code Review] Add a name to a sig_pri span

Tzafrir Cohen tzafrir.cohen at xorcom.com
Tue Jul 27 14:46:59 CDT 2010



> On 2010-07-26 12:41:35, rmudgett wrote:
> > I like the idea of a sig_pri_span.name[] member in the struct.  However, I see it as a replacement for the sig_pri_span.span member.  Thus, wherever span is used would be replaced with name instead.  For chan_dahdi, the name should be simply an ASCII number string to be compatible with the few places where span is used for something other than log messages.
> > 
> > If your intention was to just change the annoying diagnostic message, this is overkill.

No. That message was not the only message lacking a proper identifier. I started adding a few more examples. Original message had a span number.

I didn't bother going through all of them. Want me to?


> On 2010-07-26 12:41:35, rmudgett wrote:
> > /trunk/channels/sig_pri.h, line 288
> > <https://reviewboard.asterisk.org/r/800/diff/1/?file=11894#file11894line288>
> >
> >     How about using AST_CHANNEL_NAME here instead of 20.

Done


> On 2010-07-26 12:41:35, rmudgett wrote:
> > /trunk/channels/sig_pri.c, line 7064
> > <https://reviewboard.asterisk.org/r/800/diff/1/?file=11895#file11895line7064>
> >
> >     This is going to be constant for all D channels in the span.  At the minimum it should be moved outside the for loop.
> >     
> >     The same can be said about the "Overlap Recv" line a couple lines below even though you did not add this line.

Done. I might as well remove that line.


- Tzafrir


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/800/#review2470
-----------------------------------------------------------


On 2010-07-27 14:46:52, Tzafrir Cohen wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/800/
> -----------------------------------------------------------
> 
> (Updated 2010-07-27 14:46:52)
> 
> 
> Review request for Asterisk Developers and rmudgett.
> 
> 
> Summary
> -------
> 
> 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.
> 
> 
> Diffs
> -----
> 
>   /trunk/channels/chan_dahdi.c 279783 
>   /trunk/channels/sig_pri.h 279783 
>   /trunk/channels/sig_pri.c 279783 
> 
> Diff: https://reviewboard.asterisk.org/r/800/diff
> 
> 
> Testing
> -------
> 
> Lightly tested loading, unloading and such.
> 
> 
> Thanks,
> 
> Tzafrir
> 
>




More information about the asterisk-dev mailing list