Index: apps/app_voicemail.c =================================================================== --- apps/app_voicemail.c (revision 7663) +++ apps/app_voicemail.c (working copy) @@ -121,6 +121,7 @@ OPT_RECORDGAIN = (1 << 3), OPT_PREPEND_MAILBOX = (1 << 4), OPT_PRIORITY_JUMP = (1 << 5), + OPT_AUTOPLAYNEWMSGS = (1 << 6), } vm_option_flags; enum { @@ -129,6 +130,7 @@ } vm_option_args; AST_APP_OPTIONS(vm_app_options, { + AST_APP_OPTION('a', OPT_AUTOPLAYNEWMSGS), AST_APP_OPTION('s', OPT_SILENT), AST_APP_OPTION('b', OPT_BUSY_GREETING), AST_APP_OPTION('u', OPT_UNAVAIL_GREETING), @@ -329,6 +331,7 @@ "calling party will be prompted to enter one. If a context is not specified,\n" "the 'default' context will be used.\n\n" " Options:\n" +" a - Auto-Play the new messages\n" " p - Consider the mailbox parameter as a prefix to the mailbox that\n" " is entered by the caller.\n" " g(#) - Use the specified amount of gain when recording a voicemail\n" @@ -5017,6 +5020,7 @@ int silentexit = 0; struct ast_flags flags = { 0 }; signed char record_gain = 0; + int autoplaynewmsgs = 0; LOCAL_USER_ADD(u); @@ -5067,6 +5071,12 @@ } + if (ast_test_flag(&flags, OPT_AUTOPLAYNEWMSGS)) { + ast_log(LOG_DEBUG, "AUTO PLAY NEW MSGS enabled\n"); + autoplaynewmsgs = 1; + } + + valid = ast_test_flag(&flags, OPT_SILENT); if ((context = strchr(argv[0], '@'))) @@ -5150,7 +5160,11 @@ } } - cmd = vm_intro(chan, &vms); + if ( autoplaynewmsgs ) { + cmd = 49; + } else { + cmd = vm_intro(chan, &vms); + } vms.repeats = 0; vms.starting = 1;