aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_sip.c
diff options
context:
space:
mode:
Diffstat (limited to 'channels/chan_sip.c')
-rwxr-xr-xchannels/chan_sip.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index d56479b1c..fff501f66 100755
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -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;