[SIPForum-discussion] Codec Prefrence Option

Manpreet Singh msingh at ibasis.net
Fri May 16 21:10:55 UTC 2008

if you send single codec which matches, then thats the final answer.
This would mean answerer wants to do that for media stream. Offerer
should not sent another invite to change it for the reason it didnt
match the preference. The answerer might only support one codec as a
match which is good.


From: Shakil, Rashid [mailto:rshakil at Covad.COM] 
Sent: Friday, May 16, 2008 4:47 PM
To: Shakil, Rashid; Manpreet Singh; discussion at sipforum.org
Subject: RE: [SIPForum-discussion] Codec Prefrence Option

Sorry let me re-phrase it if the offerer preference takes precedence
then sending a single or multiple choices in 200OK wouldn't matter. The
only way I can avoid the RE-INVITE is by having offrere setting up only
one codec instead of multiple choices. Please correct me if I phrase it


-----Original Message-----
From: Shakil, Rashid 
Sent: Friday, May 16, 2008 4:41 PM
To: 'Manpreet Singh'; discussion at sipforum.org
Subject: RE: [SIPForum-discussion] Codec Prefrence Option




Thanks for the comprehensive reply. The goal which is to negotiate media
over to G729 and by reading the specs I came to the conclusion that the
only way I can avoid the RE-INVITE is by answering the specific codec in
my case 729 only with 200 OK.




Rashid Shakil.


-----Original Message-----
From: Manpreet Singh [mailto:msingh at ibasis.net] 
Sent: Friday, May 16, 2008 4:13 PM
To: Shakil, Rashid; discussion at sipforum.org
Subject: RE: [SIPForum-discussion] Codec Prefrence Option




The flow is valid and usually what the offerer do also. Check section
10.2 of rfc 3264 and you will get your answer. When the answer carries a
list of codec, the original offerer would "usually" send a new offer
with a single codec to negotiate down to one. This is usually done when
the UAS wants to include all in the answer and let offerer decide what
it wants/prefers. The preference in the 200OK doesnt drive the codec
selection but what comes in INVITE or offer does. ( in your case )
Answer is the preference local to answerer but offerer picks the


In SIP, the offerer preference takes precedence. In H323 world, the so
called answerer preference takes precedence. Its the recommended way. In
your case if you include all codecs, it would mean your switch should be
ready to listen on those media streams anytime in the session. Not sure
if thats what your intention is? So if you want to use your preferred
one, I would say only include one media stream for simplicity in the


>From spec something about preference.


 Although the answerer MAY list the formats in their desired order of
   preference, it is RECOMMENDED that unless there is a specific reason,
   the answerer list formats in the same relative order they were
   present in the offer.  In other words, if a stream in the offer lists
   audio codecs 8, 22 and 48, in that order, and the answerer only
   supports codecs 8 and 48, it is RECOMMENDED that, if the answerer has

   no reason to change it, the ordering of codecs in the answer be 8,
   48, and not 48, 8.  This helps assure that the same codec is used in
   both directions.


Hope it help




From: discussion-bounces at sipforum.org
[mailto:discussion-bounces at sipforum.org] On Behalf Of Shakil, Rashid
Sent: Friday, May 16, 2008 3:57 PM
To: discussion at sipforum.org
Subject: [SIPForum-discussion] Codec Prefrence Option


I came across to this situation where we receive inbound call the codec
preference set on the SIP INVITE is 711 first and 729 second (m=audio
50000 RTP/AVP 0 18 100) when our softswitch reply back with a 200 OK
with SDP we set the preference as 729 first and 711 second (m=audio 3006
RTP/AVP 18 0 100). Instead of cutting the media over to 729 (means
select this as a codec because the 200 OK has 729 set as preference and
initial INVITE has both options) The peering partner sends a RE-INVITE
with 729 as the only option (a=rtpmap:18 G729/8000).


My question is this legal in SIP. Is codec can be negotiated that way as
well. I thought that carrier should negotiate the codec base on the
preference my Softswitch set on 200 OK





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sipforum.org/pipermail/discussion/attachments/20080516/80083f2a/attachment-0002.html>

More information about the discussion mailing list