Correct some scenarios where CALL_LIMIT could not be getting adjusted properly allowing chan_sip to send calls when it really shouldn't. Bug #6111

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@8432 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
BJ Weschke 2006-01-22 15:08:51 +00:00
parent 7d897634dc
commit 0034a39f29
1 changed files with 5 additions and 1 deletions

View File

@ -567,6 +567,8 @@ struct sip_auth {
#define SIP_CALL_LIMIT (1 << 29)
/* Remote Party-ID Support */
#define SIP_SENDRPID (1 << 30)
/* Did this connection increment the counter of in-use calls? */
#define SIP_INC_COUNT (1 << 31)
#define SIP_FLAGS_TO_COPY \
(SIP_PROMISCREDIR | SIP_TRUSTRPID | SIP_SENDRPID | SIP_DTMF | SIP_REINVITE | \
@ -2229,7 +2231,8 @@ static int update_call_counter(struct sip_pvt *fup, int event)
/* incoming and outgoing affects the inUse counter */
case DEC_CALL_LIMIT:
if ( *inuse > 0 ) {
(*inuse)--;
if (ast_test_flag(fup,SIP_INC_COUNT))
(*inuse)--;
} else {
*inuse = 0;
}
@ -2249,6 +2252,7 @@ static int update_call_counter(struct sip_pvt *fup, int event)
}
}
(*inuse)++;
ast_set_flag(fup,SIP_INC_COUNT);
if (option_debug > 1 || sipdebug) {
ast_log(LOG_DEBUG, "Call %s %s '%s' is %d out of %d\n", outgoing ? "to" : "from", u ? "user":"peer", name, *inuse, *call_limit);
}