Summary:ASTERISK-03835: [patch] app_voicemail - say caller name before listening to voicemail
Reporter:Matt Gibson (flewid)Labels:
Date Opened:2005-04-01 14:28:17.000-0600Date Closed:2011-06-07 14:04:59
Versions:Frequency of
Environment:Attachments:( 0) app_voicemail_cnam.patch
( 1) saycnam_patch_apr2304.patch
( 2) asterisk_say_callername_apr27-cvs.patch
Description:We have modified App Voicemail to include the ability to say the caller name following the callerid when listening to a voicemail. This comes in handy if you have one mailbox for multiple companies and you don't want your users to get confused as to who the message was left for. We are using say_character_str() because we felt that using festival wasn't the best option for overhead, and for general quality. Please provide feedback if this works for you, and if you think it's something that's worthwhile.


In order to use this you must also add the following to your voicemail.conf in /etc/asterisk

Comments:By: Matt Gibson (flewid) 2005-04-01 14:30:29.000-0600

Could a marshall please add '[PATCH]' to the subject, I forgot :)

disclaimer is on it's way.

By: () 2005-04-02 12:55:20.000-0600

Great idea, because now it acts like most cell phones do.

By: nick (nick) 2005-04-02 17:24:14.000-0600

Your patch is reversed!

By: Kevin P. Fleming (kpfleming) 2005-04-02 17:48:52.000-0600


1) As nick mentioned, the patch is backwards.

2) Do _not_ add superfluous comments that don't describe anything (all the CNAM comments).

3) Instead of copying the cid and then parsing it twice, just parse it prior to calling play_message_callerid() and play_message_callername(). In fact, you can also check for the presence of the CID/CNAM before calling them that way.

4) Code formatting does not match Asterisk coding guidelines.

5) play_message_callername() checks for (!res) but nothing above it in the function affects the value of the res variable.

By: Matt Gibson (flewid) 2005-04-03 17:23:53

Hi Guys,

Thanks for the comments - we'll be updating the patch sometime early this week with all the fixes applied.

By: Matt Gibson (flewid) 2005-04-24 05:06:34

FILE: saycnam_patch_apr2304.patch


I have done the best I can do with editing the C file to become in line with the Asterisk Coding Guidelines. I'm not really a c programmer, so for a few things I will be sending them off to a co-worker to work on. This new version compiles cleanly against April 23rd 2005 CVS-HEAD.

Answers From Before:

1. Corrected the backwards patch thing

2. Removed Superfluous commenting

3. I am not too sure how to go about this one specifically. I will pass it on to my coworker who knows C quite well and see what comes of it.

4. I tried to fix this up as much as possible.

5. I'm pretty sure I fixed this if I understood you correctly. Let me know if not.

By: Clod Patry (junky) 2005-04-24 05:48:25

In that part:
+ /* Strip off caller ID number from name */
+ ast_log(LOG_DEBUG, "VM-CNAM: composite caller name received: %s, context: %s\n", cid, context);
+ ast_callerid_parse(cid, &name, &callerid);

Why not using chan->cid.cid_name directly?

By: Matt Gibson (flewid) 2005-04-27 20:23:43

FILENAME: asterisk_say_callername_apr27-cvs.patch

The patch has been updated to work with april 27th HEAD as of 7:54pm.

Also made it use chan->cid.cid_name directly, and cleaned up the code a bit.

By: Matt Gibson (flewid) 2005-04-27 23:31:30


During testing of our newest patch, we noted that while it does work, it's giving us the wrong information.

It seems that using chan->cid.cid_name directly is for the internal caller, calling the voicemail. Not for the person calling into the system.

ie: when i call and check my voicemail, it reads me the caller number, then it reads me back my name associated with my iax or sip device. Not whomever called into the system.

Is this intended behaviour?

By: Kevin P. Fleming (kpfleming) 2005-04-29 10:57:29

Yes, you are the caller in that case, you called the VoiceMail() app to retrieve your messages. The channel cannot possibly hold the CNAM of the person who left you a message two hours ago, it has nothing to do with voicemail at all :-)

By: Kevin P. Fleming (kpfleming) 2005-04-29 10:58:08

When you have this working the way you want, please upload a final patch and remove the other ones (or as a bug marshal to do it) so we can get this moving.

By: Matt Gibson (flewid) 2005-05-09 18:16:50

Hi Kevin,

The friend of mine who was helping code this has become unavailable due to another project.

The patch works as we intended if you use saycnam_patch_apr2304.patch.

I'm no c programmer, so I have no idea if it's correct or not, but it has been functioning for us without any headaches for about a month now.  

I don't have time to teach myself C for this, so it might be best to close this bug and hope something like this gets added to VoiceMail3? I would obviously like to see this make it to 2.0 but i'm not sure if that's feasible or not :)

By: Clod Patry (junky) 2005-06-20 18:56:21

Like reporter asked, im closing it.