aboutsummaryrefslogtreecommitdiffstats
path: root/channels/iax2-parser.c
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2007-01-04 18:31:55 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2007-01-04 18:31:55 +0000
commit71de4a005d4465c264b1365662a703aa668d1e36 (patch)
tree3ad5912706707fadc74b7ae775e391bab7d754ff /channels/iax2-parser.c
parente3526e1ab7001b5e00f3f9e933d7ab60b6ccb0d9 (diff)
only do IAX2 frame caching for voice and video frames
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@49465 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/iax2-parser.c')
-rw-r--r--channels/iax2-parser.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/channels/iax2-parser.c b/channels/iax2-parser.c
index 7c113d52b..d06775128 100644
--- a/channels/iax2-parser.c
+++ b/channels/iax2-parser.c
@@ -939,7 +939,7 @@ void iax_frame_wrap(struct iax_frame *fr, struct ast_frame *f)
}
}
-struct iax_frame *iax_frame_new(int direction, int datalen)
+struct iax_frame *iax_frame_new(int direction, int datalen, unsigned int cacheable)
{
struct iax_frame *fr = NULL;
@@ -969,6 +969,7 @@ struct iax_frame *iax_frame_new(int direction, int datalen)
fr->direction = direction;
fr->retrans = -1;
+ fr->cacheable = cacheable;
if (fr->direction == DIRECTION_INGRESS)
ast_atomic_fetchadd_int(&iframes, 1);
@@ -996,7 +997,7 @@ void iax_frame_free(struct iax_frame *fr)
ast_atomic_fetchadd_int(&frames, -1);
#if !defined(LOW_MEMORY)
- if (!(iax_frames = ast_threadstorage_get(&frame_cache, sizeof(*iax_frames)))) {
+ if (!fr->cacheable || !(iax_frames = ast_threadstorage_get(&frame_cache, sizeof(*iax_frames)))) {
free(fr);
return;
}