diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-03-08 15:59:42 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-03-08 15:59:42 +0000 |
commit | 242c5ef0b21ca32290cb4fea84fd3e72306e44b2 (patch) | |
tree | ab696704058211c5a51fa765741f173eb9f9fec5 /channels/chan_zap.c | |
parent | 6def40f01dda472968e36092ff681a6085cb0f69 (diff) |
don't generate D-Channel "up" and "down" messages unless the channel state is actually changing; also, generate the "up" message when an implicit "up" occurs due to reception of a normal event when we thought the channel was "down"
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@106945 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_zap.c')
-rw-r--r-- | channels/chan_zap.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/channels/chan_zap.c b/channels/chan_zap.c index 0c33f6286..9d2400ec4 100644 --- a/channels/chan_zap.c +++ b/channels/chan_zap.c @@ -8555,8 +8555,20 @@ static void *pri_dchannel(void *vpri) if (e) { if (pri->debug) pri_dump_event(pri->dchans[which], e); - if (e->e != PRI_EVENT_DCHAN_DOWN) + + if (e->e != PRI_EVENT_DCHAN_DOWN) { + if (!(pri->dchanavail[which] & DCHAN_UP)) { + if (option_verbose > 1) + ast_verbose(VERBOSE_PREFIX_2 "%s D-Channel on span %d up\n", pri_order(which), pri->span); + } pri->dchanavail[which] |= DCHAN_UP; + } else { + if (pri->dchanavail[which] & DCHAN_UP) { + if (option_verbose > 1) + ast_verbose(VERBOSE_PREFIX_2 "%s D-Channel on span %d down\n", pri_order(which), pri->span); + } + pri->dchanavail[which] &= ~DCHAN_UP; + } if ((e->e != PRI_EVENT_DCHAN_UP) && (e->e != PRI_EVENT_DCHAN_DOWN) && (pri->pri != pri->dchans[which])) /* Must be an NFAS group that has the secondary dchan active */ @@ -8564,9 +8576,6 @@ static void *pri_dchannel(void *vpri) switch (e->e) { case PRI_EVENT_DCHAN_UP: - if (option_verbose > 1) - ast_verbose(VERBOSE_PREFIX_2 "%s D-Channel on span %d up\n", pri_order(which), pri->span); - pri->dchanavail[which] |= DCHAN_UP; if (!pri->pri) pri_find_dchan(pri); /* Note presense of D-channel */ @@ -8585,9 +8594,6 @@ static void *pri_dchannel(void *vpri) } break; case PRI_EVENT_DCHAN_DOWN: - if (option_verbose > 1) - ast_verbose(VERBOSE_PREFIX_2 "%s D-Channel on span %d down\n", pri_order(which), pri->span); - pri->dchanavail[which] &= ~DCHAN_UP; pri_find_dchan(pri); if (!pri_is_up(pri)) { pri->resetting = 0; |