Summary:ASTERISK-14322: Drawn out and static audio on inbound iax2 calls
Reporter:Avi Deitcher (deitch)Labels:
Date Opened:2009-06-16 17:49:25Date Closed:2009-07-13 14:02:53
Versions:Frequency of
Description:Calls that are inbound on a DID, to which Asterisk has registered using iax2, have terribly drawn out audio and a lot of static for prerecorded files (e.g. IVR and Voicemail files in /var/lib/asterisk/sounds). They sound like:
".... hhhheeeellllllloooooo..... Yyyyyyoooouuuu hhhhaaaavvvveeee " etc.

Specific details:
1) This occurs only on IAX2, not on SIP. I have tried with the exact same providers, on the same hosts
2) jitterbuffer is off. If I turn jitterbuffer on, no audio at all is audible.
3) This occurs across two completely separate providers, one in Israel, one in the US. However, inbound from the ITSPs directly to an IAX2 softphone (e.g. JackenIAX or Zoiper) work perfectly fine.
4) This occurs only when communicating to Asterisk. If the dialer enters an extension, and is thus connected over Asterisk to a SIP softphone, there is no problem.
5) This occurs independent of codec. I have the original outbound files converted to both ulaw and gsm, and it occurs in both cases. The provider prefers ulaw.
6) CPU usage by Asterisk remains extremely low during the bad output.


iax2 show netstats during a call with the US provider:
                               -------- LOCAL ---------------------  -------- REMOTE --------------------
Channel                    RTT  Jit  Del  Lost   %  Drop  OOO  Kpkts  Jit  Del  Lost   %  Drop  OOO  Kpkts
IAX2/xxxx            12   -1    0    -1  -1     0   -1      2    0   40     0   0     0    0      0

And during a call with the Israeli provider:
                               -------- LOCAL ---------------------  -------- REMOTE --------------------
Channel                    RTT  Jit  Del  Lost   %  Drop  OOO  Kpkts  Jit  Del  Lost   %  Drop  OOO  Kpkts
IAX2/xxxx      1000   -1    0    -1  -1     0   -1      0    0    0     0   0     0    0      0

verbose output:
   -- Executing [s@ivr-3:9] Set("IAX2/voipms-8303", "TIMEOUT(digit)=3") in new stack
   -- Digit timeout set to 3.000
   -- Executing [s@ivr-3:10] Set("IAX2/voipms-8303", "TIMEOUT(response)=5") in new stack
   -- Response timeout set to 5.000
   -- Executing [s@ivr-3:11] Set("IAX2/voipms-8303", "__IVR_RETVM=") in new stack
   -- Executing [s@ivr-3:12] ExecIf("IAX2/voipms-8303", "1?Background(custom/AtomicMain)") in new stack
   -- <IAX2/voipms-8303> Playing 'custom/AtomicMain.ulaw' (language 'en')
   -- Executing [s@ivr-3:9] Set("IAX2/voipms-99", "TIMEOUT(digit)=3") in new stack
   -- Digit timeout set to 3.000
   -- Executing [s@ivr-3:10] Set("IAX2/voipms-99", "TIMEOUT(response)=5") in new stack
   -- Response timeout set to 5.000
   -- Executing [s@ivr-3:11] Set("IAX2/voipms-99", "__IVR_RETVM=") in new stack
   -- Executing [s@ivr-3:12] ExecIf("IAX2/voipms-99", "1?Background(custom/AtomicMain)") in new stack
   -- <IAX2/voipms-99> Playing 'custom/AtomicMain.ulaw' (language 'en')

And some iax2 debug output:
Rx-Frame Retry[ No] -- OSeqno: 000 ISeqno: 000 Type: IAX     Subclass: NEW    
  Timestamp: 00007ms  SCall: 05091  DCall: 00000 []
  VERSION         : 2
  CALLED NUMBER   : 9147216182
  CODEC_PREFS     : ()
  CALLING NUMBER  : 7184321360
  CALLING NAME    : 7184321360
  LANGUAGE        : en
  USERNAME        : voipms
  FORMAT          : 4
  CAPABILITY      : 4194303
  ADSICPE         : 2
  DATE TIME       : 2009-06-16  18:31:16

