diff options
author | oej <oej@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-02-01 21:12:52 +0000 |
---|---|---|
committer | oej <oej@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-02-01 21:12:52 +0000 |
commit | 5658893096c42907cd391181aa4c209f7ef96be0 (patch) | |
tree | bb3d159aaad8db29ebee13d5307f6004dc60ba4c | |
parent | 8275398c8eefc236df7fb613f92ccab2923b1557 (diff) |
- Make sure we release call from call counter before we destroy call (maybe #7744 and more)
- Backported by accident from 1.4
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@53090 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | channels/chan_sip.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 5e1613275..a60f3ee83 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -567,8 +567,7 @@ 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_INC_COUNT (1 << 31) /* Did this connection increment the counter of in-use calls? */ #define SIP_FLAGS_TO_COPY \ (SIP_PROMISCREDIR | SIP_TRUSTRPID | SIP_SENDRPID | SIP_DTMF | SIP_REINVITE | \ @@ -2123,6 +2122,12 @@ static void __sip_destroy(struct sip_pvt *p, int lockowner) if (sip_debug_test_pvt(p)) ast_verbose("Destroying call '%s'\n", p->callid); + if (ast_test_flag(p, SIP_INC_COUNT)) { + update_call_counter(p, DEC_CALL_LIMIT); + if (option_debug) + ast_log(LOG_DEBUG, "Call did not properly clean up call counter. Call ID %s\n", p->callid); + } + if (dumphistory) sip_dump_history(p); @@ -2249,8 +2254,10 @@ 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 ) { - if (ast_test_flag(fup,SIP_INC_COUNT)) + if (ast_test_flag(fup, SIP_INC_COUNT)) { (*inuse)--; + ast_clear_flag(fup, SIP_INC_COUNT); + } } else { *inuse = 0; } |