summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Spencer <markster@digium.com>2004-05-15 22:50:51 +0000
committerMark Spencer <markster@digium.com>2004-05-15 22:50:51 +0000
commit70007e6095fa4be57b46af3a259fbcba17a95445 (patch)
tree939805a54136248145dcfeba4bc0164c3eceaf91
parent694c1c0c9c23971aaedae46060e4d641911828bf (diff)
Don't call out an FXO until at least 2 seconds after it was hungup.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2971 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rwxr-xr-xchannels/chan_zap.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/channels/chan_zap.c b/channels/chan_zap.c
index 1ed245035..6847eea06 100755
--- a/channels/chan_zap.c
+++ b/channels/chan_zap.c
@@ -426,6 +426,7 @@ static struct zt_pvt {
int channel; /* Channel Number */
int span; /* Span number */
int dialing;
+ time_t guardtime; /* Must wait this much time before using for new call */
int dialednone;
int use_callerid; /* Whether or not to use caller id on this channel */
int hidecallerid;
@@ -1973,6 +1974,13 @@ static int zt_hangup(struct ast_channel *ast)
tone_zone_play_tone(p->subs[SUB_REAL].zfd, -1);
}
break;
+ 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;
+ break;
default:
tone_zone_play_tone(p->subs[SUB_REAL].zfd, -1);
}
@@ -5763,7 +5771,10 @@ static inline int available(struct zt_pvt *p, int channelmatch, int groupmatch)
return 0;
/* If do not distrub, definitely not */
if (p->dnd)
- return 0;
+ return 0;
+ /* If guard time, definitely not */
+ if (time(NULL) < p->guardtime)
+ return 0;
/* If no owner definitely available */
if (!p->owner) {