summaryrefslogtreecommitdiff
path: root/channels/chan_zap.c
diff options
context:
space:
mode:
authorMark Spencer <markster@digium.com>2004-11-22 18:59:19 +0000
committerMark Spencer <markster@digium.com>2004-11-22 18:59:19 +0000
commit39be2d62447c7cc5f1edac377953f34a685f48f3 (patch)
tree9f0302c65e338cda3399e659c34611de1d4ef194 /channels/chan_zap.c
parenta69c0016da8393e5a23b08a1e0a5527611d008e1 (diff)
Don't allow more than 10 seconds of audio for callerid (bug #2920)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4315 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_zap.c')
-rwxr-xr-xchannels/chan_zap.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/channels/chan_zap.c b/channels/chan_zap.c
index 3486d5ae4..6227dd026 100755
--- a/channels/chan_zap.c
+++ b/channels/chan_zap.c
@@ -4700,6 +4700,7 @@ static void *ss_thread(void *data)
int receivedRingT;
int counter1;
int counter;
+ int samples = 0;
int flags;
int i;
@@ -5296,6 +5297,7 @@ static void *ss_thread(void *data)
} else if (p->cid_signalling == CID_SIG_V23) {
cs = callerid_new(cid_signalling);
if (cs) {
+ samples = 0;
#if 1
bump_gains(p);
#endif
@@ -5327,12 +5329,15 @@ static void *ss_thread(void *data)
}
break;
}
+ samples += res;
res = callerid_feed(cs, buf, res, AST_LAW(p));
if (res < 0) {
ast_log(LOG_WARNING, "CallerID feed failed: %s\n", strerror(errno));
break;
} else if (res)
break;
+ else if (samples > (8000 * 10))
+ break;
}
}
if (res == 1) {
@@ -5466,6 +5471,7 @@ static void *ss_thread(void *data)
#if 1
bump_gains(p);
#endif
+ samples = 0;
len = 0;
distMatches = 0;
/* Clear the current ring data array so we dont have old data in it. */
@@ -5520,12 +5526,15 @@ static void *ss_thread(void *data)
res = -1;
break;
}
+ samples += res;
res = callerid_feed(cs, buf, res, AST_LAW(p));
if (res < 0) {
ast_log(LOG_WARNING, "CallerID feed failed: %s\n", strerror(errno));
break;
} else if (res)
break;
+ else if (samples > (8000 * 10))
+ break;
}
}
if (p->usedistinctiveringdetection == 1) {