Tx-Frame Retry[000] -- OSeqno: 000 ISeqno: 001 Type: IAX     Subclass: AUTHREQ
  Timestamp: 00011ms  SCall: 13325  DCall: 05091 []
  CHALLENGE       : xxxxxxxxx
  USERNAME        : xxxx

Rx-Frame Retry[ No] -- OSeqno: 001 ISeqno: 001 Type: IAX     Subclass: AUTHREP
  Timestamp: 00026ms  SCall: 05091  DCall: 13325 []
  MD5 RESULT      : 56174ae8fb4768c1eb948f80f23ec00b

   -- Accepting AUTHENTICATED call from
      > requested format = ulaw,
      > requested prefs = (),
      > actual format = ulaw,
      > host prefs = (ulaw|ilbc|gsm),
      > priority = mine
   -- Executing [9147216182@from-trunk:1] Set("IAX2/xxxx", "__FROM_DID=9147216182") in new stack

Comments:By: Leif Madsen (lmadsen) 2009-06-26 10:33:05

Assigned to dvossel to do some triage here. You may just have some comments and need to set this to Feedback. Thanks!

By: David Vossel (dvossel) 2009-06-26 16:32:37

Is this only for prerecorded sounds?  or does voice do the same?

Also, I see you are using  Have you tried any other versions to see if this issue exists in them as well?

By: Avi Deitcher (deitch) 2009-06-26 16:40:11

Would I look too much like a dope if I honestly said, "no"? :-)

Seriously, with all the various versions, and the need to figure out how to install multiple concurrently, as well as not trash my existing installation, I did not even try. By default, the installation goes to /usr/sbin/asterisk, /etc/asterisk, /var/log/asterisk, etc.

1) Which version would you recommend? An earlier 1.6.x or a 1.4.x?
2) Is there any guide for installing multiple concurrently? Hate to trash my existing version.

By: David Vossel (dvossel) 2009-06-26 17:00:41

I'd give a shot out of curiosity.  Changing to a different version really isn't that big of a deal.  Just clean out the modules, probably in usr/lib/asterisk/modules/, between installations.  Your etc/asterisk configs should stay the same unless you do a 'make samples'

Also, you didn't address my other question, does voice sound right, or is it just prerecordings that are messed up?

By: Avi Deitcher (deitch) 2009-06-27 21:46:13

OK, will do. It will probably take me a few days to get it done.

Is there any way to install two versions concurrently, i.e. each with its own install directory, like /usr/lib/asterisk-* and /etc/asterisk-*? I could chroot it, or move everything over with symlinks, but is there a more standard method?

By: Avi Deitcher (deitch) 2009-06-29 09:27:07

Oh, sorry, missed the other question.

I hate to say, I am not sure. I have been having enough problems getting audio to work, even within the internal network (standard X-Lite phone as a SIP extension, no NAT), that I cannot confirm it either way. I am trying to isolate the issues one at a time. The list was a mile long, fortunately, it is down to "only" the pre-recorded voice on IAX2, and the voice on internal SIP extensions....

By: Avi Deitcher (deitch) 2009-06-29 10:21:56

OK, is installed and configured. I couldn't use exactly the same config files, spent time changing each and every one of the ExecIf statements, and I am sure other gotchas are in there.

The audio problem does *not* exist under

1) I would like to try it under 1.6.0.x, if you can recommend a particular sub-release to use.
2) I would like to do whatever I can to help capture this problem, so it can be fixed for the core, whether it is a core bug, or something else triggered by a configuration. Either way, what can I do to help here?

Now I need to move on to figuring out my DTMF issues and my internal extension sound issues....

By: David Vossel (dvossel) 2009-07-02 14:25:23

Try, can you upload your iax.conf file?

By: Avi Deitcher (deitch) 2009-07-03 11:57:32

I will get to, but it will take a good few days.

-----BEGIN iax.conf-----

; These will all be included in the [general] context
#include iax_general_additional.conf
#include iax_general_custom.conf
#include iax_registrations_custom.conf
#include iax_registrations.conf

