Summary:ASTERISK-01467: [patch] Advanced Voicemail Features (carryover from 156)
Reporter:bradster (bradster)Labels:
Date Opened:2004-04-25 15:44:21Date Closed:2004-09-25 02:17:33
Versions:Frequency of
Environment:Attachments:( 0) advanced10full.tar.gz
Description:This bug is a direct spawn from ASTERISK-153, Advanced Voicemail Features.  Please see that bug for information regarding past patches.

This Feature enables the following:

* Option to Have the CID of the caller heard before the voicemail
* Option to allow an operator to be reached after leaving a voicemail
* Option to review, rerecord, or save voicemails after leaving them
* Option to review, rerecord, or save busy, unavailable, and name prompts.
* Option to allow dialing out from within voicemail
* Option to allow calling back of the person who left voicemail (with the correctly formatted contexts in extensions.conf)


bradster, please add any more usage notes as required in a bugnote.  I've been working on cleaning this up and getting it ready for CVS.
If you want to follow the development of this patch,
please press the "monitor bug" button.
Comments:By: twisted (twisted) 2004-04-25 15:45:48

To Use:  Download the file advanced9full.tar.gz, and unpack it into /usr/src/asterisk (or wherever your base * source directory is), and execute advancedpatch.sh.  That's it.  

Should apply cleanly and compile with cvs as of 04/26/04.

I also included the saydigits fix from ASTERISK-1428 to solve that issue in one swift kick to the rear.
advanced8full.tar.gz has been removed because it is now out-of-date, advanced9 has the current fixes by bradster.

Another download method:


edited on: 04-26-04 09:52

By: twisted (twisted) 2004-04-25 16:11:18

Reminder sent to bradster

Updated patch for easy testing, and moved to new bug.  This is to let you know to pull it down, give it a whirl, and let us know back here if it's ready for cvs yet.  Please respond asap, as I'm pushing for testing.

By: Brian West (bkw918) 2004-04-25 16:14:30

If you are monitoring this bug please TEST it ASAP.

By: Steve Murphy (murf) 2004-04-25 16:22:03

Uh, will everyone that was on the maillist for the last bug number, be still
on the list, or do we have to post something on this bug number to get on the
list again?

By: twisted (twisted) 2004-04-25 16:29:14

everyone that was monitoring it got an email that the bug moved.

By: flavour (flavour) 2004-04-25 16:32:48

Have installed on latest CVS Head.
However nothing appears to be working for me - '3 for Advanced Options' just has 'Star to return to main menu' just as before. Looking back at the previous bugnote, I see that much is configurable in voicemail.conf
Would be *great* to see that info consolidated here too - either in a README or within the bugtracker.

By: twisted (twisted) 2004-04-25 16:50:43

Oops.. guess I shoulda mentioned the extra config options in voicemail.conf...

1234 => 1234,Some User,email@address.com,pager@address.com,tz=central|attach=yes|saycid=yes|dialout=fromvm|callback=fromvm|review=yes|operator=

The options for the most part are pretty self explanatory, i guess, but I forgot to put in a diff for the voicemail.conf in the tar file.. I will do that very soon.

By: twisted (twisted) 2004-04-25 17:08:17

sorry about the previous version i had up here.. i broke the diff for the sounds install... the one that's up now takes care of that.. :)

the one up now also includes a configs/voicemail.conf.sample diff that will show you what's up.

edited on: 04-25-04 16:21

By: dennis (dennis) 2004-04-25 23:02:19

I installed and tested this patch against the latest cvs.  I noticed several problems.  First issue I had was with the example voicemail.conf line:

4069 => 6522,Matt Brooks,matt@marko.net|tz=central|attach=yes|saycid=yes|dialout=fromvm|callback=fromvm|review=yes|operator=yes

I had to change it to:

4069 => 6522,Matt Brooks,matt@marko.net,,|tz=central|attach=yes|saycid=yes|dialout=fromvm|callback=fromvm|review=yes|operator=yes

I had to add the two comma placeholders.  Without those, my system was not picking up the other options.

