[Home]

Summary:ASTERISK-01428: [patch] ast_say_digit_str aborts when non-digit characters are in the string
Reporter:hwstar (hwstar)Labels:
Date Opened:2004-04-18 20:47:42Date Closed:2004-09-25 02:17:33
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) say-digits-fix.patch
Description:While testing the enhanced voicemail features (Bug 156) someone mentioned that if there were non-digit characters in the digit string passed to the function ast_say_digit_str(),
the function would abort mid-string. A better approach would be to skip over the offending characters and process the entire string from beginning to end. This way the digit string can be said in its entirety without getting aborted prematurely.

****** ADDITIONAL INFORMATION ******

The attached patch file makes a 3 line change to say.c to check for valid digits before attempting to stream them.
The patch function will only accept {0-9,*,#}. All other characters will be skipped over.

This patch can be easily tested by using the builtin SayDigits app.
Comments:By: Olle Johansson (oej) 2004-04-24 16:53:54

As a precaution, please confirm that you've sent a disclaimer, even if this is a small patch.

Also, could you add the plus sign as a valid character for saydigits? It's often included in a phone number string. If you do, I'll remove it from my massive say.c patch in ASTERISK-1414 to keep it a bit more clean.

By: hwstar (hwstar) 2004-04-24 22:59:30

Disclaimer sent in a few months ago for bug 603.

I'm curious why the plus sign needs to be included? Who uses it in telephone number strings?

I'll be able to fix this (add the plus sign) in a couple of days as I am quite far removed from my development system at the moment.

Steve.

By: hwstar (hwstar) 2004-04-25 23:52:13

oej-

What file should be played in /var/lib/asterisk/sounds/digits when the plus sign is seen in the digit string?

Steve.

By: twisted (twisted) 2004-04-28 01:17:11

Added to CVS along with 1483.