[Asterisk-Users] SIP - how does * decide codec order of preference

Alex Zeffertt ajz at cambridgebroadband.com
Fri Sep 24 06:27:07 MST 2004


Hi,

I'm a bit confused about how Asterisk decides in which order of
preference it should list the different codecs in its SDP message during
SIP call setup.

In my sip.conf [general] section I've got 

	disallow=all
	allow=gsm
	allow=ulaw
	allow=alaw

But when Asterisk bridges a call from an E1 to VoIP it sends out an
INVITE with the codecs listed in the following order of preference

	alaw, gsm, ulaw

It looks as if Asterisk is trying to minimise its work (alaw is what is
received on the E1).  Unfortunately, my requirements are to minimise
network bandwidth so I would reather it offered codecs in the order
specified in sip.conf - i.e. gsm first.

Oddly, if the call is being bridged in the opposite direction (from VoIP
to E1) and Asterisk receives an INVITE offering ulaw, alaw, and gsm (in
that order) it responds with a 200 OK offering gsm, ulaw, alaw (i.e. the
order specified in sip.conf).  In this case it respects what's in
sip.conf - overriding the order in the INVITE - and doesn't try to
minimise its workload by offering the codec used on the E1 first!

Any ideas gratefully received.


-- Alex Zeffertt
Software Engineer
Cambridge Broadband Ltd.
http://www.cambridgebroadband.com



More information about the asterisk-users mailing list