; These should all be expected to come after the [general] context
;iax_custom.conf is the proper place to start creating new contexts that you
;might have a need for.  Dundi IAX trunks is one example of when this file is needed.
#include iax_custom.conf
#include iax_additional.conf
;iax_custom_post.conf will allow you to modify FreePBX generated IAX setups so
;that you can add additional parameters to a auto-generated setup.
;if you have a auto-generated context of [foobar] and need to add a parameter
;to it then create this line [foobar](+) and place your additions on the next line
#include iax_custom_post.conf
-----END iax.conf-----

-----BEGIN iax_general_additional.conf-----
-----END iax_general_additional.conf-----

-----BEGIN iax_general_custom.conf
externhost=voice.atomicinc.com       ; refreshed periodically
externrefresh=180               ; change the refresh interval

-----END iax_general_custom.conf

-----BEGIN iax_registrations.conf-----
; actual logins and passwords blanked out here
-----END iax_registrations.conf-----

All of the other iax*conf files includes are essentially blank.

By: David Vossel (dvossel) 2009-07-09 12:02:45

externhost=voice.atomicinc.com ; refreshed periodically
externrefresh=180 ; change the refresh interval

The above options aren't even in configs/iax.conf.sample, so I don't believe they do anything.  Let me know how your testing of goes.  I've looked at this a bit myself and have not been able to reproduce it.

By: Avi Deitcher (deitch) 2009-07-09 21:07:01

Sure thing. I need another week or so.

By: Alec Davis (alecdavis) 2009-07-10 00:18:47

I don't see any mention of DAHDI hardware in your asterisk box to provide timing?

I have had a very similar experience with each of our sites I've setup, each site was setup before the TDM cards had arrived. Dialling into say VoicemailMain over an IAX trunk audio was long and drawn out. When hardware arrived, installed and audio was fine.

By: Avi Deitcher (deitch) 2009-07-10 07:12:34

Should it matter, if everything is over VoIP? There are no FSX (or FSO) or T1, etc. interfaces, everything is SIP or IAX2 over the Ethernet connection.

By: Alec Davis (alecdavis) 2009-07-10 14:46:36

I take that as a no dahdi hardware.

You assumption is correct, it shouldn't matter, but it seemed to matter, with SVN-trunk-r178919M installed in Feb 2009.

By: Alec Davis (alecdavis) 2009-07-13 02:49:51

Long and drawn out audio, confirmed tonight with

core2duo E2180@2.00GHZ
debian etch 2.6.18-6-686

libpri version: SVN-branch-1.4-r687
DAHDI Version: SVN-trunk-r6005
Asterisk SVN-trunk-r181371M

With hardware disabled.
/etc/dahdi/modules #wcte12xp

*CLI> timing test
Attempting to test a timer with 50 ticks per second.
Using the 'pthread' timing module for this test.
It has been 1007 milliseconds, and we got 50 timer ticks

site2*CLI> iax2 show peers
Name/Username    Host                 Mask             Port          Status
site2/site1    (S)  4569 (T)      OK (57 ms)

Audio normal after re-enable of /etc/dahdi/modules wcte12xp
restart asterisk and dahdi.

site2*CLI> timing test
Attempting to test a timer with 50 ticks per second.
Using the 'DAHDI' timing module for this test.
It has been 1019 milliseconds, and we got 51 timer ticks

By: Alec Davis (alecdavis) 2009-07-13 03:05:03

upgraded to
DAHDI Version: 2.2.0 Echo Canceller:
from http://svn.digium.com/svn/dahdi/linux/tags/2.2.0

Audio now fine, with hardware still disabled.

site2*CLI> dahdi show status
Description                              Alarms  IRQ    bpviol CRC4   Fra Codi Options  LBO
DAHDI_DUMMY/1 (source: Linux26) 1        UNCONFI 0      0      0      CAS Unk  YEL      0 db (CSU)/0-133 feet (DSX-1)

site2*CLI> timing test
Attempting to test a timer with 50 ticks per second.
Using the 'DAHDI' timing module for this test.
It has been 1018 milliseconds, and we got 51 timer ticks

By: David Vossel (dvossel) 2009-07-13 14:02:53

Issue confirmed by alecdavis as resolved after updating to DAHDI Version: 2.2.0.  Feel free to re-open if updating DAHDI does not fix this for you.