aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-11-09 01:42:38 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-11-09 01:42:38 +0000
commitfd40f80b8c0b214dbfa89955bb58b053101aa131 (patch)
treedbee6bdd41cf0e6770bcc8bad23e7b59956fd054
parent207f53f3c6a9568c6367df85e2a8b17ebf8592ab (diff)
correct logic for group-match CONGESTION checking
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@7038 f38db490-d61c-443f-a65b-d21fe96a405b
-rwxr-xr-xchannels/chan_zap.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/channels/chan_zap.c b/channels/chan_zap.c
index e4b64cc6b..ca3936a94 100755
--- a/channels/chan_zap.c
+++ b/channels/chan_zap.c
@@ -7240,6 +7240,7 @@ static inline int available(struct zt_pvt *p, int channelmatch, int groupmatch,
{
int res;
ZT_PARAMS par;
+
/* First, check group matching */
if (groupmatch) {
if ((p->group & groupmatch) != groupmatch)
@@ -7247,7 +7248,7 @@ static inline int available(struct zt_pvt *p, int channelmatch, int groupmatch,
*groupmatched = 1;
}
/* Check to see if we have a channel match */
- if (channelmatch) {
+ if (channelmatch != -1) {
if (p->channel != channelmatch)
return 0;
*channelmatched = 1;
@@ -7336,7 +7337,7 @@ static inline int available(struct zt_pvt *p, int channelmatch, int groupmatch,
}
if ((p->owner->_state != AST_STATE_UP) &&
- ((p->owner->_state != AST_STATE_RINGING) || p->outgoing)) {
+ ((p->owner->_state != AST_STATE_RINGING) || p->outgoing)) {
/* If the current call is not up, then don't allow the call */
return 0;
}
@@ -7628,11 +7629,15 @@ next:
}
ast_mutex_unlock(lock);
restart_monitor();
- if (channelmatched) {
- if (callwait || (!tmp && busy))
- *cause = AST_CAUSE_BUSY;
- } else if (groupmatched) {
- *cause = AST_CAUSE_CONGESTION;
+ if (callwait)
+ *cause = AST_CAUSE_BUSY;
+ else if (!tmp) {
+ if (channelmatched) {
+ if (busy)
+ *cause = AST_CAUSE_BUSY;
+ } else if (groupmatched) {
+ *cause = AST_CAUSE_CONGESTION;
+ }
}
return tmp;