[Home]

Summary:ASTERISK-06403: Codec order is not working ok
Reporter:Alvaro Palma (alvaro_palma_aste)Labels:
Date Opened:2006-02-23 08:37:02.000-0600Date Closed:2011-06-07 14:10:12
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Core/CodecInterface
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:I'm communicating a softphone (SJPhone) to a Grandstream phone GXP-2000.
The codec order on each one is the next:

SJPhone: GSM - iLBC - PCMA - PCMU
GXP2000: G729 - GSM - PCMA - PCMU

(I have a G729 license, so there's no problem with transcoding G729)

In my sip.conf, I've defined the following codec order:

disallow=all
allow=g729
allow=gsm
allow=g726
allow=alaw
allow=ulaw

And my peers shows this order correctly:

Codecs       : 0x11e (gsm|ulaw|alaw|g726|g729)
Codec Order  : (g729,gsm,g726,alaw,ulaw)

Canreinvite is set to NO.

But, if I initiate a call from the softphone to GXP-2000, Asterisk
always to the GXP phone GSM as the first codec choice, instead of G729,
as I could check with ethereal running in the same server than Asterisk.
The SIP INVITE from Asterisk to GXP looks like

*****************************************************************
Request-Line: INVITE sip:5805907@192.168.1.105;user=phone SIP/2.0
Message Header
Message body
   Session Description Protocol
       Session Description Protocol Version (v): 0
       Owner/Creator, Session Id (o): root 27682 27682 IN IP4 192.168.1.2
       Session Name (s): session
       Connection Information (c): IN IP4 192.168.1.2
       Time Description, active time (t): 0 0
       Media Description, name and address (m): audio 14224 RTP/AVP 3 18 111 8 0
           Media Type: audio
           Media Port: 14224
           Media Proto: RTP/AVP
           Media Format: GSM 06.10
           Media Format: ITU-T G.729
           Media Format: 111
           Media Format: ITU-T G.711 PCMA
           Media Format: ITU-T G.711 PCMU
       Media Attribute (a): rtpmap:3 GSM/8000
           Media Attribute Fieldname: rtpmap
           Media Attribute Value: 3 GSM/8000
       Media Attribute (a): rtpmap:18 G729/8000
           Media Attribute Fieldname: rtpmap
           Media Attribute Value: 18 G729/8000
       Media Attribute (a): fmtp:18 annexb=no
           Media Attribute Fieldname: fmtp
           Media Attribute Value: 18 annexb=no
       Media Attribute (a): rtpmap:111 G726-32/8000
           Media Attribute Fieldname: rtpmap
           Media Attribute Value: 111 G726-32/8000
       Media Attribute (a): rtpmap:8 PCMA/8000
           Media Attribute Fieldname: rtpmap
           Media Attribute Value: 8 PCMA/8000
       Media Attribute (a): rtpmap:0 PCMU/8000
           Media Attribute Fieldname: rtpmap
           Media Attribute Value: 0 PCMU/8000
       Media Attribute (a): silenceSupp:off - - - -
           Media Attribute Fieldname: silenceSupp
           Media Attribute Value: off - - - -
*****************************************************************

So it can be clearly seen how GSM is before G729.
Comments:By: Serge Vecher (serge-v) 2006-02-23 08:59:50.000-0600

alvaro: there is a new codec negotiation algorithm that is being developed in http://bugs.digium.com/view.php?id=4825. Please test the latest patch there to see if it helps your cause.

By: Olle Johansson (oej) 2006-04-04 08:50:41

Well, that is the order coded inside Asterisk. GSM is preferred if you allow that.