The second issue I had was with the options to review, rerecord, save, or cancel voicemails after leaving them.  When I press the * key to cancel the message, the entire menu just repeats.  When I select the other options, the "press * to cancel message" option is repeated.  With the exception of the * key, pressing a option twice would perform the correct function.

The last issue I had was with the CID announcements (I'm using the latest patch posted by twisted).  The following errors occurred, followed by a hangup:

-- Playing 'vm-from-phonenumber' (language 'en')
Apr 25 22:34:48 WARNING[294930]: file.c:463 ast_openstream: File digits/( does not exist in any format
Apr 25 22:34:48 WARNING[294930]: file.c:751 ast_streamfile: Unable to open digits/( (format ULAW): No such file or directory

My asterisk system is fairly vanilla, so I'm not sure why I'm having these issues.  I'm sure it's a configuration problem on my end, but I figured I'd share my findings with you all for kicks.

By: bradster (bradster) 2004-04-25 23:05:54

Thanks twisted for cleaning things up!

I did some testing, and have fixed a few things (which are now contained in advanced9.diff).

1. As for the '*' not cancelling outgoing calls unless it was the first digit dialled issue, I've changed things so that it will always cancel outgoing calls, however slowly for any digit other than the first since the caller would need to wait for a timeout

2. In the process, I noticed that unless you started to dial your number while the prompts were still playing, the first digit you entered would be omitted from the dial string. This is now fixed.

3. The prompts to "press * to cancel" a message after being recorded were being played, but this feature was disabled because of the confusion that could result if a message was deleted while another message was being left and the messages ended up with non-consecutive numbers (better not to give the option to cancel a message until that issue is resolved, I figure).

4. In the (nice) new prompts which combine the "Press X" bit with the command, the "Press 0" is missing from "To reach an operator", so it's a bit abrupt as it is.

One additional minor note, this patch also enables you to Reply (using 3-1) to a message, if it was received from someone who also has a mailbox (provided the caller ID of the received message matches a mailbox).

Actually it might be useful to mention all of the commands:

After 3 for advanced options:

1 - Reply
2 - Call back*
3 - Envelope
4 - Outgoing call*

After recording a message (incoming message, busy/unavail greeting, or name)
1 - Accept
2 - Review
3 - Re-record
0 - Reach operator* (not available when recording greetings/name)

* Prompts for these are only played if these options are enabled in voicemail.conf

edited on: 04-25-04 22:09

By: Tilghman Lesher (tilghman) 2004-04-25 23:45:33

Instead of a very large patch, would it make sense to just roll up into Voicemail3?  This would give us more possible users to test these features.

In addition, I'm going to suggest rolling in the changes from ASTERISK-1352 (voicemail broadcasts).

By: dennis (dennis) 2004-04-25 23:52:31

After reviewing a recorded voicemail and pressing 1 to accept the message, I'm able to dial any extension within my "internal" context.  Is this the expected behavior?  I think it might be a better idea to force a hang-up.

Bradster's advance9.diff seems to work well.  The only issue I'm currently having is with the CID announcements.

EDIT: My bad.  I left the Hangup() statement off the test extension I created.  I'm no longer left in the internal context after saving a message.  Everything is working as expected now.

edited on: 04-25-04 23:50

By: hwstar (hwstar) 2004-04-26 00:00:01


Regarding the problem with the CID announcements. Have you installed the patch for bug 1443? If there are any characters other than 0-9, *, # in your caller ID number string, you'll get the errors you mentioned in your report. Installing the patch skips over any character in the caller ID string which is not 0-9, * or #.


By: dennis (dennis) 2004-04-26 00:19:09

Thanks Steve!  I mistakenly thought that 1443 was rolled into this patch.  After installing 1443, CID announcements work perfectly.  Thanks again.

By: twisted (twisted) 2004-04-26 06:03:39

Ok. Regarding Corydon76's post.  I completely disagree.  I was asked about the cvs commit status directly from the top, as is.  NO new features on this bug (ie, no broadcasts here).   Also, we want to leave this as a patch for now, as there are still things to do.  

Regarding dennis:  Yes, what you're not seeing is that when you press 1 to accept a message you've left, it's exiting voicemail, and using your digit timeout, just like any application you forgot to Hangup() from.   Put a Hangup() in the priority directly after voicemail, and this will get rid of your problem. It's a config, not a patch bug.

By: cmslaght (cmslaght) 2004-04-26 09:20:52

Patch installs without any errors.  Confirmed Bradsters comment on 4/25/04 "  the "Press 0" is missing from "To reach an operator", so it's a bit abrupt as it is."

Also compiled using MySQL voicemail option.  Worked perfectly.  All tested with todays CVS, advanced 9 & digit-fix.patch from bugnote 00001443.

By: twisted (twisted) 2004-04-26 10:08:16

I think I'm going to integrate the patch from 1443 for the testing, because not everyone has their CID info set in the correct format.  I will also fix the press 0 for operator prompt, and update to advanced 9 after review.  gotta make sure we're clean for cvs entry..  Bradster, can you shoot me an email?  we need to discuss this off-line for a few minutes.  twisted AT indigent.sytes.net

By: rthrash (rthrash) 2004-04-26 10:50:31

Will testing of this patch work for STABLE from 4/16?

Also, some instructions on how to get the diffs installed as well might be helpful. Having never applied diffs to installs before, I'm sure I'm not the only one wondering how to do this without creating havoc on their * install.

By: twisted (twisted) 2004-04-26 11:00:04

rthrash: this was based off of cvs-head.   You can try it on stable if you want to, but It's not intended for stable.   If you read the previous bug posts, you simply run the advancedpatch.sh script to install all of it.   If you'd rather do it manually, use patch -p0 <patchname

By: hwstar (hwstar) 2004-04-26 11:36:58

Testing input--

All options work correctly with the following voicemail.conf configuration:

cidinternalcontexts = house-admin, house-toll, house-local, house-intercom-only
; format: password, name, email address for attached voicemail msgs
101 => XXXX,Steve Rodgers,hwstar/?at?/rodgers/?dot?/sdcoxmail/?dot?/com,,tz=pacific|saycid=yes|dialout=voicemail-callback|callback=voicemail-callback


As a side note there is some distortion (quantization noise?) on the "press 3 for advanced options" voice prompt. However this is a minor detail.

Also vm-from-phonenumber.gsm and vm-from-extension.gsm both say "message from". These recordings seem to have been modified recently:

-rw-r--r--    1 root     root         1650 Apr 25 21:08 vm-from-phonenumber.gsm
-rw-r--r--    1 root     root         1650 Apr 25 21:08 vm-from-extension.gsm

Do we not have the correct recordings for these files yet from Allison?


edited on: 04-26-04 11:05

By: flavour (flavour) 2004-04-26 12:00:33

Doesn't break anything (other than adding extra need for sound file translations ;) ). New features seem to work well - assuming CID patch is included & you ignore the lack of 'Press Zero' for 'Reach Operator'

By: hwstar (hwstar) 2004-04-26 14:12:31

Looks like we are in a race to commit this against 1361 with the loser
having to do major rework to get thier patch to interoperate with the winner.
Although I'm not advocating a commit we might regret later, what needs to be done testing wise to get to a commit?


edited on: 04-26-04 13:07

By: Steve Murphy (murf) 2004-04-26 15:22:10

I've downloaded, patched, made, installed, and played with the advanced9full.

It looks and feels good enough to me for a release. I tested the callback,
dialout features. Had to set up a special context to handle either raw CID
or hand-dialed numbers (could set up two different contexts, I guess.)

Most of my major complaints and confusions have been settled. I get a
nice list of all possible options, no CID crashes. I've patched in my
own usage of the priv-callerintros/ option, but the say-cid stuff
works as advertised.

By: Olle Johansson (oej) 2004-04-26 15:29:06

I don't like the config syntax, it's not like anything else in asterisk.

Any suggestions?

By: Steve Murphy (murf) 2004-04-26 15:29:33

Ooops. One very small nit: In the config file, there appeared
to be one more mailbox option, not specified in the example voicemail.config
file... the option:

; serveremail=<address> -- override the global serveremail for this user

Am I wrong?

By: Steve Murphy (murf) 2004-04-26 15:39:03

In response to OEJ on the config file format:

The only trouble I had with it, was understanding that [default] is a "fixed"
context, and if you rename or delete it, you have to use the @nondefault notation
to address the mailboxes.

Other than that, if the options are documented in the config file, and
a few good examples are present, people shouldn't be too confused as to
how to configure it.

What are you proposing?

By: Olle Johansson (oej) 2004-04-26 15:44:54

Well, we haven't got any other config with this syntax, and I don't think it's a good thing to add new syntaxes if that can be avoided. It confuses users.

Guess the benefit is that it's semi-backwards compatible.

We have at least two formats we're using in many places of Asterisk:

(Channel peer-inspiration:)

....Or modem.conf


The last one is documented in the asterisk handbook, but not used that many times, so it's rather confusing for users.

By: hwstar (hwstar) 2004-04-26 17:30:00

Just a vote for keeping the existing syntax --

The format was actually defined before the advanced features came to be. The apply_options function was merely expanded to handle the additional configuration settings for the advanced voicemail features.

Re-writing the parser at this point will reset all of the testing which has been done to date. I would suggest follow what has been mentioned previously and only make changes which fix bugs.

We can fix the parser post-commit by adding code supporting two parsing methods simultaneously.


By: rthrash (rthrash) 2004-04-27 00:34:21

Almost everything works with Advanced9. With my config line as follows:

107 => 1111,Thrash Ryan,rthrash@studiovertex.com,21411122222@tmomail.net,|tz=central|attach=yes|saycid=no|dialout=international|callback=international|review=yes|operator=yes

It still says the call envelope (despite saycid=no). The other options seem to work well.

(My name is purposefully reversed to use with a custom prompt for directory by first name. )

By: twisted (twisted) 2004-04-27 03:14:27

the envelope option under advanced options is supposed to work despite saycid=no
that option only determines if CID info is said at the beginning of the message.

By: sbingner (sbingner) 2004-04-27 06:03:06

durationfix2.diff contains a modified version of what I did in patch 1282.  It adds a centralized subroutine to delete voicemail, since we never seem to be able to remember to delete the txtfile.  It also corrects the calculation of the duration, by not timing it from the beginning of the call to play_and_prepend to the end, but rather only during the record section of play_and_record.  Previously this was causing the calculations to be off by whatever the length of the file played was.

By: rthrash (rthrash) 2004-04-27 10:07:39

twisted, envelope still plays during "regular" (not option 3) times with saycid=no in my config. e-mail me if you'd like more info... address is correct above

By: hwstar (hwstar) 2004-04-27 12:59:50

Regarding the problem with saycid:

I took a quick look at the code and it should be ok, unless there's something really subtle I overlooked. I'm not at home near my development system so I can't test anything.

Can anyone confirm that if saycid is set to "no", and asterisk is restarted, that the caller's number announced at the beginning the message played despite the "saycid=no" setting?

In other words if you perform the following steps is it still broke:

1. Edit Voicemail.conf to read saycid=no.
2. Restart Asterisk.
3. Leave a voice mail message
4. Enter voicemail and play the message back noting if CID is or is not announced.


By: cmslaght (cmslaght) 2004-04-27 13:07:54

I use MySQl with my voicemail but have all the patches listed above.  I tested "saycid=yes" and it worked then I switched it to "no" and it no longer played the cid before the message.  This was the case for old messages as well as new messages.

Running Redhat 9, Yesterdays CVS, Advanced 9.

edited on: 04-27-04 12:06

By: sbingner (sbingner) 2004-04-27 15:01:26

this isn't a bug, but it still seems that voicemail should jump to the next message when a message is deleted, rather than waiting for you to press 6 to move to next message...  other than my previous post I have not encountered any problems and I can confirm that at least new messages do not play CID on my system when saycid=yes is not set.   Also, on the subject of the config I think we need to get these features in ASAP, but the config syntax should be changed in the future

By: rthrash (rthrash) 2004-04-27 15:14:04

OK, it is not playing the envelope. It is playing the "first message at 2 oh 4 PM" part in front of the message. That's what I was confusing with the envelope. It just omits the caller's number. Can the date/time be played after the actual message? Or not at all with a prompt for hearing the date/time?

I also agree about going to next message after deleting messages.

Nice work!

By: hwstar (hwstar) 2004-04-27 16:21:16


Are these enhancements/changes worthy enough to hold up the commit? I personally would think they can wait. After all, voicemail has worked this way prior to the incorporation of the advanced feature set. There are a lot of users waiting for this to be incorporated into the code base. If there is something truly broke lets report it so it gets fixed. It's a bit late in the game now for new enhancements.


By: rthrash (rthrash) 2004-04-27 16:38:41

Absolutely NO reason to hold up a commit. Finally the folks can learn the secret behind the "press 3 for advanced options" prompt!

I would get a new recording for the Press 3 prompt, though... scratchy/quantitized/staticy/whatever...

From an implementation standpoint, it would be a good idea for those that are less *-proficient and/or context-saavy to have an outbound calling from voicemail security primer. (in fact, it'd probably be good to have someone point to or elaborate on http://www.voip-info.org/wiki-Asterisk+security+dialplan)

By: cmslaght (cmslaght) 2004-04-27 16:40:08

I disagree with the delete and move on but have a suggestion.  I just ran into this today where I accidently deleted a voicemail to quickly and because it did not go to the next message automatically I was able to listen to it again even though it was "deleted".  Now, the suggestion, which would be a patch, would be to have a "Express Mode" where the voicemail system assumes that you know the keys.  Basically, as soon as you log into voicemail, it begins playing the first unheard message.

By: flavour (flavour) 2004-04-27 17:00:47

I like the idea of "delete & move on" - it feels more natural to me - can always go back to re-hear if deleting accidentally. However I agree that this should be a sepatrate BugID in order not to slow down integration of this one.
I like the idea of 'Express Mode' - again should be another BugID, though...

By: bradster (bradster) 2004-04-27 17:16:23

I do agree that some user interface behavior options would be nice, especially as configurable options. Like move on after delete/save, playing the prompts in the order of what you're probably trying to accomplish rather than numerical order, perhaps even configuring what keys do what. BUT... another day, once this bug is committed.

By: Mark Spencer (markster) 2004-04-27 17:33:49

I don't want "//" for comment characters, please use /* */ or #if 0 to comment out large blocks.

By: sbingner (sbingner) 2004-04-27 19:16:51

I have no problem with this being committed as it is, I have found nothing that decreases the current functionality.  The bug I listed currently exists, and bigid 1282 will still be there if this is committed.  I just thought this was a good place to point out that there still is a bug ;)

Delete and move on can be added later, if it's not done here, I'll do up a patch for it once this is integrated.  Remember, even if you move on you can still go to last message if it was deleted accidently... messages are not actually deleted until the voicemail session ends

By: twisted (twisted) 2004-04-27 21:37:37

advanced10full.tar.gz is done, which now allows all of the options in the config to be set globally, in the [general] section.  Tested and works, also, markster, cleaned up the code as you requested.  Tested against clean cvs as of tonight, and it works beautifully.  With no options set, the following are the only changes to the existing functionality:

* User now hears "press 3 for advanced options" during options menu
* in the advanced options menu, they have the option to reply.

Those are the only differences between non-configured w/patch and standard vm.  
Note: the reply option only works if the sender has a voicemail box on the system.

By: twisted (twisted) 2004-04-27 21:38:10

As of advanced10, this patch is fully ready for CVS submission.

By: hwstar (hwstar) 2004-04-27 22:01:51


The Advanced10 patch is working with my voicemail settings documented in the bugnote above. Thanks for turning it around so quickly!!


By: Mark Spencer (markster) 2004-04-28 00:27:35

Added to CVS