[asterisk-bugs] [Asterisk 0012093]: Listening to Allison voicemail prompt on SIP phone causes [pop] sounds

noreply at bugs.digium.com noreply at bugs.digium.com
Tue Mar 25 18:12:40 CDT 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=12093 
====================================================================== 
Reported By:                mustardman
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   12093
Category:                   Sounds
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
Asterisk Version:           1.4.18 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             02-27-2008 17:57 CST
Last Modified:              03-25-2008 18:12 CDT
====================================================================== 
Summary:                    Listening to Allison voicemail prompt on SIP phone
causes [pop] sounds
Description: 
This is something that has been bugging me for awhile.  I have noticed it
on multiple systems with different hardware, different brands and models of
hardphones, with and without zaptel cards, and various versions of Asterisk
in the 1.2 and 1.4 branches.

A bit hard to describe.  Using a SIP hardphone I log into my voicemail at
which point Allison says "you have x messages.....".  There are various
other prompts that exhibit the same problem that are not necessarily part
of voicemail but that is one easy to explain and reproduce one. The problem
is there is a slight 'pop' sound usually during the first syllable of each
word.  So the prompt sounds like "y[pop]ou h[pop]ave t[pop]wo
me[pop]ssages".  If I dial *43 to do an echo test and Allison says "you are
about to enter an echo test....." it's not there so it's only in certain
modes this happens.

It's relatively minor and not something people generally complain about
but it's definitely there and (at least to me) kinda makes the system seem
to be a bit less polished sounding.  I thought it had something to do with
the prompts I am using but when I play back the actual files in a sound
player I don't hear those pops.  I tried using various format prompts
including gsm, ulaw etc. but it doesn't change anything.

This problem has always been there for as long as I can remember.  Doesn't
matter what version Asterisk/Zaptel/Sounds I am using.


====================================================================== 

---------------------------------------------------------------------- 
 mustardman - 03-25-08 18:12  
---------------------------------------------------------------------- 
padulaw fixes it.  I have uploaded the same voicemail session sound after
running sounds through padulaw.  Here is the code just to make sure it's
documented.

#padulaw.c

#include <stdio.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>


#define ULAW_SILENCE 0xff
#define MS20_BYTES  160


unsigned char silence[MS20_BYTES];


void pad_file(char *);


main(int argc, char **argv)
{
    int i;
    int nfiles;


    if (argc < 2) {
        fprintf(stderr,"Usage: %s <file name> ...\n",argv[0]);
        exit(1);
    }


    nfiles = argc - 1;
    for (i = 0; i < nfiles; i++) {
        pad_file(argv[i+1]);
    }


    exit(0);
}


void
pad_file(char *fname)
{
    int fd;
    int i;
    struct stat sbuf;
    int filesize;
    int remainder;
    int nwrite;


    fd = open(fname,O_WRONLY|O_APPEND);
    if (fd < 0) {
        fprintf(stderr,"Could not open %s for writing.\n",fname);
        return;
    }


    if (fstat(fd,&sbuf) != 0) {
        fprintf(stderr,"Could not stat file %s.\n",fname);
        return;
    }


    filesize = (int) sbuf.st_size;
    remainder = filesize % MS20_BYTES;
    if (remainder == 0) {
        close(fd);
        return;
    }


    nwrite = MS20_BYTES - remainder;
    for (i = 0; i < nwrite; i++)
        silence[i] = (unsigned char)ULAW_SILENCE;


    if (write(fd,(void *)silence,nwrite) != nwrite) {
        fprintf(stderr,"Write Failure on file %s\n",fname);
        return;
    }


    close(fd);
    return;
} 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
03-25-08 18:12  mustardman     Note Added: 0084544                          
======================================================================




More information about the asterisk-bugs mailing list