diff options
author | Richard Mudgett <rmudgett@digium.com> | 2015-04-29 14:29:10 -0500 |
---|---|---|
committer | Joshua Colp <jcolp@digium.com> | 2015-04-30 10:24:48 -0500 |
commit | d3c310a28c801d4d64d4d1763c9c53f6f18a2388 (patch) | |
tree | 94701e350d6abbea158d96f05d82018de719564c /channels/sig_pri.c | |
parent | 37a193da1861193198692c8acc52ac43a5ae5bc1 (diff) |
chan_dahdi: Add the chan_dahdi.conf force_restart_unavailable_chans option.
Some telco switches occasionally ignore ISDN RESTART requests. The fix
for ASTERISK-19608 added an escape clause for B channels in the restarting
state if the telco ignores a RESTART request. If the telco fails to
acknowledge the RESTART then Asterisk will assume the telco acknowledged
the RESTART on the second call attempt requesting the B channel by the
telco. The escape clause is good for dealing with RESTART requests in
general but it does cause the next call for the restarting B channel to be
rejected if the telco insists the call must go on that B channel.
chan_dahdi doesn't really need to issue a RESTART request in response to
receiving a cause 44 (Requested channel not available) code. Sending the
RESTART in such a situation is not required (nor prohibited) by the
standards. I think chan_dahdi does this for historical reasons to deal
with buggy peers to get channels unstuck in a similar fashion as the
chan_dahdi.conf resetinterval option.
* Add the chan_dahdi.conf force_restart_unavailable_chans compatability
option that when disabled will prevent chan_dahdi from trying to RESTART
the channel in response to a cause 44 code.
ASTERISK-25034 #close
Reported by: Richard Mudgett
Change-Id: Ib8b17a438799920f4a2038826ff99a1884042f65
Diffstat (limited to 'channels/sig_pri.c')
-rw-r--r-- | channels/sig_pri.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/channels/sig_pri.c b/channels/sig_pri.c index 395ae354c..a66d16b53 100644 --- a/channels/sig_pri.c +++ b/channels/sig_pri.c @@ -133,15 +133,6 @@ */ //#define ALWAYS_PICK_CHANNEL 1 -/*! - * Define to force a RESTART on a channel that returns a cause - * code of PRI_CAUSE_REQUESTED_CHAN_UNAVAIL(44). If the cause - * is because of a stuck channel on the peer and the channel is - * always the next channel we pick for an outgoing call then - * this can help. - */ -#define FORCE_RESTART_UNAVAIL_CHANS 1 - #if defined(HAVE_PRI_CCSS) struct sig_pri_cc_agent_prv { /*! Asterisk span D channel control structure. */ @@ -7170,9 +7161,9 @@ static void *pri_dchannel(void *vpri) pri_hangup(pri->pri, pri->pvts[chanpos]->call, e->hangup.cause); pri->pvts[chanpos]->call = NULL; } -#if defined(FORCE_RESTART_UNAVAIL_CHANS) if (e->hangup.cause == PRI_CAUSE_REQUESTED_CHAN_UNAVAIL && pri->sig != SIG_BRI_PTMP && !pri->resetting + && pri->force_restart_unavailable_chans && pri->pvts[chanpos]->resetting == SIG_PRI_RESET_IDLE) { ast_verb(3, "Span %d: Forcing restart of channel %d/%d since channel reported in use\n", @@ -7181,7 +7172,6 @@ static void *pri_dchannel(void *vpri) pri->pvts[chanpos]->resetting = SIG_PRI_RESET_ACTIVE; pri_reset(pri->pri, PVT_TO_CHANNEL(pri->pvts[chanpos])); } -#endif /* defined(FORCE_RESTART_UNAVAIL_CHANS) */ if (e->hangup.aoc_units > -1) ast_verb(3, "Channel %d/%d, span %d received AOC-E charging %d unit%s\n", pri->pvts[chanpos]->logicalspan, pri->pvts[chanpos]->prioffset, pri->span, (int)e->hangup.aoc_units, (e->hangup.aoc_units == 1) ? "" : "s"); @@ -7319,9 +7309,9 @@ static void *pri_dchannel(void *vpri) pri_hangup(pri->pri, pri->pvts[chanpos]->call, e->hangup.cause); pri->pvts[chanpos]->call = NULL; } -#if defined(FORCE_RESTART_UNAVAIL_CHANS) if (e->hangup.cause == PRI_CAUSE_REQUESTED_CHAN_UNAVAIL && pri->sig != SIG_BRI_PTMP && !pri->resetting + && pri->force_restart_unavailable_chans && pri->pvts[chanpos]->resetting == SIG_PRI_RESET_IDLE) { ast_verb(3, "Span %d: Forcing restart of channel %d/%d since channel reported in use\n", @@ -7330,7 +7320,6 @@ static void *pri_dchannel(void *vpri) pri->pvts[chanpos]->resetting = SIG_PRI_RESET_ACTIVE; pri_reset(pri->pri, PVT_TO_CHANNEL(pri->pvts[chanpos])); } -#endif /* defined(FORCE_RESTART_UNAVAIL_CHANS) */ #ifdef SUPPORT_USERUSER if (!ast_strlen_zero(e->hangup.useruserinfo)) { |