summaryrefslogtreecommitdiff
path: root/apps/app_directory.c
diff options
context:
space:
mode:
authorMark Spencer <markster@digium.com>2004-05-03 04:36:46 +0000
committerMark Spencer <markster@digium.com>2004-05-03 04:36:46 +0000
commit0e89f839e1a412be858b7f8decb2d4ab35fcc7b6 (patch)
tree77582bad3a84ae273507de3bb1e9145a01bc85fc /apps/app_directory.c
parent131a8c8f53e6ee675e4a83928b2200ac4a509084 (diff)
Make directory spell name if available
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2869 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_directory.c')
-rwxr-xr-xapps/app_directory.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/apps/app_directory.c b/apps/app_directory.c
index 658798db1..8f0de9236 100755
--- a/apps/app_directory.c
+++ b/apps/app_directory.c
@@ -125,6 +125,7 @@ static int do_directory(struct ast_channel *chan, struct ast_config *cfg, char *
{
/* Read in the first three digits.. "digit" is the first digit, already read */
char ext[NUMDIGITS + 1];
+ char name[80] = "";
struct ast_variable *v;
int res;
int found=0;
@@ -152,6 +153,7 @@ static int do_directory(struct ast_channel *chan, struct ast_config *cfg, char *
strsep(&stringp, ",");
pos = strsep(&stringp, ",");
if (pos) {
+ strncpy(name, pos, sizeof(name) - 1);
/* Grab the last name */
if (strrchr(pos, ' '))
pos = strrchr(pos, ' ') + 1;
@@ -188,7 +190,7 @@ static int do_directory(struct ast_channel *chan, struct ast_config *cfg, char *
res = ast_waitstream(chan, AST_DIGIT_ANY);
ast_stopstream(chan);
} else {
- res = ast_say_digit_str(chan, v->name, AST_DIGIT_ANY, chan->language);
+ res = ast_say_character_str(chan, strlen(name) ? name : v->name, AST_DIGIT_ANY, chan->language);
}
ahem:
if (!res)