aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-11-22 18:59:19 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-11-22 18:59:19 +0000
commit17e4b2ee61ecc87f3bb6fa47ccd5033c36ed61df (patch)
tree9f0302c65e338cda3399e659c34611de1d4ef194 /channels
parent64355621602d650748c1eb196e696f2898b99e16 (diff)
Don't allow more than 10 seconds of audio for callerid (bug #2920)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4315 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-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) {