diff options
author | Richard Mudgett <rmudgett@digium.com> | 2009-09-10 00:35:30 +0000 |
---|---|---|
committer | Richard Mudgett <rmudgett@digium.com> | 2009-09-10 00:35:30 +0000 |
commit | 98d156c5dd2238d13c88b4a92c3d909c6bcbbe21 (patch) | |
tree | 1b629ecd83054d97a49e18d92451aa88e9d0e13d | |
parent | df7dd574fd0dfe82570390c2af1d5cd7614afd22 (diff) |
Fix available() for SS7, MFC/R2, and pseudo channels.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@217560 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r-- | channels/chan_dahdi.c | 42 |
1 files changed, 26 insertions, 16 deletions
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c index 53ddf2a1b..f5217ea53 100644 --- a/channels/chan_dahdi.c +++ b/channels/chan_dahdi.c @@ -946,12 +946,12 @@ static struct dahdi_pvt { unsigned int inservice:1; /*! * \brief TRUE if the channel is locally blocked. - * \note Applies to SS7 channels. + * \note Applies to SS7 and MFCR2 channels. */ unsigned int locallyblocked:1; /*! * \brief TRUE if the channel is remotely blocked. - * \note Applies to SS7 channels. + * \note Applies to SS7 and MFCR2 channels. */ unsigned int remotelyblocked:1; #if defined(HAVE_PRI) @@ -11400,24 +11400,34 @@ static inline int available(struct dahdi_pvt *p, int channelmatch, ast_group_t g } #endif -#ifdef HAVE_SS7 - /* Trust SS7 */ - if (p->ss7) { - if (p->ss7call) - return 0; - else - return 1; + if (p->locallyblocked || p->remotelyblocked) { + return 0; } + + /* If no owner definitely available */ + if (!p->owner) { +#ifdef HAVE_SS7 + /* Trust SS7 */ + if (p->ss7) { + if (p->ss7call) { + return 0; + } else { + return 1; + } + } #endif #ifdef HAVE_OPENR2 - /* Trust MFC/R2 */ - if (p->mfcr2) { - if (p->mfcr2call) - return 0; - else - return 1; - } + /* Trust MFC/R2 */ + if (p->mfcr2) { + if (p->mfcr2call) { + return 0; + } else { + return 1; + } + } #endif + return 1; + } return 0; } |