]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
(closes issue #10165)
authorJoshua Colp <jcolp@digium.com>
Wed, 18 Jul 2007 15:41:06 +0000 (15:41 +0000)
committerJoshua Colp <jcolp@digium.com>
Wed, 18 Jul 2007 15:41:06 +0000 (15:41 +0000)
Reported by: elandivar

It is possible for hold status to exist without call limits set, so we need to ensure update_call_counter is executed regardless.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@75621 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 8523888cf6cfcf312978bd52ffcb493ae1802890..9f7f412386cde9ceeaf9d7de42d5e75e3219e729 100644 (file)
@@ -2943,7 +2943,7 @@ static void __sip_destroy(struct sip_pvt *p, int lockowner)
        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)) {
+       if (ast_test_flag(&p->flags[0], SIP_INC_COUNT) || ast_test_flag(&p->flags[1], SIP_PAGE2_CALL_ONHOLD)) {
                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);
@@ -3056,9 +3056,10 @@ static int update_call_counter(struct sip_pvt *fup, int event)
 
        if (option_debug > 2)
                ast_log(LOG_DEBUG, "Updating call counter for %s call\n", outgoing ? "outgoing" : "incoming");
+
        /* Test if we need to check call limits, in order to avoid 
           realtime lookups if we do not need it */
-       if (!ast_test_flag(&fup->flags[0], SIP_CALL_LIMIT))
+       if (!ast_test_flag(&fup->flags[0], SIP_CALL_LIMIT) && !ast_test_flag(&fup->flags[1], SIP_PAGE2_CALL_ONHOLD))
                return 0;
 
        ast_copy_string(name, fup->username, sizeof(name));