diff options
author | rmudgett <rmudgett@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-11-12 02:41:13 +0000 |
---|---|---|
committer | rmudgett <rmudgett@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-11-12 02:41:13 +0000 |
commit | 974ccb7b0efb2e06058b37eef72a9c771525fec8 (patch) | |
tree | 0c92fb27a6eee692f0c0de4727ffb50127a62d91 /channels | |
parent | c752a2ae5f077400688f0970d42bb5292aa4e17d (diff) |
Asterisk is getting a "No D-channels available!" warning message every 4 seconds.
Asterisk is just whining too much with this message: "No D-channels
available! Using Primary channel XXX as D-channel anyway!".
Filtered the message so it only comes out once if there is no D channel
available without an intervening D channel available period.
(closes issue #17270)
Reported by: jmls
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@294821 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_dahdi.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c index b508a8a6a..8d05084c1 100644 --- a/channels/chan_dahdi.c +++ b/channels/chan_dahdi.c @@ -348,6 +348,8 @@ struct dahdi_pri { #ifdef HAVE_PRI_INBANDDISCONNECT unsigned int inbanddisconnect:1; /*!< Should we support inband audio after receiving DISCONNECT? */ #endif + /*! TRUE if we have already whined about no D channels available. */ + unsigned int no_d_channels:1; time_t lastreset; /*!< time when unused channels were last reset */ long resetinterval; /*!< Interval (in seconds) for resetting unused channels */ struct dahdi_pvt *pvts[MAX_CHANNELS]; /*!< Member channel pvt structs */ @@ -2820,8 +2822,14 @@ static int pri_find_dchan(struct dahdi_pri *pri) } if (newslot < 0) { newslot = 0; - ast_log(LOG_WARNING, "No D-channels available! Using Primary channel %d as D-channel anyway!\n", - pri->dchannels[newslot]); + if (!pri->no_d_channels) { + pri->no_d_channels = 1; + ast_log(LOG_WARNING, + "No D-channels available! Using Primary channel %d as D-channel anyway!\n", + pri->dchannels[newslot]); + } + } else { + pri->no_d_channels = 0; } if (old && (oldslot != newslot)) ast_log(LOG_NOTICE, "Switching from from d-channel %d to channel %d!\n", @@ -9395,6 +9403,7 @@ static void *pri_dchannel(void *vpri) switch (e->e) { case PRI_EVENT_DCHAN_UP: + pri->no_d_channels = 0; if (!pri->pri) pri_find_dchan(pri); /* Note presense of D-channel */ |