aboutsummaryrefslogtreecommitdiffstats
path: root/main/slinfactory.c
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-08-08 19:30:52 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-08-08 19:30:52 +0000
commitce30d7306b4db59ed13b13b1742b5a9f24141057 (patch)
treed8f49fe3111f2586e86ed3583f8a44a1b2444e3f /main/slinfactory.c
parent3472e5897e580edcc65e87ec21acefec81b12cd3 (diff)
Merge audiohooks branch into trunk. This is a new API for developers to listen and manipulate the audio going through a channel.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@78649 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/slinfactory.c')
-rw-r--r--main/slinfactory.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/main/slinfactory.c b/main/slinfactory.c
index a42b2b213..038fa0d7b 100644
--- a/main/slinfactory.c
+++ b/main/slinfactory.c
@@ -148,3 +148,21 @@ unsigned int ast_slinfactory_available(const struct ast_slinfactory *sf)
{
return sf->size;
}
+
+void ast_slinfactory_flush(struct ast_slinfactory *sf)
+{
+ struct ast_frame *fr = NULL;
+
+ if (sf->trans) {
+ ast_translator_free_path(sf->trans);
+ sf->trans = NULL;
+ }
+
+ while ((fr = AST_LIST_REMOVE_HEAD(&sf->queue, frame_list)))
+ ast_frfree(fr);
+
+ sf->size = sf->holdlen = 0;
+ sf->offset = sf->hold;
+
+ return;
+}