[asterisk-bugs] [Asterisk 0013486]: [patch] ${VM_CALLERID} string content varies between email subject and body when callidname is NULL

Asterisk Bug Tracker noreply at bugs.digium.com
Wed Sep 17 15:43:55 CDT 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=13486 
====================================================================== 
Reported By:                tomo1657
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   13486
Category:                   Applications/app_voicemail
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
Asterisk Version:           1.6.0-rc6 
SVN Branch (only for SVN checkouts, not tarball releases): 1.6.0 
SVN Revision (number only!): 143199 
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             2008-09-15 17:49 CDT
Last Modified:              2008-09-17 15:43 CDT
====================================================================== 
Summary:                    [patch] ${VM_CALLERID} string content varies between
email subject and body when callidname is NULL
Description: 
When the calleridname is null in make_email_file(), the resulting string in
the email's custom subject and the custom body replaced by the
${VM_CALLERID} in voicemail.conf ends up different.

Conditions:
cidname: NULL
cidnum: 1234567890

Results:
In subject, ${VM_CALLERID} becomes: "" <123456890>
In body, ${VM_CALLERID} becomes: 1234567890

This is because the subject uses "enc_cidname" variable instead of tbe
"cidname" variable.
The value of "enc_cidname" is initialized to an empty string and remains
so even when "cidname" is  NULL.
Meanwhile ast_callerid_merge() function returns different values depending
on whether the "cidname" is NULL or empty string, so the ${VM_CALLERID}
replaced by it ends up being different in the subject and the body.

Fix Suggestion:

We could Pass NULL instead of "enc_cidname" to prep_email_sub_vars() when
"cidname" is also null.
This avoides changing any of the subfunctions or altering "enc_cidname"
type or value.

Line 3333 Before:
prep_email_sub_vars(ast, vmu, msgnum + 1, context, mailbox, enc_cidnum,
enc_cidname, dur, date, passdata, vmlen, cat\
egory, flag);

Line 3333 After:
prep_email_sub_vars(ast, vmu, msgnum + 1, context, mailbox, enc_cidnum,
cidname?enc_cidname:NULL, dur, date, passdata, vmlen, cat\
egory, flag);

The same change applies to Line 3355.

A patch with these two changes is included.
====================================================================== 

---------------------------------------------------------------------- 
 (0092638) Corydon76 (administrator) - 2008-09-17 15:43
 http://bugs.digium.com/view.php?id=13486#c92638 
---------------------------------------------------------------------- 
I think I'd prefer to fix it this way. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2008-09-17 15:43 Corydon76      Note Added: 0092638                          
======================================================================




More information about the asterisk-bugs mailing list