diff options
author | oej <oej@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-02-01 21:17:08 +0000 |
---|---|---|
committer | oej <oej@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-02-01 21:17:08 +0000 |
commit | d24d214ae16430e1225a695f08c1e5a574c421f7 (patch) | |
tree | 7bd4bcd49880df498e84dd2e6ed22076b8bec863 /channels | |
parent | cfaea10f5de3afa4b4bc34becd1cd005c0381f06 (diff) |
Merged revisions 53085 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r53085 | oej | 2007-02-01 22:05:34 +0100 (Thu, 01 Feb 2007) | 4 lines
- Clean INC_COUNT flag when we decrement call counter
- If it's still set at time of dialog destruction, make sure we decrement the device call counter properly
before we destroy the dialog
........
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@53092 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_sip.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 24c23ab7d..4293a0a81 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -3015,6 +3015,12 @@ static void __sip_destroy(struct sip_pvt *p, int lockowner, int lockdialoglist) if (sip_debug_test_pvt(p) || option_debug > 2) ast_verbose("Really destroying SIP dialog '%s' Method: %s\n", p->callid, sip_methods[p->method].text); + if (ast_test_flag(&p->flags[0], SIP_INC_COUNT)) { + update_call_counter(p, DEC_CALL_LIMIT); + if (option_debug > 1) + ast_log(LOG_DEBUG, "This call did not properly clean up call limits. Call ID %s\n", p->callid); + } + /* Remove link from peer to subscription of MWI */ if (p->relatedpeer && p->relatedpeer->mwipvt) p->relatedpeer->mwipvt = NULL; @@ -3156,9 +3162,10 @@ static int update_call_counter(struct sip_pvt *fup, int event) /* incoming and outgoing affects the inUse counter */ case DEC_CALL_LIMIT: /* Decrement inuse count if applicable */ - if (inuse && ast_test_flag(&fup->flags[0], SIP_INC_COUNT)) + if (inuse && ast_test_flag(&fup->flags[0], SIP_INC_COUNT)) { ast_atomic_fetchadd_int(inuse, -1); - else + ast_clear_flag(&fup->flags[0], SIP_INC_COUNT); + } else *inuse = 0; /* Decrement ringing count if applicable */ if (inringing && ast_test_flag(&fup->flags[1], SIP_PAGE2_INC_RINGING)) { |