Minor sip fixes
authorMark Spencer <markster@digium.com>
Tue, 9 Dec 2003 22:04:23 +0000 (22:04 +0000)
committerMark Spencer <markster@digium.com>
Tue, 9 Dec 2003 22:04:23 +0000 (22:04 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1848 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index d56479b..fff501f 100755 (executable)
@@ -1112,12 +1112,15 @@ static int sip_hangup(struct ast_channel *ast)
                                   INVITE, but do set an autodestruct just in case. */
                                needdestroy = 0;
                                sip_scheddestroy(p, 15000);
-                               /* channel still up - reverse dec of inUse counter */
-                               if ( p->outgoing ) {
-                                       find_user(p, INC_OUT_USE);
-                               }
-                               else {
-                                       find_user(p, INC_IN_USE);
+                               if ( p->initid != -1 ) {
+                                       /* channel still up - reverse dec of inUse counter
+                                          only if the channel is not auto-congested */
+                                       if ( p->outgoing ) {
+                                               find_user(p, INC_OUT_USE);
+                                       }
+                                       else {
+                                               find_user(p, INC_IN_USE);
+                                       }
                                }
                        } else {
                                char *res;