Index: apps/app_voicemail.c =================================================================== --- apps/app_voicemail.c (révision 195018) +++ apps/app_voicemail.c (copie de travail) @@ -938,7 +938,8 @@ ast_log(AST_LOG_WARNING, "Option 'maxmessage' has been deprecated in favor of 'maxsecs'. Please make that change in your voicemail config.\n"); } else if (!strcasecmp(var, "maxmsg")) { vmu->maxmsg = atoi(value); - if (vmu->maxmsg <= 0) { + /* Accept maxmsg=0 (Greetings only voicemail) */ + if (vmu->maxmsg < 0) { ast_log(AST_LOG_WARNING, "Invalid number of messages per folder maxmsg=%s. Using default value %d\n", value, MAXMSG); vmu->maxmsg = MAXMSG; } else if (vmu->maxmsg > MAXMSGLIMIT) { @@ -5223,6 +5224,13 @@ ast_set_flag(options, OPT_SILENT); res = 0; } + /* If maxmsg is zero, act as a "greetings only" voicemail: Exit successfully without recording */ + if (vmu->maxmsg == 0) { + if (option_debug > 2) + ast_log(LOG_DEBUG, "Greetings only VM (maxmsg=0), Skipping voicemail recording\n"); + pbx_builtin_setvar_helper(chan, "VMSTATUS", "SUCCESS"); + goto leave_vm_out; + } if (!res && !ast_test_flag(options, OPT_SILENT)) { res = ast_stream_and_wait(chan, INTRO, ecodes); if (res == '#') {