Summary:ASTERISK-00129: SPEEX / ILBC not working (Xten)
Reporter:chriz (chriz)Labels:
Date Opened:2003-08-19 18:03:09Date Closed:2004-09-25 02:52:04
Versions:Frequency of
Environment:Attachments:( 0) spexxilbcfix.reg
Description:SPEXX and ILBC do not seem to work in combination with asterisk using SIP. Logs from Xlite suggest that X-Lites proposes ILBC and Spexx but Asterisk replies with gsm/a,u-law, even if xlite does not send it as a supported codec (deactivated).
Comments:By: Mark Spencer (markster) 2003-08-20 00:54:48

Have you tried enabling speex or ilbc in the sip.conf file?

allow => ilbc
allow => speex

By: chriz (chriz) 2003-08-20 07:56:16

ah, that does seem to activate the codecs (I didn't see the config switch in the documentation though).
But: Booth codecs do not seem to work. With ilbc I only hear garbage (client: xlite) and with spexx I do not hear anything at all.
I think there is a problem with the magic number mapping:

Xlite says:
o=root 15784 15784 IN IP4
c=IN IP4
t=0 0
m=audio 8594 RTP/AVP 97 110 3 0 8 101
a=rtpmap:97 iLBC/8000
a=rtpmap:110 SPEEX/8000
a=rtpmap:3 GSM/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
m=video 8128 RTP/AVP

* answers with different magic numbers for the codecs. If I change the magic number manualy in Xlite I can at least get ILBC to work with great sound quality.

Seems to be a mixup.

Another problem: If I allow ilbc and spexx, only ILBC seems to work. If I only allow spexx, (and change the magic number) Spexx works.

edited on: 08-20-03 08:32

By: chriz (chriz) 2003-08-20 09:14:04

I checked the X-Lite setting, they seem to be the ones that are wrong, posted the bug to their support forums.

-Some samples for activating the codecs in the sample sip.conf would be great.
-Spexx does not work if ILBC is also activated.

By: Mark Spencer (markster) 2003-08-20 09:37:11

Does this mean that Speex does work if iLBC is not activated?  If so it may be a problem with X-lite and Asterisk not properly negotiating codecs together.

By: chriz (chriz) 2003-08-20 11:06:02

spexx works, if ilbc is deactivated ...

m=audio 8000 RTP/AVP 110 101
a=rtpmap:110 speex/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15


o=root 15955 15955 IN IP4
c=IN IP4
t=0 0
m=audio 8600 RTP/AVP 97 110 3 0 8 101
a=rtpmap:97 iLBC/8000
a=rtpmap:110 SPEEX/8000
a=rtpmap:3 GSM/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
m=video 9410 RTP/AVP

and then they proceeding uzsing ilbc, even if xlite has not offered it ...

By: Mark Spencer (markster) 2003-08-20 15:19:46

Who is using ilbc?  xlite?  If so, then that's fine because there's nothing that requires them to use the same codec as we do.

By: chriz (chriz) 2003-08-21 20:46:52

Xten wrote in their support boards, that X-Lite/Pro should negotiate the right codec (using the text representation) even if the magic numbers are different. I don't no which side is to blame, that it does not work, without adjusting the magic numbers in X-Lite/Pro to the ones used by Asterisk.

By: chriz (chriz) 2003-08-25 05:14:05

I checked the RFC ... xten SEEMS to be right if they say, recognotion of ilbc should not be dependent on the magic number:

  If 20 ms frame size mode is used, remote iLBC encoder SHALL receive
  "mode" parameter in the SDP "a=fmtp" attribute by copying them
  directly from the MIME media type string as a semicolon separated
  with parameter=value, where parameter is "mode", and values can be
  0, 20 or 30 (where 0 stands for support of both frame size modes; 20
  stands for preferred 20 ms frame size, etc.). An example of the
  media representation in SDP for describing iLBC when 20 ms frame
  size mode is used might be:
    m=audio 49120 RTP/AVP 97
    a=rtpmap:97 iLBC/8000
    a=fmtp:97 mode=20

By: John Todd (jtodd) 2003-09-08 18:57:33

chrisz: Do you have any updates on this from xten?  I'm not clear on what the problem is that you're describing after your last notes.  But let me re-state what you said above:  I discovered that xten lite this morning would not use speex with Asterisk for some reason.  I was allowing all codecs from within sip.conf, and then restricting the xten client to using speex when xten lite made requests.  The session would establish normally using ulaw or alaw, and would ignore completely the speex limitations.  The headers look OK to me for using speex but I don't know what's happening to create a ulaw/alaw call when it actually is established.  (note: I'm checking what codec is being used by looking at "sip show channels")

Here is a sample of the INVITE sent by the XTEN device to the Asterisk server.  

Session Initiation Protocol
   Request line: INVITE sip:14101234567@foo.net SIP/2.0
   Message Header
       Via: SIP/2.0/UDP
       From: Amir <sip:3014329876@foo.net>;tag=172286895
       To: <sip:14101234567@foo.net>
       Contact: <sip:3014329876@>
       Call-ID: D2438A49-25B9-4C35-9049-497D33E4AF77@
       CSeq: 291 INVITE
       Proxy-Authorization: Digest username="3014329876",realm="asterisk",nonce="5ca231a6",response="824469e35284f9934c9771c8d1f662e1",uri="sip:14101234567@foo.net"
       Content-Type: application/sdp
       User-Agent: X-Lite build 1059
       Content-Length: 204
Session Description Protocol
   Session Description Protocol Version (v): 0
   Owner/Creator, Session Id (o): 3014329876 13862963 13862963 IN IP4
       Owner Username: 3014329876
       Session ID: 13862963
       Session Version: 13862963
       Owner Network Type: IN
       Owner Address Type: IP4
       Owner Address:
   Session Name (s): X-Lite
   Connection Information (c): IN IP4
       Connection Network Type: IN
       Connection Address Type: IP4
       Connection Address:
   Time Description, active time (t): 0 0
       Session Start Time: 0
       Session Start Time: 0
   Media Description, name and address (m): audio 8000 RTP/AVP 97 101
       Media Type: audio
       Media Port: 8000
       Media Proto: RTP/AVP
       Media Format: 97
       Media Format: 101
   Media Attribute (a): rtpmap:97 speex/8000
       Media Attribute Fieldname: rtpmap
       Media Attribute Value: 97 speex/8000
   Media Attribute (a): rtpmap:101 telephone-event/8000
       Media Attribute Fieldname: rtpmap
       Media Attribute Value: 101 telephone-event/8000
   Media Attribute (a): fmtp:101 0-15
       Media Attribute Fieldname: fmtp
       Media Attribute Value: 101 0-15

By: John Todd (jtodd) 2003-09-12 19:04:03

speex also does not work with xten's client for MacOS. The RTP session looked identical to that above.  This is an Asterisk problem with SIP and speex.

By: John Todd (jtodd) 2003-09-26 17:06:10

Identical bug reported in http://bugs.digium.com/bug_view_page.php?bug_id=0000313

By: zoa (zoa) 2004-01-09 19:12:41.000-0600

i can confirm that the registry patch for xten resolves this problem on w2k and win XP.

It works for Xlite and Xpro (several builds).
As gsm seems to be asterisk's prefered codec you need to disable gsm if you support both ilbc and gsm on your asterisk server.

I don't have speex support on my asterisk server so i cannot confirm if you need to disable speex in order to get ilbc working.

Is this registry fix sufficient (do we have any other ilbc capable hard/soft phones atm?) or does this need some patching of asterisk to follow the RFC ?

By: Brian West (bkw918) 2004-01-11 03:39:58.000-0600

Attached fix for windows registry