aboutsummaryrefslogtreecommitdiffstats
path: root/main/file.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2009-06-30 16:40:38 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2009-06-30 16:40:38 +0000
commite9d15cbea7a98184521c851500176da7aa424012 (patch)
treed3d6aa7ea86d11ecaa6e88efbc46a5dde1c63ea5 /main/file.c
parentb85bdd32a783a8f07004d41db8a696645685a331 (diff)
Move Asterisk-addons modules into the main Asterisk source tree.
Someone asked yesterday, "is there a good reason why we can't just put these modules in Asterisk?". After a brief discussion, as long as the modules are clearly set aside in their own directory and not enabled by default, it is perfectly fine. For more information about why a module goes in addons, see README-addons.txt. chan_ooh323 does not currently compile as it is behind some trunk API updates. However, it will not build by default, so it should be okay for now. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@204413 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/file.c')
-rw-r--r--main/file.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/main/file.c b/main/file.c
index c89cee97c..21ce1bbdc 100644
--- a/main/file.c
+++ b/main/file.c
@@ -320,6 +320,7 @@ static void filestream_destructor(void *arg)
free(f->filename);
if (f->realfilename)
free(f->realfilename);
+ ast_free(f->open_filename);
if (f->fmt->close) {
void (*closefn)(struct ast_filestream *) = f->fmt->close;
closefn(f);
@@ -472,6 +473,7 @@ static int ast_filehelper(const char *filename, const void *arg2, const char *fm
s->fmt = f;
s->trans = NULL;
s->filename = NULL;
+ s->open_filename = ast_strdup(fn);;
if (s->fmt->format & AST_FORMAT_AUDIO_MASK) {
if (chan->stream)
ast_closestream(chan->stream);
@@ -826,7 +828,30 @@ static int ast_fsread_video(const void *data)
int ast_applystream(struct ast_channel *chan, struct ast_filestream *s)
{
+ struct ast_party_connected_line connected;
+ char *fn;
+
+ ast_channel_lock(chan);
+ ast_party_connected_line_set_init(&connected, &chan->connected);
+ if (ast_strlen_zero(chan->connected.id.number)) {
+ connected.id.number = ast_strdupa(chan->exten);
+ }
+ ast_channel_unlock(chan);
+
+ fn = ast_strdupa(s->open_filename);
+ if ((fn = strrchr(fn, '/'))) {
+ char *dot;
+ *fn++ = '\0';
+ if ((dot = strrchr(fn, '.'))) {
+ *dot = '\0';
+ }
+ }
+ connected.id.number = connected.id.name = fn;
+
+ ast_channel_update_connected_line(chan, &connected);
+
s->owner = chan;
+
return 0;
}