[asterisk-users] Re: [asterisk-dev] Questions regarding g.729 and g.711 in Asterisk

Rich Adamson radamson at routers.com
Mon Aug 7 05:37:46 MST 2006


Chan Kwang Mien wrote:
> Thanks. By setting allow=g729, sip1 was able to connect to sip2. 
> 
> Does that mean that Asterisk chooses the codec to be used between the
> Caller and Callee ? In this case, since sip1 informs Asterisk that it
> supports g.711 and g.729, Asterisk chooses g.729 since the Callee also
> supports g.729. From the SIP Messages exchange, it doesn't seem that
> Asterisk chooses the codec.
> 
> My previous setting was "allow=all". I was expecting "allow=all" to work
> since that would also imply "allow=g729", isn't it ?

This really belongs on the -users list since it doesn't deal with 
developing code. Moving it there now.

Each sip phone essentially negotiates a codec independently with 
asterisk, and not as an end-to-end conversation.

When sip1 initiates a call, it exchanges sip packets with asterisk to 
select a compatible codec.  When asterisk places the call to sip2, it 
exchanges sip packets with sip2 to select a compatible codec and it has 
nothing to do with what sip1 negotiated.

You have two choices to correct the behavior. One, change the asterisk 
definitions so as to show a preference (disallow=all, allow=g729,ulaw), 
or, two, change the sip phone's definition to prefer g729 as its first 
choice.

Even though many sip phones support multiple codecs, the negotiation is 
very simple in that it offers up its first choice codec (only), and if 
asterisk supports that first choice, that's what is used. Highly 
dependent on the sip phone manufacturers coding.




More information about the asterisk-users mailing list