--- app_voicemail.c 2003-11-17 01:20:09.000000000 -0500 +++ app_voicemail.c.bjh 2003-11-20 17:57:52.000000000 -0500 @@ -130,6 +130,8 @@ "message will be played (/var/lib/asterisk/sounds/vm//unavail) if it\n" "exists. If the extension is preceeded by a 'b' then the the busy message\n" "will be played (that is, busy instead of unavail).\n" +"If the extension is preceded by a 'i' then the instructions for leaving the\n" +"message will be played, but the gretting/intro message will be skipped.\n" "Returns -1 on error or mailbox not found, or if the user hangs up.\n" "Otherwise, it returns 0.\n"; @@ -1064,7 +1066,7 @@ free(z); } -static int leave_voicemail(struct ast_channel *chan, char *ext, int silent, int busy, int unavail) +static int leave_voicemail(struct ast_channel *chan, char *ext, int silent, int busy, int unavail, int instructonly) { char comment[256]; char txtfile[256]; @@ -1114,17 +1116,19 @@ ecodes = "#0"; /* Play the beginning intro if desired */ if (strlen(prefile)) { - if (ast_fileexists(prefile, NULL, NULL) > 0) { - if (ast_streamfile(chan, prefile, chan->language) > -1) - res = ast_waitstream(chan, "#0"); - } else { - ast_log(LOG_DEBUG, "%s doesn't exist, doing what we can\n", prefile); - res = invent_message(chan, vmu->context, ext, busy, ecodes); - } - if (res < 0) { - ast_log(LOG_DEBUG, "Hang up during prefile playback\n"); - free_user(vmu); - return -1; + if (!instructonly) { + if (ast_fileexists(prefile, NULL, NULL) > 0) { + if (ast_streamfile(chan, prefile, chan->language) > -1) + res = ast_waitstream(chan, "#0"); + } else { + ast_log(LOG_DEBUG, "%s doesn't exist, doing what we can\n", prefile); + res = invent_message(chan, vmu->context, ext, busy, ecodes); + } + if (res < 0) { + ast_log(LOG_DEBUG, "Hang up during prefile playback\n"); + free_user(vmu); + return -1; + } } } if (res == '#') { @@ -2634,7 +2638,7 @@ static int vm_exec(struct ast_channel *chan, void *data) { - int res=0, silent=0, busy=0, unavail=0; + int res=0, silent=0, busy=0, unavail=0, instructonly=0; struct localuser *u; char tmp[256], *ext; @@ -2661,10 +2665,13 @@ } else if (*ext == 'u') { unavail=1; ext++; + } else if (*ext == 'i') { + instructonly=1; + ext++; } else break; } - res = leave_voicemail(chan, ext, silent, busy, unavail); + res = leave_voicemail(chan, ext, silent, busy, unavail, instructonly); LOCAL_USER_REMOVE(u); return res; }