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

Rob Gagnon rob at networkip.net
Tue Sep 28 07:29:53 MST 2004


They are sent out based on which Codec bits are on or off.

Each codec is assigned one bit of a 32-bit integer.  That integer is parsed 
in order to produce the list in the SIP message.  Of course, doing it that 
way leaves no method for setting the order.

This is a constant topic in the list.  Maybe someone would want to recode 
that to use an ordered list?  :-)


----- Original Message ----- 
From: "Alex Zeffertt" <ajz at cambridgebroadband.com>
To: <asterisk-dev at lists.digium.com>
Sent: Tuesday, September 28, 2004 4:52 AM
Subject: [Asterisk-Dev] SIP - how does * decide codec order of preference


> 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
> _______________________________________________
> Asterisk-Dev mailing list
> Asterisk-Dev at lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-dev
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-dev 




More information about the asterisk-dev mailing list