diff options
author | Richard Mudgett <rmudgett@digium.com> | 2010-03-10 16:55:34 +0000 |
---|---|---|
committer | Richard Mudgett <rmudgett@digium.com> | 2010-03-10 16:55:34 +0000 |
commit | b1ccb1a44eda9c4d5799ce1db4f83219023d6537 (patch) | |
tree | c08b4dad147a4d30292029f7ab4513b6f0c3f5ab /channels/sig_pri.c | |
parent | ee5e65194fd6975b2bc7ffe7a2f3358a9e891167 (diff) |
Simplified dahdi_request() channel selection failed reason/cause code.
Also avoid potential crash because cause could be NULL.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@251585 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/sig_pri.c')
-rw-r--r-- | channels/sig_pri.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/channels/sig_pri.c b/channels/sig_pri.c index c655e6deb..c1dff5f5e 100644 --- a/channels/sig_pri.c +++ b/channels/sig_pri.c @@ -3863,22 +3863,17 @@ int sig_pri_answer(struct sig_pri_chan *p, struct ast_channel *ast) return res; } -int sig_pri_available(struct sig_pri_chan *p, int *reason) +int sig_pri_available(struct sig_pri_chan *p) { /* If no owner and interface has a B channel then likely available */ if (!p->owner && !p->no_b_channel && p->pri) { + if (p->resetting || p->call #if defined(HAVE_PRI_SERVICE_MESSAGES) - if (p->resetting || p->call || p->service_status) { - if (p->service_status) { - *reason = AST_CAUSE_REQUESTED_CHAN_UNAVAIL; - } - return 0; - } -#else - if (p->resetting || p->call) { + || p->service_status +#endif /* defined(HAVE_PRI_SERVICE_MESSAGES) */ + ) { return 0; } -#endif /* defined(HAVE_PRI_SERVICE_MESSAGES) */ return 1; } |