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.

Diff revision 2 (Latest)

1 2
1 2

  1. /trunk/channels/chan_dahdi.c: Loading...
  2. /trunk/channels/sig_pri.h: Loading...
  3. /trunk/channels/sig_pri.c: Loading...
/trunk/channels/chan_dahdi.c
Revision 279783 New Change
[20] 12046 lines
[+20] [+] static struct dahdi_pvt *mkintf(int channel, const struct dahdi_chan_conf *conf, int reloading)
12047
							}
12047
							}
12048
						}
12048
						}
12049
						ast_cc_copy_config_params(tmp->pri->cc_params,
12049
						ast_cc_copy_config_params(tmp->pri->cc_params,
12050
							conf->chan.cc_params);
12050
							conf->chan.cc_params);
12051

    
   
12051

   

    
   
12052
						snprintf(pris[span].pri.name,

    
   
12053
							sizeof(pris[span].pri.name),

    
   
12054
							"DAHDI/%d", span + 1);
12052
						pris[span].pri.sig = chan_sig;
12055
						pris[span].pri.sig = chan_sig;
12053
						pris[span].pri.nodetype = conf->pri.pri.nodetype;
12056
						pris[span].pri.nodetype = conf->pri.pri.nodetype;
12054
						pris[span].pri.switchtype = myswitchtype;
12057
						pris[span].pri.switchtype = myswitchtype;
12055
						pris[span].pri.nsf = conf->pri.pri.nsf;
12058
						pris[span].pri.nsf = conf->pri.pri.nsf;
12056
						pris[span].pri.dialplan = conf->pri.pri.dialplan;
12059
						pris[span].pri.dialplan = conf->pri.pri.dialplan;
[+20] [20] 5878 lines
/trunk/channels/sig_pri.h
Revision 279783 New Change
 
/trunk/channels/sig_pri.c
Revision 279783 New Change
 
  1. /trunk/channels/chan_dahdi.c: Loading...
  2. /trunk/channels/sig_pri.h: Loading...
  3. /trunk/channels/sig_pri.c: Loading...

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.