diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2002-05-13 22:29:39 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2002-05-13 22:29:39 +0000 |
commit | 1642b09aba30d6f0b95a11bf079f99db94fdac02 (patch) | |
tree | 64c5de0a1afb1872ee474057eb3f244015f2801c /apps/app_directory.c | |
parent | 1c5b980de51d4caaa1d463fd0f702305b87aec4e (diff) |
Version 0.1.12 from FTP
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@446 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_directory.c')
-rwxr-xr-x | apps/app_directory.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/apps/app_directory.c b/apps/app_directory.c index 4ee7cdcbe..8618030fc 100755 --- a/apps/app_directory.c +++ b/apps/app_directory.c @@ -11,6 +11,7 @@ * the GNU General Public License */ +#include <asterisk/lock.h> #include <asterisk/file.h> #include <asterisk/logger.h> #include <asterisk/channel.h> @@ -131,7 +132,8 @@ static int do_directory(struct ast_channel *chan, struct ast_config *cfg, char * memset(ext, 0, sizeof(ext)); ext[0] = digit; res = 0; - if (ast_readstring(chan, ext + 1, NUMDIGITS, 3000, 3000, "#") < 0) res = -1; + if (ast_readstring(chan, ext + 1, NUMDIGITS - 1, 3000, 3000, "#") < 0) res = -1; + printf("Res: %d, ext: %s\n", res, ext); if (!res) { /* Search for all names which start with those digits */ v = ast_variable_browse(cfg, context); @@ -166,7 +168,7 @@ static int do_directory(struct ast_channel *chan, struct ast_config *cfg, char * if (v) { /* We have a match -- play a greeting if they have it */ snprintf(fn, sizeof(fn), "%s/vm/%s/greet", AST_SPOOL_DIR, v->name); - if (ast_fileexists(fn, NULL, chan->language)) { + if (ast_fileexists(fn, NULL, chan->language) > 0) { res = ast_streamfile(chan, fn, chan->language); if (!res) res = ast_waitstream(chan, AST_DIGIT_ANY); |