Index: apps/app_voicemail.c =================================================================== --- apps/app_voicemail.c (revision 54176) +++ apps/app_voicemail.c (working copy) @@ -3960,6 +3960,8 @@ int todircount=0; #endif char username[70]=""; + char fn[PATH_MAX]; /* for playback of name greeting */ + char ecodes[16] = "#"; int res = 0, cmd = 0; struct ast_vm_user *receiver = NULL, *vmtmp; AST_LIST_HEAD_NOLOCK_STATIC(extensions, ast_vm_user); @@ -4059,6 +4061,22 @@ /* start all over if no username */ if (ast_strlen_zero(username)) continue; + + /* play name if available, else play extension number */ + snprintf(fn, sizeof(fn), "%s%s/%s/greet", VM_SPOOL_DIR, chan->context, username); + RETRIEVE(fn, -1); + if (ast_fileexists(fn, NULL, NULL) > 0) { + res = ast_stream_and_wait(chan, fn, ecodes); + if (res) { + DISPOSE(fn, -1); + return res; + } + } else { + /* Dispose just in case */ + DISPOSE(fn, -1); + res = ast_say_digit_str(chan, username, ecodes, chan->language); + } + stringp = username; s = strsep(&stringp, "*"); /* start optimistic */