Don't set guardtime if channel is only reserved (bug #2421)
authorMark Spencer <markster@digium.com>
Sat, 11 Sep 2004 13:37:36 +0000 (13:37 +0000)
committerMark Spencer <markster@digium.com>
Sat, 11 Sep 2004 13:37:36 +0000 (13:37 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3764 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_zap.c

index 8421ea0..e8b510d 100755 (executable)
@@ -2158,9 +2158,12 @@ static int zt_hangup(struct ast_channel *ast)
                case SIG_FXSGS:
                case SIG_FXSLS:
                case SIG_FXSKS:
-                       /* Make sure we're not made available for at least two seconds */
-                       time(&p->guardtime);
-                       p->guardtime += 2;
+                       /* Make sure we're not made available for at least two seconds assuming
+                          we were actually used for an inbound or outbound call. */
+                       if (ast->_state != AST_STATE_RESERVED) {
+                               time(&p->guardtime);
+                               p->guardtime += 2;
+                       }
                        break;
                default:
                        tone_zone_play_tone(p->subs[SUB_REAL].zfd, -1);