[SOLVED] noise problem with asterisk-1.6 upgrade

I just upgraded from

asterisk-1.4.21
asterisk-addons-1.4.7
zaptel-1.4.11
kernel-2.6.24-r8

to

asterisk-1.6.1.6
asterisk-addons-1.6.1.1
dahdi-2.2.0.2
kernel-2.6.30-r6
FreePBX 2.6.0.rc2.1

My PBX has a pair of Digium TDM400p pci telephone cards:

# Span 1: WCTDM/4 "Wildcard TDM400P REV I Board 5" (MASTER)
fxoks=1
echocanceller=mg2,1
fxoks=2
echocanceller=mg2,2
# channel 3, WCTDM/4/2, no module.
# channel 4, WCTDM/4/3, no module.

# Span 2: WCTDM/4 "Wildcard TDM400P REV I Board 5"
fxsks=5
echocanceller=mg2,5
fxsks=6
echocanceller=mg2,6
fxsks=7
echocanceller=mg2,7
# channel 8, WCTDM/4/3, no module.

# Global data
loadzone        = us
defaultzone     = us

I also have SNOM 360 phones (SIP)

After upgrading, I now have a noise (hissing static) problem.
If I make an internal call from one SNOM SIP extension to another (say from extension 101 to 102)
extension 101 hears good quality audio, but the receiving party hears hissing static. If I make the reverse call from 102 to 101, then extension 101 hears the hissing static but not 102.

Also if I make a call from the PSTN dahdi trunk, I hear hissing static noise when the FreePBX receptionist IVR answers the call and plays the greeting. Then when I get connected to my extension, the audio is just fine. Also, if I use an internal SIP phone to dial 7777 (simulate incoming call) I hear the same hissing.

Thanks for any ideas on where to begin troubleshooting this.

I did a diff between the freepbx base *.conf files and my dialplan’s *.conf files. Apparently, when running Gentoo’s etc-update, I inadvertently missed an #include line while merging the diff files. So I reinstalled freepbx’s four core *.conf files (extensions.conf features.conf, iax.conf, sip.conf). Now calls to/from any extension/trunk are crystal clear.

However, there is still one other problem. Calls to the IVR or to feature code extensions like *60 are noisy, as well as messages such as “I’m sorry that is an invalid extension. Please try again.” However, calls to a user’s voicemail greeting are clear. It looks like all the asterisk voice functions use the Playback function. Any ideas on what might be the problem?

using the asterisk CLI
I see that when asterisk plays any system .gsm recording, the audio is bad
e.g.

    -- Executing [*60@from-internal:1] Answer("SIP/104-b6002ae8", "") in new stack
    -- Executing [*60@from-internal:2] Wait("SIP/104-b6002ae8", "1") in new stack 
    -- Executing [*60@from-internal:3] Set("SIP/104-b6002ae8", "NumLoops=0") in new stack
    -- Executing [*60@from-internal:4] Set("SIP/104-b6002ae8", "FutureTime=1254113560") in new stack
    -- Executing [*60@from-internal:5] Playback("SIP/104-b6002ae8", "at-tone-time-exactly") in new stack
    -- <SIP/104-b6002ae8> Playing 'at-tone-time-exactly.gsm' (language 'en')                            
    -- Executing [*60@from-internal:6] GotoIf("SIP/104-b6002ae8", "1?hr24format") in new stack          
    -- Goto (from-internal,*60,9)                                                                       
    -- Executing [*60@from-internal:9] SayUnixTime("SIP/104-b6002ae8", "1254113560,,kM 'and' S 'seconds'") in new stack
    -- <SIP/104-b6002ae8> Playing 'digits/oh.gsm' (language 'en')                                                      
    -- <SIP/104-b6002ae8> Playing 'digits/50.gsm' (language 'en')                                                      
    -- <SIP/104-b6002ae8> Playing 'digits/2.gsm' (language 'en')                                                       
    -- <SIP/104-b6002ae8> Playing 'and.gsm' (language 'en')                                                            
    -- <SIP/104-b6002ae8> Playing 'digits/40.gsm' (language 'en')                                                      
    -- <SIP/104-b6002ae8> Playing 'seconds.gsm' (language 'en')

but when it plays e.g.
/var/spool/asterisk/voicemail/default/101/unavail.slin
audio is fine.

I have these codecs:

ls /usr/lib/asterisk/modules/codec*

/usr/lib/asterisk/modules/codec_a_mu.so   /usr/lib/asterisk/modules/codec_g726.so
/usr/lib/asterisk/modules/codec_adpcm.so  /usr/lib/asterisk/modules/codec_gsm.so
/usr/lib/asterisk/modules/codec_alaw.so   /usr/lib/asterisk/modules/codec_lpc10.so
/usr/lib/asterisk/modules/codec_dahdi.so  /usr/lib/asterisk/modules/codec_speex.so
/usr/lib/asterisk/modules/codec_g722.so   /usr/lib/asterisk/modules/codec_ulaw.so

and these formats

ls /usr/lib/asterisk/modules/format_*

/usr/lib/asterisk/modules/format_g723.so  /usr/lib/asterisk/modules/format_mp3.so
/usr/lib/asterisk/modules/format_g726.so  /usr/lib/asterisk/modules/format_ogg_vorbis.so
/usr/lib/asterisk/modules/format_g729.so  /usr/lib/asterisk/modules/format_pcm.so
/usr/lib/asterisk/modules/format_gsm.so   /usr/lib/asterisk/modules/format_sln.so
/usr/lib/asterisk/modules/format_h263.so  /usr/lib/asterisk/modules/format_sln16.so
/usr/lib/asterisk/modules/format_h264.so  /usr/lib/asterisk/modules/format_vox.so
/usr/lib/asterisk/modules/format_ilbc.so  /usr/lib/asterisk/modules/format_wav.so
/usr/lib/asterisk/modules/format_jpeg.so  /usr/lib/asterisk/modules/format_wav_gsm.so

I downgraded to i686-pc-linux-gnu-4.1.2
then recompiled with CFLAGS="-O2 -march=athlon-xp -pipe"
net-libs/openh323-1.18.0
dev-libs/pwlib-1.10.10-r2
net-misc/asterisk-1.6.1.6

Playback of gsm codec sounds just fine now.

I also tried both i686-pc-linux-gnu-4.2.4 and i686-pc-linux-gnu-4.3.4
but Playback of gsm is very noisy.

So I don’t know whether this is a bug in newer gcc compilers
or a bug in asterisk gsm code.