]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Issue #8848 - Turn off lamp more quickly after transfer (decrement inuse early on...
authorOlle Johansson <oej@edvina.net>
Wed, 21 Feb 2007 08:32:34 +0000 (08:32 +0000)
committerOlle Johansson <oej@edvina.net>
Wed, 21 Feb 2007 08:32:34 +0000 (08:32 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@55834 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 74871304b3f4772d1f62ba681654429b5b264324..f8df46409c1e403041fd933d34278d0c8bd72a43 100644 (file)
@@ -3285,6 +3285,11 @@ static int sip_hangup(struct ast_channel *ast)
        }
 
        if (ast_test_flag(&p->flags[0], SIP_DEFER_BYE_ON_TRANSFER)) {
+               if (ast_test_flag(&p->flags[0], SIP_INC_COUNT)) {
+                       if (option_debug && sipdebug)
+                               ast_log(LOG_DEBUG, "update_call_counter(%s) - decrement call limit counter on hangup\n", p->username);
+                       update_call_counter(p, DEC_CALL_LIMIT);
+               }
                if (option_debug >3)
                        ast_log(LOG_DEBUG, "SIP Transfer: Not hanging up right now... Rescheduling hangup for %s.\n", p->callid);
                if (p->autokillid > -1)
@@ -3308,9 +3313,11 @@ static int sip_hangup(struct ast_channel *ast)
                ast_log(LOG_DEBUG, "Hanging up zombie call. Be scared.\n");
 
        ast_mutex_lock(&p->lock);
-       if (option_debug && sipdebug)
-               ast_log(LOG_DEBUG, "update_call_counter(%s) - decrement call limit counter on hangup\n", p->username);
-       update_call_counter(p, DEC_CALL_LIMIT);
+       if (ast_test_flag(&p->flags[0], SIP_INC_COUNT)) {
+               if (option_debug && sipdebug)
+                       ast_log(LOG_DEBUG, "update_call_counter(%s) - decrement call limit counter on hangup\n", p->username);
+               update_call_counter(p, DEC_CALL_LIMIT);
+       }
 
        /* Determine how to disconnect */
        if (p->owner != ast) {