Summary: | ASTERISK-04439: [patch] 24h date format support on outgoing voicemail mails | ||
Reporter: | Nicklas Bondesson (lodeon) | Labels: | |
Date Opened: | 2005-06-17 21:12:43 | Date Closed: | 2008-01-15 15:40:14.000-0600 |
Priority: | Major | Regression? | No |
Status: | Closed/Complete | Components: | Applications/app_voicemail |
Versions: | Frequency of Occurrence | ||
Related Issues: | |||
Environment: | Attachments: | ( 0) app_voicemail.c-24h_vm_mail_format-0.1.patch ( 1) voicemail-20050706-2257-head.diff ( 2) voicemail-sample-config-20050707-2110-head.diff ( 3) voicemail-userdef-20050707-2044-head.diff | |
Description: | Added a new config parameter "emaildateformat" to the [general] section in voicemail.conf. It should be set to either 12/24 for which ever format you want. If not set or incorrectly set it will fall back to 12h date format. | ||
Comments: | By: Michael Jerris (mikej) 2005-06-17 21:18:50 as this is a new feature, please produce a patch for cvs head. By: Jason Parker (jparker) 2005-06-17 21:21:26 I'm doing so as we speak. By: Michael Jerris (mikej) 2005-06-17 21:33:08 Also, lodeon, please comment on the bug when you have your disclaimer sent to digium. By: Nicklas Bondesson (lodeon) 2005-06-17 22:22:31 I've tested the patch against CVS-HEAD and it works just fine. By: Nicklas Bondesson (lodeon) 2005-06-20 08:05:41 Cleaned up the code and fixed the comments etc. This diff is against the latest CVS-HEAD. By: Nicklas Bondesson (lodeon) 2005-06-20 08:19:32 I've sent in the disclaimer today as well. By: Olle Johansson (oej) 2005-07-06 08:28:09 What does the e-mail standard say? I can't find any mail that does not have 24 hour format. By: Nicklas Bondesson (lodeon) 2005-07-06 08:37:43 Just to clearify; This has nothing to do with the date format in the mail header. It's the date presented in the mail body when you have received a new voicemail. Example; "Just wanted to let you know you were just left a 0:05 long message (number 1) in mailbox n from "xyz <n>, on Wednesday, 06 July 2005 at 15:49:48, so you might want to check it when you get a chance." By: Tilghman Lesher (tilghman) 2005-07-06 13:40:46 Instead of hardcoding two different formats, why not allow the user to specify their own format to pass to strftime(3), e.g. emaildateformat=%A, %B %d, %Y at %r emaildateformat=%A, %d %B %Y at %H:%M:%S This would allow for many more formats, especially since many international formats are different from each other. By: Tilghman Lesher (tilghman) 2005-07-06 13:50:48 Also, some formatting changes need to be made: Single line for the following: } else { Indentation of case statements should be the same as the switch: switch (foo) { case 1: func(1); break; case 2: func(2); break; } There should be no line break between the end of one case and the beginning of another, unless you wish to draw special attention with a comment (e.g. like the lack of a break statement). The break statement should also be indented identically to the other statements within the case. By: Nicklas Bondesson (lodeon) 2005-07-06 17:00:05 Great idea! I have implemented this now. It defaults to 12h format, but lets you set any date format in the voicemail.conf. For 24h format you could write something like this: emaildateformat=%A, %d %B %Y at %H:%M:%S ; Set user defined date format in voicemail mails Also fixed the formating on the old patch (voicemail-20050706-2257-head.diff). Anyway, I think we should go with the (voicemail-userdef-20050706-2341-head.diff) since it's more flexible. Please review this. Nicklas By: Tilghman Lesher (tilghman) 2005-07-07 12:40:21 Okay, on your new patch, you should default the date format to the current format, rather than the date format in the header. By: Tilghman Lesher (tilghman) 2005-07-07 12:44:05 Also, the 3rd argument to strncpy() needs to be sizeof()-1, or you'll have the possibility of an unterminated string. By: Nicklas Bondesson (lodeon) 2005-07-07 13:45:47 This is now fixed. Please review. By: Nicklas Bondesson (lodeon) 2005-07-07 14:03:47 Updated the sample config as well. By: Nicklas Bondesson (lodeon) 2005-07-07 14:11:13 Changed things arround a bit (sample config) ;) By: Kevin P. Fleming (kpfleming) 2005-07-07 18:49:14 Committed to CVS HEAD, thanks! By: Digium Subversion (svnbot) 2008-01-15 15:40:14.000-0600 Repository: asterisk Revision: 6050 U trunk/apps/app_voicemail.c U trunk/configs/voicemail.conf.sample ------------------------------------------------------------------------ r6050 | kpfleming | 2008-01-15 15:40:13 -0600 (Tue, 15 Jan 2008) | 2 lines allow user-configurable date formats in voicemail message body (bug ASTERISK-4439) ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=6050 |